Search in sources :

Example 11 with LocalFlinkMiniCluster

use of org.apache.flink.runtime.minicluster.LocalFlinkMiniCluster in project flink by apache.

the class StreamFaultToleranceTestBase method startCluster.

@BeforeClass
public static void startCluster() {
    try {
        Configuration config = new Configuration();
        config.setInteger(ConfigConstants.LOCAL_NUMBER_TASK_MANAGER, NUM_TASK_MANAGERS);
        config.setInteger(ConfigConstants.TASK_MANAGER_NUM_TASK_SLOTS, NUM_TASK_SLOTS);
        config.setInteger(ConfigConstants.TASK_MANAGER_MEMORY_SIZE_KEY, 12);
        cluster = new LocalFlinkMiniCluster(config, false);
        cluster.start();
    } catch (Exception e) {
        e.printStackTrace();
        fail("Failed to start test cluster: " + e.getMessage());
    }
}
Also used : Configuration(org.apache.flink.configuration.Configuration) LocalFlinkMiniCluster(org.apache.flink.runtime.minicluster.LocalFlinkMiniCluster) BeforeClass(org.junit.BeforeClass)

Example 12 with LocalFlinkMiniCluster

use of org.apache.flink.runtime.minicluster.LocalFlinkMiniCluster in project flink by apache.

the class CancelingTestBase method startCluster.

@Before
public void startCluster() throws Exception {
    verifyJvmOptions();
    Configuration config = new Configuration();
    config.setBoolean(ConfigConstants.FILESYSTEM_DEFAULT_OVERWRITE_KEY, true);
    config.setInteger(ConfigConstants.LOCAL_NUMBER_TASK_MANAGER, 2);
    config.setInteger(ConfigConstants.TASK_MANAGER_NUM_TASK_SLOTS, 4);
    config.setString(ConfigConstants.AKKA_ASK_TIMEOUT, TestingUtils.DEFAULT_AKKA_ASK_TIMEOUT());
    config.setInteger(ConfigConstants.TASK_MANAGER_MEMORY_SEGMENT_SIZE_KEY, 4096);
    config.setInteger(ConfigConstants.TASK_MANAGER_NETWORK_NUM_BUFFERS_KEY, 2048);
    this.executor = new LocalFlinkMiniCluster(config, false);
    this.executor.start();
}
Also used : Configuration(org.apache.flink.configuration.Configuration) LocalFlinkMiniCluster(org.apache.flink.runtime.minicluster.LocalFlinkMiniCluster) Before(org.junit.Before)

Example 13 with LocalFlinkMiniCluster

use of org.apache.flink.runtime.minicluster.LocalFlinkMiniCluster in project flink by apache.

the class WindowCheckpointingITCase method startTestCluster.

@BeforeClass
public static void startTestCluster() {
    Configuration config = new Configuration();
    config.setInteger(ConfigConstants.LOCAL_NUMBER_TASK_MANAGER, 2);
    config.setInteger(ConfigConstants.TASK_MANAGER_NUM_TASK_SLOTS, PARALLELISM / 2);
    config.setInteger(ConfigConstants.TASK_MANAGER_MEMORY_SIZE_KEY, 48);
    cluster = new LocalFlinkMiniCluster(config, false);
    cluster.start();
}
Also used : Configuration(org.apache.flink.configuration.Configuration) LocalFlinkMiniCluster(org.apache.flink.runtime.minicluster.LocalFlinkMiniCluster) BeforeClass(org.junit.BeforeClass)

Example 14 with LocalFlinkMiniCluster

use of org.apache.flink.runtime.minicluster.LocalFlinkMiniCluster in project flink by apache.

the class TestBaseUtils method startCluster.

public static LocalFlinkMiniCluster startCluster(Configuration config, boolean singleActorSystem) throws Exception {
    logDir = File.createTempFile("TestBaseUtils-logdir", null);
    Assert.assertTrue("Unable to delete temp file", logDir.delete());
    Assert.assertTrue("Unable to create temp directory", logDir.mkdir());
    Path logFile = Files.createFile(new File(logDir, "jobmanager.log").toPath());
    Files.createFile(new File(logDir, "jobmanager.out").toPath());
    config.setLong(ConfigConstants.TASK_MANAGER_MEMORY_SIZE_KEY, TASK_MANAGER_MEMORY_SIZE);
    config.setBoolean(ConfigConstants.FILESYSTEM_DEFAULT_OVERWRITE_KEY, true);
    config.setString(ConfigConstants.AKKA_ASK_TIMEOUT, DEFAULT_AKKA_ASK_TIMEOUT + "s");
    config.setString(ConfigConstants.AKKA_STARTUP_TIMEOUT, DEFAULT_AKKA_STARTUP_TIMEOUT);
    config.setInteger(ConfigConstants.JOB_MANAGER_WEB_PORT_KEY, 8081);
    config.setString(ConfigConstants.JOB_MANAGER_WEB_LOG_PATH_KEY, logFile.toString());
    config.setString(ConfigConstants.TASK_MANAGER_LOG_PATH_KEY, logFile.toString());
    LocalFlinkMiniCluster cluster = new LocalFlinkMiniCluster(config, singleActorSystem);
    cluster.start();
    return cluster;
}
Also used : Path(java.nio.file.Path) File(java.io.File) LocalFlinkMiniCluster(org.apache.flink.runtime.minicluster.LocalFlinkMiniCluster)

Example 15 with LocalFlinkMiniCluster

use of org.apache.flink.runtime.minicluster.LocalFlinkMiniCluster in project flink by apache.

the class DegreesWithExceptionITCase method setupCluster.

@BeforeClass
public static void setupCluster() {
    try {
        Configuration config = new Configuration();
        config.setInteger(ConfigConstants.TASK_MANAGER_NUM_TASK_SLOTS, PARALLELISM);
        cluster = new LocalFlinkMiniCluster(config, false);
        cluster.start();
    } catch (Exception e) {
        e.printStackTrace();
        fail("Error starting test cluster: " + e.getMessage());
    }
}
Also used : Configuration(org.apache.flink.configuration.Configuration) LocalFlinkMiniCluster(org.apache.flink.runtime.minicluster.LocalFlinkMiniCluster) BeforeClass(org.junit.BeforeClass)

Aggregations

LocalFlinkMiniCluster (org.apache.flink.runtime.minicluster.LocalFlinkMiniCluster)39 Configuration (org.apache.flink.configuration.Configuration)36 BeforeClass (org.junit.BeforeClass)19 Test (org.junit.Test)9 JobGraph (org.apache.flink.runtime.jobgraph.JobGraph)5 ProgramInvocationException (org.apache.flink.client.program.ProgramInvocationException)4 ActorGateway (org.apache.flink.runtime.instance.ActorGateway)4 File (java.io.File)3 IOException (java.io.IOException)3 Properties (java.util.Properties)3 AtomicReference (java.util.concurrent.atomic.AtomicReference)3 JobVertex (org.apache.flink.runtime.jobgraph.JobVertex)3 JobManagerMessages (org.apache.flink.runtime.messages.JobManagerMessages)3 FiniteDuration (scala.concurrent.duration.FiniteDuration)3 ActorSystem (akka.actor.ActorSystem)2 AmazonKinesisClient (com.amazonaws.services.kinesis.AmazonKinesisClient)2 DescribeStreamResult (com.amazonaws.services.kinesis.model.DescribeStreamResult)2 HashSet (java.util.HashSet)2 ExecutionEnvironment (org.apache.flink.api.java.ExecutionEnvironment)2 Tuple2 (org.apache.flink.api.java.tuple.Tuple2)2