本文整理汇总了Java中org.infinispan.Cache.keySet方法的典型用法代码示例。如果您正苦于以下问题:Java Cache.keySet方法的具体用法?Java Cache.keySet怎么用?Java Cache.keySet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.infinispan.Cache
的用法示例。
在下文中一共展示了Cache.keySet方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getKeysAddresses
import org.infinispan.Cache; //导入方法依赖的package包/类
public <K> Map<K, List<Address>> getKeysAddresses(Cache<K, Object> cache) {
DistributionManager distributionManager = cache.getAdvancedCache().getDistributionManager();
Map<K, List<Address>> response = new HashMap<>();
for(K k : cache.keySet()) {
response.put(k, distributionManager.locate(k));
}
return response;
}
示例2: valuesFromKeys
import org.infinispan.Cache; //导入方法依赖的package包/类
private Set<String> valuesFromKeys(Cache<Key, Object> cache,
Predicate<Key> predicate) {
Set<String> response = new HashSet<>();
for(Key k : cache.keySet()) {
if(predicate.test(k)) {
response.add(k + " " + cache.get(k));
}
}
return response;
}
示例3: valuesFromKeys
import org.infinispan.Cache; //导入方法依赖的package包/类
private static Set<String> valuesFromKeys(Cache<Long, Value> cache, Filter filter) {
Set<String> values = new HashSet<String>();
for (Long l : cache.keySet()) {
switch (filter) {
case ALL:
values.add(l + " " + cache.get(l));
break;
case LOCAL:
if (checkIfKeyIsLocalInCache(cache, l)) {
values.add(l + " " + cache.get(l));
}
break;
case PRIMARY:
if (checkIfCacheIsPrimaryFor(cache, l)) {
values.add(l + " " + cache.get(l));
}
break;
case REPLICA:
if (checkIfCacheIsSecondaryFor(cache, l)) {
values.add(l + " " + cache.get(l));
}
break;
}
}
return values;
}
示例4: viewChanged
import org.infinispan.Cache; //导入方法依赖的package包/类
@ViewChanged
public void viewChanged(ViewChangedEvent event) {
final Cache<String, ExecutionControl> cache = GlobalCache.get().getExecutionControls();
Set<String> allExecCtrls = new HashSet<>(cache.keySet());
for (String name : allExecCtrls) {
ExecutionControl ctrl = cache.get(name);
if (ctrl != null)
ctrl.onTimeout(-1);
}
}