Search in sources :

Example 6 with LRUCache

use of org.rocksdb.LRUCache in project flink by apache.

the class RocksDBResourceContainerTest method getSharedResources.

private OpaqueMemoryResource<RocksDBSharedResources> getSharedResources() {
    final long cacheSize = 1024L, writeBufferSize = 512L;
    final LRUCache cache = new LRUCache(cacheSize, -1, false, 0.1);
    final WriteBufferManager wbm = new WriteBufferManager(writeBufferSize, cache);
    RocksDBSharedResources rocksDBSharedResources = new RocksDBSharedResources(cache, wbm, writeBufferSize, false);
    return new OpaqueMemoryResource<>(rocksDBSharedResources, cacheSize, rocksDBSharedResources::close);
}
Also used : OpaqueMemoryResource(org.apache.flink.runtime.memory.OpaqueMemoryResource) LRUCache(org.rocksdb.LRUCache) WriteBufferManager(org.rocksdb.WriteBufferManager)

Aggregations

LRUCache (org.rocksdb.LRUCache)6 IOException (java.io.IOException)4 Test (org.junit.Test)4 WriteBufferManager (org.rocksdb.WriteBufferManager)4 OpaqueMemoryResource (org.apache.flink.runtime.memory.OpaqueMemoryResource)3 BlockBasedTableConfig (org.rocksdb.BlockBasedTableConfig)2 BloomFilter (org.rocksdb.BloomFilter)2 Cache (org.rocksdb.Cache)2 ColumnFamilyOptions (org.rocksdb.ColumnFamilyOptions)2 DBOptions (org.rocksdb.DBOptions)2 File (java.io.File)1 Collection (java.util.Collection)1 AtomicLong (java.util.concurrent.atomic.AtomicLong)1 ProcessorStateException (org.apache.kafka.streams.errors.ProcessorStateException)1 RocksDBConfigSetter (org.apache.kafka.streams.state.RocksDBConfigSetter)1 CoreMatchers.is (org.hamcrest.CoreMatchers.is)1 MatcherAssert.assertThat (org.hamcrest.MatcherAssert.assertThat)1 Assert.assertFalse (org.junit.Assert.assertFalse)1 Assert.assertTrue (org.junit.Assert.assertTrue)1 Before (org.junit.Before)1