org.elasticsearch.client.Requests.snapshotsStatusRequest()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(4.9k)|赞(0)|评价(0)|浏览(90)

本文整理了Java中org.elasticsearch.client.Requests.snapshotsStatusRequest方法的一些代码示例,展示了Requests.snapshotsStatusRequest的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Requests.snapshotsStatusRequest方法的具体详情如下:
包路径:org.elasticsearch.client.Requests
类名称:Requests
方法名:snapshotsStatusRequest

Requests.snapshotsStatusRequest介绍

[英]Get status of snapshots
[中]获取快照的状态

代码示例

代码示例来源:origin: org.elasticsearch/elasticsearch

@Override
  public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
    String repository = request.param("repository", "_all");
    String[] snapshots = request.paramAsStringArray("snapshot", Strings.EMPTY_ARRAY);
    if (snapshots.length == 1 && "_all".equalsIgnoreCase(snapshots[0])) {
      snapshots = Strings.EMPTY_ARRAY;
    }
    SnapshotsStatusRequest snapshotsStatusRequest = snapshotsStatusRequest(repository).snapshots(snapshots);
    snapshotsStatusRequest.ignoreUnavailable(request.paramAsBoolean("ignore_unavailable", snapshotsStatusRequest.ignoreUnavailable()));

    snapshotsStatusRequest.masterNodeTimeout(request.paramAsTime("master_timeout", snapshotsStatusRequest.masterNodeTimeout()));
    return channel -> client.admin().cluster().snapshotsStatus(snapshotsStatusRequest, new RestToXContentListener<>(channel));
  }
}

代码示例来源:origin: harbby/presto-connectors

@Override
  public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {
    String repository = request.param("repository", "_all");
    String[] snapshots = request.paramAsStringArray("snapshot", Strings.EMPTY_ARRAY);
    if (snapshots.length == 1 && "_all".equalsIgnoreCase(snapshots[0])) {
      snapshots = Strings.EMPTY_ARRAY;
    }
    SnapshotsStatusRequest snapshotsStatusResponse = snapshotsStatusRequest(repository).snapshots(snapshots);

    snapshotsStatusResponse.masterNodeTimeout(request.paramAsTime("master_timeout", snapshotsStatusResponse.masterNodeTimeout()));
    client.admin().cluster().snapshotsStatus(snapshotsStatusResponse, new RestToXContentListener<SnapshotsStatusResponse>(channel));
  }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

@Override
  public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
    String repository = request.param("repository", "_all");
    String[] snapshots = request.paramAsStringArray("snapshot", Strings.EMPTY_ARRAY);
    if (snapshots.length == 1 && "_all".equalsIgnoreCase(snapshots[0])) {
      snapshots = Strings.EMPTY_ARRAY;
    }
    SnapshotsStatusRequest snapshotsStatusRequest = snapshotsStatusRequest(repository).snapshots(snapshots);
    snapshotsStatusRequest.ignoreUnavailable(request.paramAsBoolean("ignore_unavailable", snapshotsStatusRequest.ignoreUnavailable()));

    snapshotsStatusRequest.masterNodeTimeout(request.paramAsTime("master_timeout", snapshotsStatusRequest.masterNodeTimeout()));
    return channel -> client.admin().cluster().snapshotsStatus(snapshotsStatusRequest, new RestToXContentListener<>(channel));
  }
}

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

@Override
  public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
    String repository = request.param("repository", "_all");
    String[] snapshots = request.paramAsStringArray("snapshot", Strings.EMPTY_ARRAY);
    if (snapshots.length == 1 && "_all".equalsIgnoreCase(snapshots[0])) {
      snapshots = Strings.EMPTY_ARRAY;
    }
    SnapshotsStatusRequest snapshotsStatusRequest = snapshotsStatusRequest(repository).snapshots(snapshots);
    snapshotsStatusRequest.ignoreUnavailable(request.paramAsBoolean("ignore_unavailable", snapshotsStatusRequest.ignoreUnavailable()));

    snapshotsStatusRequest.masterNodeTimeout(request.paramAsTime("master_timeout", snapshotsStatusRequest.masterNodeTimeout()));
    return channel -> client.admin().cluster().snapshotsStatus(snapshotsStatusRequest, new RestToXContentListener<>(channel));
  }
}

代码示例来源:origin: apache/servicemix-bundles

@Override
  public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
    String repository = request.param("repository", "_all");
    String[] snapshots = request.paramAsStringArray("snapshot", Strings.EMPTY_ARRAY);
    if (snapshots.length == 1 && "_all".equalsIgnoreCase(snapshots[0])) {
      snapshots = Strings.EMPTY_ARRAY;
    }
    SnapshotsStatusRequest snapshotsStatusRequest = snapshotsStatusRequest(repository).snapshots(snapshots);
    snapshotsStatusRequest.ignoreUnavailable(request.paramAsBoolean("ignore_unavailable", snapshotsStatusRequest.ignoreUnavailable()));

    snapshotsStatusRequest.masterNodeTimeout(request.paramAsTime("master_timeout", snapshotsStatusRequest.masterNodeTimeout()));
    return channel -> client.admin().cluster().snapshotsStatus(snapshotsStatusRequest, new RestToXContentListener<>(channel));
  }
}

相关文章