本文整理汇总了Java中com.alibaba.dubbo.governance.sync.util.SyncUtils类的典型用法代码示例。如果您正苦于以下问题:Java SyncUtils类的具体用法?Java SyncUtils怎么用?Java SyncUtils使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SyncUtils类属于com.alibaba.dubbo.governance.sync.util包,在下文中一共展示了SyncUtils类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findProviderUrl
import com.alibaba.dubbo.governance.sync.util.SyncUtils; //导入依赖的package包/类
private Pair<Long, URL> findProviderUrl(String service, String address) {
Map<String, String> filter = new HashMap<String, String>();
filter.put(Constants.CATEGORY_KEY, Constants.PROVIDERS_CATEGORY);
filter.put(SyncUtils.ADDRESS_FILTER_KEY, address);
Map<Long, URL> ret = SyncUtils.filterFromCategory(getRegistryCache(), filter);
if (ret.isEmpty()) {
return null;
} else {
Long key = ret.entrySet().iterator().next().getKey();
return new Pair<Long, URL>(key, ret.get(key));
}
}
示例2: findRouteUrl
import com.alibaba.dubbo.governance.sync.util.SyncUtils; //导入依赖的package包/类
private Map<Long, URL> findRouteUrl(String service, String address, boolean force) {
Map<String, String> filter = new HashMap<String, String>();
filter.put(Constants.CATEGORY_KEY, Constants.ROUTERS_CATEGORY);
if (service != null && service.length() > 0) {
filter.put(SyncUtils.SERVICE_FILTER_KEY, service);
}
if (address != null && address.length() > 0) {
filter.put(SyncUtils.ADDRESS_FILTER_KEY, address);
}
if (force) {
filter.put("force", "true");
}
return SyncUtils.filterFromCategory(getRegistryCache(), filter);
}
示例3: findProviderUrlByService
import com.alibaba.dubbo.governance.sync.util.SyncUtils; //导入依赖的package包/类
private Map<Long, URL> findProviderUrlByService(String service) {
Map<String, String> filter = new HashMap<String, String>();
filter.put(Constants.CATEGORY_KEY, Constants.PROVIDERS_CATEGORY);
filter.put(SyncUtils.SERVICE_FILTER_KEY, service);
return SyncUtils.filterFromCategory(getRegistryCache(), filter);
}
示例4: findRouteUrl
import com.alibaba.dubbo.governance.sync.util.SyncUtils; //导入依赖的package包/类
private Map<Long, URL> findRouteUrl(String service, String address, boolean force) {
Map<String, String> filter = new HashMap<String, String>();
filter.put(Constants.CATEGORY_KEY, Constants.ROUTERS_CATEGORY);
if (service != null && service.length() > 0) {
filter.put(SyncUtils.SERVICE_FILTER_KEY, service);
}
if (address != null && address.length() > 0) {
filter.put(SyncUtils.ADDRESS_FILTER_KEY, address);
}
if (force) {
filter.put("force", "true");
}
return SyncUtils.filterFromCategory(getRegistryCache(), filter);
}
示例5: findProviderUrl
import com.alibaba.dubbo.governance.sync.util.SyncUtils; //导入依赖的package包/类
private Pair<Long, URL> findProviderUrl(String service, String address) {
Map<String, String> filter = new HashMap<String, String>();
filter.put(Constants.CATEGORY_KEY, Constants.PROVIDERS_CATEGORY);
filter.put(SyncUtils.ADDRESS_FILTER_KEY, address);
Map<Long, URL> ret = SyncUtils.filterFromCategory(getRegistryCache(), filter);
if(ret.isEmpty()) {
return null;
}
else {
Long key = ret.entrySet().iterator().next().getKey();
return new Pair<Long, URL>(key, ret.get(key));
}
}
示例6: findConsumerUrlByApplication
import com.alibaba.dubbo.governance.sync.util.SyncUtils; //导入依赖的package包/类
private Map<Long, URL> findConsumerUrlByApplication(String application) {
Map<String, String> filter = new HashMap<String, String>();
filter.put(Constants.CATEGORY_KEY, Constants.CONSUMERS_CATEGORY);
filter.put(Constants.APPLICATION_KEY, application);
return SyncUtils.filterFromCategory(getRegistryCache(), filter);
}
示例7: findOverrideUrl
import com.alibaba.dubbo.governance.sync.util.SyncUtils; //导入依赖的package包/类
private Map<Long, URL> findOverrideUrl(String service, String address, String application) {
Map<String, String> filter = new HashMap<String, String>();
filter.put(Constants.CATEGORY_KEY, Constants.CONFIGURATORS_CATEGORY);
if (service != null && service.length() > 0) {
filter.put(SyncUtils.SERVICE_FILTER_KEY, service);
}
if (address != null && address.length() > 0) {
filter.put(SyncUtils.ADDRESS_FILTER_KEY, address);
}
if (application != null && application.length() > 0) {
filter.put(Constants.APPLICATION_KEY, application);
}
return SyncUtils.filterFromCategory(getRegistryCache(), filter);
}
示例8: findConsumerUrlByAddress
import com.alibaba.dubbo.governance.sync.util.SyncUtils; //导入依赖的package包/类
private Map<Long, URL> findConsumerUrlByAddress(String address) {
Map<String, String> filter = new HashMap<String, String>();
filter.put(Constants.CATEGORY_KEY, Constants.CONSUMERS_CATEGORY);
filter.put(SyncUtils.ADDRESS_FILTER_KEY, address);
return SyncUtils.filterFromCategory(getRegistryCache(), filter);
}
示例9: findProviderUrlByAddress
import com.alibaba.dubbo.governance.sync.util.SyncUtils; //导入依赖的package包/类
public Map<Long, URL> findProviderUrlByAddress(String address) {
Map<String, String> filter = new HashMap<String, String>();
filter.put(Constants.CATEGORY_KEY, Constants.PROVIDERS_CATEGORY);
filter.put(SyncUtils.ADDRESS_FILTER_KEY, address);
return SyncUtils.filterFromCategory(getRegistryCache(), filter);
}
示例10: findProviderUrlByAddress
import com.alibaba.dubbo.governance.sync.util.SyncUtils; //导入依赖的package包/类
public Map<Long, URL> findProviderUrlByAddress(String address) {
Map<String, String> filter = new HashMap<String, String>();
filter.put(Constants.CATEGORY_KEY, Constants.PROVIDERS_CATEGORY);
filter.put(SyncUtils.ADDRESS_FILTER_KEY, address);
return SyncUtils.filterFromCategory(getRegistryCache(), filter);
}
示例11: findConsumerUrlByService
import com.alibaba.dubbo.governance.sync.util.SyncUtils; //导入依赖的package包/类
public Map<Long, URL> findConsumerUrlByService(String service) {
Map<String, String> filter = new HashMap<String, String>();
filter.put(Constants.CATEGORY_KEY, Constants.CONSUMERS_CATEGORY);
filter.put(SyncUtils.SERVICE_FILTER_KEY, service);
return SyncUtils.filterFromCategory(getRegistryCache(), filter);
}
示例12: findByService
import com.alibaba.dubbo.governance.sync.util.SyncUtils; //导入依赖的package包/类
public List<Consumer> findByService(String service) {
return SyncUtils.url2ConsumerList(findConsumerUrlByService(service));
}
示例13: findConsumer
import com.alibaba.dubbo.governance.sync.util.SyncUtils; //导入依赖的package包/类
public Consumer findConsumer(Long id) {
return SyncUtils.url2Consumer(findConsumerUrl(id));
}
示例14: findAll
import com.alibaba.dubbo.governance.sync.util.SyncUtils; //导入依赖的package包/类
public List<Consumer> findAll() {
return SyncUtils.url2ConsumerList(findAllConsumerUrl());
}
示例15: findAllConsumerUrl
import com.alibaba.dubbo.governance.sync.util.SyncUtils; //导入依赖的package包/类
private Map<Long, URL> findAllConsumerUrl() {
Map<String, String> filter = new HashMap<String, String>();
filter.put(Constants.CATEGORY_KEY, Constants.CONSUMERS_CATEGORY);
return SyncUtils.filterFromCategory(getRegistryCache(), filter);
}