You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Rick Lee <ee...@gmail.com> on 2021/10/27 01:34:33 UTC

Add field on cached class without restarting the whole cluster

Dear all,

I'm currently on version 2.8 and use ignite.getOrCreateCache(cacheCfg) to
create a cache, e.g., cache Account object, etc, on startup. Now whenever I
want to add field to the Account class, I need to restart all nodes in the
cluster in order to make the change effective, but obviously it will
introduce service interruption. Any other way I can modify the class
structure by only rolling restart the nodes instead of restarting the whole
cluster?

Thanks & Regards,
Rick

Re: Add field on cached class without restarting the whole cluster

Posted by vt...@gmail.com.
Hi,

  

You can solve the problem as follows:

1) create your pojo at the client, where all the classes are present;

2) convert pojo to the BinaryObject on the client;

3) put binary object in the cache.

  

In such a way, you can add new fields whenever you want. However, if you want
to change the type of existing field, that will be still painfull  
  

Vladimir

6:53, 27 октября 2021 г., Surinder Mehra <re...@gmail.com>:  

> Peer class loading doesnt work on key and value objects of class as per
> ignite documentation
>
>  
>
>
> On Wed, Oct 27, 2021, 08:44 Ilya Kazakov
> <[kazakov.ilya@gmail.com](mailto:kazakov.ilya@gmail.com)> wrote:  
>
>

>> Hi Rick. Actually, if you do not need to use your POJO classes on the
server-side (e.g. for some compute tasks or in services) you can try just
enabling peerClassLoding and put a new object from your client without any
interruption. In this case, Ignite will serialize a new object and create in
the cluster metadata a new schema for your POJO-type. The best way is a
monotonic expansion of object fields set.

>>

>>  
>
>>

>> \------------------

>>

>> Ilya

>>

>>  
>
>>

>> ср, 27 окт. 2021 г. в 09:34, Rick Lee
<[eerick903@gmail.com](mailto:eerick903@gmail.com)>:  
>
>>

>>> Dear all,

>>>

>>>  
>
>>>

>>> I'm currently on version 2.8 and use ignite.getOrCreateCache(cacheCfg) to
create a cache, e.g., cache Account object, etc, on startup. Now whenever I
want to add field to the Account class, I need to restart all nodes in the
cluster in order to make the change effective, but obviously it will introduce
service interruption. Any other way I can modify the class structure by only
rolling restart the nodes instead of restarting the whole cluster?

>>>

>>>  
>
>>>

>>> Thanks & Regards,

>>>

>>> Rick

  
  
\--  
Отправлено из мобильного приложения Яндекс.Почты


Re: Add field on cached class without restarting the whole cluster

Posted by Surinder Mehra <re...@gmail.com>.
Peer class loading doesnt work on key and value objects of class as per
ignite documentation

On Wed, Oct 27, 2021, 08:44 Ilya Kazakov <ka...@gmail.com> wrote:

> Hi Rick. Actually, if you do not need to use your POJO classes on the
> server-side (e.g. for some compute tasks or in services) you can try just
> enabling peerClassLoding and put a new object from your client without any
> interruption. In this case, Ignite will serialize a new object and create
> in the cluster metadata a new schema for your POJO-type. The best way is a
> monotonic expansion of object fields set.
>
> ------------------
> Ilya
>
> ср, 27 окт. 2021 г. в 09:34, Rick Lee <ee...@gmail.com>:
>
>> Dear all,
>>
>> I'm currently on version 2.8 and use ignite.getOrCreateCache(cacheCfg) to
>> create a cache, e.g., cache Account object, etc, on startup. Now whenever I
>> want to add field to the Account class, I need to restart all nodes in the
>> cluster in order to make the change effective, but obviously it will
>> introduce service interruption. Any other way I can modify the class
>> structure by only rolling restart the nodes instead of restarting the whole
>> cluster?
>>
>> Thanks & Regards,
>> Rick
>>
>

Re: Add field on cached class without restarting the whole cluster

Posted by Ilya Kazakov <ka...@gmail.com>.
Hi Rick. Actually, if you do not need to use your POJO classes on the
server-side (e.g. for some compute tasks or in services) you can try just
enabling peerClassLoding and put a new object from your client without any
interruption. In this case, Ignite will serialize a new object and create
in the cluster metadata a new schema for your POJO-type. The best way is a
monotonic expansion of object fields set.

------------------
Ilya

ср, 27 окт. 2021 г. в 09:34, Rick Lee <ee...@gmail.com>:

> Dear all,
>
> I'm currently on version 2.8 and use ignite.getOrCreateCache(cacheCfg) to
> create a cache, e.g., cache Account object, etc, on startup. Now whenever I
> want to add field to the Account class, I need to restart all nodes in the
> cluster in order to make the change effective, but obviously it will
> introduce service interruption. Any other way I can modify the class
> structure by only rolling restart the nodes instead of restarting the whole
> cluster?
>
> Thanks & Regards,
> Rick
>