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, QuotaConfig writeQuota, Consumer<CommandExecutor> onTakeLeadership, Consumer<CommandExecutor> onReleaseLeadership, Consumer<CommandExecutor> onTakeZoneLeadership, Consumer<CommandExecutor> onReleaseZoneLeadership) Creates a new instance.StandaloneCommandExecutor
(ProjectManager projectManager, Executor repositoryWorker, ServerStatusManager serverStatusManager, SessionManager sessionManager, Consumer<CommandExecutor> onTakeLeadership, Consumer<CommandExecutor> onReleaseLeadership, Consumer<CommandExecutor> onTakeZoneLeadership, Consumer<CommandExecutor> onReleaseZoneLeadership) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected <T> CompletableFuture
<T> protected void
doStart
(Runnable onTakeLeadership, Runnable onReleaseLeadership, Runnable onTakeZoneLeadership, Runnable onReleaseZoneLeadership) protected void
int
Returns the ID of a replica.final void
setWriteQuota
(String projectName, String repoName, QuotaConfig writeQuota) 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, @Nullable QuotaConfig writeQuota, @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 operationsserverStatusManager
- the server status manager for updating the server statussessionManager
- the session manager for creating/removing a sessionwriteQuota
- the write quota for limitingNormalizingPushCommand
onTakeLeadership
- 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
-
StandaloneCommandExecutor
public StandaloneCommandExecutor(ProjectManager projectManager, Executor repositoryWorker, ServerStatusManager serverStatusManager, @Nullable SessionManager sessionManager, @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:CommandExecutor
Returns the ID of a replica. -
doStart
protected void doStart(@Nullable Runnable onTakeLeadership, @Nullable Runnable onReleaseLeadership, @Nullable Runnable onTakeZoneLeadership, @Nullable Runnable onReleaseZoneLeadership) - Specified by:
doStart
in classAbstractCommandExecutor
-
doStop
protected void doStop(@Nullable Runnable onReleaseLeadership, @Nullable Runnable onReleaseZoneLeadership) - Specified by:
doStop
in classAbstractCommandExecutor
-
doExecute
- Specified by:
doExecute
in classAbstractCommandExecutor
- Throws:
Exception
-
setWriteQuota
public final void setWriteQuota(String projectName, String repoName, @Nullable QuotaConfig writeQuota) Description copied from interface:CommandExecutor
-