Interface UDFContext
-
- All Known Implementing Classes:
UDFContextImpl
public interface UDFContext
Provides context information for a particular user defined function. Java UDFs can access implementations of this interface using theudfContext
field, scripted UDFs can get it using theudfContext
binding.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TupleValue
newArgTupleValue(int argNum)
Creates a newTupleValue
instance for an argument.TupleValue
newArgTupleValue(java.lang.String argName)
Creates a newTupleValue
instance for an argument.UDTValue
newArgUDTValue(int argNum)
Creates a newUDTValue
instance for an argument.UDTValue
newArgUDTValue(java.lang.String argName)
Creates a newUDTValue
instance for an argument.TupleValue
newReturnTupleValue()
Creates a newTupleValue
instance for the return value.UDTValue
newReturnUDTValue()
Creates a newUDTValue
instance for the return value.TupleValue
newTupleValue(java.lang.String cqlDefinition)
Creates a newTupleValue
instance for the CQL type definition.UDTValue
newUDTValue(java.lang.String udtName)
Creates a newUDTValue
instance by name in the same keyspace.
-
-
-
Method Detail
-
newArgUDTValue
UDTValue newArgUDTValue(java.lang.String argName)
Creates a newUDTValue
instance for an argument.- Parameters:
argName
- name of the argument as declared in theCREATE FUNCTION
statement- Returns:
- a new
UDTValue
instance - Throws:
java.lang.IllegalArgumentException
- if no argument for the given name existsjava.lang.IllegalStateException
- if the argument is not a UDT
-
newArgUDTValue
UDTValue newArgUDTValue(int argNum)
Creates a newUDTValue
instance for an argument.- Parameters:
argNum
- zero-based index of the argument as declared in theCREATE FUNCTION
statement- Returns:
- a new
UDTValue
instance - Throws:
java.lang.ArrayIndexOutOfBoundsException
- if no argument for the given index existsjava.lang.IllegalStateException
- if the argument is not a UDT
-
newReturnUDTValue
UDTValue newReturnUDTValue()
Creates a newUDTValue
instance for the return value.- Returns:
- a new
UDTValue
instance - Throws:
java.lang.IllegalStateException
- if the return type is not a UDT
-
newUDTValue
UDTValue newUDTValue(java.lang.String udtName)
Creates a newUDTValue
instance by name in the same keyspace.- Parameters:
udtName
- name of the user defined type in the same keyspace as the function- Returns:
- a new
UDTValue
instance - Throws:
java.lang.IllegalArgumentException
- if no UDT for the given name exists
-
newArgTupleValue
TupleValue newArgTupleValue(java.lang.String argName)
Creates a newTupleValue
instance for an argument.- Parameters:
argName
- name of the argument as declared in theCREATE FUNCTION
statement- Returns:
- a new
TupleValue
instance - Throws:
java.lang.IllegalArgumentException
- if no argument for the given name existsjava.lang.IllegalStateException
- if the argument is not a tuple
-
newArgTupleValue
TupleValue newArgTupleValue(int argNum)
Creates a newTupleValue
instance for an argument.- Parameters:
argNum
- zero-based index of the argument as declared in theCREATE FUNCTION
statement- Returns:
- a new
TupleValue
instance - Throws:
java.lang.ArrayIndexOutOfBoundsException
- if no argument for the given index existsjava.lang.IllegalStateException
- if the argument is not a tuple
-
newReturnTupleValue
TupleValue newReturnTupleValue()
Creates a newTupleValue
instance for the return value.- Returns:
- a new
TupleValue
instance - Throws:
java.lang.IllegalStateException
- if the return type is not a tuple
-
newTupleValue
TupleValue newTupleValue(java.lang.String cqlDefinition)
Creates a newTupleValue
instance for the CQL type definition.- Parameters:
cqlDefinition
- CQL tuple type definition liketuple<int, text, bigint>
- Returns:
- a new
TupleValue
instance - Throws:
java.lang.IllegalStateException
- if cqlDefinition type is not a tuple or an invalid type
-
-