/** {@inheritDoc} */ @Override public Collection<IgniteInternalCache<?, ?>> cachesx( IgnitePredicate<? super IgniteInternalCache<?, ?>>[] p) { guard(); try { checkClusterState(); return F.retain(ctx.cache().caches(), true, p); } finally { unguard(); } }
locCfgsForActivation = new HashMap<>(); for (IgniteInternalCache cache : ctx.cache().caches()) { locCfgsForActivation.put(cache.name(), new T2<>((CacheConfiguration)null, cache.configuration().getNearConfiguration()));
final GridKernalContext ctx = ((IgniteKernal)ignite).context(); Collection<String> cacheNames = F.viewReadOnly(ctx.cache().caches(), new C1<IgniteInternalCache<?, ?>, String>() { @Override public String apply(IgniteInternalCache<?, ?> c) {
final GridKernalContext ctx = ((IgniteKernal)ignite).context(); Collection<String> cacheNames = F.viewReadOnly(ctx.cache().caches(), new C1<IgniteInternalCache<?, ?>, String>() { @Override public String apply(IgniteInternalCache<?, ?> c) {
for (IgniteInternalCache cache : ctx.cache().caches()) { DynamicCacheDescriptor desc = caches.get(cache.name());
/** * @param nodes Number of nodes. */ final void checkNoCaches(int nodes) { for (int i = 0; i < nodes; i++) { grid(i).context().state().publicApiActiveState(true); GridCacheProcessor cache = ((IgniteEx)ignite(i)).context().cache(); assertTrue(cache.caches().isEmpty()); assertTrue(cache.internalCaches().stream().allMatch(c -> c.context().isRecoveryMode())); } } }
IgniteKernal node0 = (IgniteKernal) node; for (IgniteInternalCache cache : node0.context().cache().caches()) { List<List<ClusterNode>> aff = affMap.get(cache.name()); List<List<ClusterNode>> aff0 = cache.context().affinity().assignments(topVer);
/** * @throws Exception If failed. */ private void checkAffinity() throws Exception { List<Ignite> nodes = G.allGrids(); ClusterNode crdNode = null; for (Ignite node : nodes) { ClusterNode locNode = node.cluster().localNode(); if (crdNode == null || locNode.order() < crdNode.order()) crdNode = locNode; } AffinityTopologyVersion topVer = ((IgniteKernal)grid(crdNode)). context().cache().context().exchange().readyAffinityVersion(); Map<String, List<List<ClusterNode>>> affMap = new HashMap<>(); for (Ignite node : nodes) { IgniteKernal node0 = (IgniteKernal)node; for (IgniteInternalCache cache : node0.context().cache().caches()) { List<List<ClusterNode>> aff = affMap.get(cache.name()); List<List<ClusterNode>> aff0 = cache.context().affinity().assignments(topVer); if (aff != null) assertEquals(aff, aff0); else affMap.put(cache.name(), aff0); } } }
/** * 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 Collection<IgniteInternalCache<?, ?>> cachesx( IgnitePredicate<? super IgniteInternalCache<?, ?>>[] p) { guard(); try { checkClusterState(); return F.retain(ctx.cache().caches(), true, p); } finally { unguard(); } }
locCfgsForActivation = new HashMap<>(); for (IgniteInternalCache cache : ctx.cache().caches()) { locCfgsForActivation.put(cache.name(), new T2<>((CacheConfiguration)null, cache.configuration().getNearConfiguration()));
final GridKernalContext ctx = ((IgniteKernal)ignite).context(); Collection<String> cacheNames = F.viewReadOnly(ctx.cache().caches(), new C1<IgniteInternalCache<?, ?>, String>() { @Override public String apply(IgniteInternalCache<?, ?> c) {
final GridKernalContext ctx = ((IgniteKernal)ignite).context(); Collection<String> cacheNames = F.viewReadOnly(ctx.cache().caches(), new C1<IgniteInternalCache<?, ?>, String>() { @Override public String apply(IgniteInternalCache<?, ?> c) {
for (IgniteInternalCache cache : ctx.cache().caches()) { DynamicCacheDescriptor desc = caches.get(cache.name());