ComponentRunner runner = new ComponentRunner.Builder() .withComponent("zk",zkServerComponent) .withComponent("kafka", kafkaComponent) .withComponent("config", configUploadComponent) .withComponent("storm", fluxComponent) .withMillisecondsBetweenAttempts(15000) .withCustomShutdownOrder(new String[]{"storm","config","kafka","zk"}) .withNumRetries(10) .build();
.build(); ComponentRunner runner = new ComponentRunner.Builder() .withComponent("zk", zkServerComponent) .withComponent("kafka", kafkaComponent) .withComponent("config", configUploadComponent) .withComponent("org/apache/storm", parserTopologyComponent) .withMillisecondsBetweenAttempts(5000) .withCustomShutdownOrder(new String[]{"org/apache/storm","config","kafka","zk"}) .withNumRetries(10) .build(); try { runner.start();
ComponentRunner.Builder componentBuilder = new ComponentRunner.Builder(); componentBuilder = componentBuilder.withComponent("zk", zkServerComponent) .withComponent("kafka", kafkaComponent) .withComponent("config", configUploadComponent) .withComponent("storm", fluxComponent) .withMillisecondsBetweenAttempts(1500) .withNumRetries(NUM_RETRIES) .withMaxTimeMS(TOTAL_TIME_MS); componentBuilder = componentBuilder.withComponent("search", getSearchComponent(topologyProperties)) .withCustomShutdownOrder(new String[]{"search", "storm", "config", "kafka", "zk"}) componentBuilder = componentBuilder.withCustomShutdownOrder(new String[]{ "storm", "config", "kafka", "zk"}) runner = componentBuilder.build();
.build(); return new ComponentRunner.Builder() .withComponent("zk", zkServerComponent) .withComponent("kafka", kafkaComponent) .withComponent("config", configUploadComponent) .withComponent("org/apache/storm", parserTopologyComponent) .withMillisecondsBetweenAttempts(5000) .withNumRetries(10) .withCustomShutdownOrder(new String[]{"org/apache/storm","config","kafka","zk"}) .build();
@Before public void setup() throws Exception { // a component that uploads the global configuration Map<String, Object> globals = new HashMap<>(); ConfigUploadComponent configUploader = new ConfigUploadComponent() .withGlobals(globals); // create zookeeper component properties = new Properties(); zkServer = getZKServerComponent(properties); // can only get the zookeeperUrl AFTER it has started zkServer.withPostStartCallback((zk) -> { zookeeperURL = zk.getConnectionString(); configUploader.withZookeeperURL(zookeeperURL); }); // start the integration test components runner = new ComponentRunner.Builder() .withComponent("zk", zkServer) .withComponent("config", configUploader) .build(); runner.start(); context = mock(InterpreterContext.class); }
@BeforeClass public static void setupBeforeClass() throws Exception { UnitTestHelper.setJavaLoggingLevel(Level.SEVERE); LOG.info("Starting up YARN cluster"); zkServerComponent = new ZKServerComponent(); yarnComponent = new YarnComponent().withApplicationMasterClass(ApplicationMaster.class).withTestName(MaasIntegrationTest.class.getSimpleName()); runner = new ComponentRunner.Builder() .withComponent("yarn", yarnComponent) .withComponent("zk", zkServerComponent) .withMillisecondsBetweenAttempts(15000) .withNumRetries(10) .build(); runner.start(); String zookeeperUrl = zkServerComponent.getConnectionString(); RetryPolicy retryPolicy = new ExponentialBackoffRetry(1000, 3); client = CuratorFrameworkFactory.newClient(zookeeperUrl, retryPolicy); client.start(); }