Skip to content

Commit

Permalink
Fix versions and breaking API changes
Browse files Browse the repository at this point in the history
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
  • Loading branch information
reta committed Jan 15, 2025
1 parent 32f689e commit 72ed864
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
"Search shards with slice specified in body":
- skip:
version: " - 2.99.99"
version: " - 2.18.99"
reason: "Added slice body to search_shards in 2.19"
- do:
indices.create:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public ClusterSearchShardsRequest(StreamInput in) throws IOException {
preference = in.readOptionalString();

indicesOptions = IndicesOptions.readIndicesOptions(in);
if (in.getVersion().onOrAfter(Version.V_3_0_0)) {
if (in.getVersion().onOrAfter(Version.V_2_19_0)) {
boolean hasSlice = in.readBoolean();
if (hasSlice) {
sliceBuilder = new SliceBuilder(in);

Check warning on line 86 in server/src/main/java/org/opensearch/action/admin/cluster/shards/ClusterSearchShardsRequest.java

View check run for this annotation

Codecov / codecov/patch

server/src/main/java/org/opensearch/action/admin/cluster/shards/ClusterSearchShardsRequest.java#L86

Added line #L86 was not covered by tests
Expand All @@ -95,7 +95,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeOptionalString(routing);
out.writeOptionalString(preference);
indicesOptions.writeIndicesOptions(out);
if (out.getVersion().onOrAfter(Version.V_3_0_0)) {
if (out.getVersion().onOrAfter(Version.V_2_19_0)) {
if (sliceBuilder != null) {
out.writeBoolean(true);
sliceBuilder.writeTo(out);

Check warning on line 101 in server/src/main/java/org/opensearch/action/admin/cluster/shards/ClusterSearchShardsRequest.java

View check run for this annotation

Codecov / codecov/patch

server/src/main/java/org/opensearch/action/admin/cluster/shards/ClusterSearchShardsRequest.java#L100-L101

Added lines #L100 - L101 were not covered by tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,17 @@ public GroupShardsIterator<ShardIterator> searchShards(
return searchShards(clusterState, concreteIndices, routing, preference, null, null, null);
}

public GroupShardsIterator<ShardIterator> searchShards(
ClusterState clusterState,
String[] concreteIndices,
@Nullable Map<String, Set<String>> routing,
@Nullable String preference,
@Nullable ResponseCollectorService collectorService,
@Nullable Map<String, Long> nodeCounts
) {
return searchShards(clusterState, concreteIndices, routing, preference, collectorService, nodeCounts, null);

Check warning on line 248 in server/src/main/java/org/opensearch/cluster/routing/OperationRouting.java

View check run for this annotation

Codecov / codecov/patch

server/src/main/java/org/opensearch/cluster/routing/OperationRouting.java#L248

Added line #L248 was not covered by tests
}

public GroupShardsIterator<ShardIterator> searchShards(
ClusterState clusterState,
String[] concreteIndices,
Expand Down

0 comments on commit 72ed864

Please sign in to comment.