public static void spawnRemote(String jobName, String cassandraHost, int cassandraPort, String inputKeyspace, String inputColumnFamily, String outputKeyspace, String outputColumnFamily, String source, String params, String mapEmitFlag, String reduceRawDataFlag) throws Throwable { String[] args = JobSpawner.getArgs(jobName, cassandraHost, cassandraPort, inputKeyspace, inputColumnFamily, outputKeyspace, outputColumnFamily, source, params, mapEmitFlag, reduceRawDataFlag, false); RunJar.main(args); } }
public void testRunjar() throws Throwable { File outFile = new File(TEST_ROOT_DIR, "out"); // delete if output file already exists. if (outFile.exists()) { outFile.delete(); } String[] args = new String[3]; args[0] = "build/test/mapred/testjar/testjob.jar"; args[1] = "testjar.Hello"; args[2] = outFile.toString(); RunJar.main(args); assertTrue("RunJar failed", outFile.exists()); } }
public static void runJar(String[] argv) { try { RunJar.main(argv); } catch (Throwable t) { fail(t.getLocalizedMessage()); } }
/** * run method from Tool */ public int run(String argv[]) throws Exception { int exitCode = -1; Configuration conf = getConf(); try{ JobClient.setCommandLineConfig(conf); try { RunJar.main(argv); exitCode = 0; } catch(Throwable th) { System.err.println(StringUtils.stringifyException(th)); } } catch(RuntimeException re) { exitCode = -1; System.err.println(re.getLocalizedMessage()); } return exitCode; }
@Test public void testRunjar() throws Throwable { File outFile = new File(TEST_ROOT_DIR, "out"); // delete if output file already exists. if (outFile.exists()) { outFile.delete(); } File makeTestJar = makeTestJar(); String[] args = new String[3]; args[0] = makeTestJar.getAbsolutePath(); args[1] = "org.apache.hadoop.util.Hello"; args[2] = outFile.toString(); RunJar.main(args); Assert.assertTrue("RunJar failed", outFile.exists()); }
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(); } }
public void runJob() throws JobCreationException { RunJarSecurityManager secMan = new RunJarSecurityManager(); try { RunJar.main(getNativeMRParams()); MRPigStatsUtil.addNativeJobStats(PigStats.get(), this, true); } catch (SecurityException se) { if(secMan.getExitInvoked()) { if(secMan.getExitCode() != 0) { throw new JobCreationException("Native job returned with non-zero return code"); } else { MRPigStatsUtil.addNativeJobStats(PigStats.get(), this, true); } } } catch (Throwable t) { JobCreationException e = new JobCreationException( "Cannot run native mapreduce job "+ t.getMessage(), t); MRPigStatsUtil.addNativeJobStats(PigStats.get(), this, false, e); throw e; } finally { secMan.retire(); } }
public void runJob() throws JobCreationException { RunJarSecurityManager secMan = new RunJarSecurityManager(); try { RunJar.main(getNativeMRParams()); SparkStatsUtil.addNativeJobStats(PigStats.get(), this); } catch (SecurityException se) { //java.lang.reflect.InvocationTargetException if (secMan.getExitInvoked()) { if (secMan.getExitCode() != 0) { JobCreationException e = new JobCreationException("Native job returned with non-zero return code"); SparkStatsUtil.addFailedNativeJobStats(PigStats.get(), this, e); } else { SparkStatsUtil.addNativeJobStats(PigStats.get(), this); } } } catch (Throwable t) { JobCreationException e = new JobCreationException( "Cannot run native spark job " + t.getMessage(), t); SparkStatsUtil.addFailedNativeJobStats(PigStats.get(), this, e); throw e; } finally { secMan.retire(); } }