public abstract class UDFunction extends AbstractFunction implements ScalarFunction
AssignmentTestable.TestResult| Modifier and Type | Field and Description | 
|---|---|
| protected com.datastax.driver.core.TypeCodec<java.lang.Object>[] | argCodecs | 
| 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.TypeCodec<java.lang.Object> | returnCodec | 
| protected UDFContext | udfContext | 
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 java.lang.Object | compose(ProtocolVersion protocolVersion,
       int argIndex,
       java.nio.ByteBuffer value)Used by UDF implementations (both Java code generated by  JavaBasedUDFunctionand script executorScriptBasedUDFunction) to convert the C*
 serialized representation to the Java object representation. | 
| protected static java.lang.Object | compose(com.datastax.driver.core.TypeCodec<java.lang.Object>[] codecs,
       ProtocolVersion protocolVersion,
       int argIndex,
       java.nio.ByteBuffer value) | 
| 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(ProtocolVersion protocolVersion,
         java.lang.Object value)Used by UDF implementations (both Java code generated by  JavaBasedUDFunctionand script executorScriptBasedUDFunction) to convert the Java
 object representation for the return value to the C* serialized representation. | 
| protected static java.nio.ByteBuffer | decompose(com.datastax.driver.core.TypeCodec<java.lang.Object> codec,
         ProtocolVersion protocolVersion,
         java.lang.Object value) | 
| boolean | equals(java.lang.Object o) | 
| java.nio.ByteBuffer | execute(ProtocolVersion protocolVersion,
       java.util.List<java.nio.ByteBuffer> parameters)Applies this function to the specified parameter. | 
| protected abstract java.lang.Object | executeAggregateUserDefined(ProtocolVersion protocolVersion,
                           java.lang.Object firstParam,
                           java.util.List<java.nio.ByteBuffer> parameters) | 
| java.lang.Object | executeForAggregate(ProtocolVersion protocolVersion,
                   java.lang.Object firstParam,
                   java.util.List<java.nio.ByteBuffer> parameters)Like  ScalarFunction.execute(ProtocolVersion, List)but the first parameter is already in non-serialized form. | 
| protected abstract java.nio.ByteBuffer | executeUserDefined(ProtocolVersion 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) | 
addFunctionsTo, argTypes, columnName, hasReferenceTo, name, returnType, testAssignment, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddFunctionsTo, argTypes, columnName, 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.TypeCodec<java.lang.Object>[] argCodecs
protected final com.datastax.driver.core.TypeCodec<java.lang.Object> returnCodec
protected final boolean calledOnNullInput
protected final UDFContext udfContext
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(ProtocolVersion protocolVersion, java.util.List<java.nio.ByteBuffer> parameters)
ScalarFunctionexecute in interface ScalarFunctionprotocolVersion - protocol version used for parameters and return valueparameters - the input parameterspublic final java.lang.Object executeForAggregate(ProtocolVersion protocolVersion, java.lang.Object firstParam, java.util.List<java.nio.ByteBuffer> parameters)
ScalarFunction.execute(ProtocolVersion, List) but the first parameter is already in non-serialized form.
 Remaining parameters (2nd paramters and all others) are in parameters.
 This is used to prevent superfluous (de)serialization of the state of aggregates.
 Means: scalar functions of aggregates are called using this variant.public 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(ProtocolVersion protocolVersion, java.util.List<java.nio.ByteBuffer> parameters)
protected abstract java.lang.Object executeAggregateUserDefined(ProtocolVersion protocolVersion, java.lang.Object firstParam, java.util.List<java.nio.ByteBuffer> parameters)
public 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(ProtocolVersion 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.TypeCodec<java.lang.Object>[] codecs,
                                          ProtocolVersion protocolVersion,
                                          int argIndex,
                                          java.nio.ByteBuffer value)
protected java.nio.ByteBuffer decompose(ProtocolVersion 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.TypeCodec<java.lang.Object> codec,
                                               ProtocolVersion protocolVersion,
                                               java.lang.Object value)
public 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