Class CommandExecutorStatusManager

java.lang.Object
com.linecorp.centraldogma.server.command.CommandExecutorStatusManager

public final class CommandExecutorStatusManager extends Object
Manages the status of a CommandExecutor.
  • Constructor Details

    • CommandExecutorStatusManager

      public CommandExecutorStatusManager(CommandExecutor executor)
      Creates a new instance.
  • Method Details

    • executor

      public CommandExecutor executor()
      Returns the executor that this CommandExecutorStatusManager manages.
    • writable

      public boolean writable()
      Returns whether the executor() is writable.
    • replicating

      public boolean replicating()
      Returns whether the executor() is replicating.
    • updateStatus

      public void updateStatus(UpdateServerStatusCommand command)
      Updates the status of the executor with the specified UpdateServerStatusCommand.

      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

      public void updateStatus(ServerStatus serverStatus)
      Updates the status of the executor with the specified ServerStatus.

      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

      public String toString()
      Overrides:
      toString in class Object