/** * @return Thread-bound context. */ public static BinaryContext threadLocalContext() { BinaryContext ctx = BINARY_CTX.get().get(); if (ctx == null) { IgniteKernal ignite = IgnitionEx.localIgnite(); IgniteCacheObjectProcessor proc = ignite.context().cacheObjects(); if (proc instanceof CacheObjectBinaryProcessorImpl) return ((CacheObjectBinaryProcessorImpl)proc).binaryContext(); else throw new IgniteIllegalStateException("Ignite instance must be started with " + BinaryMarshaller.class.getName() + " [name=" + ignite.name() + ']'); } return ctx; } }
/** * @param topVer Expected version. */ private void checkTopologyVersion(AffinityTopologyVersion topVer) { for (int i = 0; i < NODES; i++) { IgniteKernal ignite = (IgniteKernal)ignite(i); assertEquals(ignite.name(), topVer, ignite.context().discovery().topologyVersionEx()); } } }
.append(" grid=").append(g0.name()) .append("\n");
/** * @param expNodes Expected nodes number. * @param topVer Topology version. * @throws Exception If failed. */ private void checkOrderCounters(int expNodes, AffinityTopologyVersion topVer) throws Exception { List<Ignite> nodes = G.allGrids(); Long order = null; for (Ignite node : nodes) { IgniteKernal node0 = (IgniteKernal)node; if (node0.configuration().isClientMode()) continue; IgniteInternalFuture<?> fut = node0.context().cache().context().exchange().affinityReadyFuture(topVer); if (fut != null) fut.get(); AtomicLong orderCntr = GridTestUtils.getFieldValue(node0.context().cache().context().versions(), "order"); log.info("Order [node=" + node0.name() + ", order=" + orderCntr.get() + ']'); if (order == null) order = orderCntr.get(); else assertEquals(order, (Long)orderCntr.get()); } assertEquals(expNodes, nodes.size()); }
stopGrid(firstGrid.name());
"], node=" + g0.name() + " cache=" + c.getName(), res);
", node=" + g0.name() + ']', e);
/** * @return Thread-bound context. */ public static BinaryContext threadLocalContext() { BinaryContext ctx = GridBinaryMarshaller.BINARY_CTX.get(); if (ctx == null) { IgniteKernal ignite = IgnitionEx.localIgnite(); IgniteCacheObjectProcessor proc = ignite.context().cacheObjects(); if (proc instanceof CacheObjectBinaryProcessorImpl) return ((CacheObjectBinaryProcessorImpl)proc).binaryContext(); else throw new IgniteIllegalStateException("Ignite instance must be started with " + BinaryMarshaller.class.getName() + " [name=" + ignite.name() + ']'); } return ctx; } }