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
ConstructorDescriptionStandaloneCommandExecutor
(ProjectManager projectManager, Executor repositoryWorker, ServerStatusManager serverStatusManager, SessionManager sessionManager, QuotaConfig writeQuota, Consumer<CommandExecutor> onTakeLeadership, Consumer<CommandExecutor> onReleaseLeadership) Creates a new instance.StandaloneCommandExecutor
(ProjectManager projectManager, Executor repositoryWorker, ServerStatusManager serverStatusManager, SessionManager sessionManager, Consumer<CommandExecutor> onTakeLeadership, Consumer<CommandExecutor> onReleaseLeadership) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected <T> CompletableFuture<T>
protected void
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) 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 statuswriteQuota
- the write quota for limitingNormalizingPushCommand
sessionManager
- 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 leadership
-
StandaloneCommandExecutor
public StandaloneCommandExecutor(ProjectManager projectManager, Executor repositoryWorker, ServerStatusManager serverStatusManager, @Nullable SessionManager sessionManager, @Nullable Consumer<CommandExecutor> onTakeLeadership, @Nullable Consumer<CommandExecutor> onReleaseLeadership) 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 leadership
-
-
Method Details
-
replicaId
public int replicaId()Description copied from interface:CommandExecutor
Returns the ID of a replica. -
doStart
- Specified by:
doStart
in classAbstractCommandExecutor
-
doStop
- 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
-