public interface DRCClient
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addDataFilter(DataFilter 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(DataFilter 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.
|
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.
|
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()
??
|
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.
|
Thread |
startService()
Start the service running in a thread, the method does not block.
|
void |
stopService()
Stop the service thread;
|
void |
suspend()
??
|
void |
trimLongType()
trim blob or other type data to small size,omit some data
|
void |
useCaseSensitive()
upper case and lower case
|
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.IOException - log file related IO errors.Exceptionvoid 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.IOException - if the log file is not readable.Exceptionvoid 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.IOException - if the log file cannot be created.Exceptionvoid 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.IOException - if the log file cannot be created.ExceptionThread startService() throws Exception
IOException - IO Exception.DRCClientException - DRCClient internal Exception.Exceptionvoid resetService()
throws Exception
Exception - Exceptionvoid addListener(Listener listener)
listener - the listener who receives the 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()
void addDataFilter(DataFilter 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 - DRCClientExceptionvoid 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()
void trimLongType()
@Deprecated void addWhereFilter(DataFilter filter)
filter - DataFilter@Deprecated void useStrictFilter()
@Deprecated String getTaskName()
@Deprecated String getInstance()
Copyright © 2017. All Rights Reserved.