Class SetNodeOperationalStateCommandHandler

java.lang.Object
org.apache.hadoop.ozone.container.common.statemachine.commandhandler.SetNodeOperationalStateCommandHandler
All Implemented Interfaces:
CommandHandler

public class SetNodeOperationalStateCommandHandler extends Object implements CommandHandler
Handle the SetNodeOperationalStateCommand sent from SCM to the datanode to persist the current operational state.
  • Constructor Details

    • SetNodeOperationalStateCommandHandler

      public SetNodeOperationalStateCommandHandler(org.apache.hadoop.hdds.conf.ConfigurationSource conf, Consumer<org.apache.hadoop.hdds.protocol.proto.HddsProtos.NodeOperationalState> replicationSupervisor)
      Set Node State command handler.
      Parameters:
      conf - - Configuration for the datanode.
  • Method Details

    • handle

      public void handle(SCMCommand<?> command, OzoneContainer container, StateContext context, SCMConnectionManager connectionManager)
      Handles a given SCM command.
      Specified by:
      handle in interface CommandHandler
      Parameters:
      command - - SCM Command
      container - - Ozone Container.
      context - - Current Context.
      connectionManager - - The SCMs that we are talking to.
    • getCommandType

      public org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.SCMCommandProto.Type getCommandType()
      Returns the command type that this command handler handles.
      Specified by:
      getCommandType in interface CommandHandler
      Returns:
      Type
    • getInvocationCount

      public int getInvocationCount()
      Returns number of times this handler has been invoked.
      Specified by:
      getInvocationCount in interface CommandHandler
      Returns:
      int
    • getAverageRunTime

      public long getAverageRunTime()
      Returns the average time this function takes to run.
      Specified by:
      getAverageRunTime in interface CommandHandler
      Returns:
      long
    • getTotalRunTime

      public long getTotalRunTime()
      Description copied from interface: CommandHandler
      Returns the total time this function takes to run.
      Specified by:
      getTotalRunTime in interface CommandHandler
      Returns:
      long
    • getQueuedCount

      public int getQueuedCount()
      Description copied from interface: CommandHandler
      Returns the queued command count for this handler.
      Specified by:
      getQueuedCount in interface CommandHandler
      Returns:
      The number of queued commands inside this handler.