You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by mb...@apache.org on 2012/09/22 14:51:34 UTC

svn commit: r1388799 - in /hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase: io/hfile/HFileReaderV2.java ipc/ProfilingData.java

Author: mbautin
Date: Sat Sep 22 12:51:34 2012
New Revision: 1388799

URL: http://svn.apache.org/viewvc?rev=1388799&view=rev
Log:
[HBASE-6215] Per-request profiling: on-disk size for the block misses

Author: liyintang

Summary:
Task #1462913:
We assume that hbase block cache misses are equal in terms of disk load, which might not be true as blocks of different type (data, bloom, index) from different CFs have different size & compression ratio.
It might be useful to also return the size of compressed data it actually reads from disk per each request.

Test Plan: Will test it on the dev cluster

Reviewers: kannan, kranganathan

Reviewed By: kranganathan

CC: hbase-eng@

Differential Revision: https://phabricator.fb.com/D580608

Task ID: 1462913

Modified:
    hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java
    hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/ipc/ProfilingData.java

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java?rev=1388799&r1=1388798&r2=1388799&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java (original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java Sat Sep 22 12:51:34 2012
@@ -324,9 +324,14 @@ public class HFileReaderV2 extends Abstr
       Call call = HRegionServer.callContext.get();
       ProfilingData pData = call == null ? null : call.getProfilingData();
       if (pData != null) {
-        pData.incInt(ProfilingData.blockMissStr(
+        pData.incInt(ProfilingData.blockMissCntStr(
             hfileBlock.getBlockType().getCategory(),
             hfileBlock.getColumnFamilyName()));
+        pData.incLong(
+            ProfilingData.blockMissOnDiskSizeStr(
+                hfileBlock.getBlockType().getCategory(),
+                hfileBlock.getColumnFamilyName()),
+            onDiskBlockSize);
         pData.incLong(ProfilingData.TOTAL_BLOCK_READ_TIME_NS, delta);
       }
       return hfileBlock;
@@ -364,7 +369,7 @@ public class HFileReaderV2 extends Abstr
           Call call = HRegionServer.callContext.get();
           ProfilingData pData = call == null ? null : call.getProfilingData();
           if (pData != null) {
-            pData.incInt(ProfilingData.blockHitStr(
+            pData.incInt(ProfilingData.blockHitCntStr(
                 cachedBlock.getBlockType().getCategory(),
                 cachedBlock.getColumnFamilyName()));
           }

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/ipc/ProfilingData.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/ipc/ProfilingData.java?rev=1388799&r1=1388798&r2=1388799&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/ipc/ProfilingData.java (original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/ipc/ProfilingData.java Sat Sep 22 12:51:34 2012
@@ -32,20 +32,27 @@ public class ProfilingData implements Wr
   public static final String CLIENT_NETWORK_LATENCY_MS = "client_network_latency.ms";
   
   /**
-   *  number of block hits on get
+   *  number of block hits cnt on get
    */
-  public static String blockHitStr(BlockType.BlockCategory cat, String cf) {
+  public static String blockHitCntStr(BlockType.BlockCategory cat, String cf) {
     return "block_hit_cnt." + cat + "." + cf;
   }
   
   /**
-   *  number of block misses on get
+   *  number of block misses cnt on get
    */
-  public static String blockMissStr(BlockType.BlockCategory cat, String cf) {
+  public static String blockMissCntStr(BlockType.BlockCategory cat, String cf) {
     return "block_miss_cnt." + cat + "." + cf;
   }
   
   /**
+   *  on-disk size for the block misses
+   */
+  public static String blockMissOnDiskSizeStr(BlockType.BlockCategory cat, String cf) {
+    return "block_miss_on_disk_size." + cat + "." + cf;
+  }
+  
+  /**
    *  total time spent reading data blocks into cache on misses
    */
   public static final String TOTAL_BLOCK_READ_TIME_NS = "total_block_read_time.ns";