Source:
public synchronized void init(Properties properties) throws Exception { if (isInitialized()) { return; } LOG.info("Creating coordinator."); VerifiableProperties verifiableProperties = new VerifiableProperties(properties); CoordinatorConfig coordinatorConfig = new CoordinatorConfig(verifiableProperties); _coordinator = new Coordinator(coordinatorConfig); LOG.info("Loading connectors."); String connectorStrings = verifiableProperties.getString(CONFIG_PREFIX + "connectorTypes"); ClassLoader classLoader = DatastreamServer.class.getClassLoader(); for (String connector : connectorStrings.split(",")) { Class connectorClass = classLoader.loadClass(connector); Connector connectorInstance = (Connector) connectorClass.newInstance(); AssignmentStrategy assignmentStrategy; String strategy = verifiableProperties.getString(connector + ".assignmentStrategy", ""); if (!strategy.isEmpty()) { Class assignmentStrategyClass = classLoader.loadClass(strategy); assignmentStrategy = (AssignmentStrategy) assignmentStrategyClass.newInstance(); } else { assignmentStrategy = new BroadcastStrategy(); } _coordinator.addConnector(connectorInstance, assignmentStrategy); } LOG.info("Setting up DMS endpoint server."); ZkClient zkClient = new ZkClient(coordinatorConfig.getZkAddress(), coordinatorConfig.getZkSessionTimeout(), coordinatorConfig.getZkConnectionTimeout()); _datastreamStore = new ZookeeperBackedDatastreamStore(zkClient, coordinatorConfig.getCluster()); int httpPort = verifiableProperties.getIntInRange(CONFIG_PREFIX + "httpport", 1, 65535); NettyStandaloneLauncher launcher = new NettyStandaloneLauncher(httpPort, "com.linkedin.datastream.server.dms"); launcher.start(); verifiableProperties.verify(); _isInitialized = true; LOG.info("DatastreamServer initialized."); }

Target:
public synchronized void init(Properties properties) throws DatastreamException { if (isInitialized()) { return; } LOG.info("Creating coordinator."); VerifiableProperties verifiableProperties = new VerifiableProperties(properties); CoordinatorConfig coordinatorConfig = new CoordinatorConfig(verifiableProperties); _coordinator = new Coordinator(coordinatorConfig); LOG.info("Loading connectors."); String connectorStrings = verifiableProperties.getString(CONFIG_PREFIX + "connectorTypes"); ClassLoader classLoader = DatastreamServer.class.getClassLoader(); for (String connector : connectorStrings.split(",")) { try { Class connectorClass = classLoader.loadClass(connector); Connector connectorInstance = (Connector) connectorClass.newInstance(); AssignmentStrategy assignmentStrategy; String strategy = verifiableProperties.getString(connector + ".assignmentStrategy", ""); if (!strategy.isEmpty()) { Class assignmentStrategyClass = classLoader.loadClass(strategy); assignmentStrategy = (AssignmentStrategy) assignmentStrategyClass.newInstance(); } else { assignmentStrategy = new BroadcastStrategy(); } _coordinator.addConnector(connectorInstance, assignmentStrategy); } catch (Exception ex) { throw new DatastreamException("Failed to instantiate connector: " + connector, ex); } } LOG.info("Setting up DMS endpoint server."); ZkClient zkClient = new ZkClient(coordinatorConfig.getZkAddress(), coordinatorConfig.getZkSessionTimeout(), coordinatorConfig.getZkConnectionTimeout()); _datastreamStore = new ZookeeperBackedDatastreamStore(zkClient, coordinatorConfig.getCluster()); int httpPort = verifiableProperties.getIntInRange(CONFIG_PREFIX + "httpport", 1, 65535); NettyStandaloneLauncher launcher = new NettyStandaloneLauncher(httpPort, "com.linkedin.datastream.server.dms"); try { launcher.start(); } catch (IOException ex) { throw new DatastreamException("Failed to start netty.", ex); } verifiableProperties.verify(); _isInitialized = true; LOG.info("DatastreamServer initialized."); }