소스 검색

Docs: add notes about using close and awaitClose with bulk processor

Closes #10839
Igor Motov 10 년 전
부모
커밋
9b76be92b3
1개의 변경된 파일19개의 추가작업 그리고 0개의 파일을 삭제
  1. 19 0
      docs/java-api/bulk.asciidoc

+ 19 - 0
docs/java-api/bulk.asciidoc

@@ -99,3 +99,22 @@ By default, `BulkProcessor`:
 * does not set flushInterval
 * sets concurrentRequests to 1
 
+When all documents are loaded to the `BulkProcessor` it can be closed by using `awaitClose` or `close` methods:
+
+[source,java]
+--------------------------------------------------
+bulkProcessor.awaitClose(10, TimeUnit.MINUTES);
+--------------------------------------------------
+
+or
+
+[source,java]
+--------------------------------------------------
+bulkProcessor.close();
+--------------------------------------------------
+
+Both methods flush any remaining documents and disable all other scheduled flushes if they were scheduled by setting
+`flushInterval`. If concurrent requests were enabled the `awaitClose` method waits for up to the specified timeout for
+all bulk requests to complete then returns `true`, if the specified waiting time elapses before all bulk requests complete,
+`false` is returned. The `close` method doesn't wait for any remaining bulk requests to complete and exists immediately.
+