Skip to content

Commit

Permalink
HBASE-6340 HBase RPC should allow protocol extension with common inte…
Browse files Browse the repository at this point in the history
…rfaces.: REVERT

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/0.94@1383537 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
saintstack committed Sep 11, 2012
1 parent 66aa04e commit 3fadfe5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 115 deletions.
Expand Up @@ -64,7 +64,7 @@ public Exec(Configuration configuration,
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;
Expand Down
17 changes: 8 additions & 9 deletions src/main/java/org/apache/hadoop/hbase/ipc/Invocation.java
Expand Up @@ -45,27 +45,26 @@ public class Invocation extends VersionedWritable implements Configurable {

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());
}
}

Expand Down Expand Up @@ -170,4 +169,4 @@ public Configuration getConf() {
public byte getVersion() {
return RPC_VERSION;
}
}
}
Expand Up @@ -148,7 +148,7 @@ public Object invoke(Object proxy, Method method, Object[] args)
}

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!
Expand Down Expand Up @@ -210,7 +210,7 @@ public Object[] call(Method method, Object[][] params,

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 =
Expand Down
103 changes: 0 additions & 103 deletions src/test/java/org/apache/hadoop/hbase/ipc/TestProtocolExtension.java

This file was deleted.

0 comments on commit 3fadfe5

Please sign in to comment.