Search in sources :

Example 1 with MySQLBinlogSource

use of org.apache.inlong.manager.client.api.source.MySQLBinlogSource in project incubator-inlong by apache.

the class InlongStreamSourceTransfer method parseMySQLBinlogSource.

private static MySQLBinlogSource parseMySQLBinlogSource(BinlogSourceResponse response) {
    MySQLBinlogSource binlogSource = new MySQLBinlogSource();
    binlogSource.setSourceName(response.getSourceName());
    binlogSource.setHostname(response.getHostname());
    binlogSource.setDataFormat(DataFormat.NONE);
    binlogSource.setPort(response.getPort());
    binlogSource.setAgentIp(response.getAgentIp());
    DefaultAuthentication defaultAuthentication = new DefaultAuthentication(response.getUser(), response.getPassword());
    binlogSource.setAuthentication(defaultAuthentication);
    binlogSource.setIncludeSchema(response.getIncludeSchema());
    binlogSource.setServerTimezone(response.getServerTimezone());
    binlogSource.setMonitoredDdl(response.getMonitoredDdl());
    binlogSource.setTimestampFormatStandard(response.getTimestampFormatStandard());
    binlogSource.setAllMigration(response.isAllMigration());
    if (StringUtils.isNotBlank(response.getDatabaseWhiteList())) {
        binlogSource.setDbNames(Arrays.asList(response.getDatabaseWhiteList().split(",")));
    }
    if (StringUtils.isNotBlank(response.getTableWhiteList())) {
        binlogSource.setTableNames(Arrays.asList(response.getTableWhiteList().split(",")));
    }
    return binlogSource;
}
Also used : DefaultAuthentication(org.apache.inlong.manager.client.api.auth.DefaultAuthentication) MySQLBinlogSource(org.apache.inlong.manager.client.api.source.MySQLBinlogSource)

Example 2 with MySQLBinlogSource

use of org.apache.inlong.manager.client.api.source.MySQLBinlogSource in project incubator-inlong by apache.

the class InlongStreamSourceTransfer method parseMySQLBinlogSource.

private static MySQLBinlogSource parseMySQLBinlogSource(BinlogSourceListResponse response) {
    MySQLBinlogSource binlogSource = new MySQLBinlogSource();
    binlogSource.setSourceName(response.getSourceName());
    binlogSource.setHostname(response.getHostname());
    binlogSource.setDataFormat(DataFormat.NONE);
    binlogSource.setPort(response.getPort());
    DefaultAuthentication defaultAuthentication = new DefaultAuthentication(response.getUser(), response.getPassword());
    binlogSource.setAuthentication(defaultAuthentication);
    binlogSource.setIncludeSchema(response.getIncludeSchema());
    binlogSource.setServerTimezone(response.getServerTimezone());
    binlogSource.setMonitoredDdl(response.getMonitoredDdl());
    binlogSource.setTimestampFormatStandard(response.getTimestampFormatStandard());
    binlogSource.setAllMigration(response.isAllMigration());
    if (StringUtils.isNotBlank(response.getDatabaseWhiteList())) {
        binlogSource.setDbNames(Arrays.asList(response.getDatabaseWhiteList().split(",")));
    }
    if (StringUtils.isNotBlank(response.getTableWhiteList())) {
        binlogSource.setTableNames(Arrays.asList(response.getTableWhiteList().split(",")));
    }
    return binlogSource;
}
Also used : DefaultAuthentication(org.apache.inlong.manager.client.api.auth.DefaultAuthentication) MySQLBinlogSource(org.apache.inlong.manager.client.api.source.MySQLBinlogSource)

Aggregations

DefaultAuthentication (org.apache.inlong.manager.client.api.auth.DefaultAuthentication)2 MySQLBinlogSource (org.apache.inlong.manager.client.api.source.MySQLBinlogSource)2