Do this after the loop - just set pkPos to 0 if we're using salting. The reason is that if we have a fully qualified key at the end of the loop (scanRanges.isSingleRowScan()), then we can just calculate the salt byte here. Otherwise, we can do as you've done here. I think we don't need to generate all the point ranges too. I think it'll be the same if we just have a range from [0,numSaltBuckets). What do you think? Will it still be split in a good way?