mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
modify
This commit is contained in:
@@ -65,7 +65,7 @@ public class ESSyncService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (logger.isTraceEnabled()) {
|
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),
|
(System.currentTimeMillis() - begin),
|
||||||
esSyncConfigs.size(),
|
esSyncConfigs.size(),
|
||||||
dml.getDestination());
|
dml.getDestination());
|
||||||
@@ -81,13 +81,13 @@ public class ESSyncService {
|
|||||||
if (type != null && type.equalsIgnoreCase("INSERT")) {
|
if (type != null && type.equalsIgnoreCase("INSERT")) {
|
||||||
insert(config, dml);
|
insert(config, dml);
|
||||||
} else if (type != null && type.equalsIgnoreCase("UPDATE")) {
|
} else if (type != null && type.equalsIgnoreCase("UPDATE")) {
|
||||||
// update(config, dml);
|
update(config, dml);
|
||||||
} else if (type != null && type.equalsIgnoreCase("DELETE")) {
|
} else if (type != null && type.equalsIgnoreCase("DELETE")) {
|
||||||
// delete(config, dml);
|
delete(config, dml);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (logger.isTraceEnabled()) {
|
if (logger.isTraceEnabled()) {
|
||||||
logger.trace("Sync elapsed time: {},destination: {}, es index: {}",
|
logger.trace("Sync elapsed time: {} ms,destination: {}, es index: {}",
|
||||||
(System.currentTimeMillis() - begin),
|
(System.currentTimeMillis() - begin),
|
||||||
dml.getDestination(),
|
dml.getDestination(),
|
||||||
config.getEsMapping().get_index());
|
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操作
|
* 插入dml操作
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -38,8 +38,7 @@ public class HbaseSyncService {
|
|||||||
delete(config, dml);
|
delete(config, dml);
|
||||||
}
|
}
|
||||||
if (logger.isDebugEnabled()) {
|
if (logger.isDebugEnabled()) {
|
||||||
String res = dml.toString();
|
logger.debug("DML: {}", dml.toString());
|
||||||
logger.debug(res);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -199,7 +198,8 @@ public class HbaseSyncService {
|
|||||||
Map<String, MappingConfig.ColumnItem> columnItems = hbaseMapping.getColumnItems();
|
Map<String, MappingConfig.ColumnItem> columnItems = hbaseMapping.getColumnItems();
|
||||||
HRow hRow = new HRow(rowKeyBytes);
|
HRow hRow = new HRow(rowKeyBytes);
|
||||||
for (String updateColumn : old.get(index).keySet()) {
|
for (String updateColumn : old.get(index).keySet()) {
|
||||||
if (hbaseMapping.getExcludeColumns() != null && hbaseMapping.getExcludeColumns().contains(updateColumn)) {
|
if (hbaseMapping.getExcludeColumns() != null
|
||||||
|
&& hbaseMapping.getExcludeColumns().contains(updateColumn)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
MappingConfig.ColumnItem columnItem = columnItems.get(updateColumn);
|
MappingConfig.ColumnItem columnItem = columnItems.get(updateColumn);
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ public class LoggerAdapterExample implements OuterAdapter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sync(Dml dml) {
|
public void sync(Dml dml) {
|
||||||
logger.info(dml.toString());
|
logger.info("DML: ", dml.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user