use of org.apache.ignite.internal.client.GridClientConfiguration in project gridgain by gridgain.
the class ClientAbstractConnectivitySelfTest method startClient.
/**
* Starts a REST client.
*
* @param addr REST server address.
* @param port REST server port.
* @return A successfully started REST client.
* @throws GridClientException If failed to start REST client.
*/
protected GridClient startClient(String addr, int port) throws GridClientException {
GridClientConfiguration cliCfg = new GridClientConfiguration();
cliCfg.setServers(Collections.singleton(addr + ":" + port));
cliCfg.setProtocol(protocol());
return GridClientFactory.start(cliCfg);
}
use of org.apache.ignite.internal.client.GridClientConfiguration in project gridgain by gridgain.
the class TaskEventSubjectIdSelfTest method beforeTestsStarted.
/**
* {@inheritDoc}
*/
@Override
protected void beforeTestsStarted() throws Exception {
Ignite g = startGrid();
g.events().localListen(new IgnitePredicate<Event>() {
@Override
public boolean apply(Event evt) {
assert evt instanceof TaskEvent;
evts.add((TaskEvent) evt);
latch.countDown();
return true;
}
}, EVTS_TASK_EXECUTION);
nodeId = g.cluster().localNode().id();
GridClientConfiguration cfg = new GridClientConfiguration();
cfg.setServers(Collections.singleton("127.0.0.1:11211"));
client = GridClientFactory.start(cfg);
}
use of org.apache.ignite.internal.client.GridClientConfiguration in project gridgain by gridgain.
the class TcpRouterMultiNodeSelfTest method clientConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected GridClientConfiguration clientConfiguration() throws GridClientException {
GridClientConfiguration cfg = super.clientConfiguration();
cfg.setServers(Collections.<String>emptySet());
Collection<String> rtrs = new ArrayList<>(ROUTERS_CNT);
for (int i = 0; i < ROUTERS_CNT; i++) rtrs.add(HOST + ':' + (ROUTER_TCP_PORT_BASE + i));
cfg.setRouters(rtrs);
return cfg;
}
use of org.apache.ignite.internal.client.GridClientConfiguration in project gridgain by gridgain.
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;
}
use of org.apache.ignite.internal.client.GridClientConfiguration in project gridgain by gridgain.
the class ClientTcpUnreachableMultiNodeSelfTest method clientConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected GridClientConfiguration clientConfiguration() throws GridClientException {
GridClientConfiguration cfg = super.clientConfiguration();
// Setting low connection timeout to allow multiple threads
// pass the unavailable address quickly.
cfg.setConnectTimeout(100);
return cfg;
}
Aggregations