Package org.apache.zookeeper.Watcher.Event

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


  /**
   * @see org.apache.zookeeper.Watcher#process(org.apache.zookeeper.WatchedEvent)
   */
  @Override
  public synchronized void process (WatchedEvent event) {
    EventType type = event.getType();
    LOG.debug(("Got event " + type + " with path " + event.getPath()));
    if (type.equals(EventType.NodeDeleted)) {
      if (event.getPath().equals(this.zookeeper.clusterStateZNode)) {
        LOG.info("Cluster shutdown while waiting, shutting down" +
          " this master.");
        this.requestShutdown.set(true);
      } else {
        LOG.debug("Master address ZNode deleted, notifying waiting masters");
        notifyAll();
      }
    } else if(type.equals(EventType.NodeCreated) &&
        event.getPath().equals(this.zookeeper.clusterStateZNode)) {
      LOG.debug("Resetting watch on cluster state node.");
      this.zookeeper.setClusterStateWatch(this);
    }
  }
View Full Code Here


   * is called it means either our master has died, or a new one has come up.
   * 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.
View Full Code Here

        this.awaitedTypes = awaitedTypes;
    }

    public void process(WatchedEvent event) {
        this.event = event;
        EventType received = event.getType();
        if (LOG.isDebugEnabled()) {
            LOG.debug(format("Recieved event of type %s for node '%s'", received, event.getPath()));
        }

        for (EventType watched : awaitedTypes) {
View Full Code Here

    }

    @Test
    public void testInvalidIntConversion() {
        try {
            EventType et = EventType.fromInt(324242);
            fail("Was able to create an invalid EventType via an integer");
        } catch(RuntimeException re) {
            // we're good.
        }
View Full Code Here

   * is called it means either our master has died, or a new one has come up.
   * 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.
View Full Code Here

  /**
   * @see org.apache.zookeeper.Watcher#process(org.apache.zookeeper.WatchedEvent)
   */
  @Override
  public synchronized void process(WatchedEvent event) {
    EventType type = event.getType();
    LOG.debug(("Got event " + type + " with path " + event.getPath()));
    if (type.equals(EventType.NodeDeleted)) {
      if(event.getPath().equals(this.zooKeeper.clusterStateZNode)) {
        LOG.info("The cluster was shutdown while waiting, shutting down" +
            " this master.");
        master.shutdownRequested.set(true);
      }
      else {
        LOG.debug("Master address ZNode deleted, notifying waiting masters");
        notifyAll();
      }
    }
    else if(type.equals(EventType.NodeCreated) &&
        event.getPath().equals(this.zooKeeper.clusterStateZNode)) {
      LOG.debug("Resetting the watch on the cluster state node.");
      this.zooKeeper.setClusterStateWatch(this);
    }
  }
View Full Code Here

    public void process(WatchedEvent event) {
      if (log.isTraceEnabled())
        log.trace(event);

      final String zPath = event.getPath();
      final EventType zType = event.getType();

      String tablesPrefix = ZooUtil.getRoot(instance) + Constants.ZTABLES;
      String tableId = null;

      if (zPath != null && zPath.startsWith(tablesPrefix + "/")) {
View Full Code Here

    }

    @Test
    public void testInvalidIntConversion() {
        try {
            EventType et = EventType.fromInt(324242);
            Assert.fail("Was able to create an invalid EventType via an integer");
        } catch(RuntimeException re) {
            // we're good.
        }
View Full Code Here

      }
    }

    @Override
    public void process(WatchedEvent event) {
      EventType type = event.getType();

      if (type == EventType.NodeChildrenChanged) {
        if (LOG.isDebugEnabled()) {
          LOG.debug("signal: number of children changed.");
        }
View Full Code Here

      getDataStore().put(goraKey, goraVertex);
    }

    @Override
    public void process(WatchedEvent event) {
      EventType type = event.getType();
      if (type == EventType.NodeChildrenChanged) {
        if (getLogger().isDebugEnabled()) {
          getLogger().debug("signal: number of children changed.");
        }
        synchronized (lock) {
View Full Code Here

TOP

Related Classes of org.apache.zookeeper.Watcher.Event.EventType

Copyright © 2018 www.massapicom. 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.