Source:
private void initializeConnector(String connectorStr, Properties connectorProperties) { LOG.info("Starting to load connector: " + connectorStr); String className = connectorProperties.getProperty(CONFIG_CONNECTOR_FACTORY_CLASS_NAME, ""); if (StringUtils.isBlank(className)) { String errorMessage = "Factory className is empty for connector " + connectorStr; LOG.error(errorMessage); throw new DatastreamRuntimeException(errorMessage); } ConnectorFactory connectorFactoryInstance = ReflectionUtils.createInstance(className); if (connectorFactoryInstance == null) { String msg = "Invalid class name or no parameter-less constructor, class=" + className; LOG.error(msg); throw new DatastreamRuntimeException(msg); } Connector connectorInstance = connectorFactoryInstance.createConnector(connectorProperties); String bootstrapConnector = connectorProperties.getProperty(CONFIG_CONNECTOR_BOOTSTRAP_TYPE, ""); if (!bootstrapConnector.isEmpty()) { _bootstrapConnectors.put(connectorStr, bootstrapConnector); } AssignmentStrategy assignmentStrategyInstance = null; String strategy = connectorProperties.getProperty(CONFIG_CONNECTOR_ASSIGNMENT_STRATEGY, ""); if (!strategy.isEmpty()) { assignmentStrategyInstance = ReflectionUtils.createInstance(strategy); if (assignmentStrategyInstance == null) { String errorMessage = "Invalid strategy class: " + strategy; LOG.error(errorMessage); throw new DatastreamRuntimeException(errorMessage); } } boolean customCheckpointing = Boolean.parseBoolean(connectorProperties.getProperty(CONFIG_CONNECTOR_CUSTOM_CHECKPOINTING, "false")); _coordinator.addConnector(connectorStr, connectorInstance, assignmentStrategyInstance, customCheckpointing); LOG.info("Connector loaded successfully. Type: " + connectorStr); }

Target:
private void initializeConnector(String connectorStr, Properties connectorProperties) { LOG.info("Starting to load connector: " + connectorStr); String className = connectorProperties.getProperty(CONFIG_CONNECTOR_FACTORY_CLASS_NAME, ""); if (StringUtils.isBlank(className)) { String errorMessage = "Factory className is empty for connector " + connectorStr; ErrorLogger.logAndThrowDatastreamRuntimeException(LOG, errorMessage, null); } ConnectorFactory connectorFactoryInstance = ReflectionUtils.createInstance(className); if (connectorFactoryInstance == null) { String msg = "Invalid class name or no parameter-less constructor, class=" + className; ErrorLogger.logAndThrowDatastreamRuntimeException(LOG, msg, null); } Connector connectorInstance = connectorFactoryInstance.createConnector(connectorProperties); String bootstrapConnector = connectorProperties.getProperty(CONFIG_CONNECTOR_BOOTSTRAP_TYPE, ""); if (!bootstrapConnector.isEmpty()) { _bootstrapConnectors.put(connectorStr, bootstrapConnector); } AssignmentStrategy assignmentStrategyInstance = null; String strategy = connectorProperties.getProperty(CONFIG_CONNECTOR_ASSIGNMENT_STRATEGY, ""); if (!strategy.isEmpty()) { assignmentStrategyInstance = ReflectionUtils.createInstance(strategy); if (assignmentStrategyInstance == null) { String errorMessage = "Invalid strategy class: " + strategy; ErrorLogger.logAndThrowDatastreamRuntimeException(LOG, errorMessage, null); } } boolean customCheckpointing = Boolean.parseBoolean(connectorProperties.getProperty(CONFIG_CONNECTOR_CUSTOM_CHECKPOINTING, "false")); _coordinator.addConnector(connectorStr, connectorInstance, assignmentStrategyInstance, customCheckpointing); LOG.info("Connector loaded successfully. Type: " + connectorStr); }