Package ai.rapids.cudf
Class HostUDFWrapper
java.lang.Object
ai.rapids.cudf.HostUDFWrapper
A wrapper around native host UDF aggregations.
This class is used to create the native handle of a host UDF aggregation and is used as a proxy object to compute hash code and compare two host UDF aggregations for equality.
A new host UDF aggregation implementation must extend this class and override the
computeHashCode
and isEqual
methods for such purposes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
closeUDFInstance
(long hostUDFInstance) Close the derived UDF instance created by `createUDFInstance`.abstract int
abstract long
Create a derived host UDF native instance.boolean
int
hashCode()
abstract boolean
-
Constructor Details
-
HostUDFWrapper
public HostUDFWrapper()
-
-
Method Details
-
createUDFInstance
public abstract long createUDFInstance()Create a derived host UDF native instance. The instance created by this function MUST be closed by `closeUDFInstance`Typical usage, refer to Aggregation.java:
long udf = 0; try { udf = wrapper.createUDFInstance(); return Aggregation.createHostUDFAgg(udf); } finally { // a new UDF is cloned in `createHostUDFAgg`, here should close the UDF instance. if (udf != 0) { HostUDFWrapper.closeUDFInstance(udf); } }
-
closeUDFInstance
public static void closeUDFInstance(long hostUDFInstance) Close the derived UDF instance created by `createUDFInstance`.- Parameters:
hostUDFInstance
- the UDF instance
-
computeHashCode
public abstract int computeHashCode() -
hashCode
public int hashCode() -
isEqual
-
equals
-