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


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/CompactDBUtil.java:
##########
@@ -38,13 +40,13 @@ public final class CompactDBUtil {
   private CompactDBUtil() {
   }
 
-  public static void compactTable(OMMetadataManager omMetadataManager,
-                                  String tableName) throws IOException {
+  public static void compactTable(OMMetadataManager omMetadataManager, String 
tableName,
+      ManagedCompactRangeOptions.BottommostLevelCompaction compactionType) 
throws IOException {
     long startTime = Time.monotonicNow();
-    LOG.info("Compacting column family: {}", tableName);
     try (ManagedCompactRangeOptions options = new 
ManagedCompactRangeOptions()) {
-      options.setBottommostLevelCompaction(
-          ManagedCompactRangeOptions.BottommostLevelCompaction.kForce);
+      options.setBottommostLevelCompaction(compactionType);
+      LOG.info("Compacting column family: {} with {} bottommostlevel 
compaction",

Review Comment:
   Nit: in the logging, can use `bottom most level compaction` for readability.



##########
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).
+   * Refer to {@code 
org.rocksdb.CompactRangeOptions.BottommostLevelCompaction}.
+   */
+  public static final String 
OZONE_OM_COMPACTION_SERVICE_BOTTOMMOSTLEVELCOMPACTION =

Review Comment:
   You can define this as Int and then you can call `conf.getInt` as you are 
already converting string to int yourself 
[below](https://github.com/apache/ozone/pull/10419/changes#diff-3142f862b803f3df9de5e0aa4e0d51b7e0d603e9ba84fa853ef2562f82a3c6daR81-R88).



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