ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kamal C <kamaltar...@gmail.com>
Subject IgniteCache: How to receive Load Re-balance notifications?
Date Mon, 29 Feb 2016 09:00:13 GMT
Hi,

    I have a replicated ignite cache with 3 nodes. I want to listen for
data rebalance notifications in all the nodes whenever a new node joined /
left the cluster.

Using Ignite Events, I'd tried to register for cache re-balance
notifications. But, I'm unable to receive any notifications.

CacheConfiguration<String, Integer> cacheCfg = new
CacheConfiguration<>("cache_name");
cacheCfg.setCacheMode(CacheMode.REPLICATED);


IgniteCache<String, Boolean> cache = ignite.getOrCreateCache(cacheCfg);

ignite.events(ignite.cluster().forCacheNodes("cache_name")).localListen(
    new IgnitePredicate<CacheRebalanacingEvent>() {

    private static final long serialVersionUID = 1L;

                    @Override
                    public boolean apply(CacheRebalanacingEvent e)
                    {
                        if(e.cacheName.equals("cache_name")) {
                            logger.info("Received rebalancing Event : {}",
e);
                        }
                        return true;
                    }
                }, EventType.EVTS_CACHE_REBALANCE);




*In logs,* WARN [2016-02-29 13:01:31,661] [main] (Log4JLogger.java:480) -
Added listener for disabled event type: CACHE_REBALANCE_STARTED
 WARN [2016-02-29 13:01:31,662] [main] (Log4JLogger.java:480) - Added
listener for disabled event type: CACHE_REBALANCE_STOPPED
 WARN [2016-02-29 13:01:31,662] [main] (Log4JLogger.java:480) - Added
listener for disabled event type: CACHE_REBALANCE_PART_LOADED
 WARN [2016-02-29 13:01:31,662] [main] (Log4JLogger.java:480) - Added
listener for disabled event type: CACHE_REBALANCE_PART_UNLOADED
 WARN [2016-02-29 13:01:31,662] [main] (Log4JLogger.java:480) - Added
listener for disabled event type: CACHE_REBALANCE_OBJECT_LOADED
 WARN [2016-02-29 13:01:31,663] [main] (Log4JLogger.java:480) - Added
listener for disabled event type: CACHE_REBALANCE_OBJECT_UNLOADED
 WARN [2016-02-29 13:01:31,663] [main] (Log4JLogger.java:480) - Added
listener for disabled event type: CACHE_REBALANCE_PART_DATA_LOST


How to receive REBALANCE_STOPPED notification ?

--
Kamal

Mime
View raw message