类 InstanceOperatorClientImpl

  • 所有已实现的接口:
    InstanceOperator

    @Service
    public class InstanceOperatorClientImpl
    extends java.lang.Object
    implements InstanceOperator
    Instance service.
    作者:
    xiweng.yy
    • 方法详细资料

      • registerInstance

        public void registerInstance​(java.lang.String namespaceId,
                                     java.lang.String serviceName,
                                     com.alibaba.nacos.api.naming.pojo.Instance instance)
                              throws com.alibaba.nacos.api.exception.NacosException
        This method creates IpPortBasedClient if it don't exist.
        指定者:
        registerInstance 在接口中 InstanceOperator
        参数:
        namespaceId - id of namespace
        serviceName - grouped service name group@@service
        instance - instance to register
        抛出:
        com.alibaba.nacos.api.exception.NacosException - nacos exception when register failed
      • removeInstance

        public void removeInstance​(java.lang.String namespaceId,
                                   java.lang.String serviceName,
                                   com.alibaba.nacos.api.naming.pojo.Instance instance)
        从接口复制的说明: InstanceOperator
        Remove instance from service.
        指定者:
        removeInstance 在接口中 InstanceOperator
        参数:
        namespaceId - namespace
        serviceName - grouped service name group@@service
        instance - instance
      • updateInstance

        public void updateInstance​(java.lang.String namespaceId,
                                   java.lang.String serviceName,
                                   com.alibaba.nacos.api.naming.pojo.Instance instance)
                            throws com.alibaba.nacos.api.exception.NacosException
        从接口复制的说明: InstanceOperator
        Update instance information. Due to the basic information can't be changed, so this update should only update metadata.

        Update API will replace the whole metadata with new input instance.

        指定者:
        updateInstance 在接口中 InstanceOperator
        参数:
        namespaceId - namespace
        serviceName - grouped service name group@@service
        instance - instance
        抛出:
        com.alibaba.nacos.api.exception.NacosException - nacos exception when update failed
      • buildMetadata

        private InstanceMetadata buildMetadata​(com.alibaba.nacos.api.naming.pojo.Instance instance)
      • patchInstance

        public void patchInstance​(java.lang.String namespaceId,
                                  java.lang.String serviceName,
                                  InstancePatchObject patchObject)
                           throws com.alibaba.nacos.api.exception.NacosException
        从接口复制的说明: InstanceOperator
        Patch update instance information. Due to the basic information can't be changed, so this update should only update metadata.

        Patch update will only update variables in requests, the others will keep original value.

        指定者:
        patchInstance 在接口中 InstanceOperator
        参数:
        namespaceId - namespace
        serviceName - grouped service name group@@service
        patchObject - objects need to be patch
        抛出:
        com.alibaba.nacos.api.exception.NacosException - nacos exception when update failed
      • listInstance

        public com.alibaba.nacos.api.naming.pojo.ServiceInfo listInstance​(java.lang.String namespaceId,
                                                                          java.lang.String serviceName,
                                                                          Subscriber subscriber,
                                                                          java.lang.String cluster,
                                                                          boolean healthOnly)
        从接口复制的说明: InstanceOperator
        Get all instance of input service.
        指定者:
        listInstance 在接口中 InstanceOperator
        参数:
        namespaceId - namespace
        serviceName - grouped service name group@@service
        subscriber - subscriber info
        cluster - cluster of instances
        healthOnly - whether only return health instances
        返回:
        service info
      • getInstance

        public com.alibaba.nacos.api.naming.pojo.Instance getInstance​(java.lang.String namespaceId,
                                                                      java.lang.String serviceName,
                                                                      java.lang.String cluster,
                                                                      java.lang.String ip,
                                                                      int port)
                                                               throws com.alibaba.nacos.api.exception.NacosException
        从接口复制的说明: InstanceOperator
        Get instance detail information.
        指定者:
        getInstance 在接口中 InstanceOperator
        参数:
        namespaceId - namespace
        serviceName - grouped service name group@@service
        cluster - cluster of instance
        ip - ip of instance
        port - port of instance
        返回:
        instance info
        抛出:
        com.alibaba.nacos.api.exception.NacosException - nacos exception during query
      • getInstance0

        private com.alibaba.nacos.api.naming.pojo.Instance getInstance0​(Service service,
                                                                        java.lang.String cluster,
                                                                        java.lang.String ip,
                                                                        int port)
                                                                 throws com.alibaba.nacos.api.exception.NacosException
        抛出:
        com.alibaba.nacos.api.exception.NacosException
      • handleBeat

        public int handleBeat​(java.lang.String namespaceId,
                              java.lang.String serviceName,
                              java.lang.String ip,
                              int port,
                              java.lang.String cluster,
                              RsInfo clientBeat,
                              BeatInfoInstanceBuilder builder)
                       throws com.alibaba.nacos.api.exception.NacosException
        从接口复制的说明: InstanceOperator
        Handle beat request.
        指定者:
        handleBeat 在接口中 InstanceOperator
        参数:
        namespaceId - namespace
        serviceName - grouped service name group@@service
        ip - ip of instance
        port - port of instance
        cluster - cluster of instance
        clientBeat - client beat info
        builder - client beat instance builder, will be used when current instance is not exist and clientBeat exist
        返回:
        result code
        抛出:
        com.alibaba.nacos.api.exception.NacosException - nacos exception when service non-exist and client beat info is null
      • getHeartBeatInterval

        public long getHeartBeatInterval​(java.lang.String namespaceId,
                                         java.lang.String serviceName,
                                         java.lang.String ip,
                                         int port,
                                         java.lang.String cluster)
        从接口复制的说明: InstanceOperator
        Get heart beat interval for specified instance.
        指定者:
        getHeartBeatInterval 在接口中 InstanceOperator
        参数:
        namespaceId - namespace
        serviceName - grouped service name group@@service
        ip - ip of instance
        port - port of instance
        cluster - cluster of instance
        返回:
        heart beat interval
      • listAllInstances

        public java.util.List<? extends com.alibaba.nacos.api.naming.pojo.Instance> listAllInstances​(java.lang.String namespaceId,
                                                                                                     java.lang.String serviceName)
                                                                                              throws com.alibaba.nacos.api.exception.NacosException
        从接口复制的说明: InstanceOperator
        List all instances whatever status they are.
        指定者:
        listAllInstances 在接口中 InstanceOperator
        参数:
        namespaceId - namespace
        serviceName - grouped service name group@@service
        返回:
        all instances
        抛出:
        com.alibaba.nacos.api.exception.NacosException - nacos exception during query
      • batchUpdateMetadata

        public java.util.List<java.lang.String> batchUpdateMetadata​(java.lang.String namespaceId,
                                                                    InstanceOperationInfo instanceOperationInfo,
                                                                    java.util.Map<java.lang.String,​java.lang.String> metadata)
                                                             throws com.alibaba.nacos.api.exception.NacosException
        从接口复制的说明: InstanceOperator
        Batch update metadata of instances.
        指定者:
        batchUpdateMetadata 在接口中 InstanceOperator
        参数:
        namespaceId - namespace Id of instances
        instanceOperationInfo - instance operation info
        metadata - updated metadata
        返回:
        updated instance
        抛出:
        com.alibaba.nacos.api.exception.NacosException - nacos exception during update
      • batchDeleteMetadata

        public java.util.List<java.lang.String> batchDeleteMetadata​(java.lang.String namespaceId,
                                                                    InstanceOperationInfo instanceOperationInfo,
                                                                    java.util.Map<java.lang.String,​java.lang.String> metadata)
                                                             throws com.alibaba.nacos.api.exception.NacosException
        从接口复制的说明: InstanceOperator
        Batch delete metadata of instances.
        指定者:
        batchDeleteMetadata 在接口中 InstanceOperator
        参数:
        namespaceId - namespace Id of instances
        instanceOperationInfo - instance operation info
        metadata - delete metadata
        返回:
        updated instance
        抛出:
        com.alibaba.nacos.api.exception.NacosException - nacos exception during update
      • findBatchUpdateInstance

        private java.util.List<com.alibaba.nacos.api.naming.pojo.Instance> findBatchUpdateInstance​(InstanceOperationInfo instanceOperationInfo,
                                                                                                   Service service)
      • createIpPortClientIfAbsent

        private void createIpPortClientIfAbsent​(java.lang.String clientId)
      • getService

        private Service getService​(java.lang.String namespaceId,
                                   java.lang.String serviceName,
                                   boolean ephemeral)