org.apache.mahout.clustering.canopy
Class ClusterMapper
java.lang.Object
org.apache.hadoop.mapred.MapReduceBase
org.apache.mahout.clustering.canopy.ClusterMapper
- All Implemented Interfaces:
- java.io.Closeable, org.apache.hadoop.mapred.JobConfigurable, org.apache.hadoop.mapred.Mapper<org.apache.hadoop.io.WritableComparable<?>,VectorWritable,org.apache.hadoop.io.Text,VectorWritable>
public class ClusterMapper
- extends org.apache.hadoop.mapred.MapReduceBase
- implements org.apache.hadoop.mapred.Mapper<org.apache.hadoop.io.WritableComparable<?>,VectorWritable,org.apache.hadoop.io.Text,VectorWritable>
Method Summary |
boolean |
canopyCovers(Canopy canopy,
Vector point)
|
void |
config(java.util.List<Canopy> canopies)
Configure the mapper by providing its canopies. |
void |
configure(org.apache.hadoop.mapred.JobConf job)
|
void |
map(org.apache.hadoop.io.WritableComparable<?> key,
VectorWritable point,
org.apache.hadoop.mapred.OutputCollector<org.apache.hadoop.io.Text,VectorWritable> output,
org.apache.hadoop.mapred.Reporter reporter)
|
Methods inherited from class org.apache.hadoop.mapred.MapReduceBase |
close |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.io.Closeable |
close |
ClusterMapper
public ClusterMapper()
map
public void map(org.apache.hadoop.io.WritableComparable<?> key,
VectorWritable point,
org.apache.hadoop.mapred.OutputCollector<org.apache.hadoop.io.Text,VectorWritable> output,
org.apache.hadoop.mapred.Reporter reporter)
throws java.io.IOException
- Specified by:
map
in interface org.apache.hadoop.mapred.Mapper<org.apache.hadoop.io.WritableComparable<?>,VectorWritable,org.apache.hadoop.io.Text,VectorWritable>
- Throws:
java.io.IOException
config
public void config(java.util.List<Canopy> canopies)
- Configure the mapper by providing its canopies. Used by unit tests.
- Parameters:
canopies
- a List
configure
public void configure(org.apache.hadoop.mapred.JobConf job)
- Specified by:
configure
in interface org.apache.hadoop.mapred.JobConfigurable
- Overrides:
configure
in class org.apache.hadoop.mapred.MapReduceBase
canopyCovers
public boolean canopyCovers(Canopy canopy,
Vector point)
Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.