Java Client Batch API , missing invocation of afterBulk


I am running ElasticSearch V2.1.0 on a single node machine and TransportClient at client side.
The bulk process bulider was set with following parameters:
.setBulkSize(new ByteSizeValue(1, ByteSizeUnit.GB))

The data update process went through correctly except the last bulk API call, whose call back functions were invoked inconsistently, in some occasion no callback (success or failure) was ever returned in 5 minutes.

I understand the last call always has less than 1000 requests, but would that make any difference to the call back? very weird! any clues?




did you close the bulk processor after adding all documents either via:

bulkProcessor.awaitClose(10, TimeUnit.MINUTES);



The bulk processor should then send all remaining documents and perform internal clean up.


1 Like

If I understand correctly and IIRC you have to call close() method when you shutdown your client.

It should flush the remaining items.