public ReplicatedTransactionStateMachine(CommandIndexTracker commandIndexTracker, ReplicatedLockTokenStateMachine lockStateMachine, int maxBatchSize, LogProvider logProvider, PageCursorTracerSupplier pageCursorTracerSupplier, VersionContextSupplier versionContextSupplier) { this._commandIndexTracker = commandIndexTracker; this._lockTokenStateMachine = lockStateMachine; this._maxBatchSize = maxBatchSize; this._log = logProvider.getLog(this.GetType()); this._pageCursorTracerSupplier = pageCursorTracerSupplier; this._versionContextSupplier = versionContextSupplier; }
internal TestKernelTransactions(StatementLocksFactory statementLocksFactory, ConstraintIndexCreator constraintIndexCreator, StatementOperationParts statementOperations, SchemaWriteGuard schemaWriteGuard, TransactionHeaderInformationFactory txHeaderFactory, TransactionCommitProcess transactionCommitProcess, AuxiliaryTransactionStateManager auxTxStateManager, TransactionHooks hooks, TransactionMonitor transactionMonitor, AvailabilityGuard databaseAvailabilityGuard, Tracers tracers, StorageEngine storageEngine, Procedures procedures, TransactionIdStore transactionIdStore, SystemNanoClock clock, AccessCapability accessCapability, AutoIndexing autoIndexing, VersionContextSupplier versionContextSupplier, TokenHolders tokenHolders, Dependencies dataSourceDependencies) : base(Config.defaults(), statementLocksFactory, constraintIndexCreator, statementOperations, schemaWriteGuard, txHeaderFactory, transactionCommitProcess, auxTxStateManager, hooks, transactionMonitor, databaseAvailabilityGuard, tracers, storageEngine, procedures, transactionIdStore, clock, new AtomicReference <CpuClock>(CpuClock.NOT_AVAILABLE), new AtomicReference <HeapAllocation>(HeapAllocation.NOT_AVAILABLE), accessCapability, autoIndexing, mock(typeof(ExplicitIndexStore)), versionContextSupplier, ON_HEAP, new StandardConstraintSemantics(), mock(typeof(SchemaState)), mock(typeof(IndexingService)), tokenHolders, DEFAULT_DATABASE_NAME, dataSourceDependencies) { }
public ActiveState(ReadableState <Key> store, VersionContextSupplier versionContextSupplier) { this.Store = store; this.VersionContextSupplier = versionContextSupplier; }
//JAVA TO C# CONVERTER WARNING: 'final' parameters are ignored unless the option to convert to C# 7.2 'in' parameters is selected: //ORIGINAL LINE: public CountsTracker(final org.neo4j.logging.LogProvider logProvider, org.neo4j.io.fs.FileSystemAbstraction fs, org.neo4j.io.pagecache.PageCache pages, org.neo4j.kernel.configuration.Config config, org.neo4j.io.layout.DatabaseLayout databaseLayout, org.neo4j.time.SystemNanoClock clock, org.neo4j.io.pagecache.tracing.cursor.context.VersionContextSupplier versionContextSupplier) public CountsTracker(LogProvider logProvider, FileSystemAbstraction fs, PageCache pages, Config config, DatabaseLayout databaseLayout, SystemNanoClock clock, VersionContextSupplier versionContextSupplier) : base(fs, pages, databaseLayout, new CountsTrackerRotationMonitor(logProvider), logProvider.GetLog(typeof(CountsTracker)).infoLogger(), new RotationTimerFactory(clock, config.Get(counts_store_rotation_timeout).toMillis()), versionContextSupplier, 16, 16, _headerFields) { }
public RecordStorageEngine(DatabaseLayout databaseLayout, Config config, PageCache pageCache, FileSystemAbstraction fs, LogProvider logProvider, LogProvider userLogProvider, TokenHolders tokenHolders, SchemaState schemaState, ConstraintSemantics constraintSemantics, JobScheduler scheduler, TokenNameLookup tokenNameLookup, LockService lockService, IndexProviderMap indexProviderMap, IndexingService.Monitor indexingServiceMonitor, DatabaseHealth databaseHealth, ExplicitIndexProvider explicitIndexProvider, IndexConfigStore indexConfigStore, IdOrderingQueue explicitIndexTransactionOrdering, IdGeneratorFactory idGeneratorFactory, IdController idController, Monitors monitors, RecoveryCleanupWorkCollector recoveryCleanupWorkCollector, OperationalMode operationalMode, VersionContextSupplier versionContextSupplier) { this._tokenHolders = tokenHolders; this._schemaState = schemaState; this._lockService = lockService; this._databaseHealth = databaseHealth; this._explicitIndexProviderLookup = explicitIndexProvider; this._indexConfigStore = indexConfigStore; this._constraintSemantics = constraintSemantics; this._explicitIndexTransactionOrdering = explicitIndexTransactionOrdering; this._idController = idController; StoreFactory factory = new StoreFactory(databaseLayout, config, idGeneratorFactory, pageCache, fs, logProvider, versionContextSupplier); _neoStores = factory.OpenAllNeoStores(true); try { _schemaCache = new SchemaCache(constraintSemantics, Collections.emptyList(), indexProviderMap); _schemaStorage = new SchemaStorage(_neoStores.SchemaStore); NeoStoreIndexStoreView neoStoreIndexStoreView = new NeoStoreIndexStoreView(lockService, _neoStores); bool readOnly = config.Get(GraphDatabaseSettings.read_only) && operationalMode == OperationalMode.single; monitors.AddMonitorListener(new LoggingMonitor(logProvider.GetLog(typeof(NativeLabelScanStore)))); _labelScanStore = new NativeLabelScanStore(pageCache, databaseLayout, fs, new FullLabelStream(neoStoreIndexStoreView), readOnly, monitors, recoveryCleanupWorkCollector); _indexStoreView = new DynamicIndexStoreView(neoStoreIndexStoreView, _labelScanStore, lockService, _neoStores, logProvider); this._indexProviderMap = indexProviderMap; _indexingService = IndexingServiceFactory.createIndexingService(config, scheduler, indexProviderMap, _indexStoreView, tokenNameLookup, Iterators.asList(_schemaStorage.loadAllSchemaRules()), logProvider, userLogProvider, indexingServiceMonitor, schemaState, readOnly); _integrityValidator = new IntegrityValidator(_neoStores, _indexingService); _cacheAccess = new BridgingCacheAccess(_schemaCache, schemaState, tokenHolders); _explicitIndexApplierLookup = new Org.Neo4j.Kernel.Impl.Api.ExplicitIndexApplierLookup_Direct(explicitIndexProvider); _labelScanStoreSync = new WorkSync <Supplier <LabelScanWriter>, LabelUpdateWork>(_labelScanStore.newWriter); _commandReaderFactory = new RecordStorageCommandReaderFactory(); _indexUpdatesSync = new WorkSync <IndexingUpdateService, IndexUpdatesWork>(_indexingService); _denseNodeThreshold = config.Get(GraphDatabaseSettings.dense_node_threshold); _recordIdBatchSize = config.Get(GraphDatabaseSettings.record_id_batch_size); } catch (Exception failure) { _neoStores.close(); throw failure; } }
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET: //ORIGINAL LINE: public AbstractKeyValueStore(org.neo4j.io.fs.FileSystemAbstraction fs, org.neo4j.io.pagecache.PageCache pages, org.neo4j.io.layout.DatabaseLayout databaseLayout, RotationMonitor monitor, org.neo4j.logging.Logger logger, RotationTimerFactory timerFactory, org.neo4j.io.pagecache.tracing.cursor.context.VersionContextSupplier versionContextSupplier, int keySize, int valueSize, HeaderField<?>... headerFields) public AbstractKeyValueStore(FileSystemAbstraction fs, PageCache pages, DatabaseLayout databaseLayout, RotationMonitor monitor, Logger logger, RotationTimerFactory timerFactory, VersionContextSupplier versionContextSupplier, int keySize, int valueSize, params HeaderField <object>[] headerFields) { this._fs = fs; this.KeySize = keySize; this.ValueSize = valueSize; Rotation rotation = this.GetType().getAnnotation(typeof(Rotation)); if (monitor == null) { monitor = RotationMonitor.NONE; } this._format = new Format(this, headerFields); this._logger = logger; this.RotationStrategy = rotation.value().create(fs, pages, _format, monitor, databaseLayout); this._rotationTimerFactory = timerFactory; this.State = new DeadState.Stopped <Key>(_format, this.GetType().getAnnotation(typeof(State)).value(), versionContextSupplier); }
//JAVA TO C# CONVERTER WARNING: 'final' parameters are ignored unless the option to convert to C# 7.2 'in' parameters is selected: //ORIGINAL LINE: public CountsTracker(final org.neo4j.logging.LogProvider logProvider, org.neo4j.io.fs.FileSystemAbstraction fs, org.neo4j.io.pagecache.PageCache pages, org.neo4j.kernel.configuration.Config config, org.neo4j.io.layout.DatabaseLayout databaseLayout, org.neo4j.io.pagecache.tracing.cursor.context.VersionContextSupplier versionContextSupplier) public CountsTracker(LogProvider logProvider, FileSystemAbstraction fs, PageCache pages, Config config, DatabaseLayout databaseLayout, VersionContextSupplier versionContextSupplier) : this(logProvider, fs, pages, config, databaseLayout, Clocks.nanoClock(), versionContextSupplier) { }
protected internal virtual PageCache CreatePageCache(FileSystemAbstraction fileSystem, Config config, LogService logging, Tracers tracers, VersionContextSupplier versionContextSupplier, JobScheduler jobScheduler) { Log pageCacheLog = logging.GetInternalLog(typeof(PageCache)); ConfiguringPageCacheFactory pageCacheFactory = new ConfiguringPageCacheFactory(fileSystem, config, tracers.PageCacheTracer, tracers.PageCursorTracerSupplier, pageCacheLog, versionContextSupplier, jobScheduler); PageCache pageCache = pageCacheFactory.OrCreatePageCache; if (config.Get(GraphDatabaseSettings.dump_configuration)) { pageCacheFactory.DumpConfiguration(); } return(pageCache); }
public PlatformModule(File providedStoreDir, Config config, DatabaseInfo databaseInfo, GraphDatabaseFacadeFactory.Dependencies externalDependencies) { this.DatabaseInfo = databaseInfo; this.DataSourceManager = new DataSourceManager(config); Dependencies = new Dependencies(); Dependencies.satisfyDependency(databaseInfo); Clock = Dependencies.satisfyDependency(CreateClock()); Life = Dependencies.satisfyDependency(CreateLife()); this.StoreLayout = StoreLayout.of(providedStoreDir); config.AugmentDefaults(GraphDatabaseSettings.neo4j_home, StoreLayout.storeDirectory().Path); this.Config = Dependencies.satisfyDependency(config); FileSystem = Dependencies.satisfyDependency(CreateFileSystemAbstraction()); Life.add(new FileSystemLifecycleAdapter(FileSystem)); // Component monitoring Monitors = externalDependencies.Monitors() == null ? new Monitors() : externalDependencies.Monitors(); Dependencies.satisfyDependency(Monitors); JobScheduler = Life.add(Dependencies.satisfyDependency(CreateJobScheduler())); StartDeferredExecutors(JobScheduler, externalDependencies.DeferredExecutors()); // Cleanup after recovery, used by GBPTree, added to life in NeoStoreDataSource RecoveryCleanupWorkCollector = new GroupingRecoveryCleanupWorkCollector(JobScheduler); Dependencies.satisfyDependency(RecoveryCleanupWorkCollector); // Database system information, used by UDC UsageData = new UsageData(JobScheduler); Dependencies.satisfyDependency(Life.add(UsageData)); // If no logging was passed in from the outside then create logging and register // with this life Logging = Dependencies.satisfyDependency(CreateLogService(externalDependencies.UserLogProvider())); config.Logger = Logging.getInternalLog(typeof(Config)); Life.add(Dependencies.satisfyDependency(new StoreLockerLifecycleAdapter(CreateStoreLocker()))); (new JvmChecker(Logging.getInternalLog(typeof(JvmChecker)), new JvmMetadataRepository())).checkJvmCompatibilityAndIssueWarning(); string desiredImplementationName = config.Get(GraphDatabaseSettings.tracer); Tracers = Dependencies.satisfyDependency(new Tracers(desiredImplementationName, Logging.getInternalLog(typeof(Tracers)), Monitors, JobScheduler, Clock)); Dependencies.satisfyDependency(Tracers.pageCacheTracer); Dependencies.satisfyDependency(FirstImplementor(typeof(LogRotationMonitor), Tracers.transactionTracer, LogRotationMonitor.NULL)); Dependencies.satisfyDependency(FirstImplementor(typeof(CheckPointerMonitor), Tracers.checkPointTracer, CheckPointerMonitor.NULL)); VersionContextSupplier = CreateCursorContextSupplier(config); CollectionsFactorySupplier = CreateCollectionsFactorySupplier(config, Life); Dependencies.satisfyDependency(VersionContextSupplier); PageCache = Dependencies.satisfyDependency(CreatePageCache(FileSystem, config, Logging, Tracers, VersionContextSupplier, JobScheduler)); Life.add(new PageCacheLifecycle(PageCache)); DiagnosticsManager = Life.add(Dependencies.satisfyDependency(new DiagnosticsManager(Logging.getInternalLog(typeof(DiagnosticsManager))))); SystemDiagnostics.registerWith(DiagnosticsManager); Dependencies.satisfyDependency(DataSourceManager); KernelExtensionFactories = externalDependencies.KernelExtensions(); EngineProviders = externalDependencies.ExecutionEngines(); GlobalKernelExtensions = Dependencies.satisfyDependency(new GlobalKernelExtensions(new SimpleKernelContext(StoreLayout.storeDirectory(), databaseInfo, Dependencies), KernelExtensionFactories, Dependencies, KernelExtensionFailureStrategies.fail())); UrlAccessRule = Dependencies.satisfyDependency(URLAccessRules.combined(externalDependencies.UrlAccessRules())); ConnectorPortRegister = new ConnectorPortRegister(); Dependencies.satisfyDependency(ConnectorPortRegister); EventHandlers = new KernelEventHandlers(Logging.getInternalLog(typeof(KernelEventHandlers))); PanicEventGenerator = new DatabasePanicEventGenerator(EventHandlers); PublishPlatformInfo(Dependencies.resolveDependency(typeof(UsageData))); }
public MuninnPageCache(PageSwapperFactory swapperFactory, MemoryAllocator memoryAllocator, int cachePageSize, PageCacheTracer pageCacheTracer, PageCursorTracerSupplier pageCursorTracerSupplier, VersionContextSupplier versionContextSupplier, JobScheduler jobScheduler) { VerifyHacks(); VerifyCachePageSizeIsPowerOfTwo(cachePageSize); int maxPages = CalculatePageCount(memoryAllocator, cachePageSize); // Expose the total number of pages pageCacheTracer.MaxPages(maxPages); MemoryAllocationTracker memoryTracker = GlobalMemoryTracker.INSTANCE; this._pageCacheId = _pageCacheIdCounter.incrementAndGet(); this._swapperFactory = swapperFactory; this._cachePageSize = cachePageSize; this._keepFree = Math.Min(_pagesToKeepFree, maxPages / 2); this._pageCacheTracer = pageCacheTracer; this._pageCursorTracerSupplier = pageCursorTracerSupplier; this._versionContextSupplier = versionContextSupplier; this._printExceptionsOnClose = true; long alignment = swapperFactory.RequiredBufferAlignment; this.VictimPage = VictimPageReference.GetVictimPage(cachePageSize, memoryTracker); this.Pages = new PageList(maxPages, cachePageSize, memoryAllocator, new SwapperSet(), VictimPage, alignment); this._scheduler = jobScheduler; FreelistHead = new AtomicInteger(); }
/// <summary> /// Create page cache. </summary> /// <param name="swapperFactory"> page cache swapper factory </param> /// <param name="memoryAllocator"> the source of native memory the page cache should use </param> /// <param name="pageCacheTracer"> global page cache tracer </param> /// <param name="pageCursorTracerSupplier"> supplier of thread local (transaction local) page cursor tracer that will provide /// thread local page cache statistics </param> /// <param name="versionContextSupplier"> supplier of thread local (transaction local) version context that will provide /// access to thread local version context </param> public MuninnPageCache(PageSwapperFactory swapperFactory, MemoryAllocator memoryAllocator, PageCacheTracer pageCacheTracer, PageCursorTracerSupplier pageCursorTracerSupplier, VersionContextSupplier versionContextSupplier, JobScheduler jobScheduler) : this(swapperFactory, memoryAllocator, org.neo4j.io.pagecache.PageCache_Fields.PAGE_SIZE, pageCacheTracer, pageCursorTracerSupplier, versionContextSupplier, jobScheduler) { }
/// <summary> /// Create page cache. </summary> /// <param name="swapperFactory"> page cache swapper factory </param> /// <param name="maxPages"> maximum number of pages </param> /// <param name="pageCacheTracer"> global page cache tracer </param> /// <param name="pageCursorTracerSupplier"> supplier of thread local (transaction local) page cursor tracer that will provide /// thread local page cache statistics </param> /// <param name="versionContextSupplier"> supplier of thread local (transaction local) version context that will provide /// access to thread local version context </param> public MuninnPageCache(PageSwapperFactory swapperFactory, int maxPages, PageCacheTracer pageCacheTracer, PageCursorTracerSupplier pageCursorTracerSupplier, VersionContextSupplier versionContextSupplier, JobScheduler jobScheduler) : this(swapperFactory, MemoryAllocator.createAllocator("" + MemoryRequiredForPages(maxPages), GlobalMemoryTracker.INSTANCE), org.neo4j.io.pagecache.PageCache_Fields.PAGE_SIZE, pageCacheTracer, pageCursorTracerSupplier, versionContextSupplier, jobScheduler) { }