private void ensureAllLoaded() throws IOException {
            if (sizeInBytes != -1) {
                return;
            }
            Records records;
            try {
                records = elasticLogFileRecords.readAll0(FetchContext.DEFAULT, startOffset, maxOffset, fetchSize).get();
            } catch (Throwable t) {
                throw new IOException(FutureUtil.cause(t));
            }
            sizeInBytes = records.sizeInBytes();
            if (records instanceof PooledMemoryRecords) {
                memoryRecords = MemoryRecords.readableRecords(((PooledMemoryRecords) records).pack.nioBuffer());
                lastOffset = ((PooledMemoryRecords) records).lastOffset();
            } else if (records instanceof MemoryRecords) {
                memoryRecords = (MemoryRecords) records;
                lastOffset = startOffset;
                for (RecordBatch batch: records.batches()) {
                    lastOffset = batch.lastOffset() + 1;
                }
            } else {
                throw new IllegalArgumentException("unknown records type " + records.getClass());
            }
        }
Return the largest timestamp of the messages after a given offset

@param startOffset The starting offset.
@return The largest timestamp of the messages after the given position.
core/src/main/scala/kafka/log/streamaspect/ElasticLogFileRecords.java