bulkProcessor never calls afterBulk?


(Scott Chapman) #1

Here's my code example, I get something printed beforeBulk. But never see
anything printed for afterBulk. And yes, a document is getting written.

What am I missing??

BulkProcessor bulkProcessor = ((org.elasticsearch.action.bulk.BulkProcessor)
BulkProcessor).builder(
client,
new BulkProcessor.Listener() {
@Override
public void beforeBulk(long executionId, BulkRequest request) { System.out.
println("BeforeBulk"); }

@Override
public void afterBulk(long executionId, BulkRequest request, Throwable
failure) {
System.out.println("Bulk execution failed ["+ executionId + "].\n" +
failure.toString());
}

@Override
public void afterBulk(long executionId, BulkRequest request, BulkResponse
response) {
System.out.println("Bulk execution completed ["+ executionId + "].\n" +
"Took (ms): " + response.getTookInMillis() + "\n" +
"Failures: " + response.hasFailures() + "\n" +
"Count: " + response.getItems().length);
}
})
.setBulkActions(10000)
.setBulkSize(new ByteSizeValue(1, ByteSizeUnit.GB))
.setFlushInterval(TimeValue.timeValueSeconds(5))
.setConcurrentRequests(1)
.build();

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/5ed933f3-ffe4-4ef4-ba87-1f3ef522aaa4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(David Pilato) #2

Try to remove setBulkSize.
What is the other part of your code?

David

Le 30 avr. 2015 à 00:30, Scott Chapman scottedchapman@gmail.com a écrit :

Here's my code example, I get something printed beforeBulk. But never see anything printed for afterBulk. And yes, a document is getting written.

What am I missing??

BulkProcessor bulkProcessor = ((org.elasticsearch.action.bulk.BulkProcessor) BulkProcessor).builder(
client,
new BulkProcessor.Listener() {
@Override
public void beforeBulk(long executionId, BulkRequest request) { System.out.println("BeforeBulk"); }

@Override
public void afterBulk(long executionId, BulkRequest request, Throwable failure) {
System.out.println("Bulk execution failed ["+ executionId + "].\n" +
failure.toString());
}

@Override
public void afterBulk(long executionId, BulkRequest request, BulkResponse response) {
System.out.println("Bulk execution completed ["+ executionId + "].\n" +
"Took (ms): " + response.getTookInMillis() + "\n" +
"Failures: " + response.hasFailures() + "\n" +
"Count: " + response.getItems().length);
}
})
.setBulkActions(10000)
.setBulkSize(new ByteSizeValue(1, ByteSizeUnit.GB))
.setFlushInterval(TimeValue.timeValueSeconds(5))
.setConcurrentRequests(1)
.build();

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/5ed933f3-ffe4-4ef4-ba87-1f3ef522aaa4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/C2258558-7AD5-40FA-A11F-8570A59C5FAF%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.


(system) #3