org.apache.pig.impl.plan
Class PlanValidator<O extends Operator,P extends OperatorPlan<O>>

java.lang.Object
  extended by org.apache.pig.impl.plan.PlanValidator<O,P>
Type Parameters:
P -
Direct Known Subclasses:
InputOutputFileValidator, SchemaAliasValidator, TypeCheckingValidator

public abstract class PlanValidator<O extends Operator,P extends OperatorPlan<O>>
extends Object

Master of all plan validation classes.


Constructor Summary
PlanValidator()
           
 
Method Summary
abstract  void validate(P plan, CompilationMessageCollector messageCollector)
          If there are errors during validation, all of the errors have to be collected in the supplied messageCollector.
protected  void validate(PlanVisitor<O,P> visitor, CompilationMessageCollector messageCollector)
          This convenient method is used when: - if an exception being thrown from the current validation logic indicates that the whole validation pipeline should stop.
protected  void validateSkipCollectException(PlanVisitor<O,P> visitor, CompilationMessageCollector messageCollector)
          This convenient method is used when: - if an exception being thrown from the current validation logic indicates that the whole validation pipeline should stop.
protected  void validateTolerateException(PlanVisitor<O,P> visitor, CompilationMessageCollector messageCollector)
          This convenient method is used when: - if an exception being thrown from the current validation logic indicates that the whole validation pipeline should keep going by continuing with the next validation logic in the pipeline (skip the rest of the current logic)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlanValidator

public PlanValidator()
Method Detail

validate

public abstract void validate(P plan,
                              CompilationMessageCollector messageCollector)
                       throws PlanValidationException
If there are errors during validation, all of the errors have to be collected in the supplied messageCollector. The exception should be thrown only when the validation logic finds something too bad that other validation logics should not try to do more work.

Throws:
PlanValidationException

validate

protected void validate(PlanVisitor<O,P> visitor,
                        CompilationMessageCollector messageCollector)
                 throws PlanValidationException
This convenient method is used when: - if an exception being thrown from the current validation logic indicates that the whole validation pipeline should stop.

Parameters:
visitor -
messageCollector -
Throws:
PlanValidationException

validateTolerateException

protected void validateTolerateException(PlanVisitor<O,P> visitor,
                                         CompilationMessageCollector messageCollector)
                                  throws PlanValidationException
This convenient method is used when: - if an exception being thrown from the current validation logic indicates that the whole validation pipeline should keep going by continuing with the next validation logic in the pipeline (skip the rest of the current logic)

Parameters:
visitor -
messageCollector -
Throws:
PlanValidationException

validateSkipCollectException

protected void validateSkipCollectException(PlanVisitor<O,P> visitor,
                                            CompilationMessageCollector messageCollector)
                                     throws PlanValidationException
This convenient method is used when: - if an exception being thrown from the current validation logic indicates that the whole validation pipeline should stop. This method also assumes that the appropriate error message has already been recorded in the message collector so there is no need to duplicate the error message again here.

Parameters:
visitor -
messageCollector -
Throws:
PlanValidationException


Copyright © ${year} The Apache Software Foundation