예제 #1
0
        public override InternalIndexState GetInitialState(StoreIndexDescriptor descriptor)
        {
            TemporalIndexFiles temporalIndexFiles = new TemporalIndexFiles(DirectoryStructure(), descriptor, _fs);

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final Iterable<TemporalIndexFiles.FileLayout> existing = temporalIndexFiles.existing();
            IEnumerable <TemporalIndexFiles.FileLayout> existing = temporalIndexFiles.Existing();
            InternalIndexState state = InternalIndexState.ONLINE;

            foreach (TemporalIndexFiles.FileLayout subIndex in existing)
            {
                try
                {
                    switch (NativeIndexes.ReadState(_pageCache, subIndex.indexFile))
                    {
                    case FAILED:
                        return(InternalIndexState.FAILED);

                    case POPULATING:
                        state = InternalIndexState.POPULATING;
                        goto default;

                    default:                              // continue
                        break;
                    }
                }
                catch (Exception e) when(e is MetadataMismatchException || e is IOException)
                {
                    _monitor.failedToOpenIndex(descriptor, "Requesting re-population.", e);
                    return(InternalIndexState.POPULATING);
                }
            }
            return(state);
        }
예제 #2
0
 internal PartFactory(PageCache pageCache, FileSystemAbstraction fs, TemporalIndexFiles temporalIndexFiles, StoreIndexDescriptor descriptor, IndexSamplingConfig samplingConfig, IndexProvider.Monitor monitor)
 {
     this.PageCache          = pageCache;
     this.Fs                 = fs;
     this.TemporalIndexFiles = temporalIndexFiles;
     this.Descriptor         = descriptor;
     this.SamplingConfig     = samplingConfig;
     this.Monitor            = monitor;
 }
예제 #3
0
        public override IndexPopulator GetPopulator(StoreIndexDescriptor descriptor, IndexSamplingConfig samplingConfig, ByteBufferFactory bufferFactory)
        {
            if (_readOnly)
            {
                throw new System.NotSupportedException("Can't create populator for read only index");
            }
            TemporalIndexFiles files = new TemporalIndexFiles(DirectoryStructure(), descriptor, _fs);

            return(new TemporalIndexPopulator(descriptor, samplingConfig, files, _pageCache, _fs, _monitor));
        }
예제 #4
0
 internal PartFactory(PageCache pageCache, FileSystemAbstraction fs, RecoveryCleanupWorkCollector recoveryCleanupWorkCollector, IndexProvider.Monitor monitor, StoreIndexDescriptor descriptor, IndexSamplingConfig samplingConfig, TemporalIndexFiles temporalIndexFiles, bool readOnly)
 {
     this.PageCache = pageCache;
     this.Fs        = fs;
     this.RecoveryCleanupWorkCollector = recoveryCleanupWorkCollector;
     this.Monitor            = monitor;
     this.Descriptor         = descriptor;
     this.SamplingConfig     = samplingConfig;
     this.TemporalIndexFiles = temporalIndexFiles;
     this.ReadOnly           = readOnly;
 }
예제 #5
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public String getPopulationFailure(org.neo4j.storageengine.api.schema.StoreIndexDescriptor descriptor) throws IllegalStateException
        public override string GetPopulationFailure(StoreIndexDescriptor descriptor)
        {
            TemporalIndexFiles temporalIndexFiles = new TemporalIndexFiles(DirectoryStructure(), descriptor, _fs);

            try
            {
                foreach (TemporalIndexFiles.FileLayout subIndex in temporalIndexFiles.Existing())
                {
                    string indexFailure = NativeIndexes.ReadFailureMessage(_pageCache, subIndex.indexFile);
                    if (!string.ReferenceEquals(indexFailure, null))
                    {
                        return(indexFailure);
                    }
                }
            }
            catch (IOException e)
            {
                throw new Exception(e);
            }
            throw new System.InvalidOperationException("Index " + descriptor.Id + " isn't failed");
        }
예제 #6
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public org.neo4j.kernel.api.index.IndexAccessor getOnlineAccessor(org.neo4j.storageengine.api.schema.StoreIndexDescriptor descriptor, org.neo4j.kernel.impl.api.index.sampling.IndexSamplingConfig samplingConfig) throws java.io.IOException
        public override IndexAccessor GetOnlineAccessor(StoreIndexDescriptor descriptor, IndexSamplingConfig samplingConfig)
        {
            TemporalIndexFiles files = new TemporalIndexFiles(DirectoryStructure(), descriptor, _fs);

            return(new TemporalIndexAccessor(descriptor, samplingConfig, _pageCache, _fs, _recoveryCleanupWorkCollector, _monitor, files, _readOnly));
        }
예제 #7
0
 internal TemporalIndexPopulator(StoreIndexDescriptor descriptor, IndexSamplingConfig samplingConfig, TemporalIndexFiles temporalIndexFiles, PageCache pageCache, FileSystemAbstraction fs, IndexProvider.Monitor monitor) : base(new PartFactory(pageCache, fs, temporalIndexFiles, descriptor, samplingConfig, monitor))
 {
 }
예제 #8
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: TemporalIndexAccessor(org.neo4j.storageengine.api.schema.StoreIndexDescriptor descriptor, org.neo4j.kernel.impl.api.index.sampling.IndexSamplingConfig samplingConfig, org.neo4j.io.pagecache.PageCache pageCache, org.neo4j.io.fs.FileSystemAbstraction fs, org.neo4j.index.internal.gbptree.RecoveryCleanupWorkCollector recoveryCleanupWorkCollector, org.neo4j.kernel.api.index.IndexProvider.Monitor monitor, TemporalIndexFiles temporalIndexFiles, boolean readOnly) throws java.io.IOException
        internal TemporalIndexAccessor(StoreIndexDescriptor descriptor, IndexSamplingConfig samplingConfig, PageCache pageCache, FileSystemAbstraction fs, RecoveryCleanupWorkCollector recoveryCleanupWorkCollector, IndexProvider.Monitor monitor, TemporalIndexFiles temporalIndexFiles, bool readOnly) : base(new PartFactory(pageCache, fs, recoveryCleanupWorkCollector, monitor, descriptor, samplingConfig, temporalIndexFiles, readOnly))
        {
            this._descriptor = descriptor;

            temporalIndexFiles.LoadExistingIndexes(this);
        }