Examples of ZooCacheFactory


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

   *          Client configuration for specifying connection options.
   *          See {@link ClientConfiguration} which extends Configuration with convenience methods specific to Accumulo.
   * @since 1.6.0
   */
  public ZooKeeperInstance(Configuration config) {
    this(config, new ZooCacheFactory());
  }
View Full Code Here

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

  private final Instance instance;
  private final TabletServerLockChecker lockChecker;
  private final ZooCacheFactory zcf;
 
  RootTabletLocator(Instance instance, TabletServerLockChecker lockChecker) {
    this(instance, lockChecker, new ZooCacheFactory());
  }
View Full Code Here

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

    ArgumentChecker.notNull(instance);
    // create list of servers
    ArrayList<ThriftTransportKey> servers = new ArrayList<ThriftTransportKey>();
   
    // add tservers
    ZooCache zc = new ZooCacheFactory().getZooCache(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut());
    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, Constants.UTF8).equals("master"))
        servers.add(new ThriftTransportKey(
View Full Code Here

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

    });
  }

  @Override
  public List<String> getTabletServers() {
    ZooCache cache = new ZooCacheFactory().getZooCache(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) {
View Full Code Here

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

   
    long startTime = System.currentTimeMillis();
   
    LockID lid = new LockID(ZooUtil.getRoot(instance) + Constants.ZTSERVERS, sessionId.lockId);
   
    ZooCacheFactory zcf = new ZooCacheFactory();
    while (true) {
      if (!ZooLock.isLockHeld(zcf.getZooCache(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut()), lid)) {
        // ACCUMULO-1152 added a tserver lock check to the tablet location cache, so this invalidation prevents future attempts to contact the
        // tserver even its gone zombie and is still running w/o a lock
        locator.invalidateCache(location);
        return;
      }
View Full Code Here

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

 
  private final ZooCache zc;
  private final String root;

  ZookeeperLockChecker(Instance instance) {
    this(instance, new ZooCacheFactory());
  }
View Full Code Here

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

   * @param parent
   *          parent configuration (required)
   * @return configuration
   */
  public ZooConfiguration getInstance(Instance inst, AccumuloConfiguration parent) {
    return getInstance(inst, new ZooCacheFactory(), parent);
  }
View Full Code Here

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

*/
public class HdfsZooInstance implements Instance {

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

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

  private static ZooCache getZooCache(Instance instance) {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
      sm.checkPermission(TABLES_PERMISSION);
    }
    return new ZooCacheFactory().getZooCache(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut());
  }
View Full Code Here

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

  private static ZooCache getZooCache(Instance instance) {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
      sm.checkPermission(TABLES_PERMISSION);
    }
    return new ZooCacheFactory().getZooCache(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut());
  }
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.