Apache9 commented on code in PR #7410:
URL: https://github.com/apache/hbase/pull/7410#discussion_r2483748524


##########
hbase-client/src/main/java/org/apache/hadoop/hbase/client/RawAsyncHBaseAdmin.java:
##########
@@ -1316,19 +1316,52 @@ private CompletableFuture<Void> compact(TableName 
tableName, byte[] columnFamily
 
     switch (compactType) {
       case MOB:
-        addListener(connection.registry.getActiveMaster(), (serverName, err) 
-> {
+        addListener(getDescriptor(tableName), (tableDesc, err) -> {
           if (err != null) {
             future.completeExceptionally(err);
             return;
           }
-          RegionInfo regionInfo = RegionInfo.createMobRegionInfo(tableName);
-          addListener(compact(serverName, regionInfo, major, columnFamily), 
(ret, err2) -> {
-            if (err2 != null) {
-              future.completeExceptionally(err2);
-            } else {
-              future.complete(ret);
-            }
-          });
+          List<ColumnFamilyDescriptor> mobColumnFamilies =
+            Arrays.stream(tableDesc.getColumnFamilies())
+              .filter(ColumnFamilyDescriptor::isMobEnabled).toList();
+          if (mobColumnFamilies.isEmpty()) {
+            // It's not a mob table, nothing to do.
+            future.complete(null);
+            return;
+          }
+          if (columnFamily == null) {

Review Comment:
   Seems here we added bunch of code related to MOB feature? What is the 
implementation on branch-2 for sync HBaseAdmin?



##########
hbase-client/src/main/java/org/apache/hadoop/hbase/client/RawAsyncHBaseAdmin.java:
##########
@@ -1339,6 +1372,7 @@ private CompletableFuture<Void> compact(TableName 
tableName, byte[] columnFamily
           }
           if (locations == null || locations.isEmpty()) {
             future.completeExceptionally(new 
TableNotFoundException(tableName));
+            return;

Review Comment:
   This should be a separated bug? We can fix this first?



##########
hbase-client/src/main/java/org/apache/hadoop/hbase/client/RawAsyncHBaseAdmin.java:
##########
@@ -1316,19 +1316,52 @@ private CompletableFuture<Void> compact(TableName 
tableName, byte[] columnFamily
 
     switch (compactType) {
       case MOB:
-        addListener(connection.registry.getActiveMaster(), (serverName, err) 
-> {
+        addListener(getDescriptor(tableName), (tableDesc, err) -> {
           if (err != null) {
             future.completeExceptionally(err);
             return;
           }
-          RegionInfo regionInfo = RegionInfo.createMobRegionInfo(tableName);
-          addListener(compact(serverName, regionInfo, major, columnFamily), 
(ret, err2) -> {
-            if (err2 != null) {
-              future.completeExceptionally(err2);
-            } else {
-              future.complete(ret);
-            }
-          });
+          List<ColumnFamilyDescriptor> mobColumnFamilies =
+            Arrays.stream(tableDesc.getColumnFamilies())
+              .filter(ColumnFamilyDescriptor::isMobEnabled).toList();

Review Comment:
   I do not think toList is available in java 8?



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

Reply via email to