|
10 | 10 | import org.elasticsearch.ElasticsearchException; |
11 | 11 | import org.elasticsearch.Version; |
12 | 12 | import org.elasticsearch.action.ActionListener; |
13 | | -import org.elasticsearch.action.StepListener; |
14 | 13 | import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotRequest; |
15 | 14 | import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse; |
16 | 15 | import org.elasticsearch.action.support.ActionFilters; |
|
26 | 25 | import org.elasticsearch.common.inject.Inject; |
27 | 26 | import org.elasticsearch.common.settings.Setting; |
28 | 27 | import org.elasticsearch.common.settings.Settings; |
| 28 | +import org.elasticsearch.common.util.concurrent.ListenableFuture; |
29 | 29 | import org.elasticsearch.index.IndexNotFoundException; |
30 | 30 | import org.elasticsearch.indices.ShardLimitValidator; |
31 | 31 | import org.elasticsearch.indices.SystemIndices; |
@@ -185,9 +185,9 @@ protected void masterOperation( |
185 | 185 | final Repository repository = repositoriesService.repository(repoName); |
186 | 186 | SearchableSnapshots.getSearchableRepository(repository); // just check it's valid |
187 | 187 |
|
188 | | - final StepListener<RepositoryData> repositoryDataListener = new StepListener<>(); |
| 188 | + final ListenableFuture<RepositoryData> repositoryDataListener = new ListenableFuture<>(); |
189 | 189 | repository.getRepositoryData(repositoryDataListener); |
190 | | - repositoryDataListener.whenComplete(repoData -> { |
| 190 | + repositoryDataListener.addListener(ActionListener.wrap(repoData -> { |
191 | 191 | final Map<String, IndexId> indexIds = repoData.getIndices(); |
192 | 192 | if (indexIds.containsKey(indexName) == false) { |
193 | 193 | throw new IndexNotFoundException("index [" + indexName + "] not found in repository [" + repoName + "]"); |
@@ -280,6 +280,6 @@ protected void masterOperation( |
280 | 280 | .snapshotUuid(snapshotId.getUUID()), |
281 | 281 | listener |
282 | 282 | ); |
283 | | - }, listener::onFailure); |
| 283 | + }, listener::onFailure), threadPool.generic(), null); |
284 | 284 | } |
285 | 285 | } |
0 commit comments