|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.je.utilint.DaemonThread
com.sleepycat.je.evictor.Evictor
public abstract class Evictor
The Evictor looks through the INList for IN's and BIN's that are worthy of eviction. Once the nodes are selected, it removes all references to them so that they can be GC'd by the JVM.
Nested Class Summary | |
---|---|
static class |
Evictor.EvictionSource
|
(package private) static class |
Evictor.EvictProfile
|
Field Summary | |
---|---|
(package private) Evictor.EvictProfile |
evictProfile
|
protected IntStat |
sharedCacheEnvs
|
Fields inherited from class com.sleepycat.je.utilint.DaemonThread |
---|
envImpl, logger, name, nWakeupRequests, stifleExceptionChatter |
Constructor Summary | |
---|---|
Evictor(EnvironmentImpl envImpl,
long wakeupInterval,
String name)
|
Method Summary | |
---|---|
abstract void |
addEnvironment(EnvironmentImpl envImpl)
Only supported by SharedEvictor. |
void |
alert()
Wakeup the evictor only if it's not already active. |
abstract boolean |
checkEnv(EnvironmentImpl env)
Only supported by SharedEvictor. |
abstract void |
clearEnv()
Standard daemon method to set envImpl to null. |
void |
doCriticalEviction(boolean backgroundIO)
Do a check on whether synchronous eviction is needed. |
void |
doEvict(Evictor.EvictionSource source)
May be called by the evictor thread on wakeup or programatically. |
(package private) long |
evictBatch(Evictor.EvictionSource source,
boolean backgroundIO,
long reqEvictBytes)
Each iteration will attempt to evict requiredEvictBytes, but will give up after a complete pass over the INList. |
long |
evictIN(IN target,
boolean backgroundIO,
Evictor.EvictionSource source)
Strip or evict this node. |
(package private) abstract StatGroup |
getINListStats(StatsConfig config)
|
(package private) abstract int |
getMaxINsPerBatch()
Returns the approximate number of total INs in the INList(s). |
(package private) abstract IN |
getNextIN()
Returns the next IN in the INList(s), wrapping if necessary. |
(package private) abstract Iterator<IN> |
getScanIterator()
|
void |
incBINEvictStats(Evictor.EvictionSource source)
|
void |
incBINFetchStats(boolean isMiss)
|
void |
incINEvictStats(Evictor.EvictionSource source)
|
void |
incINFetchStats(boolean isMiss)
|
void |
incLNFetchStats(boolean isMiss)
Update the appropriate fetch stat, based on node type. |
boolean |
isCacheFull()
Returns true if the JE cache level is above the point where it is likely that the cache has filled, and is staying full. |
StatGroup |
loadStats(StatsConfig config)
Load stats. |
protected long |
nDeadlockRetries()
Return the number of retries when a deadlock exception occurs. |
int |
normalizeLevel(IN in,
int evictType)
Normalize the tree level of the given IN. |
abstract void |
noteINListChange(int nINs)
Called whenever INs are added to, or removed from, the INList. |
void |
onWakeup()
Called whenever the daemon thread wakes up from a sleep. |
abstract void |
removeEnvironment(EnvironmentImpl envImpl)
Only supported by SharedEvictor. |
void |
setPreEvictINHook(TestHook<Object> hook)
|
void |
setRunnableHook(TestHook<Boolean> hook)
|
(package private) abstract void |
setScanIterator(Iterator<IN> iter)
|
(package private) abstract long |
startBatch()
Perform class-specific batch processing: Initialize iterator, perform UtilizationTracker eviction, etc. |
boolean |
wasCacheEverFull()
Returns whether eviction has ever occurred, i.e., whether the cache has ever filled. |
Methods inherited from class com.sleepycat.je.utilint.DaemonThread |
---|
checkErrorListener, createLogger, getExceptionListener, getNWakeupRequests, getThread, isPaused, isRunning, isShutdownRequested, requestShutdown, run, runOrPause, setExceptionListener, shutdown, toString, wakeup |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected IntStat sharedCacheEnvs
Evictor.EvictProfile evictProfile
Constructor Detail |
---|
Evictor(EnvironmentImpl envImpl, long wakeupInterval, String name) throws DatabaseException
DatabaseException
Method Detail |
---|
abstract StatGroup getINListStats(StatsConfig config)
public StatGroup loadStats(StatsConfig config)
protected long nDeadlockRetries()
nDeadlockRetries
in class DaemonThread
public void alert()
public void onWakeup() throws DatabaseException
onWakeup
in class DaemonThread
DatabaseException
public void doEvict(Evictor.EvictionSource source) throws DatabaseException
DatabaseException
public void doCriticalEviction(boolean backgroundIO)
long evictBatch(Evictor.EvictionSource source, boolean backgroundIO, long reqEvictBytes) throws DatabaseException
DatabaseException
public boolean isCacheFull()
public boolean wasCacheEverFull()
public int normalizeLevel(IN in, int evictType)
public long evictIN(IN target, boolean backgroundIO, Evictor.EvictionSource source) throws DatabaseException
source
- is EvictSource.CRITICAL or EVICTORTHREAD when this
operation is invoked by the evictor (either critical eviction or the
evictor background thread), and is EvictSource.CACHEMODE if invoked by a
user operation using CacheMode.EVICT_BIN. If CACHEMODE, we will perform
the eviction regardless of whether:
1) we have to wait for a latch, or
2) the IN generation changes, or
3) we are able to strip LNs.
If not CACHEMODE, any of the above conditions will prevent eviction.
DatabaseException
public void incBINEvictStats(Evictor.EvictionSource source)
public void incINEvictStats(Evictor.EvictionSource source)
public void incLNFetchStats(boolean isMiss)
public void incBINFetchStats(boolean isMiss)
public void incINFetchStats(boolean isMiss)
public void setRunnableHook(TestHook<Boolean> hook)
public void setPreEvictINHook(TestHook<Object> hook)
public abstract void clearEnv()
public abstract void noteINListChange(int nINs)
public abstract void addEnvironment(EnvironmentImpl envImpl)
public abstract void removeEnvironment(EnvironmentImpl envImpl)
public abstract boolean checkEnv(EnvironmentImpl env)
abstract long startBatch() throws DatabaseException
DatabaseException
abstract int getMaxINsPerBatch()
abstract IN getNextIN()
abstract Iterator<IN> getScanIterator()
abstract void setScanIterator(Iterator<IN> iter)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |