Package com.linkedin.venice.controller
Class AdminCommandExecutionTracker
- java.lang.Object
-
- com.linkedin.venice.controller.AdminCommandExecutionTracker
-
public class AdminCommandExecutionTracker extends java.lang.Object
This class is used to track the execution of the async admin command. Async admin command is a kind of admin command which is sent to a parent controller and propagated through a Kafka admin topic. Eventually command would be executed by the controller in each PROD fabric.The context of command execution would be stored in this tracker and expired in case it lives longer than TTL. It also provides a way to check the latest execution status of given command by sending requests to remote fabric. But the checking logic is defined in a closure when the command was created.
This class is Thread-safe.
-
-
Constructor Summary
Constructors Constructor Description AdminCommandExecutionTracker(java.lang.String cluster, ExecutionIdAccessor executionIdAccessor, java.util.Map<java.lang.String,ControllerClient> fabricToControllerClientsMap)
AdminCommandExecutionTracker(java.lang.String cluster, ExecutionIdAccessor executionIdAccessor, java.util.Map<java.lang.String,ControllerClient> fabricToControllerClientsMap, int executionTTLHour)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AdminCommandExecution
checkExecutionStatus(long id)
Check the latest status of execution in remote fabrics.AdminCommandExecution
createExecution(java.lang.String operation)
Create an execution context of a command.long
getLastExecutionId()
void
startTrackingExecution(AdminCommandExecution execution)
Add execution context into local memory and expired old executions if needed.
-
-
-
Constructor Detail
-
AdminCommandExecutionTracker
public AdminCommandExecutionTracker(java.lang.String cluster, ExecutionIdAccessor executionIdAccessor, java.util.Map<java.lang.String,ControllerClient> fabricToControllerClientsMap, int executionTTLHour)
-
AdminCommandExecutionTracker
public AdminCommandExecutionTracker(java.lang.String cluster, ExecutionIdAccessor executionIdAccessor, java.util.Map<java.lang.String,ControllerClient> fabricToControllerClientsMap)
-
-
Method Detail
-
createExecution
public AdminCommandExecution createExecution(java.lang.String operation)
Create an execution context of a command.
-
startTrackingExecution
public void startTrackingExecution(AdminCommandExecution execution)
Add execution context into local memory and expired old executions if needed.
-
checkExecutionStatus
public AdminCommandExecution checkExecutionStatus(long id)
Check the latest status of execution in remote fabrics.
-
getLastExecutionId
public long getLastExecutionId()
-
-