use of com.dtstack.taier.develop.utils.develop.sync.template.RDBReader in project Taier by DTStack.
the class DatasourceService method putDefaultEmptyValueForReader.
/**
* 向导模式,填充reader的默认信息
* @param sourceType
* @param reader
* @return
*/
private Reader putDefaultEmptyValueForReader(int sourceType, Reader reader) {
if (Objects.nonNull(RDBMSSourceType.getByDataSourceType(sourceType)) && DataSourceType.HIVE.getVal() != sourceType && DataSourceType.HIVE1X.getVal() != sourceType && DataSourceType.HIVE3X.getVal() != sourceType && DataSourceType.SparkThrift2_1.getVal() != sourceType && DataSourceType.CarbonData.getVal() != sourceType) {
RDBReader rdbReader = (RDBReader) reader;
rdbReader.setWhere("");
rdbReader.setSplitPK("");
return rdbReader;
} else if (DataSourceType.ES.getVal() == sourceType) {
EsReader esReader = (EsReader) reader;
JSONObject obj = new JSONObject();
obj.put("col", "");
JSONObject query = new JSONObject();
query.put("match", obj);
esReader.setQuery(query);
JSONObject column = new JSONObject();
column.put("key", "col1");
column.put("type", "string");
esReader.getColumn().add(column);
return esReader;
} else if (DataSourceType.FTP.getVal() == sourceType) {
FtpReader ftpReader = (FtpReader) reader;
ftpReader.setPath("/");
return ftpReader;
} else if (DataSourceType.INFLUXDB.getVal().equals(sourceType)) {
InfluxDBReader influxDBReader = (InfluxDBReader) reader;
influxDBReader.setWhere("");
influxDBReader.setSplitPK("");
return influxDBReader;
}
return reader;
}
Aggregations