protected static class UniqueBlockAgg.UniqueBlockSlotAcc extends SlotAcc
SlotAcc.Resizer, SlotAcc.SlotContext
Modifier and Type | Field and Description |
---|---|
protected int[] |
lastSeenValuesPerSlot |
currentDocBase, currentReaderContext, fcontext
Modifier | Constructor and Description |
---|---|
protected |
UniqueBlockSlotAcc(FacetContext fcontext,
SchemaField field,
int numSlots) |
Modifier and Type | Method and Description |
---|---|
void |
calcCounts() |
void |
collect(int doc,
int slotNum,
IntFunction<SlotAcc.SlotContext> slotContext)
All subclasses must override this method to collect documents.
|
protected void |
collectOrdToSlot(int slotNum,
int ord) |
int |
compare(int slotA,
int slotB) |
Object |
getValue(int slot) |
protected BytesRef |
lookupOrd(int ord) |
void |
reset()
Called to reset the acc to a fresh state, ready for reuse
|
void |
resetIterators()
Typically called from setNextReader to reset docValue iterators
|
void |
resize(SlotAcc.Resizer resizer) |
void |
setNextReader(LeafReaderContext readerContext)
NOTE: this currently detects when it is being reused and calls resetIterators by comparing reader ords
with previous calls to setNextReader.
|
protected UniqueBlockSlotAcc(FacetContext fcontext, SchemaField field, int numSlots) throws IOException
IOException
protected void collectOrdToSlot(int slotNum, int ord)
public void calcCounts()
public void reset() throws IOException
SlotAcc
IOException
public void resize(SlotAcc.Resizer resizer)
public Object getValue(int slot) throws IOException
IOException
public void resetIterators() throws IOException
SlotAcc
resetIterators
in class SlotAcc
IOException
protected BytesRef lookupOrd(int ord) throws IOException
IOException
public void setNextReader(LeafReaderContext readerContext) throws IOException
SlotAcc
setNextReader
in class SlotAcc
IOException
public void collect(int doc, int slotNum, IntFunction<SlotAcc.SlotContext> slotContext) throws IOException
SlotAcc
SlotAcc.collect(DocSet, int, IntFunction)
but it's also neccessary if this accumulator
is used for sorting.collect
in class SlotAcc
doc
- Single Segment docId (relative to the current LeafReaderContext
to collectslotNum
- The slot number to collect this document inslotContext
- 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.IOException
Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.