On Sat, Mar 19, 2011 at 2:52 PM, Ted Yu <[email protected]> wrote: > Hi, > I have a question about TestRegionRebalancing.assertRegionsAreBalanced() > I see hardcoded slop of 0.1 > In 0.90 and beyond, sloppiness is gone. > Therefore: > // TODO: Fix this test. Old balancer used to run with 'slop'. New > // balancer does not. > I want to get your opinion on how this test should be rewritten. >
Yes slop is gone. But that method still uses 'slop'. IIRC -- and the method javadoc agrees -- the new balancer should make it so we are +/- 1 either side of the 'average'. The 'slop' here is being used to do the +/- 1. You could change the method to do +/- 1 explicitly and clean up dead code (we set slop == 0.1 and then test for <= 0 which is unnecessary). Or just clean dead code and add comments about what 'slop' means in this context. St.Ack
