/** {@inheritDoc} */ @Override public <K1, V1> IgniteInternalCache<K1, V1> cache() { return delegate.cache(); }
/** {@inheritDoc} */ @Override public IgniteInternalCache cache() { return delegate.get().cache(); }
@Override public GridRestResponse applyx(IgniteInternalFuture<?> f) throws IgniteCheckedException { GridCacheRestResponse resp = new GridCacheRestResponse(); resp.setResponse(f.get()); if (key != null) resp.setAffinityNodeId(c.cache().affinity().mapKeyToNode(key).id().toString()); return resp; } };
/** {@inheritDoc} */ @Override public IgniteInternalFuture<?> applyx(IgniteInternalCache<Object, Object> c, GridKernalContext ctx) { CacheMetrics metrics = c.cache().localMetrics(); assert metrics != null; return new GridFinishedFuture<Object>(new GridCacheRestMetrics( (int)metrics.getCacheGets(), (int)(metrics.getCacheRemovals() + metrics.getCachePuts()), (int)metrics.getCacheHits(), (int)metrics.getCacheMisses()) ); } }
ClusterNode primaryNode = dataCachePrj.cache().affinity().mapKeyToNode(key);
/** * Get data cache for the given node ID. * * @param nodeId Node ID. * @return Data cache. */ private GridCacheAdapter<IgfsBlockKey, byte[]> cache(UUID nodeId) { IgniteEx g = (IgniteEx)G.ignite(nodeId); return (GridCacheAdapter<IgfsBlockKey, byte[]>)g.cachex(g.igfsx(IGFS_NAME).configuration() .getDataCacheConfiguration().getName()).<IgfsBlockKey, byte[]>cache(); }
/** {@inheritDoc} */ @SuppressWarnings("RedundantCast") @Override protected void onKernalStart0() throws IgniteCheckedException { metaCache = igfsCtx.kernalContext().cache().getOrStartCache(metaCacheName); assert metaCache != null; igfsCtx.kernalContext().cache().internalCache(metaCacheName).preloader().startFuture() .listen(new CI1<IgniteInternalFuture<Object>>() { @Override public void apply(IgniteInternalFuture<Object> f) { metaCacheStartLatch.countDown(); } }); id2InfoPrj = (IgniteInternalCache<IgniteUuid, IgfsEntryInfo>)metaCache.<IgniteUuid, IgfsEntryInfo>cache(); locNode = igfsCtx.kernalContext().discovery().localNode(); // Start background delete worker. if (!client) { delWorker = new IgfsDeleteWorker(igfsCtx); delWorker.start(); } }
if (cache.cache().affinity().isPrimary(ctx.discovery().localNode(), key)) { try { cache.getAndRemove(key);
.getName()).cache();
/** * Checks that after exchange all nodes have consistent state about partition owners. * * @throws Exception If failed. */ private void checkTopologiesConsistency() throws Exception { List<Ignite> nodes = G.allGrids(); IgniteEx crdNode = null; for (Ignite node : nodes) { ClusterNode locNode = node.cluster().localNode(); if (crdNode == null || locNode.order() < crdNode.localNode().order()) crdNode = (IgniteEx) node; } for (Ignite node : nodes) { IgniteEx node0 = (IgniteEx) node; if (node0.localNode().id().equals(crdNode.localNode().id())) continue; for (IgniteInternalCache cache : node0.context().cache().caches()) { int partitions = cache.context().affinity().partitions(); for (int p = 0; p < partitions; p++) { List<ClusterNode> crdOwners = crdNode.cachex(cache.name()).cache().context().topology().owners(p); List<ClusterNode> owners = cache.context().topology().owners(p); assertEquals(crdOwners, owners); } } } }
/** {@inheritDoc} */ @Override public <K1, V1> IgniteInternalCache<K1, V1> cache() { return delegate.cache(); }
@Override public GridRestResponse applyx(IgniteInternalFuture<?> f) throws IgniteCheckedException { GridCacheRestResponse resp = new GridCacheRestResponse(); resp.setResponse(f.get()); if (key != null) resp.setAffinityNodeId(c.cache().affinity().mapKeyToNode(key).id().toString()); return resp; } };
ClusterNode primaryNode = dataCachePrj.cache().affinity().mapKeyToNode(key);
/** {@inheritDoc} */ @Override public IgniteInternalFuture<?> applyx(IgniteInternalCache<Object, Object> c, GridKernalContext ctx) { CacheMetrics metrics = c.cache().localMetrics(); assert metrics != null; return new GridFinishedFuture<Object>(new GridCacheRestMetrics( (int)metrics.getCacheGets(), (int)(metrics.getCacheRemovals() + metrics.getCachePuts()), (int)metrics.getCacheHits(), (int)metrics.getCacheMisses()) ); } }
/** {@inheritDoc} */ @SuppressWarnings("RedundantCast") @Override protected void onKernalStart0() throws IgniteCheckedException { metaCache = igfsCtx.kernalContext().cache().getOrStartCache(metaCacheName); assert metaCache != null; igfsCtx.kernalContext().cache().internalCache(metaCacheName).preloader().startFuture() .listen(new CI1<IgniteInternalFuture<Object>>() { @Override public void apply(IgniteInternalFuture<Object> f) { metaCacheStartLatch.countDown(); } }); id2InfoPrj = (IgniteInternalCache<IgniteUuid, IgfsEntryInfo>)metaCache.<IgniteUuid, IgfsEntryInfo>cache(); locNode = igfsCtx.kernalContext().discovery().localNode(); // Start background delete worker. if (!client) { delWorker = new IgfsDeleteWorker(igfsCtx); delWorker.start(); } }
if (cache.cache().affinity().isPrimary(ctx.discovery().localNode(), key)) { try { cache.getAndRemove(key);