3232import org .elasticsearch .client .ml .GetBucketsResponse ;
3333import org .elasticsearch .client .ml .GetJobRequest ;
3434import org .elasticsearch .client .ml .GetJobResponse ;
35+ import org .elasticsearch .client .ml .GetOverallBucketsRequest ;
36+ import org .elasticsearch .client .ml .GetOverallBucketsResponse ;
3537import org .elasticsearch .client .ml .GetRecordsRequest ;
3638import org .elasticsearch .client .ml .GetRecordsResponse ;
3739import org .elasticsearch .client .ml .OpenJobRequest ;
@@ -136,6 +138,47 @@ public void getJobAsync(GetJobRequest request, RequestOptions options, ActionLis
136138 Collections .emptySet ());
137139 }
138140
141+ /**
142+ * Gets usage statistics for one or more Machine Learning jobs
143+ *
144+ * <p>
145+ * For additional info
146+ * see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html">Get Job stats docs</a>
147+ * </p>
148+ * @param request {@link GetJobStatsRequest} Request containing a list of jobId(s) and additional options
149+ * @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
150+ * @return {@link GetJobStatsResponse} response object containing
151+ * the {@link JobStats} objects and the number of jobs found
152+ * @throws IOException when there is a serialization issue sending the request or receiving the response
153+ */
154+ public GetJobStatsResponse getJobStats (GetJobStatsRequest request , RequestOptions options ) throws IOException {
155+ return restHighLevelClient .performRequestAndParseEntity (request ,
156+ MLRequestConverters ::getJobStats ,
157+ options ,
158+ GetJobStatsResponse ::fromXContent ,
159+ Collections .emptySet ());
160+ }
161+
162+ /**
163+ * Gets one or more Machine Learning job configuration info, asynchronously.
164+ *
165+ * <p>
166+ * For additional info
167+ * see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html">Get Job stats docs</a>
168+ * </p>
169+ * @param request {@link GetJobStatsRequest} Request containing a list of jobId(s) and additional options
170+ * @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
171+ * @param listener Listener to be notified with {@link GetJobStatsResponse} upon request completion
172+ */
173+ public void getJobStatsAsync (GetJobStatsRequest request , RequestOptions options , ActionListener <GetJobStatsResponse > listener ) {
174+ restHighLevelClient .performRequestAsyncAndParseEntity (request ,
175+ MLRequestConverters ::getJobStats ,
176+ options ,
177+ GetJobStatsResponse ::fromXContent ,
178+ listener ,
179+ Collections .emptySet ());
180+ }
181+
139182 /**
140183 * Deletes the given Machine Learning Job
141184 * <p>
@@ -257,42 +300,6 @@ public void closeJobAsync(CloseJobRequest request, RequestOptions options, Actio
257300 Collections .emptySet ());
258301 }
259302
260- /**
261- * Gets the buckets for a Machine Learning Job.
262- * <p>
263- * For additional info
264- * see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html">ML GET buckets documentation</a>
265- *
266- * @param request The request
267- * @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
268- */
269- public GetBucketsResponse getBuckets (GetBucketsRequest request , RequestOptions options ) throws IOException {
270- return restHighLevelClient .performRequestAndParseEntity (request ,
271- MLRequestConverters ::getBuckets ,
272- options ,
273- GetBucketsResponse ::fromXContent ,
274- Collections .emptySet ());
275- }
276-
277- /**
278- * Gets the buckets for a Machine Learning Job, notifies listener once the requested buckets are retrieved.
279- * <p>
280- * For additional info
281- * see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html">ML GET buckets documentation</a>
282- *
283- * @param request The request
284- * @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
285- * @param listener Listener to be notified upon request completion
286- */
287- public void getBucketsAsync (GetBucketsRequest request , RequestOptions options , ActionListener <GetBucketsResponse > listener ) {
288- restHighLevelClient .performRequestAsyncAndParseEntity (request ,
289- MLRequestConverters ::getBuckets ,
290- options ,
291- GetBucketsResponse ::fromXContent ,
292- listener ,
293- Collections .emptySet ());
294- }
295-
296303 /**
297304 * Flushes internally buffered data for the given Machine Learning Job ensuring all data sent to the has been processed.
298305 * This may cause new results to be calculated depending on the contents of the buffer
@@ -311,13 +318,13 @@ public void getBucketsAsync(GetBucketsRequest request, RequestOptions options, A
311318 * @param request The {@link FlushJobRequest} object enclosing the `jobId` and additional request options
312319 * @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
313320 */
314- public FlushJobResponse flushJob (FlushJobRequest request , RequestOptions options ) throws IOException {
321+ public FlushJobResponse flushJob (FlushJobRequest request , RequestOptions options ) throws IOException {
315322 return restHighLevelClient .performRequestAndParseEntity (request ,
316- MLRequestConverters ::flushJob ,
317- options ,
318- FlushJobResponse ::fromXContent ,
319- Collections .emptySet ());
320- }
323+ MLRequestConverters ::flushJob ,
324+ options ,
325+ FlushJobResponse ::fromXContent ,
326+ Collections .emptySet ());
327+ }
321328
322329 /**
323330 * Flushes internally buffered data for the given Machine Learning Job asynchronously ensuring all data sent to the has been processed.
@@ -338,54 +345,88 @@ public FlushJobResponse flushJob(FlushJobRequest request, RequestOptions options
338345 * @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
339346 * @param listener Listener to be notified upon request completion
340347 */
341- public void flushJobAsync (FlushJobRequest request , RequestOptions options , ActionListener <FlushJobResponse > listener ) {
342- restHighLevelClient .performRequestAsyncAndParseEntity (request ,
343- MLRequestConverters ::flushJob ,
344- options ,
345- FlushJobResponse ::fromXContent ,
346- listener ,
347- Collections .emptySet ());
348- }
348+ public void flushJobAsync (FlushJobRequest request , RequestOptions options , ActionListener <FlushJobResponse > listener ) {
349+ restHighLevelClient .performRequestAsyncAndParseEntity (request ,
350+ MLRequestConverters ::flushJob ,
351+ options ,
352+ FlushJobResponse ::fromXContent ,
353+ listener ,
354+ Collections .emptySet ());
355+ }
349356
350- /**
351- * Gets usage statistics for one or more Machine Learning jobs
352- *
357+ /**
358+ * Gets the buckets for a Machine Learning Job.
353359 * <p>
354- * For additional info
355- * see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats .html">Get Job stats docs </a>
356- * </p>
357- * @param request {@link GetJobStatsRequest} Request containing a list of jobId(s) and additional options
360+ * For additional info
361+ * see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket .html">ML GET buckets documentation </a>
362+ *
363+ * @param request The request
358364 * @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
359- * @return {@link GetJobStatsResponse} response object containing
360- * the {@link JobStats} objects and the number of jobs found
361- * @throws IOException when there is a serialization issue sending the request or receiving the response
362365 */
363- public GetJobStatsResponse getJobStats ( GetJobStatsRequest request , RequestOptions options ) throws IOException {
366+ public GetBucketsResponse getBuckets ( GetBucketsRequest request , RequestOptions options ) throws IOException {
364367 return restHighLevelClient .performRequestAndParseEntity (request ,
365- MLRequestConverters ::getJobStats ,
366- options ,
367- GetJobStatsResponse ::fromXContent ,
368- Collections .emptySet ());
368+ MLRequestConverters ::getBuckets ,
369+ options ,
370+ GetBucketsResponse ::fromXContent ,
371+ Collections .emptySet ());
369372 }
370373
371374 /**
372- * Gets one or more Machine Learning job configuration info, asynchronously.
375+ * Gets the buckets for a Machine Learning Job, notifies listener once the requested buckets are retrieved.
376+ * <p>
377+ * For additional info
378+ * see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html">ML GET buckets documentation</a>
379+ *
380+ * @param request The request
381+ * @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
382+ * @param listener Listener to be notified upon request completion
383+ */
384+ public void getBucketsAsync (GetBucketsRequest request , RequestOptions options , ActionListener <GetBucketsResponse > listener ) {
385+ restHighLevelClient .performRequestAsyncAndParseEntity (request ,
386+ MLRequestConverters ::getBuckets ,
387+ options ,
388+ GetBucketsResponse ::fromXContent ,
389+ listener ,
390+ Collections .emptySet ());
391+ }
392+
393+ /**
394+ * Gets overall buckets for a set of Machine Learning Jobs.
395+ * <p>
396+ * For additional info
397+ * see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-overall-buckets.html">
398+ * ML GET overall buckets documentation</a>
373399 *
400+ * @param request The request
401+ * @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
402+ */
403+ public GetOverallBucketsResponse getOverallBuckets (GetOverallBucketsRequest request , RequestOptions options ) throws IOException {
404+ return restHighLevelClient .performRequestAndParseEntity (request ,
405+ MLRequestConverters ::getOverallBuckets ,
406+ options ,
407+ GetOverallBucketsResponse ::fromXContent ,
408+ Collections .emptySet ());
409+ }
410+
411+ /**
412+ * Gets overall buckets for a set of Machine Learning Jobs, notifies listener once the requested buckets are retrieved.
374413 * <p>
375- * For additional info
376- * see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html">Get Job stats docs</a>
377- * </p>
378- * @param request {@link GetJobStatsRequest} Request containing a list of jobId(s) and additional options
414+ * For additional info
415+ * see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-overall-buckets.html">
416+ * ML GET overall buckets documentation</a>
417+ *
418+ * @param request The request
379419 * @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
380- * @param listener Listener to be notified with {@link GetJobStatsResponse} upon request completion
420+ * @param listener Listener to be notified upon request completion
381421 */
382- public void getJobStatsAsync (GetJobStatsRequest request , RequestOptions options , ActionListener <GetJobStatsResponse > listener ) {
422+ public void getOverallBucketsAsync (GetOverallBucketsRequest request , RequestOptions options ,
423+ ActionListener <GetOverallBucketsResponse > listener ) {
383424 restHighLevelClient .performRequestAsyncAndParseEntity (request ,
384- MLRequestConverters ::getJobStats ,
385- options ,
386- GetJobStatsResponse ::fromXContent ,
387- listener ,
388- Collections .emptySet ());
425+ MLRequestConverters ::getOverallBuckets ,
426+ options ,
427+ GetOverallBucketsResponse ::fromXContent ,
428+ listener ,
429+ Collections .emptySet ());
389430 }
390431
391432 /**
0 commit comments