Java Code Examples for org.apache.flink.runtime.query.KvStateRegistry#createTaskRegistry()

The following examples show how to use org.apache.flink.runtime.query.KvStateRegistry#createTaskRegistry() . 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: StreamMockEnvironment.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
public StreamMockEnvironment(
	JobID jobID,
	ExecutionAttemptID executionAttemptID,
	Configuration jobConfig,
	Configuration taskConfig,
	ExecutionConfig executionConfig,
	long memorySize,
	MockInputSplitProvider inputSplitProvider,
	int bufferSize,
	TaskStateManager taskStateManager) {

	this.jobID = jobID;
	this.executionAttemptID = executionAttemptID;

	int subtaskIndex = 0;
	this.taskInfo = new TaskInfo(
		"", /* task name */
		1, /* num key groups / max parallelism */
		subtaskIndex, /* index of this subtask */
		1, /* num subtasks */
		0 /* attempt number */);
	this.jobConfiguration = jobConfig;
	this.taskConfiguration = taskConfig;
	this.inputs = new LinkedList<InputGate>();
	this.outputs = new LinkedList<ResultPartitionWriter>();
	this.memManager = new MemoryManager(memorySize, 1);
	this.ioManager = new IOManagerAsync();
	this.taskStateManager = Preconditions.checkNotNull(taskStateManager);
	this.aggregateManager = new TestGlobalAggregateManager();
	this.inputSplitProvider = inputSplitProvider;
	this.bufferSize = bufferSize;

	this.executionConfig = executionConfig;
	this.accumulatorRegistry = new AccumulatorRegistry(jobID, getExecutionId());

	KvStateRegistry registry = new KvStateRegistry();
	this.kvStateRegistry = registry.createTaskRegistry(jobID, getJobVertexId());
}
 
Example 2
Source File: StreamMockEnvironment.java    From flink with Apache License 2.0 5 votes vote down vote up
public StreamMockEnvironment(
	JobID jobID,
	ExecutionAttemptID executionAttemptID,
	Configuration jobConfig,
	Configuration taskConfig,
	ExecutionConfig executionConfig,
	long memorySize,
	MockInputSplitProvider inputSplitProvider,
	int bufferSize,
	TaskStateManager taskStateManager) {

	this.jobID = jobID;
	this.executionAttemptID = executionAttemptID;

	int subtaskIndex = 0;
	this.taskInfo = new TaskInfo(
		"", /* task name */
		1, /* num key groups / max parallelism */
		subtaskIndex, /* index of this subtask */
		1, /* num subtasks */
		0 /* attempt number */);
	this.jobConfiguration = jobConfig;
	this.taskConfiguration = taskConfig;
	this.inputs = new LinkedList<InputGate>();
	this.outputs = new LinkedList<ResultPartitionWriter>();
	this.memManager = new MemoryManager(memorySize, 1);
	this.ioManager = new IOManagerAsync();
	this.taskStateManager = Preconditions.checkNotNull(taskStateManager);
	this.aggregateManager = new TestGlobalAggregateManager();
	this.inputSplitProvider = inputSplitProvider;
	this.bufferSize = bufferSize;

	this.executionConfig = executionConfig;
	this.accumulatorRegistry = new AccumulatorRegistry(jobID, getExecutionId());

	KvStateRegistry registry = new KvStateRegistry();
	this.kvStateRegistry = registry.createTaskRegistry(jobID, getJobVertexId());
}
 
Example 3
Source File: StreamMockEnvironment.java    From flink with Apache License 2.0 5 votes vote down vote up
public StreamMockEnvironment(
	JobID jobID,
	ExecutionAttemptID executionAttemptID,
	Configuration jobConfig,
	Configuration taskConfig,
	ExecutionConfig executionConfig,
	long offHeapMemorySize,
	MockInputSplitProvider inputSplitProvider,
	int bufferSize,
	TaskStateManager taskStateManager) {

	this.jobID = jobID;
	this.executionAttemptID = executionAttemptID;

	int subtaskIndex = 0;
	this.taskInfo = new TaskInfo(
		"", /* task name */
		1, /* num key groups / max parallelism */
		subtaskIndex, /* index of this subtask */
		1, /* num subtasks */
		0 /* attempt number */);
	this.jobConfiguration = jobConfig;
	this.taskConfiguration = taskConfig;
	this.inputs = new LinkedList<>();
	this.outputs = new LinkedList<ResultPartitionWriter>();
	this.memManager = MemoryManagerBuilder.newBuilder().setMemorySize(offHeapMemorySize).build();
	this.ioManager = new IOManagerAsync();
	this.taskStateManager = Preconditions.checkNotNull(taskStateManager);
	this.aggregateManager = new TestGlobalAggregateManager();
	this.inputSplitProvider = inputSplitProvider;
	this.bufferSize = bufferSize;

	this.executionConfig = executionConfig;
	this.accumulatorRegistry = new AccumulatorRegistry(jobID, getExecutionId());

	KvStateRegistry registry = new KvStateRegistry();
	this.kvStateRegistry = registry.createTaskRegistry(jobID, getJobVertexId());
}
 
Example 4
Source File: MockEnvironment.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
protected MockEnvironment(
	JobID jobID,
	JobVertexID jobVertexID,
	String taskName,
	long memorySize,
	MockInputSplitProvider inputSplitProvider,
	int bufferSize,
	Configuration taskConfiguration,
	ExecutionConfig executionConfig,
	TaskStateManager taskStateManager,
	GlobalAggregateManager aggregateManager,
	int maxParallelism,
	int parallelism,
	int subtaskIndex,
	ClassLoader userCodeClassLoader,
	TaskMetricGroup taskMetricGroup,
	TaskManagerRuntimeInfo taskManagerRuntimeInfo) {

	this.jobID = jobID;
	this.jobVertexID = jobVertexID;

	this.taskInfo = new TaskInfo(taskName, maxParallelism, subtaskIndex, parallelism, 0);
	this.jobConfiguration = new Configuration();
	this.taskConfiguration = taskConfiguration;
	this.inputs = new LinkedList<InputGate>();
	this.outputs = new LinkedList<ResultPartitionWriter>();

	this.memManager = new MemoryManager(memorySize, 1);
	this.ioManager = new IOManagerAsync();
	this.taskManagerRuntimeInfo = taskManagerRuntimeInfo;

	this.executionConfig = executionConfig;
	this.inputSplitProvider = inputSplitProvider;
	this.bufferSize = bufferSize;

	this.accumulatorRegistry = new AccumulatorRegistry(jobID, getExecutionId());

	KvStateRegistry registry = new KvStateRegistry();
	this.kvStateRegistry = registry.createTaskRegistry(jobID, getJobVertexId());

	this.userCodeClassLoader = Preconditions.checkNotNull(userCodeClassLoader);
	this.taskStateManager = Preconditions.checkNotNull(taskStateManager);
	this.aggregateManager = Preconditions.checkNotNull(aggregateManager);

	this.taskMetricGroup = taskMetricGroup;
}
 
Example 5
Source File: MockEnvironment.java    From flink with Apache License 2.0 4 votes vote down vote up
protected MockEnvironment(
	JobID jobID,
	JobVertexID jobVertexID,
	String taskName,
	long memorySize,
	MockInputSplitProvider inputSplitProvider,
	int bufferSize,
	Configuration taskConfiguration,
	ExecutionConfig executionConfig,
	TaskStateManager taskStateManager,
	GlobalAggregateManager aggregateManager,
	int maxParallelism,
	int parallelism,
	int subtaskIndex,
	ClassLoader userCodeClassLoader,
	TaskMetricGroup taskMetricGroup,
	TaskManagerRuntimeInfo taskManagerRuntimeInfo) {

	this.jobID = jobID;
	this.jobVertexID = jobVertexID;

	this.taskInfo = new TaskInfo(taskName, maxParallelism, subtaskIndex, parallelism, 0);
	this.jobConfiguration = new Configuration();
	this.taskConfiguration = taskConfiguration;
	this.inputs = new LinkedList<InputGate>();
	this.outputs = new LinkedList<ResultPartitionWriter>();

	this.memManager = new MemoryManager(memorySize, 1);
	this.ioManager = new IOManagerAsync();
	this.taskManagerRuntimeInfo = taskManagerRuntimeInfo;

	this.executionConfig = executionConfig;
	this.inputSplitProvider = inputSplitProvider;
	this.bufferSize = bufferSize;

	this.accumulatorRegistry = new AccumulatorRegistry(jobID, getExecutionId());

	KvStateRegistry registry = new KvStateRegistry();
	this.kvStateRegistry = registry.createTaskRegistry(jobID, getJobVertexId());

	this.userCodeClassLoader = Preconditions.checkNotNull(userCodeClassLoader);
	this.taskStateManager = Preconditions.checkNotNull(taskStateManager);
	this.aggregateManager = Preconditions.checkNotNull(aggregateManager);

	this.taskMetricGroup = taskMetricGroup;
}