in flink-taxi-stream-processor/src/main/java/com/amazonaws/flink/refarch/utils/ElasticsearchJestSink.java [78:88]
public void invoke(T document) {
documentBuffer.add(new Index.Builder(document.toString()).index(indexName).type(documentType).build());
if (documentBuffer.size() >= batchSize || System.currentTimeMillis() - lastBufferFlush >= maxBufferTime) {
try {
flushDocumentBuffer();
} catch (IOException e) {
//if the request fails, that's fine, just retry on the next invocation
}
}
}