Skip to content

Commit 1832248

Browse files
authored
Replace deprecated routingTable table call in tests (#131005)
1 parent 27bba64 commit 1832248

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/plugin/DataNodeRequestSenderIT.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import org.elasticsearch.action.index.IndexRequest;
1111
import org.elasticsearch.action.support.WriteRequest;
1212
import org.elasticsearch.cluster.metadata.IndexMetadata;
13+
import org.elasticsearch.cluster.metadata.ProjectId;
1314
import org.elasticsearch.common.settings.Settings;
1415
import org.elasticsearch.common.util.CollectionUtils;
1516
import org.elasticsearch.compute.operator.exchange.ExchangeService;
@@ -131,12 +132,8 @@ public void testRetryOnShardMovement() {
131132
(handler, request, channel, task) -> {
132133
// move index shard
133134
if (shouldMove.compareAndSet(true, false)) {
134-
var currentShardNodeId = clusterService().state()
135-
.routingTable()
136-
.index("index-1")
137-
.shard(0)
138-
.primaryShard()
139-
.currentNodeId();
135+
var shardRouting = clusterService().state().routingTable(ProjectId.DEFAULT).shardRoutingTable("index-1", 0);
136+
var currentShardNodeId = shardRouting.primaryShard().currentNodeId();
140137
assertAcked(
141138
client().admin()
142139
.indices()

0 commit comments

Comments
 (0)