use of com.pamirs.attach.plugin.rabbitmq.consumer.admin.support.ConsumerApiResult in project LinkAgent by shulieTech.
the class ZkWithoutIpCacheSupport method computeIfAbsent.
@Override
public ConsumerApiResult computeIfAbsent(CacheKey cacheKey, Supplier supplier) {
if (CACHE == null) {
synchronized (ZkWithoutIpCacheSupport.class) {
if (CACHE == null) {
List<ConsumerApiResult> consumerApiResults = getFromZK();
if (consumerApiResults == null) {
renew(supplier);
return CACHE.get(cacheKey);
} else {
CACHE = group(consumerApiResults);
ConsumerApiResult consumerApiResult = CACHE.get(cacheKey);
if (consumerApiResult == null) {
renew(supplier);
return CACHE.get(cacheKey);
} else {
return consumerApiResult;
}
}
}
}
}
ConsumerApiResult consumerApiResult = CACHE.get(cacheKey);
if (consumerApiResult == null) {
synchronized (ZkWithoutIpCacheSupport.class) {
renew(supplier);
consumerApiResult = CACHE.get(cacheKey);
}
}
return consumerApiResult;
}
Aggregations