Interface CommandExecutor

All Known Implementing Classes:
AbstractCommandExecutor, ForwardingCommandExecutor, StandaloneCommandExecutor

public interface CommandExecutor
An executor interface which executes Commands.
  • Method Details

    • replicaId

      int replicaId()
      Returns the ID of a replica.
    • isStarted

      boolean isStarted()
      Returns true if the executor is started.
    • start

      Starts the executor.
    • stop

      Stops the executor.
    • isWritable

      boolean isWritable()
      Returns true if the executor can accept the Commands 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, or false to make it read-only mode
    • setWriteQuota

      void setWriteQuota(String projectName, String repoName, @Nullable QuotaConfig writeQuota)
      Sets the specified write quota to the specified repoName in the specified projectName.
    • execute

      <T> CompletableFuture<T> execute(Command<T> command)
      Executes the specified Command.
      Type Parameters:
      T - the type of the result to be returned
      Parameters:
      command - the command which is supposed to be executed