use of org.apache.ignite.internal.client.GridClientConfiguration in project ignite by apache.
the class ClientTcpSslDirectSelfTest method clientConfiguration.
/** {@inheritDoc} */
@Override
protected GridClientConfiguration clientConfiguration() throws GridClientException {
GridClientConfiguration cfg = super.clientConfiguration();
cfg.setServers(Collections.<String>emptySet());
cfg.setRouters(Collections.singleton(HOST + ":" + BINARY_PORT));
return cfg;
}
use of org.apache.ignite.internal.client.GridClientConfiguration in project ignite by apache.
the class ClientFailedInitSelfTest method testRoutersAndServersAddressesProvided.
/**
*
*/
public void testRoutersAndServersAddressesProvided() {
try {
GridClientConfiguration c = new GridClientConfiguration();
c.setRouters(Collections.singleton("127.0.0.1:10000"));
c.setServers(Collections.singleton("127.0.0.1:10000"));
GridClientFactory.start(c);
assert false;
} catch (GridClientException e) {
info("Caught expected exception: " + e);
}
}
use of org.apache.ignite.internal.client.GridClientConfiguration in project ignite by apache.
the class MapReduceClient method client.
/**
* Gets the client.
*
* @return The client.
*/
public GridClient client() throws IOException {
GridClient cli0 = cli;
if (cli0 == null) {
synchronized (mux) {
cli0 = cli;
if (cli0 == null) {
GridClientConfiguration cliCfg = new GridClientConfiguration();
cliCfg.setProtocol(TCP);
cliCfg.setServers(addrs);
cliCfg.setMarshaller(new GridClientJdkMarshaller());
// 1 day.
cliCfg.setMaxConnectionIdleTime(24 * 60 * 60 * 1000L);
cliCfg.setDaemon(true);
try {
cli0 = GridClientFactory.start(cliCfg);
cli = cli0;
} catch (GridClientException e) {
throw new IOException("Failed to establish connection with Ignite: " + addrs, e);
}
}
}
}
return cli0;
}
Aggregations