You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by vinshar <vi...@gmail.com> on 2016/01/09 17:32:53 UTC

Is CacheConfiguration specified at client node ignored in case if Cache already exists?

Hi,

What happens in case where i have a cache which is already exists on one of
the server nodes and i try to configure same cache at client node where
configurations at client node differs from configuration on server node used
to start the cache? 

For an example, Lets say in my server node's cache configuration i mentioned
a near cache configuration where as at client node i did not or vice versa?
or i specified a different cache mode in configuration on client node? Are
there some configurations which are ignored whereas some configuration which
are not? or will there be an exception thrown while getting cache at client
node?

Regards,
Vinay Sharma



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Is-CacheConfiguration-specified-at-client-node-ignored-in-case-if-Cache-already-exists-tp2461.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Is CacheConfiguration specified at client node ignored in case if Cache already exists?

Posted by vkulichenko <va...@gmail.com>.
Vinay,

Near cache on client is created separately using Ignite.createNearCache() or
Ignite.getOrCreateNearCache() method.

The configuration you're referring to creates near caches on server nodes
(next to the instances of distributed cache). This supports rare use case
when all data is accessed from server nodes and near cache is still needed.

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Is-CacheConfiguration-specified-at-client-node-ignored-in-case-if-Cache-already-exists-tp2461p2482.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Is CacheConfiguration specified at client node ignored in case if Cache already exists?

Posted by vinshar <vi...@gmail.com>.
Hi Val,

How about NearCacheConfiguration? Will that also be ignored as part of
CacheConfiguration? If it also get ignored then it means that client nodes
cannot have a near cache size as per their own requirement and will have to
stick with what was configured by the node which created cache.

Regards,
Vinay
On Jan 10, 2016 12:21 AM, "vkulichenko [via Apache Ignite Users]" <
ml-node+s70518n2476h12@n6.nabble.com> wrote:

> Vinay,
>
> Ignite.createCache() method will throw an exception if the cache already
> exists. But if you use Ignite.getOrCreateCache() method instead, it will be
> either created with the provided configuration, or you will get an already
> existing cache. In the latter case the configuration you provide will be
> ignored. There is also Ignite.cache() method that you can use when you're
> sure cache already exists. It accepts just a cache name instead of
> CacheConfiguration object.
>
> Makes sense?
>
> -Val
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://apache-ignite-users.70518.x6.nabble.com/Is-CacheConfiguration-specified-at-client-node-ignored-in-case-if-Cache-already-exists-tp2461p2476.html
> To unsubscribe from Is CacheConfiguration specified at client node ignored
> in case if Cache already exists?, click here
> <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2461&code=dmluc2hhcm1hLnRlY2hAZ21haWwuY29tfDI0NjF8ODIyNDgwNzMy>
> .
> NAML
> <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Is-CacheConfiguration-specified-at-client-node-ignored-in-case-if-Cache-already-exists-tp2461p2480.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Is CacheConfiguration specified at client node ignored in case if Cache already exists?

Posted by vkulichenko <va...@gmail.com>.
Vinay,

Ignite.createCache() method will throw an exception if the cache already
exists. But if you use Ignite.getOrCreateCache() method instead, it will be
either created with the provided configuration, or you will get an already
existing cache. In the latter case the configuration you provide will be
ignored. There is also Ignite.cache() method that you can use when you're
sure cache already exists. It accepts just a cache name instead of
CacheConfiguration object.

Makes sense?

-Val




--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Is-CacheConfiguration-specified-at-client-node-ignored-in-case-if-Cache-already-exists-tp2461p2476.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.