Search in sources :

Example 1 with MemoryBlockCache

use of io.datarouter.filesystem.snapshot.cache.MemoryBlockCache in project datarouter by hotpads.

the class BaseSnapshotTests method beforeClass.

@BeforeClass
public void beforeClass() {
    var wordId = new AtomicLong();
    sortedInputs = Scanner.of(getInputs()).map(str -> str.getBytes(StandardCharsets.UTF_8)).map(BaseSnapshotTests::makeEntry).map(entry -> new Input(wordId.getAndIncrement(), entry)).list();
    Require.equals(sortedInputs.get(0).entry.columnValues.length, NUM_COLUMNS);
    randomInputs = Scanner.of(sortedInputs).shuffle().list();
    exec = Executors.newFixedThreadPool(getNumThreads());
    scanExec = Executors.newFixedThreadPool(getNumThreads());
    snapshotKey = writeSnapshot();
    sharedMemoryCache = new MemoryBlockCache(64 * 1024 * 1024, getGroup());
}
Also used : AtomicLong(java.util.concurrent.atomic.AtomicLong) MemoryBlockCache(io.datarouter.filesystem.snapshot.cache.MemoryBlockCache) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

MemoryBlockCache (io.datarouter.filesystem.snapshot.cache.MemoryBlockCache)1 AtomicLong (java.util.concurrent.atomic.AtomicLong)1 BeforeClass (org.testng.annotations.BeforeClass)1