gpt4 book ai didi

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

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

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

ZkBaseDataAccessor.set介绍

[英]sync set
[中]同步集

代码示例

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

LOGGER.info("Updating IdealState for table {}", tableName);
if (zkBaseDataAccessor
  .set(idealStateKey.getPath(), nextIdealState.getRecord(), currentIdealState.getRecord().getVersion(),
    AccessOption.PERSISTENT)) {

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

@Override
public boolean[] setChildren(List<String> paths, List<T> records, int options) {
 final int size = paths.size();
 List<String> serverPaths = prependChroot(paths);
 Cache<T> cache = getCache(serverPaths);
 if (cache != null) {
  try {
   cache.lockWrite();
   List<Stat> setStats = new ArrayList<Stat>();
   List<List<String>> pathsCreatedList =
     new ArrayList<List<String>>(Collections.<List<String>> nCopies(size, null));
   boolean[] success =
     _baseAccessor.set(serverPaths, records, pathsCreatedList, setStats, options);
   for (int i = 0; i < size; i++) {
    updateCache(cache, pathsCreatedList.get(i), success[i], serverPaths.get(i),
      records.get(i), setStats.get(i));
   }
   return success;
  } finally {
   cache.unlockWrite();
  }
 }
 return _baseAccessor.setChildren(serverPaths, records, options);
}

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

/**
 * async set
 * TODO: rename to set
 */
@Override
public boolean[] setChildren(List<String> paths, List<T> records, int options) {
 return set(paths, records, null, null, options);
}

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

@Override
public boolean[] setChildren(List<String> paths, List<T> records, int options) {
 final int size = paths.size();
 List<String> serverPaths = prependChroot(paths);
 Cache<T> cache = getCache(serverPaths);
 if (cache != null) {
  try {
   cache.lockWrite();
   List<Stat> setStats = new ArrayList<Stat>();
   List<List<String>> pathsCreatedList =
     new ArrayList<List<String>>(Collections.<List<String>>nCopies(size, null));
   boolean[] success =
     _baseAccessor.set(serverPaths, records, pathsCreatedList, setStats, options);
   for (int i = 0; i < size; i++) {
    updateCache(cache, pathsCreatedList.get(i), success[i], serverPaths.get(i),
      records.get(i), setStats.get(i));
   }
   return success;
  } finally {
   cache.unlockWrite();
  }
 }
 return _baseAccessor.setChildren(serverPaths, records, options);
}

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

/**
 * async set
 * TODO: rename to set
 */
@Override
public boolean[] setChildren(List<String> paths, List<T> records, int options) {
 return set(paths, records, null, null, options);
}

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

/**
 * sync set
 */
@Override
public boolean set(String path, T record, int options) {
 return set(path, record, -1, options);
}

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

/**
 * sync set
 */
@Override
public boolean set(String path, T record, int options) {
 return set(path, record, -1, options);
}

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

success = accessor.set(mergedKey, merged, readStat.getVersion(), options);
if (!success) {
 LOG.error("Fail to group commit. path: " + mergedKey + ", value: " + merged

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

new ArrayList<List<String>>(Collections.<List<String>> nCopies(setPaths.size(), null));
boolean[] success =
  accessor.set(setPaths, setRecords, pathsCreated, null, AccessOption.PERSISTENT);
System.out.println("pathsCreated: " + pathsCreated);
System.out.println("setSuccess: " + Arrays.toString(success));

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

success = accessor.set(mergedKey, merged, readStat.getVersion(), options);
if (!success) {
 LOG.error("Fail to group commit. path: " + mergedKey + ", value: " + merged

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

@Override
public boolean set(String path, T data, int expectVersion, int options) {
 String clientPath = path;
 String serverPath = prependChroot(clientPath);
 Cache<T> cache = getCache(serverPath);
 boolean success = false;
 try {
  if (cache != null) {
   cache.lockWrite();
   ZkBaseDataAccessor<T>.AccessResult result =
     _baseAccessor.doSet(serverPath, data, expectVersion, options);
   success = result._retCode == RetCode.OK;
   updateCache(cache, result._pathCreated, success, serverPath, data, result._stat);
  } else {
   // no cache
   success = _baseAccessor.set(serverPath, data, expectVersion, options);
  }
 } catch (Exception e) {
 } finally {
  if (cache != null) {
   cache.unlockWrite();
  }
 }
 return success;
}

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

@Override
public boolean set(String path, T data, int expectVersion, int options) {
 String clientPath = path;
 String serverPath = prependChroot(clientPath);
 Cache<T> cache = getCache(serverPath);
 boolean success = false;
 try {
  if (cache != null) {
   cache.lockWrite();
   ZkBaseDataAccessor<T>.AccessResult result =
     _baseAccessor.doSet(serverPath, data, expectVersion, options);
   success = result._retCode == RetCode.OK;
   updateCache(cache, result._pathCreated, success, serverPath, data, result._stat);
  } else {
   // no cache
   success = _baseAccessor.set(serverPath, data, expectVersion, options);
  }
 } catch (Exception e) {
 } finally {
  if (cache != null) {
   cache.unlockWrite();
  }
 }
 return success;
}

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

success = accessor.set(path, record, AccessOption.PERSISTENT);
Assert.assertTrue(success);

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

ZNRecord data = accessor.get(path, stat, 2);
data.getSimpleFields().put("SESSION_ID", "invalid-id");
accessor.set(path, data, 2);
Thread.sleep(2000);

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