Java Client Batch API , missing invocation of afterBulk

Hi,

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:
.setBulkActions(1000)
.setBulkSize(new ByteSizeValue(1, ByteSizeUnit.GB))
.setFlushInterval(TimeValue.timeValueSeconds(5))
.setConcurrentRequests(1)
.build();

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?

Thanks,

Landong

Hi,

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

bulkProcessor.awaitClose(10, TimeUnit.MINUTES);

or

bulkProcessor.close();

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

Daniel

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.