hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1478639 [4/10] - in /hbase/branches/0.95: hbase-client/src/main/java/org/apache/hadoop/hbase/ hbase-client/src/main/java/org/apache/hadoop/hbase/catalog/ hbase-client/src/main/java/org/apache/hadoop/hbase/client/ hbase-client/src/main/java...
Date Fri, 03 May 2013 03:58:35 GMT
Modified: hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java?rev=1478639&r1=1478638&r2=1478639&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java
(original)
+++ hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java
Fri May  3 03:58:33 2013
@@ -34,7 +34,6 @@ import org.apache.hadoop.hbase.HTableDes
 import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.KeyValueUtil;
 import org.apache.hadoop.hbase.ServerName;
-import org.apache.hadoop.hbase.client.HConnectionManager.HConnectable;
 import org.apache.hadoop.hbase.client.coprocessor.Batch;
 import org.apache.hadoop.hbase.filter.BinaryComparator;
 import org.apache.hadoop.hbase.ipc.CoprocessorRpcChannel;
@@ -534,7 +533,7 @@ public class HTable implements HTableInt
    throws IOException {
      return new ServerCallable<Result>(connection, tableName, row, operationTimeout)
{
        public Result call() throws IOException {
-         return ProtobufUtil.getRowOrBefore(server,
+         return ProtobufUtil.getRowOrBefore(stub,
            location.getRegionInfo().getRegionName(), row, family);
        }
      }.withRetries();
@@ -580,7 +579,7 @@ public class HTable implements HTableInt
   public Result get(final Get get) throws IOException {
     return new ServerCallable<Result>(connection, tableName, get.getRow(), operationTimeout)
{
           public Result call() throws IOException {
-            return ProtobufUtil.get(server,
+            return ProtobufUtil.get(stub,
               location.getRegionInfo().getRegionName(), get);
           }
         }.withRetries();
@@ -649,7 +648,7 @@ public class HTable implements HTableInt
             try {
               MutateRequest request = RequestConverter.buildMutateRequest(
                 location.getRegionInfo().getRegionName(), delete);
-              MutateResponse response = server.mutate(null, request);
+              MutateResponse response = stub.mutate(null, request);
               return Boolean.valueOf(response.getProcessed());
             } catch (ServiceException se) {
               throw ProtobufUtil.getRemoteException(se);
@@ -726,7 +725,7 @@ public class HTable implements HTableInt
         try {
           MultiRequest request = RequestConverter.buildMultiRequest(
             location.getRegionInfo().getRegionName(), rm);
-          server.multi(null, request);
+          stub.multi(null, request);
         } catch (ServiceException se) {
           throw ProtobufUtil.getRemoteException(se);
         }
@@ -751,7 +750,7 @@ public class HTable implements HTableInt
                 location.getRegionInfo().getRegionName(), append);
               PayloadCarryingRpcController rpcController =
                 new PayloadCarryingRpcController();
-              MutateResponse response = server.mutate(rpcController, request);
+              MutateResponse response = stub.mutate(rpcController, request);
               if (!response.hasResult()) return null;
               return ProtobufUtil.toResult(response.getResult(), rpcController.cellScanner());
             } catch (ServiceException se) {
@@ -776,7 +775,7 @@ public class HTable implements HTableInt
               MutateRequest request = RequestConverter.buildMutateRequest(
                 location.getRegionInfo().getRegionName(), increment);
               PayloadCarryingRpcController rpcContoller = new PayloadCarryingRpcController();
-              MutateResponse response = server.mutate(rpcContoller, request);
+              MutateResponse response = stub.mutate(rpcContoller, request);
               return ProtobufUtil.toResult(response.getResult(), rpcContoller.cellScanner());
             } catch (ServiceException se) {
               throw ProtobufUtil.getRemoteException(se);
@@ -821,7 +820,7 @@ public class HTable implements HTableInt
                 location.getRegionInfo().getRegionName(), row, family,
                 qualifier, amount, durability);
               PayloadCarryingRpcController rpcController = new PayloadCarryingRpcController();
-              MutateResponse response = server.mutate(rpcController, request);
+              MutateResponse response = stub.mutate(rpcController, request);
               Result result =
                 ProtobufUtil.toResult(response.getResult(), rpcController.cellScanner());
               return Long.valueOf(Bytes.toLong(result.getValue(family, qualifier)));
@@ -846,7 +845,7 @@ public class HTable implements HTableInt
               MutateRequest request = RequestConverter.buildMutateRequest(
                 location.getRegionInfo().getRegionName(), row, family, qualifier,
                 new BinaryComparator(value), CompareType.EQUAL, put);
-              MutateResponse response = server.mutate(null, request);
+              MutateResponse response = stub.mutate(null, request);
               return Boolean.valueOf(response.getProcessed());
             } catch (ServiceException se) {
               throw ProtobufUtil.getRemoteException(se);
@@ -870,7 +869,7 @@ public class HTable implements HTableInt
               MutateRequest request = RequestConverter.buildMutateRequest(
                 location.getRegionInfo().getRegionName(), row, family, qualifier,
                 new BinaryComparator(value), CompareType.EQUAL, delete);
-              MutateResponse response = server.mutate(null, request);
+              MutateResponse response = stub.mutate(null, request);
               return Boolean.valueOf(response.getProcessed());
             } catch (ServiceException se) {
               throw ProtobufUtil.getRemoteException(se);
@@ -889,7 +888,7 @@ public class HTable implements HTableInt
             try {
               GetRequest request = RequestConverter.buildGetRequest(
                   location.getRegionInfo().getRegionName(), get, true);
-              GetResponse response = server.get(null, request);
+              GetResponse response = stub.get(null, request);
               return response.getExists();
             } catch (ServiceException se) {
               throw ProtobufUtil.getRemoteException(se);
@@ -992,7 +991,7 @@ public class HTable implements HTableInt
               try {
                 MultiGetRequest requests = RequestConverter.buildMultiGetRequest(location
                     .getRegionInfo().getRegionName(), getsByRegionEntry.getValue(), true,
false);
-                MultiGetResponse responses = server.multiGet(null, requests);
+                MultiGetResponse responses = stub.multiGet(null, requests);
                 return responses.getExistsList();
               } catch (ServiceException se) {
                 throw ProtobufUtil.getRemoteException(se);

Modified: hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MasterAdminKeepAliveConnection.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MasterAdminKeepAliveConnection.java?rev=1478639&r1=1478638&r2=1478639&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MasterAdminKeepAliveConnection.java
(original)
+++ hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MasterAdminKeepAliveConnection.java
Fri May  3 03:58:33 2013
@@ -20,25 +20,25 @@
 
 package org.apache.hadoop.hbase.client;
 
-
-import org.apache.hadoop.hbase.MasterAdminProtocol;
-
-import java.io.Closeable;
+import org.apache.hadoop.hbase.protobuf.generated.MasterAdminProtos;
 
 /**
  * A KeepAlive connection is not physically closed immediately after the close,
- *  but rather kept alive for a few minutes. It makes sense only if it's shared.
+ *  but rather kept alive for a few minutes. It makes sense only if it is shared.
  *
- * This interface is used by a dynamic proxy. It allows to have a #close
- *  function in a master client.
+ * <p>This interface is implemented on a stub. It allows to have a #close function
in a master
+ * client.
  *
- * This class is intended to be used internally by HBase classes that need to
- * speak the MasterAdminProtocol; but not by * final user code. Hence it's
- * package protected.
+ * <p>This class is intended to be used internally by HBase classes that need to make
invocations
+ * against the master on the MasterAdminProtos.MasterAdminService.BlockingInterface; but
not by
+ * final user code. Hence it's package protected.
  */
-interface MasterAdminKeepAliveConnection extends MasterAdminProtocol, Closeable {
-
-  @Override
+interface MasterAdminKeepAliveConnection
+extends MasterAdminProtos.MasterAdminService.BlockingInterface {
+  /**
+   * Close down all resources.
+   */
+  // The Closeable Interface wants to throw an IOE out of a close.
+  //  Thats a PITA.  Do this below instead of Closeable.
   public void close();
-}
-
+}
\ No newline at end of file

Modified: hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MasterMonitorKeepAliveConnection.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MasterMonitorKeepAliveConnection.java?rev=1478639&r1=1478638&r2=1478639&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MasterMonitorKeepAliveConnection.java
(original)
+++ hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MasterMonitorKeepAliveConnection.java
Fri May  3 03:58:33 2013
@@ -20,11 +20,10 @@
 
 package org.apache.hadoop.hbase.client;
 
-
-import org.apache.hadoop.hbase.MasterMonitorProtocol;
-
 import java.io.Closeable;
 
+import org.apache.hadoop.hbase.protobuf.generated.MasterMonitorProtos;
+
 /**
  * A KeepAlive connection is not physically closed immediately after the close,
  *  but rather kept alive for a few minutes. It makes sense only if it's shared.
@@ -36,9 +35,5 @@ import java.io.Closeable;
  * speak the MasterMonitorProtocol; but not by final user code. Hence it's
  * package protected.
  */
-interface MasterMonitorKeepAliveConnection extends MasterMonitorProtocol, Closeable {
-
-  @Override
-  public void close();
-}
-
+interface MasterMonitorKeepAliveConnection
+extends MasterMonitorProtos.MasterMonitorService.BlockingInterface, Closeable {}
\ No newline at end of file

Modified: hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MetaScanner.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MetaScanner.java?rev=1478639&r1=1478638&r2=1478639&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MetaScanner.java
(original)
+++ hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MetaScanner.java
Fri May  3 03:58:33 2013
@@ -26,10 +26,8 @@ import org.apache.hadoop.conf.Configurat
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.ServerName;
-import org.apache.hadoop.hbase.client.HConnectionManager.HConnectable;
 import org.apache.hadoop.hbase.exceptions.TableNotFoundException;
 import org.apache.hadoop.hbase.util.Bytes;
-import org.apache.hadoop.hbase.util.PairOfSameType;
 
 import java.io.Closeable;
 import java.io.IOException;
@@ -275,7 +273,7 @@ public class MetaScanner {
   public static List<HRegionInfo> listAllRegions(Configuration conf, final boolean
offlined)
   throws IOException {
     final List<HRegionInfo> regions = new ArrayList<HRegionInfo>();
-    MetaScannerVisitor visitor = new DefaultMetaScannerVisitor(conf) {
+    MetaScannerVisitor visitor = new DefaultMetaScannerVisitor() {
         @Override
         public boolean processRowInternal(Result result) throws IOException {
           if (result == null || result.isEmpty()) {
@@ -310,7 +308,7 @@ public class MetaScanner {
       final byte [] tablename, final boolean offlined) throws IOException {
     final NavigableMap<HRegionInfo, ServerName> regions =
       new TreeMap<HRegionInfo, ServerName>();
-    MetaScannerVisitor visitor = new TableMetaScannerVisitor(conf, tablename) {
+    MetaScannerVisitor visitor = new TableMetaScannerVisitor(tablename) {
       @Override
       public boolean processRowInternal(Result rowResult) throws IOException {
         HRegionInfo info = getHRegionInfo(rowResult);
@@ -354,10 +352,8 @@ public class MetaScanner {
   public static abstract class DefaultMetaScannerVisitor
     extends MetaScannerVisitorBase {
 
-    protected Configuration conf;
-
-    public DefaultMetaScannerVisitor(Configuration conf) {
-      this.conf = conf;
+    public DefaultMetaScannerVisitor() {
+      super();
     }
 
     public abstract boolean processRowInternal(Result rowResult) throws IOException;
@@ -386,8 +382,8 @@ public class MetaScanner {
   public static abstract class TableMetaScannerVisitor extends DefaultMetaScannerVisitor
{
     private byte[] tableName;
 
-    public TableMetaScannerVisitor(Configuration conf, byte[] tableName) {
-      super(conf);
+    public TableMetaScannerVisitor(byte[] tableName) {
+      super();
       this.tableName = tableName;
     }
 
@@ -402,6 +398,5 @@ public class MetaScanner {
       }
       return super.processRow(rowResult);
     }
-
   }
-}
+}
\ No newline at end of file

Modified: hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MultiServerCallable.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MultiServerCallable.java?rev=1478639&r1=1478638&r2=1478639&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MultiServerCallable.java
(original)
+++ hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MultiServerCallable.java
Fri May  3 03:58:33 2013
@@ -74,7 +74,7 @@ class MultiServerCallable<R> extends Ser
                 RequestConverter.buildNoDataMultiRequest(regionName, rms, cells);
             // Carry the cells over the proxy/pb Service interface using the payload carrying
             // rpc controller.
-            server.multi(new PayloadCarryingRpcController(cells), multiRequest);
+            stub.multi(new PayloadCarryingRpcController(cells), multiRequest);
             // This multi call does not return results.
             response.add(regionName, action.getOriginalIndex(), Result.EMPTY_RESULT);
           } catch (ServiceException se) {
@@ -99,7 +99,7 @@ class MultiServerCallable<R> extends Ser
           // Controller optionally carries cell data over the proxy/service boundary and
also
           // optionally ferries cell response data back out again.
           PayloadCarryingRpcController controller = new PayloadCarryingRpcController(cells);
-          ClientProtos.MultiResponse responseProto = server.multi(controller, multiRequest);
+          ClientProtos.MultiResponse responseProto = stub.multi(controller, multiRequest);
           results = ResponseConverter.getResults(responseProto, controller.cellScanner());
         } catch (ServiceException se) {
           ex = ProtobufUtil.getRemoteException(se);
@@ -114,7 +114,7 @@ class MultiServerCallable<R> extends Ser
   }
 
   @Override
-  public void connect(boolean reload) throws IOException {
-    server = connection.getClient(loc.getServerName());
+  public void prepare(boolean reload) throws IOException {
+    stub = connection.getClient(loc.getServerName());
   }
 }

Modified: hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java?rev=1478639&r1=1478638&r2=1478639&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java
(original)
+++ hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java
Fri May  3 03:58:33 2013
@@ -92,9 +92,9 @@ public class ScannerCallable extends Ser
    * @throws IOException
    */
   @Override
-  public void connect(boolean reload) throws IOException {
+  public void prepare(boolean reload) throws IOException {
     if (!instantiated || reload) {
-      super.connect(reload);
+      super.prepare(reload);
       checkIfRegionServerIsRemote();
       instantiated = true;
     }
@@ -144,7 +144,7 @@ public class ScannerCallable extends Ser
             RequestConverter.buildScanRequest(scannerId, caching, false, nextCallSeq);
           ScanResponse response = null;
           try {
-            response = server.scan(null, request);
+            response = stub.scan(null, request);
             // Client and RS maintain a nextCallSeq number during the scan. Every next()
call
             // from client to server will increment this number in both sides. Client passes
this
             // number along with the request and at RS side both the incoming nextCallSeq
and its
@@ -248,7 +248,7 @@ public class ScannerCallable extends Ser
       ScanRequest request =
         RequestConverter.buildScanRequest(this.scannerId, 0, true);
       try {
-        server.scan(null, request);
+        stub.scan(null, request);
       } catch (ServiceException se) {
         throw ProtobufUtil.getRemoteException(se);
       }
@@ -265,7 +265,7 @@ public class ScannerCallable extends Ser
         this.location.getRegionInfo().getRegionName(),
         this.scan, 0, false);
     try {
-      ScanResponse response = server.scan(null, request);
+      ScanResponse response = stub.scan(null, request);
       long id = response.getScannerId();
       if (logScannerActivity) {
         LOG.info("Open scanner=" + id + " for scan=" + scan.toString()

Modified: hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ServerCallable.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ServerCallable.java?rev=1478639&r1=1478638&r2=1478639&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ServerCallable.java
(original)
+++ hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ServerCallable.java
Fri May  3 03:58:33 2013
@@ -29,7 +29,8 @@ import org.apache.hadoop.hbase.HConstant
 import org.apache.hadoop.hbase.HRegionLocation;
 import org.apache.hadoop.hbase.exceptions.DoNotRetryIOException;
 import org.apache.hadoop.hbase.exceptions.NotServingRegionException;
-import org.apache.hadoop.hbase.ipc.HBaseClientRPC;
+import org.apache.hadoop.hbase.ipc.RpcClient;
+import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ClientService;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;
 import org.apache.hadoop.ipc.RemoteException;
@@ -47,7 +48,7 @@ import java.util.concurrent.Callable;
  * return type and method we actually invoke on remote Server.  Usually
  * used inside a try/catch that fields usual connection failures all wrapped
  * up in a retry loop.
- * <p>Call {@link #connect(boolean)} to connect to server hosting region
+ * <p>Call {@link #prepare(boolean)} to connect to server hosting region
  * that contains the passed row in the passed table before invoking
  * {@link #call()}.
  * @see HConnection#getRegionServerWithoutRetries(ServerCallable)
@@ -62,7 +63,7 @@ public abstract class ServerCallable<T> 
   protected final byte [] tableName;
   protected final byte [] row;
   protected HRegionLocation location;
-  protected ClientProtocol server;
+  protected ClientService.BlockingInterface stub;
   protected int callTimeout;
   protected long globalStartTime;
   protected long startTime, endTime;
@@ -86,13 +87,14 @@ public abstract class ServerCallable<T> 
   }
 
   /**
-   * Connect to the server hosting region with row from tablename.
+   * Prepare for connection to the server hosting region with row from tablename.  Does lookup
+   * to find region location and hosting server.
    * @param reload Set this to true if connection should re-find the region
    * @throws IOException e
    */
-  public void connect(final boolean reload) throws IOException {
+  public void prepare(final boolean reload) throws IOException {
     this.location = connection.getRegionLocation(tableName, row, reload);
-    this.server = connection.getClient(location.getServerName());
+    this.stub = connection.getClient(location.getServerName());
   }
 
   /** @return the server name
@@ -127,11 +129,11 @@ public abstract class ServerCallable<T> 
       // resetting to the minimum.
       remaining = MIN_RPC_TIMEOUT;
     }
-    HBaseClientRPC.setRpcTimeout(remaining);
+    RpcClient.setRpcTimeout(remaining);
   }
 
   public void afterCall() {
-    HBaseClientRPC.resetRpcTimeout();
+    RpcClient.resetRpcTimeout();
     this.endTime = EnvironmentEdgeManager.currentTimeMillis();
   }
 
@@ -164,11 +166,11 @@ public abstract class ServerCallable<T> 
       long expectedSleep = 0;
       try {
         beforeCall();
-        connect(tries != 0); // if called with false, check table status on ZK
+        prepare(tries != 0); // if called with false, check table status on ZK
         return call();
       } catch (Throwable t) {
-        LOG.warn("Received exception, tries=" + tries + ", numRetries=" + numRetries +
-            " message=" + t.getMessage());
+        LOG.warn("Received exception, tries=" + tries + ", numRetries=" + numRetries + ":"
+
+          t.getMessage());
 
         t = translateException(t);
         // translateException throws an exception when we should not retry, i.e. when it's
the
@@ -237,7 +239,7 @@ public abstract class ServerCallable<T> 
     this.globalStartTime = EnvironmentEdgeManager.currentTimeMillis();
     try {
       beforeCall();
-      connect(false);
+      prepare(false);
       return call();
     } catch (Throwable t) {
       Throwable t2 = translateException(t);

Added: hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/BadAuthException.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/BadAuthException.java?rev=1478639&view=auto
==============================================================================
--- hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/BadAuthException.java
(added)
+++ hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/BadAuthException.java
Fri May  3 03:58:33 2013
@@ -0,0 +1,32 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase.ipc;
+
+public class BadAuthException extends FatalConnectionException {
+  public BadAuthException() {
+    super();
+  }
+
+  public BadAuthException(String msg) {
+    super(msg);
+  }
+
+  public BadAuthException(String msg, Throwable t) {
+    super(msg, t);
+  }
+}
\ No newline at end of file

Modified: hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/IPCUtil.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/IPCUtil.java?rev=1478639&r1=1478638&r2=1478639&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/IPCUtil.java
(original)
+++ hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/IPCUtil.java
Fri May  3 03:58:33 2013
@@ -33,6 +33,12 @@ import org.apache.hadoop.conf.Configurab
 import org.apache.hadoop.hbase.CellScanner;
 import org.apache.hadoop.hbase.codec.Codec;
 import org.apache.hadoop.hbase.io.ByteBufferOutputStream;
+import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ScanRequest;
+import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ScanResponse;
+import org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionServerReportRequest;
+import org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionServerReportResponse;
+import org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionServerStartupRequest;
+import org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionServerStartupResponse;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.io.compress.CodecPool;
 import org.apache.hadoop.io.compress.CompressionCodec;
@@ -44,6 +50,7 @@ import com.google.common.base.Preconditi
 import com.google.protobuf.CodedInputStream;
 import com.google.protobuf.CodedOutputStream;
 import com.google.protobuf.Message;
+import com.google.protobuf.TextFormat;
 
 /**
  * Utility to help ipc'ing.
@@ -263,4 +270,24 @@ class IPCUtil {
     Preconditions.checkArgument(totalSize < Integer.MAX_VALUE);
     return totalSize;
   }
-}
+
+  /**
+   * Return short version of Param Message toString'd, shorter than TextFormat#regionServerStartup
+   * @param methodName
+   * @param request
+   * @return toString of passed <code>param</code>
+   */
+  static String getRequestShortTextFormat(Message request) {
+    if (request instanceof ScanRequest) {
+      return TextFormat.shortDebugString(request);
+    } else if (request instanceof RegionServerReportRequest) {
+      // Print a short message only, just the servername and the requests, not the full load.
+      RegionServerReportRequest r = (RegionServerReportRequest)request;
+      return "server " + TextFormat.shortDebugString(r.getServer()) +
+        " load { numberOfRequests: " + r.getLoad().getNumberOfRequests() + " }";
+    } else if (request instanceof RegionServerStartupRequest) {
+      return TextFormat.shortDebugString(request);
+    }
+    return "TODO " + TextFormat.shortDebugString(request);
+  }
+}
\ No newline at end of file

Modified: hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/RegionCoprocessorRpcChannel.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/RegionCoprocessorRpcChannel.java?rev=1478639&r1=1478638&r2=1478639&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/RegionCoprocessorRpcChannel.java
(original)
+++ hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/RegionCoprocessorRpcChannel.java
Fri May  3 03:58:33 2013
@@ -79,7 +79,7 @@ public class RegionCoprocessorRpcChannel
         new ServerCallable<CoprocessorServiceResponse>(connection, table, row) {
           public CoprocessorServiceResponse call() throws Exception {
             byte[] regionName = location.getRegionInfo().getRegionName();
-            return ProtobufUtil.execService(server, call, regionName);
+            return ProtobufUtil.execService(stub, call, regionName);
           }
         };
     CoprocessorServiceResponse result = callable.withRetries();

Modified: hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/RemoteWithExtrasException.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/RemoteWithExtrasException.java?rev=1478639&r1=1478638&r2=1478639&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/RemoteWithExtrasException.java
(original)
+++ hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/RemoteWithExtrasException.java
Fri May  3 03:58:33 2013
@@ -22,8 +22,9 @@ import org.apache.hadoop.hbase.exception
 import org.apache.hadoop.ipc.RemoteException;
 
 /**
- * An {@link RemoteException} with some extra information.  If source exception
+ * A {@link RemoteException} with some extra information.  If source exception
  * was a {@link DoNotRetryIOException}, {@link #isDoNotRetry()} will return true.
+ * <p>A {@link RemoteException} hosts exceptions we got from the server.
  */
 @SuppressWarnings("serial")
 @InterfaceAudience.Private



Mime
View raw message