public class SyncClient extends Object implements ISyncClient
| 限定符和类型 | 方法和说明 |
|---|---|
void |
confirmIdentity()
Confirm identity, the receiver will check whether the sender has synchronization privileges.
|
void |
establishConnection(String serverIp,
int serverPort)
Establish a connection to receiver end.
|
static SyncClient |
getInstance() |
void |
init() |
static void |
main(String[] args)
Create a sender and sync files to the receiver periodically.
|
void |
setConfig(SyncSenderConfig config) |
void |
startMonitor()
Start monitor thread, which monitor sync status.
|
void |
startTimedTask()
Start sync task in a certain time.
|
void |
stop()
Stop sync process
|
void |
sync()
Execute a sync task for a data directory.
|
void |
syncAll()
Execute a sync task for all data directory.
|
void |
syncDataFilesInOneGroup(String sgName,
Long vgId,
Long timeRangeId,
Set<File> toBeSyncFiles)
For new valid files in a storage group, sync them to receiver side and load these data in
receiver.
|
void |
syncDeletedFilesNameInOneGroup(String sgName,
Long vgId,
Long timeRangeId,
Set<File> deletedFilesName)
For deleted files in a storage group, sync them to receiver side and load these files in
receiver.
|
void |
syncSchema()
Sync schema file to receiver before all data to be synced.
|
void |
verifySingleton()
Verify whether the client lock file is locked or not, ensuring that only one client is running.
|
public static SyncClient getInstance()
public static void main(String[] args) throws IOException
IOExceptionpublic void verifySingleton()
throws IOException
ISyncClientverifySingleton 在接口中 ISyncClientIOExceptionpublic void init()
init 在接口中 ISyncClientpublic void startMonitor()
ISyncClientstartMonitor 在接口中 ISyncClientpublic void startTimedTask()
ISyncClientstartTimedTask 在接口中 ISyncClientpublic void stop()
ISyncClientstop 在接口中 ISyncClientpublic void syncAll()
throws SyncConnectionException,
IOException,
org.apache.thrift.TException
ISyncClientsyncAll 在接口中 ISyncClientSyncConnectionExceptionIOExceptionorg.apache.thrift.TExceptionpublic void establishConnection(String serverIp, int serverPort) throws SyncConnectionException
ISyncClientestablishConnection 在接口中 ISyncClientSyncConnectionExceptionpublic void confirmIdentity()
throws SyncConnectionException
ISyncClientconfirmIdentity 在接口中 ISyncClientSyncConnectionExceptionpublic void syncSchema()
throws SyncConnectionException,
org.apache.thrift.TException
ISyncClientsyncSchema 在接口中 ISyncClientSyncConnectionExceptionorg.apache.thrift.TExceptionpublic void sync()
throws IOException
ISyncClientsync 在接口中 ISyncClientIOExceptionpublic void syncDeletedFilesNameInOneGroup(String sgName, Long vgId, Long timeRangeId, Set<File> deletedFilesName) throws IOException
ISyncClientsyncDeletedFilesNameInOneGroup 在接口中 ISyncClientsgName - storage group namevgId - virtual group idtimeRangeId - id of time rangedeletedFilesName - list of deleted file namesIOExceptionpublic void syncDataFilesInOneGroup(String sgName, Long vgId, Long timeRangeId, Set<File> toBeSyncFiles) throws SyncConnectionException, IOException, SyncDeviceOwnerConflictException
ISyncClientsyncDataFilesInOneGroup 在接口中 ISyncClientsgName - storage group namevgId - virtual group idtimeRangeId - id of time rangetoBeSyncFiles - list of new tsfile namesSyncConnectionExceptionIOExceptionSyncDeviceOwnerConflictExceptionpublic void setConfig(SyncSenderConfig config)
Copyright © 2022 The Apache Software Foundation. All rights reserved.