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); }
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; }
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)); }
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; }
//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"); }
//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)); }
internal TemporalIndexPopulator(StoreIndexDescriptor descriptor, IndexSamplingConfig samplingConfig, TemporalIndexFiles temporalIndexFiles, PageCache pageCache, FileSystemAbstraction fs, IndexProvider.Monitor monitor) : base(new PartFactory(pageCache, fs, temporalIndexFiles, descriptor, samplingConfig, monitor)) { }
//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); }