Package org.apache.solr.analytics.value
Interface AnalyticsValueStream
-
- All Known Subinterfaces:
AnalyticsValue
,BooleanValue
,BooleanValue.CastingBooleanValue
,BooleanValueStream
,BooleanValueStream.CastingBooleanValueStream
,ComparableValue
,DateValue
,DateValue.CastingDateValue
,DateValueStream
,DateValueStream.CastingDateValueStream
,DoubleValue
,DoubleValue.CastingDoubleValue
,DoubleValueStream
,DoubleValueStream.CastingDoubleValueStream
,FloatValue
,FloatValue.CastingFloatValue
,FloatValueStream
,FloatValueStream.CastingFloatValueStream
,IntValue
,IntValue.CastingIntValue
,IntValueStream
,IntValueStream.CastingIntValueStream
,LongValue
,LongValue.CastingLongValue
,LongValueStream
,LongValueStream.CastingLongValueStream
,ReductionFunction
,StringValue
,StringValue.CastingStringValue
,StringValueStream
,StringValueStream.CastingStringValueStream
- All Known Implementing Classes:
AnalyticsField
,AnalyticsValue.AbstractAnalyticsValue
,AnalyticsValueStream.AbstractAnalyticsValueStream
,BooleanField
,BooleanMultiField
,BooleanValue.AbstractBooleanValue
,BooleanValueStream.AbstractBooleanValueStream
,ConstantBooleanValue
,ConstantDateValue
,ConstantDoubleValue
,ConstantFloatValue
,ConstantIntValue
,ConstantLongValue
,ConstantStringValue
,ConstantValue
,CountFunction
,DateField
,DateMultiPointField
,DateMultiTrieField
,DateValue.AbstractDateValue
,DateValueStream.AbstractDateValueStream
,DocCountFunction
,DoubleField
,DoubleMultiPointField
,DoubleMultiTrieField
,DoubleValue.AbstractDoubleValue
,DoubleValueStream.AbstractDoubleValueStream
,FloatField
,FloatMultiPointField
,FloatMultiTrieField
,FloatValue.AbstractFloatValue
,FloatValueStream.AbstractFloatValueStream
,IfFunction
,IntField
,IntMultiPointField
,IntMultiTrieField
,IntValue.AbstractIntValue
,IntValueStream.AbstractIntValueStream
,LongField
,LongMultiPointField
,LongMultiTrieField
,LongValue.AbstractLongValue
,LongValueStream.AbstractLongValueStream
,MeanFunction
,MissingFunction
,StringField
,StringMultiField
,StringValue.AbstractStringValue
,StringValueStream.AbstractStringValueStream
,SumFunction
,UniqueFunction
public interface AnalyticsValueStream
A multi-valued analytics value, the super-type of all Analytics value types.The back-end production of the value can change inbetween calls to
streamObjects(java.util.function.Consumer<java.lang.Object>)
, resulting in different values on each call.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
AnalyticsValueStream.AbstractAnalyticsValueStream
static class
AnalyticsValueStream.ExpressionType
The types of expressions.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description AnalyticsValueStream
convertToConstant()
Converts this value to aConstantValue
if it's expression type isAnalyticsValueStream.ExpressionType.CONST
.static String
createExpressionString(String funcName, AnalyticsValueStream... params)
Helper to create an expression string for a function.static AnalyticsValueStream.ExpressionType
determineMappingPhase(String exprString, AnalyticsValueStream... params)
Determine whether the expression is a unreduced mapping expression, a reduced mapping expression, or a constant.String
getExpressionStr()
Get the expression string of the analytics value stream.AnalyticsValueStream.ExpressionType
getExpressionType()
Get the type of the expression that this class represents.String
getName()
Get the name of function or value.void
streamObjects(Consumer<Object> cons)
Stream the object representations of all current values, if any exist.
-
-
-
Method Detail
-
getName
String getName()
Get the name of function or value.- Returns:
- the name of function/value
-
getExpressionStr
String getExpressionStr()
Get the expression string of the analytics value stream. Must be unique to the expression. If passed toExpressionFactory.createExpression(String)
, the exact same expression should be created.- Returns:
- the name of function/value
-
streamObjects
void streamObjects(Consumer<Object> cons)
Stream the object representations of all current values, if any exist.- Parameters:
cons
- The consumer to accept the values
-
convertToConstant
AnalyticsValueStream convertToConstant()
Converts this value to aConstantValue
if it's expression type isAnalyticsValueStream.ExpressionType.CONST
.If the value is reduced then no conversion will occur and the value itself will be returned.
- Returns:
- a constant representation of this value
-
getExpressionType
AnalyticsValueStream.ExpressionType getExpressionType()
Get the type of the expression that this class represents.- Returns:
- the expression type
-
createExpressionString
static String createExpressionString(String funcName, AnalyticsValueStream... params)
Helper to create an expression string for a function.- Parameters:
funcName
- the name of the functionparams
- the parameters of the function- Returns:
- a valid expression string for the function.
-
determineMappingPhase
static AnalyticsValueStream.ExpressionType determineMappingPhase(String exprString, AnalyticsValueStream... params) throws org.apache.solr.common.SolrException
Determine whether the expression is a unreduced mapping expression, a reduced mapping expression, or a constant.- Parameters:
exprString
- the string representing the expression, used when creating exceptionsparams
- the parameters- Returns:
- the expression type
- Throws:
org.apache.solr.common.SolrException
- if the params are incompatable types, for example if reduced and unreduced params are both included
-
-