Details
Description
Pig has only builtin plan optimizer rules. Adding the possibility to load user defined and implemented Rule make it easier for people to work on plan optimizers. The idea behind this is to be able to push/propose new optimizer rule through the piggybank without touching pig core classes. I'm preparing some optimisations and so need this patch 1st.
User defined rules are classes that extend the abstract Rule class and configured through the pig property pig.optimizer.user.defined.rules by setting it to one or more named classes splitted using regex [,;:\t ]. These classes will be loaded using PigContext.getClassLoader() and if that fails use the current thread context class loader. Classes can have a PigContext one argument constructor, and if it does not exists the default constructor is used.