Examples of KeeperState


Examples of org.apache.zookeeper.Watcher.Event.KeeperState

     * for more information.
     *
     * @param event WatchedEvent witnessed by ZooKeeper.
     */
    public void process(WatchedEvent event) {
      KeeperState state = event.getState();
      if(!state.equals(KeeperState.SyncConnected)) {
        LOG.debug("Got ZooKeeper event, state: " + state + ", type: "
            + event.getType() + ", path: " + event.getPath());
      }
      if (state == KeeperState.Expired) {
        resetZooKeeper();
View Full Code Here

Examples of org.apache.zookeeper.Watcher.Event.KeeperState

   * Either way we need to update our knowledge of the master.
   * @param event WatchedEvent from ZooKeeper.
   */
  public void process(WatchedEvent event) {
    EventType type = event.getType();
    KeeperState state = event.getState();
    LOG.info("Got ZooKeeper event, state: " + state + ", type: " +
      type + ", path: " + event.getPath());

    // Ignore events if we're shutting down.
    if (this.stopRequested.get()) {
View Full Code Here

Examples of org.apache.zookeeper.Watcher.Event.KeeperState

      try {
        if (!this.connected) {
          this.zookeeper = new ZooKeeper(this.url, 3000, new Watcher() {
            @Override
            public void process(WatchedEvent event) {
              KeeperState state = event.getState();
              if (state == KeeperState.Disconnected || state == KeeperState.Expired) {
                log.warn("Zookeeper [" + name + "] disconnected event.");
                database.setZookeeperOffline(id);
                Notifier.getNotifier().notifyZookeeperOffline(name);
                connected = false;
View Full Code Here

Examples of org.apache.zookeeper.Watcher.Event.KeeperState

        }
    }

    void queueEvent(String clientPath, int err,
            Set<Watcher> materializedWatchers, EventType eventType) {
        KeeperState sessionState = KeeperState.SyncConnected;
        if (KeeperException.Code.SESSIONEXPIRED.intValue() == err
                || KeeperException.Code.CONNECTIONLOSS.intValue() == err) {
            sessionState = Event.KeeperState.Disconnected;
        }
        WatchedEvent event = new WatchedEvent(eventType, sessionState,
View Full Code Here

Examples of org.apache.zookeeper.Watcher.Event.KeeperState

                                   LOG.error("SASL authentication with Zookeeper Quorum member failed: " + e);
                                    state = States.AUTH_FAILED;
                                    sendAuthEvent = true;
                                }
                            }
                            KeeperState authState = zooKeeperSaslClient.getKeeperState();
                            if (authState != null) {
                                if (authState == KeeperState.AuthFailed) {
                                    // An authentication error occurred during authentication with the Zookeeper Server.
                                    state = States.AUTH_FAILED;
                                    sendAuthEvent = true;
View Full Code Here

Examples of org.apache.zookeeper.Watcher.Event.KeeperState

            LOG.info("Session establishment complete on server "
                    + clientCnxnSocket.getRemoteSocketAddress()
                    + ", sessionid = 0x" + Long.toHexString(sessionId)
                    + ", negotiated timeout = " + negotiatedSessionTimeout
                    + (isRO ? " (READ-ONLY mode)" : ""));
            KeeperState eventState = (isRO) ?
                    KeeperState.ConnectedReadOnly : KeeperState.SyncConnected;
            eventThread.queueEvent(new WatchedEvent(
                    Watcher.Event.EventType.None,
                    eventState, null));
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.