public class ServiceInstancesByProto extends Object implements ServiceInstances, RegistryCacheValue
| Modifier and Type | Field and Description |
|---|---|
static ServiceInstancesByProto |
EMPTY_INSTANCES |
| Constructor and Description |
|---|
ServiceInstancesByProto()
创建空的服务对象
|
ServiceInstancesByProto(com.tencent.polaris.specification.api.v1.service.manage.ResponseProto.DiscoverResponse response,
ServiceInstancesByProto oldSvcInstances,
boolean loadFromFile)
构造函数
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
ServiceEventKey.EventType |
getEventType()
缓存对象类型
|
InstanceByProto |
getInstance(Node node)
get instance by host and port
|
InstanceByProto |
getInstance(String instId)
获取实例本地数据
|
List<Instance> |
getInstances()
获取服务实例列表
|
Map<String,String> |
getMetadata()
获取服务元数据信息
|
String |
getNamespace()
获取名字空间
|
List<com.tencent.polaris.specification.api.v1.service.manage.ServiceProto.Instance> |
getOriginInstancesList() |
String |
getRevision()
获取唯一标识信息
|
String |
getService()
获取服务名
|
ServiceKey |
getServiceKey()
获取服务标识
|
int |
getTotalWeight()
获取服务实例总权重值
|
int |
hashCode() |
boolean |
isInitialized()
服务实例列表是否已经加载
|
boolean |
isLoadedFromFile()
判断是否从文件中加载
|
String |
toString() |
public static final ServiceInstancesByProto EMPTY_INSTANCES
public ServiceInstancesByProto(com.tencent.polaris.specification.api.v1.service.manage.ResponseProto.DiscoverResponse response,
ServiceInstancesByProto oldSvcInstances,
boolean loadFromFile)
response - 应答ProtooldSvcInstances - 旧的实例列表loadFromFile - 是否从缓存文件加载public ServiceInstancesByProto()
public ServiceKey getServiceKey()
ServiceInstancesgetServiceKey in interface ServiceInstancespublic int getTotalWeight()
ServiceInstancesgetTotalWeight in interface ServiceInstancespublic List<Instance> getInstances()
ServiceInstancesgetInstances in interface ServiceInstancespublic boolean isLoadedFromFile()
RegistryCacheValueisLoadedFromFile in interface RegistryCacheValuepublic ServiceEventKey.EventType getEventType()
RegistryCacheValuegetEventType in interface RegistryCacheValuepublic boolean isInitialized()
ServiceInstancesisInitialized in interface RegistryCacheValueisInitialized in interface ServiceInstancespublic String getRevision()
ServiceInstancesgetRevision in interface RegistryCacheValuegetRevision in interface ServiceInstancespublic String getService()
ServicegetService in interface Servicepublic String getNamespace()
ServicegetNamespace in interface Servicepublic Map<String,String> getMetadata()
ServiceMetadatagetMetadata in interface ServiceMetadatapublic InstanceByProto getInstance(String instId)
getInstance in interface ServiceInstancesinstId - 实例IDpublic InstanceByProto getInstance(Node node)
ServiceInstancesgetInstance in interface ServiceInstancesnode - host and portpublic List<com.tencent.polaris.specification.api.v1.service.manage.ServiceProto.Instance> getOriginInstancesList()
Copyright © 2024. All rights reserved.