Class SetNodeOperationalStateCommand
java.lang.Object
org.apache.hadoop.ozone.protocol.commands.SCMCommand<org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.SetNodeOperationalStateCommandProto>
org.apache.hadoop.ozone.protocol.commands.SetNodeOperationalStateCommand
- All Implemented Interfaces:
org.apache.hadoop.hdds.server.events.IdentifiableEventPayload
public class SetNodeOperationalStateCommand
extends SCMCommand<org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.SetNodeOperationalStateCommandProto>
A command used to persist the current node operational state on the datanode.
-
Constructor Summary
ConstructorsConstructorDescriptionSetNodeOperationalStateCommand(long id, org.apache.hadoop.hdds.protocol.proto.HddsProtos.NodeOperationalState state, long stateExpiryEpochSeconds) Ctor that creates a SetNodeOperationalStateCommand. -
Method Summary
Modifier and TypeMethodDescriptiongetFromProtobuf(org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.SetNodeOperationalStateCommandProto cmdProto) org.apache.hadoop.hdds.protocol.proto.HddsProtos.NodeOperationalStateorg.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.SetNodeOperationalStateCommandProtogetProto()Gets the protobuf message of this object.longorg.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.SCMCommandProto.TypegetType()Returns the type of this command.toString()Methods inherited from class org.apache.hadoop.ozone.protocol.commands.SCMCommand
contributesToQueueSize, getDeadline, getEncodedToken, getId, getTerm, hasExpired, setDeadline, setEncodedToken, setTerm
-
Constructor Details
-
SetNodeOperationalStateCommand
public SetNodeOperationalStateCommand(long id, org.apache.hadoop.hdds.protocol.proto.HddsProtos.NodeOperationalState state, long stateExpiryEpochSeconds) Ctor that creates a SetNodeOperationalStateCommand.- Parameters:
id- - Command ID. Something a time stamp would suffice.state- - OperationalState that want the node to be set into.stateExpiryEpochSeconds- The epoch time when the state should expire, or zero for the state to remain indefinitely.
-
-
Method Details
-
getType
public org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.SCMCommandProto.Type getType()Returns the type of this command.- Specified by:
getTypein classSCMCommand<org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.SetNodeOperationalStateCommandProto>- Returns:
- Type - This is setNodeOperationalStateCommand.
-
getProto
public org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.SetNodeOperationalStateCommandProto getProto()Gets the protobuf message of this object.- Specified by:
getProtoin classSCMCommand<org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.SetNodeOperationalStateCommandProto>- Returns:
- A protobuf message.
-
getOpState
public org.apache.hadoop.hdds.protocol.proto.HddsProtos.NodeOperationalState getOpState() -
getStateExpiryEpochSeconds
public long getStateExpiryEpochSeconds() -
getFromProtobuf
public static SetNodeOperationalStateCommand getFromProtobuf(org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.SetNodeOperationalStateCommandProto cmdProto) -
toString
- Overrides:
toStringin classSCMCommand<org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.SetNodeOperationalStateCommandProto>
-