/** * Run with a local cluster * @deprecated use ``` * try (LocalCluster cluster = new LocalCluster()) { * ... * } * ``` * @param code what to run */ @Deprecated public static void withLocalCluster(TestJob code) { withLocalCluster(new MkClusterParam(), code); }
@Test @IntegrationTest public void testCompleteTopologyNettySimulated() throws Exception { Config daemonConf = new Config(); daemonConf.put(Config.STORM_LOCAL_MODE_ZMQ, true); MkClusterParam param = new MkClusterParam(); param.setSupervisors(4); param.setDaemonConf(daemonConf); Testing.withSimulatedTimeLocalCluster(param, COMPLETE_TOPOLOGY_TESTJOB); }
@Test @IntegrationTest public void testCompleteTopologyLocal() throws Exception { MkClusterParam param = new MkClusterParam(); param.setSupervisors(4); Testing.withLocalCluster(param, COMPLETE_TOPOLOGY_TESTJOB); }
MkClusterParam mkClusterParam = new MkClusterParam(); mkClusterParam.setSupervisors(1); mkClusterParam.setPortsPerSupervisor(32); //Hard limit on the number of topologies that can run at once
private static LocalCluster cluster(MkClusterParam param, String id, boolean simulated) throws Exception { Integer supervisors = param.getSupervisors(); if (supervisors == null) { supervisors = 2; } Integer ports = param.getPortsPerSupervisor(); if (ports == null) { ports = 3; } Map<String, Object> conf = param.getDaemonConf(); if (conf == null) { conf = new HashMap<>(); } return new LocalCluster.Builder() .withSupervisors(supervisors) .withPortsPerSupervisor(ports) .withDaemonConf(conf) .withNimbusDaemon(param.isNimbusDaemon()) .withTracked(id) .withSimulatedTime(simulated) .build(); }
@Test @IntegrationTest public void testCompleteTopologyNetty() throws Exception { Config daemonConf = new Config(); daemonConf.put(Config.STORM_LOCAL_MODE_ZMQ, true); MkClusterParam param = new MkClusterParam(); param.setSupervisors(4); param.setDaemonConf(daemonConf); Testing.withLocalCluster(param, COMPLETE_TOPOLOGY_TESTJOB); }
@Test @IntegrationTest public void testCompleteTopologyLocalSimulated() throws Exception { MkClusterParam param = new MkClusterParam(); param.setSupervisors(4); Testing.withSimulatedTimeLocalCluster(param, COMPLETE_TOPOLOGY_TESTJOB); }
/** * Run with a local cluster * @deprecated use ``` * try (LocalCluster cluster = new LocalCluster.Builder().withTracked().build()) { * ... * } * ``` * @param code what to run */ @Deprecated public static void withTrackedCluster(TestJob code) { withTrackedCluster(new MkClusterParam(), code); }
/** * Run with a local cluster * @deprecated use ``` * try (LocalCluster cluster = new LocalCluster.Builder().withSimulatedTime().build()) { * ... * } * ``` * @param code what to run */ @Deprecated public static void withSimulatedTimeLocalCluster(TestJob code) { withSimulatedTimeLocalCluster(new MkClusterParam(), code); }