HDFS-5890. Avoid NPE in Datanode heartbeat. Contributed by Vinay
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/HDFS-5535@1565023 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
35e59eeaa2
commit
b2ce764093
|
@ -20,3 +20,5 @@ HDFS-5535 subtasks:
|
|||
DataNodeLayoutVersion. (Brandon Li via szetszwo)
|
||||
|
||||
HDFS-5848. Add rolling upgrade status to heartbeat response. (szetszwo)
|
||||
|
||||
HDFS-5890. Avoid NPE in Datanode heartbeat. (Vinay via brandonli)
|
||||
|
|
|
@ -34,6 +34,7 @@ import org.apache.hadoop.hdfs.protocol.DatanodeID;
|
|||
import org.apache.hadoop.hdfs.protocol.ExtendedBlock;
|
||||
import org.apache.hadoop.hdfs.protocol.HdfsConstants;
|
||||
import org.apache.hadoop.hdfs.protocol.LocatedBlock;
|
||||
import org.apache.hadoop.hdfs.protocol.RollingUpgradeStatus;
|
||||
import org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.BlockReceivedAndDeletedRequestProto;
|
||||
import org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.BlockReportRequestProto;
|
||||
import org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.BlockReportResponseProto;
|
||||
|
@ -183,9 +184,12 @@ public class DatanodeProtocolClientSideTranslatorPB implements
|
|||
cmds[index] = PBHelper.convert(p);
|
||||
index++;
|
||||
}
|
||||
return new HeartbeatResponse(cmds,
|
||||
PBHelper.convert(resp.getHaStatus()),
|
||||
PBHelper.convert(resp.getRollingUpgradeStatus()));
|
||||
RollingUpgradeStatus rollingUpdateStatus = null;
|
||||
if (resp.hasRollingUpgradeStatus()) {
|
||||
rollingUpdateStatus = PBHelper.convert(resp.getRollingUpgradeStatus());
|
||||
}
|
||||
return new HeartbeatResponse(cmds, PBHelper.convert(resp.getHaStatus()),
|
||||
rollingUpdateStatus);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -23,6 +23,7 @@ import java.util.List;
|
|||
|
||||
import org.apache.hadoop.hdfs.protocol.DatanodeID;
|
||||
import org.apache.hadoop.hdfs.protocol.LocatedBlock;
|
||||
import org.apache.hadoop.hdfs.protocol.RollingUpgradeStatus;
|
||||
import org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.BlockReceivedAndDeletedRequestProto;
|
||||
import org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.BlockReceivedAndDeletedResponseProto;
|
||||
import org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.BlockReportRequestProto;
|
||||
|
@ -121,8 +122,12 @@ public class DatanodeProtocolServerSideTranslatorPB implements
|
|||
}
|
||||
}
|
||||
builder.setHaStatus(PBHelper.convert(response.getNameNodeHaState()));
|
||||
builder.setRollingUpgradeStatus(PBHelper.convertRollingUpgradeStatus(
|
||||
response.getRollingUpdateStatus()));
|
||||
RollingUpgradeStatus rollingUpdateStatus = response
|
||||
.getRollingUpdateStatus();
|
||||
if (rollingUpdateStatus != null) {
|
||||
builder.setRollingUpgradeStatus(PBHelper
|
||||
.convertRollingUpgradeStatus(rollingUpdateStatus));
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue