use of org.apache.ignite.internal.client.marshaller.jdk.GridClientJdkMarshaller 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;
}
use of org.apache.ignite.internal.client.marshaller.jdk.GridClientJdkMarshaller in project ignite by apache.
the class GridTcpRestProtocol method onKernalStart.
/** {@inheritDoc} */
@Override
public void onKernalStart() {
super.onKernalStart();
Map<Byte, GridClientMarshaller> marshMap = new HashMap<>();
ArrayList<PluginProvider> providers = new ArrayList<>(ctx.plugins().allProviders());
GridClientOptimizedMarshaller optMarsh = new GridClientOptimizedMarshaller(providers);
marshMap.put(GridClientOptimizedMarshaller.ID, optMarsh);
marshMap.put(GridClientZipOptimizedMarshaller.ID, new GridClientZipOptimizedMarshaller(optMarsh, providers));
marshMap.put(GridClientJdkMarshaller.ID, new GridClientJdkMarshaller());
lsnr.marshallers(marshMap);
}
Aggregations