T
- the type of reduction data being collectedpublic abstract class ReductionDataCollector<T extends ReductionData> extends Object
ReductionData
collection.Modifier and Type | Field and Description |
---|---|
protected ArrayList<T> |
collectionTargets |
protected T |
ioData |
protected ArrayList<T> |
lastingTargets |
Modifier | Constructor and Description |
---|---|
protected |
ReductionDataCollector() |
Modifier and Type | Method and Description |
---|---|
void |
addCollectTarget(ReductionData data)
Add a reduction data to target during collection.
|
void |
addLastingCollectTarget(ReductionData data)
Add a reduction data to target during collection.
|
protected abstract void |
apply(T data)
Apply the collected info to the given reduction data.
|
void |
clearLastingCollectTargets()
Clear the lasting collection targets.
|
protected void |
collect()
Collect the information from current Solr Document.
|
void |
collectAndApply()
Collect the info for the current Solr Document and apply the results to the
given collection targets.
|
void |
dataIO(ReductionData data)
Set the reduction data to use in exporting and merging.
|
abstract String |
getExpressionStr()
The unique expression string of the reduction data collector, given all inputs and parameters.
|
abstract String |
getName()
Get the name of the reduction data collector.
|
abstract T |
newData()
A clean slate to start a new reduction.
|
T |
newDataIO()
Create a new reduction data to use in exporting and merging.
|
T |
newDataTarget()
Create a new reduction data to target during collection.
|
abstract void |
setData(ReductionData data)
Finalize the reduction with the collected data stored in the parameter.
|
abstract void |
setMergedData(ReductionData data)
Finalize the reduction with the merged data stored in the parameter.
|
abstract void |
submitReservations(Consumer<ReductionDataReservation<?,?>> consumer)
Submits the data reservations needed for this data collector.
|
protected ArrayList<T extends ReductionData> lastingTargets
protected ArrayList<T extends ReductionData> collectionTargets
protected T extends ReductionData ioData
public abstract void submitReservations(Consumer<ReductionDataReservation<?,?>> consumer)
consumer
- the consumer which the reservations are submitted topublic abstract T newData()
public void addLastingCollectTarget(ReductionData data)
data
- the data to targetpublic void clearLastingCollectTargets()
collectAndApply()
calls.public T newDataTarget()
collectAndApply()
.public void addCollectTarget(ReductionData data)
collectAndApply()
.data
- the data to targetpublic void collectAndApply()
protected void collect()
protected abstract void apply(T data)
collect()
call.data
- reduction data to apply collected info topublic T newDataIO()
public void dataIO(ReductionData data)
data
- the data to usepublic abstract void setMergedData(ReductionData data)
ReductionFunction
s that use this
data collector act like regular AnalyticsValue
classes that
can be accessed through their get<value-type>
methods.
(FOR CLOUD)data
- the merged data to compute a reduction forpublic abstract void setData(ReductionData data)
ReductionFunction
s that use this
data collector act like regular AnalyticsValue
classes that
can be accessed through their get<value-type>
methods.
(FOR SINGLE-SHARD)data
- the collected data to compute a reduction forpublic abstract String getName()
public abstract String getExpressionStr()
ReductionDataCollector
syncing. Since the string should be unique,
only one of expression is kept.Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.