Class FrozenBufferedUpdates


  • final class FrozenBufferedUpdates
    extends java.lang.Object
    Holds buffered deletes and updates by term or query, once pushed. Pushed deletes/updates are write-once, so we shift to more memory efficient data structure to hold them. We don't hold docIDs because these are applied on flush.
    • Field Detail

      • BYTES_PER_DEL_QUERY

        static final int BYTES_PER_DEL_QUERY
      • deleteQueries

        final Query[] deleteQueries
      • deleteQueryLimits

        final int[] deleteQueryLimits
      • applied

        public final java.util.concurrent.CountDownLatch applied
        Counts down once all deletes/updates have been applied
      • applyLock

        private final java.util.concurrent.locks.ReentrantLock applyLock
      • fieldUpdates

        private final java.util.Map<java.lang.String,​FieldUpdatesBuffer> fieldUpdates
      • totalDelCount

        public long totalDelCount
        How many total documents were deleted/updated.
      • fieldUpdatesCount

        private final int fieldUpdatesCount
      • bytesUsed

        final int bytesUsed
      • numTermDeletes

        final int numTermDeletes
      • delGen

        private long delGen
    • Method Detail

      • tryLock

        boolean tryLock()
        Tries to lock this buffered update instance
        Returns:
        true if the lock was successfully acquired. otherwise false.
      • lock

        void lock()
        locks this buffered update instance
      • unlock

        void unlock()
        Releases the lock of this buffered update instance
      • isApplied

        boolean isApplied()
        Returns true iff this buffered updates instance was already applied
      • apply

        long apply​(BufferedUpdatesStream.SegmentState[] segStates)
            throws java.io.IOException
        Applies pending delete-by-term, delete-by-query and doc values updates to all segments in the index, returning the number of new deleted or updated documents.
        Throws:
        java.io.IOException
      • applyDocValuesUpdates

        private static long applyDocValuesUpdates​(BufferedUpdatesStream.SegmentState segState,
                                                  java.util.Map<java.lang.String,​FieldUpdatesBuffer> updates,
                                                  long delGen,
                                                  boolean segmentPrivateDeletes)
                                           throws java.io.IOException
        Throws:
        java.io.IOException
      • setDelGen

        public void setDelGen​(long delGen)
      • delGen

        public long delGen()
      • toString

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

        boolean any()