use of com.dtstack.taier.develop.utils.develop.sync.template.EsWriter in project Taier by DTStack.
the class DatasourceService method putDefaultEmptyValueForWriter.
private Writer putDefaultEmptyValueForWriter(int targetType, Writer writer) {
if (Objects.nonNull(RDBMSSourceType.getByDataSourceType(targetType)) && !notPutValueFoeWriterSourceTypeSet.contains(targetType)) {
RDBWriter rdbWriter = (RDBWriter) writer;
rdbWriter.setPostSql("");
rdbWriter.setPostSql("");
rdbWriter.setSession("");
if (DataSourceType.GREENPLUM6.getVal() == targetType) {
rdbWriter.setWriteMode("insert");
} else {
rdbWriter.setWriteMode("replace");
}
return rdbWriter;
} else if (DataSourceType.ES.getVal() == targetType) {
EsWriter esWriter = (EsWriter) writer;
esWriter.setType("");
esWriter.setIndex("");
JSONObject column = new JSONObject();
column.put("key", "col1");
column.put("type", "string");
JSONObject idColumn = new JSONObject();
idColumn.put("index", 0);
idColumn.put("type", "int");
esWriter.getIdColumn().add(idColumn);
return esWriter;
}
return writer;
}
Aggregations