Use RestoreSnapshotRequest in CcrRepositoryIT

Commit #37535 removed an internal restore request in favor of the
RestoreSnapshotRequest. Commit #37449 added a new test that used the
internal restore request. This commit modifies the new test to use the
RestoreSnapshotRequest.
This commit is contained in:
Tim Brooks 2019-01-17 15:31:27 -07:00
parent b6f06a48c0
commit 978c818d0f
No known key found for this signature in database
GPG Key ID: C2AA3BB91A889E77
1 changed files with 4 additions and 5 deletions

View File

@ -273,11 +273,10 @@ public class CcrRepositoryIT extends CcrIntegTestCase {
Settings.Builder settingsBuilder = Settings.builder() Settings.Builder settingsBuilder = Settings.builder()
.put(IndexMetaData.SETTING_INDEX_PROVIDED_NAME, followerIndex) .put(IndexMetaData.SETTING_INDEX_PROVIDED_NAME, followerIndex)
.put(CcrSettings.CCR_FOLLOWING_INDEX_SETTING.getKey(), true); .put(CcrSettings.CCR_FOLLOWING_INDEX_SETTING.getKey(), true);
RestoreService.RestoreRequest restoreRequest = new RestoreService.RestoreRequest(leaderClusterRepoName, RestoreSnapshotRequest restoreRequest = new RestoreSnapshotRequest(leaderClusterRepoName, CcrRepository.LATEST)
CcrRepository.LATEST, new String[]{leaderIndex}, indicesOptions, .indices(leaderIndex).indicesOptions(indicesOptions).renamePattern("^(.*)$")
"^(.*)$", followerIndex, Settings.EMPTY, new TimeValue(1, TimeUnit.HOURS), false, .renameReplacement(followerIndex).masterNodeTimeout(new TimeValue(1L, TimeUnit.HOURS))
false, true, settingsBuilder.build(), new String[0], .indexSettings(settingsBuilder);
"restore_snapshot[" + leaderClusterRepoName + ":" + leaderIndex + "]");
PlainActionFuture<RestoreInfo> future = PlainActionFuture.newFuture(); PlainActionFuture<RestoreInfo> future = PlainActionFuture.newFuture();
restoreService.restoreSnapshot(restoreRequest, waitForRestore(clusterService, future)); restoreService.restoreSnapshot(restoreRequest, waitForRestore(clusterService, future));