|
34 | 34 | import org.elasticsearch.action.admin.indices.delete.DeleteIndexResponse;
|
35 | 35 | import org.elasticsearch.action.admin.indices.flush.FlushRequest;
|
36 | 36 | import org.elasticsearch.action.admin.indices.flush.FlushResponse;
|
| 37 | +import org.elasticsearch.action.admin.indices.flush.SyncedFlushRequest; |
37 | 38 | import org.elasticsearch.action.admin.indices.forcemerge.ForceMergeRequest;
|
38 | 39 | import org.elasticsearch.action.admin.indices.forcemerge.ForceMergeResponse;
|
39 | 40 | import org.elasticsearch.action.admin.indices.get.GetIndexRequest;
|
@@ -269,6 +270,28 @@ public void flushAsync(FlushRequest flushRequest, ActionListener<FlushResponse>
|
269 | 270 | listener, emptySet(), headers);
|
270 | 271 | }
|
271 | 272 |
|
| 273 | + /** Initiate a synced flush manually using the synced flush API |
| 274 | + * <p> |
| 275 | + * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-synced-flush.html"> |
| 276 | + * Synced flush API on elastic.co</a> |
| 277 | + */ |
| 278 | + public SyncedFlushResponse flushSynced(SyncedFlushRequest syncedFlushRequest, Header... headers) throws IOException { |
| 279 | + return restHighLevelClient.performRequestAndParseEntity(syncedFlushRequest, RequestConverters::flushSynced, |
| 280 | + SyncedFlushResponse::fromXContent, emptySet(), headers); |
| 281 | + } |
| 282 | + |
| 283 | + /** |
| 284 | + * Asynchronously initiate a synced flush manually using the synced flush API |
| 285 | + * <p> |
| 286 | + * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-synced-flush.html"> |
| 287 | + * Synced flush API on elastic.co</a> |
| 288 | + */ |
| 289 | + public void flushSyncedAsync(SyncedFlushRequest syncedFlushRequest, ActionListener<SyncedFlushResponse> listener, Header... headers) { |
| 290 | + restHighLevelClient.performRequestAsyncAndParseEntity(syncedFlushRequest, RequestConverters::flushSynced, |
| 291 | + SyncedFlushResponse::fromXContent, listener, emptySet(), headers); |
| 292 | + } |
| 293 | + |
| 294 | + |
272 | 295 | /**
|
273 | 296 | * Retrieve the settings of one or more indices
|
274 | 297 | * <p>
|
|
0 commit comments