Revert "HDFS-5079. Cleaning up NNHAStatusHeartbeat.State from DatanodeProtocolProtos. Contributed by Tao Luo."

This reverts commit 4c8db60092.

Conflicts:
	hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
	hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelper.java
This commit is contained in:
Kihwal Lee 2016-12-08 15:41:49 -06:00
parent 9f8344db50
commit 13d8e552d2
2 changed files with 7 additions and 5 deletions

View File

@ -26,7 +26,6 @@ import com.google.protobuf.ByteString;
import org.apache.hadoop.fs.StorageType; import org.apache.hadoop.fs.StorageType;
import org.apache.hadoop.ha.HAServiceProtocol.HAServiceState; 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.DFSUtilClient;
import org.apache.hadoop.hdfs.protocol.Block; import org.apache.hadoop.hdfs.protocol.Block;
import org.apache.hadoop.hdfs.protocol.DatanodeID; import org.apache.hadoop.hdfs.protocol.DatanodeID;
@ -772,10 +771,10 @@ public class PBHelper {
NNHAStatusHeartbeatProto.newBuilder(); NNHAStatusHeartbeatProto.newBuilder();
switch (hb.getState()) { switch (hb.getState()) {
case ACTIVE: case ACTIVE:
builder.setState(HAServiceProtocolProtos.HAServiceStateProto.ACTIVE); builder.setState(NNHAStatusHeartbeatProto.State.ACTIVE);
break; break;
case STANDBY: case STANDBY:
builder.setState(HAServiceProtocolProtos.HAServiceStateProto.STANDBY); builder.setState(NNHAStatusHeartbeatProto.State.STANDBY);
break; break;
default: default:
throw new IllegalArgumentException("Unexpected NNHAStatusHeartbeat.State:" + throw new IllegalArgumentException("Unexpected NNHAStatusHeartbeat.State:" +

View File

@ -31,7 +31,6 @@ option java_generic_services = true;
option java_generate_equals_and_hash = true; option java_generate_equals_and_hash = true;
package hadoop.hdfs.datanode; package hadoop.hdfs.datanode;
import "HAServiceProtocol.proto";
import "hdfs.proto"; import "hdfs.proto";
import "erasurecoding.proto"; import "erasurecoding.proto";
import "HdfsServer.proto"; import "HdfsServer.proto";
@ -214,7 +213,11 @@ message HeartbeatRequestProto {
* txid - Highest transaction ID this NN has seen * txid - Highest transaction ID this NN has seen
*/ */
message NNHAStatusHeartbeatProto { message NNHAStatusHeartbeatProto {
required hadoop.common.HAServiceStateProto state = 1; enum State {
ACTIVE = 0;
STANDBY = 1;
}
required State state = 1;
required uint64 txid = 2; required uint64 txid = 2;
} }