Class DeleteContainerCommand

java.lang.Object
org.apache.hadoop.ozone.protocol.commands.SCMCommand<org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.DeleteContainerCommandProto>
org.apache.hadoop.ozone.protocol.commands.DeleteContainerCommand
All Implemented Interfaces:
org.apache.hadoop.hdds.server.events.IdentifiableEventPayload

public class DeleteContainerCommand extends SCMCommand<org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.DeleteContainerCommandProto>
SCM command which tells the datanode to delete a container.
  • Constructor Details

    • DeleteContainerCommand

      public DeleteContainerCommand(long containerId)
      DeleteContainerCommand, to send a command for datanode to delete a container.
      Parameters:
      containerId -
    • DeleteContainerCommand

      public DeleteContainerCommand(long containerId, boolean forceFlag)
      DeleteContainerCommand, to send a command for datanode to delete a container.
      Parameters:
      containerId -
      forceFlag - if this is set to true, we delete container without checking state of the container.
    • DeleteContainerCommand

      public DeleteContainerCommand(org.apache.hadoop.hdds.scm.container.ContainerID containerID, boolean forceFlag)
  • Method Details

    • setReplicaIndex

      public void setReplicaIndex(int index)
    • getType

      public org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.SCMCommandProto.Type getType()
      Description copied from class: SCMCommand
      Returns the type of this command.
      Specified by:
      getType in class SCMCommand<org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.DeleteContainerCommandProto>
      Returns:
      Type
    • getProto

      public org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.DeleteContainerCommandProto getProto()
      Description copied from class: SCMCommand
      Gets the protobuf message of this object.
      Specified by:
      getProto in class SCMCommand<org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.DeleteContainerCommandProto>
      Returns:
      A protobuf message.
    • getContainerID

      public long getContainerID()
    • isForce

      public boolean isForce()
    • getFromProtobuf

      public static DeleteContainerCommand getFromProtobuf(org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.DeleteContainerCommandProto protoMessage)
    • getReplicaIndex

      public int getReplicaIndex()
    • toString

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