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() |
static void |
assertUdfsEnabled(java.lang.String language) |
java.lang.String |
body() |
protected static java.lang.Object |
compose(com.datastax.driver.core.DataType[] argDataTypes,
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
JavaBasedUDFunction
and script executor ScriptBasedUDFunction ) 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 static java.nio.ByteBuffer |
decompose(com.datastax.driver.core.DataType dataType,
int protocolVersion,
java.lang.Object value) |
protected java.nio.ByteBuffer |
decompose(int protocolVersion,
java.lang.Object value)
Used by UDF implementations (both Java code generated by
JavaBasedUDFunction
and script executor ScriptBasedUDFunction ) 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) |
protected abstract java.util.concurrent.ExecutorService |
executor() |
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, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
argTypes, getFunctions, hasReferenceTo, name, returnType
testAssignment
protected 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)
public 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)
ScalarFunction
execute
in interface ScalarFunction
protocolVersion
- protocol version used for parameters and return valueparameters
- the input parameterspublic static void assertUdfsEnabled(java.lang.String language)
protected abstract java.util.concurrent.ExecutorService executor()
public boolean isCallableWrtNullable(java.util.List<java.nio.ByteBuffer> parameters)
protected abstract java.nio.ByteBuffer executeUserDefined(int protocolVersion, java.util.List<java.nio.ByteBuffer> parameters)
public boolean isAggregate()
Function
isAggregate
in interface Function
true
if the function is an aggregate function, false
otherwise.public boolean isNative()
Function
public boolean isCalledOnNullInput()
isCalledOnNullInput
in interface ScalarFunction
public 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)
JavaBasedUDFunction
and script executor ScriptBasedUDFunction
) 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 static java.lang.Object compose(com.datastax.driver.core.DataType[] argDataTypes, int protocolVersion, int argIndex, java.nio.ByteBuffer value)
protected java.nio.ByteBuffer decompose(int protocolVersion, java.lang.Object value)
JavaBasedUDFunction
and script executor ScriptBasedUDFunction
) to convert the Java
object representation for the return value to the C* serialized representation.protocolVersion
- the native protocol version used for serializationprotected static java.nio.ByteBuffer decompose(com.datastax.driver.core.DataType dataType, int protocolVersion, java.lang.Object value)
public boolean equals(java.lang.Object o)
equals
in class AbstractFunction
public int hashCode()
hashCode
in class AbstractFunction
public void userTypeUpdated(java.lang.String ksName, java.lang.String typeName)
Copyright © 2015 The Apache Software Foundation