@SuppressWarnings({"rawtypes"})
    public synchronized void flush() {
        flushing = true;
        if (!hasRecords()) {
            flushing = false;
            return;
        }

        for (Entry<String, List> kvs : batchMap.entrySet()) {
            flushSingleTable(kvs.getKey(), kvs.getValue());
        }
        if (!errorTables.isEmpty()) {
            // Clean the key that has errors
            errorTables.forEach(batchMap::remove);
            errorTables.clear();
        }
        batchBytes = 0;
        size = 0;
        LOG.info("Doris sink statistics: readInNum: {}, writeOutNum: {}, errorNum: {}, ddlNum: {}",
                readInNum.get(), writeOutNum.get(), errorNum.get(), ddlNum.get());
        flushing = false;
    }
A builder used to set parameters to the output format's configuration in a fluent way.

@return builder
inlong-sort/sort-flink/sort-flink-v1.13/sort-connectors/doris/src/main/java/org/apache/inlong/sort/doris/table/DorisDynamicSchemaOutputFormat.java