use of org.apache.flink.contrib.streaming.state.RocksDBKeyedStateBackendBuilder in project flink by apache.
the class StateBackendBenchmarkUtils method createRocksDBKeyedStateBackend.
private static RocksDBKeyedStateBackend<Long> createRocksDBKeyedStateBackend(File rootDir) throws IOException {
File recoveryBaseDir = prepareDirectory(recoveryDirName, rootDir);
File dbPathFile = prepareDirectory(dbDirName, rootDir);
ExecutionConfig executionConfig = new ExecutionConfig();
RocksDBResourceContainer resourceContainer = new RocksDBResourceContainer();
RocksDBKeyedStateBackendBuilder<Long> builder = new RocksDBKeyedStateBackendBuilder<>("Test", Thread.currentThread().getContextClassLoader(), dbPathFile, resourceContainer, stateName -> resourceContainer.getColumnOptions(), null, LongSerializer.INSTANCE, 2, new KeyGroupRange(0, 1), executionConfig, new LocalRecoveryConfig(null), EmbeddedRocksDBStateBackend.PriorityQueueStateType.ROCKSDB, TtlTimeProvider.DEFAULT, LatencyTrackingStateConfig.disabled(), new UnregisteredMetricsGroup(), Collections.emptyList(), AbstractStateBackend.getCompressionDecorator(executionConfig), new CloseableRegistry());
try {
return builder.build();
} catch (Exception e) {
IOUtils.closeQuietly(resourceContainer);
throw e;
}
}
Aggregations