go thin client

2020-07-15 Thread Warren Pang
Hi

Will you provide go-lang thin client for Ignite?
Thank you.


Re: How to do cache.get() on SQL table by primary key with multiple columns?

2020-07-15 Thread John Smith
Well it's more because I have to inject the ignite instance into my cache
"repository" which abstracts away the IgniteCache only.

And if the builder is not an expensive operation I guess I can find a way
to pass the ignite instance down into the cache repo implementation.

On Wed, 15 Jul 2020 at 17:45, Evgenii Zhuravlev 
wrote:

> John,
>
> Then you should just get a new builder every time when you need it:
> myIgniteInstance.binary().builder("MyKey"). I don't see why you need to
> reuse builder from multiple threads here.
>
> Evgenii
>
> ср, 15 июл. 2020 г. в 14:34, John Smith :
>
>> I'm using it in Vertx.io. if you understand the concept a bit. I have 2
>> vertices.
>>
>> I create 2 instances of BinaryObjectBuilder
>>
>> Each builder creates a new object (binary key) per "event" that comes in.
>>
>> So if I get 2 events then each builder will build one...
>>
>> If I get 3 events, the 3rd event will wait until one of the event loops
>> can process the next event...
>>
>>
>>
>> On Wed., Jul. 15, 2020, 3:43 p.m. Evgenii Zhuravlev, <
>> e.zhuravlev...@gmail.com> wrote:
>>
>>> 1. This builder can be used for making one object, do you want to
>>> construct one object from multiple threads?
>>> 2. No, you still can work with BinaryObjects instead of actual classes.
>>>
>>> Evgenii
>>>
>>> ср, 15 июл. 2020 г. в 08:50, John Smith :
>>>
 Hi Evgenii, it works good. I have two questions...

 1- Is the BinaryObjectBuilder obtained from
 myIgniteInstance.binary().builder("MyKey"); thread safe? Can I pass the
 same builder to multiple instances of my cache "repository" wrapper I 
 wrote?
 2- If we want to use the actual MyKey class then I suppose that needs
 to be in the classpath on all nodes?

 On Wed, 15 Jul 2020 at 10:43, John Smith 
 wrote:

> Ok I will try it...
>
> On Tue, 14 Jul 2020 at 22:34, Evgenii Zhuravlev <
> e.zhuravlev...@gmail.com> wrote:
>
>> John,
>>
>> It's not necessary to have class at all, you can specify any type,
>> you just need to use this type when creating binary object for this key.
>>
>> вт, 14 июл. 2020 г. в 17:50, John Smith :
>>
>>> I just used two columns as primary key...
>>>
>>> Of I use key_type and specify a type does that class need to exist
>>> in the class path of the server nodes?
>>>
>>> Like if I have
>>>
>>> class MyKeyClass {
>>>Integer col1;
>>>Integer col2;
>>> }
>>>
>>> Does this class need to be loaded in all nodes or ignite can figure
>>> it out and marshal it?
>>>
>>> On Tue., Jul. 14, 2020, 6:50 p.m. Evgenii Zhuravlev, <
>>> e.zhuravlev...@gmail.com> wrote:
>>>
 Hi John,

 To do this, you need to create a key object with the same type as
 you have for the table. If you don't specify KEY_TYPE in the create 
 table
 script, it will be generated automatically. I would recommend to 
 specify it
 for the command(just type name, if you don't have a class) and, when 
 you
 need to get data using key-value API, just create a binary object of 
 this
 type with these fields:
 https://www.gridgain.com/docs/latest/developers-guide/key-value-api/binary-objects#creating-and-modifying-binary-objects

 Evgenii

 вт, 14 июл. 2020 г. в 07:18, John Smith :

> Hi, I have an SQL table
>
> create table if not exists my_table (
> column1 int,
> column2 int,
> column3 varchar(16),
> PRIMARY KEY (column1, column2)
> ) with "template=replicatedTpl";
>
> and I'm creating my near cache as follows...
>
> IgniteCache myCache;
>
> NearCacheConfiguration nearConfig = new
> NearCacheConfiguration<>();
> nearConfig.setNearEvictionPolicyFactory(new
> LruEvictionPolicyFactory<>(1024));
>
> myCache =
> this.ignite.getOrCreateNearCache(SQL_PUBLIC_MY_TABLE, nearConfig)
> .withExpiryPolicy(new AccessedExpiryPolicy(new
> Duration(TimeUnit.HOURS, 1)));
>
> So if I use myCache.get()...
>
> 1- How do I specify the primary key if it's 2 columns?
> 2- I assume the data will be put in near cache?
>
>
>
>
>


Re: How to do cache.get() on SQL table by primary key with multiple columns?

2020-07-15 Thread Evgenii Zhuravlev
John,

Then you should just get a new builder every time when you need it:
myIgniteInstance.binary().builder("MyKey"). I don't see why you need to
reuse builder from multiple threads here.

Evgenii

ср, 15 июл. 2020 г. в 14:34, John Smith :

> I'm using it in Vertx.io. if you understand the concept a bit. I have 2
> vertices.
>
> I create 2 instances of BinaryObjectBuilder
>
> Each builder creates a new object (binary key) per "event" that comes in.
>
> So if I get 2 events then each builder will build one...
>
> If I get 3 events, the 3rd event will wait until one of the event loops
> can process the next event...
>
>
>
> On Wed., Jul. 15, 2020, 3:43 p.m. Evgenii Zhuravlev, <
> e.zhuravlev...@gmail.com> wrote:
>
>> 1. This builder can be used for making one object, do you want to
>> construct one object from multiple threads?
>> 2. No, you still can work with BinaryObjects instead of actual classes.
>>
>> Evgenii
>>
>> ср, 15 июл. 2020 г. в 08:50, John Smith :
>>
>>> Hi Evgenii, it works good. I have two questions...
>>>
>>> 1- Is the BinaryObjectBuilder obtained from
>>> myIgniteInstance.binary().builder("MyKey"); thread safe? Can I pass the
>>> same builder to multiple instances of my cache "repository" wrapper I wrote?
>>> 2- If we want to use the actual MyKey class then I suppose that needs to
>>> be in the classpath on all nodes?
>>>
>>> On Wed, 15 Jul 2020 at 10:43, John Smith  wrote:
>>>
 Ok I will try it...

 On Tue, 14 Jul 2020 at 22:34, Evgenii Zhuravlev <
 e.zhuravlev...@gmail.com> wrote:

> John,
>
> It's not necessary to have class at all, you can specify any type, you
> just need to use this type when creating binary object for this key.
>
> вт, 14 июл. 2020 г. в 17:50, John Smith :
>
>> I just used two columns as primary key...
>>
>> Of I use key_type and specify a type does that class need to exist in
>> the class path of the server nodes?
>>
>> Like if I have
>>
>> class MyKeyClass {
>>Integer col1;
>>Integer col2;
>> }
>>
>> Does this class need to be loaded in all nodes or ignite can figure
>> it out and marshal it?
>>
>> On Tue., Jul. 14, 2020, 6:50 p.m. Evgenii Zhuravlev, <
>> e.zhuravlev...@gmail.com> wrote:
>>
>>> Hi John,
>>>
>>> To do this, you need to create a key object with the same type as
>>> you have for the table. If you don't specify KEY_TYPE in the create 
>>> table
>>> script, it will be generated automatically. I would recommend to 
>>> specify it
>>> for the command(just type name, if you don't have a class) and, when you
>>> need to get data using key-value API, just create a binary object of 
>>> this
>>> type with these fields:
>>> https://www.gridgain.com/docs/latest/developers-guide/key-value-api/binary-objects#creating-and-modifying-binary-objects
>>>
>>> Evgenii
>>>
>>> вт, 14 июл. 2020 г. в 07:18, John Smith :
>>>
 Hi, I have an SQL table

 create table if not exists my_table (
 column1 int,
 column2 int,
 column3 varchar(16),
 PRIMARY KEY (column1, column2)
 ) with "template=replicatedTpl";

 and I'm creating my near cache as follows...

 IgniteCache myCache;

 NearCacheConfiguration nearConfig = new
 NearCacheConfiguration<>();
 nearConfig.setNearEvictionPolicyFactory(new
 LruEvictionPolicyFactory<>(1024));

 myCache =
 this.ignite.getOrCreateNearCache(SQL_PUBLIC_MY_TABLE, nearConfig)
 .withExpiryPolicy(new AccessedExpiryPolicy(new
 Duration(TimeUnit.HOURS, 1)));

 So if I use myCache.get()...

 1- How do I specify the primary key if it's 2 columns?
 2- I assume the data will be put in near cache?







Re: How to do cache.get() on SQL table by primary key with multiple columns?

2020-07-15 Thread John Smith
I'm using it in Vertx.io. if you understand the concept a bit. I have 2
vertices.

I create 2 instances of BinaryObjectBuilder

Each builder creates a new object (binary key) per "event" that comes in.

So if I get 2 events then each builder will build one...

If I get 3 events, the 3rd event will wait until one of the event loops can
process the next event...



On Wed., Jul. 15, 2020, 3:43 p.m. Evgenii Zhuravlev, <
e.zhuravlev...@gmail.com> wrote:

> 1. This builder can be used for making one object, do you want to
> construct one object from multiple threads?
> 2. No, you still can work with BinaryObjects instead of actual classes.
>
> Evgenii
>
> ср, 15 июл. 2020 г. в 08:50, John Smith :
>
>> Hi Evgenii, it works good. I have two questions...
>>
>> 1- Is the BinaryObjectBuilder obtained from
>> myIgniteInstance.binary().builder("MyKey"); thread safe? Can I pass the
>> same builder to multiple instances of my cache "repository" wrapper I wrote?
>> 2- If we want to use the actual MyKey class then I suppose that needs to
>> be in the classpath on all nodes?
>>
>> On Wed, 15 Jul 2020 at 10:43, John Smith  wrote:
>>
>>> Ok I will try it...
>>>
>>> On Tue, 14 Jul 2020 at 22:34, Evgenii Zhuravlev <
>>> e.zhuravlev...@gmail.com> wrote:
>>>
 John,

 It's not necessary to have class at all, you can specify any type, you
 just need to use this type when creating binary object for this key.

 вт, 14 июл. 2020 г. в 17:50, John Smith :

> I just used two columns as primary key...
>
> Of I use key_type and specify a type does that class need to exist in
> the class path of the server nodes?
>
> Like if I have
>
> class MyKeyClass {
>Integer col1;
>Integer col2;
> }
>
> Does this class need to be loaded in all nodes or ignite can figure it
> out and marshal it?
>
> On Tue., Jul. 14, 2020, 6:50 p.m. Evgenii Zhuravlev, <
> e.zhuravlev...@gmail.com> wrote:
>
>> Hi John,
>>
>> To do this, you need to create a key object with the same type as you
>> have for the table. If you don't specify KEY_TYPE in the create table
>> script, it will be generated automatically. I would recommend to specify 
>> it
>> for the command(just type name, if you don't have a class) and, when you
>> need to get data using key-value API, just create a binary object of this
>> type with these fields:
>> https://www.gridgain.com/docs/latest/developers-guide/key-value-api/binary-objects#creating-and-modifying-binary-objects
>>
>> Evgenii
>>
>> вт, 14 июл. 2020 г. в 07:18, John Smith :
>>
>>> Hi, I have an SQL table
>>>
>>> create table if not exists my_table (
>>> column1 int,
>>> column2 int,
>>> column3 varchar(16),
>>> PRIMARY KEY (column1, column2)
>>> ) with "template=replicatedTpl";
>>>
>>> and I'm creating my near cache as follows...
>>>
>>> IgniteCache myCache;
>>>
>>> NearCacheConfiguration nearConfig = new
>>> NearCacheConfiguration<>();
>>> nearConfig.setNearEvictionPolicyFactory(new
>>> LruEvictionPolicyFactory<>(1024));
>>>
>>> myCache =
>>> this.ignite.getOrCreateNearCache(SQL_PUBLIC_MY_TABLE, nearConfig)
>>> .withExpiryPolicy(new AccessedExpiryPolicy(new
>>> Duration(TimeUnit.HOURS, 1)));
>>>
>>> So if I use myCache.get()...
>>>
>>> 1- How do I specify the primary key if it's 2 columns?
>>> 2- I assume the data will be put in near cache?
>>>
>>>
>>>
>>>
>>>


Re: How to do cache.get() on SQL table by primary key with multiple columns?

2020-07-15 Thread Evgenii Zhuravlev
1. This builder can be used for making one object, do you want to construct
one object from multiple threads?
2. No, you still can work with BinaryObjects instead of actual classes.

Evgenii

ср, 15 июл. 2020 г. в 08:50, John Smith :

> Hi Evgenii, it works good. I have two questions...
>
> 1- Is the BinaryObjectBuilder obtained from
> myIgniteInstance.binary().builder("MyKey"); thread safe? Can I pass the
> same builder to multiple instances of my cache "repository" wrapper I wrote?
> 2- If we want to use the actual MyKey class then I suppose that needs to
> be in the classpath on all nodes?
>
> On Wed, 15 Jul 2020 at 10:43, John Smith  wrote:
>
>> Ok I will try it...
>>
>> On Tue, 14 Jul 2020 at 22:34, Evgenii Zhuravlev 
>> wrote:
>>
>>> John,
>>>
>>> It's not necessary to have class at all, you can specify any type, you
>>> just need to use this type when creating binary object for this key.
>>>
>>> вт, 14 июл. 2020 г. в 17:50, John Smith :
>>>
 I just used two columns as primary key...

 Of I use key_type and specify a type does that class need to exist in
 the class path of the server nodes?

 Like if I have

 class MyKeyClass {
Integer col1;
Integer col2;
 }

 Does this class need to be loaded in all nodes or ignite can figure it
 out and marshal it?

 On Tue., Jul. 14, 2020, 6:50 p.m. Evgenii Zhuravlev, <
 e.zhuravlev...@gmail.com> wrote:

> Hi John,
>
> To do this, you need to create a key object with the same type as you
> have for the table. If you don't specify KEY_TYPE in the create table
> script, it will be generated automatically. I would recommend to specify 
> it
> for the command(just type name, if you don't have a class) and, when you
> need to get data using key-value API, just create a binary object of this
> type with these fields:
> https://www.gridgain.com/docs/latest/developers-guide/key-value-api/binary-objects#creating-and-modifying-binary-objects
>
> Evgenii
>
> вт, 14 июл. 2020 г. в 07:18, John Smith :
>
>> Hi, I have an SQL table
>>
>> create table if not exists my_table (
>> column1 int,
>> column2 int,
>> column3 varchar(16),
>> PRIMARY KEY (column1, column2)
>> ) with "template=replicatedTpl";
>>
>> and I'm creating my near cache as follows...
>>
>> IgniteCache myCache;
>>
>> NearCacheConfiguration nearConfig = new
>> NearCacheConfiguration<>();
>> nearConfig.setNearEvictionPolicyFactory(new
>> LruEvictionPolicyFactory<>(1024));
>>
>> myCache =
>> this.ignite.getOrCreateNearCache(SQL_PUBLIC_MY_TABLE, nearConfig)
>> .withExpiryPolicy(new AccessedExpiryPolicy(new
>> Duration(TimeUnit.HOURS, 1)));
>>
>> So if I use myCache.get()...
>>
>> 1- How do I specify the primary key if it's 2 columns?
>> 2- I assume the data will be put in near cache?
>>
>>
>>
>>
>>


Re: Hot service upgrade without downtime

2020-07-15 Thread Denis Magda
Hi Sergey,

Starting Ignite 2.8 you can update services without brining down cluster
nodes:
https://apacheignite.readme.io/docs/service-grid#service-updates-redeployment

Even though you still need to shut down for a short period of time, the
cluster itself stays up-and-running.

-
Denis


On Thu, Jul 2, 2020 at 3:09 AM Sergey Antonov  wrote:

> Hello, Igniters!
>
>
>
> I’d like to know, does Ignite have ability to upgrade user’s service in
> service grid without downtime?
>
>
>
> Let’s imagine that I have grid with 2 nodes. Each node has deployed
> instance of service. I’d like to upgrade service version without service’s
> downtime.
>
>
>
> At the moment I have only one idea how to do it: start the same service on
> different nodes with different names (service1 on node1 and service2 on
> node2) and use node filter.
>
> · Stop one node
>
> · Upgrade service jar.
>
> · Return the node to cluster.
>
>
>
> Apply same steps to another node.
>
>
>
> Do you know simpler ways for the service upgrade?
>
>
> ---
> Die Europäische Kommission hat unter http://ec.europa.eu/consumers/odr/
> eine Europäische Online-Streitbeilegungsplattform (OS-Plattform) errichtet.
> Verbraucher können die OS-Plattform für die außergerichtliche Beilegung von
> Streitigkeiten aus Online-Verträgen mit in der EU niedergelassenen
> Unternehmen nutzen.
>
> Informationen (einschließlich Pflichtangaben) zu einzelnen, innerhalb der
> EU tätigen Gesellschaften und Zweigniederlassungen des Konzerns Deutsche
> Bank finden Sie unter https://www.deutsche-bank.de/Pflichtangaben. Diese
> E-Mail enthält vertrauliche und/ oder rechtlich geschützte Informationen.
> Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich
> erhalten haben, informieren Sie bitte sofort den Absender und vernichten
> Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe
> dieser E-Mail ist nicht gestattet.
>
> The European Commission has established a European online dispute
> resolution platform (OS platform) under http://ec.europa.eu/consumers/odr/.
> Consumers may use the OS platform to resolve disputes arising from online
> contracts with providers established in the EU.
>
> Please refer to https://www.db.com/disclosures for information (including
> mandatory corporate particulars) on selected Deutsche Bank branches and
> group companies registered or incorporated in the European Union. This
> e-mail may contain confidential and/or privileged information. If you are
> not the intended recipient (or have received this e-mail in error) please
> notify the sender immediately and delete this e-mail. Any unauthorized
> copying, disclosure or distribution of the material in this e-mail is
> strictly forbidden.
>


cache.getAsync() blocks if cluster is not activated.

2020-07-15 Thread John Smith
Hi, testing some failover scenarios etc...

When we call cache.getAsync() and the state of the cluster is not active.
It seems to block.

I implemented a cache repository as follows and using Vertx.io. It seems to
block at the cacheOperation.apply(cache)

So when I call myRepo.get(myKey) which underneath applies the
cache.getAsync() function it blocks.

public class IgniteCacheRepository implements CacheRepository {
public final long DEFAULT_OPERATION_TIMEOUT = 1000;
private final TimeUnit DEFAULT_TIMEOUT_UNIT = TimeUnit.MILLISECONDS;

private Vertx vertx;
private IgniteCache cache;

public IgniteCacheRepository(Vertx vertx, IgniteCache cache) {
this.vertx = vertx;
this.cache = cache;
}

@Override
public Future put(K key, V value) {
return executeAsync(cache -> cache.putAsync(key, value),
DEFAULT_OPERATION_TIMEOUT, DEFAULT_TIMEOUT_UNIT);
}

@Override
public Future get(K key) {
return executeAsync(cache -> cache.getAsync(key),
DEFAULT_OPERATION_TIMEOUT, DEFAULT_TIMEOUT_UNIT);
}

@Override
public  Future invoke(K key, EntryProcessor
processor, Object... arguments) {
return executeAsync(cache -> cache.invokeAsync(key, processor,
arguments), DEFAULT_OPERATION_TIMEOUT, DEFAULT_TIMEOUT_UNIT);
}

@Override
public  T cache() {
return (T) cache;
}

/**
 * Adapt Ignite async operation to vertx futures.
 *
 * @param cacheOperation The ignite operation to execute async.
 * @return The value from the cache operation.
 */
private  Future executeAsync(Function,
IgniteFuture> cacheOperation, long timeout, TimeUnit unit) {
Future future = Future.future();

try {
IgniteFuture value = cacheOperation.apply(cache);

value.listenAsync(result -> {
try {
future.complete(result.get(timeout, unit));
} catch(Exception ex) {
future.fail(ex);
}
}, 
VertxIgniteExecutorAdapter.getOrCreate(vertx.getOrCreateContext()));
} catch(Exception ex) {
// Catch some RuntimeException that can be thrown by Ignite cache.
future.fail(ex);
}

return future;
}
}


Re: How to do cache.get() on SQL table by primary key with multiple columns?

2020-07-15 Thread John Smith
Hi Evgenii, it works good. I have two questions...

1- Is the BinaryObjectBuilder obtained from
myIgniteInstance.binary().builder("MyKey"); thread safe? Can I pass the
same builder to multiple instances of my cache "repository" wrapper I wrote?
2- If we want to use the actual MyKey class then I suppose that needs to be
in the classpath on all nodes?

On Wed, 15 Jul 2020 at 10:43, John Smith  wrote:

> Ok I will try it...
>
> On Tue, 14 Jul 2020 at 22:34, Evgenii Zhuravlev 
> wrote:
>
>> John,
>>
>> It's not necessary to have class at all, you can specify any type, you
>> just need to use this type when creating binary object for this key.
>>
>> вт, 14 июл. 2020 г. в 17:50, John Smith :
>>
>>> I just used two columns as primary key...
>>>
>>> Of I use key_type and specify a type does that class need to exist in
>>> the class path of the server nodes?
>>>
>>> Like if I have
>>>
>>> class MyKeyClass {
>>>Integer col1;
>>>Integer col2;
>>> }
>>>
>>> Does this class need to be loaded in all nodes or ignite can figure it
>>> out and marshal it?
>>>
>>> On Tue., Jul. 14, 2020, 6:50 p.m. Evgenii Zhuravlev, <
>>> e.zhuravlev...@gmail.com> wrote:
>>>
 Hi John,

 To do this, you need to create a key object with the same type as you
 have for the table. If you don't specify KEY_TYPE in the create table
 script, it will be generated automatically. I would recommend to specify it
 for the command(just type name, if you don't have a class) and, when you
 need to get data using key-value API, just create a binary object of this
 type with these fields:
 https://www.gridgain.com/docs/latest/developers-guide/key-value-api/binary-objects#creating-and-modifying-binary-objects

 Evgenii

 вт, 14 июл. 2020 г. в 07:18, John Smith :

> Hi, I have an SQL table
>
> create table if not exists my_table (
> column1 int,
> column2 int,
> column3 varchar(16),
> PRIMARY KEY (column1, column2)
> ) with "template=replicatedTpl";
>
> and I'm creating my near cache as follows...
>
> IgniteCache myCache;
>
> NearCacheConfiguration nearConfig = new
> NearCacheConfiguration<>();
> nearConfig.setNearEvictionPolicyFactory(new
> LruEvictionPolicyFactory<>(1024));
>
> myCache =
> this.ignite.getOrCreateNearCache(SQL_PUBLIC_MY_TABLE, nearConfig)
> .withExpiryPolicy(new AccessedExpiryPolicy(new
> Duration(TimeUnit.HOURS, 1)));
>
> So if I use myCache.get()...
>
> 1- How do I specify the primary key if it's 2 columns?
> 2- I assume the data will be put in near cache?
>
>
>
>
>


Re: Ignite Native Persistence With write behind additional store

2020-07-15 Thread Evgenii Zhuravlev
There is a typo in my previous message, I meant "Storages will be
synchronized in case of one of the node failure."

There is no reference for this type of configuration since there is no
guarantee for the consistency. If you still want to use it, you can just
combine configuration for persistence with a configuration for 3rd party
cache store. Both can be found in the documentation and Ignite examples.

Evgenii

ср, 15 июл. 2020 г. в 08:22, Devakumar J :

> Hi,
>
> Thanks for the reply.
>
> is there a reference to configure custom store along with native
> persistence
> enabled.
>
> Thanks & Regards,
> Devakumar J
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>


Re: Ignite Native Persistence With write behind additional store

2020-07-15 Thread Devakumar J
Hi,

Thanks for the reply.

is there a reference to configure custom store along with native persistence
enabled.

Thanks & Regards,
Devakumar J



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/


Apache Ignite CacheRebalanceMode Is Not Respected By Nodes

2020-07-15 Thread cparaskeva
The setup: Hello folks I have a simple Apache Ignite setup with two Ignite
instances configured as server nodes over C# and one Ignite instance as a
client node over java.

What is the goal: Populate data on instance 1 and instance 2 but avoid
movement of data between them. In other words data receiced on each node
must stay in node. Then using the java client to run queries against the two
nodes either combined (distributed join) or per node (using affinity).

The issue: With one server node everything works as expected, however on
more than one server nodes, data of the cluster is balancing between the x
member nodes even if I have expliccitly set the CacheRebalanceMode to None
which should disable the rebalance between then nodes. The insert time is
increase by 4x-10x times, function to each node's populated data.

P.S. I have tried change the cache mode from Partitioned to Local where each
node will have isolated the data in it's internal H2 db however in that case
the Java client is unable to detect the nodes or read any data from the
cache of each node.

Java Client Node

IgniteConfiguration cfg = new IgniteConfiguration();
// Enable client mode.
cfg.setClientMode(true);

// Setting up an IP Finder to ensure the client can locate the
servers.
TcpDiscoveryMulticastIpFinder ipFinder = new
TcpDiscoveryMulticastIpFinder();
   
ipFinder.setAddresses(Collections.singletonList("127.0.0.1:47500..47509"));
cfg.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(ipFinder));

// Configure Ignite to connect with .NET nodes
cfg.setBinaryConfiguration(new BinaryConfiguration()
.setNameMapper(new BinaryBasicNameMapper(true))
.setCompactFooter(true)

// Start Ignite in client mode.
Ignite ignite = Ignition.start(cfg);


IgniteCache cache0 = ignite.cache(CACHE_NAME);
IgniteCache cache =
cache0.withKeepBinary();

// execute some queries to nodes
C# Server Node


   IIgnite _ignite =
Ignition.Start(IgniteUtils.DefaultIgniteConfig()));

// Create new cache and configure queries for Trade binary
types.
// Note that there are no such classes defined.
var cache0 = _ignite.GetOrCreateCache("DEALIO");

// Switch to binary mode to work with data in serialized
form.
_cache = cache0.WithKeepBinary();

   //populate some data ...

public static IgniteConfiguration DefaultIgniteConfig()
{
return new IgniteConfiguration
{

   
PeerAssemblyLoadingMode =
PeerAssemblyLoadingMode.CurrentAppDomain,
BinaryConfiguration = new BinaryConfiguration
{
NameMapper = new BinaryBasicNameMapper { IsSimpleName =
true },
CompactFooter = true,
TypeConfigurations = new[] {
new BinaryTypeConfiguration(typeof(Trade)) {
Serializer = new IgniteTradeSerializer()
}
}
},
DiscoverySpi = new TcpDiscoverySpi
{
IpFinder = new TcpDiscoveryMulticastIpFinder
{
Endpoints = new[] { "127.0.0.1:47500..47509" }
},
SocketTimeout = TimeSpan.FromSeconds(0.10)
},
Logger = new IgniteNLogLogger(),
CacheConfiguration = new[]{
new CacheConfiguration{
PartitionLossPolicy=PartitionLossPolicy.Ignore,
RebalanceMode=CacheRebalanceMode.None,
Name = CACHE_NAME,
CacheMode = CacheMode.Partitioned,
Backups = 0,
QueryEntities = new[] { 
new QueryEntity(typeof(AffinityKey),
typeof(Trade))
}
}
}
};
}



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/


Re: How to do cache.get() on SQL table by primary key with multiple columns?

2020-07-15 Thread John Smith
Ok I will try it...

On Tue, 14 Jul 2020 at 22:34, Evgenii Zhuravlev 
wrote:

> John,
>
> It's not necessary to have class at all, you can specify any type, you
> just need to use this type when creating binary object for this key.
>
> вт, 14 июл. 2020 г. в 17:50, John Smith :
>
>> I just used two columns as primary key...
>>
>> Of I use key_type and specify a type does that class need to exist in the
>> class path of the server nodes?
>>
>> Like if I have
>>
>> class MyKeyClass {
>>Integer col1;
>>Integer col2;
>> }
>>
>> Does this class need to be loaded in all nodes or ignite can figure it
>> out and marshal it?
>>
>> On Tue., Jul. 14, 2020, 6:50 p.m. Evgenii Zhuravlev, <
>> e.zhuravlev...@gmail.com> wrote:
>>
>>> Hi John,
>>>
>>> To do this, you need to create a key object with the same type as you
>>> have for the table. If you don't specify KEY_TYPE in the create table
>>> script, it will be generated automatically. I would recommend to specify it
>>> for the command(just type name, if you don't have a class) and, when you
>>> need to get data using key-value API, just create a binary object of this
>>> type with these fields:
>>> https://www.gridgain.com/docs/latest/developers-guide/key-value-api/binary-objects#creating-and-modifying-binary-objects
>>>
>>> Evgenii
>>>
>>> вт, 14 июл. 2020 г. в 07:18, John Smith :
>>>
 Hi, I have an SQL table

 create table if not exists my_table (
 column1 int,
 column2 int,
 column3 varchar(16),
 PRIMARY KEY (column1, column2)
 ) with "template=replicatedTpl";

 and I'm creating my near cache as follows...

 IgniteCache myCache;

 NearCacheConfiguration nearConfig = new
 NearCacheConfiguration<>();
 nearConfig.setNearEvictionPolicyFactory(new
 LruEvictionPolicyFactory<>(1024));

 myCache =
 this.ignite.getOrCreateNearCache(SQL_PUBLIC_MY_TABLE, nearConfig)
 .withExpiryPolicy(new AccessedExpiryPolicy(new Duration(TimeUnit.HOURS,
 1)));

 So if I use myCache.get()...

 1- How do I specify the primary key if it's 2 columns?
 2- I assume the data will be put in near cache?







Re: Block until partition map exchange is complete

2020-07-15 Thread Ilya Kasnacheev
Hello!

I'm not actually sure. Do you have a reproducer where you see decreased
count() result? What is PartitionLossPolicy, have you tried tweaking it?

I can see a method in our tests for doing that, and it is very raw: it
checks every cache to make sure that all partitions are OWNING. This
is 
org.apache.ignite.testframework.junits.common.GridCommonAbstractTest#awaitPartitionMapExchange(boolean,
boolean, java.util.Collection,
boolean, java.util.Set)

Regards,
-- 
Ilya Kasnacheev


ср, 15 июл. 2020 г. в 12:03, ssansoy :

> By the way, just referring back to the original question - is there such a
> callback that can be used to wait for the partition exchange to complete,
> in
> any version of ignite? We are using ignite 2.7.6 (which I acknowledge is
> slightly behind - but we planning to upgrade)
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>


Re: How to get local node near cache metrics?

2020-07-15 Thread Ilya Kasnacheev
Hello!

The only thing I can think of is cache.metrics().getHeapEntriesCount()

Have you tried that?

Regards,
-- 
Ilya Kasnacheev


вт, 14 июл. 2020 г. в 05:12, John Smith :

> Hi I want to get how many entries are on the thick client's near cache. Is
> there a way?
>


Re: question about node segment and split brain

2020-07-15 Thread Ilya Kasnacheev
Hello!

1. if gc time > failureDetectionTimeout.
2. No, NODE_SEGMENTED is reserved for case where node is excluded from
cluster, alone, and not able to function as a single-node cluster
(explicitly removed from cluster).
3. I've never seen splitting into two clusters.
4. Perhaps, but see above.

Regards,
-- 
Ilya Kasnacheev


чт, 2 июл. 2020 г. в 13:45, bbweb :

> Hi,
>
>  we are considering ignite for mission critical system and concerning
> about node segmentation and split brain problem. I searched for current
> documents and suggestions but still have some questions in the following,
> please help and thanks in advance:
>
>
>
> 1、For long gc case , when a node has long gc and after gc is done, what's
> the heartbeat check and rejoin sequence for this node and when will this
> node be judged as segmented?
>
>
>
> 2、It seems sometimes EVT_NODE_SEGMENTED is reported from segmented node.
> When will  EVT_NODE_SEGMENTED event be fired and what's the further
> action?  SegmentationPolicy defines what happens when segmentation occurs.
> The default value is STOP。Does this mean that even no segmentation plugin
> is defined,  behavior can still be controlled(like stop or restart) using
> SegmentationPolicy  for EVT_NODE_SEGMENTED  ?
>
>
> 3、If there is network issue like switch outage which cause one cluster be
> splitted to 2 clusters,  will  node segmentation be reported and
> EVT_NODE_SEGMENTED event be fired?  Does this related to node number in the
> cluster, e.g if this is only one node isolated then this event is possible
> to be fired and if the splitted cluster has at least 2 nodes then no event
> will be fired and this two splitted cluster can both provide service which
> cause split brain? In out test, actually short time network outage can
> generate even one node cluster and this node can still provide service, no
> segmentation event is reported.
>
>
> 4、Can ZooKeeper resolve all this kind of issues including long GC or
> short-time network outage?
>
>
> 5、As ZooKeeper is for big cluster, for small cluster can plugin resolve
> all cases? I looked at some implentation including gridgain's paid verion,
> different plugins checks for node access, port access and shared first
> sytem but is seems it's difficult for some cases like GC as in this case
> the host is still reacheable but ignite node  is not reachable for
> sometime,  so what's the suggestions for plugin that can resolve all cases?
>
> Thanks!
>
>
>
>
>
> 
>
>
>
>


Re: Remote Filter Execution

2020-07-15 Thread Ilya Kasnacheev
Hello!

I have just checked this behavior on 2.8.1, and I don't see any of these
issues popping up. All 3 server nodes run remote listener (judging by log),
and after restarting of nodes I can still see updates on 'id1' appearing in
client npde's log.

I didn't check it on 2.7.6. Can you confirm or deny that it works on 2.8.1
for you? Are you sure that all nodes are in the baseline?

Regards,
-- 
Ilya Kasnacheev


ср, 15 июл. 2020 г. в 13:55, VeenaMithare :

> Hi Ilya,
>
> Please find the reproducer project with a readme.txt.
>
> I have put in comments on how to reproduce both the issues mentioned in my
> original mail.
>
> regards,
> Veena. RemoteFilterIssueProject.zip
> <
> http://apache-ignite-users.70518.x6.nabble.com/file/t2757/RemoteFilterIssueProject.zip>
>
> Readme.txt
> 
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>


Re: First 10 long running cache futures [total=1]

2020-07-15 Thread Ilya Kasnacheev
Hello!

The printed cache future contains some of this information, but it's hard
to decipher.

In this case, you are waiting for a node
1e36906c-fae5-49a3-b67a-9eed6ada7e4e. It will make sense to check its
thread dump.

Regards,
-- 
Ilya Kasnacheev


вт, 14 июл. 2020 г. в 05:59, marble.zh...@coinflex.com <
marble.zh...@coinflex.com>:

> thanks, are there any hints that can find/locate the operations that impact
> the server?
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>


Re: DataRegion sysMemPlc, TxLog

2020-07-15 Thread Ilya Kasnacheev
Hello!

sysMemPlc is used to hold ignite-sys-cache and TxLog to hold SQL MVCC
information. You may skip monitoring these.

Regards,
-- 
Ilya Kasnacheev


ср, 15 июл. 2020 г. в 09:02, kay :

> Hello
>
> We found sysMempPlc and Txlog DataRegion. What is each role?
> Do I have to monitoring thoes regions??
>
> Thank you so much
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>


Re: Remote Filter Execution

2020-07-15 Thread VeenaMithare
Hi Ilya,

Please find the reproducer project with a readme.txt. 

I have put in comments on how to reproduce both the issues mentioned in my
original mail.

regards,
Veena. RemoteFilterIssueProject.zip

  
Readme.txt
  



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/


Re: Block until partition map exchange is complete

2020-07-15 Thread ssansoy
By the way, just referring back to the original question - is there such a
callback that can be used to wait for the partition exchange to complete, in
any version of ignite? We are using ignite 2.7.6 (which I acknowledge is
slightly behind - but we planning to upgrade)




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/


Performance Issue with Enum Serialization in Ignite 2.8

2020-07-15 Thread zork
Hello,

I was doing some performance profiling of my ignite.NET client under load
and found that it was taking enormous time while serializing an enum field.
I'm using IBinarizable approach for serialization and my writeBinary method
looks like this:

public void WriteBinary(IBinaryWriter writer)
{
writer.WriteShort(nameof(decimalOffset), decimalOffset);
writer.WriteEnum(nameof(instrumentType), 
instrumentType);  //problematic
writer.WriteObject(nameof(marketKey), marketKey);
writer.WriteString(nameof(marketName), marketName);
writer.WriteEnum(nameof(marketType), marketType);   
//problematic
writer.WriteInt(nameof(priceFormat), priceFormat);
writer.WriteString(nameof(productCode), productCode);
writer.WriteString(nameof(productName), productName);
writer.WriteString(nameof(strategyTemplateName), 
strategyTemplateName);
writer.WriteDouble(nameof(tickSize), tickSize);
}

And my InstrumentType and MarketType enums looks like this:

[IgniteBinaryType] //Order of Enum values has to be identical to
order of Enum values in Java
public enum InstrumentType
{
Undefined,
Stock,
Option,
Future,
Bond,
Strategy,
DNTP,
Forex,
ForexFW,
Repo,
CFD,
TAPO,
CDS,
Swap,
Forward
}

public enum MarketType : byte
{
Undefined = 0,
Outright = 1,
Strategy = 2,
}

I'm also attaching a screenshot of the performance report clearly showing
that it takes around 7.5 secs and 1.3 secs  in 2 WriteEnum() methods while
under 30 miliseconds for the other fields (WriteInt(), WriteString() etc).

WriteEnum.jpg
  

Can someone please suggest what might be causing this and how to workaround
this?




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/


DataRegion sysMemPlc, TxLog

2020-07-15 Thread kay
Hello

We found sysMempPlc and Txlog DataRegion. What is each role? 
Do I have to monitoring thoes regions??

Thank you so much



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/