Interface CommandExecutor
- All Known Implementing Classes:
AbstractCommandExecutor
,ForwardingCommandExecutor
,StandaloneCommandExecutor
public interface CommandExecutor
An executor interface which executes
Command
s.-
Method Summary
Modifier and TypeMethodDescription<T> CompletableFuture
<T> Executes the specifiedCommand
.boolean
Returnstrue
if the executor is started.boolean
Returnstrue
if the executor can accept theCommand
s making a change to the replica.int
Returns the ID of a replica.void
setWritable
(boolean writable) Makes the executor read/write mode or read-only mode.void
setWriteQuota
(String projectName, String repoName, QuotaConfig writeQuota) start()
Starts the executor.Returns the status manager of this executor.stop()
Stops the executor.
-
Method Details
-
replicaId
int replicaId()Returns the ID of a replica. -
isStarted
boolean isStarted()Returnstrue
if the executor is started. -
start
CompletableFuture<Void> start()Starts the executor. -
stop
CompletableFuture<Void> stop()Stops the executor. -
isWritable
boolean isWritable()Returnstrue
if the executor can accept theCommand
s making a change to the replica.false
would be returned if the replica is running as a read-only mode. -
setWritable
void setWritable(boolean writable) Makes the executor read/write mode or read-only mode.- Parameters:
writable
-true
to make the executor read/write mode, orfalse
to make it read-only mode
-
setWriteQuota
-
execute
Executes the specifiedCommand
.- Type Parameters:
T
- the type of the result to be returned- Parameters:
command
- the command which is supposed to be executed
-
statusManager
CommandExecutorStatusManager statusManager()Returns the status manager of this executor.
-