CanopyClusterer clusterer = new CanopyClusterer(measure, t1, t2);
Collection<Canopy> clusters = new ArrayList<Canopy>();
Configuration conf = new Configuration();
FileSystem fs = FileSystem.get(canopies.toUri(), conf);
FileStatus[] status = fs.listStatus(canopies, new OutputLogFilter());
for (FileStatus s : status) {
SequenceFile.Reader reader = new SequenceFile.Reader(fs, s.getPath(), conf);
try {
Writable key = reader.getKeyClass().asSubclass(Writable.class).newInstance();
Canopy value = reader.getValueClass().asSubclass(Canopy.class).newInstance();
while (reader.next(key, value)) {
clusters.add(value);
value = reader.getValueClass().asSubclass(Canopy.class).newInstance();
}
} finally {
reader.close();
}
}
// iterate over all points, assigning each to the closest canopy and outputing that clustering
fs = FileSystem.get(points.toUri(), conf);
status = fs.listStatus(points, new OutputLogFilter());
Path outPath = new Path(output, DEFAULT_CLUSTERED_POINTS_DIRECTORY);
int part = 0;
for (FileStatus s : status) {
SequenceFile.Reader reader = new SequenceFile.Reader(fs, s.getPath(), conf);
SequenceFile.Writer writer = new SequenceFile.Writer(fs,