gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-13 22:42:03 27 4
gpt4 key购买 nike

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

ZooLock.deleteLock介绍

暂无

代码示例

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

@Override
public Repo<Master> call(long tid, Master master) throws Exception {
 // suppress assignment of tablets to the server
 if (force) {
  ZooReaderWriter zoo = master.getContext().getZooReaderWriter();
  String path = master.getZooKeeperRoot() + Constants.ZTSERVERS + "/" + server.getLocation();
  ZooLock.deleteLock(zoo, path);
  path = master.getZooKeeperRoot() + Constants.ZDEADTSERVERS + "/" + server.getLocation();
  zoo.putPersistentData(path, "forced down".getBytes(UTF_8), NodeExistsPolicy.OVERWRITE);
 }
 return null;
}

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

public static void main(String[] args) throws Exception {
 try (ServerContext context = new ServerContext(new SiteConfiguration())) {
  String tserverPath = context.getZooKeeperRoot() + Constants.ZTSERVERS;
  Opts opts = new Opts();
  opts.parseArgs(TabletServerLocks.class.getName(), args);
  ZooCache cache = context.getZooCache();
  ZooReaderWriter zoo = context.getZooReaderWriter();
  if (opts.list) {
   List<String> tabletServers = zoo.getChildren(tserverPath);
   for (String tabletServer : tabletServers) {
    byte[] lockData = ZooLock.getLockData(cache, tserverPath + "/" + tabletServer, null);
    String holder = null;
    if (lockData != null) {
     holder = new String(lockData, UTF_8);
    }
    System.out.printf("%32s %16s%n", tabletServer, holder);
   }
  } else if (opts.delete != null) {
   ZooLock.deleteLock(zoo, tserverPath + "/" + args[1]);
  } else {
   System.out.println(
     "Usage : " + TabletServerLocks.class.getName() + " -list|-delete <tserver lock>");
  }
 }
}

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

String path = tserversPath + "/" + child;
if (zoo.getChildren(path).size() > 0) {
 if (!ZooLock.deleteLock(zoo, path, "tserver")) {
  message("Did not delete " + tserversPath + "/" + child, opts);

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

private void killMacGc() throws ProcessNotFoundException, InterruptedException, KeeperException {
 // kill gc started by MAC
 getCluster().killProcess(ServerType.GARBAGE_COLLECTOR,
   getCluster().getProcesses().get(ServerType.GARBAGE_COLLECTOR).iterator().next());
 // delete lock in zookeeper if there, this will allow next GC to start quickly
 String path = ZooUtil.getRoot(new ZooKeeperInstance(getCluster().getClientConfig()))
   + Constants.ZGC_LOCK;
 ZooReaderWriter zk = new ZooReaderWriter(cluster.getZooKeepers(), 30000, OUR_SECRET);
 try {
  ZooLock.deleteLock(zk, path);
 } catch (IllegalStateException e) {
 }
 assertNull(getCluster().getProcesses().get(ServerType.GARBAGE_COLLECTOR));
}

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