hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdcry...@apache.org
Subject svn commit: r1514037 - in /hbase/branches/0.95: hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/ hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/
Date Wed, 14 Aug 2013 20:50:36 GMT
Author: jdcryans
Date: Wed Aug 14 20:50:35 2013
New Revision: 1514037

URL: http://svn.apache.org/r1514037
Log:
HBASE-8719 Fix responseTooSlow formatting

Modified:
    hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
    hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcCallContext.java
    hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java
    hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java

Modified: hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java?rev=1514037&r1=1514036&r2=1514037&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
(original)
+++ hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
Wed Aug 14 20:50:35 2013
@@ -2227,10 +2227,29 @@ public final class ProtobufUtil {
       return TextFormat.shortDebugString(m);
     } else if (m instanceof MutationProto) {
       return toShortString((MutationProto)m);
+    } else if (m instanceof GetRequest) {
+      GetRequest r = (GetRequest) m;
+      return "region= " + getStringForByteString(r.getRegion().getValue()) +
+          ", row=" + getStringForByteString(r.getGet().getRow());
+    } else if (m instanceof ClientProtos.MultiRequest) {
+      ClientProtos.MultiRequest r = (ClientProtos.MultiRequest) m;
+      ClientProtos.MultiAction action = r.getActionList().get(0);
+      return "region= " + getStringForByteString(r.getRegion().getValue()) +
+          ", for " + r.getActionCount() +
+          " actions and 1st row key=" + getStringForByteString(action.hasMutation() ?
+          action.getMutation().getRow() : action.getGet().getRow());
+    } else if (m instanceof ClientProtos.MutateRequest) {
+      ClientProtos.MutateRequest r = (ClientProtos.MutateRequest) m;
+      return "region= " + getStringForByteString(r.getRegion().getValue()) +
+          ", row=" + getStringForByteString(r.getMutation().getRow());
     }
     return "TODO: " + m.getClass().toString();
   }
 
+  private static String getStringForByteString(ByteString bs) {
+    return Bytes.toStringBinary(bs.toByteArray());
+  }
+
   /**
    * Print out some subset of a MutationProto rather than all of it and its data
    * @param proto Protobuf to print out

Modified: hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcCallContext.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcCallContext.java?rev=1514037&r1=1514036&r2=1514037&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcCallContext.java
(original)
+++ hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcCallContext.java
Wed Aug 14 20:50:35 2013
@@ -24,5 +24,5 @@ public interface RpcCallContext extends 
    * If called from outside the context of IPC, this does nothing.
    * @throws CallerDisconnectedException
    */
-  void throwExceptionIfCallerDisconnected() throws CallerDisconnectedException;
+  void throwExceptionIfCallerDisconnected(String regionName) throws CallerDisconnectedException;
 }

Modified: hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java?rev=1514037&r1=1514036&r2=1514037&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java
(original)
+++ hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java
Wed Aug 14 20:50:35 2013
@@ -444,12 +444,14 @@ public class RpcServer implements RpcSer
     }
 
     @Override
-    public void throwExceptionIfCallerDisconnected() throws CallerDisconnectedException {
+    public void throwExceptionIfCallerDisconnected(String regionName)
+        throws CallerDisconnectedException {
       if (!connection.channel.isOpen()) {
         long afterTime = System.currentTimeMillis() - timestamp;
         throw new CallerDisconnectedException(
-            "Aborting call " + this + " after " + afterTime + " ms, since " +
-            "caller disconnected");
+            "Aborting on region " + regionName + ", call " +
+             this + " after " + afterTime + " ms, since " +
+             "caller disconnected");
       }
     }
 

Modified: hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java?rev=1514037&r1=1514036&r2=1514037&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
(original)
+++ hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
Wed Aug 14 20:50:35 2013
@@ -3630,7 +3630,7 @@ public class HRegion implements HeapSize
           // client might time out and disconnect while the server side
           // is still processing the request. We should abort aggressively
           // in that case.
-          rpcCall.throwExceptionIfCallerDisconnected();
+          rpcCall.throwExceptionIfCallerDisconnected(getRegionNameAsString());
         }
 
         // Let's see what we have in the storeHeap.



Mime
View raw message