Class DeleteContainerCommandHandler
java.lang.Object
org.apache.hadoop.ozone.container.common.statemachine.commandhandler.DeleteContainerCommandHandler
- All Implemented Interfaces:
CommandHandler
Handler to process the DeleteContainerCommand from SCM.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionDeleteContainerCommandHandler(int threadPoolSize, Clock clock, int queueSize, String threadNamePrefix) protectedDeleteContainerCommandHandler(Clock clock, ThreadPoolExecutor executor, int queueSize) -
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.intReturns the number of threads currently executing tasks in the thread pool for this handler.If the subclass does not override this method, the default implementation will return -1, indicating that the number of active threads is not applicable or not defined.intReturns the maximum number of threads allowed in the thread pool for this handler.intlongReturns the total time this function takes to run.voidhandle(SCMCommand<?> command, OzoneContainer ozoneContainer, StateContext context, SCMConnectionManager connectionManager) Handles a given SCM command.voidstop()Override for any command with an internal threadpool, and stop the executor when this method is invoked.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
updateCommandStatus
-
Constructor Details
-
DeleteContainerCommandHandler
-
DeleteContainerCommandHandler
-
-
Method Details
-
handle
public void handle(SCMCommand<?> command, OzoneContainer ozoneContainer, StateContext context, SCMConnectionManager connectionManager) Description copied from interface:CommandHandlerHandles a given SCM command.- Specified by:
handlein interfaceCommandHandler- Parameters:
command- - SCM CommandozoneContainer- - Ozone Container.context- - Current Context.connectionManager- - The SCMs that we are talking to.
-
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.
-
getCommandType
public org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.SCMCommandProto.Type getCommandType()Description copied from interface:CommandHandlerReturns the command type that this command handler handles.- Specified by:
getCommandTypein interfaceCommandHandler- Returns:
- Type
-
getInvocationCount
public int getInvocationCount()Description copied from interface:CommandHandlerReturns number of times this handler has been invoked.- Specified by:
getInvocationCountin interfaceCommandHandler- Returns:
- int
-
getTimeoutCount
public int getTimeoutCount() -
getAverageRunTime
public long getAverageRunTime()Description copied from interface:CommandHandlerReturns 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
-
getThreadPoolMaxPoolSize
public int getThreadPoolMaxPoolSize()Description copied from interface:CommandHandlerReturns the maximum number of threads allowed in the thread pool for this handler. If the subclass does not override this method, the default implementation will return -1, indicating that the maximum pool size is not applicable or not defined.- Specified by:
getThreadPoolMaxPoolSizein interfaceCommandHandler- Returns:
- The maximum number of threads allowed in the thread pool, or -1 if not applicable or not defined.
-
getThreadPoolActivePoolSize
public int getThreadPoolActivePoolSize()Description copied from interface:CommandHandlerReturns the number of threads currently executing tasks in the thread pool for this handler.If the subclass does not override this method, the default implementation will return -1, indicating that the number of active threads is not applicable or not defined.- Specified by:
getThreadPoolActivePoolSizein interfaceCommandHandler- Returns:
- The number of threads currently executing tasks in the thread pool, or -1 if not applicable or not defined.
-
stop
public void stop()Description copied from interface:CommandHandlerOverride for any command with an internal threadpool, and stop the executor when this method is invoked.- Specified by:
stopin interfaceCommandHandler
-