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

svn commit: r1383537 - in /hbase/branches/0.94/src: main/java/org/apache/hadoop/hbase/client/coprocessor/ main/java/org/apache/hadoop/hbase/ipc/ test/java/org/apache/hadoop/hbase/ipc/

Author: stack
Date: Tue Sep 11 18:53:14 2012
New Revision: 1383537

URL: http://svn.apache.org/viewvc?rev=1383537&view=rev
Log:
HBASE-6340 HBase RPC should allow protocol extension with common interfaces.: REVERT

Removed:
    hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/ipc/TestProtocolExtension.java
Modified:
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/client/coprocessor/Exec.java
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/ipc/Invocation.java
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/ipc/WritableRpcEngine.java

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/client/coprocessor/Exec.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/client/coprocessor/Exec.java?rev=1383537&r1=1383536&r2=1383537&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/client/coprocessor/Exec.java (original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/client/coprocessor/Exec.java Tue Sep 11 18:53:14 2012
@@ -64,7 +64,7 @@ public class Exec extends Invocation imp
       byte[] row,
       Class<? extends CoprocessorProtocol> protocol,
       Method method, Object[] parameters) {
-    super(method, protocol, parameters);
+    super(method, parameters);
     this.conf = configuration;
     this.referenceRow = row;
     this.protocol = protocol;

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/ipc/Invocation.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/ipc/Invocation.java?rev=1383537&r1=1383536&r2=1383537&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/ipc/Invocation.java (original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/ipc/Invocation.java Tue Sep 11 18:53:14 2012
@@ -45,27 +45,26 @@ public class Invocation extends Versione
 
   public Invocation() {}
 
-  public Invocation(Method method,
-      Class<? extends VersionedProtocol> declaringClass, Object[] parameters) {
+  public Invocation(Method method, Object[] parameters) {
     this.methodName = method.getName();
     this.parameterClasses = method.getParameterTypes();
     this.parameters = parameters;
-    if (declaringClass.equals(VersionedProtocol.class)) {
+    if (method.getDeclaringClass().equals(VersionedProtocol.class)) {
       //VersionedProtocol is exempted from version check.
       clientVersion = 0;
       clientMethodsHash = 0;
     } else {
       try {
-        Field versionField = declaringClass.getField("VERSION");
+        Field versionField = method.getDeclaringClass().getField("VERSION");
         versionField.setAccessible(true);
-        this.clientVersion = versionField.getLong(declaringClass);
+        this.clientVersion = versionField.getLong(method.getDeclaringClass());
       } catch (NoSuchFieldException ex) {
-        throw new RuntimeException("The " + declaringClass, ex);
+        throw new RuntimeException("The " + method.getDeclaringClass(), ex);
       } catch (IllegalAccessException ex) {
         throw new RuntimeException(ex);
       }
-      this.clientMethodsHash = ProtocolSignature.getFingerprint(
-          declaringClass.getMethods());
+      this.clientMethodsHash = ProtocolSignature.getFingerprint(method
+          .getDeclaringClass().getMethods());
     }
   }
 
@@ -170,4 +169,4 @@ public class Invocation extends Versione
   public byte getVersion() {
     return RPC_VERSION;
   }
-}
+}
\ No newline at end of file

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/ipc/WritableRpcEngine.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/ipc/WritableRpcEngine.java?rev=1383537&r1=1383536&r2=1383537&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/ipc/WritableRpcEngine.java (original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/ipc/WritableRpcEngine.java Tue Sep 11 18:53:14 2012
@@ -148,7 +148,7 @@ class WritableRpcEngine implements RpcEn
       }
 
       HbaseObjectWritable value = (HbaseObjectWritable)
-        client.call(new Invocation(method, protocol, args), address,
+        client.call(new Invocation(method, args), address,
                     protocol, ticket, rpcTimeout);
       if (logDebug) {
         // FIGURE HOW TO TURN THIS OFF!
@@ -210,7 +210,7 @@ class WritableRpcEngine implements RpcEn
 
     Invocation[] invocations = new Invocation[params.length];
     for (int i = 0; i < params.length; i++)
-      invocations[i] = new Invocation(method, protocol, params[i]);
+      invocations[i] = new Invocation(method, params[i]);
     HBaseClient client = CLIENTS.getClient(conf);
     try {
     Writable[] wrappedValues =