This commit is contained in:
mcy
2018-11-01 14:43:59 +08:00
parent 9d04a82c42
commit a6b16eedfa
3 changed files with 16 additions and 8 deletions

View File

@@ -65,7 +65,7 @@ public class ESSyncService {
}
}
if (logger.isTraceEnabled()) {
logger.trace("Sync elapsed time: {}, effect index count:{}, destination: {}",
logger.trace("Sync elapsed time: {} ms, effect index count:{}, destination: {}",
(System.currentTimeMillis() - begin),
esSyncConfigs.size(),
dml.getDestination());
@@ -81,13 +81,13 @@ public class ESSyncService {
if (type != null && type.equalsIgnoreCase("INSERT")) {
insert(config, dml);
} else if (type != null && type.equalsIgnoreCase("UPDATE")) {
// update(config, dml);
update(config, dml);
} else if (type != null && type.equalsIgnoreCase("DELETE")) {
// delete(config, dml);
delete(config, dml);
}
if (logger.isTraceEnabled()) {
logger.trace("Sync elapsed time: {},destination: {}, es index: {}",
logger.trace("Sync elapsed time: {} ms,destination: {}, es index: {}",
(System.currentTimeMillis() - begin),
dml.getDestination(),
config.getEsMapping().get_index());
@@ -98,6 +98,14 @@ public class ESSyncService {
}
}
private void delete(ESSyncConfig config, Dml dml) {
}
private void update(ESSyncConfig config, Dml dml) {
}
/**
* 插入dml操作
*

View File

@@ -38,8 +38,7 @@ public class HbaseSyncService {
delete(config, dml);
}
if (logger.isDebugEnabled()) {
String res = dml.toString();
logger.debug(res);
logger.debug("DML: {}", dml.toString());
}
}
} catch (Exception e) {
@@ -199,7 +198,8 @@ public class HbaseSyncService {
Map<String, MappingConfig.ColumnItem> columnItems = hbaseMapping.getColumnItems();
HRow hRow = new HRow(rowKeyBytes);
for (String updateColumn : old.get(index).keySet()) {
if (hbaseMapping.getExcludeColumns() != null && hbaseMapping.getExcludeColumns().contains(updateColumn)) {
if (hbaseMapping.getExcludeColumns() != null
&& hbaseMapping.getExcludeColumns().contains(updateColumn)) {
continue;
}
MappingConfig.ColumnItem columnItem = columnItems.get(updateColumn);

View File

@@ -27,7 +27,7 @@ public class LoggerAdapterExample implements OuterAdapter {
@Override
public void sync(Dml dml) {
logger.info(dml.toString());
logger.info("DML: ", dml.toString());
}
@Override