gpt4 book ai didi

org.lilyproject.util.zookeeper.ZooKeeperItf.getData()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 20:56:49 26 4
gpt4 key购买 nike

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

ZooKeeperItf.getData介绍

暂无

代码示例

代码示例来源:origin: NGDATA/lilyproject

@Override
public byte[] getData(String path, Watcher watcher, Stat stat) throws KeeperException, InterruptedException {
  return wrapped.getData(path, watcher, stat);
}

代码示例来源:origin: NGDATA/lilyproject

@Override
public byte[] getData(String path, boolean watch, Stat stat) throws KeeperException, InterruptedException {
  return wrapped.getData(path, watch, stat);
}

代码示例来源:origin: NGDATA/lilyproject

@Override
public void getData(String path, Watcher watcher, DataCallback cb, Object ctx) {
  wrapped.getData(path, watcher, cb, ctx);
}

代码示例来源:origin: NGDATA/lilyproject

@Override
public void getData(String path, boolean watch, DataCallback cb, Object ctx) {
  wrapped.getData(path, watch, cb, ctx);
}

代码示例来源:origin: NGDATA/lilyproject

@Override
  public Boolean execute() throws KeeperException, InterruptedException {
    data.add(zk.getData(path, watcher, stat));
    return null;
  }
});

代码示例来源:origin: NGDATA/lilyproject

private static URI getDfsUri(ZooKeeperItf zk) {
  try {
    return new URI(new String(zk.getData(blobDfsUriPath, false, new Stat())));
  } catch (Exception e) {
    throw new RuntimeException("Blob stores config lookup: failed to get DFS URI from ZooKeeper", e);
  }
}

代码示例来源:origin: NGDATA/lilyproject

@Override
  public Boolean execute() throws KeeperException, InterruptedException {
    byte[] currentData = zk.getData(path, false, new Stat());
    if (!Arrays.equals(currentData, data)) {
      zk.setData(path, data, -1);
    }
    return null;
  }
});

代码示例来源:origin: NGDATA/lilyproject

private static BlobStoreAccessConfig getBlobStoreAccessConfig(ZooKeeperItf zk) {
  try {
    return new BlobStoreAccessConfig(zk.getData(blobStoreAccessConfigPath, false, new Stat()));
  } catch (Exception e) {
    throw new RuntimeException(
        "Blob stores config lookup: failed to get blob store access config from ZooKeeper", e);
  }
}

代码示例来源:origin: NGDATA/lilyproject

private RepositoryDefinition loadRepository(String name, boolean watch) throws KeeperException, InterruptedException {
  byte[] repoJson = zk.getData(REPOSITORY_COLLECTION_PATH + "/" + name, watch ? zkWatcher : null, new Stat());
  return RepositoryDefinitionJsonSerDeser.INSTANCE.fromJsonBytes(name, repoJson);
}

代码示例来源:origin: NGDATA/lilyproject

/**
 * Reads the refreshing enabled state on zookeeper and puts a new watch
 */
protected void readRefreshingEnabledState() {
  byte[] data;
  try {
    data = zooKeeper.getData(CACHE_REFRESHENABLED_PATH, new CacheRefreshingEnabledWatcher(), new Stat());
    if (data == null || data.length == 0 || data[0] == (byte) 1) {
      cacheRefreshingEnabled = true;
    } else {
      cacheRefreshingEnabled = false;
    }
  } catch (KeeperException e) {
    // Rely on connectionwatcher to put watcher again
  } catch (InterruptedException e) {
    // Stop processing
  }
}

代码示例来源:origin: NGDATA/lilyproject

public static Configuration getHBaseConfiguration(ZooKeeperItf zk) {
  try {
    Configuration configuration = HBaseConfiguration.create();
    // Make this configuration object 'owned' by us: this way we can close the associated
    // connection completely without worrying we close someone else's connection (e.g.
    // when running two LilyClient's in one JVM, or when running LilyClient from within
    // the lily-server JVM, which is the case when we launch a batch build job)
    configuration.set(HConstants.HBASE_CLIENT_INSTANCE_ID, String.valueOf("lilyclient-" + hbaseConfCounter.incrementAndGet()));
    byte[] data = zk.getData(hbaseConfigPath, false, new Stat());
    ObjectNode propertiesNode = (ObjectNode) JsonFormat.deserializeSoft(data, "HBase configuration");
    Iterator<Map.Entry<String, JsonNode>> it = propertiesNode.getFields();
    while (it.hasNext()) {
      Map.Entry<String, JsonNode> entry = it.next();
      configuration.set(entry.getKey(), entry.getValue().getTextValue());
    }
    return configuration;
  } catch (Exception e) {
    throw new RuntimeException("Failed to get HBase configuration from ZooKeeper", e);
  }
}

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