@InterfaceAudience.Public
@InterfaceStability.Stable
public class JVMReuseManager
extends Object
This class is used to manage JVM Reuse in case of execution engines like Tez
and Spark.
Static data members of a UDF, LoadFunc or StoreFunc class
need to be reset or object references made null or reinitialized
when the jvm container is reused for new tasks.
Example usage to perform static data cleanup in a UDF as follows.
public class MyUDF extends EvalFunc {
private static int numInvocations = 0;
private static Reporter reporter;
static {
// Register this class for static data cleanup
JVMReuseManager.getInstance().registerForStaticDataCleanup(MyUDF.class);
}
// Write a public static method that performs the cleanup
// and annotate it with @StaticDataCleanup
- Since:
- Pig 0.14