From 13d8e552d2eddd66b3c3e6517d175567a4aa905c Mon Sep 17 00:00:00 2001 From: Kihwal Lee Date: Thu, 8 Dec 2016 15:41:49 -0600 Subject: [PATCH] Revert "HDFS-5079. Cleaning up NNHAStatusHeartbeat.State from DatanodeProtocolProtos. Contributed by Tao Luo." This reverts commit 4c8db6009291001b685b63f05b59a084972df8d4. Conflicts: hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelper.java --- .../java/org/apache/hadoop/hdfs/protocolPB/PBHelper.java | 5 ++--- .../hadoop-hdfs/src/main/proto/DatanodeProtocol.proto | 7 +++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelper.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelper.java index 78371f5b0f8..4f6a04e1d25 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelper.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelper.java @@ -26,7 +26,6 @@ import com.google.protobuf.ByteString; import org.apache.hadoop.fs.StorageType; import org.apache.hadoop.ha.HAServiceProtocol.HAServiceState; -import org.apache.hadoop.ha.proto.HAServiceProtocolProtos; import org.apache.hadoop.hdfs.DFSUtilClient; import org.apache.hadoop.hdfs.protocol.Block; import org.apache.hadoop.hdfs.protocol.DatanodeID; @@ -772,10 +771,10 @@ public class PBHelper { NNHAStatusHeartbeatProto.newBuilder(); switch (hb.getState()) { case ACTIVE: - builder.setState(HAServiceProtocolProtos.HAServiceStateProto.ACTIVE); + builder.setState(NNHAStatusHeartbeatProto.State.ACTIVE); break; case STANDBY: - builder.setState(HAServiceProtocolProtos.HAServiceStateProto.STANDBY); + builder.setState(NNHAStatusHeartbeatProto.State.STANDBY); break; default: throw new IllegalArgumentException("Unexpected NNHAStatusHeartbeat.State:" + diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/DatanodeProtocol.proto b/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/DatanodeProtocol.proto index 9bae4c3cf1f..016eae255c4 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/DatanodeProtocol.proto +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/DatanodeProtocol.proto @@ -31,7 +31,6 @@ option java_generic_services = true; option java_generate_equals_and_hash = true; package hadoop.hdfs.datanode; -import "HAServiceProtocol.proto"; import "hdfs.proto"; import "erasurecoding.proto"; import "HdfsServer.proto"; @@ -214,7 +213,11 @@ message HeartbeatRequestProto { * txid - Highest transaction ID this NN has seen */ message NNHAStatusHeartbeatProto { - required hadoop.common.HAServiceStateProto state = 1; + enum State { + ACTIVE = 0; + STANDBY = 1; + } + required State state = 1; required uint64 txid = 2; }