Search in sources :

Example 6 with ResourceFilter

use of com.tencent.polaris.api.plugin.registry.ResourceFilter in project polaris-java by polarismesh.

the class InstancesCircuitBreakTask method getInstance.

private Instance getInstance() {
    ServiceEventKey serviceEventKey = new ServiceEventKey(serviceKey, EventType.INSTANCE);
    ResourceFilter resourceFilter = new ResourceFilter(serviceEventKey, true, true);
    ServiceInstancesByProto instances = (ServiceInstancesByProto) extensions.getLocalRegistry().getInstances(resourceFilter);
    if (!instances.isInitialized()) {
        return null;
    }
    return instances.getInstance(instId);
}
Also used : ResourceFilter(com.tencent.polaris.api.plugin.registry.ResourceFilter) ServiceEventKey(com.tencent.polaris.api.pojo.ServiceEventKey) ServiceInstancesByProto(com.tencent.polaris.client.pojo.ServiceInstancesByProto)

Aggregations

ResourceFilter (com.tencent.polaris.api.plugin.registry.ResourceFilter)6 ServiceInstances (com.tencent.polaris.api.pojo.ServiceInstances)5 ServiceEventKey (com.tencent.polaris.api.pojo.ServiceEventKey)3 ServiceRule (com.tencent.polaris.api.pojo.ServiceRule)3 Services (com.tencent.polaris.api.pojo.Services)3 Instance (com.tencent.polaris.api.pojo.Instance)2 ServiceInstancesByProto (com.tencent.polaris.client.pojo.ServiceInstancesByProto)2 LocalRegistry (com.tencent.polaris.api.plugin.registry.LocalRegistry)1 ServiceUpdateRequest (com.tencent.polaris.api.plugin.registry.ServiceUpdateRequest)1 DetectResult (com.tencent.polaris.api.pojo.DetectResult)1 ServiceKey (com.tencent.polaris.api.pojo.ServiceKey)1 InstanceByProto (com.tencent.polaris.client.pojo.InstanceByProto)1 Node (com.tencent.polaris.client.pojo.Node)1 HashMap (java.util.HashMap)1