ajkh88 commented on code in PR #7481:
URL: https://github.com/apache/hbase/pull/7481#discussion_r2569605374


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionWrapperImpl.java:
##########
@@ -357,6 +359,33 @@ public void run() {
     }
   }
 
+  @Override
+  public String getTableDescriptorHash() {
+    return tableDescriptorHash;
+  }
+
+  private String computeTableDescriptorHash() {
+    try {
+      TableDescriptor tableDesc = this.region.getTableDescriptor();
+      if (tableDesc == null) {
+        return UNKNOWN;
+      }
+
+      
org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableSchema 
tableSchema =
+        
org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil.toTableSchema(tableDesc);
+      byte[] bytes = tableSchema.toByteArray();
+
+      java.security.MessageDigest digest = 
java.security.MessageDigest.getInstance("SHA-256");
+      byte[] hash = digest.digest(bytes);
+
+      return org.apache.hadoop.hbase.util.Bytes.toHex(hash);

Review Comment:
   No - I have now removed the qualification here in favour of imports



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