本文整理了Java中org.apache.flink.runtime.zookeeper.ZooKeeperSharedValue
类的一些代码示例,展示了ZooKeeperSharedValue
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZooKeeperSharedValue
类的具体详情如下:
包路径:org.apache.flink.runtime.zookeeper.ZooKeeperSharedValue
类名称:ZooKeeperSharedValue
[英]Wrapper class for a SharedValue so that we don't expose a curator dependency in our internal APIs. Such an exposure is problematic due to the relocation of curator.
[中]SharedValue的包装类,这样我们就不会在内部API中暴露策展人依赖关系。由于策展人的搬迁,这样的曝光是有问题的。
代码示例来源:origin: apache/flink
public void stop(boolean cleanup) throws Exception {
synchronized (startStopLock) {
if (isRunning) {
frameworkIdInZooKeeper.close();
totalTaskCountInZooKeeper.close();
if (cleanup) {
workersInZooKeeper.releaseAndTryRemoveAll();
}
isRunning = false;
}
}
}
代码示例来源:origin: apache/flink
/**
* Update the persisted framework ID.
* @param frameworkID the new ID or empty to remove the persisted ID.
* @throws Exception on ZK failures, interruptions.
*/
@Override
public void setFrameworkID(Option<Protos.FrameworkID> frameworkID) throws Exception {
synchronized (startStopLock) {
verifyIsRunning();
byte[] value = frameworkID.isDefined() ? frameworkID.get().getValue().getBytes(ConfigConstants.DEFAULT_CHARSET) :
new byte[0];
frameworkIdInZooKeeper.setValue(value);
}
}
代码示例来源:origin: apache/flink
@Override
public void start() throws Exception {
synchronized (startStopLock) {
if (!isRunning) {
isRunning = true;
frameworkIdInZooKeeper.start();
totalTaskCountInZooKeeper.start();
}
}
}
代码示例来源:origin: org.apache.flink/flink-runtime_2.10
/**
* 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));
}
代码示例来源:origin: apache/flink
/**
* Get the persisted framework ID.
* @return the current ID or empty if none is yet persisted.
* @throws Exception on ZK failures, interruptions.
*/
@Override
public Option<Protos.FrameworkID> getFrameworkID() throws Exception {
synchronized (startStopLock) {
verifyIsRunning();
Option<Protos.FrameworkID> frameworkID;
byte[] value = frameworkIdInZooKeeper.getValue();
if (value.length == 0) {
frameworkID = Option.empty();
} else {
frameworkID = Option.apply(Protos.FrameworkID.newBuilder().setValue(new String(value,
ConfigConstants.DEFAULT_CHARSET)).build());
}
return frameworkID;
}
}
代码示例来源:origin: org.apache.flink/flink-runtime_2.11
/**
* 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));
}
代码示例来源:origin: org.apache.flink/flink-runtime
/**
* 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));
}
代码示例来源:origin: com.alibaba.blink/flink-runtime
/**
* 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));
}
内容来源于网络,如有侵权,请联系作者删除!