@Override protected void mapOperation() { map.keySet(); } }
private void showConnected(IMap<String, ChatMessage> map) { for (String user : map.keySet()) { System.out.println(user + " is online"); } }
private static Set<String> getDBNames( HazelcastInstance hazelcastInstance ) { IMap<String, UUID> uuidPerDbCluster = hazelcastInstance.getMap( CLUSTER_UUID_DB_NAME_MAP ); return uuidPerDbCluster.keySet(); }
@Nonnull @Override public Collection<K> getKeys() { return map.keySet(); }
@Nonnull @Override public Set<K> keySet() { return map.keySet(); }
@Override public Set<String> getKeys() { return Collections.unmodifiableSet(cache.keySet()); }
public void run() { IMap map = hazelcast.getMap("myMap"); Iterator it = map.keySet(new SqlPredicate("name=" + random.nextInt(10000))).iterator(); while (it.hasNext()) { it.next(); } } }, 10);
private String[] getSparkMastersFromCluster() { HazelcastInstance hz = AnalyticsServiceHolder.getHazelcastInstance(); IMap<String, Object> masterMap = hz.getMap(AnalyticsConstants.SPARK_MASTER_MAP); Set<String> masterUrls = masterMap.keySet(); return masterUrls.toArray(new String[masterUrls.size()]); }
/** * <p>List the stored flights, keys are {@link java.lang.Comparable} so sort before printing. * </p> */ @CliCommand(value = "KEYS", help = "DISPLAY THE STORED FLIGHTS") public String keys() { IMap<MyKey, AbstractFlight> flightsMap = this.hazelcastInstance.getMap(Constants.IMAP_FLIGHTS); Set<MyKey> keys = flightsMap.keySet().stream().collect(Collectors.toCollection(TreeSet::new)); keys.forEach(key -> System.out.println(" -> " + key)); return String.format("[%d record%s]%n", keys.size(), (keys.size() == 1 ? "" : "s")); }
/** * Gets all keys in this storage. * * @return All keys in this storage. */ @Override public Set<? extends Comparable<?>> keySet() { return getDistributedObject().keySet(); }
@GetMapping public Collection<String> index() { LOGGER.info("index()"); IMap<String, String> helloMap = this.hazelcastInstance.getMap("hello"); Set<String> keys = new TreeSet<>(helloMap.keySet()); Collection<String> result = new ArrayList<>(); for (String key : keys) { result.add(helloMap.get(key)); } return result; } }
protected void handleMapKeys() { Set set = getMap().keySet(); Iterator it = set.iterator(); int count = 0; while (it.hasNext()) { count++; println(it.next()); } println("Total " + count); }
protected void handleMapKeys() { Set set = getMap().keySet(); Iterator it = set.iterator(); int count = 0; while (it.hasNext()) { count++; println(it.next()); } println("Total " + count); }
protected void handleMapKeys() { Set set = getMap().keySet(); Iterator it = set.iterator(); int count = 0; while (it.hasNext()) { count++; println(it.next()); } println("Total " + count); }
@Override public long getSizeInMemory() { long size = 0; for (final Object key : map.keySet()) { final EntryView entry = map.getEntryView(key); if (entry != null) { size += entry.getCost(); } } return size; }
@Override public long getSizeInMemory() { long size = 0; for (final Object key : map.keySet()) { final EntryView entry = map.getEntryView(key); if (entry != null) { size += entry.getCost(); } } return size; }
@Override public List<ApplicationInfo> getAllApplications() { List<ApplicationInfo> appsList = new ArrayList<ApplicationInfo>(); IMap<String, PersistentClientCredentials> clientsContainer = getClientCredentialsContainer(); for (String key : clientsContainer.keySet()) { ApplicationInfo appInfo = PersistenceTransformations.toApplicationInfo(clientsContainer.get(key)); appsList.add(appInfo); } return appsList; }
@SuppressWarnings("unchecked") private Set<DocumentKey> getDocumentsOfType(String root) { Predicate<DocumentKey, Document> f = Predicates.and(Predicates.equal(fnRoot, root), Predicates.equal(fnTxFinish, TX_NO)); return docCache.keySet(f); }