Path datasetPath = new Path(datasetStr);
Dataset dataset = Dataset.load(conf, datasetPath);
// currents[label] = next partition file where to place the tuple
int[] currents = new int[dataset.nblabels()];
// currents is initialized randomly in the range [0, numpartitions[
Random random = RandomUtils.getRandom();
for (int c = 0; c < currents.length; c++) {
currents[c] = random.nextInt(numPartitions);