HBASE-8380 NPE in HBaseClient.readResponse

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1471271 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
nkeywal 2013-04-24 07:26:55 +00:00
parent 374052f071
commit 929776752e
1 changed files with 14 additions and 12 deletions

View File

@ -392,7 +392,7 @@ public class HBaseClient {
if (LOG.isDebugEnabled()) { if (LOG.isDebugEnabled()) {
LOG.debug("Use " + authMethod + " authentication for protocol " LOG.debug("Use " + authMethod + " authentication for protocol "
+ protocol.getSimpleName()); + (protocol == null ? "null" : protocol.getSimpleName()));
} }
reloginMaxBackoff = conf.getInt("hbase.security.relogin.maxbackoff", 5000); reloginMaxBackoff = conf.getInt("hbase.security.relogin.maxbackoff", 5000);
this.remoteId = remoteId; this.remoteId = remoteId;
@ -811,7 +811,7 @@ public class HBaseClient {
ticket = ticket.getRealUser(); ticket = ticket.getRealUser();
} }
} }
boolean continueSasl = false; boolean continueSasl;
try { try {
if (ticket == null) { if (ticket == null) {
throw new NullPointerException("ticket is null"); throw new NullPointerException("ticket is null");
@ -855,7 +855,7 @@ public class HBaseClient {
} }
} catch (Throwable t) { } catch (Throwable t) {
failedServers.addToFailedServers(remoteId.address); failedServers.addToFailedServers(remoteId.address);
IOException e = null; IOException e;
if (t instanceof IOException) { if (t instanceof IOException) {
e = (IOException)t; e = (IOException)t;
markClosed(e); markClosed(e);
@ -1007,14 +1007,16 @@ public class HBaseClient {
if (call != null) call.setException(re); if (call != null) call.setException(re);
} }
} else { } else {
Message rpcResponseType; Message rpcResponseType = null;
try { if (call != null){
// TODO: Why pb engine pollution in here in this class? FIX. try {
rpcResponseType = // TODO: Why pb engine pollution in here in this class? FIX.
ProtobufRpcClientEngine.Invoker.getReturnProtoType( rpcResponseType =
reflectionCache.getMethod(remoteId.getProtocol(), call.method.getName())); ProtobufRpcClientEngine.Invoker.getReturnProtoType(
} catch (Exception e) { reflectionCache.getMethod(remoteId.getProtocol(), call.method.getName()));
throw new RuntimeException(e); //local exception } catch (Exception e) {
throw new RuntimeException(e); //local exception
}
} }
Message value = null; Message value = null;
if (rpcResponseType != null) { if (rpcResponseType != null) {
@ -1474,4 +1476,4 @@ public class HBaseClient {
return hashcode; return hashcode;
} }
} }
} }