Class UDAggregate
- java.lang.Object
-
- org.apache.cassandra.cql3.functions.AbstractFunction
-
- org.apache.cassandra.cql3.functions.UserFunction
-
- org.apache.cassandra.cql3.functions.UDAggregate
-
- All Implemented Interfaces:
AssignmentTestable
,AggregateFunction
,Function
,SchemaElement
public class UDAggregate extends UserFunction implements AggregateFunction
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.ByteBuffer
initcond
protected static org.slf4j.Logger
logger
-
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 void
addFunctionsTo(java.util.List<Function> functions)
java.util.Optional<Difference>
compare(Function function)
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)
SchemaElement.SchemaElementType
elementType()
Return the schema element typeboolean
equals(java.lang.Object o)
ScalarFunction
finalFunction()
int
hashCode()
boolean
hasReferenceTo(Function function)
java.nio.ByteBuffer
initialCondition()
boolean
isAggregate()
Checks whether the function is an aggregate function or not.boolean
isPure()
Checks whether the function is a pure function (as in doesn't depend on, nor produces side effects) or not.AggregateFunction.Aggregate
newAggregate()
Creates a newAggregate
instance.Arguments
newArguments(ProtocolVersion version)
Creates some new input arguments for this function.boolean
referencesUserType(java.nio.ByteBuffer name)
ScalarFunction
stateFunction()
AbstractType<?>
stateType()
java.lang.String
toCqlString(boolean withInternals, boolean ifNotExists)
Returns a CQL representation of this elementUDAggregate
withUpdatedUserType(java.util.Collection<UDFunction> udfs, UserType udt)
-
Methods inherited from class org.apache.cassandra.cql3.functions.UserFunction
isNative
-
Methods inherited from class org.apache.cassandra.cql3.functions.AbstractFunction
argTypes, argumentsList, columnName, elementKeyspace, elementName, getCompatibleTypeIfKnown, name, returnType, testAssignment, toCqlString, toString, typesMatch
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.cassandra.cql3.AssignmentTestable
getCompatibleTypeIfKnown, testAssignment
-
Methods inherited from interface org.apache.cassandra.cql3.functions.Function
argTypes, columnName, isNative, 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:Function
Checks whether the function is a pure function (as in doesn't depend on, nor produces side effects) or not.
-
newArguments
public Arguments newArguments(ProtocolVersion version)
Description copied from interface:Function
Creates some new input arguments for this function.- Specified by:
newArguments
in interfaceFunction
- Parameters:
version
- the protocol version- Returns:
- some new input arguments for this function
-
hasReferenceTo
public boolean hasReferenceTo(Function function)
-
referencesUserType
public boolean referencesUserType(java.nio.ByteBuffer name)
- Specified by:
referencesUserType
in interfaceFunction
- Overrides:
referencesUserType
in classAbstractFunction
-
withUpdatedUserType
public UDAggregate withUpdatedUserType(java.util.Collection<UDFunction> udfs, UserType udt)
-
addFunctionsTo
public void addFunctionsTo(java.util.List<Function> functions)
- Specified by:
addFunctionsTo
in interfaceFunction
- Overrides:
addFunctionsTo
in classAbstractFunction
-
isAggregate
public boolean isAggregate()
Description copied from interface:Function
Checks whether the function is an aggregate function or not.- Specified by:
isAggregate
in interfaceFunction
- Returns:
true
if the function is an aggregate function,false
otherwise.
-
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:AggregateFunction
Creates a newAggregate
instance.- Specified by:
newAggregate
in interfaceAggregateFunction
- Returns:
- a new
Aggregate
instance. - Throws:
InvalidRequestException
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classAbstractFunction
-
compare
public java.util.Optional<Difference> compare(Function function)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAbstractFunction
-
elementType
public SchemaElement.SchemaElementType elementType()
Description copied from interface:SchemaElement
Return the schema element type- Specified by:
elementType
in interfaceSchemaElement
- Returns:
- the schema element type
-
toCqlString
public java.lang.String toCqlString(boolean withInternals, boolean ifNotExists)
Description copied from interface:SchemaElement
Returns a CQL representation of this element- Specified by:
toCqlString
in 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
-
-