Class StandaloneCommandExecutor
java.lang.Object
com.linecorp.centraldogma.server.command.AbstractCommandExecutor
com.linecorp.centraldogma.server.command.StandaloneCommandExecutor
- All Implemented Interfaces:
CommandExecutor
A
CommandExecutor implementation which performs operations on the local storage.-
Constructor Summary
ConstructorsConstructorDescriptionStandaloneCommandExecutor(ProjectManager projectManager, Executor repositoryWorker, ServerStatusManager serverStatusManager, SessionManager sessionManager, EncryptionStorageManager encryptionStorageManager, Consumer<CommandExecutor> onTakeLeadership, Consumer<CommandExecutor> onReleaseLeadership, Consumer<CommandExecutor> onTakeZoneLeadership, Consumer<CommandExecutor> onReleaseZoneLeadership) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected <T> CompletableFuture<T> Executes the specifiedCommand.protected voiddoStart(Runnable onTakeLeadership, Runnable onReleaseLeadership, Runnable onTakeZoneLeadership, Runnable onReleaseZoneLeadership) Starts theCommandExecutor.protected voidStops theCommandExecutor.intReturns the ID of a replica.Methods inherited from class com.linecorp.centraldogma.server.command.AbstractCommandExecutor
execute, isStarted, isStopping, isWritable, setWritable, start, statusManager, stop, toString
-
Constructor Details
-
StandaloneCommandExecutor
public StandaloneCommandExecutor(ProjectManager projectManager, Executor repositoryWorker, ServerStatusManager serverStatusManager, @Nullable SessionManager sessionManager, EncryptionStorageManager encryptionStorageManager, @Nullable Consumer<CommandExecutor> onTakeLeadership, @Nullable Consumer<CommandExecutor> onReleaseLeadership, @Nullable Consumer<CommandExecutor> onTakeZoneLeadership, @Nullable Consumer<CommandExecutor> onReleaseZoneLeadership) Creates a new instance.- Parameters:
projectManager- the project manager for accessing the storagerepositoryWorker- the executor which is used for performing storage operationssessionManager- the session manager for creating/removing a sessiononTakeLeadership- the callback to be invoked after the replica has taken the leadershiponReleaseLeadership- the callback to be invoked before the replica releases the leadershiponTakeZoneLeadership- the callback to be invoked after the replica has taken the zone leadershiponReleaseZoneLeadership- the callback to be invoked before the replica releases the zone leadership
-
-
Method Details
-
replicaId
public int replicaId()Description copied from interface:CommandExecutorReturns the ID of a replica. -
doStart
protected void doStart(@Nullable Runnable onTakeLeadership, @Nullable Runnable onReleaseLeadership, @Nullable Runnable onTakeZoneLeadership, @Nullable Runnable onReleaseZoneLeadership) Description copied from class:AbstractCommandExecutorStarts theCommandExecutor.- Specified by:
doStartin classAbstractCommandExecutor
-
doStop
protected void doStop(@Nullable Runnable onReleaseLeadership, @Nullable Runnable onReleaseZoneLeadership) Description copied from class:AbstractCommandExecutorStops theCommandExecutor.- Specified by:
doStopin classAbstractCommandExecutor
-
doExecute
Description copied from class:AbstractCommandExecutorExecutes the specifiedCommand.- Specified by:
doExecutein classAbstractCommandExecutor- Throws:
Exception
-