long offsetForEarliestTimestamp(TopicIdPartition topicIdPartition) {
        // TODO: We need to know the isolation level from group configs, for now we are passing Option.empty() for isolationLevel
        Option<TimestampAndOffset> timestampAndOffset = replicaManager.fetchOffsetForTimestamp(
            topicIdPartition.topicPartition(), ListOffsetsRequest.EARLIEST_TIMESTAMP, Option.empty(),
            Optional.empty(), true);
        return timestampAndOffset.isEmpty() ? (long) 0 : timestampAndOffset.get().offset;
    }
The method is used to get the offset for the earliest timestamp for the topic-partition.

@return The offset for the earliest timestamp.
core/src/main/java/kafka/server/share/SharePartitionManager.java