gpt4 book ai didi

org.apache.accumulo.core.zookeeper.ZooUtil.getRoot()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 01:02:49 27 4
gpt4 key购买 nike

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

ZooUtil.getRoot介绍

暂无

代码示例

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

NamespaceConfWatcher(Instance instance) {
 this.instance = instance;
 namespacesPrefix = ZooUtil.getRoot(instance) + Constants.ZNAMESPACES + "/";
 namespacesPrefixLength = namespacesPrefix.length();
 scf = new ServerConfigurationFactory(instance);
}

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

private String get(String key) {
 String zPath = ZooUtil.getRoot(instanceId) + Constants.ZCONFIG + "/" + key;
 byte[] v = propCache.get(zPath);
 String value = null;
 if (v != null)
  value = new String(v, UTF_8);
 return value;
}

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

private void updateTableStateCache() {
 synchronized (tableStateCache) {
  for (String tableId : zooStateCache
    .getChildren(ZooUtil.getRoot(instance) + Constants.ZTABLES))
   if (zooStateCache.get(ZooUtil.getRoot(instance) + Constants.ZTABLES + "/" + tableId
     + Constants.ZTABLE_STATE) != null)
    updateTableStateCache(tableId);
 }
}

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

private void updateTableStateCache() {
 synchronized (tableStateCache) {
  for (String tableId : zooStateCache.getChildren(ZooUtil.getRoot(instance) + Constants.ZTABLES))
   if (zooStateCache.get(ZooUtil.getRoot(instance) + Constants.ZTABLES + "/" + tableId + Constants.ZTABLE_STATE) != null)
    updateTableStateCache(tableId);
 }
}

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

public static String getRootTabletDir() throws IOException {
 IZooReaderWriter zoo = ZooReaderWriter.getInstance();
 String zpath = ZooUtil.getRoot(HdfsZooInstance.getInstance()) + RootTable.ZROOT_TABLET_PATH;
 try {
  return new String(zoo.getData(zpath, null), UTF_8);
 } catch (KeeperException e) {
  throw new IOException(e);
 } catch (InterruptedException e) {
  Thread.currentThread().interrupt();
  throw new IOException(e);
 }
}

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

private String get(String key) {
 String zPath = ZooUtil.getRoot(instanceId) + Constants.ZTABLES + "/" + table + Constants.ZTABLE_CONF + "/" + key;
 byte[] v = getTablePropCache().get(zPath);
 String value = null;
 if (v != null)
  value = new String(v, UTF_8);
 return value;
}

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

public MonitorLog4jWatcher(String instance, String filename) {
 super(filename);
 this.path = ZooUtil.getRoot(instance) + Constants.ZMONITOR_LOG4J_ADDR;
 this.lock = new Object();
 this.logConfig = new Log4jConfiguration(filename);
 doOnChange();
}

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

private String getZPath() throws IOException {
 ByteArrayOutputStream baos = new ByteArrayOutputStream();
 DataOutputStream dos = new DataOutputStream(baos);
 dos.writeUTF(getTableName());
 dos.writeUTF(getProblemType().name());
 dos.writeUTF(getResource());
 dos.close();
 baos.close();
 String zpath = ZooUtil.getRoot(HdfsZooInstance.getInstance()) + Constants.ZPROBLEMS + "/" + Encoding.encodeAsBase64FileName(new Text(baos.toByteArray()));
 return zpath;
}

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

public void removeNamespace(String namespaceId) throws KeeperException, InterruptedException {
 ZooReaderWriter.getInstance().recursiveDelete(
   ZooUtil.getRoot(instance) + Constants.ZNAMESPACES + "/" + namespaceId,
   NodeMissingPolicy.SKIP);
}

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

@Override
public boolean transactionAlive(String type, long tid) throws Exception {
 String path = ZooUtil.getRoot(instance) + "/" + type + "/" + tid;
 rdr.sync(path);
 return rdr.exists(path);
}

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

@Override
 public boolean transactionComplete(String type, long tid) throws Exception {
  String path = ZooUtil.getRoot(instance) + "/" + type + "/" + tid + "-running";
  rdr.sync(path);
  return !rdr.exists(path);
 }
}

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

public static void clearCache(Instance instance) {
 getZooCache(instance).clear(ZooUtil.getRoot(instance) + Constants.ZTABLES);
 getZooCache(instance).clear(ZooUtil.getRoot(instance) + Constants.ZNAMESPACES);
 instanceToMapCache.invalidate(instance.getInstanceID());
}

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

public static String getLocation(Instance instance) throws KeeperException, InterruptedException {
  ZooReader zr = new ZooReader(instance.getZooKeepers(), 30000);
  byte[] loc = zr.getData(ZooUtil.getRoot(instance) + Constants.ZMONITOR_HTTP_ADDR, null);
  return loc == null ? null : new String(loc, UTF_8);
 }
}

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

static ProblemReport decodeZooKeeperEntry(String node) throws Exception {
 byte bytes[] = Encoding.decodeBase64FileName(node);
 ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
 DataInputStream dis = new DataInputStream(bais);
 String tableName = dis.readUTF();
 String problemType = dis.readUTF();
 String resource = dis.readUTF();
 String zpath = ZooUtil.getRoot(HdfsZooInstance.getInstance()) + Constants.ZPROBLEMS + "/" + node;
 byte[] enc = ZooReaderWriter.getInstance().getData(zpath, null);
 return new ProblemReport(tableName, ProblemType.valueOf(problemType), resource, enc);
}

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

void setMasterGoalState(MasterGoalState state) {
 try {
  ZooReaderWriter.getInstance().putPersistentData(
    ZooUtil.getRoot(getInstance()) + Constants.ZMASTER_GOAL_STATE, state.name().getBytes(),
    NodeExistsPolicy.OVERWRITE);
 } catch (Exception ex) {
  log.error("Unable to set master goal state in zookeeper");
 }
}

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

public void clearMergeState(Text tableId) throws IOException, KeeperException, InterruptedException {
 synchronized (mergeLock) {
  String path = ZooUtil.getRoot(instance.getInstanceID()) + Constants.ZTABLES + "/" + tableId.toString() + "/merge";
  ZooReaderWriter.getInstance().recursiveDelete(path, NodeMissingPolicy.SKIP);
  mergeLock.notifyAll();
 }
 nextEvent.event("Merge state of %s cleared", tableId);
}

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

public void startWatchingForRecoveryLogs(ThreadPoolExecutor distWorkQThreadPool)
  throws KeeperException, InterruptedException {
 this.threadPool = distWorkQThreadPool;
 new DistributedWorkQueue(ZooUtil.getRoot(instance) + Constants.ZRECOVERY, conf)
   .startProcessing(new LogProcessor(), this.threadPool);
}

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

public static void stop(String type, long tid) throws KeeperException, InterruptedException {
 Instance instance = HdfsZooInstance.getInstance();
 IZooReaderWriter writer = ZooReaderWriter.getInstance();
 writer.recursiveDelete(ZooUtil.getRoot(instance) + "/" + type + "/" + tid,
   NodeMissingPolicy.SKIP);
}

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

public static void removeSystemProperty(String property) throws InterruptedException, KeeperException {
  String zPath = ZooUtil.getRoot(HdfsZooInstance.getInstance()) + Constants.ZCONFIG + "/" + property;
  ZooReaderWriter.getInstance().recursiveDelete(zPath, NodeMissingPolicy.FAIL);
 }
}

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

@Override
public void invalidateCache(Instance instance, String server) {
 ZooCache zooCache = zcf.getZooCache(instance.getZooKeepers(),
   instance.getZooKeepersSessionTimeOut());
 String root = ZooUtil.getRoot(instance) + Constants.ZTSERVERS;
 zooCache.clear(root + "/" + server);
}

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