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 1

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

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

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 t

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 sup

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

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

2020-07-14 Thread Evgenii Zhuravlev
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

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

2020-07-14 Thread 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 an

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

2020-07-14 Thread Evgenii Zhuravlev
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

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

2020-07-14 Thread 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 NearCacheConfigu