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) |
Long |
getCurrentMaxVersion() |
List<UpdateLog.DBQ> |
getDBQNewer(long version) |
org.apache.hadoop.fs.FileSystem |
getFs() |
long |
getLastLogId() |
String |
getLogDir() |
String[] |
getLogList(File directory) |
int |
getMaxNumLogsToKeep() |
int |
getNumRecordsToKeep() |
int |
getNumVersionBuckets() |
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() |
TransactionLog |
newTransactionLog(File tlogFile,
Collection<String> globalStrings,
boolean openExisting)
Returns a new
TransactionLog . |
protected static int |
objToInt(Object obj,
int def) |
void |
openRealtimeSearcher()
Opens a new realtime searcher and clears the id caches.
|
void |
postCommit(CommitUpdateCommand cmd) |
void |
postSoftCommit(CommitUpdateCommand cmd) |
void |
preCommit(CommitUpdateCommand cmd) |
void |
preSoftCommit(CommitUpdateCommand cmd) |
Future<UpdateLog.RecoveryInfo> |
recoverFromLog() |
void |
seedBucketsWithHighestVersion(SolrIndexSearcher newSearcher) |
protected Long |
seedBucketsWithHighestVersion(SolrIndexSearcher newSearcher,
VersionInfo versions)
Used to seed all version buckets with the max value of the version field in the index.
|
String |
toString() |
public static String LOG_FILENAME_PATTERN
public static String TLOG_NAME
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 final 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
protected int numRecordsToKeep
protected int maxNumLogsToKeep
protected int numVersionBuckets
protected Long maxVersionFromIndex
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 int getNumRecordsToKeep()
public int getMaxNumLogsToKeep()
public int getNumVersionBuckets()
protected static int objToInt(Object obj, int def)
public void init(PluginInfo info)
init
in interface PluginInfoInitialized
public void init(UpdateHandler uhandler, SolrCore core)
public TransactionLog newTransactionLog(File tlogFile, Collection<String> globalStrings, boolean openExisting)
TransactionLog
. Sub-classes can override this method to
change the implementation of the transaction log.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 openRealtimeSearcher()
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 UpdateHandlerpublic Long getCurrentMaxVersion()
protected Long seedBucketsWithHighestVersion(SolrIndexSearcher newSearcher, VersionInfo versions)
public void seedBucketsWithHighestVersion(SolrIndexSearcher newSearcher)
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.