public class UpdateLog extends Object implements PluginInfoInitialized
Modifier and Type | Class and Description |
---|---|
class |
UpdateLog.DBQ |
static class |
UpdateLog.LogPtr |
class |
UpdateLog.RecentUpdates |
static class |
UpdateLog.RecoveryInfo |
static class |
UpdateLog.State |
static class |
UpdateLog.SyncLevel |
Constructor and Description |
---|
UpdateLog() |
Modifier and Type | Method and Description |
---|---|
void |
add(AddUpdateCommand cmd) |
void |
add(AddUpdateCommand cmd,
boolean clearCaches) |
protected void |
addOldLog(TransactionLog oldLog,
boolean removeOld) |
Future<UpdateLog.RecoveryInfo> |
applyBufferedUpdates()
Returns the Future to wait on, or null if no replay was needed
|
void |
bufferUpdates() |
void |
cancelApplyBufferedUpdates() |
void |
clearLog(SolrCore core,
PluginInfo ulogPluginInfo)
Clears the logs on the file system.
|
void |
close(boolean committed) |
void |
close(boolean committed,
boolean deleteOnClose) |
void |
delete(DeleteUpdateCommand cmd) |
void |
deleteAll()
currently for testing only
|
void |
deleteByQuery(DeleteUpdateCommand cmd) |
static void |
deleteFile(File file) |
boolean |
dropBufferedUpdates()
Returns true if we were able to drop buffered updates and return to the ACTIVE state
|
protected void |
ensureLog() |
void |
finish(UpdateLog.SyncLevel syncLevel) |
List<UpdateLog.DBQ> |
getDBQNewer(long version) |
org.apache.hadoop.fs.FileSystem |
getFs() |
long |
getLastLogId() |
String |
getLogDir() |
String[] |
getLogList(File directory) |
UpdateLog.RecentUpdates |
getRecentUpdates()
The RecentUpdates object returned must be closed after use
|
int |
getStartingOperation() |
List<Long> |
getStartingVersions() |
UpdateLog.State |
getState() |
protected String |
getTlogDir(SolrCore core,
PluginInfo info) |
long |
getTotalLogsNumber() |
long |
getTotalLogsSize() |
VersionInfo |
getVersionInfo() |
boolean |
hasUncommittedChanges() |
void |
init(PluginInfo info) |
void |
init(UpdateHandler uhandler,
SolrCore core) |
Object |
lookup(BytesRef indexedId) |
Long |
lookupVersion(BytesRef indexedId) |
protected void |
newMap() |
void |
postCommit(CommitUpdateCommand cmd) |
void |
postSoftCommit(CommitUpdateCommand cmd) |
void |
preCommit(CommitUpdateCommand cmd) |
void |
preSoftCommit(CommitUpdateCommand cmd) |
Future<UpdateLog.RecoveryInfo> |
recoverFromLog() |
String |
toString() |
public static String LOG_FILENAME_PATTERN
public static String TLOG_NAME
public static org.slf4j.Logger log
public boolean debug
public boolean trace
public static final int ADD
public static final int DELETE
public static final int DELETE_BY_QUERY
public static final int COMMIT
public static final int FLAG_GAP
public static final int OPERATION_MASK
protected UpdateLog.State state
protected int operationFlags
protected TransactionLog tlog
protected TransactionLog prevTlog
protected Deque<TransactionLog> logs
protected LinkedList<TransactionLog> newestLogsOnStartup
protected int numOldRecords
protected Map<BytesRef,UpdateLog.LogPtr> map
protected Map<BytesRef,UpdateLog.LogPtr> prevMap
protected Map<BytesRef,UpdateLog.LogPtr> prevMap2
protected TransactionLog prevMapLog
protected TransactionLog prevMapLog2
protected final int numDeletesToKeep
protected final int numDeletesByQueryToKeep
public final int numRecordsToKeep
protected LinkedHashMap<BytesRef,UpdateLog.LogPtr> oldDeletes
protected LinkedList<UpdateLog.DBQ> deleteByQueries
protected String[] tlogFiles
protected File tlogDir
protected Collection<String> globalStrings
protected String dataDir
protected String lastDataDir
protected VersionInfo versionInfo
protected UpdateLog.SyncLevel defaultSyncLevel
protected volatile boolean cancelApplyBufferUpdate
public static Runnable testing_logReplayHook
public static Runnable testing_logReplayFinishHook
protected UpdateLog.RecoveryInfo recoveryInfo
public org.apache.hadoop.fs.FileSystem getFs()
public long getTotalLogsSize()
public long getTotalLogsNumber()
public VersionInfo getVersionInfo()
public void init(PluginInfo info)
init
in interface PluginInfoInitialized
public void init(UpdateHandler uhandler, SolrCore core)
public String getLogDir()
public int getStartingOperation()
protected void addOldLog(TransactionLog oldLog, boolean removeOld)
public long getLastLogId()
public void add(AddUpdateCommand cmd)
public void add(AddUpdateCommand cmd, boolean clearCaches)
public void delete(DeleteUpdateCommand cmd)
public void deleteByQuery(DeleteUpdateCommand cmd)
public void deleteAll()
public List<UpdateLog.DBQ> getDBQNewer(long version)
protected void newMap()
public boolean hasUncommittedChanges()
public void preCommit(CommitUpdateCommand cmd)
public void postCommit(CommitUpdateCommand cmd)
public void preSoftCommit(CommitUpdateCommand cmd)
public void postSoftCommit(CommitUpdateCommand cmd)
public void finish(UpdateLog.SyncLevel syncLevel)
public Future<UpdateLog.RecoveryInfo> recoverFromLog()
protected void ensureLog()
public void close(boolean committed)
public void close(boolean committed, boolean deleteOnClose)
public UpdateLog.RecentUpdates getRecentUpdates()
public void bufferUpdates()
public boolean dropBufferedUpdates()
public Future<UpdateLog.RecoveryInfo> applyBufferedUpdates()
public UpdateLog.State getState()
public void cancelApplyBufferedUpdates()
public static void deleteFile(File file)
protected String getTlogDir(SolrCore core, PluginInfo info)
public void clearLog(SolrCore core, PluginInfo ulogPluginInfo)
core
- the SolrCoreulogPluginInfo
- the init info for the UpdateHandlerCopyright © 2000-2014 Apache Software Foundation. All Rights Reserved.