Class SetNodeOperationalStateCommandHandler
java.lang.Object
org.apache.hadoop.ozone.container.common.statemachine.commandhandler.SetNodeOperationalStateCommandHandler
- All Implemented Interfaces:
CommandHandler
Handle the SetNodeOperationalStateCommand sent from SCM to the datanode
to persist the current operational state.
-
Constructor Summary
ConstructorsConstructorDescriptionSetNodeOperationalStateCommandHandler(org.apache.hadoop.hdds.conf.ConfigurationSource conf, Consumer<org.apache.hadoop.hdds.protocol.proto.HddsProtos.NodeOperationalState> replicationSupervisor) Set Node State command handler. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the average time this function takes to run.org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.SCMCommandProto.TypeReturns the command type that this command handler handles.intReturns number of times this handler has been invoked.intReturns the queued command count for this handler.longReturns the total time this function takes to run.voidhandle(SCMCommand<?> command, OzoneContainer container, StateContext context, SCMConnectionManager connectionManager) Handles a given SCM command.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.ozone.container.common.statemachine.commandhandler.CommandHandler
getThreadPoolActivePoolSize, getThreadPoolMaxPoolSize, stop, updateCommandStatus
-
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:
handlein interfaceCommandHandler- Parameters:
command- - SCM Commandcontainer- - 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:
getCommandTypein interfaceCommandHandler- Returns:
- Type
-
getInvocationCount
public int getInvocationCount()Returns number of times this handler has been invoked.- Specified by:
getInvocationCountin interfaceCommandHandler- Returns:
- int
-
getAverageRunTime
public long getAverageRunTime()Returns the average time this function takes to run.- Specified by:
getAverageRunTimein interfaceCommandHandler- Returns:
- long
-
getTotalRunTime
public long getTotalRunTime()Description copied from interface:CommandHandlerReturns the total time this function takes to run.- Specified by:
getTotalRunTimein interfaceCommandHandler- Returns:
- long
-
getQueuedCount
public int getQueuedCount()Description copied from interface:CommandHandlerReturns the queued command count for this handler.- Specified by:
getQueuedCountin interfaceCommandHandler- Returns:
- The number of queued commands inside this handler.
-