Class SlotAcc

    • Field Detail

      • currentReaderContext

        protected org.apache.lucene.index.LeafReaderContext currentReaderContext
      • currentDocBase

        protected int currentDocBase
    • Constructor Detail

    • Method Detail

      • setNextReader

        public void setNextReader​(org.apache.lucene.index.LeafReaderContext readerContext)
                           throws IOException
        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.
        Throws:
        IOException
      • collect

        public abstract void collect​(int doc,
                                     int slot,
                                     IntFunction<SlotAcc.SlotContext> slotContext)
                              throws IOException
        All subclasses must override this method to collect documents. This method is called by the default impl of collect(DocSet, int, IntFunction) but it's also neccessary if this accumulator is used for sorting.
        Parameters:
        doc - Single Segment docId (relative to the current LeafReaderContext to collect
        slot - 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
      • collect

        public int collect​(DocSet docs,
                           int slot,
                           IntFunction<SlotAcc.SlotContext> slotContext)
                    throws IOException
        Bulk collection of all documents in a slot. The default implementation calls collect(int, int, IntFunction)
        Parameters:
        docs - (global) Documents to collect
        slot - The slot number to collect these documents 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 abstract int compare​(int slotA,
                                    int slotB)
      • setValues

        public void setValues​(org.apache.solr.common.util.SimpleOrderedMap<Object> bucket,
                              int slotNum)
                       throws IOException
        Throws:
        IOException
      • reset

        public abstract void reset()
                            throws IOException
        Called to reset the acc to a fresh state, ready for reuse
        Throws:
        IOException
      • resetIterators

        protected void resetIterators()
                               throws IOException
        Typically called from setNextReader to reset docValue iterators
        Throws:
        IOException