32
32
import org .elasticsearch .client .ml .GetBucketsResponse ;
33
33
import org .elasticsearch .client .ml .GetJobRequest ;
34
34
import org .elasticsearch .client .ml .GetJobResponse ;
35
+ import org .elasticsearch .client .ml .GetOverallBucketsRequest ;
36
+ import org .elasticsearch .client .ml .GetOverallBucketsResponse ;
35
37
import org .elasticsearch .client .ml .GetRecordsRequest ;
36
38
import org .elasticsearch .client .ml .GetRecordsResponse ;
37
39
import org .elasticsearch .client .ml .OpenJobRequest ;
@@ -136,6 +138,47 @@ public void getJobAsync(GetJobRequest request, RequestOptions options, ActionLis
136
138
Collections .emptySet ());
137
139
}
138
140
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
+
139
182
/**
140
183
* Deletes the given Machine Learning Job
141
184
* <p>
@@ -257,42 +300,6 @@ public void closeJobAsync(CloseJobRequest request, RequestOptions options, Actio
257
300
Collections .emptySet ());
258
301
}
259
302
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
-
296
303
/**
297
304
* Flushes internally buffered data for the given Machine Learning Job ensuring all data sent to the has been processed.
298
305
* 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
311
318
* @param request The {@link FlushJobRequest} object enclosing the `jobId` and additional request options
312
319
* @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
313
320
*/
314
- public FlushJobResponse flushJob (FlushJobRequest request , RequestOptions options ) throws IOException {
321
+ public FlushJobResponse flushJob (FlushJobRequest request , RequestOptions options ) throws IOException {
315
322
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
+ }
321
328
322
329
/**
323
330
* 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
338
345
* @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
339
346
* @param listener Listener to be notified upon request completion
340
347
*/
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
+ }
349
356
350
- /**
351
- * Gets usage statistics for one or more Machine Learning jobs
352
- *
357
+ /**
358
+ * Gets the buckets for a Machine Learning Job.
353
359
* <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
358
364
* @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
362
365
*/
363
- public GetJobStatsResponse getJobStats ( GetJobStatsRequest request , RequestOptions options ) throws IOException {
366
+ public GetBucketsResponse getBuckets ( GetBucketsRequest request , RequestOptions options ) throws IOException {
364
367
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 ());
369
372
}
370
373
371
374
/**
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>
373
399
*
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.
374
413
* <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
379
419
* @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
381
421
*/
382
- public void getJobStatsAsync (GetJobStatsRequest request , RequestOptions options , ActionListener <GetJobStatsResponse > listener ) {
422
+ public void getOverallBucketsAsync (GetOverallBucketsRequest request , RequestOptions options ,
423
+ ActionListener <GetOverallBucketsResponse > listener ) {
383
424
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 ());
389
430
}
390
431
391
432
/**
0 commit comments