Skip to content

Commit

Permalink
Merge pull request #1288 from Graylog2/issue-1264
Browse files Browse the repository at this point in the history
Use synchronous replication for bulk indexing
  • Loading branch information
kroepke committed Jul 7, 2015
2 parents 3bcee89 + 61f091b commit 9bddcb8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ public void move(String source, String target) {
}

request.setConsistencyLevel(WriteConsistencyLevel.ONE);
request.setReplicationType(ReplicationType.ASYNC);

if (request.numberOfActions() > 0) {
BulkResponse response = c.bulk(request.request()).actionGet();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,12 @@ public boolean bulkIndex(final List<Message> messages) {

final BulkRequestBuilder request = c.prepareBulk();
for (Message msg : messages) {
request.add(buildIndexRequest(configuration.getIndexPrefix() + "_" + Deflector.DEFLECTOR_SUFFIX,
request.add(buildIndexRequest(Deflector.buildName(configuration.getIndexPrefix()),
msg.toElasticSearchObject(),
msg.getId())); // Main index.
}

request.setConsistencyLevel(WriteConsistencyLevel.ONE);
request.setReplicationType(ReplicationType.ASYNC);

final BulkResponse response = c.bulk(request.request()).actionGet();

Expand Down

0 comments on commit 9bddcb8

Please sign in to comment.