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


##########
hadoop-hdds/common/src/main/resources/ozone-default.xml:
##########
@@ -1591,6 +1591,15 @@
       If this is empty, no column families are compacted.
     </description>
   </property>
+  <property>
+    <name>ozone.om.compaction.service.bottommostlevelcompaction</name>
+    <value>0</value>
+    <tag>OZONE, OM, PERFORMANCE</tag>
+    <description>
+      Bottommost level compaction type for manual compaction.
+      Valid values: 0 (kSkip), 1 (kIfHaveCompactionFilter), 2 (kForce).

Review Comment:
   Used by both CompactionService(background) and CLI(manual). Better to remove 
manual word.



##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/OMConfigKeys.java:
##########
@@ -681,6 +681,15 @@ public final class OMConfigKeys {
   public static final String 
OZONE_OM_COMPACTION_SERVICE_COLUMNFAMILIES_DEFAULT =
       
"keyTable,fileTable,directoryTable,deletedTable,deletedDirectoryTable,multipartInfoTable,multipartPartsTable";
 
+  /**
+   * Bottommost level compaction type for manual compaction.
+   * Valid values: 0 (kSkip), 1 (kIfHaveCompactionFilter), 2 (kForce).

Review Comment:
   Also add `Invalid values fall back to the default (kSkip).`
   Future RocksDB versions may add new values (e.g., kForceOptimized=3).



##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestCompactionService.java:
##########
@@ -159,6 +163,35 @@ public void testCompactFailure() {
         () -> getCompactionService(compactTables));
   }
 
+  @Test
+  public void testDefaultCompactionLevelIsKSkip() {
+    CompactionService compactionService = 
getCompactionService(Arrays.asList("keyTable", "fileTable"));
+    assertEquals(ManagedCompactRangeOptions.BottommostLevelCompaction.kSkip,
+        compactionService.getBottommostLevelCompaction());
+  }
+
+  @Test
+  public void testConfiguredCompactionLevelKForce() {
+    OzoneConfiguration conf = new OzoneConfiguration();
+    conf.set(OZONE_OM_COMPACTION_SERVICE_BOTTOMMOSTLEVELCOMPACTION, "2");

Review Comment:
   Nit: Use `conf.setInt(` like other place.



##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestCompactionService.java:
##########
@@ -159,6 +163,35 @@ public void testCompactFailure() {
         () -> getCompactionService(compactTables));
   }
 
+  @Test
+  public void testDefaultCompactionLevelIsKSkip() {
+    CompactionService compactionService = 
getCompactionService(Arrays.asList("keyTable", "fileTable"));
+    assertEquals(ManagedCompactRangeOptions.BottommostLevelCompaction.kSkip,
+        compactionService.getBottommostLevelCompaction());
+  }
+
+  @Test
+  public void testConfiguredCompactionLevelKForce() {
+    OzoneConfiguration conf = new OzoneConfiguration();
+    conf.set(OZONE_OM_COMPACTION_SERVICE_BOTTOMMOSTLEVELCOMPACTION, "2");
+    when(ozoneManager.getConfiguration()).thenReturn(conf);
+
+    CompactionService compactionService = 
getCompactionService(Arrays.asList("keyTable", "fileTable"));
+    assertEquals(ManagedCompactRangeOptions.BottommostLevelCompaction.kForce,
+        compactionService.getBottommostLevelCompaction());
+  }
+
+  @Test
+  public void testInvalidCompactionLevelFallsBackToDefault() {
+    OzoneConfiguration conf = new OzoneConfiguration();
+    conf.set(OZONE_OM_COMPACTION_SERVICE_BOTTOMMOSTLEVELCOMPACTION, "99");

Review Comment:
   Nit: Use `conf.setInt(` like other place.



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