opensearch-project / opensearch-project/data-prepper

OpenSearch source should write to buffer directly (no BufferAccumulator)

Open
#6,331 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

maintenance
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.