use of org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryResponse in project elasticsearch by elastic.
the class IndicesOptionsIntegrationIT method testSpecifiedIndexUnavailableSnapshotRestore.
public void testSpecifiedIndexUnavailableSnapshotRestore() throws Exception {
createIndex("test1");
ensureGreen("test1");
waitForRelocation();
PutRepositoryResponse putRepositoryResponse = client().admin().cluster().preparePutRepository("dummy-repo").setType("fs").setSettings(Settings.builder().put("location", randomRepoPath())).get();
assertThat(putRepositoryResponse.isAcknowledged(), equalTo(true));
client().admin().cluster().prepareCreateSnapshot("dummy-repo", "snap1").setWaitForCompletion(true).get();
verify(snapshot("snap2", "test1", "test2"), true);
verify(restore("snap1", "test1", "test2"), true);
IndicesOptions options = IndicesOptions.strictExpandOpen();
verify(snapshot("snap2", "test1", "test2").setIndicesOptions(options), true);
verify(restore("snap1", "test1", "test2").setIndicesOptions(options), true);
options = IndicesOptions.lenientExpandOpen();
verify(snapshot("snap2", "test1", "test2").setIndicesOptions(options), false);
verify(restore("snap2", "test1", "test2").setIndicesOptions(options), false);
options = IndicesOptions.strictExpandOpen();
createIndex("test2");
//TODO: temporary work-around for #5531
ensureGreen("test2");
waitForRelocation();
verify(snapshot("snap3", "test1", "test2").setIndicesOptions(options), false);
verify(restore("snap3", "test1", "test2").setIndicesOptions(options), false);
}
Aggregations