//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Before public void setUp() public virtual void SetUp() { FileSystemAbstraction fs = _fsRule.get(); _pageCache = _pageCacheRule.getPageCache(fs); _idGeneratorFactory = new DefaultIdGeneratorFactory(fs); }
private DatabaseIdContext CreateBufferingIdContext <T1>(System.Func <T1> idGeneratorFactoryProvider, JobScheduler jobScheduler, string databaseName) where T1 : Org.Neo4j.Kernel.impl.store.id.IdGeneratorFactory { IdGeneratorFactory idGeneratorFactory = idGeneratorFactoryProvider(databaseName); BufferingIdGeneratorFactory bufferingIdGeneratorFactory = new BufferingIdGeneratorFactory(idGeneratorFactory, _eligibleForIdReuse, _idTypeConfigurationProvider); BufferedIdController bufferingController = CreateBufferedIdController(bufferingIdGeneratorFactory, jobScheduler); return(CreateIdContext(bufferingIdGeneratorFactory, bufferingController)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void createBufferedIdComponentsByDefault() public virtual void CreateBufferedIdComponentsByDefault() { ClusterManager.ManagedCluster managedCluster = ClusterRule.startCluster(); DependencyResolver dependencyResolver = managedCluster.Master.DependencyResolver; IdController idController = dependencyResolver.ResolveDependency(typeof(IdController)); IdGeneratorFactory idGeneratorFactory = dependencyResolver.ResolveDependency(typeof(IdGeneratorFactory)); assertThat(idController, instanceOf(typeof(BufferedIdController))); assertThat(idGeneratorFactory, instanceOf(typeof(BufferingIdGeneratorFactory))); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void createBufferedIdComponentsByDefault() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void CreateBufferedIdComponentsByDefault() { Cluster cluster = ClusterRule.startCluster(); CoreClusterMember leader = cluster.awaitLeader(); DependencyResolver dependencyResolver = leader.Database().DependencyResolver; IdController idController = dependencyResolver.ResolveDependency(typeof(IdController)); IdGeneratorFactory idGeneratorFactory = dependencyResolver.ResolveDependency(typeof(IdGeneratorFactory)); assertThat(idController, instanceOf(typeof(BufferedIdController))); assertThat(idGeneratorFactory, instanceOf(typeof(FreeIdFilteredIdGeneratorFactory))); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void createContextWithFactoryWrapper() internal virtual void CreateContextWithFactoryWrapper() { System.Func <IdGeneratorFactory, IdGeneratorFactory> factoryWrapper = mock(typeof(System.Func)); IdGeneratorFactory idGeneratorFactory = mock(typeof(IdGeneratorFactory)); when(factoryWrapper(any())).thenReturn(idGeneratorFactory); IdContextFactory contextFactory = IdContextFactoryBuilder.Of(_fs, _jobScheduler).withFactoryWrapper(factoryWrapper).build(); DatabaseIdContext idContext = contextFactory.CreateIdContext("database"); assertSame(idGeneratorFactory, idContext.IdGeneratorFactory); }
public StoreFactory(DatabaseLayout databaseLayout, Config config, IdGeneratorFactory idGeneratorFactory, PageCache pageCache, FileSystemAbstraction fileSystemAbstraction, RecordFormats recordFormats, LogProvider logProvider, VersionContextSupplier versionContextSupplier, params OpenOption[] openOptions) { this._databaseLayout = databaseLayout; this._config = config; this._idGeneratorFactory = idGeneratorFactory; this._fileSystemAbstraction = fileSystemAbstraction; this._versionContextSupplier = versionContextSupplier; this._recordFormats = recordFormats; this._openOptions = openOptions; (new RecordFormatPropertyConfigurator(recordFormats, config)).configure(); this._logProvider = logProvider; this._pageCache = pageCache; }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void createBufferedIdComponentsByDefault() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void CreateBufferedIdComponentsByDefault() { //JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET: //ORIGINAL LINE: org.neo4j.causalclustering.discovery.Cluster<?> cluster = clusterRule.startCluster(); Cluster <object> cluster = ClusterRule.startCluster(); CoreClusterMember leader = cluster.AwaitLeader(); DependencyResolver dependencyResolver = leader.Database().DependencyResolver; IdController idController = dependencyResolver.ResolveDependency(typeof(IdController)); IdGeneratorFactory idGeneratorFactory = dependencyResolver.ResolveDependency(typeof(IdGeneratorFactory)); assertThat(idController, instanceOf(typeof(BufferedIdController))); assertThat(idGeneratorFactory, instanceOf(typeof(FreeIdFilteredIdGeneratorFactory))); }
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); }
public DefaultMasterImplSPI(GraphDatabaseAPI graphDb, FileSystemAbstraction fileSystemAbstraction, Monitors monitors, TokenHolders tokenHolders, IdGeneratorFactory idGeneratorFactory, TransactionCommitProcess transactionCommitProcess, CheckPointer checkPointer, TransactionIdStore transactionIdStore, LogicalTransactionStore logicalTransactionStore, NeoStoreDataSource neoStoreDataSource, LogProvider logProvider) { this._graphDb = graphDb; this._fileSystem = fileSystemAbstraction; this._tokenHolders = tokenHolders; this._idGeneratorFactory = idGeneratorFactory; this._transactionCommitProcess = transactionCommitProcess; this._checkPointer = checkPointer; this._neoStoreDataSource = neoStoreDataSource; this._databaseDirectory = graphDb.DatabaseLayout().databaseDirectory(); this._txChecksumLookup = new TransactionChecksumLookup(transactionIdStore, logicalTransactionStore); this._responsePacker = new ResponsePacker(logicalTransactionStore, transactionIdStore, graphDb.storeId); this._monitors = monitors; //JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method: monitors.AddMonitorListener(new LoggingStoreCopyServerMonitor(logProvider.GetLog(typeof(StoreCopyServer))), typeof(StoreCopyServer).FullName); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void createBufferedIdComponentsByDefault() internal virtual void CreateBufferedIdComponentsByDefault() { GraphDatabaseAPI database = ( GraphDatabaseAPI )(new GraphDatabaseFactory()).newEmbeddedDatabase(_testDirectory.storeDir()); try { DependencyResolver dependencyResolver = database.DependencyResolver; IdController idController = dependencyResolver.ResolveDependency(typeof(IdController)); IdGeneratorFactory idGeneratorFactory = dependencyResolver.ResolveDependency(typeof(IdGeneratorFactory)); assertThat(idController, instanceOf(typeof(BufferedIdController))); assertThat(idGeneratorFactory, instanceOf(typeof(BufferingIdGeneratorFactory))); } finally { database.Shutdown(); } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void createCommunityBufferedContextByDefault() internal virtual void CreateCommunityBufferedContextByDefault() { IdContextFactory idContextFactory = IdContextFactoryBuilder.Of(_fs, _jobScheduler).build(); DatabaseIdContext idContext = idContextFactory.CreateIdContext("database"); IdGeneratorFactory idGeneratorFactory = idContext.IdGeneratorFactory; assertThat(idContext.IdController, instanceOf(typeof(BufferedIdController))); assertThat(idGeneratorFactory, instanceOf(typeof(BufferingIdGeneratorFactory))); (( BufferingIdGeneratorFactory )idGeneratorFactory).initialize(() => mock(typeof(KernelTransactionsSnapshot))); idGeneratorFactory.Open(_testDirectory.file("a"), IdType.NODE, () => 0, 100).Dispose(); idGeneratorFactory.Open(_testDirectory.file("b"), IdType.PROPERTY, () => 0, 100).Dispose(); BufferingIdGeneratorFactory bufferedFactory = ( BufferingIdGeneratorFactory )idGeneratorFactory; assertThat(bufferedFactory.Get(IdType.NODE), instanceOf(typeof(IdGeneratorImpl))); assertThat(bufferedFactory.Get(IdType.PROPERTY), not(instanceOf(typeof(IdGeneratorImpl)))); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void createContextWithCustomIdGeneratorFactoryWhenProvided() internal virtual void CreateContextWithCustomIdGeneratorFactoryWhenProvided() { IdGeneratorFactory idGeneratorFactory = mock(typeof(IdGeneratorFactory)); IdContextFactory contextFactory = IdContextFactoryBuilder.Of(_fs, _jobScheduler).withIdGenerationFactoryProvider(any => idGeneratorFactory).build(); DatabaseIdContext idContext = contextFactory.CreateIdContext("database"); IdGeneratorFactory bufferedGeneratorFactory = idContext.IdGeneratorFactory; assertThat(idContext.IdController, instanceOf(typeof(BufferedIdController))); assertThat(bufferedGeneratorFactory, instanceOf(typeof(BufferingIdGeneratorFactory))); (( BufferingIdGeneratorFactory )bufferedGeneratorFactory).initialize(() => mock(typeof(KernelTransactionsSnapshot))); File file = _testDirectory.file("a"); IdType idType = IdType.NODE; System.Func <long> highIdSupplier = () => 0; int maxId = 100; idGeneratorFactory.Open(file, idType, highIdSupplier, maxId); verify(idGeneratorFactory).open(file, idType, highIdSupplier, maxId); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void createContextWithProvidedReusabilityCheck() internal virtual void CreateContextWithProvidedReusabilityCheck() { IdReuseEligibility reuseEligibility = mock(typeof(IdReuseEligibility)); IdContextFactory contextFactory = IdContextFactoryBuilder.Of(_fs, _jobScheduler).withIdReuseEligibility(reuseEligibility).build(); DatabaseIdContext idContext = contextFactory.CreateIdContext("database"); IdGeneratorFactory bufferedGeneratorFactory = idContext.IdGeneratorFactory; assertThat(bufferedGeneratorFactory, instanceOf(typeof(BufferingIdGeneratorFactory))); BufferingIdGeneratorFactory bufferedFactory = ( BufferingIdGeneratorFactory )bufferedGeneratorFactory; KernelTransactionsSnapshot snapshot = mock(typeof(KernelTransactionsSnapshot)); when(snapshot.AllClosed()).thenReturn(true); bufferedFactory.Initialize(() => snapshot); using (IdGenerator idGenerator = bufferedFactory.Open(_testDirectory.file("a"), IdType.PROPERTY, () => 100, 100)) { idGenerator.FreeId(15); bufferedFactory.Maintenance(); verify(reuseEligibility).isEligible(snapshot); } }
internal DatabaseIdContext(IdGeneratorFactory idGeneratorFactory, IdController idController) { this._idGeneratorFactory = idGeneratorFactory; this._idController = idController; }
public ReplicatedRelationshipTypeTokenHolder(TokenRegistry registry, RaftReplicator replicator, IdGeneratorFactory idGeneratorFactory, System.Func <StorageEngine> storageEngineSupplier) : base(registry, replicator, idGeneratorFactory, RELATIONSHIP_TYPE_TOKEN, storageEngineSupplier, RELATIONSHIP, TransactionState.relationshipTypeDoCreateForName) { }
internal ExtendedRecordStorageEngine(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 explicitIndexProviderLookup, IndexConfigStore indexConfigStore, IdOrderingQueue explicitIndexTransactionOrdering, IdGeneratorFactory idGeneratorFactory, IdController idController, System.Func <BatchTransactionApplierFacade, BatchTransactionApplierFacade> transactionApplierTransformer, Monitors monitors, RecoveryCleanupWorkCollector recoveryCleanupWorkCollector, OperationalMode operationalMode) : base(databaseLayout, config, pageCache, fs, logProvider, userLogProvider, tokenHolders, schemaState, constraintSemantics, scheduler, tokenNameLookup, lockService, indexProviderMap, indexingServiceMonitor, databaseHealth, explicitIndexProviderLookup, indexConfigStore, explicitIndexTransactionOrdering, idGeneratorFactory, idController, monitors, recoveryCleanupWorkCollector, operationalMode, EmptyVersionContextSupplier.EMPTY) { this.TransactionApplierTransformer = transactionApplierTransformer; }
public ReplicatedLabelTokenHolder(TokenRegistry registry, Replicator replicator, IdGeneratorFactory idGeneratorFactory, System.Func <StorageEngine> storageEngineSupplier) : base(registry, replicator, idGeneratorFactory, IdType.LABEL_TOKEN, storageEngineSupplier, TokenType.Label, TransactionState.labelDoCreateForName) { }
public StoreFactory(DatabaseLayout directoryStructure, Config config, IdGeneratorFactory idGeneratorFactory, PageCache pageCache, FileSystemAbstraction fileSystemAbstraction, LogProvider logProvider, VersionContextSupplier versionContextSupplier) : this(directoryStructure, config, idGeneratorFactory, pageCache, fileSystemAbstraction, selectForStoreOrConfig(config, directoryStructure, fileSystemAbstraction, pageCache, logProvider), logProvider, versionContextSupplier) { }
public IdBasedStoreEntityCounters(IdGeneratorFactory idGeneratorFactory) { this._idGeneratorFactory = idGeneratorFactory; }
private DatabaseIdContext CreateIdContext(IdGeneratorFactory idGeneratorFactory, IdController idController) { return(new DatabaseIdContext(_factoryWrapper.apply(idGeneratorFactory), idController)); }
public ReplicatedPropertyKeyTokenHolder(TokenRegistry registry, RaftReplicator replicator, IdGeneratorFactory idGeneratorFactory, System.Func <StorageEngine> storageEngineSupplier) : base(registry, replicator, idGeneratorFactory, IdType.PROPERTY_KEY_TOKEN, storageEngineSupplier, TokenType.Property, TransactionState.propertyKeyDoCreateForName) { }