类 DistroProtocol

java.lang.Object
com.alibaba.nacos.core.distributed.distro.DistroProtocol

@Component public class DistroProtocol extends Object
Distro protocol.
作者:
xiweng.yy
  • 构造器详细资料

  • 方法详细资料

    • 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, 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, 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(String type)
      Query all datum snapshot.
      参数:
      type - datum type
      返回:
      all datum snapshot