示例#1
0
        public override IndexCapability GetCapability(StoreIndexDescriptor descriptor)
        {
            FulltextIndexDescriptor fulltextIndexDescriptor;

            if (descriptor is FulltextIndexDescriptor)
            {
                // We got our own index descriptor type, so we can ask it directly.
                fulltextIndexDescriptor = ( FulltextIndexDescriptor )descriptor;
                return(new FulltextIndexCapability(fulltextIndexDescriptor.EventuallyConsistent));
            }
            SchemaDescriptor schema = descriptor.Schema();

            if (schema is FulltextSchemaDescriptor)
            {
                // The fulltext schema descriptor is readily available with our settings.
                // This could be the situation where the index creation is about to be committed.
                // In that case, the schema descriptor is our own legit type, but the StoreIndexDescriptor is generic.
                FulltextSchemaDescriptor fulltextSchemaDescriptor = ( FulltextSchemaDescriptor )schema;
                return(new FulltextIndexCapability(fulltextSchemaDescriptor.EventuallyConsistent));
            }
            // The schema descriptor is probably a generic multi-token descriptor.
            // This happens if it was loaded from the schema store instead of created by our provider.
            // This would be the case when the IndexingService is starting up, and if so, we probably have an online accessor that we can ask instead.
            FulltextIndexAccessor accessor = GetOpenOnlineAccessor(descriptor);

            if (accessor != null)
            {
                fulltextIndexDescriptor = accessor.Descriptor;
                return(new FulltextIndexCapability(fulltextIndexDescriptor.EventuallyConsistent));
            }
            // All of the above has failed, so we need to load the settings in from the storage directory of the index.
            // This situation happens during recovery.
            PartitionedIndexStorage indexStorage = GetIndexStorage(descriptor.Id);

            fulltextIndexDescriptor = readOrInitialiseDescriptor(descriptor, _defaultAnalyzerName, _tokenHolders.propertyKeyTokens(), indexStorage.IndexFolder, _fileSystem);
            return(new FulltextIndexCapability(fulltextIndexDescriptor.EventuallyConsistent));
        }
示例#2
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;
        }
示例#3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public int propertyKeyGetOrCreateForName(String propertyKeyName) throws org.neo4j.internal.kernel.api.exceptions.schema.IllegalTokenNameException
        public override int PropertyKeyGetOrCreateForName(string propertyKeyName)
        {
            return(GetOrCreateForName(_tokenHolders.propertyKeyTokens(), propertyKeyName));
        }
示例#4
0
 public override int PropertyKeyCount()
 {
     return(_tokenHolders.propertyKeyTokens().size());
 }