opensearch-project / opensearch-project/data-prepper
Stop listing indexes after one time pull from the OpenSearch indices
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 374
- Forks
- 354
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 8
Description
Is your feature request related to a problem? Please describe.
As a user of the OpenSearch source, I would like to only do a one-time list of the indices rather than periodically pull new indices.
Describe the solution you'd like
An option in the OpenSearch source to configure the number of cat/indices calls to make.
source:
opensearch:
scheduling:
list_index_count: 1
Would only list indexes once, process those indexes, and then stop listing and working completely.
This can be done in a similar way as the S3 Source, which will only has a configurable scan count that will block subsequent scans once that scan count is reached (https://github.com/opensearch-project/data-prepper/blob/2f9bed8ae28868c33f50e7e929b502970cb23aff/data-prepper-plugins/s3-source/src/main/java/org/opensearch/dataprepper/plugins/source/s3/S3ScanPartitionCreationSupplier.java#L73). This would be applied to the Global state item and supplier for the OpenSearch source (https://github.com/opensearch-project/data-prepper/blob/2f9bed8ae28868c33f50e7e929b502970cb23aff/data-prepper-plugins/opensearch/src/main/java/org/opensearch/dataprepper/plugins/source/opensearch/worker/OpenSearchIndexPartitionCreationSupplier.java#L65)
Describe alternatives you've considered (Optional)
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
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 with data-prepper-plugins/opensearch/src/main/java/org/opensearch/dataprepper/plugins/source/opensearch/worker/OpenSearchIndexPartitionCreationSupplier.java and the related Global state item, then compare S3ScanPartitionCreationSupplier.java. Add the scheduling list_index_count option so the OpenSearch source stops listing and working after the configured number of scans, including the one-time case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, search
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100