hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajeshb...@apache.org
Subject hbase git commit: HBASE-13054 Provide more tracing information for locking/latching events.(Rajeshbabu)
Date Sat, 21 Feb 2015 06:52:52 GMT
Repository: hbase
Updated Branches:
  refs/heads/0.98 2f428bf74 -> 137d5e62d


HBASE-13054 Provide more tracing information for locking/latching events.(Rajeshbabu)


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/137d5e62
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/137d5e62
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/137d5e62

Branch: refs/heads/0.98
Commit: 137d5e62dff459cf194c43bf9573aa7dd5f24330
Parents: 2f428bf
Author: Rajeshbabu Chintaguntla <rajeshbabu@apache.org>
Authored: Sat Feb 21 12:22:29 2015 +0530
Committer: Rajeshbabu Chintaguntla <rajeshbabu@apache.org>
Committed: Sat Feb 21 12:22:29 2015 +0530

----------------------------------------------------------------------
 .../apache/hadoop/hbase/io/hfile/HFileReaderV2.java    |  3 +++
 .../org/apache/hadoop/hbase/regionserver/HRegion.java  | 13 +++++++++++++
 .../org/apache/hadoop/hbase/regionserver/MemStore.java |  4 ++++
 3 files changed, 20 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/137d5e62/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java
index 321f8de..1c7c02b 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java
@@ -363,6 +363,9 @@ public class HFileReaderV2 extends AbstractHFileReader {
             if (cacheConf.shouldCacheCompressed(cachedBlock.getBlockType().getCategory()))
{
               cachedBlock = cachedBlock.unpack(hfileContext, fsBlockReader);
             }
+            if (Trace.isTracing()) {
+              traceScope.getSpan().addTimelineAnnotation("blockCacheHit");
+            }
             assert cachedBlock.isUnpacked() : "Packed block leak.";
             if (cachedBlock.getBlockType().isData()) {
               HFile.dataBlockReadCnt.incrementAndGet();

http://git-wip-us.apache.org/repos/asf/hbase/blob/137d5e62/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
index cf927c3..28ca92d 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
@@ -152,6 +152,8 @@ import org.apache.hadoop.hbase.util.Threads;
 import org.apache.hadoop.io.MultipleIOException;
 import org.apache.hadoop.util.StringUtils;
 import org.cliffc.high_scale_lib.Counter;
+import org.cloudera.htrace.Trace;
+import org.cloudera.htrace.TraceScope;
 
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Preconditions;
@@ -3681,15 +3683,26 @@ public class HRegion implements HeapSize { // , Writable{
         if (!waitForLock) {
           return null;
         }
+        TraceScope traceScope = null;
         try {
+          if (Trace.isTracing()) {
+            traceScope = Trace.startSpan("HRegion.getRowLockInternal");
+          }
           if (!existingContext.latch.await(this.rowLockWaitDuration, TimeUnit.MILLISECONDS))
{
+            if(traceScope != null) {
+              traceScope.getSpan().addTimelineAnnotation("Failed to get row lock");
+            }
             throw new IOException("Timed out waiting for lock for row: " + rowKey);
           }
+          if (traceScope != null) traceScope.close();
+          traceScope = null;
         } catch (InterruptedException ie) {
           LOG.warn("Thread interrupted waiting for lock on row: " + rowKey);
           InterruptedIOException iie = new InterruptedIOException();
           iie.initCause(ie);
           throw iie;
+        } finally {
+          if (traceScope != null) traceScope.close();
         }
       }
     }

http://git-wip-us.apache.org/repos/asf/hbase/blob/137d5e62/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java
index e365cc9..8430c1c 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java
@@ -45,6 +45,7 @@ import org.apache.hadoop.hbase.regionserver.MemStoreLAB.Allocation;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.ClassSize;
 import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;
+import org.cloudera.htrace.Trace;
 
 /**
  * The MemStore holds in-memory modifications to the Store.  Modifications
@@ -741,6 +742,9 @@ public class MemStore implements HeapSize {
         this.snapshotAllocatorAtCreation = snapshotAllocator;
         this.snapshotAllocatorAtCreation.incScannerCount();
       }
+      if (Trace.isTracing() && Trace.currentSpan() != null) {
+        Trace.currentSpan().addTimelineAnnotation("Creating MemStoreScanner");
+      }
     }
 
     private KeyValue getNext(Iterator<KeyValue> it) {


Mime
View raw message