Skip to content

Commit

Permalink
Support request-params for bulk operation (opensearch-project#501)
Browse files Browse the repository at this point in the history
Adding "request-params" support for bulk operation.
Signed-off-by: Liyun Xiu <[email protected]>
  • Loading branch information
chishui authored Apr 3, 2024
1 parent 490ec84 commit 5f19515
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion osbenchmark/worker_coordinator/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ async def __call__(self, opensearch, params):
The following keys are optional:
* ``pipeline``: If present, runs the the specified ingest pipeline for this bulk.
* ``request-params``: If present, they will be passed as parameters of bulk.
* ``detailed-results``: If ``True``, the runner will analyze the response and add detailed meta-data. Defaults to ``False``. Note
that this has a very significant impact on performance and will very
likely cause a bottleneck in the benchmark worker_coordinator so please
Expand All @@ -486,12 +487,17 @@ async def __call__(self, opensearch, params):
``None`` and potentially falls back to the global timeout setting.
"""
detailed_results = params.get("detailed-results", False)
api_kwargs = self._default_kw_params(params)

bulk_params = {}
if "pipeline" in params:
bulk_params["pipeline"] = params["pipeline"]

if "request-params" in params:
bulk_params.update(params["request-params"])
params.pop( "request-params" )

api_kwargs = self._default_kw_params(params)

with_action_metadata = mandatory(params, "action-metadata-present", self)
bulk_size = mandatory(params, "bulk-size", self)
unit = mandatory(params, "unit", self)
Expand Down

0 comments on commit 5f19515

Please sign in to comment.