public class CdcrUpdateLog extends UpdateLog
UpdateLog
for the CDCR scenario.CdcrUpdateLog.CdcrLogReader
provides
a CdcrUpdateLog.CdcrLogReader.seek(long)
method to
efficiently lookup a particular transaction log file given a version number.Modifier and Type | Class and Description |
---|---|
static class |
CdcrUpdateLog.BufferedUpdates |
class |
CdcrUpdateLog.CdcrLogReader |
UpdateLog.DBQ, UpdateLog.LogPtr, UpdateLog.RecentUpdates, UpdateLog.RecoveryInfo, UpdateLog.State, UpdateLog.SyncLevel
Modifier and Type | Field and Description |
---|---|
static String |
LOG_FILENAME_PATTERN |
protected Map<CdcrUpdateLog.CdcrLogReader,org.apache.solr.update.CdcrUpdateLog.CdcrLogPointer> |
logPointers |
ADD, applyingBufferedOpsMeter, BUFFER_TLOG_NAME, bufferedOpsGauge, bufferTlog, cancelApplyBufferUpdate, COMMIT, copyOverOldUpdatesMeter, dataDir, defaultSyncLevel, DELETE, DELETE_BY_QUERY, deleteByQueries, existOldBufferLog, FLAGS_IDX, globalStrings, lastDataDir, logs, map, maxNumLogsToKeep, maxVersionFromIndex, metricManager, newestLogsOnStartup, numDeletesByQueryToKeep, numDeletesToKeep, numOldRecords, numRecordsToKeep, numVersionBuckets, oldDeletes, OPERATION_MASK, PREV_POINTER_IDX, PREV_VERSION_IDX, prevMap, prevMap2, prevMapLog, prevMapLog2, prevTlog, prevTlogOnPrecommit, recoveryInfo, registryName, replayOpsMeter, state, testing_logReplayFinishHook, testing_logReplayHook, tlog, TLOG_NAME, tlogDir, tlogFiles, UPDATE_INPLACE, VERSION_IDX, versionInfo
Constructor and Description |
---|
CdcrUpdateLog() |
Modifier and Type | Method and Description |
---|---|
void |
add(AddUpdateCommand cmd,
boolean clearCaches) |
protected void |
addOldLog(TransactionLog oldLog,
boolean removeOld) |
void |
close(boolean committed,
boolean deleteOnClose) |
void |
delete(DeleteUpdateCommand cmd) |
void |
deleteByQuery(DeleteUpdateCommand cmd) |
void |
disableBuffer()
Disable the buffering of the tlogs.
|
void |
enableBuffer()
Enable the buffering of the tlogs.
|
protected void |
ensureLog(long startVersion) |
CdcrUpdateLog.CdcrLogReader |
getBufferToggle() |
long |
getLastLogId() |
void |
init(UpdateHandler uhandler,
SolrCore core) |
void |
initForRecovery(File bufferedTlog,
long offset)
expert: Initialise the update log with a tlog file containing buffered updates.
|
boolean |
isBuffering()
Is the update log buffering the tlogs ?
|
CdcrUpdateLog.CdcrLogReader |
newLogReader()
Creates a new
CdcrUpdateLog.CdcrLogReader
initialised with the current list of tlogs. |
TransactionLog |
newTransactionLog(File tlogFile,
Collection<String> globalStrings,
boolean openExisting)
Returns a new
TransactionLog . |
CdcrUpdateLog.BufferedUpdates |
resetForRecovery()
expert: Reset the update log before initialisation.
|
add, applyBufferedUpdates, applyPartialUpdates, bufferUpdates, clearLog, close, commitAndSwitchToNewTlog, convertTlogEntryToAddUpdateCommand, copyOverBufferingUpdates, copyOverOldUpdates, copyOverOldUpdates, deleteAll, deleteBufferLogs, deleteFile, dropBufferedUpdates, ensureBufferTlog, ensureLog, existOldBufferLog, finish, getBufferLogList, getCurrentLogSizeFromStream, getCurrentMaxVersion, getDBQNewer, getFs, getLogDir, getLogList, getMaxNumLogsToKeep, getNumRecordsToKeep, getNumVersionBuckets, getRecentUpdates, getStartingVersions, getState, getTlogDir, getTotalLogsNumber, getTotalLogsSize, getVersionInfo, hasUncommittedChanges, init, initializeMetrics, lookup, lookupVersion, newMap, objToInt, openRealtimeSearcher, postCommit, postSoftCommit, preCommit, preSoftCommit, recoverFromCurrentLog, recoverFromLog, seedBucketsWithHighestVersion, seedBucketsWithHighestVersion, toString
protected final Map<CdcrUpdateLog.CdcrLogReader,org.apache.solr.update.CdcrUpdateLog.CdcrLogPointer> logPointers
public static String LOG_FILENAME_PATTERN
public void init(UpdateHandler uhandler, SolrCore core)
public TransactionLog newTransactionLog(File tlogFile, Collection<String> globalStrings, boolean openExisting)
UpdateLog
TransactionLog
. Sub-classes can override this method to
change the implementation of the transaction log.newTransactionLog
in class UpdateLog
protected void addOldLog(TransactionLog oldLog, boolean removeOld)
public long getLastLogId()
getLastLogId
in class UpdateLog
public void add(AddUpdateCommand cmd, boolean clearCaches)
public void delete(DeleteUpdateCommand cmd)
public void deleteByQuery(DeleteUpdateCommand cmd)
deleteByQuery
in class UpdateLog
public CdcrUpdateLog.CdcrLogReader newLogReader()
CdcrUpdateLog.CdcrLogReader
initialised with the current list of tlogs.public void enableBuffer()
public void disableBuffer()
public CdcrUpdateLog.CdcrLogReader getBufferToggle()
public boolean isBuffering()
protected void ensureLog(long startVersion)
public CdcrUpdateLog.BufferedUpdates resetForRecovery()
IndexFetcher.moveTlogFiles(File)
during a
a Recovery operation in order to re-initialise the UpdateLog with a new set of tlog files.initForRecovery(File, long)
public void initForRecovery(File bufferedTlog, long offset)
expert: Initialise the update log with a tlog file containing buffered updates. This is called by
IndexFetcher.moveTlogFiles(File)
during a Recovery operation.
This is mainly a copy of the original UpdateLog.init(UpdateHandler, SolrCore)
method, but modified
to:
VersionInfo
instance in order to not "unblock" updates, since the
IndexFetcher.moveTlogFiles(File)
acquired a write lock from this instance.resetForRecovery()
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.