Class CommandExecutorStatusManager
java.lang.Object
com.linecorp.centraldogma.server.command.CommandExecutorStatusManager
Manages the status of a
CommandExecutor
.-
Constructor Summary
ConstructorDescriptionCommandExecutorStatusManager
(CommandExecutor executor) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionexecutor()
Returns the executor that thisCommandExecutorStatusManager
manages.boolean
Returns whether theexecutor()
is replicating.boolean
setReplicating
(boolean newReplicating) Sets the executor to replicating mode or non-replicating mode.boolean
setWritable
(boolean newWritable) Sets the executor to read/write mode or read-only mode.toString()
void
updateStatus
(UpdateServerStatusCommand command) Updates the status of the executor with the specifiedUpdateServerStatusCommand
.void
updateStatus
(ServerStatus serverStatus) Updates the status of the executor with the specifiedServerStatus
.boolean
writable()
Returns whether theexecutor()
is writable.
-
Constructor Details
-
CommandExecutorStatusManager
Creates a new instance.
-
-
Method Details
-
executor
Returns the executor that thisCommandExecutorStatusManager
manages. -
writable
public boolean writable()Returns whether theexecutor()
is writable. -
replicating
public boolean replicating()Returns whether theexecutor()
is replicating. -
updateStatus
Updates the status of the executor with the specifiedUpdateServerStatusCommand
.This method could take a long time if the executor is not in the desired state yet. So it should be not called from an event loop thread.
-
updateStatus
Updates the status of the executor with the specifiedServerStatus
.This method could take a long time if the executor is not in the desired state yet. So it should be not called from an event loop thread.
-
setWritable
public boolean setWritable(boolean newWritable) Sets the executor to read/write mode or read-only mode.- Returns:
true
if the executor is already in the specified mode, or the mode has been updated successfully.
-
setReplicating
public boolean setReplicating(boolean newReplicating) Sets the executor to replicating mode or non-replicating mode.This method could take a long time if the executor is not in the desired state yet. So it should be not called from an event loop thread.
- Returns:
true
if the executor is already in the specified mode, or the mode has been updated successfully.
-
toString
-