@Override public GridClient call() throws Exception { return GridClientFactory.start(cfg); } });
/** * Waits for all pending requests for a particular client to be completed (no new requests will be * accepted) and then closes the client. This method is equivalent to {@code stop(clientId, true)}. * * @param clientId Identifier of client to close. * @see #stop(UUID, boolean) */ public static void stop(UUID clientId) { stop(clientId, true); }
/** * Waits for all open clients to finish their operations and stops them, This method * is equivalent to {@code stopAll(true)} method invocation. * * @see #stopAll(boolean) */ public static void stopAll() { stopAll(true); }
/** * Performs test, * * @param printResults Whether to print results. * @throws GridClientException If failed. */ public void run(boolean printResults) throws GridClientException { Collection<TestThread> workers = new ArrayList<>(threadCnt); client = GridClientFactory.start(configuration()); long startTime = System.currentTimeMillis(); for(int i = 0; i < threadCnt; i++) { TestThread th = new TestThread(); workers.add(th); th.start(); } U.joinThreads(workers, null); if (printResults) countAndPrintSummary(workers, startTime); GridClientFactory.stopAll(); }
/** * Test that thin client will be able to connect to node with custom binary serializer and custom consistent ID. * * @throws Exception If failed. */ @Test public void testThinClientConnected() throws Exception { UUID nid = ignite(0).cluster().localNode().id(); GridClientConfiguration clnCfg = new GridClientConfiguration(); clnCfg.setProtocol(GridClientProtocol.TCP); clnCfg.setServers(Collections.singleton("127.0.0.1:11211")); clnCfg.setBalancer(new GridClientRoundRobinBalancer()); // Start client. GridClient client = GridClientFactory.start(clnCfg); // Execute some task. client.compute().execute(VisorNodePingTask.class.getName(), new VisorTaskArgument<>(nid, new VisorNodePingTaskArg(nid), false)); GridClientFactory.stop(client.id(), false); }
/** * @return Client. * @throws GridClientException In case of error. */ protected GridClient client() throws GridClientException { return GridClientFactory.start(clientConfiguration()); }
/** {@inheritDoc} */ @Override public void close() { GridClientFactory.stop(id); }
/** {@inheritDoc} */ @Override protected void afterTest() throws Exception { GridClientFactory.stopAll(); G.stopAll(true); }
/** {@inheritDoc} */ @Override protected void beforeTest() throws Exception { client = GridClientFactory.start(clientConfiguration()); }
/** {@inheritDoc} */ @Override public void close() throws SQLException { if (closed) return; closed = true; GridClientFactory.stop(client.id(), false); }
/** {@inheritDoc} */ @Override protected void afterTest() throws Exception { GridClientFactory.stopAll(); GridRouterFactory.stopAllRouters(); stopAllGrids(); }
/** {@inheritDoc} */ @Override protected void beforeTest() throws Exception { client = GridClientFactory.start(clientConfiguration()); }
/** {@inheritDoc} */ @Override protected void afterTest() throws Exception { GridClientFactory.stop(client.id(), false); client = null; }
GridClientFactory.stopAll();
/** {@inheritDoc} */ @Override protected void beforeTest() throws Exception { client = GridClientFactory.start(clientConfiguration()); }
/** {@inheritDoc} */ @Override protected void afterTest() throws Exception { if (client != null) { GridClientFactory.stop(client.id(), false); client = null; } }
/** * Waits for all open clients to finish their operations and stops them, This method * is equivalent to {@code stopAll(true)} method invocation. * * @see #stopAll(boolean) */ public static void stopAll() { stopAll(true); }
cfg.setAutoFetchAttributes(false); client = GridClientFactory.start(cfg);
/** {@inheritDoc} */ @Override protected void afterTestsStopped() throws Exception { GridClientFactory.stop(client.id()); }
/** {@inheritDoc} */ @Override protected void beforeTest() throws Exception { GridClientConfiguration cfg = new GridClientConfiguration(); cfg.setProtocol(TCP); cfg.setServers(Collections.singletonList("localhost:" + BINARY_PORT)); client = GridClientFactory.start(cfg); }