org.apache.flink.runtime.zookeeper.ZooKeeperSharedValue Java Examples

The following examples show how to use org.apache.flink.runtime.zookeeper.ZooKeeperSharedValue. 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: ZooKeeperMesosServices.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
@Override
public MesosWorkerStore createMesosWorkerStore(Configuration configuration, Executor executor) throws Exception {
	RetrievableStateStorageHelper<MesosWorkerStore.Worker> stateStorageHelper =
		ZooKeeperUtils.createFileSystemStateStorage(configuration, "mesosWorkerStore");

	ZooKeeperStateHandleStore<MesosWorkerStore.Worker> zooKeeperStateHandleStore = zooKeeperUtilityFactory.createZooKeeperStateHandleStore(
		"/workers",
		stateStorageHelper);

	ZooKeeperSharedValue frameworkId = zooKeeperUtilityFactory.createSharedValue("/frameworkId", new byte[0]);
	ZooKeeperSharedCount totalTaskCount = zooKeeperUtilityFactory.createSharedCount("/taskCount", 0);

	return new ZooKeeperMesosWorkerStore(
		zooKeeperStateHandleStore,
		frameworkId,
		totalTaskCount);
}
 
Example #2
Source File: ZooKeeperMesosServices.java    From flink with Apache License 2.0 6 votes vote down vote up
@Override
public MesosWorkerStore createMesosWorkerStore(Configuration configuration, Executor executor) throws Exception {
	RetrievableStateStorageHelper<MesosWorkerStore.Worker> stateStorageHelper =
		ZooKeeperUtils.createFileSystemStateStorage(configuration, "mesosWorkerStore");

	ZooKeeperStateHandleStore<MesosWorkerStore.Worker> zooKeeperStateHandleStore = zooKeeperUtilityFactory.createZooKeeperStateHandleStore(
		"/workers",
		stateStorageHelper);

	ZooKeeperSharedValue frameworkId = zooKeeperUtilityFactory.createSharedValue("/frameworkId", new byte[0]);
	ZooKeeperSharedCount totalTaskCount = zooKeeperUtilityFactory.createSharedCount("/taskCount", 0);

	return new ZooKeeperMesosWorkerStore(
		zooKeeperStateHandleStore,
		frameworkId,
		totalTaskCount);
}
 
Example #3
Source File: ZooKeeperMesosServices.java    From flink with Apache License 2.0 6 votes vote down vote up
@Override
public MesosWorkerStore createMesosWorkerStore(Configuration configuration, Executor executor) throws Exception {
	RetrievableStateStorageHelper<MesosWorkerStore.Worker> stateStorageHelper =
		ZooKeeperUtils.createFileSystemStateStorage(configuration, "mesosWorkerStore");

	ZooKeeperStateHandleStore<MesosWorkerStore.Worker> zooKeeperStateHandleStore = zooKeeperUtilityFactory.createZooKeeperStateHandleStore(
		"/workers",
		stateStorageHelper);

	ZooKeeperSharedValue frameworkId = zooKeeperUtilityFactory.createSharedValue("/frameworkId", new byte[0]);
	ZooKeeperSharedCount totalTaskCount = zooKeeperUtilityFactory.createSharedCount("/taskCount", 0);

	return new ZooKeeperMesosWorkerStore(
		zooKeeperStateHandleStore,
		frameworkId,
		totalTaskCount);
}
 
Example #4
Source File: ZooKeeperMesosWorkerStore.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
public ZooKeeperMesosWorkerStore(
	ZooKeeperStateHandleStore<MesosWorkerStore.Worker> workersInZooKeeper,
	ZooKeeperSharedValue frameworkIdInZooKeeper,
	ZooKeeperSharedCount totalTaskCountInZooKeeper) throws Exception {
	this.workersInZooKeeper = checkNotNull(workersInZooKeeper, "workersInZooKeeper");
	this.frameworkIdInZooKeeper = checkNotNull(frameworkIdInZooKeeper, "frameworkIdInZooKeeper");
	this.totalTaskCountInZooKeeper = checkNotNull(totalTaskCountInZooKeeper, "totalTaskCountInZooKeeper");
}
 
Example #5
Source File: ZooKeeperMesosWorkerStore.java    From flink with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
public ZooKeeperMesosWorkerStore(
	ZooKeeperStateHandleStore<MesosWorkerStore.Worker> workersInZooKeeper,
	ZooKeeperSharedValue frameworkIdInZooKeeper,
	ZooKeeperSharedCount totalTaskCountInZooKeeper) throws Exception {
	this.workersInZooKeeper = checkNotNull(workersInZooKeeper, "workersInZooKeeper");
	this.frameworkIdInZooKeeper = checkNotNull(frameworkIdInZooKeeper, "frameworkIdInZooKeeper");
	this.totalTaskCountInZooKeeper = checkNotNull(totalTaskCountInZooKeeper, "totalTaskCountInZooKeeper");
}
 
Example #6
Source File: ZooKeeperMesosWorkerStore.java    From flink with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
public ZooKeeperMesosWorkerStore(
	ZooKeeperStateHandleStore<MesosWorkerStore.Worker> workersInZooKeeper,
	ZooKeeperSharedValue frameworkIdInZooKeeper,
	ZooKeeperSharedCount totalTaskCountInZooKeeper) throws Exception {
	this.workersInZooKeeper = checkNotNull(workersInZooKeeper, "workersInZooKeeper");
	this.frameworkIdInZooKeeper = checkNotNull(frameworkIdInZooKeeper, "frameworkIdInZooKeeper");
	this.totalTaskCountInZooKeeper = checkNotNull(totalTaskCountInZooKeeper, "totalTaskCountInZooKeeper");
}