@ SneakyThrows ( IOException . class ) private KeyUpdateCollection readKeysFromSegment ( DirectSegmentAccess segment , long firstOffset , long lastOffset , TimeoutTimer timer ) { KeyUpdateCollection keyUpdates = new KeyUpdateCollection ( ) ; try ( InputStream input = readFromInMemorySegment ( segment , firstOffset , lastOffset , timer ) ) { long segmentOffset = firstOffset ; while ( segmentOffset < lastOffset ) { segmentOffset += indexSingleKey ( input , segmentOffset , keyUpdates ) ; } } return keyUpdates ; }
Reads all the Keys from the given Segment between the given offsets and indexes them by key .