Dear All, I can not find sample code for how customise partition... and I
could almost finish it by myself.

however, the most wired thing is it work occasionally !!?? most of time it
doesn't work....

my code is:[
public class UCSRendezvousAffinityFunction extends
        public int partitions()
                return 2; //only test 2 partitions :-)

        public int partition(final Object key)
                return xxx % 2;

        //this API is...correct??
         public List<List&lt;ClusterNode>> assignPartitions(final
AffinityFunctionContext affCtx)

                final List<List&lt;ClusterNode>> assignments = new

                final boolean exclNeighbors = false;

                final Map<UUID, Collection&lt;ClusterNode>> neighborhoodCache =
GridCacheUtils.neighbors(affCtx.currentTopologySnapshot()) : null;

                for (int i = 0; i < partitions(); i++)
                        final List<ClusterNode> partAssignment = 
affCtx.currentTopologySnapshot(), affCtx.backups(),


                return assignments;




So as I said... it works from time to time....why.....

and could you show me if my API of "assignPartitions()" is right or maybe do
me a favour what is your code? thanks a lot.

View this message in context:
Sent from the Apache Ignite Users mailing list archive at

Reply via email to