Package org.apache.blur.zookeeper

Examples of org.apache.blur.zookeeper.WatchNodeData


    }

    @Override
    public void action(Stat stat) {
      if (stat != null) {
        WatchNodeData watchNodeData = new WatchNodeData(_zk, ZookeeperPathConstants.getSafemodePath(cluster));
        watchNodeData.watch(new WatchNodeData.OnChange() {
          @Override
          public void action(byte[] data) {
            if (data == null) {
              LOG.debug("Safe mode value for cluster [" + cluster + "] is not set.");
              _safeModeMap.put(cluster, Long.MIN_VALUE);
View Full Code Here


      Set<String> oldSet = _tablesPerCluster.put(_cluster, newSet);
      Set<String> newTables = getNewTables(newSet, oldSet);
      Set<String> oldTables = getOldTables(newSet, oldSet);
      for (String table : oldTables) {
        final String clusterTableKey = getClusterTableKey(_cluster, table);
        WatchNodeData watch = _enabledWatchNodeExistance.remove(clusterTableKey);
        if (watch != null) {
          watch.close();
        }
        _tableDescriptorCache.remove(table);
      }
      for (String table : newTables) {
        final String clusterTableKey = getClusterTableKey(_cluster, table);
        WatchNodeData enabledWatcher = new WatchNodeData(_zk, ZookeeperPathConstants.getTablePath(_cluster, table));
        enabledWatcher.watch(new WatchNodeData.OnChange() {
          @Override
          public void action(byte[] data) {
            runActions();
            _tableDescriptorCache.clear();
          }
        });
        if (_enabledWatchNodeExistance.putIfAbsent(clusterTableKey, enabledWatcher) != null) {
          enabledWatcher.close();
        }
      }
    }
View Full Code Here

TOP

Related Classes of org.apache.blur.zookeeper.WatchNodeData

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.