gpt4 book ai didi

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

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

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

ZooUtil.getInstanceIDFromHdfs介绍

[英]Utility to support certain client side utilities to minimize command-line options.
[中]实用程序支持某些客户端实用程序,以最小化命令行选项。

代码示例

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

/**
 * Utility to support certain client side utilities to minimize command-line options.
 */
public static String getInstanceIDFromHdfs(Path instanceDirectory, AccumuloConfiguration conf) {
 return getInstanceIDFromHdfs(instanceDirectory, conf, CachedConfiguration.getInstance());
}

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

private static synchronized void _getInstanceID() {
 if (instanceId == null) {
  AccumuloConfiguration acuConf = SiteConfiguration.getInstance();
  // InstanceID should be the same across all volumes, so just choose one
  VolumeManager fs;
  try {
   fs = VolumeManagerImpl.get();
  } catch (IOException e) {
   throw new RuntimeException(e);
  }
  Path instanceIdPath = Accumulo.getAccumuloInstanceIdPath(fs);
  log.trace("Looking for instanceId from {}", instanceIdPath);
  String instanceIdFromFile = ZooUtil.getInstanceIDFromHdfs(instanceIdPath, acuConf);
  instanceId = instanceIdFromFile;
 }
}

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

Integer currentVersion;
try {
 currentIid = ZooUtil.getInstanceIDFromHdfs(path, SiteConfiguration.getInstance());
 Path vpath = new Path(baseDir, VERSION_DIR);
 currentVersion = Accumulo.getAccumuloPersistentVersion(

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

private static void addVolumes(VolumeManager fs) throws IOException {
 String[] volumeURIs = VolumeConfiguration.getVolumeUris(SiteConfiguration.getInstance());
 HashSet<String> initializedDirs = new HashSet<>();
 initializedDirs.addAll(Arrays.asList(ServerConstants.checkBaseUris(volumeURIs, true)));
 HashSet<String> uinitializedDirs = new HashSet<>();
 uinitializedDirs.addAll(Arrays.asList(volumeURIs));
 uinitializedDirs.removeAll(initializedDirs);
 Path aBasePath = new Path(initializedDirs.iterator().next());
 Path iidPath = new Path(aBasePath, ServerConstants.INSTANCE_ID_DIR);
 Path versionPath = new Path(aBasePath, ServerConstants.VERSION_DIR);
 UUID uuid = UUID
   .fromString(ZooUtil.getInstanceIDFromHdfs(iidPath, SiteConfiguration.getInstance()));
 for (Pair<Path,Path> replacementVolume : ServerConstants.getVolumeReplacements()) {
  if (aBasePath.equals(replacementVolume.getFirst()))
   log.error(aBasePath + " is set to be replaced in " + Property.INSTANCE_VOLUMES_REPLACEMENTS
     + " and should not appear in " + Property.INSTANCE_VOLUMES
     + ". It is highly recommended that this property be removed as data"
     + " could still be written to this volume.");
 }
 if (ServerConstants.DATA_VERSION != Accumulo.getAccumuloPersistentVersion(
   versionPath.getFileSystem(CachedConfiguration.getInstance()), versionPath)) {
  throw new IOException("Accumulo " + Constants.VERSION + " cannot initialize data version "
    + Accumulo.getAccumuloPersistentVersion(fs));
 }
 initDirs(fs, uuid, uinitializedDirs.toArray(new String[uinitializedDirs.size()]), true);
}

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

String instanceIDFromFile = ZooUtil.getInstanceIDFromHdfs(instanceDir, config);
if (config.getBoolean(Property.INSTANCE_RPC_SSL_ENABLED))
 clientConfig.setProperty(ClientProperty.INSTANCE_RPC_SSL_ENABLED, "true");

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

private static Instance getZooInstance(String instanceName, String keepersOption,
  ClientConfiguration clientConfig) {
 UUID instanceId = null;
 if (instanceName == null) {
  instanceName = clientConfig.get(ClientProperty.INSTANCE_NAME);
 }
 String keepers = getZooKeepers(keepersOption, clientConfig);
 if (instanceName == null) {
  AccumuloConfiguration conf = SiteConfiguration.getInstance();
  Path instanceDir = new Path(VolumeConfiguration.getVolumeUris(conf)[0], "instance_id");
  instanceId = UUID.fromString(ZooUtil.getInstanceIDFromHdfs(instanceDir, conf));
 }
 if (instanceId != null) {
  return new ZooKeeperInstance(clientConfig.withInstance(instanceId).withZkHosts(keepers));
 } else {
  return new ZooKeeperInstance(clientConfig.withInstance(instanceName).withZkHosts(keepers));
 }
}

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

String instanceIdFromFile = ZooUtil.getInstanceIDFromHdfs(instanceIdPath, cc, hadoopConf);
IZooReaderWriter zrw = new ZooReaderWriterFactory().getZooReaderWriter(
  cc.get(Property.INSTANCE_ZK_HOST), (int) cc.getTimeInMillis(Property.INSTANCE_ZK_TIMEOUT),

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

instanceId = ZooUtil.getInstanceIDFromHdfs(instanceIdPath, parent);
} else {
 instanceId = inst.getInstanceID();

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