DanielLeens opened a new issue, #13637:
URL: https://github.com/apache/seatunnel/issues/13637

   ## Improvement
   
   In dev 5cf050be3ffc77c0065d67d4eb8af83f24a2a620, 
`ElasticsearchSinkWriter.bulkEsWithRetry` builds the entire NDJSON payload with 
`String.join("\n", requestEsList)` and then concatenates a final newline. This 
creates an additional complete-payload String/copy on each bulk attempt. 
Sanitized JFR of a matched million-row complete-engine run identifies this 
lambda as an allocation hotspot; sampled allocation weights are not an exact 
savings estimate.
   
   Use a `StringJoiner` with a newline suffix so delimiters and the required 
final NDJSON newline are included in the joined result. Preserve the exact 
existing wire payload, Unicode/escaping, batch boundaries, synchronous retry 
execution, failure propagation, clearing only after success, and empty-batch 
behavior. Do not change batch-size defaults or client ownership.
   
   The common JSON fixture has 19 fields and explicitly uses text projections 
for decimal/date/time/timestamp/binary. On the same existing 4-vCPU/16-GiB host 
with Java11, 1-GiB maximum heap, one channel/parallelism, batch2000 and DataX 
completion polling1000ms, baseline DataX68.961s/SeaTunnel72.200s was one 
diagnostic pair, not three-run acceptance. Response-tree optimization 
diagnostics also remained slower than DataX (69.998/75.691s); no whole-job 
benefit is attributed to this request-payload change before it is measured.
   
   Scope: only the existing Elasticsearch sink writer, its existing tests/E2E 
resource coverage and English/Chinese sink documentation. No 
API/config-default/row-format/engine/core/dependency/POM changes. Validate 
exact payload and retry behavior, existing checks, real self-hosted ES8.9 and 
complete-engine million-row comparisons with all19values reconciled. The 
original payload join arrived in #2817 (2fcbbf464a1).
   
   Open/closed duplicate searches for Elasticsearch String.join and payload 
allocation found no matching PR. #13557 covers batch-sizing documentation; 
#11567 covers REST-client ownership; #13629 concerns response DOM parsing and 
is a separate unsubmitted experiment. Repeat the duplicate search before 
submitting.
   


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

Reply via email to