You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2020/09/23 00:03:17 UTC

[GitHub] [hbase] bharathv commented on a change in pull request #2440: HBASE-25082: Per table WAL metrics: appendCount and appendSize

bharathv commented on a change in pull request #2440:
URL: https://github.com/apache/hbase/pull/2440#discussion_r493099034



##########
File path: hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/MetricsWAL.java
##########
@@ -58,9 +59,10 @@ public void postSync(final long timeInNanos, final int handlerSyncs) {
   @Override
   public void postAppend(final long size, final long time, final WALKey logkey,
       final WALEdit logEdit) throws IOException {
-    source.incrementAppendCount();
+    TableName tableName = logkey.getTableName();

Review comment:
       Don't think it's optional (the test I fixed seems like an outlier). At least the protobuf based WAL implementation mandates the table name to be a required field and there are multiple other places in the code (like replication tailing etc) that assume a non-null table name. 
   
   ```
   message WALKey {
     required bytes encoded_region_name = 1;
     required bytes table_name = 2;
   ```
   
   Wish there is a better way to enforce it but using (non)nullable annotations is not a common practice in HBase code. 




----------------------------------------------------------------
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:
users@infra.apache.org