Class UDAggregate
- java.lang.Object
-
- org.apache.cassandra.cql3.functions.AbstractFunction
-
- org.apache.cassandra.cql3.functions.UDAggregate
-
- All Implemented Interfaces:
AssignmentTestable,AggregateFunction,Function,SchemaElement
public class UDAggregate extends AbstractFunction implements AggregateFunction, SchemaElement
Base class for user-defined-aggregates.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.cassandra.cql3.functions.AggregateFunction
AggregateFunction.Aggregate
-
Nested classes/interfaces inherited from interface org.apache.cassandra.cql3.AssignmentTestable
AssignmentTestable.TestResult
-
Nested classes/interfaces inherited from interface org.apache.cassandra.cql3.SchemaElement
SchemaElement.SchemaElementType
-
-
Field Summary
Fields Modifier and Type Field Description protected java.nio.ByteBufferinitcondprotected static org.slf4j.Loggerlogger-
Fields inherited from class org.apache.cassandra.cql3.functions.AbstractFunction
argTypes, name, returnType
-
Fields inherited from interface org.apache.cassandra.cql3.functions.Function
UNRESOLVED
-
Fields inherited from interface org.apache.cassandra.cql3.SchemaElement
NAME_COMPARATOR
-
-
Constructor Summary
Constructors Constructor Description UDAggregate(FunctionName name, java.util.List<AbstractType<?>> argTypes, AbstractType<?> returnType, ScalarFunction stateFunc, ScalarFunction finalFunc, java.nio.ByteBuffer initcond)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFunctionsTo(java.util.List<Function> functions)java.util.Optional<Difference>compare(Function function)static UDAggregatecreate(java.util.Collection<UDFunction> functions, FunctionName name, java.util.List<AbstractType<?>> argTypes, AbstractType<?> returnType, FunctionName stateFunc, FunctionName finalFunc, AbstractType<?> stateType, java.nio.ByteBuffer initcond)SchemaElement.SchemaElementTypeelementType()Return the schema element typebooleanequals(java.lang.Object o)ScalarFunctionfinalFunction()inthashCode()booleanhasReferenceTo(Function function)java.nio.ByteBufferinitialCondition()booleanisAggregate()Checks whether the function is an aggregate function or not.booleanisNative()Checks whether the function is a native/hard coded one or not.booleanisPure()Checks whether the function is a pure function (as in doesn't depend on, nor produces side effects) or not.AggregateFunction.AggregatenewAggregate()Creates a newAggregateinstance.booleanreferencesUserType(java.nio.ByteBuffer name)ScalarFunctionstateFunction()AbstractType<?>stateType()java.lang.StringtoCqlString(boolean withInternals, boolean ifNotExists)Returns a CQL representation of this elementUDAggregatewithUpdatedUserType(java.util.Collection<UDFunction> udfs, UserType udt)-
Methods inherited from class org.apache.cassandra.cql3.functions.AbstractFunction
argTypes, argumentsList, columnName, elementKeyspace, elementName, name, returnType, testAssignment, toCqlString, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.cassandra.cql3.AssignmentTestable
testAssignment
-
Methods inherited from interface org.apache.cassandra.cql3.functions.Function
argTypes, columnName, name, returnType
-
Methods inherited from interface org.apache.cassandra.cql3.SchemaElement
elementKeyspace, elementKeyspaceQuotedIfNeeded, elementName, elementNameQuotedIfNeeded
-
-
-
-
Constructor Detail
-
UDAggregate
public UDAggregate(FunctionName name, java.util.List<AbstractType<?>> argTypes, AbstractType<?> returnType, ScalarFunction stateFunc, ScalarFunction finalFunc, java.nio.ByteBuffer initcond)
-
-
Method Detail
-
create
public static UDAggregate create(java.util.Collection<UDFunction> functions, FunctionName name, java.util.List<AbstractType<?>> argTypes, AbstractType<?> returnType, FunctionName stateFunc, FunctionName finalFunc, AbstractType<?> stateType, java.nio.ByteBuffer initcond)
-
isPure
public boolean isPure()
Description copied from interface:FunctionChecks whether the function is a pure function (as in doesn't depend on, nor produces side effects) or not.
-
hasReferenceTo
public boolean hasReferenceTo(Function function)
-
referencesUserType
public boolean referencesUserType(java.nio.ByteBuffer name)
- Specified by:
referencesUserTypein interfaceFunction- Overrides:
referencesUserTypein classAbstractFunction
-
withUpdatedUserType
public UDAggregate withUpdatedUserType(java.util.Collection<UDFunction> udfs, UserType udt)
-
addFunctionsTo
public void addFunctionsTo(java.util.List<Function> functions)
- Specified by:
addFunctionsToin interfaceFunction- Overrides:
addFunctionsToin classAbstractFunction
-
isAggregate
public boolean isAggregate()
Description copied from interface:FunctionChecks whether the function is an aggregate function or not.- Specified by:
isAggregatein interfaceFunction- Returns:
trueif the function is an aggregate function,falseotherwise.
-
isNative
public boolean isNative()
Description copied from interface:FunctionChecks whether the function is a native/hard coded one or not.
-
stateFunction
public ScalarFunction stateFunction()
-
finalFunction
public ScalarFunction finalFunction()
-
initialCondition
public java.nio.ByteBuffer initialCondition()
-
stateType
public AbstractType<?> stateType()
-
newAggregate
public AggregateFunction.Aggregate newAggregate() throws InvalidRequestException
Description copied from interface:AggregateFunctionCreates a newAggregateinstance.- Specified by:
newAggregatein interfaceAggregateFunction- Returns:
- a new
Aggregateinstance. - Throws:
InvalidRequestException
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classAbstractFunction
-
compare
public java.util.Optional<Difference> compare(Function function)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractFunction
-
elementType
public SchemaElement.SchemaElementType elementType()
Description copied from interface:SchemaElementReturn the schema element type- Specified by:
elementTypein interfaceSchemaElement- Returns:
- the schema element type
-
toCqlString
public java.lang.String toCqlString(boolean withInternals, boolean ifNotExists)Description copied from interface:SchemaElementReturns a CQL representation of this element- Specified by:
toCqlStringin interfaceSchemaElement- Parameters:
withInternals- if the internals part of the CQL should be exposed.ifNotExists- if "IF NOT EXISTS" should be included.- Returns:
- a CQL representation of this element
-
-