Source:
<code>public void initializeDatastream(Datastream stream, List<Datastream> allDatastreams) throws DatastreamValidationException { LOG.info("validating datastream " + stream.toString()); try { MysqlSource source = MysqlSource.createFromUri(stream.getSource().getConnectionString()); if (source.getSourceType() != _sourceType) { <START> String msg = String.format("Connector can support datastreams of source type: %s", _sourceType); <END> LOG.error(msg); throw new DatastreamValidationException(msg); } if (_sourceType == SourceType.MYSQLSERVER) { MysqlQueryUtils queryUtils = new MysqlQueryUtils(source, getUserNameFromDatastream(stream), getPasswordFromDatastream(stream)); queryUtils.initializeConnection(); if (!queryUtils.checkTableExist(source.getDatabaseName(), source.getTableName())) { throw new DatastreamValidationException( String.format("Invalid datastream: Can't find table %s in db %s.", source.getDatabaseName(), source.getTableName())); } queryUtils.closeConnection(); } else { File binlogFolder = new File(source.getBinlogFolderName()); if (!binlogFolder.exists()) { String msg = String.format("BinlogFolder %s doesn't exist", binlogFolder.getAbsolutePath()); LOG.error(msg); throw new DatastreamValidationException(msg); } } if (stream.getSource().hasPartitions() && stream.getSource().getPartitions() != 1) { String msg = "Mysql connector can only support single partition sources"; LOG.error(msg); throw new DatastreamValidationException(msg); } } catch (SourceNotValidException | SQLException e) { throw new DatastreamValidationException(e); } }</code><technical_language>nit: "can only" is more clear</technical_language>

Target:
public void initializeDatastream(Datastream stream, List<Datastream> allDatastreams) throws DatastreamValidationException { LOG.info("validating datastream " + stream.toString()); try { MysqlSource source = MysqlSource.createFromUri(stream.getSource().getConnectionString()); if (source.getSourceType() != _sourceType) { String msg = String.format("Connector can only support datastreams of source type: %s", _sourceType); LOG.error(msg); throw new DatastreamValidationException(msg); } if (_sourceType == SourceType.MYSQLSERVER) { MysqlQueryUtils queryUtils = new MysqlQueryUtils(source, getUserNameFromDatastream(stream), getPasswordFromDatastream(stream)); try { queryUtils.initializeConnection(); if (!queryUtils.checkTableExist(source.getDatabaseName(), source.getTableName())) { throw new DatastreamValidationException( String.format("Invalid datastream: Can't find table %s in db %s.", source.getDatabaseName(), source.getTableName())); } } finally { queryUtils.closeConnection(); } } else { File binlogFolder = new File(source.getBinlogFolderName()); if (!binlogFolder.exists()) { String msg = String.format("BinlogFolder %s doesn't exist", binlogFolder.getAbsolutePath()); LOG.error(msg); throw new DatastreamValidationException(msg); } } if (stream.getSource().hasPartitions() && stream.getSource().getPartitions() != 1) { String msg = "Mysql connector can only support single partition sources"; LOG.error(msg); throw new DatastreamValidationException(msg); } } catch (SourceNotValidException | SQLException e) { throw new DatastreamValidationException(e); } }