From cc82593a34e18576fde4b7b875a979cbd6c387e4 Mon Sep 17 00:00:00 2001 From: Benoit Sigoure Date: Sat, 14 Jan 2012 20:36:59 -0800 Subject: [PATCH 2/3] Make sure that a connection always uses a protocol. When a pre-0.91 client connects to HBase >= 0.91, the header received will not contain a ConnectionHeader with a protocol. This causes the Connection object to have `null' as the protocol, which prevents any RPC from being deserialized by the server. In that case just set a reasonable default for the client by assuming it wanted to talk to a RegionServer. --- .../org/apache/hadoop/hbase/ipc/HBaseServer.java | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/apache/hadoop/hbase/ipc/HBaseServer.java b/src/main/java/org/apache/hadoop/hbase/ipc/HBaseServer.java index c2cacd9..e20ec43 100644 --- a/src/main/java/org/apache/hadoop/hbase/ipc/HBaseServer.java +++ b/src/main/java/org/apache/hadoop/hbase/ipc/HBaseServer.java @@ -1213,9 +1213,10 @@ public abstract class HBaseServer implements RpcServer { header.readFields(in); try { String protocolClassName = header.getProtocol(); - if (protocolClassName != null) { - protocol = getProtocolClass(header.getProtocol(), conf); + if (protocolClassName == null) { + protocolClassName = "org.apache.hadoop.hbase.ipc.HRegionInterface"; } + protocol = getProtocolClass(protocolClassName, conf); } catch (ClassNotFoundException cnfe) { throw new IOException("Unknown protocol: " + header.getProtocol()); } -- 1.7.9.rc0.24.ga04fb