Package org.apache.accumulo.fate.zookeeper

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


    }
  }

  private HdfsZooInstance() {
    AccumuloConfiguration acuConf = ServerConfiguration.getSiteConfiguration();
    zooCache = new ZooCache(acuConf.get(Property.INSTANCE_ZK_HOST), (int) acuConf.getTimeInMillis(Property.INSTANCE_ZK_TIMEOUT));
  }
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

    }
  }

  private HdfsZooInstance() {
    AccumuloConfiguration acuConf = ServerConfiguration.getSiteConfiguration();
    zooCache = new ZooCache(acuConf.get(Property.INSTANCE_ZK_HOST), (int) acuConf.getTimeInMillis(Property.INSTANCE_ZK_TIMEOUT));
  }
View Full Code Here

  @Override
  public void invalidateCache(Collection<KeyExtent> keySet) {}
 
  @Override
  public void invalidateCache(String server) {
    ZooCache zooCache = ZooCache.getInstance(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut());
    String root = ZooUtil.getRoot(instance) + Constants.ZTSERVERS;
    zooCache.clear(root + "/" + server);
  }
View Full Code Here

  @Override
  public void invalidateCache() {}
 
  protected TabletLocation getRootTabletLocation() {
    String zRootLocPath = ZooUtil.getRoot(instance) + RootTable.ZROOT_TABLET_LOCATION;
    ZooCache zooCache = ZooCache.getInstance(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut());
   
    OpTimer opTimer = new OpTimer(Logger.getLogger(this.getClass()), Level.TRACE).start("Looking up root tablet location in zookeeper.");
    byte[] loc = zooCache.get(zRootLocPath);
    opTimer.stop("Found root tablet at " + (loc == null ? null : new String(loc)) + " in %DURATION%");
   
    if (loc == null) {
      return null;
    }
View Full Code Here

    this.parent = parent;
  }
 
  synchronized public static ZooConfiguration getInstance(Instance inst, AccumuloConfiguration parent) {
    if (instance == null) {
      propCache = new ZooCache(inst.getZooKeepers(), inst.getZooKeepersSessionTimeOut());
      instance = new ZooConfiguration(parent);
      instanceId = inst.getInstanceID();
    }
    return instance;
  }
View Full Code Here

    return instance;
  }
 
  synchronized public static ZooConfiguration getInstance(AccumuloConfiguration parent) {
    if (instance == null) {
      propCache = new ZooCache(parent.get(Property.INSTANCE_ZK_HOST), (int) parent.getTimeInMillis(Property.INSTANCE_ZK_TIMEOUT));
      instance = new ZooConfiguration(parent);
      // InstanceID should be the same across all volumes, so just choose one
      VolumeManager fs;
      try {
        fs = VolumeManagerImpl.get();
View Full Code Here

  }

  private void initializeZooCache() {
    synchronized (initLock) {
      if (null == tablePropCache) {
        tablePropCache = new ZooCache(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut(), new TableConfWatcher(instance));
      }
    }
  }
View Full Code Here

  @Override
  public void getProperties(Map<String,String> props, PropertyFilter filter) {
    parent.getProperties(props, filter);

    ZooCache zc = getTablePropCache();

    List<String> children = zc.getChildren(ZooUtil.getRoot(instanceId) + Constants.ZTABLES + "/" + table + Constants.ZTABLE_CONF);
    if (children != null) {
      for (String child : children) {
        if (child != null && filter.accept(child)) {
          String value = get(zc, child);
          if (value != null)
View Full Code Here

  }

  private void initializePropCache() {
    synchronized (lock) {
      if (propCache == null)
        propCache = new ZooCache(inst.getZooKeepers(), inst.getZooKeepersSessionTimeOut(), new NamespaceConfWatcher(inst));
    }
  }
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.