public interface DRCClient
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addClientCtrListener(Listener listener)
增加系统管控消息 listener
|
void |
addDataFilter(DataFilter filter)
已过时。
|
void |
addDataFilter(DataFilterBase filter)
Add data filter to provide required tables and columns.
|
void |
addDRCConfigure(String name,
String value)
Add drc client required properties.
|
void |
addListener(Listener listener)
Provide the listener for data.
|
void |
addUserParameter(String name,
String value)
Add user-defined parameter which is sent to the server.
|
void |
addWhereFilter(DataFilterBase filter)
已过时。
because now not supported
|
void |
askSelfUnit()
get current unit data
|
com.aliyun.drc.client.enums.DBType |
getDatabaseType()
Get the type of source database, current is "mysql" or "oceanbase"
|
String |
getDbName()
Get partial database name.
|
com.aliyun.drc.client.enums.DBType |
getDBType() |
String |
getDRCConfigure(String name)
Get one configure for drc client.
|
Map<String,String> |
getDRCConfigures()
Get all configures of drc client.
|
String |
getInstance()
已过时。
because each record has its own instance (db address)
|
String |
getTaskName()
已过时。
because no task name generated in servers
|
String |
getUserParameter(String name)
Get one parameter added by the user.
|
Map<String,String> |
getUserParameters()
Get all parameters added by the user.
|
void |
initService(String groupName,
String dbName,
String identification,
com.aliyun.drc.client.impl.Checkpoint checkpoint,
String localFilename)
Initialize the service by checkpoint in memory.
|
void |
initService(String groupName,
String dbName,
String identification,
String localFilename)
Used by users to reconnect according to the log fle.
|
void |
initService(String groupName,
String dbName,
String identification,
String startingPoint,
String localFilename)
Used by users to initialize the service by gmtModified.
|
void |
initService(String groupName,
String dbName,
String identification,
String startingPoint,
String metaVersion,
String taskname,
String mysql,
String localFilename)
Initialize the service by manually setting restarted checkpoint.
|
boolean |
isQuit()
判断是否需要退出消费成员
|
void |
requireTxnMark(boolean required)
Set whether requiring record type begin/commit.
|
void |
resetService()
Closed active connections and set the status as not quited.
|
void |
resume()
resume drc client
|
void |
setBlackList(String blackList)
db.table|db.table
|
void |
setDrcMark(String mark)
set regex (drc.t*x_begin4unit_mark_[0-9]* ,get current unit data)
|
void |
setGroup(String group)
Set the group name of the client.
|
void |
setHeartbeatFrequency(int everySeconds)
Set the frequency of heartbeat records received, one heartbeat every seconds.
|
void |
setNotifyRuntimePeriodInSec(long sec)
Set the time period to notify the listener by the time consumed.
|
void |
setNumOfRecordsPerBatch(int threshold)
Set the number of records in one batch by the server.
|
void |
setSubGroup(String subGroup)
Set the subgroup name of the client.
|
void |
startMultiService()
use hash mode,multiple subTopics
|
Thread |
startService()
Start the service running in a thread, the method does not block.
|
void |
stopService()
Stop the service thread;
|
void |
suspend()
suspend drc client
|
void |
trimLongType()
trim blob or other type data to small size,omit some data
|
void |
useCaseSensitive()
upper case and lower case
|
void |
useCRC32Check() |
void |
usePublicIp()
user public ip or private ip by default
|
void |
useStrictFilter()
已过时。
because now not supported
|
void initService(String groupName, String dbName, String identification, String startingPoint, String localFilename) throws Exception
groupName - is the name of the users' group.dbName - is the partial database name.identification - is the user's password.startingPoint - is either "checkpoint" or "gmt_modified".localFilename - path to binary log file.Exception - log file related IO errors.void initService(String groupName, String dbName, String identification, String localFilename) throws Exception
groupName - groupName is the name of the users' group.dbName - dbName is the partial database name.identification - is the user's password.localFilename - is path to binary log file.DRCClientException - if the log file not exists.Exception - if the log file is not readable.void initService(String groupName, String dbName, String identification, String startingPoint, String metaVersion, String taskname, String mysql, String localFilename) throws Exception
groupName - is the name of the users' group.dbName - is the partial database name.identification - is the user's password.startingPoint - is either "checkpoint" or "gmt_modified".metaVersion - is the metadata version.taskname - is the task name.mysql - is the address of the last database instance.localFilename - is path to binary log file.Exception - if the log file cannot be created.void initService(String groupName, String dbName, String identification, com.aliyun.drc.client.impl.Checkpoint checkpoint, String localFilename) throws Exception
groupName - is the name of the users' group.dbName - is the partial database name.identification - is the user's password.checkpoint - is the starting location in memory.localFilename - is path to binary log file.Exception - if the log file cannot be created.Thread startService() throws Exception
Exception - DRCClient internal Exception.void startMultiService()
throws Exception
Exception - DRCClient internal Exception.void stopService()
throws Exception
Exception - DRCClient internal Exception.void resetService()
throws Exception
Exception - DRCClient internal Exception.void addListener(Listener listener)
listener - the listener who receives the message.void addClientCtrListener(Listener listener)
listener - the listener who receives the ctrl message.void addDRCConfigure(String name, String value)
name - is the name of the property.value - is the value of the property.Map<String,String> getDRCConfigures()
String getDRCConfigure(String name)
name - is the name of the configure.void addUserParameter(String name, String value)
name - is the name of the parameter.value - is the value of the parameter.Map<String,String> getUserParameters()
String getUserParameter(String name)
name - is the name of the parameter.String getDbName()
@Deprecated void addDataFilter(DataFilter filter)
filter - DataFiltervoid addDataFilter(DataFilterBase filter)
filter - DataFiltervoid setHeartbeatFrequency(int everySeconds)
everySeconds - after how many seconds, has been sent one heartbeat.void requireTxnMark(boolean required)
required - ture if required, false otherwise, default is true.void setNotifyRuntimePeriodInSec(long sec)
sec - is the time period.void setNumOfRecordsPerBatch(int threshold)
threshold - is the number of records.com.aliyun.drc.client.enums.DBType getDatabaseType()
throws DRCClientException
DRCClientException - DRCClient internal Exception.void setGroup(String group)
group - groupvoid setSubGroup(String subGroup)
subGroup - subGroupvoid setDrcMark(String mark)
mark - regexvoid askSelfUnit()
void setBlackList(String blackList)
blackList - blackListvoid suspend()
void resume()
void usePublicIp()
void useCaseSensitive()
@Deprecated void addWhereFilter(DataFilterBase filter)
filter - DataFilter@Deprecated void useStrictFilter()
@Deprecated String getTaskName()
@Deprecated String getInstance()
void trimLongType()
void useCRC32Check()
com.aliyun.drc.client.enums.DBType getDBType()
boolean isQuit()
Copyright © 2019. All Rights Reserved.