本文整理汇总了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);