> Affinity is not affected by IgniteCompute. My mistake. > I get a hold of an IgniteCompute _before_ the Affinity is applied I'm not sure, what you are trying to say.
Correct me, if I'm wrong, but you are trying to choose a node to run a compute task on, depending on where a needed key is stored (just like affinityRun <https://apacheignite.readme.io/docs/affinity-collocation#section-collocating-compute-with-data> ). And at the same time you want to make sure, that the corresponding node is already initialized. And if a node, that you chose by affinity, is not ready yet, then there will be no suitable nodes. Another thing I don't understand is why you need a ComputeTask#map method. Why ClusterGroup-specific compute is not enough for you? Denis чт, 23 нояб. 2017 г. в 2:12, Chris Berry <[email protected]>: > 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 > beautifully!! > I can simply add my gating function there. > > I knew that Ignite most likely had some clever solution hiding in the > wings!! > > 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) -> > readyForLoadMonitor.isTakingLoad(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. > Cheers, > -- Chris > > > > > > -- > Sent from: http://apache-ignite-users.70518.x6.nabble.com/ >
