public static SSTableIndexIndex readIndex ( final FileSystem fileSystem , final Path sstablePath ) throws IOException { final Closer closer = Closer . create ( ) ; final Path indexPath = sstablePath . suffix ( SSTABLE_INDEX_SUFFIX ) ; // Detonate if we don't have an index. final FSDataInputStream inputStream = closer . register ( fileSystem . open ( indexPath ) ) ; final SSTableIndexIndex indexIndex = new SSTableIndexIndex ( ) ; try { while ( inputStream . available ( ) != 0 ) { indexIndex . add ( inputStream . readLong ( ) , inputStream . readLong ( ) ) ; } } finally { closer . close ( ) ; } return indexIndex ; }
Read an existing index . Reads and returns the index index which is a list of chunks defined by the Cassandra Index . db file along with the configured split size .