ptlrs commented on code in PR #10419:
URL: https://github.com/apache/ozone/pull/10419#discussion_r3377530816


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/CompactionService.java:
##########
@@ -65,6 +68,16 @@ public CompactionService(OzoneManager ozoneManager, TimeUnit 
unit, long interval
     this.numCompactions = new AtomicLong(0);
     this.suspended = new AtomicBoolean(false);
     this.compactableTables = validateTables(tables);
+    int compactionType = Integer.parseInt(ozoneManager.getConfiguration().get(
+        OMConfigKeys.OZONE_OM_COMPACTION_SERVICE_BOTTOMMOSTLEVELCOMPACTION,
+        
OMConfigKeys.OZONE_OM_COMPACTION_SERVICE_BOTTOMMOSTLEVELCOMPACTION_DEFAULT));
+    ManagedCompactRangeOptions.BottommostLevelCompaction level =
+        
ManagedCompactRangeOptions.BottommostLevelCompaction.fromRocksId(compactionType);
+    if (level == null) {
+      compactionType = 
Integer.parseInt(OMConfigKeys.OZONE_OM_COMPACTION_SERVICE_BOTTOMMOSTLEVELCOMPACTION_DEFAULT);
+      level = 
ManagedCompactRangeOptions.BottommostLevelCompaction.fromRocksId(compactionType);
+    }
+    this.bottommostLevelCompaction = level;

Review Comment:
   Throwing an exception is not the right approach here. 
   We usually throw when we don't know how to or can't handle the problem when 
we get an exception.
   
   That is not the case here. Here, the solution is clear, we will use the 
default values in case of any problems.
   
   We can definitely add some extra logging to clarify this though. 



-- 
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]

Reply via email to