本文整理了Java中org.apache.helix.ZNRecordUpdater.<init>()
方法的一些代码示例,展示了ZNRecordUpdater.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZNRecordUpdater.<init>()
方法的具体详情如下:
包路径:org.apache.helix.ZNRecordUpdater
类名称:ZNRecordUpdater
方法名:<init>
[英]Initialize with the record that will be updated
[中]使用将被更新的记录初始化
代码示例来源:origin: org.apache.helix/helix-core
@Override
public <T extends HelixProperty> boolean updateProperty(PropertyKey key, T value) {
return updateProperty(key, new ZNRecordUpdater(value.getRecord()), value);
}
代码示例来源:origin: apache/helix
@Override
public <T extends HelixProperty> boolean updateProperty(PropertyKey key, T value) {
return updateProperty(key, new ZNRecordUpdater(value.getRecord()), value);
}
代码示例来源:origin: apache/helix
@Override
public <T extends HelixProperty> boolean updateProperty(PropertyKey key, T value) {
return updateProperty(key, new ZNRecordUpdater(value.getRecord()) , value);
}
代码示例来源:origin: apache/helix
@Override
public Boolean call() throws Exception {
// create 10 current states in 2 steps
List<String> paths = new ArrayList<String>();
List<DataUpdater<ZNRecord>> updaters = new ArrayList<DataUpdater<ZNRecord>>();
for (int j = 0; j < 10; j++) {
paths.clear();
updaters.clear();
for (int i = 0; i < 10; i++) {
String path = PropertyPathBuilder.instanceCurrentState(
_clusterName, "localhost_8901", "session_0", "TestDB" + i);
ZNRecord newRecord = new ZNRecord("TestDB" + i);
newRecord.setSimpleField("" + j, "" + j);
DataUpdater<ZNRecord> updater = new ZNRecordUpdater(newRecord);
paths.add(path);
updaters.add(updater);
}
boolean[] success = _accessor.updateChildren(paths, updaters, AccessOption.PERSISTENT);
// System.out.println("thread-" + _id + " updates " + j + ": " + Arrays.toString(success));
for (int i = 0; i < 10; i++) {
Assert.assertEquals(success[i], true, "Should be all succeed");
}
}
return true;
}
}
代码示例来源:origin: apache/helix
ZkBaseDataAccessor<ZNRecord> accessor = new ZkBaseDataAccessor<ZNRecord>(_gZkClient);
boolean success = accessor.update(path, new ZNRecordUpdater(record), AccessOption.PERSISTENT);
Assert.assertTrue(success);
ZNRecord getRecord = _gZkClient.readData(path);
success = accessor.update(path, new ZNRecordUpdater(record), AccessOption.PERSISTENT);
Assert.assertTrue(success);
getRecord = _gZkClient.readData(path);
代码示例来源:origin: apache/helix
success = accessor.update(path, new ZNRecordUpdater(newRecord), AccessOption.PERSISTENT);
Assert.assertTrue(success);
代码示例来源:origin: apache/helix
newRecord.setSimpleField("" + j, "" + j);
boolean success =
accessor.update(path, new ZNRecordUpdater(newRecord), AccessOption.PERSISTENT);
Assert.assertTrue(success, "Should succeed in update: " + path);
代码示例来源:origin: apache/helix
ZNRecord newRecord = new ZNRecord("TestDB" + i);
newRecord.setSimpleField("" + j, "" + j);
DataUpdater<ZNRecord> updater = new ZNRecordUpdater(newRecord);
paths.add(path);
updaters.add(updater);
代码示例来源:origin: apache/helix
ZNRecord newRecord = new ZNRecord("TestDB" + i);
newRecord.setSimpleField("" + j, "" + j);
DataUpdater<ZNRecord> updater = new ZNRecordUpdater(newRecord);
paths.add(path);
updaters.add(updater);
代码示例来源:origin: apache/helix
ZNRecord newRecord = new ZNRecord("TestDB" + i);
newRecord.setSimpleField("" + j, "" + j);
DataUpdater<ZNRecord> updater = new ZNRecordUpdater(newRecord);
paths.add(path);
updaters.add(updater);
代码示例来源:origin: apache/helix
newRecord.setSimpleField("key2", "value2");
znrecordUpdaters.add(new ZNRecordUpdater(newRecord));
代码示例来源:origin: apache/helix
newRecord.setSimpleField("" + j, "" + j);
boolean success =
accessor.update(path, new ZNRecordUpdater(newRecord), AccessOption.PERSISTENT);
Assert.assertTrue(success, "Should succeed in update: " + path);
内容来源于网络,如有侵权,请联系作者删除!