ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Denis Magda <dma...@gridgain.com>
Subject Re: State of initially started cache with CacheRebalanceMode.SYNC ?
Date Mon, 13 Jun 2016 07:14:40 GMT
Hi Kristian,

This property means that a node that is being started and where a part of cache data is being
rebalanced won’t be considered for any cache related operations until the rebalancing has
finished.

In my understanding such a node won’t be considered for cache operations like put, get,
etc. until all the data is fully rebalanced on it. However this doesn’t prevent from getting
a cache reference on this node and ask for current cache size.

—
Denis

> On Jun 9, 2016, at 3:28 PM, Kristian Rosenvold <krosenvold@apache.org> wrote:
> 
> The javadoc on CacheRebalanceMode.SYNC seems to indicate that the
> cache should block until rebalancing is complete.
> When I run the code below, the assert statement fails unless I add the
> explicit call to cache.rebalance().get().
> 
> Am I doing something wrong ?
> 
> Kristian
> 
> 
> CacheConfiguration config = new CacheConfiguration();
> ....
> config.setCacheMode(CacheMode.REPLICATED);
> config.setRebalanceMode(CacheRebalanceMode.SYNC);
> final IgniteCache cache = ignite.getOrCreateCache(config);
> // cache.rebalance().get();
> assertThat(cache.localSize(CachePeekMode.ALL)).isEqualTo(knownRemoteSize);


Mime
View raw message