fetchOffsetPositionForStartingOffset
public static org.apache.kafka.storage.internals.log.OffsetPosition fetchOffsetPositionForStartingOffset(CancellationContext cancellationContext,
TierObjectStore tierObjectStore,
TierObjectStore.ObjectMetadata tierObjectMetadata,
long targetOffset)
throws Exception
Find an OffsetPosition from a OffsetIndex InputStream. This method attempts to duplicate
OffsetIndex.lookup() in that in the event an index entry is not found, or the index
is empty, we return OffsetPosition(baseOffset, 0).
This should allow for finding any given targetOffset as long as the targetOffset is located
in the segment file.
- Throws:
Exception