public int partition(LogData<T> logData, int[] partitions) {
    checkNotNull(logData, "record is null");
    checkArgument(ArrayUtils.isNotEmpty(partitions), "Partitions of the target topic is empty.");

    int partition;
    if (helper == null || !helper.isPrimaryKeyExist()) {
      int nextValue = nextValue();
      int part = Utils.toPositive(nextValue) % partitions.length;
      partition = partitions[part];
    } else {
      helper.open();
      long hash = helper.hashKeyValue((RowData) logData.getActualValue());
      partition = partitions[(int) (hash % partitions.length)];
    }
    return partition;
  }
This is a log message partitioner that makes sure the record is without out-of-order.
amoro-format-mixed/amoro-mixed-flink/amoro-mixed-flink-common/src/main/java/org/apache/amoro/flink/write/hidden/MixedFormatLogPartitioner.java