mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-01-09 07:23:08 -06:00
linebreak on payloads for elastic _bulk endpoint
This commit is contained in:
parent
e4903c37b9
commit
68b7f758f5
@ -46,9 +46,10 @@ public class HttpOpDispenser extends BaseOpDispenser<HttpOp, HttpSpace> {
|
||||
LongFunction<HttpRequest.Builder> builderF = l -> HttpRequest.newBuilder();
|
||||
LongFunction<String> bodyF = op.getAsFunctionOr("body", null);
|
||||
LongFunction<HttpRequest.BodyPublisher> bodyPublisherF =
|
||||
l -> Optional.ofNullable(bodyF.apply(l)).map(HttpRequest.BodyPublishers::ofString).orElse(
|
||||
HttpRequest.BodyPublishers.noBody()
|
||||
);
|
||||
l -> Optional.ofNullable(bodyF.apply(l))
|
||||
.map(s -> s + "\n") // the elastic _bulk endpoint requires a newline at the end of the body
|
||||
.map(HttpRequest.BodyPublishers::ofString)
|
||||
.orElse(HttpRequest.BodyPublishers.noBody());
|
||||
|
||||
LongFunction<String> methodF = op.getAsFunctionOr("method", "GET");
|
||||
LongFunction<HttpRequest.Builder> initBuilderF =
|
||||
|
Loading…
Reference in New Issue
Block a user