Search in sources :

Example 1 with PageCursorTracerSupplier

use of org.neo4j.io.pagecache.tracing.cursor.PageCursorTracerSupplier in project neo4j by neo4j.

the class ConfigurablePageCacheRule method createPageCache.

private PageCache createPageCache(FileSystemAbstraction fs, PageCacheConfig pageCacheConfig, Config config) {
    PageCacheTracer tracer = selectConfig(baseConfig.tracer, pageCacheConfig.tracer, PageCacheTracer.NULL);
    PageCursorTracerSupplier cursorTracerSupplier = selectConfig(baseConfig.pageCursorTracerSupplier, pageCacheConfig.pageCursorTracerSupplier, DefaultPageCursorTracerSupplier.INSTANCE);
    Config finalConfig = config.withDefaults(MapUtil.stringMap(GraphDatabaseSettings.pagecache_memory.name(), "8M"));
    FormattedLogProvider logProvider = FormattedLogProvider.toOutputStream(System.err);
    ConfiguringPageCacheFactory pageCacheFactory = new ConfiguringPageCacheFactory(fs, finalConfig, tracer, cursorTracerSupplier, logProvider.getLog(PageCache.class)) {

        @Override
        public int calculatePageSize(Config config, PageSwapperFactory swapperFactory) {
            if (pageCacheConfig.pageSize != null) {
                return pageCacheConfig.pageSize;
            }
            return super.calculatePageSize(config, swapperFactory);
        }
    };
    return pageCacheFactory.getOrCreatePageCache();
}
Also used : PageSwapperFactory(org.neo4j.io.pagecache.PageSwapperFactory) PageCursorTracerSupplier(org.neo4j.io.pagecache.tracing.cursor.PageCursorTracerSupplier) DefaultPageCursorTracerSupplier(org.neo4j.io.pagecache.tracing.cursor.DefaultPageCursorTracerSupplier) Config(org.neo4j.kernel.configuration.Config) PageCacheTracer(org.neo4j.io.pagecache.tracing.PageCacheTracer) ConfiguringPageCacheFactory(org.neo4j.kernel.impl.pagecache.ConfiguringPageCacheFactory) PageCache(org.neo4j.io.pagecache.PageCache) FormattedLogProvider(org.neo4j.logging.FormattedLogProvider)

Aggregations

PageCache (org.neo4j.io.pagecache.PageCache)1 PageSwapperFactory (org.neo4j.io.pagecache.PageSwapperFactory)1 PageCacheTracer (org.neo4j.io.pagecache.tracing.PageCacheTracer)1 DefaultPageCursorTracerSupplier (org.neo4j.io.pagecache.tracing.cursor.DefaultPageCursorTracerSupplier)1 PageCursorTracerSupplier (org.neo4j.io.pagecache.tracing.cursor.PageCursorTracerSupplier)1 Config (org.neo4j.kernel.configuration.Config)1 ConfiguringPageCacheFactory (org.neo4j.kernel.impl.pagecache.ConfiguringPageCacheFactory)1 FormattedLogProvider (org.neo4j.logging.FormattedLogProvider)1