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

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

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

RestHighLevelClient.performRequestAsyncAndParseEntity介绍

暂无

代码示例

代码示例来源:origin: org.elasticsearch.client/elasticsearch-rest-high-level-client

/**
 * Asynchronously creates a snapshot.
 * <p>
 * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html"> Snapshot and Restore
 * API on elastic.co</a>
 */
public void createAsync(CreateSnapshotRequest createSnapshotRequest, RequestOptions options,
                ActionListener<CreateSnapshotResponse> listener) {
  restHighLevelClient.performRequestAsyncAndParseEntity(createSnapshotRequest, SnapshotRequestConverters::createSnapshot, options,
    CreateSnapshotResponse::fromXContent, listener, emptySet());
}

代码示例来源:origin: org.elasticsearch.client/elasticsearch-rest-high-level-client

/**
 * Asynchronously deletes license from the cluster.
 * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
 * @param listener the listener to be notified upon request completion
 */
public void deleteLicenseAsync(DeleteLicenseRequest request, RequestOptions options, ActionListener<AcknowledgedResponse> listener) {
  restHighLevelClient.performRequestAsyncAndParseEntity(request, LicenseRequestConverters::deleteLicense, options,
    AcknowledgedResponse::fromXContent, listener, emptySet());
}

代码示例来源:origin: org.elasticsearch.client/elasticsearch-rest-high-level-client

/**
 * Removes role from the native realm.
 * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role.html">
 * the docs</a> for more.
 * @param request the request with the role to delete
 * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
 * @param listener the listener to be notified upon request completion
 */
public void deleteRoleAsync(DeleteRoleRequest request, RequestOptions options, ActionListener<DeleteRoleResponse> listener) {
  restHighLevelClient.performRequestAsyncAndParseEntity(request, SecurityRequestConverters::deleteRole, options,
    DeleteRoleResponse::fromXContent, listener, singleton(404));
}

代码示例来源:origin: org.elasticsearch.client/elasticsearch-rest-high-level-client

/**
 * Asynchronously opens an index using the Open Index API.
 * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-open-close.html">
 * Open Index API on elastic.co</a>
 * @param openIndexRequest the request
 * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
 * @param listener the listener to be notified upon request completion
 */
public void openAsync(OpenIndexRequest openIndexRequest, RequestOptions options, ActionListener<OpenIndexResponse> listener) {
  restHighLevelClient.performRequestAsyncAndParseEntity(openIndexRequest, IndicesRequestConverters::openIndex, options,
      OpenIndexResponse::fromXContent, listener, emptySet());
}

代码示例来源:origin: org.elasticsearch.client/elasticsearch-rest-high-level-client

/**
 * Asynchronously force merge one or more indices using the Force Merge API.
 * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-forcemerge.html">
 * Force Merge API on elastic.co</a>
 * @param forceMergeRequest the request
 * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
 * @param listener the listener to be notified upon request completion
 */
public void forcemergeAsync(ForceMergeRequest forceMergeRequest, RequestOptions options, ActionListener<ForceMergeResponse> listener) {
  restHighLevelClient.performRequestAsyncAndParseEntity(forceMergeRequest, IndicesRequestConverters::forceMerge, options,
      ForceMergeResponse::fromXContent, listener, emptySet());
}

代码示例来源:origin: org.elasticsearch.client/elasticsearch-rest-high-level-client

/**
 * Asynchronously start the watch service
 * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-start.html">
 * the docs</a> for more.
 * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
 */
public void startWatchServiceAsync(StartWatchServiceRequest request, RequestOptions options,
    ActionListener<AcknowledgedResponse> listener) {
  restHighLevelClient.performRequestAsyncAndParseEntity(
      request, WatcherRequestConverters::startWatchService, options, AcknowledgedResponse::fromXContent, listener, emptySet());
}

代码示例来源:origin: org.elasticsearch.client/elasticsearch-rest-high-level-client

/**
 * Asynchronously deletes a watch from the cluster
 * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html">
 * the docs</a> for more.
 * @param request the request
 * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
 * @param listener the listener to be notified upon request completion
 */
public void deleteWatchAsync(DeleteWatchRequest request, RequestOptions options, ActionListener<DeleteWatchResponse> listener) {
  restHighLevelClient.performRequestAsyncAndParseEntity(request, WatcherRequestConverters::deleteWatch, options,
    DeleteWatchResponse::fromXContent, listener, singleton(404));
}

代码示例来源:origin: org.elasticsearch.client/elasticsearch-rest-high-level-client

/**
 * Asynchronously retrieves a document by id using the Get API.
 * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html">Get API on elastic.co</a>
 * @param getRequest the request
 * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
 * @param listener the listener to be notified upon request completion
 */
public final void getAsync(GetRequest getRequest, RequestOptions options, ActionListener<GetResponse> listener) {
  performRequestAsyncAndParseEntity(getRequest, RequestConverters::get, options, GetResponse::fromXContent, listener,
      singleton(404));
}

代码示例来源:origin: org.elasticsearch.client/elasticsearch-rest-high-level-client

/**
 * Asynchronously updates a document using the Update API.
 * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html">Update API on elastic.co</a>
 * @param updateRequest the request
 * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
 * @param listener the listener to be notified upon request completion
 */
public final void updateAsync(UpdateRequest updateRequest, RequestOptions options, ActionListener<UpdateResponse> listener) {
  performRequestAsyncAndParseEntity(updateRequest, RequestConverters::update, options, UpdateResponse::fromXContent, listener,
      emptySet());
}

代码示例来源:origin: org.elasticsearch.client/elasticsearch-rest-high-level-client

/**
 * Asynchronously executes a request using the Ranking Evaluation API.
 * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/search-rank-eval.html">Ranking Evaluation API
 * on elastic.co</a>
 * @param rankEvalRequest the request
 * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
 * @param listener the listener to be notified upon request completion
 */
public final void rankEvalAsync(RankEvalRequest rankEvalRequest, RequestOptions options,  ActionListener<RankEvalResponse> listener) {
  performRequestAsyncAndParseEntity(rankEvalRequest, RequestConverters::rankEval, options,  RankEvalResponse::fromXContent, listener,
      emptySet());
}

代码示例来源:origin: org.elasticsearch.client/elasticsearch-rest-high-level-client

/**
 * Asynchronously executes an exploration request using the Graph API.
 *
 * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/graph-explore-api.html">Graph API
 * on elastic.co</a>.
 */
public final void exploreAsync(GraphExploreRequest graphExploreRequest,
                    RequestOptions options,
                    ActionListener<GraphExploreResponse> listener) {
  restHighLevelClient.performRequestAsyncAndParseEntity(graphExploreRequest, GraphRequestConverters::explore,
    options, GraphExploreResponse::fromXContent, listener, emptySet());
}

代码示例来源:origin: org.elasticsearch.client/elasticsearch-rest-high-level-client

/**
 * Asynchronously retrieve the set of effective privileges held by the current user.
 * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
 * @param listener the listener to be notified upon request completion
 */
public void getUserPrivilegesAsync(RequestOptions options, ActionListener<GetUserPrivilegesResponse> listener) {
  restHighLevelClient.performRequestAsyncAndParseEntity(GetUserPrivilegesRequest.INSTANCE, GetUserPrivilegesRequest::getRequest,
    options, GetUserPrivilegesResponse::fromXContent, listener, emptySet());
}

代码示例来源:origin: org.elasticsearch.client/elasticsearch-rest-high-level-client

/**
 * Asynchronously closes an index using the Close Index API.
 * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-open-close.html">
 * Close Index API on elastic.co</a>
 * @param closeIndexRequest the request
 * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
 * @param listener the listener to be notified upon request completion
 */
public void closeAsync(CloseIndexRequest closeIndexRequest, RequestOptions options, ActionListener<AcknowledgedResponse> listener) {
  restHighLevelClient.performRequestAsyncAndParseEntity(closeIndexRequest, IndicesRequestConverters::closeIndex, options,
    AcknowledgedResponse::fromXContent, listener, emptySet());
}

代码示例来源:origin: org.elasticsearch.client/elasticsearch-rest-high-level-client

/**
 * Asynchronously splits an index using the Split Index API.
 * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-split-index.html">
 * Split Index API on elastic.co</a>
 * @param resizeRequest the request
 * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
 * @param listener the listener to be notified upon request completion
 */
public void splitAsync(ResizeRequest resizeRequest, RequestOptions options, ActionListener<ResizeResponse> listener) {
  restHighLevelClient.performRequestAsyncAndParseEntity(resizeRequest, IndicesRequestConverters::split, options,
      ResizeResponse::fromXContent, listener, emptySet());
}

代码示例来源:origin: org.elasticsearch.client/elasticsearch-rest-high-level-client

/**
 * Asynchronously retrieves a document by id using the Get API.
 *
 * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html">Get API on elastic.co</a>
 * @deprecated Prefer {@link #getAsync(GetRequest, RequestOptions, ActionListener)}
 */
@Deprecated
public final void getAsync(GetRequest getRequest, ActionListener<GetResponse> listener, Header... headers) {
  performRequestAsyncAndParseEntity(getRequest, RequestConverters::get, GetResponse::fromXContent, listener,
      singleton(404), headers);
}

代码示例来源:origin: org.elasticsearch.client/elasticsearch-rest-high-level-client

/**
 * Asynchronously executes a bulk request using the Bulk API.
 *
 * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html">Bulk API on elastic.co</a>
 * @deprecated Prefer {@link #bulkAsync(BulkRequest, RequestOptions, ActionListener)}
 */
@Deprecated
public final void bulkAsync(BulkRequest bulkRequest, ActionListener<BulkResponse> listener, Header... headers) {
  performRequestAsyncAndParseEntity(bulkRequest, RequestConverters::bulk, BulkResponse::fromXContent, listener, emptySet(), headers);
}

代码示例来源:origin: org.elasticsearch.client/elasticsearch-rest-high-level-client

/**
 * Asynchronously deletes an index using the Delete Index API.
 * <p>
 * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-delete-index.html">
 * Delete Index API on elastic.co</a>
 * @deprecated Prefer {@link #deleteAsync(DeleteIndexRequest, RequestOptions, ActionListener)}
 */
@Deprecated
public void deleteAsync(DeleteIndexRequest deleteIndexRequest, ActionListener<AcknowledgedResponse> listener, Header... headers) {
  restHighLevelClient.performRequestAsyncAndParseEntity(deleteIndexRequest, IndicesRequestConverters::deleteIndex,
      AcknowledgedResponse::fromXContent, listener, emptySet(), headers);
}

代码示例来源:origin: org.elasticsearch.client/elasticsearch-rest-high-level-client

/**
 * Asynchronously flush one or more indices using the Flush API.
 * <p>
 * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-flush.html"> Flush API on elastic.co</a>
 * @deprecated Prefer {@link #flushAsync(FlushRequest, RequestOptions, ActionListener)}
 */
@Deprecated
public void flushAsync(FlushRequest flushRequest, ActionListener<FlushResponse> listener, Header... headers) {
  restHighLevelClient.performRequestAsyncAndParseEntity(flushRequest, IndicesRequestConverters::flush, FlushResponse::fromXContent,
      listener, emptySet(), headers);
}

代码示例来源:origin: org.elasticsearch.client/elasticsearch-rest-high-level-client

/**
 * Asynchronously splits an index using the Split Index API.
 * <p>
 * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-split-index.html">
 * Split Index API on elastic.co</a>
 * @deprecated Prefer {@link #splitAsync(ResizeRequest, RequestOptions, ActionListener)}
 */
@Deprecated
public void splitAsync(ResizeRequest resizeRequest, ActionListener<ResizeResponse> listener, Header... headers) {
  restHighLevelClient.performRequestAsyncAndParseEntity(resizeRequest, IndicesRequestConverters::split, ResizeResponse::fromXContent,
      listener, emptySet(), headers);
}

代码示例来源:origin: org.elasticsearch.client/elasticsearch-rest-high-level-client

/**
 * Asynchronously gets one or more aliases using the Get Index Aliases API.
 * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html"> Indices Aliases API on
 * elastic.co</a>
 * @param getAliasesRequest the request
 * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
 * @param listener the listener to be notified upon request completion
 */
public void getAliasAsync(GetAliasesRequest getAliasesRequest, RequestOptions options, ActionListener<GetAliasesResponse> listener) {
  restHighLevelClient.performRequestAsyncAndParseEntity(getAliasesRequest, IndicesRequestConverters::getAlias, options,
      GetAliasesResponse::fromXContent, listener, singleton(RestStatus.NOT_FOUND.getStatus()));
}

相关文章