Class CountCollector
- java.lang.Object
-
- org.apache.solr.analytics.function.reduction.data.ReductionDataCollector<CountCollector.CountData>
-
- org.apache.solr.analytics.function.reduction.data.CountCollector
-
- Direct Known Subclasses:
CountCollector.ExpressionCountCollector,CountCollector.TotalCountCollector
public abstract class CountCollector extends ReductionDataCollector<CountCollector.CountData>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCountCollector.CountDatastatic classCountCollector.ExpressionCountCollectorRepresents acount(expr)expression.static classCountCollector.TotalCountCollectorRepresents acount()expression.
-
Field Summary
Fields Modifier and Type Field Description static Stringname-
Fields inherited from class org.apache.solr.analytics.function.reduction.data.ReductionDataCollector
collectionTargets, ioData, lastingTargets
-
-
Constructor Summary
Constructors Constructor Description CountCollector(String exprStr)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longcount()The number of Solr Documents for which the given analytics expression exists.longdocCount()The number of Solr Documents used in this reduction.StringgetExpressionStr()The unique expression string of the reduction data collector, given all inputs and parameters.StringgetName()Get the name of the reduction data collector.CountCollector.CountDatanewData()A clean slate to start a new reduction.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.ReductionDataCollector
addCollectTarget, addLastingCollectTarget, apply, clearLastingCollectTargets, collect, collectAndApply, dataIO, newDataIO, newDataTarget
-
-
-
-
Field Detail
-
name
public static final String name
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CountCollector
public CountCollector(String exprStr)
-
-
Method Detail
-
count
public long count()
The number of Solr Documents for which the given analytics expression exists.- Returns:
- the count
-
docCount
public long docCount()
The number of Solr Documents used in this reduction.- Returns:
- the number of documents
-
newData
public CountCollector.CountData newData()
Description copied from class:ReductionDataCollectorA clean slate to start a new reduction.- Specified by:
newDatain classReductionDataCollector<CountCollector.CountData>- Returns:
- the new reduction data
-
submitReservations
public void submitReservations(Consumer<ReductionDataReservation<?,?>> consumer)
Description copied from class:ReductionDataCollectorSubmits the data reservations needed for this data collector.- Specified by:
submitReservationsin classReductionDataCollector<CountCollector.CountData>- Parameters:
consumer- the consumer which the reservations are submitted to
-
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)
- Specified by:
setMergedDatain classReductionDataCollector<CountCollector.CountData>- 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)
- Specified by:
setDatain classReductionDataCollector<CountCollector.CountData>- Parameters:
data- the collected data to compute a reduction for
-
getName
public String getName()
Description copied from class:ReductionDataCollectorGet the name of the reduction data collector. This is the same across all instances of the data collector.- Specified by:
getNamein classReductionDataCollector<CountCollector.CountData>- Returns:
- the name
-
getExpressionStr
public String getExpressionStr()
Description copied from class:ReductionDataCollectorThe unique expression string of the reduction data collector, given all inputs and parameters. Used duringReductionDataCollectorsyncing. Since the string should be unique, only one of expression is kept.- Specified by:
getExpressionStrin classReductionDataCollector<CountCollector.CountData>- Returns:
- the expression string
-
-