Port from my terasort branch pulling in rxin's comments.