23
23
import org .elasticsearch .client .ccr .CcrStatsRequest ;
24
24
import org .elasticsearch .client .ccr .CcrStatsResponse ;
25
25
import org .elasticsearch .client .ccr .DeleteAutoFollowPatternRequest ;
26
+ import org .elasticsearch .client .ccr .FollowStatsRequest ;
27
+ import org .elasticsearch .client .ccr .FollowStatsResponse ;
26
28
import org .elasticsearch .client .ccr .GetAutoFollowPatternRequest ;
27
29
import org .elasticsearch .client .ccr .GetAutoFollowPatternResponse ;
28
30
import org .elasticsearch .client .ccr .PauseFollowRequest ;
@@ -385,7 +387,7 @@ public CcrStatsResponse getCcrStats(CcrStatsRequest request,
385
387
}
386
388
387
389
/**
388
- * Gets all CCR stats.
390
+ * Asynchronously gets all CCR stats.
389
391
*
390
392
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-stats.html">
391
393
* the docs</a> for more.
@@ -406,4 +408,48 @@ public void getCcrStatsAsync(CcrStatsRequest request,
406
408
);
407
409
}
408
410
411
+ /**
412
+ * Gets follow stats for specific indices.
413
+ *
414
+ * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html">
415
+ * the docs</a> for more.
416
+ *
417
+ * @param request the request
418
+ * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
419
+ * @return the response
420
+ * @throws IOException in case there is a problem sending the request or parsing back the response
421
+ */
422
+ public FollowStatsResponse getFollowStats (FollowStatsRequest request ,
423
+ RequestOptions options ) throws IOException {
424
+ return restHighLevelClient .performRequestAndParseEntity (
425
+ request ,
426
+ CcrRequestConverters ::getFollowStats ,
427
+ options ,
428
+ FollowStatsResponse ::fromXContent ,
429
+ Collections .emptySet ()
430
+ );
431
+ }
432
+
433
+ /**
434
+ * Asynchronously gets follow stats for specific indices.
435
+ *
436
+ * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html">
437
+ * the docs</a> for more.
438
+ *
439
+ * @param request the request
440
+ * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
441
+ */
442
+ public void getFollowStatsAsync (FollowStatsRequest request ,
443
+ RequestOptions options ,
444
+ ActionListener <FollowStatsResponse > listener ) {
445
+ restHighLevelClient .performRequestAsyncAndParseEntity (
446
+ request ,
447
+ CcrRequestConverters ::getFollowStats ,
448
+ options ,
449
+ FollowStatsResponse ::fromXContent ,
450
+ listener ,
451
+ Collections .emptySet ()
452
+ );
453
+ }
454
+
409
455
}
0 commit comments