Thanks, Ilya!

On Tue, May 22, 2018, 10:15 AM Ilya Kasnacheev <ilya.kasnach...@gmail.com>
wrote:

> Hello!
>
> What an awesome perdu monocle have you found! I have created a ticket
> against Apache Ignite JIRA:
> https://issues.apache.org/jira/browse/IGNITE-8564
>
> Regards,
>
> --
> Ilya Kasnacheev
>
> 2018-05-18 22:30 GMT+03:00 npordash <nickpord...@gmail.com>:
>
>> Sorry about that! Trying again.
>>
>> final BiFunction<String, Boolean, IgniteConfiguration> cfg = (name, client) 
>> -> {
>>     final IgniteConfiguration c = new IgniteConfiguration();
>>     final TcpDiscoverySpi d = new TcpDiscoverySpi();
>>     d.setIpFinder(new TcpDiscoverySharedFsIpFinder());
>>     c.setDiscoverySpi(d);
>>     c.setIgniteInstanceName(name);
>>     c.setClientMode(client);
>>     c.setCacheConfiguration(new CacheConfiguration("test"));
>>     return c;
>> };
>>
>> Ignite server = null;
>> Ignite client = null;
>> try {
>>
>>     server = Ignition.start(cfg.apply("server", false));
>>     client = Ignition.start(cfg.apply("client", true));
>>
>>     try (IgniteDataStreamer<String, String> streamer = 
>> client.dataStreamer("test")) {
>>         streamer.allowOverwrite(true);
>>         streamer.addData("k1", "v1");
>>     }
>>
>>     TimeUnit.SECONDS.sleep(1);
>>     server.close();
>>     TimeUnit.SECONDS.sleep(1);
>>     server = Ignition.start(cfg.apply("server", false));
>>     TimeUnit.SECONDS.sleep(1);
>>
>>     try (IgniteDataStreamer<String, String> streamer = 
>> client.dataStreamer("test")) {
>>         streamer.allowOverwrite(true);
>>         streamer.addData("k2", "v2");
>>     }
>>
>> } finally {
>>     if (client != null) {
>>         client.close();
>>     }
>>     if (server != null) {
>>         server.close();
>>     }
>> }
>>
>>
>> ------------------------------
>> Sent from the Apache Ignite Users mailing list archive
>> <http://apache-ignite-users.70518.x6.nabble.com/> at Nabble.com.
>>
>
>

Reply via email to