Class PagesWriteThrottle
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.persistence.pagemem.PagesWriteThrottle
-
- All Implemented Interfaces:
PagesWriteThrottlePolicy
public class PagesWriteThrottle extends Object implements PagesWriteThrottlePolicy
Throttles threads that generate dirty pages during ongoing checkpoint. Designed to avoid zero dropdowns that can happen if checkpoint buffer is overflowed.
-
-
Field Summary
-
Fields inherited from interface org.apache.ignite.internal.processors.cache.persistence.pagemem.PagesWriteThrottlePolicy
CP_BUF_FILL_THRESHOLD, DFLT_THROTTLE_LOG_THRESHOLD, LOGGING_THRESHOLD
-
-
Constructor Summary
Constructors Constructor Description PagesWriteThrottle(PageMemoryImpl pageMemory, IgniteOutClosure<CheckpointProgress> cpProgress, CheckpointLockStateChecker stateChecker, boolean throttleOnlyPagesInCheckpoint, IgniteLogger log)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisCpBufferOverflowThresholdExceeded()Whether Checkpoint Buffer is currently close to exhaustion.voidonBeginCheckpoint()Callback to notify throttling policy checkpoint was started.voidonFinishCheckpoint()Callback to notify throttling policy checkpoint was finished.voidonMarkDirty(boolean isPageInCheckpoint)Callback to apply throttling delay.voidwakeupThrottledThreads()Callback to wakeup throttled threads.
-
-
-
Constructor Detail
-
PagesWriteThrottle
public PagesWriteThrottle(PageMemoryImpl pageMemory, IgniteOutClosure<CheckpointProgress> cpProgress, CheckpointLockStateChecker stateChecker, boolean throttleOnlyPagesInCheckpoint, IgniteLogger log)
- Parameters:
pageMemory- Page memory.cpProgress- Database manager.stateChecker- checkpoint lock state checker.throttleOnlyPagesInCheckpoint- If true, throttle will only protect from checkpoint buffer overflow.log- Logger.
-
-
Method Detail
-
onMarkDirty
public void onMarkDirty(boolean isPageInCheckpoint)
Callback to apply throttling delay.- Specified by:
onMarkDirtyin interfacePagesWriteThrottlePolicy- Parameters:
isPageInCheckpoint- flag indicating if current page is in scope of current checkpoint.
-
wakeupThrottledThreads
public void wakeupThrottledThreads()
Callback to wakeup throttled threads. Invoked when the Checkpoint Buffer use drops below a certain threshold.- Specified by:
wakeupThrottledThreadsin interfacePagesWriteThrottlePolicy
-
onBeginCheckpoint
public void onBeginCheckpoint()
Callback to notify throttling policy checkpoint was started.- Specified by:
onBeginCheckpointin interfacePagesWriteThrottlePolicy
-
onFinishCheckpoint
public void onFinishCheckpoint()
Callback to notify throttling policy checkpoint was finished.- Specified by:
onFinishCheckpointin interfacePagesWriteThrottlePolicy
-
isCpBufferOverflowThresholdExceeded
public boolean isCpBufferOverflowThresholdExceeded()
Whether Checkpoint Buffer is currently close to exhaustion.- Specified by:
isCpBufferOverflowThresholdExceededin interfacePagesWriteThrottlePolicy- Returns:
trueif measures like throttling to protect Checkpoint Buffer should be applied, andfalseotherwise.
-
-