本文整理了Java中io.pravega.controller.store.stream.ZKStoreHelper.createZNodeIfNotExist()
方法的一些代码示例,展示了ZKStoreHelper.createZNodeIfNotExist()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZKStoreHelper.createZNodeIfNotExist()
方法的具体详情如下:
包路径:io.pravega.controller.store.stream.ZKStoreHelper
类名称:ZKStoreHelper
方法名:createZNodeIfNotExist
暂无
代码示例来源:origin: pravega/pravega
CompletableFuture<Integer> createZNodeIfNotExist(final String path, final byte[] data) {
return createZNodeIfNotExist(path, data, true);
}
代码示例来源:origin: pravega/pravega
CompletableFuture<Integer> createZNodeIfNotExist(final String path) {
return createZNodeIfNotExist(path, true);
}
代码示例来源:origin: pravega/pravega
@Override
CompletableFuture<Void> createHistoryTimeSeriesChunkDataIfAbsent(int chunkNumber, byte[] data) {
String path = String.format(historyTimeSeriesChunkPathFormat, chunkNumber);
return Futures.toVoid(store.createZNodeIfNotExist(path, data));
}
代码示例来源:origin: pravega/pravega
@Override
CompletableFuture<Void> createStreamCutRecordData(long recordingTime, byte[] record) {
String path = String.format(retentionStreamCutRecordPathFormat, recordingTime);
return Futures.toVoid(store.createZNodeIfNotExist(path, record));
}
代码示例来源:origin: pravega/pravega
@Override
CompletableFuture<Version> createNewTransaction(final int epoch, final UUID txId, final byte[] txnRecord) {
final String activePath = getActiveTxPath(epoch, txId.toString());
// we will always create parent if needed so that transactions are created successfully even if the epoch znode
// previously found to be empty and deleted.
// For this, send createParent flag = true
return store.createZNodeIfNotExist(activePath, txnRecord, true)
.thenApply(Version.IntVersion::new);
}
代码示例来源:origin: pravega/pravega
@Override
CompletableFuture<Void> createRetentionSetDataIfAbsent(byte[] data) {
return Futures.toVoid(store.createZNodeIfNotExist(retentionSetPath, data));
}
代码示例来源:origin: pravega/pravega
@Override
CompletableFuture<Void> createWaitingRequestNodeIfAbsent(byte[] waitingRequestProcessor) {
return Futures.toVoid(store.createZNodeIfNotExist(waitingRequestProcessorPath, waitingRequestProcessor));
}
代码示例来源:origin: pravega/pravega
@Override
CompletableFuture<Void> createEpochRecordDataIfAbsent(int epoch, byte[] data) {
String path = String.format(epochRecordPathFormat, epoch);
return Futures.toVoid(store.createZNodeIfNotExist(path, data));
}
代码示例来源:origin: pravega/pravega
@Override
CompletableFuture<Void> createSealedSegmentSizesMapShardDataIfAbsent(int shard, byte[] data) {
String path = String.format(segmentsSealedSizeMapShardPathFormat, shard);
return Futures.toVoid(store.createZNodeIfNotExist(path, data));
}
代码示例来源:origin: pravega/pravega
@Override
CompletableFuture<Void> createCurrentEpochRecordDataIfAbsent(byte[] data) {
return Futures.toVoid(store.createZNodeIfNotExist(currentEpochRecordPath, data));
}
代码示例来源:origin: pravega/pravega
@Override
public CompletableFuture<Void> createTruncationDataIfAbsent(final byte[] truncationRecord) {
return Futures.toVoid(store.createZNodeIfNotExist(truncationPath, truncationRecord));
}
代码示例来源:origin: pravega/pravega
@Override
CompletableFuture<Void> createEpochTransitionIfAbsent(byte[] epochTransition) {
return Futures.toVoid(store.createZNodeIfNotExist(epochTransitionPath, epochTransition));
}
代码示例来源:origin: pravega/pravega
@Override
public CompletableFuture<Void> createConfigurationIfAbsent(final byte[] configuration) {
return Futures.toVoid(store.createZNodeIfNotExist(configurationPath, configuration));
}
代码示例来源:origin: pravega/pravega
@Override
public CompletableFuture<Void> createStateIfAbsent(final byte[] state) {
return Futures.toVoid(store.createZNodeIfNotExist(statePath, state));
}
代码示例来源:origin: pravega/pravega
@Override
CompletableFuture<Void> createCommitTxnRecordIfAbsent(byte[] committingTxns) {
return Futures.toVoid(store.createZNodeIfNotExist(committingTxnsPath, committingTxns));
}
代码示例来源:origin: pravega/pravega
private CompletableFuture<Void> initializeZNode(String zNodePath) {
return storeHelper.createZNodeIfNotExist(zNodePath).handle(
(v, ex) -> {
if (ex == null) {
log.debug("Stream bucket correctly initialized: {}.", zNodePath);
} else if (Exceptions.unwrap(ex) instanceof StoreException.DataExistsException) {
log.debug("Stream bucket already initialized: {}.", zNodePath);
} else {
throw new CompletionException("Unexpected exception initializing Stream bucket.", ex);
}
return null;
});
}
代码示例来源:origin: pravega/pravega
@Override
CompletableFuture<Void> createSegmentSealedEpochRecordData(long segmentToSeal, int epoch) {
String path = String.format(segmentSealedEpochPathFormat, segmentToSeal);
byte[] epochData = new byte[Integer.BYTES];
BitConverter.writeInt(epochData, 0, epoch);
return Futures.toVoid(store.createZNodeIfNotExist(path, epochData));
}
代码示例来源:origin: pravega/pravega
@Override
CompletableFuture<Void> storeCreationTimeIfAbsent(final long creationTime) {
byte[] b = new byte[Long.BYTES];
BitConverter.writeLong(b, 0, creationTime);
return Futures.toVoid(store.createZNodeIfNotExist(creationPath, b));
}
代码示例来源:origin: pravega/pravega
@Override
public CompletableFuture<Void> createMarkerData(long segmentId, long timestamp) {
final String path = ZKPaths.makePath(markerPath, String.format("%d", segmentId));
byte[] b = new byte[Long.BYTES];
BitConverter.writeLong(b, 0, timestamp);
return store.createZNodeIfNotExist(path, b)
.thenAccept(x -> cache.invalidateCache(markerPath));
}
代码示例来源:origin: pravega/pravega
@Override
CompletableFuture<Void> createCompletedTxEntry(final UUID txId, final byte[] complete) {
String root = String.format(STREAM_COMPLETED_TX_BATCH_PATH, currentBatchSupplier.get(), getScope(), getName());
String path = ZKPaths.makePath(root, txId.toString());
return Futures.toVoid(store.createZNodeIfNotExist(path, complete));
}
内容来源于网络,如有侵权,请联系作者删除!