@Override
    public int compareTo(Offset offset) {
        RedoLogOffset that = (RedoLogOffset) offset;
        // the NO_STOPPING_OFFSET is the max offset
        if (NO_STOPPING_OFFSET.equals(that) && NO_STOPPING_OFFSET.equals(this)) {
            return 0;
        }
        if (NO_STOPPING_OFFSET.equals(this)) {
            return 1;
        }
        if (NO_STOPPING_OFFSET.equals(that)) {
            return -1;
        }

        String scnStr = this.getScn();
        String targetScnStr = that.getScn();
        if (StringUtils.isNotEmpty(targetScnStr)) {
            if (StringUtils.isNotEmpty(scnStr)) {
                Scn scn = Scn.valueOf(scnStr);
                Scn targetScn = Scn.valueOf(targetScnStr);
                return scn.compareTo(targetScn);
            }
            return -1;
        } else if (StringUtils.isNotEmpty(scnStr)) {
            return 1;
        }
        return 0;
    }
A structure describes an offset in a redo log event.
 Copy from com.ververica:flink-connector-oracle-cdc:2.3.0
inlong-sort/sort-flink/sort-flink-v1.13/sort-connectors/oracle-cdc/src/main/java/org/apache/inlong/sort/cdc/oracle/source/meta/offset/RedoLogOffset.java