本文整理匯總了Java中com.hazelcast.core.IMap.entrySet方法的典型用法代碼示例。如果您正苦於以下問題:Java IMap.entrySet方法的具體用法?Java IMap.entrySet怎麽用?Java IMap.entrySet使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.hazelcast.core.IMap
的用法示例。
在下文中一共展示了IMap.entrySet方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: timeEvent
import com.hazelcast.core.IMap; //導入方法依賴的package包/類
@Override
public void timeEvent(long time, int iteration) {
IMap<Long, Integer> map = hazelcastInstance.getMap("watchMap");
//StringBuilder b = new StringBuilder();
boolean alert = true;
for(Map.Entry<Long, Integer> entry: map.entrySet()) {
alert = alert & (Math.abs(entry.getValue())>1); //if every value is not zero then we alert.
logger.info("id {} value {} ", entry.getKey(), entry.getValue());
}
if (alert) {
commandChannel.setValueAndBlock(port, 1, 200);
while (!commandChannel.setValue(port, 0)) {
Thread.yield();
};
}
}
示例2: findHazelcastSessionId
import com.hazelcast.core.IMap; //導入方法依賴的package包/類
protected String findHazelcastSessionId(IMap<String, Object> map) {
for (Entry<String, Object> entry : map.entrySet()) {
if (!entry.getKey().contains(HAZELCAST_SESSION_ATTRIBUTE_SEPARATOR)) {
return entry.getKey();
}
}
return null;
}
示例3: instanceEntrySet
import com.hazelcast.core.IMap; //導入方法依賴的package包/類
/**
* Gets a copy of the entries for this instance Map. NOTE: Do not let this Map
* grow arbitrarily. This a sort of static cache with no eviction.
* @return
*/
public <K, V> Set<Entry<K, V>> instanceEntrySet() {
IMap<K, V> cached = hzInstance.getMap(instanceMapName());
Set<Entry<K, V>> entrySet = cached.entrySet();
return entrySet;
}