Search in sources :

Example 1 with TransactionExecutionMonitor

use of org.neo4j.kernel.impl.query.TransactionExecutionMonitor in project neo4j by neo4j.

the class Database method buildKernel.

private DatabaseKernelModule buildKernel(LogFiles logFiles, TransactionAppender appender, IndexingService indexingService, DatabaseSchemaState databaseSchemaState, StorageEngine storageEngine, TransactionIdStore transactionIdStore, KernelVersionRepository kernelVersionRepository, AvailabilityGuard databaseAvailabilityGuard, SystemNanoClock clock, IndexStatisticsStore indexStatisticsStore, LeaseService leaseService) {
    AtomicReference<CpuClock> cpuClockRef = setupCpuClockAtomicReference();
    TransactionCommitProcess transactionCommitProcess = commitProcessFactory.create(appender, storageEngine, namedDatabaseId, readOnlyDatabaseChecker);
    /*
         * This is used by explicit indexes and constraint indexes whenever a transaction is to be spawned
         * from within an existing transaction. It smells, and we should look over alternatives when time permits.
         */
    Supplier<Kernel> kernelProvider = () -> kernelModule.kernelAPI();
    ConstraintIndexCreator constraintIndexCreator = new ConstraintIndexCreator(kernelProvider, indexingService, internalLogProvider);
    TransactionExecutionMonitor transactionExecutionMonitor = getMonitors().newMonitor(TransactionExecutionMonitor.class);
    KernelTransactions kernelTransactions = life.add(new KernelTransactions(databaseConfig, locks, constraintIndexCreator, transactionCommitProcess, databaseTransactionEventListeners, transactionStats, databaseAvailabilityGuard, storageEngine, globalProcedures, transactionIdStore, globalDependencies.resolveDependency(DbmsRuntimeRepository.class), kernelVersionRepository, clock, cpuClockRef, accessCapabilityFactory, versionContextSupplier, collectionsFactorySupplier, constraintSemantics, databaseSchemaState, tokenHolders, getNamedDatabaseId(), indexingService, indexStatisticsStore, databaseDependencies, tracers, leaseService, transactionsMemoryPool, readOnlyDatabaseChecker, transactionExecutionMonitor, externalIdReuseConditionProvider));
    buildTransactionMonitor(kernelTransactions, databaseConfig);
    KernelImpl kernel = new KernelImpl(kernelTransactions, databaseHealth, transactionStats, globalProcedures, databaseConfig, storageEngine, transactionExecutionMonitor);
    life.add(kernel);
    final DatabaseFileListing fileListing = new DatabaseFileListing(databaseLayout, logFiles, indexingService, storageEngine, idGeneratorFactory);
    databaseDependencies.satisfyDependency(fileListing);
    return new DatabaseKernelModule(transactionCommitProcess, kernel, kernelTransactions, fileListing);
}
Also used : ConstraintIndexCreator(org.neo4j.kernel.impl.api.state.ConstraintIndexCreator) DatabaseFileListing(org.neo4j.kernel.impl.transaction.state.DatabaseFileListing) CpuClock(org.neo4j.resources.CpuClock) TransactionCommitProcess(org.neo4j.kernel.impl.api.TransactionCommitProcess) TransactionExecutionMonitor(org.neo4j.kernel.impl.query.TransactionExecutionMonitor) KernelTransactions(org.neo4j.kernel.impl.api.KernelTransactions) KernelImpl(org.neo4j.kernel.impl.api.KernelImpl) Kernel(org.neo4j.kernel.api.Kernel)

Aggregations

Kernel (org.neo4j.kernel.api.Kernel)1 KernelImpl (org.neo4j.kernel.impl.api.KernelImpl)1 KernelTransactions (org.neo4j.kernel.impl.api.KernelTransactions)1 TransactionCommitProcess (org.neo4j.kernel.impl.api.TransactionCommitProcess)1 ConstraintIndexCreator (org.neo4j.kernel.impl.api.state.ConstraintIndexCreator)1 TransactionExecutionMonitor (org.neo4j.kernel.impl.query.TransactionExecutionMonitor)1 DatabaseFileListing (org.neo4j.kernel.impl.transaction.state.DatabaseFileListing)1 CpuClock (org.neo4j.resources.CpuClock)1