Search in sources :

Example 21 with GridClientConfiguration

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;
}
Also used : GridClientConfiguration(org.apache.ignite.internal.client.GridClientConfiguration)

Example 22 with GridClientConfiguration

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);
    }
}
Also used : GridClientException(org.apache.ignite.internal.client.GridClientException) GridClientConfiguration(org.apache.ignite.internal.client.GridClientConfiguration)

Example 23 with GridClientConfiguration

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;
}
Also used : GridClientException(org.apache.ignite.internal.client.GridClientException) GridClientJdkMarshaller(org.apache.ignite.internal.client.marshaller.jdk.GridClientJdkMarshaller) GridClient(org.apache.ignite.internal.client.GridClient) IOException(java.io.IOException) GridClientConfiguration(org.apache.ignite.internal.client.GridClientConfiguration)

Aggregations

GridClientConfiguration (org.apache.ignite.internal.client.GridClientConfiguration)23 GridClientDataConfiguration (org.apache.ignite.internal.client.GridClientDataConfiguration)5 ArrayList (java.util.ArrayList)4 GridClient (org.apache.ignite.internal.client.GridClient)3 GridClientException (org.apache.ignite.internal.client.GridClientException)3 GridClientPartitionAffinity (org.apache.ignite.internal.client.GridClientPartitionAffinity)2 File (java.io.File)1 IOException (java.io.IOException)1 Map (java.util.Map)1 Properties (java.util.Properties)1 UUID (java.util.UUID)1 ThreadFactory (java.util.concurrent.ThreadFactory)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 Ignite (org.apache.ignite.Ignite)1 Event (org.apache.ignite.events.Event)1 TaskEvent (org.apache.ignite.events.TaskEvent)1 GridClientClusterState (org.apache.ignite.internal.client.GridClientClusterState)1 GridClientRoundRobinBalancer (org.apache.ignite.internal.client.balancer.GridClientRoundRobinBalancer)1 GridClientJdkMarshaller (org.apache.ignite.internal.client.marshaller.jdk.GridClientJdkMarshaller)1 VisorNodePingTask (org.apache.ignite.internal.visor.node.VisorNodePingTask)1