當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。