当前位置: 首页>>代码示例>>Java>>正文


Java RestoreSnapshotRequestBuilder类代码示例

本文整理汇总了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();
}
 
开发者ID:Netflix,项目名称:Raigad,代码行数:24,代码来源:RestoreBackupManager.java

示例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;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:6,代码来源:ESBlobStoreRepositoryIntegTestCase.java

示例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);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:AbstractClient.java

示例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);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:7,代码来源:IndicesOptionsIntegrationIT.java

示例5: prepareRestoreSnapshot

import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotRequestBuilder; //导入依赖的package包/类
/**
 * Restores a snapshot.
 */
RestoreSnapshotRequestBuilder prepareRestoreSnapshot(String repository, String snapshot);
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:ClusterAdminClient.java


注:本文中的org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotRequestBuilder类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。