Package org.apache.solr.update
Class CommitTracker
- java.lang.Object
- 
- 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 SummaryFields Modifier and Type Field Description static intDOC_COMMIT_DELAY_MSstatic intSIZE_COMMIT_DELAY_MS
 - 
Constructor SummaryConstructors Constructor Description CommitTracker(String name, SolrCore core, int docsUpperBound, int timeUpperBound, long tLogFileSizeUpperBound, boolean openSearcher, boolean softCommit)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddedDocument(int commitWithin)Indicate that documents have been addedvoidaddedDocument(int commitWithin, long currentTlogSize)Indicate that documents have been addedvoidcancelPendingCommit()voidclose()voiddeletedDocument(int commitWithin)Indicate that documents have been deletedvoiddidCommit()Inform tracker that a commit has occurredvoiddidRollback()Inform tracker that a rollback has occurred, cancel any pending commitsintgetCommitCount()booleangetOpenSearcher()longgetTimeUpperBound()booleanhasPending()voidrun()This is the worker part for the ScheduledFuture *voidscheduleCommitWithin(long commitMaxTime)schedule individual commitsvoidscheduleMaxSizeTriggeredCommitIfNeeded(long currentTlogSize)If the given current tlog size is greater than the file size upper bound, then schedule a commitvoidsetOpenSearcher(boolean openSearcher)voidsetTimeUpperBound(long timeUpperBound)voidsetTLogFileSizeUpperBound(int sizeUpperBound)StringtoString()
 
- 
- 
- 
Field Detail- 
DOC_COMMIT_DELAY_MSpublic static final int DOC_COMMIT_DELAY_MS - See Also:
- Constant Field Values
 
 - 
SIZE_COMMIT_DELAY_MSpublic static final int SIZE_COMMIT_DELAY_MS - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getOpenSearcherpublic boolean getOpenSearcher() 
 - 
closepublic void close() 
 - 
scheduleCommitWithinpublic void scheduleCommitWithin(long commitMaxTime) schedule individual commits
 - 
cancelPendingCommitpublic void cancelPendingCommit() 
 - 
addedDocumentpublic void addedDocument(int commitWithin) Indicate that documents have been added- Parameters:
- commitWithin- amount of time (in ms) within which a commit should be scheduled
 
 - 
addedDocumentpublic void addedDocument(int commitWithin, long currentTlogSize)Indicate that documents have been added- Parameters:
- commitWithin- amount of time (in ms) within which a commit should be scheduled
- currentTlogSize- current tlog size (in bytes). Use -1 if we don't want to check for a max size triggered commit
 
 - 
deletedDocumentpublic void deletedDocument(int commitWithin) Indicate that documents have been deleted
 - 
scheduleMaxSizeTriggeredCommitIfNeededpublic void scheduleMaxSizeTriggeredCommitIfNeeded(long currentTlogSize) If the given current tlog size is greater than the file size upper bound, then schedule a commit- Parameters:
- currentTlogSize- current tlog size (in bytes)
 
 - 
didCommitpublic void didCommit() Inform tracker that a commit has occurred
 - 
didRollbackpublic void didRollback() Inform tracker that a rollback has occurred, cancel any pending commits
 - 
runpublic void run() This is the worker part for the ScheduledFuture *
 - 
getCommitCountpublic int getCommitCount() 
 - 
getTimeUpperBoundpublic long getTimeUpperBound() 
 - 
setTimeUpperBoundpublic void setTimeUpperBound(long timeUpperBound) 
 - 
setTLogFileSizeUpperBoundpublic void setTLogFileSizeUpperBound(int sizeUpperBound) 
 - 
setOpenSearcherpublic void setOpenSearcher(boolean openSearcher) 
 - 
hasPendingpublic boolean hasPending() 
 
- 
 
-