Skip to content

Commit

Permalink
fixing serialization, adding to a test
Browse files Browse the repository at this point in the history
  • Loading branch information
masseyke committed Oct 12, 2023
1 parent 8e295cf commit 59c345d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,12 @@ teardown:
_index: test_index
_id: test_id2
- f1: v2
- index:
_index: test_index
_id: test_id2
pipeline: fake_pipeline
- f1: v2

- match: { items.0.index.executed_pipelines: ["pipeline1"] }
- match: { items.1.index.executed_pipelines: [] }
- match: { items.2.index.executed_pipelines: null }
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,10 @@ public IndexRequest(@Nullable ShardId shardId, StreamInput in) throws IOExceptio
if (in.getTransportVersion().onOrAfter(TransportVersions.PIPELINES_IN_BULK_RESPONSE_ADDED)) {
this.listExecutedPipelines = in.readBoolean();
if (listExecutedPipelines) {
this.executedPipelines = new ArrayList<>(in.readCollectionAsList(StreamInput::readString));
List<String> possiblyImmutableExecutedPipelines = in.readOptionalCollectionAsList(StreamInput::readString);
this.executedPipelines = possiblyImmutableExecutedPipelines == null
? null
: new ArrayList<>(possiblyImmutableExecutedPipelines);
}
}
}
Expand Down Expand Up @@ -749,7 +752,7 @@ private void writeBody(StreamOutput out) throws IOException {
if (out.getTransportVersion().onOrAfter(TransportVersions.PIPELINES_IN_BULK_RESPONSE_ADDED)) {
out.writeBoolean(listExecutedPipelines);
if (listExecutedPipelines) {
out.writeCollection(executedPipelines, StreamOutput::writeString);
out.writeOptionalCollection(executedPipelines, StreamOutput::writeString);
}
}
}
Expand Down

0 comments on commit 59c345d

Please sign in to comment.