HBASE-13388 Handling NullPointer in ZKProcedureMemberRpcs while getting ZNode data (Vikas Vishwakarma)

This commit is contained in:
Andrew Purtell 2015-04-02 14:17:26 -07:00
parent 578df6dfc0
commit 2365932d78
1 changed files with 1 additions and 1 deletions

View File

@ -200,7 +200,6 @@ public class ZKProcedureMemberRpcs implements ProcedureMemberRpcs {
Subprocedure subproc = null;
try {
byte[] data = ZKUtil.getData(zkController.getWatcher(), path);
LOG.debug("start proc data length is " + data.length);
if (!ProtobufUtil.isPBMagicPrefix(data)) {
String msg = "Data in for starting procuedure " + opName +
" is illegally formatted (no pb magic). " +
@ -208,6 +207,7 @@ public class ZKProcedureMemberRpcs implements ProcedureMemberRpcs {
LOG.error(msg);
throw new IllegalArgumentException(msg);
}
LOG.debug("start proc data length is " + data.length);
data = Arrays.copyOfRange(data, ProtobufUtil.lengthOfPBMagic(), data.length);
LOG.debug("Found data for znode:" + path);
subproc = member.createSubprocedure(opName, data);