コード例 #1
0
 public ExplicitIndexTransactionApplier(ExplicitIndexApplierLookup applierLookup, IndexConfigStore indexConfigStore, TransactionApplicationMode mode, IdOrderingQueue transactionOrdering)
 {
     this._applierLookup       = applierLookup;
     this._indexConfigStore    = indexConfigStore;
     this._mode                = mode;
     this._transactionOrdering = transactionOrdering;
 }
コード例 #2
0
 /// <summary>
 /// Constructs this data source.
 /// </summary>
 public LuceneDataSource(DatabaseLayout directoryStructure, Config config, IndexConfigStore indexStore, FileSystemAbstraction fileSystemAbstraction, OperationalMode operationalMode)
 {
     this._directoryStructure    = directoryStructure;
     this._config                = config;
     this._indexStore            = indexStore;
     this._typeCache             = new IndexTypeCache(indexStore);
     this._fileSystemAbstraction = fileSystemAbstraction;
     this._operationalMode       = operationalMode;
 }
コード例 #3
0
 public LuceneBatchInserterIndexProviderNewImpl(BatchInserter inserter)
 {
     this._inserter           = inserter;
     this.IndexStore          = (( IndexConfigStoreProvider )inserter).IndexStore;
     this._relationshipLookup = id =>
     {
         // TODO too may objects allocated here
         BatchRelationship rel = inserter.GetRelationshipById(id);
         return(new EntityId_RelationshipData(id, rel.StartNode, rel.EndNode));
     };
 }
コード例 #4
0
        private ExplicitIndexTransactionStateImpl NewExplicitIndexTxState()
        {
            _indexConfigStore = mock(typeof(IndexConfigStore));
            when(_indexConfigStore.get(eq(typeof(Node)), anyString())).thenReturn(_config);
            when(_indexConfigStore.get(eq(typeof(Relationship)), anyString())).thenReturn(_config);

            ExplicitIndexProvider explicitIndexProvider = mock(typeof(ExplicitIndexProvider));

            when(explicitIndexProvider.GetProviderByName(anyString())).thenReturn(_provider);

            return(new ExplicitIndexTransactionStateImpl(_indexConfigStore, explicitIndexProvider));
        }
コード例 #5
0
		 private void RemoveProvidersFromIndexDbFile( DatabaseLayout databaseLayout )
		 {
			  IndexConfigStore indexStore = new IndexConfigStore( databaseLayout, FileSystemRule.get() );
			  foreach ( Type cls in new Type[] { typeof( Node ), typeof( Relationship ) } )
			  {
					foreach ( string name in indexStore.GetNames( cls ) )
					{
						 IDictionary<string, string> config = indexStore.Get( cls, name );
						 config = new Dictionary<string, string>( config );
						 config.Remove( Org.Neo4j.Graphdb.index.IndexManager_Fields.PROVIDER );
						 indexStore.Set( typeof( Node ), name, config );
					}
			  }
		 }
コード例 #6
0
        internal ModularDatabaseCreationContext(string databaseName, PlatformModule platformModule, DatabaseEditionContext editionContext, Procedures procedures, GraphDatabaseFacade facade)
        {
            this._databaseName = databaseName;
            this._config       = platformModule.Config;
            DatabaseIdContext idContext = editionContext.IdContext;

            this._idGeneratorFactory = idContext.IdGeneratorFactory;
            this._idController       = idContext.IdController;
            this._databaseLayout     = platformModule.StoreLayout.databaseLayout(databaseName);
            this._logService         = platformModule.Logging;
            this._scheduler          = platformModule.JobScheduler;
            this._globalDependencies = platformModule.Dependencies;
            this._tokenHolders       = editionContext.CreateTokenHolders();
            this._tokenNameLookup    = new NonTransactionalTokenNameLookup(_tokenHolders);
            this._locks = editionContext.CreateLocks();
            this._statementLocksFactory    = editionContext.CreateStatementLocksFactory();
            this._schemaWriteGuard         = editionContext.SchemaWriteGuard;
            this._transactionEventHandlers = new TransactionEventHandlers(facade);
            this._monitors = new Monitors(platformModule.Monitors);
            this._indexingServiceMonitor = _monitors.newMonitor(typeof(IndexingService.Monitor));
            this._physicalLogMonitor     = _monitors.newMonitor(typeof(LogFileCreationMonitor));
            this._fs = platformModule.FileSystem;
            this._transactionStats = editionContext.CreateTransactionMonitor();
            this._databaseHealth   = new DatabaseHealth(platformModule.PanicEventGenerator, _logService.getInternalLog(typeof(DatabaseHealth)));
            this._transactionHeaderInformationFactory = editionContext.HeaderInformationFactory;
            this._commitProcessFactory  = editionContext.CommitProcessFactory;
            this._autoIndexing          = new InternalAutoIndexing(platformModule.Config, _tokenHolders.propertyKeyTokens());
            this._indexConfigStore      = new IndexConfigStore(_databaseLayout, _fs);
            this._explicitIndexProvider = new DefaultExplicitIndexProvider();
            this._pageCache             = platformModule.PageCache;
            this._constraintSemantics   = editionContext.ConstraintSemantics;
            this._tracers    = platformModule.Tracers;
            this._procedures = procedures;
            this._ioLimiter  = editionContext.IoLimiter;
            this._clock      = platformModule.Clock;
            this._databaseAvailabilityGuard    = editionContext.CreateDatabaseAvailabilityGuard(_clock, _logService, _config);
            this._databaseAvailability         = new DatabaseAvailability(_databaseAvailabilityGuard, _transactionStats, platformModule.Clock, AwaitActiveTransactionDeadlineMillis);
            this._coreAPIAvailabilityGuard     = new CoreAPIAvailabilityGuard(_databaseAvailabilityGuard, editionContext.TransactionStartTimeout);
            this._accessCapability             = editionContext.AccessCapability;
            this._storeCopyCheckPointMutex     = new StoreCopyCheckPointMutex();
            this._recoveryCleanupWorkCollector = platformModule.RecoveryCleanupWorkCollector;
            this._databaseInfo               = platformModule.DatabaseInfo;
            this._versionContextSupplier     = platformModule.VersionContextSupplier;
            this._collectionsFactorySupplier = platformModule.CollectionsFactorySupplier;
            this._kernelExtensionFactories   = platformModule.KernelExtensionFactories;
            this._watcherServiceFactory      = editionContext.WatcherServiceFactory;
            this._facade          = facade;
            this._engineProviders = platformModule.EngineProviders;
        }
コード例 #7
0
        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;
            }
        }
コード例 #8
0
//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()
        {
            _indexStore = new IndexConfigStore(_directory.databaseLayout(), _fileSystemRule.get());
            AddIndex("foo");
        }
コード例 #9
0
 internal IndexTypeCache(IndexConfigStore indexStore)
 {
     this._indexStore = indexStore;
 }
コード例 #10
0
 public ExplicitIndexTransactionStateImpl(IndexConfigStore indexConfigStore, ExplicitIndexProvider explicitIndexProvider)
 {
     this._indexConfigStore = indexConfigStore;
     this._providerLookup   = explicitIndexProvider;
 }