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 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:
      getType in class SCMCommand<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:
      getProto in class SCMCommand<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

      public String toString()
      Overrides:
      toString in class SCMCommand<org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.SetNodeOperationalStateCommandProto>