Hisoka-X commented on code in PR #7501:
URL: https://github.com/apache/seatunnel/pull/7501#discussion_r1732048924
##########
seatunnel-api/src/main/java/org/apache/seatunnel/api/sink/multitablesink/MultiTableSinkWriter.java:
##########
@@ -75,6 +80,7 @@ public MultiTableSinkWriter(
BlockingQueue<SeaTunnelRow> queue = new
LinkedBlockingQueue<>(1024);
Map<String, SinkWriter<SeaTunnelRow, ?, ?>> tableIdWriterMap = new
HashMap<>();
Map<SinkIdentifier, SinkWriter<SeaTunnelRow, ?, ?>>
sinkIdentifierMap = new HashMap<>();
+ Map<SinkIdentifier, SinkWriter.Context> sinkContextIdentifierMap =
new HashMap<>();
Review Comment:
This variable useless?
##########
seatunnel-api/src/main/java/org/apache/seatunnel/api/sink/multitablesink/MultiTableSinkWriter.java:
##########
@@ -267,26 +276,32 @@ public void abortPrepare() {
@Override
public void close() throws IOException {
- Throwable firstE = null;
+ final Throwable[] firstE = {null};
Review Comment:
Add comment for why use array.
##########
seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/task/flow/SinkFlowLifeCycle.java:
##########
@@ -284,18 +287,11 @@ public void restoreState(List<ActionSubtaskState>
actionStateList) throws Except
.collect(Collectors.toList());
}
if (states.isEmpty()) {
- this.writer =
- sinkAction
- .getSink()
- .createWriter(
- new SinkWriterContext(indexID,
metricsContext, eventListener));
+ this.writerContext = new SinkWriterContext(indexID,
metricsContext, eventListener);
Review Comment:
we can move it into outer of if statement.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]