Package org.apache.crunch

Examples of org.apache.crunch.PipelineExecution


  }

  @Override
  public PipelineResult run() {
    try {
      PipelineExecution exec = runAsync();
      exec.waitUntilDone();
      return exec.getResult();
    } catch (Exception e) {
      // TODO: How to handle this without changing signature?
      // LOG.error("Exception running pipeline", e);
      return PipelineResult.EMPTY;
    }
View Full Code Here


  }

  @Override
  public PipelineResult run() {
    try {
      PipelineExecution exec = runAsync();
      exec.waitUntilDone();
      return exec.getResult();
    } catch (Exception e) {
      LOG.error("Exception running pipeline", e);
      return PipelineResult.EMPTY;
    }
  }
View Full Code Here

  }

  @Override
  public PipelineExecution runAsync() {
    activeTargets.clear();
    return new PipelineExecution() {
      @Override
      public String getPlanDotFile() {
        return "";
      }
View Full Code Here

  }

  @Override
  public PipelineResult run() {
    try {
      PipelineExecution pipelineExecution = runAsync();
      pipelineExecution.waitUntilDone();
      return pipelineExecution.getResult();
    } catch (InterruptedException e) {
      // TODO: How to handle this without changing signature?
      LOG.error("Exception running pipeline", e);
      return PipelineResult.EMPTY;
    }
View Full Code Here

  }

  @Override
  public PipelineExecution runAsync() {
    activeTargets.clear();
    return new PipelineExecution() {
      @Override
      public String getPlanDotFile() {
        return "";
      }
View Full Code Here

  }

  @Override
  public PipelineResult run() {
    try {
      PipelineExecution pipelineExecution = runAsync();
      pipelineExecution.waitUntilDone();
      return pipelineExecution.getResult();
    } catch (InterruptedException e) {
      // TODO: How to handle this without changing signature?
      LOG.error("Exception running pipeline", e);
      return PipelineResult.EMPTY;
    }
View Full Code Here

    }
  }
 
  @Override
  public PipelineExecution runAsync() {
    PipelineExecution res = plan().execute();
    outputTargets.clear();
    return res;
  }
View Full Code Here

  }

  @Override
  public PipelineResult run() {
    try {
      PipelineExecution exec = runAsync();
      exec.waitUntilDone();
      return exec.getResult();
    } catch (Exception e) {
      LOG.error("Exception running pipeline", e);
      return PipelineResult.EMPTY;
    }
  }
View Full Code Here

    Pipeline pipeline = new MRPipeline(FailIT.class, tempDir.getDefaultConfiguration());
    PCollection<String> p = pipeline.readTextFile(tempDir.copyResourceFileName("shakes.txt"));
    PCollection<Integer> result = p.parallelDo(new InverseFn(), Writables.ints());
    result.cache();

    PipelineExecution execution = pipeline.runAsync();

    while (!execution.isDone() && !execution.isCancelled()
        && execution.getStatus() != PipelineExecution.Status.FAILED
        && execution.getResult() == null) {
      try {
        Thread.sleep(1000);
        System.out.println("Job Status: " + execution.getStatus().toString());
      } catch (InterruptedException e) {
        System.err.println("ABORTING");
        e.printStackTrace();
        try {
          execution.kill();
          execution.waitUntilDone();
        } catch (InterruptedException e1) {
          throw new RuntimeException(e1);
        }
        throw new RuntimeException(e);
      }
    }
    System.out.println("Finished running job.");
    assertEquals(PipelineExecution.Status.FAILED, execution.getStatus());
  }
View Full Code Here

  }

  @Override
  public PipelineResult run() {
    try {
      PipelineExecution pipelineExecution = runAsync();
      pipelineExecution.waitUntilDone();
      return pipelineExecution.getResult();
    } catch (InterruptedException e) {
      // TODO: How to handle this without changing signature?
      LOG.error("Exception running pipeline", e);
      return PipelineResult.EMPTY;
    }
View Full Code Here

TOP

Related Classes of org.apache.crunch.PipelineExecution

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.