[
https://issues.apache.org/jira/browse/SOLR-793?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ryan McKinley updated SOLR-793:
-------------------------------
Attachment: SOLR-793-commitWithin.patch
Here is a patch that adds the functionality to the AddUpdateCommand. It is
only supported in DirectUpdateHandler2.
The only bits I'm not sure about are the thread synchronization issues in
CommitTracker
{code:java}
public void addedDocument( int commitWithin ) {
docsSinceCommit++;
lastAddedTime = System.currentTimeMillis();
// maxDocs-triggered autoCommit
if( docsUpperBound > 0 && (docsSinceCommit > docsUpperBound) ) {
scheduleCommitWithin( DOC_COMMIT_DELAY_MS );
}
// maxTime-triggered autoCommit
long ctime = timeUpperBound;
if( commitWithin > 0 && (ctime < 0 || commitWithin < ctime) ) {
ctime = commitWithin;
}
if( ctime > 0 ) {
scheduleCommitWithin( ctime );
}
}
{code}
previously, the code to schedule a commit was inline -- now this delegates to a
synchronized method. I don't think it is an issue (and tests pass), but I want
to make sure that gets double checked ;)
------
Also, any better ideas on what the parameter/argument should be called?
> set a commit time bounds in the <add> command
> ---------------------------------------------
>
> Key: SOLR-793
> URL: https://issues.apache.org/jira/browse/SOLR-793
> Project: Solr
> Issue Type: Improvement
> Components: update
> Reporter: Ryan McKinley
> Priority: Minor
> Attachments: SOLR-793-commitWithin.patch
>
>
> Currently there are two options for how to handle commiting documents:
> 1. the client explicitly starts the commit via <commit/>
> 2. set an auto commit value on the server -- clients can assume all documents
> will be commited within that time.
> However, this does not help in the case where the clients know what documents
> need updating quickly and others that could wait. I suggest adding:
> {code:xml}
> <add commitWithin="100">...
> {/code:xml}
> to the update syntax so the client can schedule commits explicitly.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.