Class CountCollector.ExpressionCountCollector
- java.lang.Object
-
- org.apache.solr.analytics.function.reduction.data.ReductionDataCollector<CountCollector.CountData>
-
- org.apache.solr.analytics.function.reduction.data.CountCollector
-
- org.apache.solr.analytics.function.reduction.data.CountCollector.ExpressionCountCollector
-
- Enclosing class:
- CountCollector
public static class CountCollector.ExpressionCountCollector extends CountCollector
Represents acount(expr)
expression. This collects 3 values:docCount - The number of Solr Documents for which the wrapped expression exists. count - The number of values which wrapped expression contains. missing - The number of Solr Documents for which the wrapped expression does not exist.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.solr.analytics.function.reduction.data.CountCollector
CountCollector.CountData, CountCollector.ExpressionCountCollector, CountCollector.TotalCountCollector
-
-
Field Summary
-
Fields inherited from class org.apache.solr.analytics.function.reduction.data.CountCollector
name
-
Fields inherited from class org.apache.solr.analytics.function.reduction.data.ReductionDataCollector
collectionTargets, ioData, lastingTargets
-
-
Constructor Summary
Constructors Constructor Description ExpressionCountCollector(AnalyticsValueStream param)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
apply(CountCollector.CountData data)
Apply the collected info to the given reduction data.void
collect()
Collect the information from current Solr Document.long
missing()
The number of Solr Documents for which the given analytics expression does not exist.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.-
Methods inherited from class org.apache.solr.analytics.function.reduction.data.CountCollector
count, docCount, getExpressionStr, getName, newData
-
Methods inherited from class org.apache.solr.analytics.function.reduction.data.ReductionDataCollector
addCollectTarget, addLastingCollectTarget, clearLastingCollectTargets, collectAndApply, dataIO, newDataIO, newDataTarget
-
-
-
-
Constructor Detail
-
ExpressionCountCollector
public ExpressionCountCollector(AnalyticsValueStream param)
-
-
Method Detail
-
missing
public long missing()
The number of Solr Documents for which the given analytics expression does not exist.- Returns:
- the number of missing values
-
setMergedData
public void setMergedData(ReductionData data)
Description copied from class:ReductionDataCollector
Finalize the reduction with the merged data stored in the parameter. Once the reduction is finalized, theReductionFunction
s that use this data collector act like regularAnalyticsValue
classes that can be accessed through theirget<value-type>
methods.(FOR CLOUD)
- Overrides:
setMergedData
in classCountCollector
- Parameters:
data
- the merged data to compute a reduction for
-
setData
public void setData(ReductionData data)
Description copied from class:ReductionDataCollector
Finalize the reduction with the collected data stored in the parameter. Once the reduction is finalized, theReductionFunction
s that use this data collector act like regularAnalyticsValue
classes that can be accessed through theirget<value-type>
methods.(FOR SINGLE-SHARD)
- Overrides:
setData
in classCountCollector
- Parameters:
data
- the collected data to compute a reduction for
-
collect
public void collect()
Description copied from class:ReductionDataCollector
Collect the information from current Solr Document.- Overrides:
collect
in classReductionDataCollector<CountCollector.CountData>
-
apply
protected void apply(CountCollector.CountData data)
Description copied from class:ReductionDataCollector
Apply the collected info to the given reduction data. Should always be called after aReductionDataCollector.collect()
call.- Specified by:
apply
in classReductionDataCollector<CountCollector.CountData>
- Parameters:
data
- reduction data to apply collected info to
-
submitReservations
public void submitReservations(Consumer<ReductionDataReservation<?,?>> consumer)
Description copied from class:ReductionDataCollector
Submits the data reservations needed for this data collector.- Overrides:
submitReservations
in classCountCollector
- Parameters:
consumer
- the consumer which the reservations are submitted to
-
-