Galsza commented on code in PR #3788:
URL: https://github.com/apache/ozone/pull/3788#discussion_r995390828
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ozoneimpl/OzoneContainer.java:
##########
@@ -307,29 +307,27 @@ private void buildContainerSet() {
private void startContainerScrub() {
ContainerScannerConfiguration c = config.getObject(
ContainerScannerConfiguration.class);
- boolean enabled = c.isEnabled();
-
- if (!enabled) {
+ if (!c.isEnabled()) {
LOG.info("Background container scanner has been disabled.");
- } else {
- if (this.metadataScanner == null) {
- this.metadataScanner = new ContainerMetadataScanner(c, controller);
- }
- this.metadataScanner.start();
-
- if (c.getBandwidthPerVolume() == 0L) {
- LOG.warn(VOLUME_BYTES_PER_SECOND_KEY + " is set to 0, " +
- "so background container data scanner will not start.");
- return;
- }
+ return;
+ }
+ OnDemandContainerScanner.init(c, controller);
+ if (this.metadataScanner == null) {
+ this.metadataScanner = new ContainerMetadataScanner(c, controller);
+ }
+ this.metadataScanner.start();
- dataScanners = new ArrayList<>();
- for (StorageVolume v : volumeSet.getVolumesList()) {
- ContainerDataScanner s = new ContainerDataScanner(c, controller,
- (HddsVolume) v);
- s.start();
- dataScanners.add(s);
- }
+ if (c.getBandwidthPerVolume() == 0L) {
Review Comment:
Nice catch!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]