use of org.apache.inlong.manager.common.pojo.source.binlog.BinlogSourceRequest in project incubator-inlong by apache.
the class StreamSourceServiceTest method testGetAndUpdate.
@Test
public void testGetAndUpdate() {
Integer id = this.saveSource();
SourceResponse response = sourceService.get(id, Constant.SOURCE_BINLOG);
Assert.assertEquals(globalGroupId, response.getInlongGroupId());
BinlogSourceResponse binlogResponse = (BinlogSourceResponse) response;
BinlogSourceRequest request = CommonBeanUtils.copyProperties(binlogResponse, BinlogSourceRequest::new);
boolean result = sourceService.update(request, globalOperator);
Assert.assertTrue(result);
sourceService.delete(id, Constant.SOURCE_BINLOG, globalOperator);
}
use of org.apache.inlong.manager.common.pojo.source.binlog.BinlogSourceRequest in project incubator-inlong by apache.
the class InlongStreamSourceTransfer method createBinlogSourceRequest.
private static BinlogSourceRequest createBinlogSourceRequest(MySQLBinlogSource binlogSource, InlongStreamInfo streamInfo) {
BinlogSourceRequest sourceRequest = new BinlogSourceRequest();
sourceRequest.setSourceName(binlogSource.getSourceName());
sourceRequest.setInlongGroupId(streamInfo.getInlongGroupId());
sourceRequest.setInlongStreamId(streamInfo.getInlongStreamId());
sourceRequest.setSourceType(binlogSource.getSourceType().name());
sourceRequest.setAgentIp(binlogSource.getAgentIp());
DefaultAuthentication authentication = binlogSource.getAuthentication();
sourceRequest.setUser(authentication.getUserName());
sourceRequest.setPassword(authentication.getPassword());
sourceRequest.setHostname(binlogSource.getHostname());
sourceRequest.setPort(binlogSource.getPort());
sourceRequest.setIncludeSchema(binlogSource.getIncludeSchema());
sourceRequest.setServerTimezone(binlogSource.getServerTimezone());
sourceRequest.setMonitoredDdl(binlogSource.getMonitoredDdl());
sourceRequest.setAllMigration(binlogSource.isAllMigration());
if (CollectionUtils.isNotEmpty(binlogSource.getDbNames())) {
String dbNames = Joiner.on(",").join(binlogSource.getDbNames());
sourceRequest.setDatabaseWhiteList(dbNames);
}
if (CollectionUtils.isNotEmpty(binlogSource.getTableNames())) {
String tableNames = Joiner.on(",").join(binlogSource.getTableNames());
sourceRequest.setTableWhiteList(tableNames);
}
sourceRequest.setSnapshotMode("initial");
sourceRequest.setIntervalMs("500");
sourceRequest.setTimestampFormatStandard(binlogSource.getTimestampFormatStandard());
return sourceRequest;
}
Aggregations