org.apache.helix.manager.zk.ZkClient.deleteRecursive()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(159)

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

ZkClient.deleteRecursive介绍

暂无

代码示例

代码示例来源:origin: apache/incubator-pinot

@Override
 public boolean execute()
   throws Exception {
  LOGGER.info("Connecting to Zookeeper at address: {}", _zkAddress);
  ZkClient zkClient = new ZkClient(_zkAddress, 5000);
  String helixClusterName = "/" + _clusterName;

  LOGGER.info("Executing command: " + toString());
  if (!zkClient.exists(helixClusterName)) {
   LOGGER.error("Cluster {} does not exist.", _clusterName);
   return false;
  }

  zkClient.deleteRecursive(helixClusterName);
  return true;
 }
}

代码示例来源:origin: apache/incubator-pinot

FakeHelixManager(String clusterName, String instanceName, InstanceType instanceType, String zkAddress) {
 super(clusterName, instanceName, instanceType, zkAddress);
 super._zkclient = new ZkClient(StringUtil.join("/", StringUtils.chomp(ZkStarter.DEFAULT_ZK_STR, "/")),
   ZkClient.DEFAULT_SESSION_TIMEOUT, ZkClient.DEFAULT_CONNECTION_TIMEOUT, new ZNRecordSerializer());
 _zkclient.deleteRecursive("/" + clusterName + "/PROPERTYSTORE");
 _zkclient.createPersistent("/" + clusterName + "/PROPERTYSTORE", true);
 setPropertyStore(clusterName);
}

代码示例来源:origin: apache/incubator-pinot

protected void startController(ControllerConf config) {
 Assert.assertNotNull(config);
 Assert.assertNull(_controllerStarter);
 _controllerPort = Integer.valueOf(config.getControllerPort());
 _controllerBaseApiUrl = "http://localhost:" + _controllerPort;
 _controllerRequestURLBuilder = ControllerRequestURLBuilder.baseUrl(_controllerBaseApiUrl);
 _controllerDataDir = config.getDataDir();
 String helixClusterName = getHelixClusterName();
 config.setHelixClusterName(helixClusterName);
 String zkStr = config.getZkStr();
 _zkClient = new ZkClient(zkStr);
 if (_zkClient.exists("/" + helixClusterName)) {
  _zkClient.deleteRecursive("/" + helixClusterName);
 }
 startControllerStarter(config);
 _helixManager = _helixResourceManager.getHelixZkManager();
 _helixAdmin = _helixResourceManager.getHelixAdmin();
 _propertyStore = _helixResourceManager.getPropertyStore();
}

代码示例来源:origin: apache/incubator-pinot

@BeforeTest
public void beforeTest() {
 _zookeeperInstance = ZkStarter.startLocalZkServer();
 _zkClient = new ZkClient(StringUtil.join("/", StringUtils.chomp(ZkStarter.DEFAULT_ZK_STR, "/")),
   ZkClient.DEFAULT_SESSION_TIMEOUT, ZkClient.DEFAULT_CONNECTION_TIMEOUT, new ZNRecordSerializer());
 String helixClusterName = "TestTimeBoundaryService";
 _zkClient.deleteRecursive("/" + helixClusterName + "/PROPERTYSTORE");
 _zkClient.createPersistent("/" + helixClusterName + "/PROPERTYSTORE", true);
 _propertyStore = new ZkHelixPropertyStore<>(new ZkBaseDataAccessor<ZNRecord>(_zkClient),
   "/" + helixClusterName + "/PROPERTYSTORE", null);
}

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

/**
 * sync remove
 */
@Override
public boolean remove(String path, int options) {
 try {
  // optimize on common path
  return _zkClient.delete(path);
 } catch (ZkException e) {
  LOG.warn(String.format("Caught exception when deleting %s with options %s.", path, options),
    e);
  return _zkClient.deleteRecursive(path);
 }
}

相关文章