MCPcopy Create free account
hub / github.com/apache/pig / getJobs

Method getJobs

src/org/apache/pig/PigServer.java:499–524  ·  view source on GitHub ↗

Retrieves a list of Job objects from the PigStats object @param stats @return A list of ExecJob objects

(PigStats stats)

Source from the content-addressed store, hash-verified

497 * @return A list of ExecJob objects
498 */
499 protected List<ExecJob> getJobs(PigStats stats) {
500 LinkedList<ExecJob> jobs = new LinkedList<ExecJob>();
501 if (stats instanceof EmptyPigStats) {
502 HJob job = new HJob(HJob.JOB_STATUS.COMPLETED, pigContext, stats.result(null)
503 .getPOStore(), null);
504 jobs.add(job);
505 return jobs;
506 }
507 JobGraph jGraph = stats.getJobGraph();
508 Iterator<JobStats> iter = jGraph.iterator();
509 while (iter.hasNext()) {
510 JobStats js = iter.next();
511 for (OutputStats output : js.getOutputs()) {
512 if (js.isSuccessful()) {
513 jobs.add(new HJob(HJob.JOB_STATUS.COMPLETED, pigContext, output
514 .getPOStore(), output.getAlias(), stats));
515 } else {
516 HJob hjob = new HJob(HJob.JOB_STATUS.FAILED, pigContext, output
517 .getPOStore(), output.getAlias(), stats);
518 hjob.setException(js.getException());
519 jobs.add(hjob);
520 }
521 }
522 }
523 return jobs;
524 }
525
526 /**
527 * Discards a batch of Pig commands.

Callers 1

executeBatchMethod · 0.95

Calls 12

iteratorMethod · 0.95
getOutputsMethod · 0.95
isSuccessfulMethod · 0.95
setExceptionMethod · 0.95
getExceptionMethod · 0.95
getPOStoreMethod · 0.65
addMethod · 0.65
getAliasMethod · 0.65
resultMethod · 0.45
getJobGraphMethod · 0.45
hasNextMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected