Class DocumentsWriterFlushControl

    • Field Detail

      • hardMaxBytesPerDWPT

        private final long hardMaxBytesPerDWPT
      • activeBytes

        private long activeBytes
      • flushBytes

        private volatile long flushBytes
      • numPending

        private volatile int numPending
      • numDocsSinceStalled

        private int numDocsSinceStalled
      • flushDeletes

        private final java.util.concurrent.atomic.AtomicBoolean flushDeletes
      • fullFlush

        private boolean fullFlush
      • fullFlushMarkDone

        private boolean fullFlushMarkDone
      • maxConfiguredRamBuffer

        private double maxConfiguredRamBuffer
      • peakActiveBytes

        private long peakActiveBytes
      • peakFlushBytes

        private long peakFlushBytes
      • peakNetBytes

        private long peakNetBytes
      • peakDelta

        private long peakDelta
      • flushByRAMWasDisabled

        private boolean flushByRAMWasDisabled
      • closed

        private boolean closed
      • stallStartNS

        private long stallStartNS
    • Method Detail

      • activeBytes

        public long activeBytes()
      • getFlushingBytes

        long getFlushingBytes()
      • netBytes

        long netBytes()
      • stallLimitBytes

        private long stallLimitBytes()
      • assertMemory

        private boolean assertMemory()
      • updatePeaks

        private boolean updatePeaks​(long delta)
      • assertNumDocsSinceStalled

        private boolean assertNumDocsSinceStalled​(boolean stalled)
      • updateStallState

        private boolean updateStallState()
      • waitForFlush

        public void waitForFlush()
      • checkoutAndBlock

        private void checkoutAndBlock​(DocumentsWriterPerThread perThread)
        To be called only by the owner of this object's monitor lock
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
      • doOnDelete

        void doOnDelete()
      • getDeleteBytesUsed

        public long getDeleteBytesUsed()
        Returns heap bytes currently consumed by buffered deletes/updates that would be freed if we pushed all deletes. This does not include bytes consumed by already pushed delete/update packets.
      • ramBytesUsed

        public long ramBytesUsed()
        Description copied from interface: Accountable
        Return the memory usage of this object in bytes. Negative values are illegal.
        Specified by:
        ramBytesUsed in interface Accountable
      • numFlushingDWPT

        int numFlushingDWPT()
      • getAndResetApplyAllDeletes

        public boolean getAndResetApplyAllDeletes()
      • setApplyAllDeletes

        public void setApplyAllDeletes()
      • markForFullFlush

        long markForFullFlush()
      • pruneBlockedQueue

        private void pruneBlockedQueue​(DocumentsWriterDeleteQueue flushingQueue)
        Prunes the blockedQueue by removing all DWPTs that are associated with the given flush queue.
      • finishFullFlush

        void finishFullFlush()
      • abortFullFlushes

        void abortFullFlushes()
      • abortPendingFlushes

        void abortPendingFlushes()
      • isFullFlush

        boolean isFullFlush()
        Returns true if a full flush is currently running
      • numQueuedFlushes

        int numQueuedFlushes()
        Returns the number of flushes that are already checked out but not yet actively flushing
      • numBlockedFlushes

        int numBlockedFlushes()
        Returns the number of flushes that are checked out but not yet available for flushing. This only applies during a full flush if a DWPT needs flushing but must not be flushed until the full flush has finished.
      • waitIfStalled

        void waitIfStalled()
        This method will block if too many DWPT are currently flushing and no checked out DWPT are available
      • anyStalledThreads

        boolean anyStalledThreads()
        Returns true iff stalled
      • checkoutLargestNonPendingWriter

        final DocumentsWriterPerThread checkoutLargestNonPendingWriter()
        Returns the largest non-pending flushable DWPT or null if there is none.
      • getPeakActiveBytes

        long getPeakActiveBytes()
      • getPeakNetBytes

        long getPeakNetBytes()