IgniteClientReconnectAbstractTest.reconnectClientNode(log, cliNode, srvNode, new Runnable() { @Override public void run() { if (restart) {
IgniteClientReconnectAbstractTest.reconnectClientNode(log, cliNode, srvNode, new Runnable() { @Override public void run() { if (restart) {
Thread.sleep(ThreadLocalRandom.current().nextLong(200, 1000)); IgniteClientReconnectAbstractTest.reconnectClientNode(log, cli, srv, new Runnable() { @Override public void run() {
/** * @throws Exception If failed. */ @Test public void testReconnect() throws Exception { Ignite srv = startGrid("server"); IgniteEvents evts = srv.events(); evts.enableLocal(EventType.EVTS_DISCOVERY_ALL); evts.localListen(new IgnitePredicate<Event>() { @Override public boolean apply(Event evt) { ClusterNode node = ((DiscoveryEvent)evt).eventNode(); rejoinAttr = node.attribute("test"); return true; } }, EventType.EVT_NODE_JOINED); Ignite client = startGrid("client"); reconnectClientNode(log, client, srv, null); assertEquals("2", rejoinAttr); } }
IgniteClientReconnectAbstractTest.reconnectClientNode(log, client, srv, () -> { if (transition) { blockExchangeSingleMessage(spi1, STATE_CHANGE_TOP_VER);
/** * @throws Exception If failed. */ @Test public void testClientReconnectClusterInactive() throws Exception { testReconnectSpi = true; active = false; final int SRVS = 3; final int CLIENTS = 3; startWithCaches1(SRVS, CLIENTS); Ignite srv = ignite(0); Ignite client = ignite(SRVS); checkNoCaches(SRVS + CLIENTS); IgniteClientReconnectAbstractTest.reconnectClientNode(log, client, srv, null); checkNoCaches(SRVS + CLIENTS); ignite(0).cluster().active(true); checkCache(client, CU.UTILITY_CACHE_NAME, true); checkCaches1(SRVS + CLIENTS); this.client = false; startGrid(SRVS + CLIENTS); this.client = true; startGrid(SRVS + CLIENTS + 1); checkCaches1(SRVS + CLIENTS); }
assertCacheStarted(CACHE_NAME, node2); reconnectClientNode(log, node2, node1, new Runnable() { @Override public void run() { assertTrue(node2.context().clientDisconnected());
/** * @throws Exception If failed. */ @Test public void testClientReconnectClusterActive() throws Exception { testReconnectSpi = true; ccfgs = cacheConfigurations1(); final int SRVS = 3; final int CLIENTS = 3; startWithCaches1(SRVS, CLIENTS); if (persistenceEnabled()) ignite(0).cluster().active(true); Ignite srv = ignite(0); Ignite client = ignite(SRVS); checkCache(client, CU.UTILITY_CACHE_NAME, true); checkCaches1(SRVS + CLIENTS); IgniteClientReconnectAbstractTest.reconnectClientNode(log, client, srv, null); checkCaches1(SRVS + CLIENTS); this.client = false; startGrid(SRVS + CLIENTS); this.client = true; startGrid(SRVS + CLIENTS + 1); checkCaches1(SRVS + CLIENTS + 2); }
IgniteClientReconnectAbstractTest.reconnectClientNode(log, client, srv, () -> { if (transition) { blockExchangeSingleMessage(spi1, STATE_CHANGE_TOP_VER);