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);
        }
//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");
        }