Class ObserverZooKeeperServer

All Implemented Interfaces:
ServerStats.Provider, SessionTracker.SessionExpirer

public class ObserverZooKeeperServer extends LearnerZooKeeperServer
A ZooKeeperServer for the Observer node type. Not much is different, but we anticipate specializing the request processors in the future.
  • Method Details

    • getObserver

      public Observer getObserver()
    • getLearner

      public Learner getLearner()
      Description copied from class: LearnerZooKeeperServer
      Abstract method to return the learner associated with this server. Since the Learner may change under our feet (when QuorumPeer reassigns it) we can't simply take a reference here. Instead, we need the subclasses to implement this.
      Specified by:
      getLearner in class LearnerZooKeeperServer
    • commitRequest

      public void commitRequest(Request request)
      Unlike a Follower, which sees a full request only during the PROPOSAL phase, Observers get all the data required with the INFORM packet. This method commits a request that has been unpacked by from an INFORM received from the Leader.
      Parameters:
      request -
    • setupRequestProcessors

      protected void setupRequestProcessors()
      Set up the request processors for an Observer: firstProcesor->commitProcessor->finalProcessor
      Overrides:
      setupRequestProcessors in class ZooKeeperServer
    • sync

      public void sync()
    • getState

      public String getState()
      Specified by:
      getState in interface ServerStats.Provider
      Overrides:
      getState in class ZooKeeperServer
    • dumpMonitorValues

      public void dumpMonitorValues(BiConsumer<String,Object> response)
      Description copied from class: ZooKeeperServer
      Hook into admin server, useful to expose additional data that do not represent metrics.
      Overrides:
      dumpMonitorValues in class QuorumZooKeeperServer
      Parameters:
      response - a sink which collects the data.