Ejemplo n.º 1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: static String readFailureMessage(org.neo4j.io.pagecache.PageCache pageCache, java.io.File indexFile) throws java.io.IOException
        internal static string ReadFailureMessage(PageCache pageCache, File indexFile)
        {
            NativeIndexHeaderReader headerReader = new NativeIndexHeaderReader(NO_HEADER_READER);

            GBPTree.readHeader(pageCache, indexFile, headerReader);
            return(headerReader.FailureMessage);
        }
Ejemplo n.º 2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public static SpaceFillingCurveSettings fromGBPTree(java.io.File indexFile, org.neo4j.io.pagecache.PageCache pageCache, System.Func<ByteBuffer,String> onError) throws java.io.IOException
        public static SpaceFillingCurveSettings FromGBPTree(File indexFile, PageCache pageCache, System.Func <ByteBuffer, string> onError)
        {
            SpaceFillingCurveSettings.SettingsFromIndexHeader settings = new SpaceFillingCurveSettings.SettingsFromIndexHeader();
            GBPTree.readHeader(pageCache, indexFile, settings.HeaderReader(onError));
            if (settings.Failed)
            {
                throw new IOException(settings.FailureMessage);
            }
            return(settings);
        }
Ejemplo n.º 3
0
 private static LayoutBootstrapper GenericLayout()
 {
     return((indexFile, pageCache, meta, targetLayout) =>
     {
         if (targetLayout.contains("generic"))
         {
             string numberOfSlotsString = targetLayout.replace("generic", "");
             int numberOfSlots = int.Parse(numberOfSlotsString);
             IDictionary <CoordinateReferenceSystem, SpaceFillingCurveSettings> settings = new Dictionary <CoordinateReferenceSystem, SpaceFillingCurveSettings>();
             GBPTree.readHeader(pageCache, indexFile, new NativeIndexHeaderReader(new SpaceFillingCurveSettingsReader(settings)));
             ConfiguredSpaceFillingCurveSettingsCache configuredSettings = new ConfiguredSpaceFillingCurveSettingsCache(Config.defaults());
             return new GenericLayout(numberOfSlots, new IndexSpecificSpaceFillingCurveSettingsCache(configuredSettings, settings));
         }
         return null;
     });
 }
Ejemplo n.º 4
0
 internal override GenericLayout Layout(StoreIndexDescriptor descriptor, File storeFile)
 {
     try
     {
         int numberOfSlots = descriptor.Properties().Length;
         IDictionary <CoordinateReferenceSystem, SpaceFillingCurveSettings> settings = new Dictionary <CoordinateReferenceSystem, SpaceFillingCurveSettings>();
         if (storeFile != null && Fs.fileExists(storeFile))
         {
             // The index file exists and is sane so use it to read header information from.
             GBPTree.readHeader(PageCache, storeFile, new NativeIndexHeaderReader(new SpaceFillingCurveSettingsReader(settings)));
         }
         return(new GenericLayout(numberOfSlots, new IndexSpecificSpaceFillingCurveSettingsCache(_configuredSettings, settings)));
     }
     catch (IOException e)
     {
         throw new UncheckedIOException(e);
     }
 }
Ejemplo n.º 5
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public static org.neo4j.internal.kernel.api.InternalIndexState readState(org.neo4j.io.pagecache.PageCache pageCache, java.io.File indexFile) throws java.io.IOException
        public static InternalIndexState ReadState(PageCache pageCache, File indexFile)
        {
            NativeIndexHeaderReader headerReader = new NativeIndexHeaderReader(NO_HEADER_READER);

            GBPTree.readHeader(pageCache, indexFile, headerReader);
            switch (headerReader.State)
            {
            case BYTE_FAILED:
                return(InternalIndexState.FAILED);

            case BYTE_ONLINE:
                return(InternalIndexState.ONLINE);

            case BYTE_POPULATING:
                return(InternalIndexState.POPULATING);

            default:
                throw new System.InvalidOperationException("Unexpected initial state byte value " + headerReader.State);
            }
        }