HostUDFWrapper#
- public abstract class 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
computeHashCodeandisEqualmethods for such purposes.Method Summary
Close the derived UDF instance created by createUDFInstance.
Create a derived host UDF native instance.
Methods
- public abstract long createUDFInstance()#
Create a derived host UDF native instance.
The instance created by this function MUST be closed by
closeUDFInstanceTypical 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); } }
- public abstract int computeHashCode()#
- public int hashCode()#
Static Methods
- public static void closeUDFInstance(long hostUDFInstance)#
Close the derived UDF instance created by
createUDFInstance.- Parameters:
hostUDFInstance – the UDF instance