use of org.apache.ignite.internal.client.GridClientConfiguration in project ignite by apache.
the class BinaryConfigurationCustomSerializerSelfTest method testThinClientConnected.
/**
* Test that thin client will be able to connect to node with custom binary serializer and custom consistent ID.
*
* @throws Exception If failed.
*/
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);
}
use of org.apache.ignite.internal.client.GridClientConfiguration in project ignite by apache.
the class ClientPreferDirectSelfTest method client.
/**
* @param b Balancer.
* @return Client.
* @throws Exception If failed.
*/
private GridClient client(GridClientLoadBalancer b) throws Exception {
GridClientConfiguration cfg = new GridClientConfiguration();
cfg.setBalancer(b);
cfg.setTopologyRefreshFrequency(TOP_REFRESH_FREQ);
Collection<String> rtrs = new ArrayList<>(3);
for (int i = 0; i < NODES_CNT / 2; i++) rtrs.add(HOST + ':' + (REST_TCP_PORT_BASE + i));
cfg.setRouters(rtrs);
return GridClientFactory.start(cfg);
}
use of org.apache.ignite.internal.client.GridClientConfiguration in project ignite by apache.
the class ClientTcpDirectMultiNodeSelfTest method clientConfiguration.
/** {@inheritDoc} */
@Override
protected GridClientConfiguration clientConfiguration() throws GridClientException {
assert NODES_CNT > 3 : "Too few nodes to execute direct multinode test";
GridClientConfiguration cfg = super.clientConfiguration();
cfg.setServers(Collections.<String>emptySet());
Collection<String> srvs = new ArrayList<>(3);
for (int i = 0; i < NODES_CNT / 2; i++) srvs.add(HOST + ':' + (REST_TCP_PORT_BASE + i));
cfg.setRouters(srvs);
return cfg;
}
use of org.apache.ignite.internal.client.GridClientConfiguration in project ignite by apache.
the class ChangeStateCommandHandlerTest method beforeTest.
/** {@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);
}
use of org.apache.ignite.internal.client.GridClientConfiguration in project ignite by apache.
the class ClientTcpSslDirectMultiNodeSelfTest method clientConfiguration.
/** {@inheritDoc} */
@Override
protected GridClientConfiguration clientConfiguration() throws GridClientException {
assert NODES_CNT > 3 : "Too few nodes to execute direct multinode test";
GridClientConfiguration cfg = super.clientConfiguration();
cfg.setServers(Collections.<String>emptySet());
Collection<String> srvs = new ArrayList<>(3);
for (int i = 0; i < NODES_CNT / 2; i++) srvs.add(HOST + ':' + (REST_TCP_PORT_BASE + i));
cfg.setRouters(srvs);
return cfg;
}
Aggregations