Fix hash partitioning for new java api