public final class CommitTracker extends Object implements Runnable
Modifier and Type | Field and Description |
---|---|
static int |
DOC_COMMIT_DELAY_MS |
static int |
SIZE_COMMIT_DELAY_MS |
Constructor and Description |
---|
CommitTracker(String name,
SolrCore core,
int docsUpperBound,
int timeUpperBound,
long tLogFileSizeUpperBound,
boolean openSearcher,
boolean softCommit) |
Modifier and Type | Method and Description |
---|---|
void |
addedDocument(int commitWithin)
Indicate that documents have been added
|
void |
addedDocument(int commitWithin,
long currentTlogSize)
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() |
boolean |
hasPending() |
void |
run()
This is the worker part for the ScheduledFuture
|
void |
scheduleCommitWithin(long commitMaxTime)
schedule individual commits
|
void |
scheduleMaxSizeTriggeredCommitIfNeeded(long currentTlogSize)
If the given current tlog size is greater than the file size upper bound, then schedule a commit
|
void |
setOpenSearcher(boolean openSearcher) |
void |
setTimeUpperBound(long timeUpperBound) |
void |
setTLogFileSizeUpperBound(int sizeUpperBound) |
String |
toString() |
public static final int DOC_COMMIT_DELAY_MS
public static final int SIZE_COMMIT_DELAY_MS
public boolean getOpenSearcher()
public void close()
public void scheduleCommitWithin(long commitMaxTime)
public void cancelPendingCommit()
public void addedDocument(int commitWithin)
commitWithin
- amount of time (in ms) within which a commit should be scheduledpublic void addedDocument(int commitWithin, long currentTlogSize)
commitWithin
- amount of time (in ms) within which a commit should be scheduledcurrentTlogSize
- current tlog size (in bytes). Use -1 if we don't want to check for a max size triggered commitpublic void deletedDocument(int commitWithin)
public void scheduleMaxSizeTriggeredCommitIfNeeded(long currentTlogSize)
currentTlogSize
- current tlog size (in bytes)public void didCommit()
public void didRollback()
public void run()
public int getCommitCount()
public long getTimeUpperBound()
public void setTimeUpperBound(long timeUpperBound)
public void setTLogFileSizeUpperBound(int sizeUpperBound)
public void setOpenSearcher(boolean openSearcher)
public boolean hasPending()
Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.