use of org.neo4j.memory.MemoryPools in project neo4j by neo4j.
the class KernelTransactionTestBase method newNotInitializedTransaction.
KernelTransactionImplementation newNotInitializedTransaction(LeaseService leaseService, Config config, NamedDatabaseId databaseId) {
Dependencies dependencies = new Dependencies();
dependencies.satisfyDependency(mock(GraphDatabaseFacade.class));
var memoryPool = new MemoryPools().pool(MemoryGroup.TRANSACTION, ByteUnit.mebiBytes(4), null);
return new KernelTransactionImplementation(config, mock(DatabaseTransactionEventListeners.class), null, null, commitProcess, transactionMonitor, txPool, clock, new AtomicReference<>(CpuClock.NOT_AVAILABLE), mock(DatabaseTracers.class, RETURNS_MOCKS), storageEngine, any -> CanWrite.INSTANCE, EmptyVersionContextSupplier.EMPTY, () -> collectionsFactory, new StandardConstraintSemantics(), mock(SchemaState.class), mockedTokenHolders(), mock(IndexingService.class), mock(IndexStatisticsStore.class), dependencies, databaseId, leaseService, memoryPool, new DatabaseReadOnlyChecker.Default(new DbmsReadOnlyChecker.Default(config), databaseId.name()), TransactionExecutionMonitor.NO_OP, CommunitySecurityLog.NULL_LOG, () -> KernelVersion.LATEST, mock(DbmsRuntimeRepository.class));
}
use of org.neo4j.memory.MemoryPools in project neo4j by neo4j.
the class IndexCheckingSelectorTest method checkIndexesWithoutValuesWithNodeChecker.
@Test
void checkIndexesWithoutValuesWithNodeChecker() throws Exception {
try (Transaction tx = db.beginTx()) {
Node node = tx.createNode(label1);
node.setProperty(property1, "value");
tx.commit();
}
try (Transaction tx = db.beginTx()) {
tx.execute("CREATE FULLTEXT INDEX FOR (n:Label1) ON EACH [n.property1]");
tx.commit();
}
dbms.shutdown();
Config config = defaults(GraphDatabaseSettings.logs_directory, layout.databaseDirectory());
JobScheduler jobScheduler = JobSchedulerFactory.createInitialisedScheduler();
ConfiguringPageCacheFactory pageCacheFactory = new ConfiguringPageCacheFactory(fs, config, NULL, NullLog.getInstance(), jobScheduler, Clocks.nanoClock(), new MemoryPools(config.get(memory_tracking)));
PageCache pageCache = pageCacheFactory.getOrCreatePageCache();
ConsistencyCheckService.Result result;
try {
result = new ConsistencyCheckService().runFullConsistencyCheck(layout, config, NONE, nullLogProvider(), fs, pageCache, debugContext, layout.databaseDirectory(), DEFAULT, NULL, INSTANCE);
} finally {
pageCache.close();
jobScheduler.close();
}
assertTrue(result.isSuccessful());
assertThat(output.toString()).contains("IndexChecker[entityType:NODE,indexesToCheck:1]").containsPattern("NodeChecker\\[highId:.,indexesToCheck:0\\]");
}
use of org.neo4j.memory.MemoryPools in project neo4j by neo4j.
the class ConsistencyCheckService method runFullConsistencyCheck.
public Result runFullConsistencyCheck(DatabaseLayout databaseLayout, Config config, ProgressMonitorFactory progressFactory, LogProvider logProvider, FileSystemAbstraction fileSystem, boolean verbose, Path reportDir, ConsistencyFlags consistencyFlags) throws ConsistencyCheckIncompleteException {
Log log = logProvider.getLog(getClass());
JobScheduler jobScheduler = JobSchedulerFactory.createInitialisedScheduler();
var pageCacheTracer = PageCacheTracer.NULL;
var memoryTracker = EmptyMemoryTracker.INSTANCE;
ConfiguringPageCacheFactory pageCacheFactory = new ConfiguringPageCacheFactory(fileSystem, config, pageCacheTracer, logProvider.getLog(PageCache.class), jobScheduler, Clocks.nanoClock(), new MemoryPools(config.get(memory_tracking)));
PageCache pageCache = pageCacheFactory.getOrCreatePageCache();
try {
return runFullConsistencyCheck(databaseLayout, config, progressFactory, logProvider, fileSystem, pageCache, verbose, reportDir, consistencyFlags, pageCacheTracer, memoryTracker);
} finally {
try {
pageCache.close();
} catch (Exception e) {
log.error("Failure during shutdown of the page cache", e);
}
try {
jobScheduler.close();
} catch (Exception e) {
log.error("Failure during shutdown of the job scheduler", e);
}
}
}
use of org.neo4j.memory.MemoryPools in project neo4j by neo4j.
the class AbstractDirectBufferTest method setUp.
@BeforeEach
void setUp() {
var buckets = List.of("1K:1", "2K:1", "4K:1", "8K:1");
var poolConfig = new NeoBufferPoolConfigOverride(Duration.ZERO, buckets);
var bufferManger = new NeoByteBufferPool(poolConfig, new MemoryPools(), null);
tracingPoolWrapper = new TracingPoolWrapper(bufferManger);
nettyBufferAllocator = new NettyMemoryManagerWrapper(tracingPoolWrapper);
}
Aggregations