use of org.apache.flink.runtime.minicluster.LocalFlinkMiniCluster in project flink by apache.
the class NotSoMiniClusterIterations method main.
public static void main(String[] args) {
if ((Runtime.getRuntime().maxMemory() >>> 20) < 5000) {
throw new RuntimeException("This test program needs to run with at least 5GB of heap space.");
}
LocalFlinkMiniCluster cluster = null;
try {
Configuration config = new Configuration();
config.setInteger(ConfigConstants.LOCAL_NUMBER_TASK_MANAGER, PARALLELISM);
config.setInteger(ConfigConstants.TASK_MANAGER_MEMORY_SIZE_KEY, 8);
config.setInteger(ConfigConstants.TASK_MANAGER_NUM_TASK_SLOTS, 1);
config.setInteger(ConfigConstants.TASK_MANAGER_NETWORK_NUM_BUFFERS_KEY, 1000);
config.setInteger(ConfigConstants.TASK_MANAGER_MEMORY_SEGMENT_SIZE_KEY, 8 * 1024);
config.setInteger("taskmanager.net.server.numThreads", 1);
config.setInteger("taskmanager.net.client.numThreads", 1);
cluster = new LocalFlinkMiniCluster(config, false);
cluster.start();
runConnectedComponents(cluster.getLeaderRPCPort());
} catch (Exception e) {
e.printStackTrace();
fail(e.getMessage());
} finally {
if (cluster != null) {
cluster.shutdown();
}
}
}
use of org.apache.flink.runtime.minicluster.LocalFlinkMiniCluster in project flink by apache.
the class StreamingScalabilityAndLatency method main.
public static void main(String[] args) throws Exception {
if ((Runtime.getRuntime().maxMemory() >>> 20) < 5000) {
throw new RuntimeException("This test program needs to run with at least 5GB of heap space.");
}
final int TASK_MANAGERS = 1;
final int SLOTS_PER_TASK_MANAGER = 80;
final int PARALLELISM = TASK_MANAGERS * SLOTS_PER_TASK_MANAGER;
LocalFlinkMiniCluster cluster = null;
try {
Configuration config = new Configuration();
config.setInteger(ConfigConstants.LOCAL_NUMBER_TASK_MANAGER, TASK_MANAGERS);
config.setInteger(ConfigConstants.TASK_MANAGER_MEMORY_SIZE_KEY, 80);
config.setInteger(ConfigConstants.TASK_MANAGER_NUM_TASK_SLOTS, SLOTS_PER_TASK_MANAGER);
config.setInteger(ConfigConstants.TASK_MANAGER_NETWORK_NUM_BUFFERS_KEY, 20000);
config.setInteger("taskmanager.net.server.numThreads", 1);
config.setInteger("taskmanager.net.client.numThreads", 1);
cluster = new LocalFlinkMiniCluster(config, false);
cluster.start();
runPartitioningProgram(cluster.getLeaderRPCPort(), PARALLELISM);
} catch (Exception e) {
e.printStackTrace();
fail(e.getMessage());
} finally {
if (cluster != null) {
cluster.shutdown();
}
}
}
use of org.apache.flink.runtime.minicluster.LocalFlinkMiniCluster in project flink by apache.
the class AutoParallelismITCase method setupCluster.
@BeforeClass
public static void setupCluster() {
Configuration config = new Configuration();
config.setInteger(ConfigConstants.LOCAL_NUMBER_TASK_MANAGER, NUM_TM);
config.setInteger(ConfigConstants.TASK_MANAGER_NUM_TASK_SLOTS, SLOTS_PER_TM);
cluster = new LocalFlinkMiniCluster(config, false);
cluster.start();
}
use of org.apache.flink.runtime.minicluster.LocalFlinkMiniCluster in project flink by apache.
the class MiscellaneousIssuesITCase method startCluster.
@BeforeClass
public static void startCluster() {
try {
Configuration config = new Configuration();
config.setInteger(ConfigConstants.LOCAL_NUMBER_TASK_MANAGER, 2);
config.setInteger(ConfigConstants.TASK_MANAGER_NUM_TASK_SLOTS, 3);
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());
}
}
use of org.apache.flink.runtime.minicluster.LocalFlinkMiniCluster in project flink by apache.
the class SuccessAfterNetworkBuffersFailureITCase method testSuccessfulProgramAfterFailure.
@Test
public void testSuccessfulProgramAfterFailure() {
LocalFlinkMiniCluster cluster = null;
try {
Configuration config = new Configuration();
config.setInteger(ConfigConstants.LOCAL_NUMBER_TASK_MANAGER, 2);
config.setInteger(ConfigConstants.TASK_MANAGER_MEMORY_SIZE_KEY, 80);
config.setInteger(ConfigConstants.TASK_MANAGER_NUM_TASK_SLOTS, 8);
config.setInteger(ConfigConstants.TASK_MANAGER_NETWORK_NUM_BUFFERS_KEY, 840);
cluster = new LocalFlinkMiniCluster(config, false);
cluster.start();
try {
runConnectedComponents(cluster.getLeaderRPCPort());
} catch (Exception e) {
e.printStackTrace();
fail("Program Execution should have succeeded.");
}
try {
runKMeans(cluster.getLeaderRPCPort());
fail("This program execution should have failed.");
} catch (ProgramInvocationException e) {
assertTrue(e.getCause().getCause().getMessage().contains("Insufficient number of network buffers"));
}
try {
runConnectedComponents(cluster.getLeaderRPCPort());
} catch (Exception e) {
e.printStackTrace();
fail("Program Execution should have succeeded.");
}
} catch (Exception e) {
e.printStackTrace();
fail(e.getMessage());
} finally {
if (cluster != null) {
cluster.shutdown();
}
}
}
Aggregations