Пример #1
0
 public NeoStoreTransactionApplier(CommandVersion version, NeoStores neoStores, CacheAccessBackDoor cacheAccess, LockService lockService, long transactionId, LockGroup lockGroup)
 {
     this._version       = version;
     this._lockGroup     = lockGroup;
     this._transactionId = transactionId;
     this._lockService   = lockService;
     this._neoStores     = neoStores;
     this._cacheAccess   = cacheAccess;
 }
Пример #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private void applyExternalTransaction(long transactionId, org.neo4j.kernel.impl.transaction.command.Command...commands) throws Exception
        private void ApplyExternalTransaction(long transactionId, params Command[] commands)
        {
            LockService lockService = mock(typeof(LockService));

            when(lockService.AcquireNodeLock(anyLong(), any(typeof(Org.Neo4j.Kernel.impl.locking.LockService_LockType)))).thenReturn(LockService.NO_LOCK);
            when(lockService.AcquireRelationshipLock(anyLong(), any(typeof(Org.Neo4j.Kernel.impl.locking.LockService_LockType)))).thenReturn(LockService.NO_LOCK);
            NeoStoreBatchTransactionApplier applier = new NeoStoreBatchTransactionApplier(_neoStores, mock(typeof(CacheAccessBackDoor)), lockService);
            TransactionRepresentation       tx      = new PhysicalTransactionRepresentation(Arrays.asList(commands));

            CommandHandlerContract.apply(applier, txApplier =>
            {
                tx.Accept(txApplier);
                return(false);
            }, new TransactionToApply(tx, transactionId));
        }
Пример #3
0
 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;
 }
Пример #4
0
 public virtual Builder LockService(LockService lockService)
 {
     this.LockServiceConflict = lockService;
     return(this);
 }
Пример #5
0
        private RecordStorageEngine Get(FileSystemAbstraction fs, PageCache pageCache, IndexProvider indexProvider, DatabaseHealth databaseHealth, DatabaseLayout databaseLayout, System.Func <BatchTransactionApplierFacade, BatchTransactionApplierFacade> transactionApplierTransformer, Monitors monitors, LockService lockService)
        {
            IdGeneratorFactory    idGeneratorFactory          = new EphemeralIdGenerator.Factory();
            ExplicitIndexProvider explicitIndexProviderLookup = mock(typeof(ExplicitIndexProvider));

            when(explicitIndexProviderLookup.AllIndexProviders()).thenReturn(Iterables.empty());
            IndexConfigStore indexConfigStore = new IndexConfigStore(databaseLayout, fs);
            JobScheduler     scheduler        = _life.add(createScheduler());
            Config           config           = Config.defaults(GraphDatabaseSettings.default_schema_provider, indexProvider.ProviderDescriptor.name());

            Dependencies dependencies = new Dependencies();

            dependencies.SatisfyDependency(indexProvider);

            BufferingIdGeneratorFactory bufferingIdGeneratorFactory = new BufferingIdGeneratorFactory(idGeneratorFactory, Org.Neo4j.Kernel.impl.store.id.IdReuseEligibility_Fields.Always, new CommunityIdTypeConfigurationProvider());
            DefaultIndexProviderMap     indexProviderMap            = new DefaultIndexProviderMap(dependencies, config);
            NullLogProvider             nullLogProvider             = NullLogProvider.Instance;

            _life.add(indexProviderMap);
            return(_life.add(new ExtendedRecordStorageEngine(databaseLayout, config, pageCache, fs, nullLogProvider, nullLogProvider, mockedTokenHolders(), mock(typeof(SchemaState)), new StandardConstraintSemantics(), scheduler, mock(typeof(TokenNameLookup)), lockService, indexProviderMap, IndexingService.NO_MONITOR, databaseHealth, explicitIndexProviderLookup, indexConfigStore, new SynchronizedArrayIdOrderingQueue(), idGeneratorFactory, new BufferedIdController(bufferingIdGeneratorFactory, scheduler), transactionApplierTransformer, monitors, RecoveryCleanupWorkCollector.immediate(), OperationalMode.single)));
        }