Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Commit

Permalink
Merge pull request #134 from FlorianLautenschlager/master
Browse files Browse the repository at this point in the history
Configurable commit for the ingestion pipeline.
  • Loading branch information
Florian Lautenschlager authored May 9, 2017
2 parents b2b2789 + fc6ccb6 commit 90b5d93
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throw
return;
}

boolean commit = Boolean.parseBoolean(req.getParams().get("commit", "true"));

InputStream stream = req.getContentStreams().iterator().next().getStream();

MetricTimeSeriesConverter converter = new MetricTimeSeriesConverter();
Expand All @@ -76,9 +78,13 @@ public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throw
storeDocument(document, processor, req);
}

LOGGER.debug("Committing transaction...");
processor.processCommit(new CommitUpdateCommand(req, false));
LOGGER.debug("Committed transaction");
if (commit) {
LOGGER.debug("Committing transaction...");
processor.processCommit(new CommitUpdateCommand(req, false));
LOGGER.debug("Committed transaction");
} else {
LOGGER.debug("Only adding documents.");
}
} finally {
processor.finish();
}
Expand Down

0 comments on commit 90b5d93

Please sign in to comment.