类 InstanceOperatorClientImpl
- java.lang.Object
-
- com.alibaba.nacos.naming.core.InstanceOperatorClientImpl
-
- 所有已实现的接口:
InstanceOperator
@Service public class InstanceOperatorClientImpl extends java.lang.Object implements InstanceOperator
Instance service.- 作者:
- xiweng.yy
-
-
字段概要
字段 修饰符和类型 字段 说明 private ClientManagerclientManagerprivate ClientOperationServiceclientOperationServiceprivate NamingMetadataManagermetadataManagerprivate NamingMetadataOperateServicemetadataOperateServiceprivate UdpPushServicepushServiceprivate ServiceStorageserviceStorageprivate SwitchDomainswitchDomain
-
构造器概要
构造器 构造器 说明 InstanceOperatorClientImpl(ClientManagerDelegate clientManager, ClientOperationServiceProxy clientOperationService, ServiceStorage serviceStorage, NamingMetadataOperateService metadataOperateService, NamingMetadataManager metadataManager, SwitchDomain switchDomain, UdpPushService pushService)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 java.util.List<java.lang.String>batchDeleteMetadata(java.lang.String namespaceId, InstanceOperationInfo instanceOperationInfo, java.util.Map<java.lang.String,java.lang.String> metadata)Batch delete metadata of instances.java.util.List<java.lang.String>batchUpdateMetadata(java.lang.String namespaceId, InstanceOperationInfo instanceOperationInfo, java.util.Map<java.lang.String,java.lang.String> metadata)Batch update metadata of instances.private InstanceMetadatabuildMetadata(com.alibaba.nacos.api.naming.pojo.Instance instance)private InstanceMetadatacloneMetadata(InstanceMetadata instanceMetadata)private voidcreateIpPortClientIfAbsent(java.lang.String clientId)private java.util.List<com.alibaba.nacos.api.naming.pojo.Instance>findBatchUpdateInstance(InstanceOperationInfo instanceOperationInfo, Service service)longgetHeartBeatInterval(java.lang.String namespaceId, java.lang.String serviceName, java.lang.String ip, int port, java.lang.String cluster)Get heart beat interval for specified instance.com.alibaba.nacos.api.naming.pojo.InstancegetInstance(java.lang.String namespaceId, java.lang.String serviceName, java.lang.String cluster, java.lang.String ip, int port)Get instance detail information.private com.alibaba.nacos.api.naming.pojo.InstancegetInstance0(Service service, java.lang.String cluster, java.lang.String ip, int port)private ServicegetService(java.lang.String namespaceId, java.lang.String serviceName, boolean ephemeral)inthandleBeat(java.lang.String namespaceId, java.lang.String serviceName, java.lang.String ip, int port, java.lang.String cluster, RsInfo clientBeat, BeatInfoInstanceBuilder builder)Handle beat request.java.util.List<? extends com.alibaba.nacos.api.naming.pojo.Instance>listAllInstances(java.lang.String namespaceId, java.lang.String serviceName)List all instances whatever status they are.com.alibaba.nacos.api.naming.pojo.ServiceInfolistInstance(java.lang.String namespaceId, java.lang.String serviceName, Subscriber subscriber, java.lang.String cluster, boolean healthOnly)Get all instance of input service.private voidmergeMetadata(InstanceMetadata newMetadata, InstancePatchObject patchObject)voidpatchInstance(java.lang.String namespaceId, java.lang.String serviceName, InstancePatchObject patchObject)Patch update instance information.voidregisterInstance(java.lang.String namespaceId, java.lang.String serviceName, com.alibaba.nacos.api.naming.pojo.Instance instance)This method createsIpPortBasedClientif it don't exist.voidremoveInstance(java.lang.String namespaceId, java.lang.String serviceName, com.alibaba.nacos.api.naming.pojo.Instance instance)Remove instance from service.voidupdateInstance(java.lang.String namespaceId, java.lang.String serviceName, com.alibaba.nacos.api.naming.pojo.Instance instance)Update instance information.
-
-
-
字段详细资料
-
clientManager
private final ClientManager clientManager
-
clientOperationService
private final ClientOperationService clientOperationService
-
serviceStorage
private final ServiceStorage serviceStorage
-
metadataOperateService
private final NamingMetadataOperateService metadataOperateService
-
metadataManager
private final NamingMetadataManager metadataManager
-
switchDomain
private final SwitchDomain switchDomain
-
pushService
private final UdpPushService pushService
-
-
构造器详细资料
-
InstanceOperatorClientImpl
public InstanceOperatorClientImpl(ClientManagerDelegate clientManager, ClientOperationServiceProxy clientOperationService, ServiceStorage serviceStorage, NamingMetadataOperateService metadataOperateService, NamingMetadataManager metadataManager, SwitchDomain switchDomain, UdpPushService pushService)
-
-
方法详细资料
-
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.NacosExceptionThis method createsIpPortBasedClientif it don't exist.- 指定者:
registerInstance在接口中InstanceOperator- 参数:
namespaceId- id of namespaceserviceName- grouped service name group@@serviceinstance- 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)从接口复制的说明:InstanceOperatorRemove instance from service.- 指定者:
removeInstance在接口中InstanceOperator- 参数:
namespaceId- namespaceserviceName- grouped service name group@@serviceinstance- 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从接口复制的说明:InstanceOperatorUpdate 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- namespaceserviceName- grouped service name group@@serviceinstance- 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从接口复制的说明:InstanceOperatorPatch 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- namespaceserviceName- grouped service name group@@servicepatchObject- objects need to be patch- 抛出:
com.alibaba.nacos.api.exception.NacosException- nacos exception when update failed
-
cloneMetadata
private InstanceMetadata cloneMetadata(InstanceMetadata instanceMetadata)
-
mergeMetadata
private void mergeMetadata(InstanceMetadata newMetadata, InstancePatchObject patchObject)
-
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)从接口复制的说明:InstanceOperatorGet all instance of input service.- 指定者:
listInstance在接口中InstanceOperator- 参数:
namespaceId- namespaceserviceName- grouped service name group@@servicesubscriber- subscriber infocluster- cluster of instanceshealthOnly- 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从接口复制的说明:InstanceOperatorGet instance detail information.- 指定者:
getInstance在接口中InstanceOperator- 参数:
namespaceId- namespaceserviceName- grouped service name group@@servicecluster- cluster of instanceip- ip of instanceport- 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从接口复制的说明:InstanceOperatorHandle beat request.- 指定者:
handleBeat在接口中InstanceOperator- 参数:
namespaceId- namespaceserviceName- grouped service name group@@serviceip- ip of instanceport- port of instancecluster- cluster of instanceclientBeat- client beat infobuilder- 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)从接口复制的说明:InstanceOperatorGet heart beat interval for specified instance.- 指定者:
getHeartBeatInterval在接口中InstanceOperator- 参数:
namespaceId- namespaceserviceName- grouped service name group@@serviceip- ip of instanceport- port of instancecluster- 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从接口复制的说明:InstanceOperatorList all instances whatever status they are.- 指定者:
listAllInstances在接口中InstanceOperator- 参数:
namespaceId- namespaceserviceName- 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从接口复制的说明:InstanceOperatorBatch update metadata of instances.- 指定者:
batchUpdateMetadata在接口中InstanceOperator- 参数:
namespaceId- namespace Id of instancesinstanceOperationInfo- instance operation infometadata- 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从接口复制的说明:InstanceOperatorBatch delete metadata of instances.- 指定者:
batchDeleteMetadata在接口中InstanceOperator- 参数:
namespaceId- namespace Id of instancesinstanceOperationInfo- instance operation infometadata- 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)
-
-