gpt4 book ai didi

org.apache.accumulo.fate.zookeeper.ZooCache.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 01:23:31 25 4
gpt4 key购买 nike

本文整理了Java中org.apache.accumulo.fate.zookeeper.ZooCache.<init>()方法的一些代码示例,展示了ZooCache.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZooCache.<init>()方法的具体详情如下:
包路径:org.apache.accumulo.fate.zookeeper.ZooCache
类名称:ZooCache
方法名:<init>

ZooCache.<init>介绍

[英]Creates a new cache.
[中]创建一个新缓存。

代码示例

代码示例来源:origin: apache/accumulo

public ZooLock(ZooReaderWriter zoo, String path) {
 this(new ZooCache(zoo), zoo, path);
}

代码示例来源:origin: apache/accumulo

public synchronized ZooCache getZooCache() {
 if (zooCache == null)
  zooCache = new ZooCache(context.getZooReaderWriter(), this);
 return zooCache;
}

代码示例来源:origin: apache/accumulo

/**
 * Gets a watched {@link ZooCache}. If the watcher is null, then the same (unwatched) object may
 * be returned for multiple calls with the same remaining arguments.
 *
 * @param zooKeepers
 *          comma-separated list of ZooKeeper host[:port]s
 * @param sessionTimeout
 *          session timeout
 * @param watcher
 *          watcher (optional)
 * @return cache object
 */
public ZooCache getZooCache(String zooKeepers, int sessionTimeout, Watcher watcher) {
 if (watcher == null) {
  // reuse
  return getZooCache(zooKeepers, sessionTimeout);
 }
 return new ZooCache(zooKeepers, sessionTimeout, watcher);
}

代码示例来源:origin: apache/accumulo

public ZooStore(ServerContext context) {
 this.context = context;
 cache = new ZooCache(context.getZooReaderWriter(), null);
 String zkRoot = context.getZooKeeperRoot();
 if (zkRoot.endsWith("/"))
  zkRoot = zkRoot.substring(0, zkRoot.length() - 1);
 this.basePath = zkRoot;
}

代码示例来源:origin: apache/accumulo

/**
 * Gets a {@link ZooCache}. The same object may be returned for multiple calls with the same
 * arguments.
 *
 * @param zooKeepers
 *          comma-separated list of ZooKeeper host[:port]s
 * @param sessionTimeout
 *          session timeout
 * @return cache object
 */
public ZooCache getZooCache(String zooKeepers, int sessionTimeout) {
 String key = zooKeepers + ":" + sessionTimeout;
 synchronized (instances) {
  if (!isEnabled()) {
   throw new IllegalStateException("\"The Accumulo singleton for zookeeper caching is "
     + "disabled. This is likely caused by all AccumuloClients being closed");
  }
  ZooCache zc = instances.get(key);
  if (zc == null) {
   zc = new ZooCache(zooKeepers, sessionTimeout);
   instances.put(key, zc);
  }
  return zc;
 }
}

代码示例来源:origin: apache/accumulo

@Override
public void initialize(ServerContext context, boolean initialize) {
 this.context = context;
 zooCache = new ZooCache(context.getZooReaderWriter(), null);
 ZKUserPath = Constants.ZROOT + "/" + context.getInstanceID() + "/users";
}

代码示例来源:origin: apache/accumulo

protected SecurityOperation(ServerContext context) {
 this.context = context;
 ZKUserPath = Constants.ZROOT + "/" + context.getInstanceID() + "/users";
 zooCache = new ZooCache(context.getZooReaderWriter(), null);
}

代码示例来源:origin: apache/accumulo

@Override
public void initialize(ServerContext context, boolean initialize) {
 this.context = context;
 zooCache = new ZooCache(context.getZooReaderWriter(), null);
 ZKUserPath = ZKSecurityTool.getInstancePath(context.getInstanceID()) + "/users";
}

代码示例来源:origin: apache/accumulo

static synchronized void listInstances(String keepers, boolean printAll, boolean printErrors) {
 errors = 0;
 System.out.println("INFO : Using ZooKeepers " + keepers);
 ZooReader rdr = new ZooReader(keepers, ZOOKEEPER_TIMER_MILLIS);
 ZooCache cache = new ZooCache(keepers, ZOOKEEPER_TIMER_MILLIS);
 TreeMap<String,UUID> instanceNames = getInstanceNames(rdr, printErrors);
 System.out.println();
 printHeader();
 for (Entry<String,UUID> entry : instanceNames.entrySet()) {
  printInstanceInfo(cache, entry.getKey(), entry.getValue(), printErrors);
 }
 TreeSet<UUID> instancedIds = getInstanceIDs(rdr, printErrors);
 instancedIds.removeAll(instanceNames.values());
 if (printAll) {
  for (UUID uuid : instancedIds) {
   printInstanceInfo(cache, null, uuid, printErrors);
  }
 } else if (instancedIds.size() > 0) {
  System.out.println();
  System.out.println("INFO : " + instancedIds.size()
    + " unamed instances were not printed, run with --print-all to see all instances");
 } else {
  System.out.println();
 }
 if (!printErrors && errors > 0) {
  System.err.println(
    "WARN : There were " + errors + " errors, run with --print-errors to see more info");
 }
}

代码示例来源:origin: apache/accumulo

public RecoveryManager(Master master) {
 this.master = master;
 executor = Executors.newScheduledThreadPool(4, new NamingThreadFactory("Walog sort starter "));
 zooCache = new ZooCache(master.getContext().getZooReaderWriter(), null);
 try {
  List<String> workIDs = new DistributedWorkQueue(
    master.getZooKeeperRoot() + Constants.ZRECOVERY, master.getConfiguration())
      .getWorkQueued();
  sortsQueued.addAll(workIDs);
 } catch (Exception e) {
  log.warn("{}", e.getMessage(), e);
 }
}

代码示例来源:origin: apache/accumulo

@Override
public void initialize(ServerContext context, boolean initialize) {
 this.context = context;
 zooCache = new ZooCache(context.getZooReaderWriter(), null);
 impersonation = new UserImpersonation(context.getConfiguration());
 zkAuthenticator.initialize(context, initialize);
 zkUserPath = Constants.ZROOT + "/" + context.getInstanceID() + "/users";
}

代码示例来源:origin: apache/accumulo

public TableManager(ServerContext context) {
 this.context = context;
 zkRoot = context.getZooKeeperRoot();
 instanceID = context.getInstanceID();
 zoo = context.getZooReaderWriter();
 zooStateCache = new ZooCache(zoo, new TableStateWatcher());
 updateTableStateCache();
}

代码示例来源:origin: apache/accumulo

@Override
public void initialize(ServerContext context, boolean initialize) {
 zooCache = new ZooCache(context.getZooReaderWriter(), null);
 zoo = context.getZooReaderWriter();
 String instanceId = context.getInstanceID();
 ZKUserPath = ZKSecurityTool.getInstancePath(instanceId) + "/users";
 ZKTablePath = ZKSecurityTool.getInstancePath(instanceId) + "/tables";
 ZKNamespacePath = ZKSecurityTool.getInstancePath(instanceId) + "/namespaces";
}

代码示例来源:origin: apache/accumulo

@Override
public void assignWork() {
 if (workQueue == null) {
  initializeWorkQueue(conf);
 }
 initializeQueuedWork();
 if (zooCache == null) {
  zooCache = new ZooCache(workQueue.getZooReaderWriter());
 }
 // Get the maximum number of entries we want to queue work for (or the default)
 this.maxQueueSize = conf.getCount(Property.REPLICATION_MAX_WORK_QUEUE);
 // Scan over the work records, adding the work to the queue
 createWork();
 // Keep the state of the work we queued correct
 cleanupFinishedWork();
}

代码示例来源:origin: apache/accumulo

.equals(TabletsSection.ServerColumnFamily.LOCK_COLUMN)) {
if (zooCache == null) {
 zooCache = new ZooCache(context.getZooReaderWriter(), null);

代码示例来源:origin: apache/accumulo

public TabletServer(ServerContext context) {
 this.context = context;
 this.masterLockCache = new ZooCache(context.getZooReaderWriter(), null);
 this.watcher = new TransactionWatcher(context);
 this.confFactory = context.getServerConfFactory();

代码示例来源:origin: org.apache.accumulo/accumulo-server

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

代码示例来源:origin: org.apache.accumulo/accumulo-server

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;
}

代码示例来源:origin: org.apache.accumulo/accumulo-server

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

代码示例来源:origin: org.apache.accumulo/accumulo-server

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);
  @SuppressWarnings("deprecation")
  String deprecatedInstanceIdFromHdfs = ZooKeeperInstance.getInstanceIDFromHdfs(ServerConstants.getInstanceIdLocation());
  instanceId = deprecatedInstanceIdFromHdfs;
 }
 return instance;
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com