Package org.apache.accumulo.core.zookeeper

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


  private static ZooCache getPropCache() {
   
    if (propCache == null)
      synchronized (ZooConfiguration.class) {
        if (propCache == null)
          propCache = new ZooCache();
      }
    return propCache;
  }
View Full Code Here


   
  }
 
  public synchronized ZooCache getZooCache() {
    if (zooCache == null)
      zooCache = new ZooCache(this);
    return zooCache;
  }
View Full Code Here

  interface NewLoggerWatcher {
    void newLogger(String address);
  }
 
  public TabletServerLoggers(NewLoggerWatcher watcher) {
    cache = new ZooCache(this);
    this.watcher = watcher;
  }
View Full Code Here

    this(HdfsZooInstance.getInstance().getInstanceID());
  }
 
  public ZKAuthenticator(String instanceId) {
    ZKUserPath = Constants.ZROOT + "/" + instanceId + "/users";
    zooCache = new ZooCache();
  }
View Full Code Here

              violations = new ArrayList<Short>();
            violations.add((short) 3);
          }
        } else if (new ColumnFQ(columnUpdate).equals(Constants.METADATA_LOCK_COLUMN)) {
          if (zooCache == null) {
            zooCache = new ZooCache();
          }
         
          if (zooRoot == null) {
            zooRoot = ZooUtil.getRoot(HdfsZooInstance.getInstance());
          }
View Full Code Here

   * @see org.apache.accumulo.core.client.admin.InstanceOperations#getTabletServers()
   */
 
  @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))) {
          results.add(candidate);
        }
      }
    }
View Full Code Here

public class ServerClient {
  private static final Logger log = Logger.getLogger(ServerClient.class);
  private static final Map<String,ZooCache> zooCaches = new HashMap<String,ZooCache>();
 
  private synchronized static ZooCache getZooCache(Instance instance) {
    ZooCache result = zooCaches.get(instance.getZooKeepers());
    if (result == null) {
      result = new ZooCache(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut(), null);
      zooCaches.put(instance.getZooKeepers(), result);
    }
    return result;
  }
View Full Code Here

    // create list of servers
    ArrayList<ThriftTransportKey> servers = new ArrayList<ThriftTransportKey>();
   
    // add tservers
   
    ZooCache zc = getZooCache(instance);
    AccumuloConfiguration conf = instance.getConfiguration();
    for (String tserver : zc.getChildren(ZooUtil.getRoot(instance) + Constants.ZTSERVERS)) {
      String path = ZooUtil.getRoot(instance) + Constants.ZTSERVERS + "/" + tserver;
      byte[] data = ZooUtil.getLockData(zc, path);
      if (data != null && !new String(data).equals("master"))
        servers.add(new ThriftTransportKey(
            new ServerServices(new String(data)).getAddressString(Service.TSERV_CLIENT),
View Full Code Here

TOP

Related Classes of org.apache.accumulo.core.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.