public class SumCollector extends ReductionDataCollector<SumCollector.SumData>
DoubleValueStream
parameter.Modifier and Type | Class and Description |
---|---|
static class |
SumCollector.SumData |
Modifier and Type | Field and Description |
---|---|
static String |
name |
collectionTargets, ioData, lastingTargets
Constructor and Description |
---|
SumCollector(DoubleValueStream param) |
Modifier and Type | Method and Description |
---|---|
protected void |
apply(SumCollector.SumData data)
Apply the collected info to the given reduction data.
|
void |
collect()
Collect the information from current Solr Document.
|
boolean |
exists()
Return whether a sum exists.
|
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.
|
SumCollector.SumData |
newData()
A clean slate to start a new reduction.
|
void |
setData(ReductionData data)
Finalize the reduction with the collected data stored in the parameter.
|
void |
setMergedData(ReductionData data)
Finalize the reduction with the merged data stored in the parameter.
|
void |
submitReservations(Consumer<ReductionDataReservation<?,?>> consumer)
Submits the data reservations needed for this data collector.
|
double |
sum()
Return the sum of the set data
|
addCollectTarget, addLastingCollectTarget, clearLastingCollectTargets, collectAndApply, dataIO, newDataIO, newDataTarget
public static final String name
public SumCollector(DoubleValueStream param)
public double sum()
public boolean exists()
public SumCollector.SumData newData()
ReductionDataCollector
newData
in class ReductionDataCollector<SumCollector.SumData>
public void collect()
ReductionDataCollector
collect
in class ReductionDataCollector<SumCollector.SumData>
protected void apply(SumCollector.SumData data)
ReductionDataCollector
ReductionDataCollector.collect()
call.apply
in class ReductionDataCollector<SumCollector.SumData>
data
- reduction data to apply collected info topublic void submitReservations(Consumer<ReductionDataReservation<?,?>> consumer)
ReductionDataCollector
submitReservations
in class ReductionDataCollector<SumCollector.SumData>
consumer
- the consumer which the reservations are submitted topublic void setMergedData(ReductionData data)
ReductionDataCollector
ReductionFunction
s that use this
data collector act like regular AnalyticsValue
classes that
can be accessed through their get<value-type>
methods.
(FOR CLOUD)setMergedData
in class ReductionDataCollector<SumCollector.SumData>
data
- the merged data to compute a reduction forpublic void setData(ReductionData data)
ReductionDataCollector
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)setData
in class ReductionDataCollector<SumCollector.SumData>
data
- the collected data to compute a reduction forpublic String getName()
ReductionDataCollector
getName
in class ReductionDataCollector<SumCollector.SumData>
public String getExpressionStr()
ReductionDataCollector
ReductionDataCollector
syncing. Since the string should be unique,
only one of expression is kept.getExpressionStr
in class ReductionDataCollector<SumCollector.SumData>
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.