Package org.apache.blur.zookeeper

Examples of org.apache.blur.zookeeper.WatchChildren.watch()


    }
  }

  private void watch(String cluster, String path, ConcurrentMap<String, WatchChildren> map) {
    WatchChildren watchForTables = new WatchChildren(_zookeeper, path);
    watchForTables.watch(new OnChange() {
      @Override
      public void action(List<String> children) {
        LOG.info("Layout change.");
        updateLayout();
      }
View Full Code Here


  }

  private WatchChildren watchForShardServerChanges() {
    WatchChildren watchOnlineShards = new WatchChildren(_zookeeper,
        ZookeeperPathConstants.getOnlineShardsPath(_cluster));
    watchOnlineShards.watch(new OnChange() {
      private List<String> _prevOnlineShards = new ArrayList<String>();

      @Override
      public void action(List<String> onlineShards) {
        List<String> oldOnlineShards = _prevOnlineShards;
View Full Code Here

    String path = ZookeeperPathConstants.getTablesPath(cluster);
    if (map.containsKey(cluster)) {
      return;
    }
    WatchChildren watchForTableLayoutChanges = new WatchChildren(_zookeeper, path);
    watchForTableLayoutChanges.watch(new OnChange() {
      @Override
      public void action(List<String> children) {
        LOG.info("Layout change for cluster [{0}].", cluster);
        updateLayout(cluster);
      }
View Full Code Here

    String key = cluster + "|" + table;
    if (map.containsKey(key)) {
      return;
    }
    WatchChildren watchForTableLayoutChanges = new WatchChildren(_zookeeper, path);
    watchForTableLayoutChanges.watch(new OnChange() {
      @Override
      public void action(List<String> children) {
        LOG.info("Layout change for cluster [{0}] table [{1}].", cluster, table);
        updateLayout(cluster);
      }
View Full Code Here

    }
  }

  private void watchForOnlineShardNodes(final String cluster) {
    WatchChildren watch = new WatchChildren(_zk, ZookeeperPathConstants.getOnlineShardsPath(cluster));
    watch.watch(new OnChange() {
      @Override
      public void action(List<String> children) {
        _onlineShardsNodes.put(cluster, children);
      }
    });
View Full Code Here

      for (String cluster : clusters) {
        if (!_tableWatchers.containsKey(cluster)) {
          String tablesPath = ZookeeperPathConstants.getTablesPath(cluster);
          ZkUtils.waitUntilExists(_zk, tablesPath);
          WatchChildren clusterWatcher = new WatchChildren(_zk, tablesPath);
          clusterWatcher.watch(new Tables(cluster));
          _tableWatchers.put(cluster, clusterWatcher);
        }
      }

      List<String> clustersToCloseAndRemove = new ArrayList<String>(clusters);
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.