Apache9 commented on a change in pull request #2326:
URL: https://github.com/apache/hbase/pull/2326#discussion_r492013532



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
##########
@@ -1741,9 +1741,10 @@ RegionLoad createRegionLoad(final HRegion r, 
RegionLoad.Builder regionLoadBldr,
       .setBlocksLocalWeight(blocksLocalWeight)
       .setBlocksLocalWithSsdWeight(blocksLocalWithSsdWeight)
       .setBlocksTotalWeight(blocksTotalWeight)
+      
.setCompactionState(ProtobufUtil.createCompactionStateForRegionLoad(r.getCompactionState()))
       .setLastMajorCompactionTs(r.getOldestHfileTs(true));
     r.setCompleteSequenceId(regionLoadBldr);
-
+    LOG.info(">>>>>>setCompactionState:{}",r.getCompactionState());

Review comment:
       Debug log?

##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
##########
@@ -3907,4 +3909,51 @@ public MetaRegionLocationCache 
getMetaRegionLocationCache() {
   public RSGroupInfoManager getRSGroupInfoManager() {
     return rsGroupInfoManager;
   }
+
+  /**
+   * Get the compaction state of the table
+   *
+   * @param tableName The table name
+   * @return CompactionState Compaction state of the table
+   */
+  public org.apache.hadoop.hbase.client.CompactionState getCompactionState(

Review comment:
       Why full class name here?

##########
File path: 
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionState.java
##########
@@ -164,10 +166,10 @@ private void compaction(final String tableName, final int 
flushes,
       long curt = System.currentTimeMillis();
       long waitTime = 5000;
       long endt = curt + waitTime;
-      CompactionState state = admin.getCompactionState(table);
+      CompactionState state = master.getCompactionState(table);

Review comment:
       I think this test is for testing the HBaseAdmin.getCompactionState so we 
should not change to use master?

##########
File path: 
hbase-client/src/main/java/org/apache/hadoop/hbase/RegionMetricsBuilder.java
##########
@@ -263,6 +268,10 @@ public RegionMetricsBuilder setBlocksTotalWeight(long 
value) {
     this.blocksTotalWeight = value;
     return this;
   }
+  public RegionMetricsBuilder setCompactionState(CompactionState 
compactionState) {
+    this.compactionState = compactionState;
+    return this;
+  }

Review comment:
       New line here?

##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
##########
@@ -3907,4 +3909,51 @@ public MetaRegionLocationCache 
getMetaRegionLocationCache() {
   public RSGroupInfoManager getRSGroupInfoManager() {
     return rsGroupInfoManager;
   }
+
+  /**
+   * Get the compaction state of the table
+   *
+   * @param tableName The table name
+   * @return CompactionState Compaction state of the table
+   */
+  public org.apache.hadoop.hbase.client.CompactionState getCompactionState(

Review comment:
       Then better not import 
org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetRegionInfoResponse.CompactionState
 directly? Import 
org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetRegionInfoResponse,
 and then use GetRegionInfoResponse.CompactionState to reference the protobuf 
message.




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to