Hi Val,
the reason is that "assignPartitions()" returns same
"List<List<ClusterNode>>" usually even I start two ignite nodes.
last Friday, I refactor it as below:[
@Override
public List<List<ClusterNode>> assignPartitions(final
AffinityFunctionContext affCtx)
{
final List<ClusterNode> nodes =
affCtx.currentTopologySnapshot();
int tmpi = 0;
final List<List<ClusterNode>> assignments = new
ArrayList<>(2);
for (int i = 0; i < 2; i++)
{
final List<ClusterNode> partAssignment = new
ArrayList<ClusterNode>();
partAssignment.add(nodes.get(tmpi));
if (tmpi < nodes.size() - 1)
{
tmpi++;
}
assignments.add(partAssignment);
}
return assignments;
}
]
and it return result like:
list[0] -> node1;
list[1] -> node2.
it is what I want.
I don't think the original "assignPartitions()" has bug. (there are lots
of people use it without error, right?)
but why "assignPartitions()" returns to me the same node# List ?
--
View this message in context:
http://apache-ignite-users.70518.x6.nabble.com/sample-code-for-customised-Partition-logic-tp8270p8317.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.