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 voidapply(CountCollector.CountData data)Apply the collected info to the given reduction data.voidcollect()Collect the information from current Solr Document.longmissing()The number of Solr Documents for which the given analytics expression does not exist.voidsetData(ReductionData data)Finalize the reduction with the collected data stored in the parameter.voidsetMergedData(ReductionData data)Finalize the reduction with the merged data stored in the parameter.voidsubmitReservations(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:ReductionDataCollectorFinalize the reduction with the merged data stored in the parameter. Once the reduction is finalized, theReductionFunctions that use this data collector act like regularAnalyticsValueclasses that can be accessed through theirget<value-type>methods. (FOR CLOUD)- Overrides:
setMergedDatain classCountCollector- Parameters:
data- the merged data to compute a reduction for
-
setData
public void setData(ReductionData data)
Description copied from class:ReductionDataCollectorFinalize the reduction with the collected data stored in the parameter. Once the reduction is finalized, theReductionFunctions that use this data collector act like regularAnalyticsValueclasses that can be accessed through theirget<value-type>methods. (FOR SINGLE-SHARD)- Overrides:
setDatain classCountCollector- Parameters:
data- the collected data to compute a reduction for
-
collect
public void collect()
Description copied from class:ReductionDataCollectorCollect the information from current Solr Document.- Overrides:
collectin classReductionDataCollector<CountCollector.CountData>
-
apply
protected void apply(CountCollector.CountData data)
Description copied from class:ReductionDataCollectorApply the collected info to the given reduction data. Should always be called after aReductionDataCollector.collect()call.- Specified by:
applyin classReductionDataCollector<CountCollector.CountData>- Parameters:
data- reduction data to apply collected info to
-
submitReservations
public void submitReservations(Consumer<ReductionDataReservation<?,?>> consumer)
Description copied from class:ReductionDataCollectorSubmits the data reservations needed for this data collector.- Overrides:
submitReservationsin classCountCollector- Parameters:
consumer- the consumer which the reservations are submitted to
-
-