/** {@inheritDoc} */ @Override public boolean contains(Object o) { A.notNull(o, "o"); for (GridCacheEntry<K, V> e : map.values()) if (F.isAll(e, filter) && F.eq(e.getValue(), o)) return true; return false; } }
/** {@inheritDoc} */ @Override public boolean remove(Object o) { A.notNull(o, "o"); boolean rmv = false; for (Iterator<GridCacheEntry<K, V>> it = map.values().iterator(); it.hasNext();) { GridCacheEntry<K, V> e = it.next(); if (F.isAll(e, filter) && F.eq(o, e.getValue())) { it.remove(); try { e.removex(); } catch (GridException ex) { throw new GridRuntimeException(ex); } rmv = true; } } return rmv; }
/** * @return Future. */ @SuppressWarnings("unchecked") public GridFuture<?> cancelAll() { Collection<GridFuture<?>> futs = new ArrayList<>(); for (GridCacheEntry<Object, Object> e : cache.entrySetx()) { if (!(e.getKey() instanceof GridServiceDeploymentKey)) continue; GridServiceDeployment dep = (GridServiceDeployment)e.getValue(); // Cancel each service separately. futs.add(cancel(dep.configuration().getName())); } return futs.isEmpty() ? new GridFinishedFuture<>(ctx) : new GridCompoundFuture(ctx, null, futs); }
/** * @return Collection of service descriptors. */ public Collection<GridServiceDescriptor> deployedServices() { Collection<GridServiceDescriptor> descs = new ArrayList<>(); for (GridCacheEntry<Object, Object> e : cache.entrySetx()) { if (!(e.getKey() instanceof GridServiceDeploymentKey)) continue; GridServiceDeployment dep = (GridServiceDeployment)e.getValue(); GridServiceDescriptorImpl desc = new GridServiceDescriptorImpl(dep); try { GridServiceAssignments assigns = (GridServiceAssignments)cache.//flagsOn(GridCacheFlag.GET_PRIMARY). get(new GridServiceAssignmentsKey(dep.configuration().getName())); if (assigns != null) { desc.topologySnapshot(assigns.assigns()); descs.add(desc); } } catch (GridException ex) { log.error("Failed to get assignments from replicated cache for service: " + dep.configuration().getName(), ex); } } return descs; }
info.onIterate(new GridCacheContinuousQueryEntry<>(cctx, e, e.getKey(), e.getValue(), null, null, null), !internal && cctx.gridEvents().isRecordable(EVT_CACHE_QUERY_OBJECT_READ));
for (GridCacheEntry<Object, Object> e : cache.entrySetx()) { if (e.getKey() instanceof GridServiceAssignmentsKey) { GridServiceAssignments assigns = (GridServiceAssignments)e.getValue();