本文整理匯總了Java中org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotRequestBuilder類的典型用法代碼示例。如果您正苦於以下問題:Java RestoreSnapshotRequestBuilder類的具體用法?Java RestoreSnapshotRequestBuilder怎麽用?Java RestoreSnapshotRequestBuilder使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
RestoreSnapshotRequestBuilder類屬於org.elasticsearch.action.admin.cluster.snapshots.restore包,在下文中一共展示了RestoreSnapshotRequestBuilder類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getRestoreSnapshotResponse
import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotRequestBuilder; //導入依賴的package包/類
public RestoreSnapshotResponse getRestoreSnapshotResponse(Client esTransportClient, String commaSeparatedIndices,
String restoreRepositoryName, String snapshotN,
String renamePattern, String renameReplacement) {
RestoreSnapshotRequestBuilder restoreSnapshotRequestBuilder;
if (commaSeparatedIndices != null && !commaSeparatedIndices.equalsIgnoreCase(ALL_INDICES_TAG)) {
//This is a blocking call. It'll wait until Restore is finished.
restoreSnapshotRequestBuilder = esTransportClient.admin().cluster().prepareRestoreSnapshot(restoreRepositoryName, snapshotN)
.setWaitForCompletion(true)
.setIndices(commaSeparatedIndices.split(COMMA_SEPARATOR)); //"test-idx-*", "-test-idx-2"
} else {
// Not Setting Indices explicitly -- Seems to be a bug in Elasticsearch
restoreSnapshotRequestBuilder = esTransportClient.admin().cluster().prepareRestoreSnapshot(restoreRepositoryName, snapshotN)
.setWaitForCompletion(true);
}
if ((renamePattern != null && renameReplacement != null) && (!renamePattern.isEmpty() || !renameReplacement.isEmpty())) {
logger.info("Rename Pattern = {}, Rename Replacement = {}", renamePattern, renameReplacement);
restoreSnapshotRequestBuilder.setRenamePattern(renamePattern).setRenameReplacement(renameReplacement);
}
return restoreSnapshotRequestBuilder.execute().actionGet();
}
示例2: assertSuccessfulRestore
import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotRequestBuilder; //導入依賴的package包/類
public static RestoreSnapshotResponse assertSuccessfulRestore(RestoreSnapshotRequestBuilder requestBuilder) {
RestoreSnapshotResponse response = requestBuilder.get();
assertSuccessfulRestore(response);
return response;
}
示例3: prepareRestoreSnapshot
import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotRequestBuilder; //導入依賴的package包/類
@Override
public RestoreSnapshotRequestBuilder prepareRestoreSnapshot(String repository, String snapshot) {
return new RestoreSnapshotRequestBuilder(this, RestoreSnapshotAction.INSTANCE, repository, snapshot);
}
示例4: restore
import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotRequestBuilder; //導入依賴的package包/類
private static RestoreSnapshotRequestBuilder restore(String name, String... indices) {
return client().admin().cluster().prepareRestoreSnapshot("dummy-repo", name)
.setRenamePattern("(.+)").setRenameReplacement("$1-copy-" + name)
.setWaitForCompletion(true)
.setIndices(indices);
}
示例5: prepareRestoreSnapshot
import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotRequestBuilder; //導入依賴的package包/類
/**
* Restores a snapshot.
*/
RestoreSnapshotRequestBuilder prepareRestoreSnapshot(String repository, String snapshot);