public void visit(TezOpPlanVisitor v) throws VisitorException {
v.visitTezOp(this);
}
public void runJob(String jobStatsKey) throws JobCreationException {
RunJarSecurityManager secMan = new RunJarSecurityManager();
try {
RunJar.main(getNativeTezParams());
((TezPigScriptStats)PigStats.get()).addTezJobStatsForNative(jobStatsKey, this, true);
} catch (SecurityException se) {
if(secMan.getExitInvoked()) {
if(secMan.getExitCode() != 0) {
throw new JobCreationException("Native job returned with non-zero return code");
}
else {
((TezPigScriptStats)PigStats.get()).addTezJobStatsForNative(jobStatsKey, this, true);
}
}
} catch (Throwable t) {
JobCreationException e = new JobCreationException(
"Cannot run native tez job "+ t.getMessage(), t);
((TezPigScriptStats)PigStats.get()).addTezJobStatsForNative(jobStatsKey, this, false);
throw e;
} finally {
secMan.retire();
}
}