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

[GitHub] [incubator-seatunnel] iture123 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

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


##########
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(1000)

Review Comment:
   It is better set defualtValue is 0 ?



##########
seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/sink/ElasticsearchSinkWriter.java:
##########
@@ -116,6 +157,9 @@ public synchronized void bulkEsWithRetry(
                                         ElasticsearchConnectorErrorCode.BULK_RESPONSE_ERROR,
                                         "bulk es error: " + bulkResponse.getResponse());
                             }
+                            log.info(

Review Comment:
   I support not to  introduce ScheduledThreadPool,but run Thead.sleep(batchIntervalMs) after bulk request.



##########
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(1000)

Review Comment:
   It is better set defualtValue is 0 ?



-- 
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