Re: Can we set TTL (expiry time) of a key-value from thin client?

2020-05-19 Thread Pavel Tupitsyn
> you could specify the expiration policy on the actual "Put" call itself That is true on the protocol level. User-facing API has WithExpiryPolicy so we don't have to add an additional overload for every cache operation. On Tue, May 19, 2020 at 5:00 PM Marty Jones wrote: > Pavel, > > My bad, I m

Re: Can we set TTL (expiry time) of a key-value from thin client?

2020-05-19 Thread Marty Jones
Pavel, My bad, I misunderstood the question. The code I am using works fine. I thought the previous discussion was stating that you could specify the expiration policy on the actual "Put" call itself. On Tue, May 19, 2020 at 8:53 AM Pavel Tupitsyn wrote: > Marty, can you please elaborate? > W

Re: Can we set TTL (expiry time) of a key-value from thin client?

2020-05-19 Thread Pavel Tupitsyn
Marty, can you please elaborate? We are talking about protocol-level details in this thread. Your code for .NET Thin Client seems to be fine, does it work as expected? On Tue, May 19, 2020 at 4:39 PM Marty Jones wrote: > I am not seeing that option in the ASP.NET thin client. This is how I > a

Re: Can we set TTL (expiry time) of a key-value from thin client?

2020-05-19 Thread Marty Jones
I am not seeing that option in the ASP.NET thin client. This is how I accomplished setting an expiration policy: ICacheClient cache = igniteClient.GetCache("testCache"); cache.WithExpiryPolicy(new ExpiryPolicy(TimeSpan.FromSeconds(15), null, null)) .Put("test1", new CacheItemEntry() {

Re: Can we set TTL (expiry time) of a key-value from thin client?

2020-05-19 Thread Pavel Tupitsyn
> if there is support for setting expire times for multiple key-values > while doing a OP_CACHE_PUT_ALL The answer is yes. All key-val operations support expiration, namely: OP_CACHE_PUT OP_CACHE_PUT_IF_ABSENT OP_CACHE_PUT_ALL OP_CACHE_GET_AND_PUT OP_CACHE_GET_AND_REPLACE OP_CACHE_GET_AND_PUT_IF_A

Re: Can we set TTL (expiry time) of a key-value from thin client?

2020-05-19 Thread scriptnull
Awesome, that's exactly the information that I needed. So we will have to set the flag byte while doing OP_CACHE_PUT. Do you know by any chance if there is support for setting expire times for multiple key-values while doing a OP_CACHE_PUT_ALL (opcode: 1004) operation? I am guessing the answer is

Re: Can we set TTL (expiry time) of a key-value from thin client?

2020-05-19 Thread Pavel Tupitsyn
Hi, Yes, every cache request has Flags byte right after cacheId. There is FLAG_WITH_EXPIRY_POLICY = 0x04. When this flag is set, server expects 3 long values (3x8 bytes) after flags byte, representing TTL for Create, Update, and Access, in milliseconds For example, if we want to store a cache ent

Re: Can we set TTL (expiry time) of a key-value from thin client?

2020-05-19 Thread scriptnull
Hi, I am referring to any of the thin clients (java/.net/c++/node.js/python/php) documented at https://apacheignite.readme.io/docs/thin-clients I wonder if any of those thin clients have an API to set TTL for a key-value in a cache. If so I can reverse engineer the implementation of it and implem

Re: Can we set TTL (expiry time) of a key-value from thin client?

2020-05-19 Thread Igor Sapego
Which thin client are you referring to? Best Regards, Igor On Mon, May 18, 2020 at 5:09 PM scriptnull wrote: > I would like to break down this question into two questions. > > 1. Can we have key-values with different expire times in the same cache? (I > think the answer for this is yes, becaus

Can we set TTL (expiry time) of a key-value from thin client?

2020-05-18 Thread scriptnull
I would like to break down this question into two questions. 1. Can we have key-values with different expire times in the same cache? (I think the answer for this is yes, because the redis layer in ignite allows for this) 2. I am trying to build a ruby thin client for Apache Ignite and got a basi