ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Berry <chriswbe...@gmail.com>
Subject Re: ComputeTask is including Nodes for ComputeJobs prematurely
Date Wed, 22 Nov 2017 23:12:41 GMT
Hi Denis,

You are correct. Thank you!
Affinity is not affected by IgniteCompute. My mistake.
I get a hold of an IgniteCompute _before_ the Affinity is applied.

So. It seems that a “dynamic cluster group based on a predicate” will work
I can simply add my gating function there.

I knew that Ignite most likely had some clever solution hiding in the

These are my thoughts on implementing it.

1) Create a REPLICATED, ReadyForLoadCache
As Nodes become “ready for load”, write a new row to the ReadyForLoadCache. 
I.e. write  a Key=NodeId  Value=”true” row 

2) Use a Continuous Query that watches the ReadyForLoadCache.
It will use a SQL Query to collect all rows that are “true”
The results will be stored locally in a Set<NodeId> nodesReadyForLoad;

3) In the ComputeTask::map() method, use;

   ClusterGroup readyNodes = cluster.forPredicate((node) ->
   IgniteCompute c = ignite.compute(readyNodes);

where isTakingLoad(node) will simply check the Set<NodeId> nodesReadyForLoad

4) I still need to handle Nodes coming & going with some sort of “outside
monitor”, that will monitor when Nodes leave the Grid. And thus, can remove
the row from the ReadyForLoadCache (or make it "false")
This will lilely just listen to Grid Events.

Any comments??

FWIW, I do not think synchronization can work for me.
This is very high volume, low latency app.
And honestly, I dont really see how I'd implement it 

Thanks again for all of your help.
-- Chris

Sent from: http://apache-ignite-users.70518.x6.nabble.com/

View raw message