Search in sources :

Example 1 with HeapKeyedStateBackendBuilder

use of org.apache.flink.runtime.state.heap.HeapKeyedStateBackendBuilder in project flink by apache.

the class StateBackendBenchmarkUtils method createHeapKeyedStateBackend.

private static HeapKeyedStateBackend<Long> createHeapKeyedStateBackend(File rootDir) throws IOException {
    File recoveryBaseDir = prepareDirectory(recoveryDirName, rootDir);
    KeyGroupRange keyGroupRange = new KeyGroupRange(0, 1);
    int numberOfKeyGroups = keyGroupRange.getNumberOfKeyGroups();
    ExecutionConfig executionConfig = new ExecutionConfig();
    HeapPriorityQueueSetFactory priorityQueueSetFactory = new HeapPriorityQueueSetFactory(keyGroupRange, numberOfKeyGroups, 128);
    HeapKeyedStateBackendBuilder<Long> backendBuilder = new HeapKeyedStateBackendBuilder<>(null, new LongSerializer(), Thread.currentThread().getContextClassLoader(), numberOfKeyGroups, keyGroupRange, executionConfig, TtlTimeProvider.DEFAULT, LatencyTrackingStateConfig.disabled(), Collections.emptyList(), AbstractStateBackend.getCompressionDecorator(executionConfig), new LocalRecoveryConfig(null), priorityQueueSetFactory, false, new CloseableRegistry());
    return backendBuilder.build();
}
Also used : LongSerializer(org.apache.flink.api.common.typeutils.base.LongSerializer) HeapPriorityQueueSetFactory(org.apache.flink.runtime.state.heap.HeapPriorityQueueSetFactory) KeyGroupRange(org.apache.flink.runtime.state.KeyGroupRange) LocalRecoveryConfig(org.apache.flink.runtime.state.LocalRecoveryConfig) ExecutionConfig(org.apache.flink.api.common.ExecutionConfig) CloseableRegistry(org.apache.flink.core.fs.CloseableRegistry) File(java.io.File) HeapKeyedStateBackendBuilder(org.apache.flink.runtime.state.heap.HeapKeyedStateBackendBuilder)

Aggregations

File (java.io.File)1 ExecutionConfig (org.apache.flink.api.common.ExecutionConfig)1 LongSerializer (org.apache.flink.api.common.typeutils.base.LongSerializer)1 CloseableRegistry (org.apache.flink.core.fs.CloseableRegistry)1 KeyGroupRange (org.apache.flink.runtime.state.KeyGroupRange)1 LocalRecoveryConfig (org.apache.flink.runtime.state.LocalRecoveryConfig)1 HeapKeyedStateBackendBuilder (org.apache.flink.runtime.state.heap.HeapKeyedStateBackendBuilder)1 HeapPriorityQueueSetFactory (org.apache.flink.runtime.state.heap.HeapPriorityQueueSetFactory)1