Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
client = TransportClient.builder().build()
.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("192.168.10.15"), 9300));
bulkProcessor = BulkProcessor.builder(
client,
new BulkProcessor.Listener() {
@Override
public void afterBulk(long arg0, BulkRequest arg1,
BulkResponse arg2) {
// TODO Auto-generated method stub
System.out.println("Finished bulk response");
}
@Override
public void afterBulk(long arg0, BulkRequest arg1,
Throwable failure) {
// TODO Auto-generated method stub
System.out.println("Failed to finish bulk response");
failure.printStackTrace();
}
@Override
public void beforeBulk(long arg0, BulkRequest arg1) {
// TODO Auto-generated method stub
System.out.println("Starting bulk response");
}
})
.setBulkActions(10000)
.setBulkSize(new ByteSizeValue(1, ByteSizeUnit.GB))
.setFlushInterval(TimeValue.timeValueSeconds(5))
.setConcurrentRequests(3)
.build();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment