default void judgeKafkaSampleIsAvailable(OffsetMap offsetMap, String topic) {
        boolean kafkaSampleIsAvailable = false;
        Map<KafkaTopicPartition, Long> latest = offsetMap.getLatest();
        Map<KafkaTopicPartition, Long> earliest = offsetMap.getEarliest();

        for (KafkaTopicPartition partition : latest.keySet()) {
            Long earliestOffset = earliest.get(partition);
            Long latestOffset = latest.get(partition);

            if (!latestOffset.equals(earliestOffset)) {
                kafkaSampleIsAvailable = true;
            }
        }

        if (!kafkaSampleIsAvailable) {
            throw new KafkaSamplingUnavailableException(
                    String.format(
                            "Kafka sampling of [%s] is unavailable because there is no data in all partitions",
                            topic));
        }
    }
Judge whether there is data for consumption in each partition in Kafka. If there is no data
consumption in all partitions, then this sampling task is not available

@param offsetMap offset map
kafka-base/kafka-base-source/src/main/java/com/dtstack/flink/sql/source/kafka/sample/OffsetFetcher.java