类 DistroProtocol


  • @Component
    public class DistroProtocol
    extends java.lang.Object
    Distro protocol.
    作者:
    xiweng.yy
    • 方法详细资料

      • startDistroTask

        private void startDistroTask()
      • startLoadTask

        private void startLoadTask()
      • startVerifyTask

        private void startVerifyTask()
      • isInitialized

        public boolean isInitialized()
      • sync

        public void sync​(DistroKey distroKey,
                         com.alibaba.nacos.consistency.DataOperation action)
        Start to sync by configured delay.
        参数:
        distroKey - distro key of sync data
        action - 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 data
        action - the action of data operation
        delay - delay time for sync
      • syncToTarget

        public void syncToTarget​(DistroKey distroKey,
                                 com.alibaba.nacos.consistency.DataOperation action,
                                 java.lang.String targetServer,
                                 long delay)
        Start to sync to target server.
        参数:
        distroKey - distro key of sync data
        action - the action of data operation
        targetServer - target server
        delay - delay time for sync
      • queryFromRemote

        public DistroData queryFromRemote​(DistroKey distroKey)
        Query data from specified server.
        参数:
        distroKey - data key
        返回:
        data
      • onReceive

        public boolean onReceive​(DistroData distroData)
        Receive synced distro data, find processor to process.
        参数:
        distroData - Received data
        返回:
        true if handle receive data successfully, otherwise false
      • onVerify

        public boolean onVerify​(DistroData distroData,
                                java.lang.String sourceAddress)
        Receive verify data, find processor to process.
        参数:
        distroData - verify data
        sourceAddress - source server address, might be get data from source server
        返回:
        true if verify data successfully, otherwise false
      • onQuery

        public DistroData onQuery​(DistroKey distroKey)
        Query data of input distro key.
        参数:
        distroKey - key of data
        返回:
        data
      • onSnapshot

        public DistroData onSnapshot​(java.lang.String type)
        Query all datum snapshot.
        参数:
        type - datum type
        返回:
        all datum snapshot