public override InternalIndexState GetInitialState(StoreIndexDescriptor descriptor) { SpatialIndexFiles spatialIndexFiles = new SpatialIndexFiles(DirectoryStructure(), descriptor.Id, _fs, _configuredSettings); //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final Iterable<SpatialIndexFiles.SpatialFile> existing = spatialIndexFiles.existing(); IEnumerable <SpatialIndexFiles.SpatialFile> existing = spatialIndexFiles.Existing(); InternalIndexState state = InternalIndexState.ONLINE; foreach (SpatialIndexFiles.SpatialFile 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, SpatialIndexFiles spatialIndexFiles, StoreIndexDescriptor descriptor, IndexProvider.Monitor monitor, SpaceFillingCurveConfiguration configuration) { this.PageCache = pageCache; this.Fs = fs; this.SpatialIndexFiles = spatialIndexFiles; this.Descriptor = descriptor; this.Monitor = monitor; this.Configuration = configuration; }
public override IndexPopulator GetPopulator(StoreIndexDescriptor descriptor, IndexSamplingConfig samplingConfig, ByteBufferFactory bufferFactory) { if (_readOnly) { throw new System.NotSupportedException("Can't create populator for read only index"); } SpatialIndexFiles files = new SpatialIndexFiles(DirectoryStructure(), descriptor.Id, _fs, _configuredSettings); return(new SpatialIndexPopulator(descriptor, files, _pageCache, _fs, _monitor, _configuration)); }
internal PartFactory(PageCache pageCache, FileSystemAbstraction fs, RecoveryCleanupWorkCollector recoveryCleanupWorkCollector, IndexProvider.Monitor monitor, StoreIndexDescriptor descriptor, SpatialIndexFiles spatialIndexFiles, SpaceFillingCurveConfiguration searchConfiguration, bool readOnly) { this.PageCache = pageCache; this.Fs = fs; this.RecoveryCleanupWorkCollector = recoveryCleanupWorkCollector; this.Monitor = monitor; this.Descriptor = descriptor; this.SpatialIndexFiles = spatialIndexFiles; this.SearchConfiguration = searchConfiguration; 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) { SpatialIndexFiles spatialIndexFiles = new SpatialIndexFiles(DirectoryStructure(), descriptor.Id, _fs, _configuredSettings); try { foreach (SpatialIndexFiles.SpatialFile subIndex in spatialIndexFiles.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: SpatialIndexAccessor(org.neo4j.storageengine.api.schema.StoreIndexDescriptor descriptor, 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, SpatialIndexFiles spatialIndexFiles, org.neo4j.gis.spatial.index.curves.SpaceFillingCurveConfiguration searchConfiguration, boolean readOnly) throws java.io.IOException internal SpatialIndexAccessor(StoreIndexDescriptor descriptor, PageCache pageCache, FileSystemAbstraction fs, RecoveryCleanupWorkCollector recoveryCleanupWorkCollector, IndexProvider.Monitor monitor, SpatialIndexFiles spatialIndexFiles, SpaceFillingCurveConfiguration searchConfiguration, bool readOnly) : base(new PartFactory(pageCache, fs, recoveryCleanupWorkCollector, monitor, descriptor, spatialIndexFiles, searchConfiguration, readOnly)) { this._descriptor = descriptor; spatialIndexFiles.LoadExistingIndexes(this); }
//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) { SpatialIndexFiles files = new SpatialIndexFiles(DirectoryStructure(), descriptor.Id, _fs, _configuredSettings); return(new SpatialIndexAccessor(descriptor, _pageCache, _fs, _recoveryCleanupWorkCollector, _monitor, files, _configuration, _readOnly)); }
internal SpatialIndexPopulator(StoreIndexDescriptor descriptor, SpatialIndexFiles spatialIndexFiles, PageCache pageCache, FileSystemAbstraction fs, IndexProvider.Monitor monitor, SpaceFillingCurveConfiguration configuration) : base(new PartFactory(pageCache, fs, spatialIndexFiles, descriptor, monitor, configuration)) { }