类 DistroProtocol
java.lang.Object
com.alibaba.nacos.core.distributed.distro.DistroProtocol
Distro protocol.
- 作者:
- xiweng.yy
-
构造器概要
构造器构造器说明DistroProtocol(ServerMemberManager memberManager, DistroComponentHolder distroComponentHolder, DistroTaskEngineHolder distroTaskEngineHolder) -
方法概要
修饰符和类型方法说明booleanQuery data of input distro key.booleanonReceive(DistroData distroData)Receive synced distro data, find processor to process.onSnapshot(String type)Query all datum snapshot.booleanonVerify(DistroData distroData, String sourceAddress)Receive verify data, find processor to process.queryFromRemote(DistroKey distroKey)Query data from specified server.voidStart to sync by configured delay.voidStart to sync data to all remote server.voidsyncToTarget(DistroKey distroKey, com.alibaba.nacos.consistency.DataOperation action, String targetServer, long delay)Start to sync to target server.
-
构造器详细资料
-
DistroProtocol
public DistroProtocol(ServerMemberManager memberManager, DistroComponentHolder distroComponentHolder, DistroTaskEngineHolder distroTaskEngineHolder)
-
-
方法详细资料
-
isInitialized
public boolean isInitialized() -
sync
Start to sync by configured delay.- 参数:
distroKey- distro key of sync dataaction- the action of data operation
-
sync
public void sync(DistroKey distroKey, com.alibaba.nacos.consistency.DataOperation action, long delay)Start to sync data to all remote server.- 参数:
distroKey- distro key of sync dataaction- the action of data operationdelay- delay time for sync
-
syncToTarget
public void syncToTarget(DistroKey distroKey, com.alibaba.nacos.consistency.DataOperation action, String targetServer, long delay)Start to sync to target server.- 参数:
distroKey- distro key of sync dataaction- the action of data operationtargetServer- target serverdelay- delay time for sync
-
queryFromRemote
Query data from specified server.- 参数:
distroKey- data key- 返回:
- data
-
onReceive
Receive synced distro data, find processor to process.- 参数:
distroData- Received data- 返回:
- true if handle receive data successfully, otherwise false
-
onVerify
Receive verify data, find processor to process.- 参数:
distroData- verify datasourceAddress- source server address, might be get data from source server- 返回:
- true if verify data successfully, otherwise false
-
onQuery
Query data of input distro key.- 参数:
distroKey- key of data- 返回:
- data
-
onSnapshot
Query all datum snapshot.- 参数:
type- datum type- 返回:
- all datum snapshot
-