public abstract class CanalConnectorClient
extends com.alibaba.otter.canal.common.AbstractCanalLifeCycle
implements org.springframework.beans.factory.InitializingBean
| 限定符和类型 | 类和说明 |
|---|---|
static class |
CanalConnectorClient.ExceptionStrategy |
| 限定符和类型 | 字段和说明 |
|---|---|
protected CanalConnector |
connector |
protected static String |
contextFormat |
protected static String |
DATE_FORMAT |
protected boolean |
debug |
protected int |
exceptionStrategy |
protected Thread.UncaughtExceptionHandler |
handler |
protected static org.slf4j.Logger |
logger |
protected int |
retryTimes |
protected static String |
rowFormat |
protected static String |
SEP |
protected Thread |
thread |
protected static String |
transactionFormat |
protected int |
waitingTime |
| 构造器和说明 |
|---|
CanalConnectorClient() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
afterPropertiesSet() |
protected String |
buildPosition(CanalEntry.Entry entry) |
String |
getAddress() |
int |
getBatchSize() |
String |
getDestination() |
int |
getExceptionStrategy() |
String |
getFilter() |
String |
getPassword() |
int |
getRetryTimes() |
String |
getUsername() |
int |
getWaitingTime() |
String |
getZkServers() |
boolean |
isDebug() |
protected boolean |
isDML(CanalEntry.EventType eventType)
判断事件类型为DML 数据
|
protected void |
printBatch(Message message,
long batchId)
打印当前batch的摘要信息
|
void |
process() |
protected void |
processDDL(CanalEntry.Header header,
CanalEntry.EventType eventType,
String sql)
处理 DDL数据
|
protected abstract void |
processMessage(Message message) |
protected void |
quietlyStop(Thread task) |
void |
setAddress(String address) |
void |
setBatchSize(int batchSize) |
void |
setDebug(boolean debug) |
void |
setDestination(String destination) |
void |
setExceptionStrategy(int exceptionStrategy) |
void |
setFilter(String filter) |
void |
setPassword(String password) |
void |
setRetryTimes(int retryTimes) |
void |
setUsername(String username) |
void |
setWaitingTime(int waitingTime) |
void |
setZkServers(String zkServers) |
void |
start() |
void |
stop() |
protected void |
transactionBegin(CanalEntry.Entry entry)
default,only logging information
|
protected void |
transactionEnd(CanalEntry.Entry entry) |
void |
whenOthers(CanalEntry.Header header,
String sql)
强烈建议捕获异常,非上述已列出的其他操作,非核心
除了“insert”、“update”、“delete”操作之外的,其他类型的操作.
|
protected static final org.slf4j.Logger logger
protected static final String SEP
protected static String contextFormat
protected static String rowFormat
protected static String transactionFormat
protected boolean debug
protected int exceptionStrategy
protected int retryTimes
protected int waitingTime
protected CanalConnector connector
protected Thread thread
protected Thread.UncaughtExceptionHandler handler
public void afterPropertiesSet()
afterPropertiesSet 在接口中 org.springframework.beans.factory.InitializingBeanpublic void start()
start 在接口中 com.alibaba.otter.canal.common.CanalLifeCyclestart 在类中 com.alibaba.otter.canal.common.AbstractCanalLifeCyclepublic void stop()
stop 在接口中 com.alibaba.otter.canal.common.CanalLifeCyclestop 在类中 com.alibaba.otter.canal.common.AbstractCanalLifeCycleprotected void quietlyStop(Thread task)
public void process()
protected abstract void processMessage(Message message)
protected void printBatch(Message message, long batchId)
message - batchId - protected String buildPosition(CanalEntry.Entry entry)
protected void transactionBegin(CanalEntry.Entry entry)
entry - protected void transactionEnd(CanalEntry.Entry entry)
protected boolean isDML(CanalEntry.EventType eventType)
eventType - protected void processDDL(CanalEntry.Header header, CanalEntry.EventType eventType, String sql)
header - eventType - sql - public void whenOthers(CanalEntry.Header header, String sql)
header - 可以从header中获得schema、table的名称sql - public String getZkServers()
public void setZkServers(String zkServers)
public String getAddress()
public void setAddress(String address)
public String getDestination()
public void setDestination(String destination)
public String getUsername()
public void setUsername(String username)
public String getPassword()
public void setPassword(String password)
public int getBatchSize()
public void setBatchSize(int batchSize)
public String getFilter()
public void setFilter(String filter)
public boolean isDebug()
public void setDebug(boolean debug)
public int getExceptionStrategy()
public void setExceptionStrategy(int exceptionStrategy)
public int getRetryTimes()
public void setRetryTimes(int retryTimes)
public int getWaitingTime()
public void setWaitingTime(int waitingTime)
Copyright © 2018. All rights reserved.