org.apache.curator.framework.recipes.shared.SharedValue Java Examples

The following examples show how to use org.apache.curator.framework.recipes.shared.SharedValue. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ZooKeeperUtilityFactory.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a {@link ZooKeeperSharedValue} to store a shared value between multiple instances.
 *
 * @param path to the shared value in ZooKeeper
 * @param seedValue for the shared value
 * @return a shared value
 */
public ZooKeeperSharedValue createSharedValue(String path, byte[] seedValue) {
	return new ZooKeeperSharedValue(
		new SharedValue(
			facade,
			path,
			seedValue));
}
 
Example #2
Source File: ZooKeeperUtilityFactory.java    From flink with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a {@link ZooKeeperSharedValue} to store a shared value between multiple instances.
 *
 * @param path to the shared value in ZooKeeper
 * @param seedValue for the shared value
 * @return a shared value
 */
public ZooKeeperSharedValue createSharedValue(String path, byte[] seedValue) {
	return new ZooKeeperSharedValue(
		new SharedValue(
			facade,
			path,
			seedValue));
}
 
Example #3
Source File: ZooKeeperSharedValue.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
public ZooKeeperSharedValue(SharedValue sharedValue) {
	this.sharedValue = Preconditions.checkNotNull(sharedValue);
}
 
Example #4
Source File: ZooKeeperSharedValue.java    From flink with Apache License 2.0 4 votes vote down vote up
public ZooKeeperSharedValue(SharedValue sharedValue) {
	this.sharedValue = Preconditions.checkNotNull(sharedValue);
}
 
Example #5
Source File: SharedBoolean.java    From datawave with Apache License 2.0 4 votes vote down vote up
public SharedBoolean(CuratorFramework client, String path, boolean seedValue) {
    this.sharedValue = new SharedValue(client, path, toBytes(seedValue));
}
 
Example #6
Source File: SharedTriState.java    From datawave with Apache License 2.0 4 votes vote down vote up
public SharedTriState(CuratorFramework client, String path, STATE seedValue) {
    this.sharedValue = new SharedValue(client, path, toBytes(seedValue));
}
 
Example #7
Source File: PregelComputation.java    From kafka-graphs with Apache License 2.0 4 votes vote down vote up
private static void setPregelState(SharedValue sharedValue, PregelState pregelState) throws Exception {
    sharedValue.setValue(pregelState.toBytes());
    log.info("Set new pregel state {}", pregelState);
}