|
20 | 20 | import org.elasticsearch.action.support.IndicesOptions; |
21 | 21 | import org.elasticsearch.client.internal.Client; |
22 | 22 | import org.elasticsearch.cluster.node.DiscoveryNode; |
| 23 | +import org.elasticsearch.cluster.project.ProjectResolver; |
23 | 24 | import org.elasticsearch.cluster.service.ClusterService; |
24 | 25 | import org.elasticsearch.common.util.concurrent.EsExecutors; |
25 | 26 | import org.elasticsearch.core.Strings; |
@@ -48,26 +49,29 @@ public class GetMigrationReindexStatusTransportAction extends HandledTransportAc |
48 | 49 | private final ClusterService clusterService; |
49 | 50 | private final TransportService transportService; |
50 | 51 | private final Client client; |
| 52 | + private final ProjectResolver projectResolver; |
51 | 53 |
|
52 | 54 | @Inject |
53 | 55 | public GetMigrationReindexStatusTransportAction( |
54 | 56 | ClusterService clusterService, |
55 | 57 | TransportService transportService, |
56 | 58 | ActionFilters actionFilters, |
57 | | - Client client |
| 59 | + Client client, |
| 60 | + ProjectResolver projectResolver |
58 | 61 | ) { |
59 | 62 | super(GetMigrationReindexStatusAction.NAME, transportService, actionFilters, Request::new, EsExecutors.DIRECT_EXECUTOR_SERVICE); |
60 | 63 | this.clusterService = clusterService; |
61 | 64 | this.transportService = transportService; |
62 | 65 | this.client = client; |
| 66 | + this.projectResolver = projectResolver; |
63 | 67 | } |
64 | 68 |
|
65 | 69 | @Override |
66 | 70 | protected void doExecute(Task task, Request request, ActionListener<Response> listener) { |
67 | 71 | String index = request.getIndex(); |
68 | 72 | String persistentTaskId = ReindexDataStreamAction.TASK_ID_PREFIX + index; |
69 | 73 | PersistentTasksCustomMetadata.PersistentTask<?> persistentTask = PersistentTasksCustomMetadata.getTaskWithId( |
70 | | - clusterService.state(), |
| 74 | + projectResolver.getProjectMetadata(clusterService.state()), |
71 | 75 | persistentTaskId |
72 | 76 | ); |
73 | 77 | if (persistentTask == null) { |
|
0 commit comments