本文整理了Java中com.hazelcast.core.IMap.loadAll()
方法的一些代码示例,展示了IMap.loadAll()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IMap.loadAll()
方法的具体详情如下:
包路径:com.hazelcast.core.IMap
类名称:IMap
方法名:loadAll
[英]Loads the given keys. This is a batch load operation so that an implementation can optimize multiple loads.
Interactions with the map store
Calls MapLoader#loadAll(java.util.Collection) on the partitions storing the values with the keys. Exceptions thrown by loadAll() are not propagated to the caller.
[中]加载给定的键。这是一个批量加载操作,因此实现可以优化多个加载。
与地图商店的交互
在存储带有键的值的分区上调用MapLoader#loadAll(java.util.Collection)。loadAll()引发的异常不会传播到调用方。
代码示例来源:origin: com.hazelcast/hazelcast-all
@Override
public void loadAll(boolean replaceExistingValues) {
map.loadAll(replaceExistingValues);
}
代码示例来源:origin: hazelcast/hazelcast-jet
@Override
public void loadAll(boolean replaceExistingValues) {
map.loadAll(replaceExistingValues);
}
代码示例来源:origin: hazelcast/hazelcast-jet
@Override
public void loadAll(boolean replaceExistingValues) {
map.loadAll(replaceExistingValues);
}
代码示例来源:origin: hazelcast/hazelcast-jet
@Override
public void loadAll(Set<K> keys, boolean replaceExistingValues) {
map.loadAll(keys, replaceExistingValues);
}
代码示例来源:origin: hazelcast/hazelcast-jet
@Override
public void loadAll(Set<K> keys, boolean replaceExistingValues) {
map.loadAll(keys, replaceExistingValues);
}
代码示例来源:origin: com.hazelcast/hazelcast-all
@Override
public void loadAll(Set<K> keys, boolean replaceExistingValues) {
map.loadAll(keys, replaceExistingValues);
}
代码示例来源:origin: dsukhoroslov/bagri
@ManagedOperation(description="Reloads registered Module from disk")
public void refreshModule() {
Set<String> keys = new HashSet<>(1);
keys.add(entityName);
entityCache.loadAll(keys, true);
}
代码示例来源:origin: hazelcast/hazelcast-code-samples
public static void main(String[] args) {
int numberOfEntriesToAdd = 1000;
String mapName = LoadAll.class.getCanonicalName();
Config config = createNewConfig(mapName);
HazelcastInstance node = Hazelcast.newHazelcastInstance(config);
IMap<Integer, Integer> map = node.getMap(mapName);
populateMap(map, numberOfEntriesToAdd);
System.out.printf("# Map store has %d elements\n", numberOfEntriesToAdd);
map.evictAll();
System.out.printf("# After evictAll map size: %d\n", map.size());
map.loadAll(true);
System.out.printf("# After loadAll map size: %d\n", map.size());
}
代码示例来源:origin: hazelcast/hazelcast-code-samples
public void run() {
IMap<String, Supplement> supplements = instance.getMap("supplements");
System.out.println(supplements.size());
supplements.set("1", new Supplement("bcaa", 10));
supplements.set("2", new Supplement("protein", 100));
supplements.set("3", new Supplement("glucosamine", 200));
System.out.println(supplements.size());
supplements.evictAll();
System.out.println(supplements.size());
supplements.loadAll(true);
System.out.println(supplements.size());
}
}
代码示例来源:origin: com.hazelcast.simulator/tests-common
@Override
public void timeStep(MapOperation mapOperation) {
Integer key = randomInt(keyCount);
switch (mapOperation) {
case LOAD_ALL:
map.loadAll(true);
break;
case PUT:
putOperation(key);
break;
case GET:
map.get(key);
operationCounter.getCount.incrementAndGet();
break;
case GET_ASYNC:
map.getAsync(key);
operationCounter.getAsyncCount.incrementAndGet();
break;
case DELETE:
map.delete(key);
operationCounter.deleteCount.incrementAndGet();
break;
case DESTROY:
map.destroy();
operationCounter.destroyCount.incrementAndGet();
break;
default:
throw new UnsupportedOperationException();
}
}
代码示例来源:origin: com.hazelcast.simulator/tests-hz36
@Override
public void timeStep(MapOperation mapOperation) {
Integer key = randomInt(keyCount);
switch (mapOperation) {
case LOAD_ALL:
map.loadAll(true);
break;
case PUT:
putOperation(key);
break;
case GET:
map.get(key);
operationCounter.getCount.incrementAndGet();
break;
case GET_ASYNC:
map.getAsync(key);
operationCounter.getAsyncCount.incrementAndGet();
break;
case DELETE:
map.delete(key);
operationCounter.deleteCount.incrementAndGet();
break;
case DESTROY:
map.destroy();
operationCounter.destroyCount.incrementAndGet();
break;
default:
throw new UnsupportedOperationException();
}
}
代码示例来源:origin: dsukhoroslov/bagri
public boolean populateSchema(boolean overrideExisting) {
clearLoadStats();
allowPopulation = true;
startTime.set(nodeEngine.getClusterService().getClusterTime());
int partId = nodeEngine.getPartitionService().getPartitionId(CN_XDM_DOCUMENT);
if (nodeEngine.getPartitionService().isPartitionOwner(partId)) {
// don't load transactions if schema non-transactional?
xtxCache.loadAll(false);
logger.info("populateSchema; transactions size after loadAll: {}", xtxCache.size());
xddCache.loadAll(overrideExisting);
logger.info("populateSchema; documents size after loadAll: {}", xddCache.size());
stopTime.set(nodeEngine.getClusterService().getClusterTime());
return true;
}
return false;
}
内容来源于网络,如有侵权,请联系作者删除!