Review Board 1.7.22


HBASE-4117: Slow Query Log and Client Operation FIngerprints

Review Request #1621 - Created Aug. 22, 2011 and updated

Riley Patterson
HBASE-4117
Reviewers
hbase
hbase
Exposes JSON-parseable fingerprint and details for queries that take longer than a configurable threshold time. The exposure is currently to the main regionserver log, along with a (operationTooSlow) tag which allows it to be grepped out and easily aggregated and/or monitored in administrator scripts.

The patch also provides a standard way to extract fingerprint and detail information of interest by requiring each "Operation" to provide a fingerprint map and a details map, which will be a superset of the fingerprint. 
Monitored get and put latency with and without the patch using reasonable hbase.ipc.warn.response.time settings (1000ms, 2000ms). Performance was not noticeably impacted.
/src/main/java/org/apache/hadoop/hbase/KeyValue.java
Revision 1161979 New Change
[20] 626 lines
[+20] [+] public static String keyToString(final byte [] k) {
627
    Map<String, Object> stringMap = new HashMap<String, Object>();
627
    Map<String, Object> stringMap = new HashMap<String, Object>();
628
    stringMap.put("row", Bytes.toStringBinary(getRow()));
628
    stringMap.put("row", Bytes.toStringBinary(getRow()));
629
    stringMap.put("family", Bytes.toStringBinary(getFamily()));
629
    stringMap.put("family", Bytes.toStringBinary(getFamily()));
630
    stringMap.put("qualifier", Bytes.toStringBinary(getQualifier()));
630
    stringMap.put("qualifier", Bytes.toStringBinary(getQualifier()));
631
    stringMap.put("timestamp", getTimestamp());
631
    stringMap.put("timestamp", getTimestamp());

    
   
632
    stringMap.put("vlen", getValueLength());
632
    return stringMap;
633
    return stringMap;
633
  }
634
  }
634

    
   
635

   
635
  public static String keyToString(final byte [] b, final int o, final int l) {
636
  public static String keyToString(final byte [] b, final int o, final int l) {
636
    if (b == null) return "";
637
    if (b == null) return "";
[+20] [20] 1383 lines
/src/main/java/org/apache/hadoop/hbase/client/Delete.java
Revision 1161979 New Change
 
/src/main/java/org/apache/hadoop/hbase/client/Get.java
Revision 1161979 New Change
 
/src/main/java/org/apache/hadoop/hbase/client/MultiAction.java
Revision 1161979 New Change
 
/src/main/java/org/apache/hadoop/hbase/client/MultiPut.java
Revision 1161979 New Change
 
/src/main/java/org/apache/hadoop/hbase/client/Operation.java
New File
 
/src/main/java/org/apache/hadoop/hbase/client/Put.java
Revision 1161979 New Change
 
/src/main/java/org/apache/hadoop/hbase/client/Scan.java
Revision 1161979 New Change
 
/src/main/java/org/apache/hadoop/hbase/ipc/HBaseServer.java
Revision 1161979 New Change
 
/src/main/java/org/apache/hadoop/hbase/ipc/WritableRpcEngine.java
Revision 1161979 New Change
 
/src/test/java/org/apache/hadoop/hbase/client/TestOperation.java
New File
 
  1. /src/main/java/org/apache/hadoop/hbase/KeyValue.java: Loading...
  2. /src/main/java/org/apache/hadoop/hbase/client/Delete.java: Loading...
  3. /src/main/java/org/apache/hadoop/hbase/client/Get.java: Loading...
  4. /src/main/java/org/apache/hadoop/hbase/client/MultiAction.java: Loading...
  5. /src/main/java/org/apache/hadoop/hbase/client/MultiPut.java: Loading...
  6. /src/main/java/org/apache/hadoop/hbase/client/Operation.java: Loading...
  7. /src/main/java/org/apache/hadoop/hbase/client/Put.java: Loading...
  8. /src/main/java/org/apache/hadoop/hbase/client/Scan.java: Loading...
  9. /src/main/java/org/apache/hadoop/hbase/ipc/HBaseServer.java: Loading...
  10. /src/main/java/org/apache/hadoop/hbase/ipc/WritableRpcEngine.java: Loading...
  11. /src/test/java/org/apache/hadoop/hbase/client/TestOperation.java: Loading...