Class 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.
    • 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:
        onMarkDirty in interface PagesWriteThrottlePolicy
        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:
        wakeupThrottledThreads in interface PagesWriteThrottlePolicy
      • isCpBufferOverflowThresholdExceeded

        public boolean isCpBufferOverflowThresholdExceeded()
        Whether Checkpoint Buffer is currently close to exhaustion.
        Specified by:
        isCpBufferOverflowThresholdExceeded in interface PagesWriteThrottlePolicy
        Returns:
        true if measures like throttling to protect Checkpoint Buffer should be applied, and false otherwise.