Class UniqueBlockAgg.UniqueBlockSlotAcc

    • Field Detail

      • lastSeenValuesPerSlot

        protected int[] lastSeenValuesPerSlot
    • Method Detail

      • collectOrdToSlot

        protected void collectOrdToSlot​(int slotNum,
                                        int ord)
      • calcCounts

        public void calcCounts()
      • reset

        public void reset()
                   throws IOException
        Description copied from class: SlotAcc
        Called to reset the acc to a fresh state, ready for reuse
        Throws:
        IOException
      • getNonShardValue

        public long getNonShardValue​(int slot)
        Returns the current slot value as long This is used to get non-sharded value
      • lookupOrd

        protected org.apache.lucene.util.BytesRef lookupOrd​(int ord)
                                                     throws IOException
        Throws:
        IOException
      • setNextReader

        public void setNextReader​(org.apache.lucene.index.LeafReaderContext readerContext)
                           throws IOException
        Description copied from class: SlotAcc
        NOTE: this currently detects when it is being reused and calls resetIterators by comparing reader ords with previous calls to setNextReader. For this reason, current users must call setNextReader in segment order. Failure to do so will cause worse performance.
        Overrides:
        setNextReader in class SlotAcc
        Throws:
        IOException
      • collect

        public void collect​(int doc,
                            int slotNum,
                            IntFunction<SlotAcc.SlotContext> slotContext)
                     throws IOException
        Description copied from class: SlotAcc
        All subclasses must override this method to collect documents. This method is called by the default impl of SlotAcc.collect(DocSet, int, IntFunction) but it's also neccessary if this accumulator is used for sorting.
        Specified by:
        collect in class SlotAcc
        Parameters:
        doc - Single Segment docId (relative to the current LeafReaderContext to collect
        slotNum - The slot number to collect this document in
        slotContext - A callback that can be used for Accumulators that would like additional info about the current slot -- the IntFunction is only garunteed to be valid for the current slot, and the SlotAcc.SlotContext returned is only valid for the duration of the collect() call.
        Throws:
        IOException
      • compare

        public int compare​(int slotA,
                           int slotB)
        Specified by:
        compare in class SlotAcc