T
- The type of data being processed.public abstract class SortedListCollector<T extends Comparable<T>> extends ReductionDataCollector<SortedListCollector.SortedListData<T>>
SortedListCollector
.
Supported types are:
Modifier and Type | Class and Description |
---|---|
static class |
SortedListCollector.SortedDoubleListCollector |
static class |
SortedListCollector.SortedFloatListCollector |
static class |
SortedListCollector.SortedIntListCollector |
static class |
SortedListCollector.SortedListData<D extends Comparable<D>> |
static class |
SortedListCollector.SortedLongListCollector |
static class |
SortedListCollector.SortedStringListCollector |
Modifier and Type | Field and Description |
---|---|
static String |
name |
collectionTargets, ioData, lastingTargets
Modifier | Constructor and Description |
---|---|
protected |
SortedListCollector(AnalyticsValueStream param,
String specificationName) |
Modifier and Type | Method and Description |
---|---|
protected void |
apply(SortedListCollector.SortedListData<T> data)
Apply the collected info to the given reduction data.
|
void |
calcMedian()
Informs the collector that the median needs to be computed.
|
void |
calcOrdinal(int ordinal)
Informs the collector that the following ordinal needs to be computed.
|
void |
calcPercentile(double percentile)
Informs the collector that the following percentile needs to be computed.
|
void |
calcReverseOrdinal(int reverseOrdinal)
Informs the collector that the following reverse ordinal needs to be computed.
|
T |
exportNext()
Return the next value in the list.
|
T |
get(int index)
Once the data has been set by either
setData(org.apache.solr.analytics.function.reduction.data.ReductionData) or setMergedData(org.apache.solr.analytics.function.reduction.data.ReductionData) ,
this returns the value at the given sorted index. |
String |
getExpressionStr()
The unique expression string of the reduction data collector, given all inputs and parameters.
|
String |
getName()
Get the name of the reduction data collector.
|
protected void |
importNext(T value)
Merges the current list with the incoming value.
|
SortedListCollector.SortedListData<T> |
newData()
A clean slate to start a new reduction.
|
void |
setData(ReductionData data)
This is where the given indices are put in their sorted positions.
|
void |
setMergedData(ReductionData data)
Put the given indices in their sorted positions
|
int |
size() |
int |
startExport()
The list to be exported is unsorted.
|
protected void |
startImport(int size)
Starts the import of the shard data.
|
addCollectTarget, addLastingCollectTarget, clearLastingCollectTargets, collect, collectAndApply, dataIO, newDataIO, newDataTarget, submitReservations
public static final String name
protected SortedListCollector(AnalyticsValueStream param, String specificationName)
public int size()
public void calcMedian()
public void calcPercentile(double percentile)
percentile
- requested percentilepublic void calcOrdinal(int ordinal)
ordinal
- requested ordinalpublic void calcReverseOrdinal(int reverseOrdinal)
reverseOrdinal
- requested reverseOrdinalpublic T get(int index)
setData(org.apache.solr.analytics.function.reduction.data.ReductionData)
or setMergedData(org.apache.solr.analytics.function.reduction.data.ReductionData)
,
this returns the value at the given sorted index.
Only the indices specified by calcMedian
, calcPercentile(double)
, calcOrdinal(int)
, and calcReverseOrdinal(int)
will contain valid data. All other indices may return unsorted data.index
- the index of the sorted data to returnpublic SortedListCollector.SortedListData<T> newData()
ReductionDataCollector
newData
in class ReductionDataCollector<SortedListCollector.SortedListData<T extends Comparable<T>>>
protected void apply(SortedListCollector.SortedListData<T> data)
ReductionDataCollector
ReductionDataCollector.collect()
call.apply
in class ReductionDataCollector<SortedListCollector.SortedListData<T extends Comparable<T>>>
data
- reduction data to apply collected info toprotected void startImport(int size)
size
- the size of the incoming shard listprotected void importNext(T value)
value
- the next imported value to addpublic int startExport()
startImport(int)
and importNext(T)
methods.public T exportNext()
public void setMergedData(ReductionData data)
setMergedData
in class ReductionDataCollector<SortedListCollector.SortedListData<T extends Comparable<T>>>
data
- the merged data to compute a reduction forpublic void setData(ReductionData data)
setData
in class ReductionDataCollector<SortedListCollector.SortedListData<T extends Comparable<T>>>
data
- the collected data to compute a reduction forpublic String getName()
ReductionDataCollector
getName
in class ReductionDataCollector<SortedListCollector.SortedListData<T extends Comparable<T>>>
public String getExpressionStr()
ReductionDataCollector
ReductionDataCollector
syncing. Since the string should be unique,
only one of expression is kept.getExpressionStr
in class ReductionDataCollector<SortedListCollector.SortedListData<T extends Comparable<T>>>
Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.