Hello, Denis.

Did you check my sample code?

And I have another question.
On testing with my sample code above, 
when a new node is joined, as I don't complete executing received event,
ignite does not finish rebalance.
For example,
If I put a line of code to sample test code which I attached before like
below, then ignite does not complete rebalancing(more exactly, getting
affinity returns old partition information) until the event listener thread
wakes up.

I expected the event listener thread is a separated behavior against
rebalance process.
So, I'm confused now.
Am I thinking in a wrong way?
I need some advice.


=====================================
        if (isClient != null && !isClient
                && cacheEvt.cacheName().equals(CACHE_NAME)
                && (cacheEvt.discoveryEventType() == EventType.EVT_NODE_JOINED
                        || cacheEvt.discoveryEventType() == 
EventType.EVT_NODE_LEFT 
                        || cacheEvt.discoveryEventType() == 
EventType.EVT_NODE_FAILED)) {
        
                //Rebalance has been finished?
                System.out.println("Rebalance stopped.");

                
/*  //Put thread sleep
                Thread.sleep(10000);*/


                Affinity aff = ignite.affinity(CACHE_NAME);
                int[] partitions = 
aff.primaryPartitions(ignite.cluster().localNode());
                System.out.println("Current partitions : " + 
Arrays.toString(partitions));

===================================

Sincerely,
Andrew





--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/How-do-I-know-the-cache-rebalance-is-finished-tp5219p5853.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Reply via email to