Skip to content

Commit 44adfbb

Browse files
committed
Refactor ObjectPath evaluation
1 parent f1055be commit 44adfbb

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/TimeSeriesRestDriver.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import org.elasticsearch.core.TimeValue;
2626
import org.elasticsearch.test.rest.ESRestTestCase;
2727
import org.elasticsearch.test.rest.ObjectPath;
28-
import org.elasticsearch.test.rest.Stash;
2928
import org.elasticsearch.xcontent.ToXContent;
3029
import org.elasticsearch.xcontent.XContentBuilder;
3130
import org.elasticsearch.xcontent.XContentType;
@@ -375,10 +374,7 @@ public static Integer getNumberOfPrimarySegments(RestClient client, String index
375374
Response response = client.performRequest(new Request("GET", index + "/_segments"));
376375
final Map<String, Object> originalResponseEntity = ESRestTestCase.entityAsMap(response);
377376
logger.trace("segments response for {}: {}", index, originalResponseEntity);
378-
// We need to use a stash here because the index name is likely a data stream index with a dot.
379-
Stash stash = new Stash();
380-
stash.stashValue("index", index);
381-
Map<String, Object> responseEntity = new ObjectPath(originalResponseEntity).evaluate("indices.${index}.shards", stash);
377+
Map<String, Object> responseEntity = new ObjectPath(originalResponseEntity).evaluateExact("indices", index, "shards");
382378
return responseEntity.values()
383379
.stream()
384380
.mapToInt(

0 commit comments

Comments
 (0)