类 ServerMemberManager

java.lang.Object
com.alibaba.nacos.core.cluster.ServerMemberManager
所有已实现的接口:
EventListener, org.springframework.context.ApplicationListener<org.springframework.boot.web.context.WebServerInitializedEvent>

@Component("serverMemberManager") public class ServerMemberManager extends Object implements org.springframework.context.ApplicationListener<org.springframework.boot.web.context.WebServerInitializedEvent>
Cluster node management in Nacos.

init() Cluster node manager initialization shutdown() The cluster node manager is down getSelf() Gets local node information getServerList() Gets the cluster node dictionary getMemberAddressInfos() Gets the address information of the healthy member node allMembers() Gets a list of member information objects allMembersWithoutSelf() Gets a list of cluster member nodes with the exception of this node hasMember(String) Is there a node memberChange(Collection) The final node list changes the method, making the full size more memberJoin(Collection) Node join, can automatically trigger memberLeave(Collection) When the node leaves, only the interface call can be manually triggered update(Member) Update the target node information isUnHealth(String) Whether the target node is healthy initAndStartLookup() Initializes the addressing mode

作者:
liaochuntao
  • 构造器详细资料

    • ServerMemberManager

      public ServerMemberManager(javax.servlet.ServletContext servletContext) throws Exception
      抛出:
      Exception
  • 方法详细资料

    • init

      protected void init() throws com.alibaba.nacos.api.exception.NacosException
      抛出:
      com.alibaba.nacos.api.exception.NacosException
    • switchLookup

      public void switchLookup(String name) throws com.alibaba.nacos.api.exception.NacosException
      switch look up.
      参数:
      name - look up name.
      抛出:
      com.alibaba.nacos.api.exception.NacosException - exception.
    • isUseAddressServer

      public static boolean isUseAddressServer()
    • update

      public boolean update(Member newMember)
      member information update.
      参数:
      newMember - Member
      返回:
      update is successw
    • hasMember

      public boolean hasMember(String address)
      Whether the node exists within the cluster.
      参数:
      address - ip:port
      返回:
      is exist
    • getServerListUnhealth

      public List<String> getServerListUnhealth()
    • getLookup

      public MemberLookup getLookup()
    • getSelf

      public Member getSelf()
    • find

      public Member find(String address)
    • allMembers

      public Collection<Member> allMembers()
      return this cluster all members.
      返回:
      Collection all member
    • allMembersWithoutSelf

      public List<Member> allMembersWithoutSelf()
      return this cluster all members without self.
      返回:
      Collection all member without self
    • memberJoin

      public boolean memberJoin(Collection<Member> members)
      members join this cluster.
      参数:
      members - Collection new members
      返回:
      is success
    • memberLeave

      public boolean memberLeave(Collection<Member> members)
      members leave this cluster.
      参数:
      members - Collection wait leave members
      返回:
      is success
    • isUnHealth

      public boolean isUnHealth(String address)
      this member Member.getState() is health.
      参数:
      address - ip:port
      返回:
      is health
    • isFirstIp

      public boolean isFirstIp()
    • onApplicationEvent

      public void onApplicationEvent(org.springframework.boot.web.context.WebServerInitializedEvent event)
      指定者:
      onApplicationEvent 在接口中 org.springframework.context.ApplicationListener<org.springframework.boot.web.context.WebServerInitializedEvent>
    • shutdown

      @PreDestroy public void shutdown() throws com.alibaba.nacos.api.exception.NacosException
      ServerMemberManager shutdown.
      抛出:
      com.alibaba.nacos.api.exception.NacosException - NacosException
    • getMemberAddressInfos

      public Set<String> getMemberAddressInfos()
    • updateMember

      public void updateMember(Member member)
    • setMemberAddressInfos

      public void setMemberAddressInfos(Set<String> memberAddressInfos)
    • getInfoReportTask

      public com.alibaba.nacos.core.cluster.ServerMemberManager.MemberInfoReportTask getInfoReportTask()
    • getServerList

      public Map<String,​Member> getServerList()
    • isInIpList

      public static boolean isInIpList()