private OffsetHolder getEarliestLocalOffset(TopicPartition topicPartition) {
        List<String> partitionFiles = getTopicPartitionFileNames(topicPartition);
        Optional<String> firstLogFile = partitionFiles.stream()
                .filter(filename -> filename.endsWith(LogFileUtils.LOG_FILE_SUFFIX))
                .sorted()
                .findFirst();
        if (!firstLogFile.isPresent()) {
            throw new IllegalArgumentException(String.format(
                    "[BrokerId=%d] No log file found for the topic-partition %s", brokerId, topicPartition));
        }
        return new OffsetHolder(LogFileUtils.offsetFromFileName(firstLogFile.get()), partitionFiles);
    }
Check if the given offset is present in the first local segment of the given topic-partition.
@param topicPartition The topic-partition to check.
@param firstLogFileBaseOffset The base offset of the first local segment.
@param offsetToSearch The offset to search.
@return true if the offset is present in the first local segment, false otherwise.
storage/src/test/java/org/apache/kafka/tiered/storage/utils/BrokerLocalStorage.java