opensearch-project / opensearch-project/data-prepper
OpenSearch source should write to buffer directly (no BufferAccumulator)
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 374
- Forks
- 354
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 8
Description
The opensearch source is using the BufferAccumulator to write to the buffer. But, this is an unnecessary structure because the source already queries the OpenSearch cluster/domain/collection in batches. Each batch should be a single Buffer::writeAll.
This will help the metrics align between batches and buffer writes. And batches will be all-or-nothing similar.
The BufferAccumulator was made for the S3 source. This had a stream of data coming in and the number of events is unknown to the sink until after it is parsed. The BufferAccumulator allows for batches writing to the buffer. It is only appropriate for situations where there is no natural batch available. For example, the http source has batches pushed from clients and the opensearch source searches in batches.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the OpenSearch source and its use of BufferAccumulator, then inspect the surrounding batch-query and buffer-writing flow. Replace the accumulator path with one Buffer::writeAll per OpenSearch batch, and verify that batch metrics align with buffer writes and writes remain all-or-nothing using the relevant existing tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, data-engineering
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100