You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "hailin0 (via GitHub)" <gi...@apache.org> on 2023/03/27 08:55:09 UTC

[GitHub] [incubator-seatunnel] hailin0 commented on a diff in pull request #4349: [Feature][Connector-V2][Elasticsearch] Elasticsearch supports spaced write and is relatively real-time data source friendly #4347

hailin0 commented on code in PR #4349:
URL: https://github.com/apache/incubator-seatunnel/pull/4349#discussion_r1148998093


##########
seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/sink/ElasticsearchSinkWriter.java:
##########
@@ -94,6 +112,32 @@ public void write(SeaTunnelRow element) {
         }
     }
 
+    public void open() {

Review Comment:
   ```suggestion
       public void startScheduler() {
   ```



##########
seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/config/SinkConfig.java:
##########
@@ -58,6 +58,13 @@ public class SinkConfig {
                     .defaultValue(10)
                     .withDescription("batch bulk doc max size");
 
+    @SuppressWarnings("checkstyle:MagicNumber")
+    public static final Option<Integer> BATCH_INTERVAL_MS =
+            Options.key("batch_interval_ms")
+                    .intType()
+                    .defaultValue(-1)

Review Comment:
   Why do you need a default



##########
seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/sink/ElasticsearchSink.java:
##########
@@ -51,6 +54,8 @@
 
     private int maxRetryCount = MAX_RETRY_COUNT.defaultValue();
 
+    private int batchIntervalMs = BATCH_INTERVAL_MS.defaultValue();

Review Comment:
   ```suggestion
       private Integer batchIntervalMs = BATCH_INTERVAL_MS.defaultValue();
   ```



-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org