if(fs.exists(new Path(randomPermFile))){
sLogger.info("Random permutations output path already exists!");
return randomPermFile;
}
SequenceFile.Writer writer = SequenceFile.createWriter(fs, job, new Path(randomPermFile), IntWritable.class, ArrayListOfIntsWritable.class);
Permutation p = new PermutationByBit(numBits);
for(int i=0;i<numOfPermutations;i++){
ArrayListOfIntsWritable perm = p.nextPermutation();
writer.append(new IntWritable(i), perm);
sLogger.debug(i +":"+perm);
}
writer.close();
sLogger.info("Random permutations written.");