public void run() { IMap map = hazelcast.getMap("myMap"); map.size(); } }, 4);
@Override public int stats() { return Stream.of(MAP_NAME, GPS) .mapToInt(it -> client.getMap(it).size()) .sum(); }
@RequestMapping("/size") public CommandResponse size() { IMap<String, String> map = hazelcastInstance.getMap("map"); int size = map.size(); return new CommandResponse(Integer.toString(size)); }
@RequestMapping("/size") public CommandResponse size() { IMap<String, String> map = hazelcastInstance.getMap("map"); int size = map.size(); return new CommandResponse(Integer.toString(size)); }
@RequestMapping("/size") public CommandResponse size() { IMap<String, String> map = hazelcastClient.getMap("map"); int size = map.size(); return new CommandResponse(Integer.toString(size)); }
@RequestMapping("/size") public CommandResponse size() { IMap<String, String> map = hazelcastInstance.getMap("map"); int size = map.size(); return new CommandResponse(Integer.toString(size)); }
@Override public void start(ILifecycleProgressMonitor monitor) throws SiteWhereException { if (assets.size() == 0) { refresh(monitor); } else { LOGGER.info("Skipping datastore refresh due to existing distributed map data."); } }
@Verify(global = false) public void verify() throws Exception { try{ Thread.sleep( maxTTLExpireySeconds * 2 ); final IMap map = targetInstance.getMap(basename); System.out.println(basename+ ": map size =" + map.size() ); }catch(UnsupportedOperationException e){} }
@RequestMapping("/size") public CommandResponse size(@RequestParam(value = "name") String name) { IMap<Integer, String> map = jetClient.getMap(name); int size = map.size(); return new CommandResponse(Integer.toString(size)); }
void removeQueryResults(int queryId, PathExpression pex, Elements elts) { int oSize = logger.isTraceEnabled() ? xrCache.size() : 0; logger.trace("removeQueryResults.enter; got queryId: {}; result cache size: {}", queryId, oSize); xrCache.removeAll(new ResultsQueryParamsPredicate(queryId, pex, elts)); int nSize = logger.isTraceEnabled() ? xrCache.size() : 0; logger.trace("removeQueryResults.exit; deleted {} results; new size is: {}", oSize - nSize, nSize); }
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()); }
/** * Dumps contents of the IMap named {@code mapName} to the output stream */ private static void dumpMap(JetInstance instance, String mapName) { IMap sinkMap = instance.getMap(mapName); System.out.println("Sink map size: " + sinkMap.size()); System.out.println("Sink map entries: "); sinkMap.forEach((k, v) -> System.out.println(k + " - " + v)); }
@BeforeRun public void beforeRun(ThreadState state) { int size = map.size(); if (size != keyCount) { throw new TestException( "Prepare has not run since the map is not filled correctly, found size: %s, expected size: %s", size, keyCount); } for (int i = 0; i < keyCount; i++) { state.result.put(i, 0L); } }
@ManagedAnnotation("size") @ManagedDescription("size of the map") public int getSize() { return managedObject.size(); }
@Verify public void verify() { if (isClient(targetInstance)) { return; } StringBuilder sb = new StringBuilder(name).append(": In local verify phase the map size is ").append(map.size()); addMemoryStatistics(sb); logger.info(sb.toString()); } }
private void assertMapMaxSize() { if (isMemberNode(targetInstance)) { int mapSize = map.size(); int clusterSize = targetInstance.getCluster().getMembers().size(); assertTrue(format("Size of map %s should be <= %d * %d, but was %d", name, clusterSize, maxSizePerNode, mapSize), mapSize <= clusterSize * maxSizePerNode); } }
private void assertMapMaxSize() { if (isMemberNode(targetInstance)) { int mapSize = map.size(); int clusterSize = targetInstance.getCluster().getMembers().size(); assertTrue(format("Size of map %s should be <= %d * %d, but was %d", name, clusterSize, maxSizePerNode, mapSize), mapSize <= clusterSize * maxSizePerNode); } } }
@Prepare public void prepare() { logger.info("======== PREPARE ========="); logger.info("Map size is: " + map.size()); }
@Verify(global = false) public void verify() { sleepSeconds(maxTTLExpirySeconds * 2); logger.info(name + ": map size =" + map.size()); } }
@Override public int getElementCount() throws SiteWhereException { if (getParent().getLifecycleStatus() == LifecycleStatus.Started) { return hMap.size(); } else { throw new SiteWhereException("Cache getElementCount() called after shutdown."); } }