//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldExtractTransactionInformationFromMetaDataStore() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldExtractTransactionInformationFromMetaDataStore() { // given // ... variables long txId = 42; long checksum = 123456789123456789L; long timestamp = 919191919191919191L; TransactionId expected = new TransactionId(txId, checksum, timestamp); // ... and files DatabaseLayout databaseLayout = _directory.databaseLayout(); File neoStore = databaseLayout.MetadataStore(); neoStore.createNewFile(); // ... and mocks Config config = mock(typeof(Config)); LogService logService = mock(typeof(LogService)); // when // ... data in record setRecord(_pageCache, neoStore, LAST_TRANSACTION_ID, txId); setRecord(_pageCache, neoStore, LAST_TRANSACTION_CHECKSUM, checksum); setRecord(_pageCache, neoStore, LAST_TRANSACTION_COMMIT_TIMESTAMP, timestamp); // ... and with migrator StoreMigrator migrator = new StoreMigrator(_fileSystemRule.get(), _pageCache, config, logService, _jobScheduler); TransactionId actual = migrator.ExtractTransactionIdInformation(neoStore, txId); // then assertEquals(expected, actual); }
private static BoltConnectionReadLimiter CreateReadLimiter(Config config, LogService logService) { int lowWatermark = config.Get(GraphDatabaseSettings.bolt_inbound_message_throttle_low_water_mark); int highWatermark = config.Get(GraphDatabaseSettings.bolt_inbound_message_throttle_high_water_mark); return(new BoltConnectionReadLimiter(logService, lowWatermark, highWatermark)); }
public static LocksFactory CreateLockFactory(Config config, LogService logging) { string key = config.Get(GraphDatabaseSettings.LockManager); foreach (DynamicLocksFactory candidate in Service.load(typeof(DynamicLocksFactory))) { string candidateId = candidate.Keys.GetEnumerator().next(); if (key.Equals(candidateId)) { return(candidate); } else if ("".Equals(key)) { logging.GetInternalLog(typeof(CommunityEditionModule)).info("No locking implementation specified, defaulting to '" + candidateId + "'"); return(candidate); } } if ("community".Equals(key)) { return(new CommunityLocksFactory()); } else if (StringUtils.isEmpty(key)) { logging.GetInternalLog(typeof(CommunityEditionModule)).info("No locking implementation specified, defaulting to 'community'"); return(new CommunityLocksFactory()); } throw new System.ArgumentException("No lock manager found with the name '" + key + "'."); }
private BoltConnectionReadLimiter NewLimiter(int low, int high) { LogService logService = mock(typeof(LogService)); when(logService.GetInternalLog(typeof(BoltConnectionReadLimiter))).thenReturn(_log); return(new BoltConnectionReadLimiter(logService, low, high)); }
public LifecycleAdapterAnonymousInnerClass(QueryLoggerKernelExtension outerInstance, FileSystemAbstraction fileSystem, Config config, Monitors monitoring, LogService logService, JobScheduler jobScheduler) { this.outerInstance = outerInstance; this._fileSystem = fileSystem; this._config = config; this._monitoring = monitoring; this._logService = logService; this._jobScheduler = jobScheduler; }
public DefaultBoltConnectionFactory(BoltSchedulerProvider schedulerProvider, TransportThrottleGroup throttleGroup, Config config, LogService logService, Clock clock, Monitors monitors) { this._schedulerProvider = schedulerProvider; this._throttleGroup = throttleGroup; this._config = config; this._logService = logService; this._clock = clock; this._monitors = monitors; this._metricsMonitor = monitors.NewMonitor(typeof(BoltConnectionMetricsMonitor)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Override public org.neo4j.kernel.lifecycle.Lifecycle newInstance(@SuppressWarnings("unused") org.neo4j.kernel.impl.spi.KernelContext context, final Dependencies dependencies) //JAVA TO C# CONVERTER WARNING: 'final' parameters are ignored unless the option to convert to C# 7.2 'in' parameters is selected: public override Lifecycle NewInstance(KernelContext context, Dependencies dependencies) { FileSystemAbstraction fileSystem = dependencies.FileSystem(); Config config = dependencies.Config(); Monitors monitoring = dependencies.Monitoring(); LogService logService = dependencies.Logger(); JobScheduler jobScheduler = dependencies.JobScheduler(); return(new LifecycleAdapterAnonymousInnerClass(this, fileSystem, config, monitoring, logService, jobScheduler)); }
public BoltStateMachineFactoryImpl(DatabaseManager databaseManager, UsageData usageData, Authentication authentication, Clock clock, Config config, LogService logging) { this._databaseManager = databaseManager; this._usageData = usageData; this._logging = logging; this._authentication = authentication; this._config = config; this._clock = clock; this._activeDatabaseName = config.Get(GraphDatabaseSettings.active_database); }
public BoltProtocolV1(BoltChannel channel, BoltConnectionFactory connectionFactory, BoltStateMachineFactory stateMachineFactory, LogService logging) { this._channel = channel; this._logging = logging; BoltStateMachine stateMachine = stateMachineFactory.NewStateMachine(Version(), channel); this._connection = connectionFactory.NewConnection(channel, stateMachine); this._neo4jPack = CreatePack(); this._messageReader = CreateMessageReader(channel, _neo4jPack, _connection, logging); }
public SwitchToMaster(LogService logService, HaIdGeneratorFactory idGeneratorFactory, Config config, System.Func <SlaveFactory> slaveFactorySupplier, System.Func <Locks, ConversationManager> conversationManagerFactory, System.Func <ConversationManager, LifeSupport, Master> masterFactory, System.Func <Master, ConversationManager, MasterServer> masterServerFactory, DelegateInvocationHandler <Master> masterDelegateHandler, ClusterMemberAvailability clusterMemberAvailability, System.Func <NeoStoreDataSource> dataSourceSupplier) { this.ConversationManagerFactory = conversationManagerFactory; this.MasterFactory = masterFactory; this.MasterServerFactory = masterServerFactory; this._userLog = logService.GetUserLog(this.GetType()); this._idGeneratorFactory = idGeneratorFactory; this._config = config; this._slaveFactorySupplier = slaveFactorySupplier; this._masterDelegateHandler = masterDelegateHandler; this._clusterMemberAvailability = clusterMemberAvailability; this._dataSourceSupplier = dataSourceSupplier; }
public DatabaseMigrator(MigrationProgressMonitor progressMonitor, FileSystemAbstraction fs, Config config, LogService logService, IndexProviderMap indexProviderMap, ExplicitIndexProvider indexProvider, PageCache pageCache, RecordFormats format, LogTailScanner tailScanner, JobScheduler jobScheduler) { this._progressMonitor = progressMonitor; this._fs = fs; this._config = config; this._logService = logService; this._indexProviderMap = indexProviderMap; this._explicitIndexProvider = indexProvider; this._pageCache = pageCache; this._format = format; this._tailScanner = tailScanner; this._jobScheduler = jobScheduler; }
internal MetricsExtension(KernelContext kernelContext, MetricsKernelExtensionFactory.Dependencies dependencies) { LogService logService = dependencies.LogService(); Config configuration = dependencies.Configuration(); FileSystemAbstraction fileSystem = dependencies.FileSystemAbstraction(); JobScheduler scheduler = dependencies.Scheduler(); _logger = logService.GetUserLog(this.GetType()); MetricRegistry registry = new MetricRegistry(); _reporter = (new EventReporterBuilder(configuration, registry, _logger, kernelContext, _life, fileSystem, scheduler, dependencies.PortRegister())).build(); _metricsBuilt = (new Neo4jMetricsBuilder(registry, _reporter, configuration, logService, kernelContext, dependencies, _life)).build(); }
public ParallelBatchImporter(DatabaseLayout directoryStructure, FileSystemAbstraction fileSystem, PageCache externalPageCache, Configuration config, LogService logService, ExecutionMonitor executionMonitor, AdditionalInitialIds additionalInitialIds, Config dbConfig, RecordFormats recordFormats, ImportLogic.Monitor monitor, JobScheduler jobScheduler) { this._externalPageCache = externalPageCache; this._directoryStructure = directoryStructure; this._fileSystem = fileSystem; this._config = config; this._logService = logService; this._dbConfig = dbConfig; this._recordFormats = recordFormats; this._executionMonitor = executionMonitor; this._additionalInitialIds = additionalInitialIds; this._monitor = monitor; this._jobScheduler = jobScheduler; }
public CommunityEditionModule(PlatformModule platformModule) { Org.Neo4j.Kernel.impl.util.Dependencies dependencies = platformModule.Dependencies; Config config = platformModule.Config; LogService logging = platformModule.Logging; FileSystemAbstraction fileSystem = platformModule.FileSystem; PageCache pageCache = platformModule.PageCache; DataSourceManager dataSourceManager = platformModule.DataSourceManager; LifeSupport life = platformModule.Life; life.Add(platformModule.DataSourceManager); WatcherServiceFactoryConflict = databaseDir => CreateFileSystemWatcherService(fileSystem, databaseDir, logging, platformModule.JobScheduler, config, FileWatcherFileNameFilter()); this.AccessCapabilityConflict = config.Get(GraphDatabaseSettings.read_only) ? new ReadOnly() : new CanWrite(); dependencies.SatisfyDependency(SslPolicyLoader.create(config, logging.InternalLogProvider)); // for bolt and web server LocksFactory lockFactory = createLockFactory(config, logging); LocksSupplierConflict = () => createLockManager(lockFactory, config, platformModule.Clock); StatementLocksFactoryProviderConflict = locks => CreateStatementLocksFactory(locks, config, logging); ThreadToTransactionBridgeConflict = dependencies.SatisfyDependency(new ThreadToStatementContextBridge(GetGlobalAvailabilityGuard(platformModule.Clock, logging, platformModule.Config))); IdContextFactoryConflict = CreateIdContextFactory(platformModule, fileSystem); TokenHoldersProviderConflict = CreateTokenHolderProvider(platformModule); File kernelContextDirectory = platformModule.StoreLayout.storeDirectory(); dependencies.SatisfyDependency(CreateKernelData(fileSystem, pageCache, kernelContextDirectory, config, life, dataSourceManager)); CommitProcessFactoryConflict = new CommunityCommitProcessFactory(); HeaderInformationFactoryConflict = CreateHeaderInformationFactory(); SchemaWriteGuardConflict = CreateSchemaWriteGuard(); TransactionStartTimeoutConflict = config.Get(GraphDatabaseSettings.transaction_start_timeout).toMillis(); ConstraintSemanticsConflict = CreateSchemaRuleVerifier(); IoLimiterConflict = Org.Neo4j.Io.pagecache.IOLimiter_Fields.Unlimited; ConnectionTrackerConflict = dependencies.SatisfyDependency(CreateConnectionTracker()); PublishEditionInfo(dependencies.ResolveDependency(typeof(UsageData)), platformModule.DatabaseInfo, config); }
public override Lifecycle NewInstance(KernelContext context, Dependencies deps) { JobScheduler scheduler = deps.JobScheduler(); DatabaseAvailabilityGuard databaseAvailabilityGuard = deps.AvailabilityGuard(); PageCache pageCache = deps.PageCache(); FileSystemAbstraction fs = deps.FileSystemAbstraction(); LogService logService = deps.LogService(); NeoStoreDataSource dataSourceManager = deps.DataSource; Log log = logService.GetInternalLog(typeof(PageCacheWarmer)); Monitors monitors = deps.Monitors(); PageCacheWarmerMonitor monitor = monitors.NewMonitor(typeof(PageCacheWarmerMonitor)); monitors.AddMonitorListener(new PageCacheWarmerLoggingMonitor(log)); Config config = deps.Config(); return(new PageCacheWarmerKernelExtension(scheduler, databaseAvailabilityGuard, pageCache, fs, dataSourceManager, log, monitor, config)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldNotWriteDebugToInternalDiagnosticsLogByDefault() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldNotWriteDebugToInternalDiagnosticsLogByDefault() { // Given GraphDatabaseService db = (new TestGraphDatabaseFactory()).newEmbeddedDatabaseBuilder(TestDir.storeDir()).setConfig(GraphDatabaseSettings.logs_directory, TestDir.directory("logs").AbsolutePath).newGraphDatabase(); // When LogService logService = (( GraphDatabaseAPI )db).DependencyResolver.resolveDependency(typeof(LogService)); logService.GetInternalLog(this.GetType()).debug("A debug entry"); Db.shutdown(); File internalLog = new File(TestDir.directory("logs"), INTERNAL_LOG_FILE); // Then assertThat(internalLog.File, @is(true)); assertThat(internalLog.length(), greaterThan(0L)); assertEquals(0, CountOccurrences(internalLog, "A debug entry")); }
protected internal override QueryExecutionEngine CreateEngine(Dependencies deps, GraphDatabaseAPI graphAPI) { GraphDatabaseCypherService queryService = new GraphDatabaseCypherService(graphAPI); deps.SatisfyDependency(queryService); DependencyResolver resolver = graphAPI.DependencyResolver; LogService logService = resolver.ResolveDependency(typeof(LogService)); Monitors monitors = resolver.ResolveDependency(typeof(Monitors)); Config config = resolver.ResolveDependency(typeof(Config)); CypherConfiguration cypherConfig = CypherConfiguration.fromConfig(config); CypherPlannerConfiguration plannerConfig = cypherConfig.toCypherPlannerConfiguration(config); CypherRuntimeConfiguration runtimeConfig = cypherConfig.toCypherRuntimeConfiguration(); LogProvider logProvider = logService.InternalLogProvider; CommunityCompilerFactory compilerFactory = new CommunityCompilerFactory(queryService, monitors, logProvider, plannerConfig, runtimeConfig); deps.SatisfyDependencies(compilerFactory); return(CreateEngine(queryService, config, logProvider, compilerFactory)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldWriteDebugToInternalDiagnosticsLogForEnabledContexts() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldWriteDebugToInternalDiagnosticsLogForEnabledContexts() { // Given //JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method: GraphDatabaseService db = (new TestGraphDatabaseFactory()).newEmbeddedDatabaseBuilder(TestDir.storeDir()).setConfig(GraphDatabaseSettings.store_internal_debug_contexts, this.GetType().FullName + ",java.io").setConfig(GraphDatabaseSettings.logs_directory, TestDir.directory("logs").AbsolutePath).newGraphDatabase(); // When LogService logService = (( GraphDatabaseAPI )db).DependencyResolver.resolveDependency(typeof(LogService)); logService.GetInternalLog(this.GetType()).debug("A debug entry"); logService.GetInternalLog(typeof(GraphDatabaseService)).debug("A GDS debug entry"); logService.GetInternalLog(typeof(StringWriter)).debug("A SW debug entry"); Db.shutdown(); File internalLog = new File(TestDir.directory("logs"), INTERNAL_LOG_FILE); // Then assertThat(internalLog.File, @is(true)); assertThat(internalLog.length(), greaterThan(0L)); assertEquals(1, CountOccurrences(internalLog, "A debug entry")); assertEquals(0, CountOccurrences(internalLog, "A GDS debug entry")); assertEquals(1, CountOccurrences(internalLog, "A SW debug entry")); }
public override BatchImporter Instantiate(DatabaseLayout directoryStructure, FileSystemAbstraction fileSystem, PageCache externalPageCache, Configuration config, LogService logService, ExecutionMonitor executionMonitor, AdditionalInitialIds additionalInitialIds, Config dbConfig, RecordFormats recordFormats, ImportLogic.Monitor monitor, JobScheduler scheduler) { return(new ParallelBatchImporter(directoryStructure, fileSystem, externalPageCache, config, logService, executionMonitor, additionalInitialIds, dbConfig, recordFormats, monitor, scheduler)); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public abstract void handle(java.io.File databaseDirectory, org.neo4j.io.pagecache.PageCache pageCache, org.neo4j.logging.internal.LogService msgLog) throws java.io.IOException; public abstract void handle(java.io.File databaseDirectory, Org.Neo4j.Io.pagecache.PageCache pageCache, [email protected] msgLog);
internal ErrorReporter(LogService logging) { this._userLog = logging.GetUserLog(typeof(ErrorReporter)); this._debugLog = logging.GetInternalLog(typeof(ErrorReporter)); }
protected internal override BoltRequestMessageReader CreateMessageReader(BoltChannel channel, Neo4jPack neo4jPack, BoltConnection connection, LogService logging) { BoltResponseMessageWriterV1 responseWriter = new BoltResponseMessageWriterV1(neo4jPack, connection.Output(), logging); return(new BoltRequestMessageReaderV3(connection, responseWriter, logging)); }
public BoltProtocolV3(BoltChannel channel, BoltConnectionFactory connectionFactory, BoltStateMachineFactory stateMachineFactory, LogService logging) : base(channel, connectionFactory, stateMachineFactory, logging) { }
//JAVA TO C# CONVERTER NOTE: Members cannot have the same name as their enclosing type: public static BatchingNeoStores BatchingNeoStoresConflict(FileSystemAbstraction fileSystem, File storeDir, RecordFormats recordFormats, Configuration config, LogService logService, AdditionalInitialIds initialIds, Config dbConfig, JobScheduler jobScheduler) { Config neo4jConfig = GetNeo4jConfig(config, dbConfig); //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final org.neo4j.io.pagecache.tracing.PageCacheTracer tracer = new org.neo4j.io.pagecache.tracing.DefaultPageCacheTracer(); PageCacheTracer tracer = new DefaultPageCacheTracer(); PageCache pageCache = CreatePageCache(fileSystem, neo4jConfig, logService.InternalLogProvider, tracer, DefaultPageCursorTracerSupplier.INSTANCE, EmptyVersionContextSupplier.EMPTY, jobScheduler); return(new BatchingNeoStores(fileSystem, pageCache, storeDir, recordFormats, neo4jConfig, config, logService, initialIds, false, tracer.bytesWritten)); }
private BatchingNeoStores(FileSystemAbstraction fileSystem, PageCache pageCache, File databaseDirectory, RecordFormats recordFormats, Config neo4jConfig, Configuration importConfiguration, LogService logService, AdditionalInitialIds initialIds, bool externalPageCache, IoTracer ioTracer) { this._fileSystem = fileSystem; this._recordFormats = recordFormats; this._importConfiguration = importConfiguration; this._initialIds = initialIds; this._logProvider = logService.InternalLogProvider; this._databaseLayout = DatabaseLayout.of(databaseDirectory); this._temporaryDatabaseLayout = DatabaseLayout.of(_databaseLayout.file(TEMP_STORE_NAME), TEMP_STORE_NAME); this._neo4jConfig = neo4jConfig; this._pageCache = pageCache; this._ioTracer = ioTracer; this._externalPageCache = externalPageCache; this._idGeneratorFactory = new DefaultIdGeneratorFactory(fileSystem); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @SuppressWarnings("unchecked") public static org.neo4j.kernel.extension.DatabaseKernelExtensions instantiateKernelExtensions(java.io.File databaseDirectory, org.neo4j.io.fs.FileSystemAbstraction fileSystem, org.neo4j.kernel.configuration.Config config, org.neo4j.logging.internal.LogService logService, org.neo4j.io.pagecache.PageCache pageCache, org.neo4j.scheduler.JobScheduler jobScheduler, org.neo4j.index.internal.gbptree.RecoveryCleanupWorkCollector recoveryCollector, org.neo4j.kernel.impl.factory.DatabaseInfo databaseInfo, org.neo4j.kernel.monitoring.Monitors monitors, org.neo4j.kernel.impl.core.TokenHolders tokenHolders) public static DatabaseKernelExtensions InstantiateKernelExtensions(File databaseDirectory, FileSystemAbstraction fileSystem, Config config, LogService logService, PageCache pageCache, JobScheduler jobScheduler, RecoveryCleanupWorkCollector recoveryCollector, DatabaseInfo databaseInfo, Monitors monitors, TokenHolders tokenHolders) { Dependencies deps = new Dependencies(); deps.SatisfyDependencies(fileSystem, config, logService, pageCache, recoveryCollector, monitors, jobScheduler, tokenHolders); //JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @SuppressWarnings("rawtypes") Iterable kernelExtensions = org.neo4j.helpers.Service.load(org.neo4j.kernel.extension.KernelExtensionFactory.class); System.Collections.IEnumerable kernelExtensions = Service.load(typeof(KernelExtensionFactory)); KernelContext kernelContext = new SimpleKernelContext(databaseDirectory, databaseInfo, deps); return(new DatabaseKernelExtensions(kernelContext, kernelExtensions, deps, KernelExtensionFailureStrategies.ignore())); }
public static BatchingNeoStores BatchingNeoStoresWithExternalPageCache(FileSystemAbstraction fileSystem, PageCache pageCache, PageCacheTracer tracer, File storeDir, RecordFormats recordFormats, Configuration config, LogService logService, AdditionalInitialIds initialIds, Config dbConfig) { Config neo4jConfig = GetNeo4jConfig(config, dbConfig); return(new BatchingNeoStores(fileSystem, pageCache, storeDir, recordFormats, neo4jConfig, config, logService, initialIds, true, tracer.bytesWritten)); }
//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 ConsensusModule(org.neo4j.causalclustering.identity.MemberId myself, final org.neo4j.graphdb.factory.module.PlatformModule platformModule, org.neo4j.causalclustering.messaging.Outbound<org.neo4j.causalclustering.identity.MemberId,RaftMessages_RaftMessage> outbound, java.io.File clusterStateDirectory, org.neo4j.causalclustering.discovery.CoreTopologyService coreTopologyService) public ConsensusModule(MemberId myself, PlatformModule platformModule, Outbound <MemberId, RaftMessages_RaftMessage> outbound, File clusterStateDirectory, CoreTopologyService coreTopologyService) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final org.neo4j.kernel.configuration.Config config = platformModule.config; Config config = platformModule.Config; //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final org.neo4j.logging.internal.LogService logging = platformModule.logging; LogService logging = platformModule.Logging; //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final org.neo4j.io.fs.FileSystemAbstraction fileSystem = platformModule.fileSystem; FileSystemAbstraction fileSystem = platformModule.FileSystem; //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final org.neo4j.kernel.lifecycle.LifeSupport life = platformModule.life; LifeSupport life = platformModule.Life; LogProvider logProvider = logging.InternalLogProvider; //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final org.neo4j.causalclustering.core.state.storage.SafeChannelMarshal<org.neo4j.causalclustering.core.replication.ReplicatedContent> marshal = org.neo4j.causalclustering.messaging.marshalling.CoreReplicatedContentMarshal.marshaller(); SafeChannelMarshal <ReplicatedContent> marshal = CoreReplicatedContentMarshal.marshaller(); RaftLog underlyingLog = CreateRaftLog(config, life, fileSystem, clusterStateDirectory, marshal, logProvider, platformModule.JobScheduler); _raftLog = new MonitoredRaftLog(underlyingLog, platformModule.Monitors); StateStorage <TermState> termState; StateStorage <VoteState> voteState; StateStorage <RaftMembershipState> raftMembershipStorage; StateStorage <TermState> durableTermState = life.Add(new DurableStateStorage <TermState>(fileSystem, clusterStateDirectory, RAFT_TERM_NAME, new TermState.Marshal(), config.Get(CausalClusteringSettings.term_state_size), logProvider)); termState = new MonitoredTermStateStorage(durableTermState, platformModule.Monitors); voteState = life.Add(new DurableStateStorage <>(fileSystem, clusterStateDirectory, RAFT_VOTE_NAME, new VoteState.Marshal(new MemberId.Marshal()), config.Get(CausalClusteringSettings.vote_state_size), logProvider)); raftMembershipStorage = life.Add(new DurableStateStorage <>(fileSystem, clusterStateDirectory, RAFT_MEMBERSHIP_NAME, new RaftMembershipState.Marshal(), config.Get(CausalClusteringSettings.raft_membership_state_size), logProvider)); TimerService timerService = new TimerService(platformModule.JobScheduler, logProvider); _leaderAvailabilityTimers = CreateElectionTiming(config, timerService, logProvider); int?minimumConsensusGroupSize = config.Get(CausalClusteringSettings.minimum_core_cluster_size_at_runtime); MemberIdSetBuilder memberSetBuilder = new MemberIdSetBuilder(); SendToMyself leaderOnlyReplicator = new SendToMyself(myself, outbound); _raftMembershipManager = new RaftMembershipManager(leaderOnlyReplicator, memberSetBuilder, _raftLog, logProvider, minimumConsensusGroupSize.Value, _leaderAvailabilityTimers.ElectionTimeout, systemClock(), config.Get(join_catch_up_timeout).toMillis(), raftMembershipStorage); platformModule.Dependencies.satisfyDependency(_raftMembershipManager); life.Add(_raftMembershipManager); _inFlightCache = InFlightCacheFactory.create(config, platformModule.Monitors); RaftLogShippingManager logShipping = new RaftLogShippingManager(outbound, logProvider, _raftLog, timerService, systemClock(), myself, _raftMembershipManager, _leaderAvailabilityTimers.ElectionTimeout, config.Get(catchup_batch_size), config.Get(log_shipping_max_lag), _inFlightCache); bool supportsPreVoting = config.Get(CausalClusteringSettings.enable_pre_voting); _raftMachine = new RaftMachine(myself, termState, voteState, _raftLog, _leaderAvailabilityTimers, outbound, logProvider, _raftMembershipManager, logShipping, _inFlightCache, config.Get(refuse_to_be_leader), supportsPreVoting, platformModule.Monitors); DurationSinceLastMessageMonitor durationSinceLastMessageMonitor = new DurationSinceLastMessageMonitor(); platformModule.Monitors.addMonitorListener(durationSinceLastMessageMonitor); platformModule.Dependencies.satisfyDependency(durationSinceLastMessageMonitor); string dbName = config.Get(CausalClusteringSettings.database); life.Add(new RaftCoreTopologyConnector(coreTopologyService, _raftMachine, dbName)); life.Add(logShipping); }
protected internal override StatementLocksFactory CreateStatementLocksFactory(Locks locks, Config config, LogService logService) { return((new StatementLocksFactorySelector(locks, config, logService)).select()); }
public DefaultBoltProtocolFactory(BoltConnectionFactory connectionFactory, BoltStateMachineFactory stateMachineFactory, LogService logService) { this._connectionFactory = connectionFactory; this._stateMachineFactory = stateMachineFactory; this._logService = logService; }