Search in sources :

Example 1 with RocksDBKeyedStateBackendBuilder

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;
    }
}
Also used : RocksDBResourceContainer(org.apache.flink.contrib.streaming.state.RocksDBResourceContainer) UnregisteredMetricsGroup(org.apache.flink.metrics.groups.UnregisteredMetricsGroup) RocksDBKeyedStateBackendBuilder(org.apache.flink.contrib.streaming.state.RocksDBKeyedStateBackendBuilder) 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) RocksDBException(org.rocksdb.RocksDBException) IOException(java.io.IOException)

Aggregations

File (java.io.File)1 IOException (java.io.IOException)1 ExecutionConfig (org.apache.flink.api.common.ExecutionConfig)1 RocksDBKeyedStateBackendBuilder (org.apache.flink.contrib.streaming.state.RocksDBKeyedStateBackendBuilder)1 RocksDBResourceContainer (org.apache.flink.contrib.streaming.state.RocksDBResourceContainer)1 CloseableRegistry (org.apache.flink.core.fs.CloseableRegistry)1 UnregisteredMetricsGroup (org.apache.flink.metrics.groups.UnregisteredMetricsGroup)1 KeyGroupRange (org.apache.flink.runtime.state.KeyGroupRange)1 LocalRecoveryConfig (org.apache.flink.runtime.state.LocalRecoveryConfig)1 RocksDBException (org.rocksdb.RocksDBException)1