Examples of NepheleMiniCluster


Examples of eu.stratosphere.client.minicluster.NepheleMiniCluster

  //  Local Test Cluster Life Cycle
  // --------------------------------------------------------------------------------------------
 
  @Before
  public void startCluster() throws Exception {
    this.executor = new NepheleMiniCluster();
    this.executor.setDefaultOverwriteFiles(true);
    this.executor.setLazyMemoryAllocation(true);
    this.executor.setMemorySize(MEMORY_SIZE);
    this.executor.setNumTaskManager(this.numTaskManager);
    this.executor.start();
View Full Code Here

Examples of eu.stratosphere.client.minicluster.NepheleMiniCluster

  }
 
  @Before
  public void startCluster() throws Exception {
    verifyJvmOptions();
    this.executor = new NepheleMiniCluster();
    this.executor.setDefaultOverwriteFiles(true);
   
    this.executor.start();
  }
View Full Code Here

Examples of eu.stratosphere.client.minicluster.NepheleMiniCluster

    LogUtils.initializeDefaultTestConsoleLogger();
  }
 
  @Test
  public void testEverything() {
    NepheleMiniCluster cluster = new NepheleMiniCluster();
    try {
      // set up the files
      File points = File.createTempFile("kmeans_points", ".in");
      File clusters = File.createTempFile("kmeans_clusters", ".in");
      File outFile = File.createTempFile("kmeans_result", ".out");
      points.deleteOnExit();
      clusters.deleteOnExit();
      outFile.deleteOnExit();
      outFile.delete();

      FileWriter fwPoints = new FileWriter(points);
      fwPoints.write(KMeansData.DATAPOINTS);
      fwPoints.close();

      FileWriter fwClusters = new FileWriter(clusters);
      fwClusters.write(KMeansData.INITIAL_CENTERS);
      fwClusters.close();

      String jarPath = "target/maven-test-jar.jar";

      // run KMeans
      cluster.setNumTaskManager(2);
      cluster.start();
      RemoteExecutor ex = new RemoteExecutor("localhost", 6498);
     
      ex.executeJar(jarPath,
          "eu.stratosphere.test.util.testjar.KMeansForTest",
          new String[] {
              points.toURI().toString(),
              clusters.toURI().toString(),
              outFile.toURI().toString(),
              "25"});

      points.delete();
      clusters.delete();
      outFile.delete();

    } catch (Exception e) {
      e.printStackTrace();
      Assert.fail(e.getMessage());
    } finally {
      try {
        cluster.stop();
      } catch (Exception e) {
        e.printStackTrace();
        Assert.fail(e.getMessage());
      }
    }
View Full Code Here

Examples of eu.stratosphere.client.minicluster.NepheleMiniCluster

  }
 
  @Test
  public void testExternalProgram() {
   
    NepheleMiniCluster testMiniCluster = null;
   
    try {
      testMiniCluster = new NepheleMiniCluster();
      testMiniCluster.setJobManagerRpcPort(TEST_JM_PORT);
      testMiniCluster.start();
     
      String jarFile = JAR_FILE;
      String testData = getClass().getResource(TEST_DATA_FILE).toString();
     
      PackagedProgram program = new PackagedProgram(new File(jarFile), new String[] { testData });
           
      Client c = new Client(new InetSocketAddress("localhost", TEST_JM_PORT), new Configuration());
      c.run(program, 4, true);
    }
    catch (Throwable t) {
      System.err.println(t.getMessage());
      t.printStackTrace();
      Assert.fail("Error during the packaged program execution: " + t.getMessage());
    }
    finally {
      if (testMiniCluster != null) {
        try {
          testMiniCluster.stop();
        } catch (Throwable t) {}
      }
    }
  }
View Full Code Here

Examples of eu.stratosphere.client.minicluster.NepheleMiniCluster

  public void start() throws Exception {
    synchronized (this.lock) {
      if (this.nephele == null) {
       
        // create the embedded runtime
        this.nephele = new NepheleMiniCluster();
       
        // configure it, if values were changed. otherwise the embedded runtime uses the internal defaults
        if (jobManagerRpcPort > 0) {
          nephele.setJobManagerRpcPort(jobManagerRpcPort);
        }
View Full Code Here

Examples of org.apache.flink.client.minicluster.NepheleMiniCluster

  private static final String TEST_DATA_FILE = "/testdata.avro";

  @Test
  public void testExternalProgram() {
   
    NepheleMiniCluster testMiniCluster = null;
   
    try {
      testMiniCluster = new NepheleMiniCluster();
      testMiniCluster.setTaskManagerNumSlots(4);
      testMiniCluster.start();
     
      String jarFile = JAR_FILE;
      String testData = getClass().getResource(TEST_DATA_FILE).toString();
     
      PackagedProgram program = new PackagedProgram(new File(jarFile), new String[] { testData });
           
      Client c = new Client(new InetSocketAddress("localhost", testMiniCluster.getJobManagerRpcPort()), new Configuration(), program.getUserCodeClassLoader());
      c.run(program, 4, true);
    }
    catch (Throwable t) {
      System.err.println(t.getMessage());
      t.printStackTrace();
      Assert.fail("Error during the packaged program execution: " + t.getMessage());
    }
    finally {
      if (testMiniCluster != null) {
        try {
          testMiniCluster.stop();
        } catch (Throwable t) {}
      }
    }
  }
View Full Code Here

Examples of org.apache.flink.client.minicluster.NepheleMiniCluster

public class PackagedProgramEndToEndITCase {

  @Test
  public void testEverything() {
    NepheleMiniCluster cluster = new NepheleMiniCluster();

    File points = null;
    File clusters = null;
    File outFile = null;
   
    try {
      // set up the files
      points = File.createTempFile("kmeans_points", ".in");
      clusters = File.createTempFile("kmeans_clusters", ".in");
      outFile = File.createTempFile("kmeans_result", ".out");
     
      outFile.delete();

      FileWriter fwPoints = new FileWriter(points);
      fwPoints.write(KMeansData.DATAPOINTS);
      fwPoints.close();

      FileWriter fwClusters = new FileWriter(clusters);
      fwClusters.write(KMeansData.INITIAL_CENTERS);
      fwClusters.close();

      String jarPath = "target/maven-test-jar.jar";

      // run KMeans
      cluster.setNumTaskManager(2);
      cluster.setTaskManagerNumSlots(2);
      cluster.start();

      RemoteExecutor ex = new RemoteExecutor("localhost", cluster.getJobManagerRpcPort());

      ex.executeJar(jarPath,
          "org.apache.flink.test.util.testjar.KMeansForTest",
          new String[] {
              points.toURI().toString(),
              clusters.toURI().toString(),
              outFile.toURI().toString(),
              "25"});

    } catch (Exception e) {
      e.printStackTrace();
      Assert.fail(e.getMessage());
    }
    finally {
      if (points != null) {
        points.delete();
      }
      if (cluster != null) {
        clusters.delete();
      }
      if (outFile != null) {
        outFile.delete();
      }
     
      try {
        cluster.stop();
      } catch (Exception e) {
        e.printStackTrace();
        Assert.fail(e.getMessage());
      }
    }
View Full Code Here

Examples of org.apache.flink.client.minicluster.NepheleMiniCluster

   */
  public static void runOnMiniCluster(JobGraph jobGraph, int degreeOfPrallelism, long memorySize) throws Exception  {

    Configuration configuration = jobGraph.getJobConfiguration();

    NepheleMiniCluster exec = new NepheleMiniCluster();
    exec.setMemorySize(memorySize);
    exec.setNumTaskManager(1);
    exec.setTaskManagerNumSlots(degreeOfPrallelism);
    if (LOG.isInfoEnabled()) {
      LOG.info("Running on mini cluster");
    }

    try {
      exec.start();

      Client client = new Client(new InetSocketAddress("localhost",
          exec.getJobManagerRpcPort()), configuration, ClusterUtil.class.getClassLoader());
      client.run(jobGraph, true);
    } catch (ProgramInvocationException e) {
      if (e.getMessage().contains("GraphConversionException")) {
        throw new Exception(CANNOT_EXECUTE_EMPTY_JOB, e);
      } else {
        throw e;
      }
    } catch (Exception e) {
      throw e;
    } finally {
      try {
        exec.stop();
      } catch (Throwable t) {
      }
    }
  }
View Full Code Here

Examples of org.apache.flink.client.minicluster.NepheleMiniCluster

  }

  @Before
  public void startCluster() throws Exception {
    verifyJvmOptions();
    this.executor = new NepheleMiniCluster();
    this.executor.setDefaultOverwriteFiles(true);
    this.executor.setTaskManagerNumSlots(taskManagerNumSlots);
    this.executor.start();
  }
View Full Code Here

Examples of org.apache.flink.client.minicluster.NepheleMiniCluster

  public void start() throws Exception {
    synchronized (this.lock) {
      if (this.nephele == null) {
       
        // create the embedded runtime
        this.nephele = new NepheleMiniCluster();
       
        // configure it, if values were changed. otherwise the embedded runtime uses the internal defaults
        if (jobManagerRpcPort > 0) {
          nephele.setJobManagerRpcPort(jobManagerRpcPort);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.