Excellent discovery, thanks Michael! I would suggest doing the following. If we see that a number of partitions is a power of two then the new algorithm will be applied, otherwise the warning will be printed out and the *old* one approach will be used. Does this resolver all the concerns?
Michael, could you complete the contribution performing all the required changes? I think we should squeeze the update into AI 2.0 where it’s safe to break the compatibility. Before merging the changes we can ask Ilya to run a set of benchmarks to confirm that there is no performance hit. — Denis > On Mar 15, 2017, at 12:31 PM, Dmitriy Setrakyan <dsetrak...@apache.org> wrote: > > On Wed, Mar 15, 2017 at 9:51 AM, Michael Griggs <michael.gri...@gridgain.com >> wrote: > >> Have we ever heard of somebody needing to set the partition count to a >> non-power-of-two number? Perhaps we could restrict the method so that it >> will only accept a power of two as the partition count? >> > > As Valentin suggested, we should not restrict it, but should print out a > warning.