|
19 | 19 | package org.elasticsearch.client; |
20 | 20 |
|
21 | 21 | import org.elasticsearch.action.ActionListener; |
22 | | -import org.elasticsearch.client.ml.FlushJobRequest; |
23 | | -import org.elasticsearch.client.ml.FlushJobResponse; |
24 | | -import org.elasticsearch.client.ml.GetJobStatsRequest; |
25 | | -import org.elasticsearch.client.ml.GetJobStatsResponse; |
26 | | -import org.elasticsearch.client.ml.job.stats.JobStats; |
27 | 22 | import org.elasticsearch.client.ml.CloseJobRequest; |
28 | 23 | import org.elasticsearch.client.ml.CloseJobResponse; |
29 | 24 | import org.elasticsearch.client.ml.DeleteJobRequest; |
30 | 25 | import org.elasticsearch.client.ml.DeleteJobResponse; |
| 26 | +import org.elasticsearch.client.ml.FlushJobRequest; |
| 27 | +import org.elasticsearch.client.ml.FlushJobResponse; |
31 | 28 | import org.elasticsearch.client.ml.GetBucketsRequest; |
32 | 29 | import org.elasticsearch.client.ml.GetBucketsResponse; |
| 30 | +import org.elasticsearch.client.ml.GetInfluencersRequest; |
| 31 | +import org.elasticsearch.client.ml.GetInfluencersResponse; |
33 | 32 | import org.elasticsearch.client.ml.GetJobRequest; |
34 | 33 | import org.elasticsearch.client.ml.GetJobResponse; |
| 34 | +import org.elasticsearch.client.ml.GetJobStatsRequest; |
| 35 | +import org.elasticsearch.client.ml.GetJobStatsResponse; |
35 | 36 | import org.elasticsearch.client.ml.GetOverallBucketsRequest; |
36 | 37 | import org.elasticsearch.client.ml.GetOverallBucketsResponse; |
37 | 38 | import org.elasticsearch.client.ml.GetRecordsRequest; |
|
40 | 41 | import org.elasticsearch.client.ml.OpenJobResponse; |
41 | 42 | import org.elasticsearch.client.ml.PutJobRequest; |
42 | 43 | import org.elasticsearch.client.ml.PutJobResponse; |
| 44 | +import org.elasticsearch.client.ml.job.stats.JobStats; |
43 | 45 |
|
44 | 46 | import java.io.IOException; |
45 | 47 | import java.util.Collections; |
@@ -464,4 +466,43 @@ public void getRecordsAsync(GetRecordsRequest request, RequestOptions options, A |
464 | 466 | listener, |
465 | 467 | Collections.emptySet()); |
466 | 468 | } |
| 469 | + |
| 470 | + /** |
| 471 | + * Gets the influencers for a Machine Learning Job. |
| 472 | + * <p> |
| 473 | + * For additional info |
| 474 | + * see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-influencer.html"> |
| 475 | + * ML GET influencers documentation</a> |
| 476 | + * |
| 477 | + * @param request the request |
| 478 | + * @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized |
| 479 | + */ |
| 480 | + public GetInfluencersResponse getInfluencers(GetInfluencersRequest request, RequestOptions options) throws IOException { |
| 481 | + return restHighLevelClient.performRequestAndParseEntity(request, |
| 482 | + MLRequestConverters::getInfluencers, |
| 483 | + options, |
| 484 | + GetInfluencersResponse::fromXContent, |
| 485 | + Collections.emptySet()); |
| 486 | + } |
| 487 | + |
| 488 | + /** |
| 489 | + * Gets the influencers for a Machine Learning Job, notifies listener once the requested influencers are retrieved. |
| 490 | + * <p> |
| 491 | + * For additional info |
| 492 | + * * see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-influencer.html"> |
| 493 | + * ML GET influencers documentation</a> |
| 494 | + * |
| 495 | + * @param request the request |
| 496 | + * @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized |
| 497 | + * @param listener Listener to be notified upon request completion |
| 498 | + */ |
| 499 | + public void getInfluencersAsync(GetInfluencersRequest request, RequestOptions options, |
| 500 | + ActionListener<GetInfluencersResponse> listener) { |
| 501 | + restHighLevelClient.performRequestAsyncAndParseEntity(request, |
| 502 | + MLRequestConverters::getInfluencers, |
| 503 | + options, |
| 504 | + GetInfluencersResponse::fromXContent, |
| 505 | + listener, |
| 506 | + Collections.emptySet()); |
| 507 | + } |
467 | 508 | } |
0 commit comments