Package org.apache.accumulo.fate.zookeeper

Examples of org.apache.accumulo.fate.zookeeper.ZooCache


    });
  }

  @Override
  public List<String> getTabletServers() {
    ZooCache cache = ZooCache.getInstance(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut());
    String path = ZooUtil.getRoot(instance) + Constants.ZTSERVERS;
    List<String> results = new ArrayList<String>();
    for (String candidate : cache.getChildren(path)) {
      List<String> children = cache.getChildren(path + "/" + candidate);
      if (children != null && children.size() > 0) {
        List<String> copy = new ArrayList<String>(children);
        Collections.sort(copy);
        byte[] data = cache.get(path + "/" + candidate + "/" + copy.get(0));
        if (data != null && !"master".equals(new String(data, Constants.UTF8))) {
          results.add(candidate);
        }
      }
    }
View Full Code Here


    Instance instance = HdfsZooInstance.getInstance();
    String tserverPath = ZooUtil.getRoot(instance) + Constants.ZTSERVERS;
    Opts opts = new Opts();
    opts.parseArgs(TabletServerLocks.class.getName(), args);
   
    ZooCache cache = new ZooCache(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut());
   
    if (opts.list) {
      IZooReaderWriter zoo = ZooReaderWriter.getInstance();
     
      List<String> tabletServers = zoo.getChildren(tserverPath);
View Full Code Here

TOP

Related Classes of org.apache.accumulo.fate.zookeeper.ZooCache

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.