public abstract class UDFunction extends AbstractFunction implements ScalarFunction
AssignmentTestable.TestResult| Modifier and Type | Field and Description |
|---|---|
protected com.datastax.driver.core.DataType[] |
argDataTypes |
protected java.util.List<ColumnIdentifier> |
argNames |
protected java.lang.String |
body |
protected boolean |
calledOnNullInput |
protected java.lang.String |
language |
protected static org.slf4j.Logger |
logger |
protected com.datastax.driver.core.DataType |
returnDataType |
argTypes, name, returnType| Modifier | Constructor and Description |
|---|---|
protected |
UDFunction(FunctionName name,
java.util.List<ColumnIdentifier> argNames,
java.util.List<AbstractType<?>> argTypes,
AbstractType<?> returnType,
boolean calledOnNullInput,
java.lang.String language,
java.lang.String body) |
protected |
UDFunction(FunctionName name,
java.util.List<ColumnIdentifier> argNames,
java.util.List<AbstractType<?>> argTypes,
com.datastax.driver.core.DataType[] argDataTypes,
AbstractType<?> returnType,
com.datastax.driver.core.DataType returnDataType,
boolean calledOnNullInput,
java.lang.String language,
java.lang.String body) |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<ColumnIdentifier> |
argNames() |
java.lang.String |
body() |
protected boolean |
compose_boolean(int protocolVersion,
int argIndex,
java.nio.ByteBuffer value) |
protected byte |
compose_byte(int protocolVersion,
int argIndex,
java.nio.ByteBuffer value) |
protected double |
compose_double(int protocolVersion,
int argIndex,
java.nio.ByteBuffer value) |
protected float |
compose_float(int protocolVersion,
int argIndex,
java.nio.ByteBuffer value) |
protected int |
compose_int(int protocolVersion,
int argIndex,
java.nio.ByteBuffer value) |
protected long |
compose_long(int protocolVersion,
int argIndex,
java.nio.ByteBuffer value) |
protected short |
compose_short(int protocolVersion,
int argIndex,
java.nio.ByteBuffer value) |
protected java.lang.Object |
compose(int protocolVersion,
int argIndex,
java.nio.ByteBuffer value)
Used by UDF implementations (both Java code generated by
JavaSourceUDFFactory
and script executor ScriptBasedUDF) to convert the C*
serialized representation to the Java object representation. |
static UDFunction |
create(FunctionName name,
java.util.List<ColumnIdentifier> argNames,
java.util.List<AbstractType<?>> argTypes,
AbstractType<?> returnType,
boolean calledOnNullInput,
java.lang.String language,
java.lang.String body) |
static UDFunction |
createBrokenFunction(FunctionName name,
java.util.List<ColumnIdentifier> argNames,
java.util.List<AbstractType<?>> argTypes,
AbstractType<?> returnType,
boolean calledOnNullInput,
java.lang.String language,
java.lang.String body,
InvalidRequestException reason)
It can happen that a function has been declared (is listed in the scheam) but cannot
be loaded (maybe only on some nodes).
|
protected java.nio.ByteBuffer |
decompose(int protocolVersion,
java.lang.Object value)
Used by UDF implementations (both Java code generated by
JavaSourceUDFFactory
and script executor ScriptBasedUDF) to convert the Java
object representation for the return value to the C* serialized representation. |
boolean |
equals(java.lang.Object o) |
java.nio.ByteBuffer |
execute(int protocolVersion,
java.util.List<java.nio.ByteBuffer> parameters)
Applies this function to the specified parameter.
|
protected abstract java.nio.ByteBuffer |
executeUserDefined(int protocolVersion,
java.util.List<java.nio.ByteBuffer> parameters) |
int |
hashCode() |
boolean |
isAggregate()
Checks whether the function is an aggregate function or not.
|
boolean |
isCallableWrtNullable(java.util.List<java.nio.ByteBuffer> parameters) |
boolean |
isCalledOnNullInput() |
boolean |
isNative()
Checks whether the function is a native/hard coded one or not.
|
java.lang.String |
language() |
void |
userTypeUpdated(java.lang.String ksName,
java.lang.String typeName) |
argTypes, getFunctions, hasReferenceTo, name, returnType, testAssignment, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitargTypes, getFunctions, hasReferenceTo, name, returnTypetestAssignmentprotected static final org.slf4j.Logger logger
protected final java.util.List<ColumnIdentifier> argNames
protected final java.lang.String language
protected final java.lang.String body
protected final com.datastax.driver.core.DataType[] argDataTypes
protected final com.datastax.driver.core.DataType returnDataType
protected final boolean calledOnNullInput
protected UDFunction(FunctionName name, java.util.List<ColumnIdentifier> argNames, java.util.List<AbstractType<?>> argTypes, AbstractType<?> returnType, boolean calledOnNullInput, java.lang.String language, java.lang.String body)
protected UDFunction(FunctionName name, java.util.List<ColumnIdentifier> argNames, java.util.List<AbstractType<?>> argTypes, com.datastax.driver.core.DataType[] argDataTypes, AbstractType<?> returnType, com.datastax.driver.core.DataType returnDataType, boolean calledOnNullInput, java.lang.String language, java.lang.String body)
public static UDFunction create(FunctionName name, java.util.List<ColumnIdentifier> argNames, java.util.List<AbstractType<?>> argTypes, AbstractType<?> returnType, boolean calledOnNullInput, java.lang.String language, java.lang.String body) throws InvalidRequestException
InvalidRequestExceptionpublic static UDFunction createBrokenFunction(FunctionName name, java.util.List<ColumnIdentifier> argNames, java.util.List<AbstractType<?>> argTypes, AbstractType<?> returnType, boolean calledOnNullInput, java.lang.String language, java.lang.String body, InvalidRequestException reason)
public final java.nio.ByteBuffer execute(int protocolVersion,
java.util.List<java.nio.ByteBuffer> parameters)
throws InvalidRequestException
ScalarFunctionexecute in interface ScalarFunctionprotocolVersion - protocol version used for parameters and return valueparameters - the input parametersInvalidRequestException - if this function cannot not be applied to the parameterpublic boolean isCallableWrtNullable(java.util.List<java.nio.ByteBuffer> parameters)
protected abstract java.nio.ByteBuffer executeUserDefined(int protocolVersion,
java.util.List<java.nio.ByteBuffer> parameters)
throws InvalidRequestException
InvalidRequestExceptionpublic boolean isAggregate()
FunctionisAggregate in interface Functiontrue if the function is an aggregate function, false otherwise.public boolean isNative()
Functionpublic boolean isCalledOnNullInput()
isCalledOnNullInput in interface ScalarFunctionpublic java.util.List<ColumnIdentifier> argNames()
public java.lang.String body()
public java.lang.String language()
protected java.lang.Object compose(int protocolVersion,
int argIndex,
java.nio.ByteBuffer value)
JavaSourceUDFFactory
and script executor ScriptBasedUDF) to convert the C*
serialized representation to the Java object representation.protocolVersion - the native protocol version used for serializationargIndex - index of the UDF input argumentprotected float compose_float(int protocolVersion,
int argIndex,
java.nio.ByteBuffer value)
protected double compose_double(int protocolVersion,
int argIndex,
java.nio.ByteBuffer value)
protected byte compose_byte(int protocolVersion,
int argIndex,
java.nio.ByteBuffer value)
protected short compose_short(int protocolVersion,
int argIndex,
java.nio.ByteBuffer value)
protected int compose_int(int protocolVersion,
int argIndex,
java.nio.ByteBuffer value)
protected long compose_long(int protocolVersion,
int argIndex,
java.nio.ByteBuffer value)
protected boolean compose_boolean(int protocolVersion,
int argIndex,
java.nio.ByteBuffer value)
protected java.nio.ByteBuffer decompose(int protocolVersion,
java.lang.Object value)
JavaSourceUDFFactory
and script executor ScriptBasedUDF) to convert the Java
object representation for the return value to the C* serialized representation.protocolVersion - the native protocol version used for serializationpublic boolean equals(java.lang.Object o)
equals in class AbstractFunctionpublic int hashCode()
hashCode in class AbstractFunctionpublic void userTypeUpdated(java.lang.String ksName,
java.lang.String typeName)
Copyright © 2018 The Apache Software Foundation