@Override public InternalIndexState getInitialState( StoreIndexDescriptor descriptor ) { SpatialIndexFiles spatialIndexFiles = new SpatialIndexFiles( directoryStructure(), descriptor.getId(), fs, configuredSettings ); final Iterable<SpatialIndexFiles.SpatialFile> existing = spatialIndexFiles.existing(); InternalIndexState state = InternalIndexState.ONLINE; for ( SpatialIndexFiles.SpatialFile subIndex : existing ) { try { switch ( NativeIndexes.readState( pageCache, subIndex.indexFile ) ) { case FAILED: return InternalIndexState.FAILED; case POPULATING: state = InternalIndexState.POPULATING; default: // continue } } catch ( MetadataMismatchException | IOException e ) { monitor.failedToOpenIndex( descriptor, "Requesting re-population.", e ); return InternalIndexState.POPULATING; } } return state; }
@Override public InternalIndexState getInitialState( StoreIndexDescriptor descriptor ) { TemporalIndexFiles temporalIndexFiles = new TemporalIndexFiles( directoryStructure(), descriptor, fs ); final Iterable<TemporalIndexFiles.FileLayout> existing = temporalIndexFiles.existing(); InternalIndexState state = InternalIndexState.ONLINE; for ( TemporalIndexFiles.FileLayout subIndex : existing ) { try { switch ( NativeIndexes.readState( pageCache, subIndex.indexFile ) ) { case FAILED: return InternalIndexState.FAILED; case POPULATING: state = InternalIndexState.POPULATING; default: // continue } } catch ( MetadataMismatchException | IOException e ) { monitor.failedToOpenIndex( descriptor, "Requesting re-population.", e ); return InternalIndexState.POPULATING; } } return state; }
@Override public InternalIndexState getInitialState( StoreIndexDescriptor descriptor ) { try { return NativeIndexes.readState( pageCache, nativeIndexFileFromIndexId( descriptor.getId() ) ); } catch ( MetadataMismatchException | IOException e ) { monitor.failedToOpenIndex( descriptor, "Requesting re-population.", e ); return InternalIndexState.POPULATING; } }
@Override public InternalIndexState getInitialState( StoreIndexDescriptor descriptor ) { SpatialIndexFiles spatialIndexFiles = new SpatialIndexFiles( directoryStructure(), descriptor.getId(), fs, configuredSettings ); final Iterable<SpatialIndexFiles.SpatialFile> existing = spatialIndexFiles.existing(); InternalIndexState state = InternalIndexState.ONLINE; for ( SpatialIndexFiles.SpatialFile subIndex : existing ) { try { switch ( NativeIndexes.readState( pageCache, subIndex.indexFile ) ) { case FAILED: return InternalIndexState.FAILED; case POPULATING: state = InternalIndexState.POPULATING; default: // continue } } catch ( MetadataMismatchException | IOException e ) { monitor.failedToOpenIndex( descriptor, "Requesting re-population.", e ); return InternalIndexState.POPULATING; } } return state; }
@Override public InternalIndexState getInitialState( StoreIndexDescriptor descriptor ) { TemporalIndexFiles temporalIndexFiles = new TemporalIndexFiles( directoryStructure(), descriptor, fs ); final Iterable<TemporalIndexFiles.FileLayout> existing = temporalIndexFiles.existing(); InternalIndexState state = InternalIndexState.ONLINE; for ( TemporalIndexFiles.FileLayout subIndex : existing ) { try { switch ( NativeIndexes.readState( pageCache, subIndex.indexFile ) ) { case FAILED: return InternalIndexState.FAILED; case POPULATING: state = InternalIndexState.POPULATING; default: // continue } } catch ( MetadataMismatchException | IOException e ) { monitor.failedToOpenIndex( descriptor, "Requesting re-population.", e ); return InternalIndexState.POPULATING; } } return state; }
@Override public InternalIndexState getInitialState( StoreIndexDescriptor descriptor ) { PartitionedIndexStorage indexStorage = getIndexStorage( descriptor.getId() ); String failure = indexStorage.getStoredIndexFailure(); if ( failure != null ) { return InternalIndexState.FAILED; } try { return indexIsOnline( indexStorage, descriptor ) ? InternalIndexState.ONLINE : InternalIndexState.POPULATING; } catch ( IOException e ) { monitor.failedToOpenIndex( descriptor, "Requesting re-population.", e ); return InternalIndexState.POPULATING; } }
@Override public InternalIndexState getInitialState( StoreIndexDescriptor descriptor ) { try { return NativeIndexes.readState( pageCache, nativeIndexFileFromIndexId( descriptor.getId() ) ); } catch ( MetadataMismatchException | IOException e ) { monitor.failedToOpenIndex( descriptor, "Requesting re-population.", e ); return InternalIndexState.POPULATING; } }