Exemple #1
0
        public override long PageCacheMemory()
        {
            string pageCacheMemory = Config.get(pagecache_memory);

            if (string.ReferenceEquals(pageCacheMemory, null))
            {
                pageCacheMemory = ConfiguringPageCacheFactory.defaultHeuristicPageCacheMemory() + "";
            }
            return(min(Configuration_Fields.MaxPageCacheMemory, ByteUnit.parse(pageCacheMemory)));
        }
Exemple #2
0
        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, Org.Neo4j.Io.pagecache.tracing.cursor.PageCursorTracerSupplier_Fields.Null);

            config.AugmentDefaults(GraphDatabaseSettings.pagecache_memory, "8M");
            FormattedLogProvider logProvider = FormattedLogProvider.toOutputStream(System.err);

            InitializeJobScheduler();
            ConfiguringPageCacheFactory pageCacheFactory = new ConfiguringPageCacheFactory(fs, config, tracer, cursorTracerSupplier, logProvider.GetLog(typeof(PageCache)), EmptyVersionContextSupplier.EMPTY, JobScheduler);

            return(pageCacheFactory.OrCreatePageCache);
        }
Exemple #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldParseDefaultPageCacheMemorySetting()
        public virtual void ShouldParseDefaultPageCacheMemorySetting()
        {
            // GIVEN
            Configuration config = Configuration.DEFAULT;

            // WHEN
            long memory = config.PageCacheMemory();

            // THEN
            long heuristic = ConfiguringPageCacheFactory.defaultHeuristicPageCacheMemory();

            assertTrue(Within(memory, heuristic, MAX_PAGE_CACHE_MEMORY));
        }