org.apache.solr.update
Class CommitTracker

java.lang.Object
  extended by org.apache.solr.update.CommitTracker
All Implemented Interfaces:
Runnable

public final class CommitTracker
extends Object
implements Runnable

Helper class for tracking autoCommit state. Note: This is purely an implementation detail of autoCommit and will definitely change in the future, so the interface should not be relied-upon Note: all access must be synchronized. Public for tests.


Field Summary
 int DOC_COMMIT_DELAY_MS
           
protected static org.slf4j.Logger log
           
 
Constructor Summary
CommitTracker(String name, SolrCore core, int docsUpperBound, int timeUpperBound, boolean openSearcher, boolean softCommit)
           
 
Method Summary
 void addedDocument(int commitWithin)
          Indicate that documents have been added
 void cancelPendingCommit()
           
 void close()
           
 void deletedDocument(int commitWithin)
          Indicate that documents have been deleted
 void didCommit()
          Inform tracker that a commit has occurred
 void didRollback()
          Inform tracker that a rollback has occurred, cancel any pending commits
 int getCommitCount()
           
 boolean getOpenSearcher()
           
 long getTimeUpperBound()
           
 void run()
          This is the worker part for the ScheduledFuture
 void scheduleCommitWithin(long commitMaxTime)
          schedule individual commits
 void setTimeUpperBound(long timeUpperBound)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected static final org.slf4j.Logger log

DOC_COMMIT_DELAY_MS

public final int DOC_COMMIT_DELAY_MS
See Also:
Constant Field Values
Constructor Detail

CommitTracker

public CommitTracker(String name,
                     SolrCore core,
                     int docsUpperBound,
                     int timeUpperBound,
                     boolean openSearcher,
                     boolean softCommit)
Method Detail

getOpenSearcher

public boolean getOpenSearcher()

close

public void close()

scheduleCommitWithin

public void scheduleCommitWithin(long commitMaxTime)
schedule individual commits


cancelPendingCommit

public void cancelPendingCommit()

addedDocument

public void addedDocument(int commitWithin)
Indicate that documents have been added


deletedDocument

public void deletedDocument(int commitWithin)
Indicate that documents have been deleted


didCommit

public void didCommit()
Inform tracker that a commit has occurred


didRollback

public void didRollback()
Inform tracker that a rollback has occurred, cancel any pending commits


run

public void run()
This is the worker part for the ScheduledFuture

Specified by:
run in interface Runnable

getCommitCount

public int getCommitCount()

toString

public String toString()
Overrides:
toString in class Object

getTimeUpperBound

public long getTimeUpperBound()

setTimeUpperBound

public void setTimeUpperBound(long timeUpperBound)


Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.