/** run through all clusters once and set sequence of IDs */
int clusterCount = 0;
for (ClusterWritable clusterWritable :
new SequenceFileValueIterable<ClusterWritable>(new Path(output, "part-randomSeed"), true, conf)) {
Cluster cluster = clusterWritable.getValue();
clusterIDSeq[clusterCount] = cluster.getId();
clusterCount++;
}
/* Rebuild cluster and run through again making sure all IDs are in the same random sequence
* Needs a better test because in this case passes when seeded with 1 and 2 fails with 1, 3
* passes when set to two */
RandomSeedGenerator.buildRandom(conf, input, output, 4, new ManhattanDistanceMeasure(), randSeed); clusterCount = 0;
for (ClusterWritable clusterWritable :
new SequenceFileValueIterable<ClusterWritable>(new Path(output, "part-randomSeed"), true, conf)) {
Cluster cluster = clusterWritable.getValue();
// Make sure cluster ids are in same random sequence
assertEquals(clusterIDSeq[clusterCount], cluster.getId());
clusterCount++;
}
}