public class Checkpointer extends DaemonThread
Modifier and Type | Class and Description |
---|---|
static class |
Checkpointer.CheckpointReference |
static class |
Checkpointer.FlushStats
A struct to hold log flushing stats for checkpoint and database sync.
|
name, nWakeupRequests, stifleExceptionChatter, workQueue, workQueueLatch
Constructor and Description |
---|
Checkpointer(EnvironmentImpl envImpl,
long waitTime,
java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
void |
clearEnv() |
void |
doCheckpoint(CheckpointConfig config,
boolean flushAll,
java.lang.String invokingSource)
The real work to do a checkpoint.
|
long |
getFirstActiveLsn() |
int |
getHighestFlushLevel() |
static long |
getWakeupPeriod(DbConfigManager configManager)
Figure out the wakeup period.
|
void |
initIntervals(long lastCheckpointEnd,
long lastCheckpointMillis)
Initializes the checkpoint intervals when no checkpoint is performed
while opening the environment.
|
void |
loadStats(StatsConfig config,
EnvironmentStats stat)
Load stats.
|
protected int |
nDeadlockRetries()
Return the number of retries when a deadlock exception occurs.
|
protected void |
onWakeup()
Called whenever the DaemonThread wakes up from a sleep.
|
void |
setCheckpointId(long lastCheckpointId)
Set checkpoint id -- can only be done after recovery.
|
void |
setFirstActiveLsn(long lastFirstActiveLsn)
Initialize the FirstActiveLsn during recovery.
|
static void |
syncDatabase(EnvironmentImpl envImpl,
DatabaseImpl dbImpl,
boolean flushLog)
Flush a given database to disk.
|
void |
wakeupAfterWrite()
Wakes up the checkpointer if a checkpoint log interval is configured and
the number of bytes written since the last checkpoint exeeds the size
of the interval.
|
addToQueue, addToQueueAlreadyLatched, getNWakeupRequests, getQueueSize, getThread, isPaused, isRunning, isShutdownRequested, requestShutdown, run, runOrPause, shutdown, toString, wakeup
public Checkpointer(EnvironmentImpl envImpl, long waitTime, java.lang.String name) throws DatabaseException
DatabaseException
public void initIntervals(long lastCheckpointEnd, long lastCheckpointMillis)
public int getHighestFlushLevel()
public static long getWakeupPeriod(DbConfigManager configManager) throws java.lang.IllegalArgumentException, DatabaseException
java.lang.IllegalArgumentException
DatabaseException
public void setCheckpointId(long lastCheckpointId)
public void loadStats(StatsConfig config, EnvironmentStats stat) throws DatabaseException
DatabaseException
public long getFirstActiveLsn()
public void setFirstActiveLsn(long lastFirstActiveLsn)
public void clearEnv()
protected int nDeadlockRetries() throws DatabaseException
nDeadlockRetries
in class DaemonThread
DatabaseException
protected void onWakeup() throws DatabaseException
onWakeup
in class DaemonThread
DatabaseException
public void wakeupAfterWrite()
public void doCheckpoint(CheckpointConfig config, boolean flushAll, java.lang.String invokingSource) throws DatabaseException
flushAll
- if true, this checkpoint must flush all the way to
the top of the dbtree, instead of stopping at the highest level
last modified.invokingSource
- a debug aid, to indicate who invoked this
checkpoint. (i.e. recovery, the checkpointer daemon, the cleaner,
programatically)DatabaseException
public static void syncDatabase(EnvironmentImpl envImpl, DatabaseImpl dbImpl, boolean flushLog) throws DatabaseException
DatabaseException