diff --git a/seatunnel-api/src/main/java/org/apache/seatunnel/api/sink/DefaultSinkWriterContext.java b/seatunnel-api/src/main/java/org/apache/seatunnel/api/sink/DefaultSinkWriterContext.java index 533fd5c6150c..73af75f22ca9 100644 --- a/seatunnel-api/src/main/java/org/apache/seatunnel/api/sink/DefaultSinkWriterContext.java +++ b/seatunnel-api/src/main/java/org/apache/seatunnel/api/sink/DefaultSinkWriterContext.java @@ -45,11 +45,6 @@ public int getIndexOfSubtask() { return subtask; } - @Override - public int getNumberOfParallelSubtasks() { - return 0; - } - @Override public MetricsContext getMetricsContext() { // TODO Waiting for Flink and Spark to implement MetricsContext diff --git a/seatunnel-api/src/main/java/org/apache/seatunnel/api/sink/SinkWriter.java b/seatunnel-api/src/main/java/org/apache/seatunnel/api/sink/SinkWriter.java index 91b711a367ed..8d204d82f692 100644 --- a/seatunnel-api/src/main/java/org/apache/seatunnel/api/sink/SinkWriter.java +++ b/seatunnel-api/src/main/java/org/apache/seatunnel/api/sink/SinkWriter.java @@ -93,7 +93,9 @@ interface Context extends Serializable { int getIndexOfSubtask(); /** @return parallelism of this writer. */ - int getNumberOfParallelSubtasks(); + default int getNumberOfParallelSubtasks() { + return 0; + } /** @return metricsContext of this reader. */ MetricsContext getMetricsContext(); diff --git a/seatunnel-translation/seatunnel-translation-flink/seatunnel-translation-flink-13/src/main/java/org/apache/seatunnel/translation/flink/sink/FlinkSinkWriterContext.java b/seatunnel-translation/seatunnel-translation-flink/seatunnel-translation-flink-13/src/main/java/org/apache/seatunnel/translation/flink/sink/FlinkSinkWriterContext.java index 073c39477727..4a81b43c9a8d 100644 --- a/seatunnel-translation/seatunnel-translation-flink/seatunnel-translation-flink-13/src/main/java/org/apache/seatunnel/translation/flink/sink/FlinkSinkWriterContext.java +++ b/seatunnel-translation/seatunnel-translation-flink/seatunnel-translation-flink-13/src/main/java/org/apache/seatunnel/translation/flink/sink/FlinkSinkWriterContext.java @@ -50,11 +50,6 @@ public int getIndexOfSubtask() { return writerContext.getSubtaskId(); } - @Override - public int getNumberOfParallelSubtasks() { - return 0; - } - @Override public MetricsContext getMetricsContext() { try { diff --git a/seatunnel-translation/seatunnel-translation-flink/seatunnel-translation-flink-common/src/main/java/org/apache/seatunnel/translation/flink/sink/FlinkSinkWriterContext.java b/seatunnel-translation/seatunnel-translation-flink/seatunnel-translation-flink-common/src/main/java/org/apache/seatunnel/translation/flink/sink/FlinkSinkWriterContext.java index d59060198cc8..7969f4450979 100644 --- a/seatunnel-translation/seatunnel-translation-flink/seatunnel-translation-flink-common/src/main/java/org/apache/seatunnel/translation/flink/sink/FlinkSinkWriterContext.java +++ b/seatunnel-translation/seatunnel-translation-flink/seatunnel-translation-flink-common/src/main/java/org/apache/seatunnel/translation/flink/sink/FlinkSinkWriterContext.java @@ -47,11 +47,6 @@ public int getIndexOfSubtask() { return writerContext.getSubtaskId(); } - @Override - public int getNumberOfParallelSubtasks() { - return 0; - } - @Override public MetricsContext getMetricsContext() { return new FlinkMetricContext(getStreamingRuntimeContextForV15(writerContext));