Search in sources :

Example 1 with ConfigurableIOBufferFactory

use of org.neo4j.configuration.pagecache.ConfigurableIOBufferFactory in project neo4j by neo4j.

the class BatchingNeoStores method createPageCache.

private static PageCache createPageCache(FileSystemAbstraction fileSystem, Config config, PageCacheTracer tracer, JobScheduler jobScheduler, MemoryTracker memoryTracker) {
    SingleFilePageSwapperFactory swapperFactory = new SingleFilePageSwapperFactory(fileSystem);
    MemoryAllocator memoryAllocator = createAllocator(ByteUnit.parse(config.get(pagecache_memory)), memoryTracker);
    MuninnPageCache.Configuration configuration = MuninnPageCache.config(memoryAllocator).pageCacheTracer(tracer).memoryTracker(memoryTracker).bufferFactory(new ConfigurableIOBufferFactory(config, memoryTracker)).faultLockStriping(1 << 11).disableEvictionThread();
    return new MuninnPageCache(swapperFactory, jobScheduler, configuration);
}
Also used : MemoryAllocator(org.neo4j.io.mem.MemoryAllocator) MuninnPageCache(org.neo4j.io.pagecache.impl.muninn.MuninnPageCache) SingleFilePageSwapperFactory(org.neo4j.io.pagecache.impl.SingleFilePageSwapperFactory) ConfigurableIOBufferFactory(org.neo4j.configuration.pagecache.ConfigurableIOBufferFactory)

Example 2 with ConfigurableIOBufferFactory

use of org.neo4j.configuration.pagecache.ConfigurableIOBufferFactory in project neo4j by neo4j.

the class ConfiguringPageCacheFactory method createPageCache.

protected PageCache createPageCache() {
    long pageCacheMaxMemory = getPageCacheMaxMemory(config);
    var memoryPool = memoryPools.pool(PAGE_CACHE, pageCacheMaxMemory, false, null);
    var memoryTracker = memoryPool.getPoolMemoryTracker();
    MemoryAllocator memoryAllocator = buildMemoryAllocator(pageCacheMaxMemory, memoryTracker);
    var bufferFactory = new ConfigurableIOBufferFactory(config, memoryTracker);
    MuninnPageCache.Configuration configuration = MuninnPageCache.config(memoryAllocator).memoryTracker(memoryTracker).bufferFactory(bufferFactory).preallocateStoreFiles(config.get(preallocate_store_files)).clock(clock).pageCacheTracer(pageCacheTracer);
    return new MuninnPageCache(swapperFactory, scheduler, configuration);
}
Also used : MemoryAllocator(org.neo4j.io.mem.MemoryAllocator) MuninnPageCache(org.neo4j.io.pagecache.impl.muninn.MuninnPageCache) ConfigurableIOBufferFactory(org.neo4j.configuration.pagecache.ConfigurableIOBufferFactory)

Example 3 with ConfigurableIOBufferFactory

use of org.neo4j.configuration.pagecache.ConfigurableIOBufferFactory in project neo4j by neo4j.

the class MuninnPageCacheTest method createFixture.

@Override
protected Fixture<MuninnPageCache> createFixture() {
    ConfigurableIOBufferFactory bufferFactory = new ConfigurableIOBufferFactory(Config.defaults(pagecache_buffered_flush_enabled, true), new ScopedMemoryTracker(INSTANCE));
    fixture = new MuninnPageCacheFixture();
    fixture.withBufferFactory(bufferFactory);
    return fixture;
}
Also used : ScopedMemoryTracker(org.neo4j.memory.ScopedMemoryTracker) ConfigurableIOBufferFactory(org.neo4j.configuration.pagecache.ConfigurableIOBufferFactory)

Aggregations

ConfigurableIOBufferFactory (org.neo4j.configuration.pagecache.ConfigurableIOBufferFactory)3 MemoryAllocator (org.neo4j.io.mem.MemoryAllocator)2 MuninnPageCache (org.neo4j.io.pagecache.impl.muninn.MuninnPageCache)2 SingleFilePageSwapperFactory (org.neo4j.io.pagecache.impl.SingleFilePageSwapperFactory)1 ScopedMemoryTracker (org.neo4j.memory.ScopedMemoryTracker)1