public SpatialIndexProvider(PageCache pageCache, FileSystemAbstraction fs, IndexDirectoryStructure.Factory directoryStructure, Monitor monitor, RecoveryCleanupWorkCollector recoveryCleanupWorkCollector, bool readOnly, Config config) : base(_spatialProviderDescriptor, directoryStructure) { this._pageCache = pageCache; this._fs = fs; this._monitor = monitor; this._recoveryCleanupWorkCollector = recoveryCleanupWorkCollector; this._readOnly = readOnly; this._configuration = SpaceFillingCurveSettingsFactory.getConfiguredSpaceFillingCurveConfiguration(config); this._configuredSettings = GetConfiguredSpaceFillingCurveSettings(config); }
private GenericBlockBasedIndexPopulator InstantiatePopulator(StoreIndexDescriptor indexDescriptor) { Config config = Config.defaults(); ConfiguredSpaceFillingCurveSettingsCache settingsCache = new ConfiguredSpaceFillingCurveSettingsCache(config); IndexSpecificSpaceFillingCurveSettingsCache spatialSettings = new IndexSpecificSpaceFillingCurveSettingsCache(settingsCache, new Dictionary <Org.Neo4j.Values.Storable.CoordinateReferenceSystem, SpaceFillingCurveSettings>()); GenericLayout layout = new GenericLayout(1, spatialSettings); SpaceFillingCurveConfiguration configuration = SpaceFillingCurveSettingsFactory.getConfiguredSpaceFillingCurveConfiguration(config); GenericBlockBasedIndexPopulator populator = new GenericBlockBasedIndexPopulator(Storage.pageCache(), _fs, _indexFile, layout, EMPTY, indexDescriptor, spatialSettings, _directoryStructure, configuration, _dropAction, false, heapBufferFactory(1024)); populator.Create(); return(populator); }
private void VerifySpatialSettings(File indexFile, SpaceFillingCurveSettings expectedSettings) { try { SpaceFillingCurveSettings settings = SpaceFillingCurveSettingsFactory.fromGBPTree(indexFile, _pageCache, NativeIndexHeaderReader.readFailureMessage); assertThat("Should get correct results from header", settings, equalTo(expectedSettings)); } catch (IOException e) { fail("Failed to read GBPTree header: " + e.Message); } }
private static LayoutBootstrapper SpatialLayoutFactory(CoordinateReferenceSystem crs) { return((indexFile, pageCache, meta, targetLayout) => { if (targetLayout.Equals(crs.Name)) { MutableBoolean failure = new MutableBoolean(false); Function <ByteBuffer, string> onError = byteBuffer => { failure.setTrue(); return ""; }; SpaceFillingCurveSettings curveSettings = SpaceFillingCurveSettingsFactory.fromGBPTree(indexFile, pageCache, onError); if (!failure.Value) { return new SpatialLayout(crs, curveSettings.curve()); } } return null; }); }
/// <summary> /// If we are loading a layout for an existing index, read the settings from the index header, and ignore config settings /// </summary> //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: SpatialFileLayout getLayoutForExistingIndex(org.neo4j.io.pagecache.PageCache pageCache) throws java.io.IOException internal virtual SpatialFileLayout GetLayoutForExistingIndex(PageCache pageCache) { SpaceFillingCurveSettings settings = SpaceFillingCurveSettingsFactory.fromGBPTree(IndexFile, pageCache, NativeIndexHeaderReader.readFailureMessage); return(new SpatialFileLayout(this, settings)); }