All pastes #986332 Raw Edit

Untitled

public text v1 · immutable
·published 2008-04-15 18:54 UTC
rendered paste body
08/04/15 20:50:43 INFO mapred.JobClient: Task Id : task_200804150848_0005_m_000000_2, Status : FAILED
java.lang.AbstractMethodError: org.apache.mahout.clustering.hierarchial.HierarchialClusterDriver$LeafNodesMapper.map(Ljava/lang/Object;Ljava/lang/Object;Lorg/apache/hadoop/mapred/OutputCollector;Lorg/apache/hadoop/mapred/Reporter;)V
	at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:47)
	at org.apache.hadoop.mapred.MapTask.run(MapTask.java:219)
	at org.apache.hadoop.mapred.TaskTracker$Child.main(TaskTracker.java:2126)




  public static class LeafNodesMapper extends MapReduceBase
      implements Mapper</** leaf node pk */LongWritable, /** leaf node vector */DenseVectorWritable, /** distance to leaf node */DoubleWritable, /** leaf node pk */LongWritable> {

    private DistanceMeasure distanceMeasure;
    private Vector testInstance;

    public DistanceMeasure getDistanceMeasure() {
      return distanceMeasure;
    }

    public void setDistanceMeasure(DistanceMeasure distanceMeasure) {
      this.distanceMeasure = distanceMeasure;
    }

    public Vector getTestInstance() {
      return testInstance;
    }

    public void setTestInstance(Vector testInstance) {
      this.testInstance = testInstance;
    }

    public void configure(JobConf jobConf) {
      super.configure(jobConf);
      try {
        String distanceMeasureClassName = jobConf.get(LeafNodesMapper.class.getName() + ".distanceMeasureClass");
        if (distanceMeasureClassName != null) {
          this.distanceMeasure = (DistanceMeasure) Class.forName(distanceMeasureClassName).newInstance();
        }

        FileSystem fs = FileSystem.get(jobConf);
        DenseVectorWritable testInstance = new DenseVectorWritable();
        DataInputStream is = fs.open(new Path(jobConf.get(LeafNodesMapper.class.getName() + ".testInstanceFile")));
        testInstance.readFields(is);
        is.close();
        this.testInstance = testInstance.get();


      } catch (Exception e) {
        throw new RuntimeException(e);
      }


    }


    private DoubleWritable distanceToLeafNode = new DoubleWritable();

    /**
     * Maps the distance from the instance vector to the leaf node vector the the leaf node pk.
     *
     * @param leafNodePK
     * @param leafNodeVector
     * @param outputCollector
     * @param reporter
     * @throws java.io.IOException
     */
    public void map(LongWritable leafNodePK, DenseVectorWritable leafNodeVector, OutputCollector<DoubleWritable, LongWritable> outputCollector, Reporter reporter) throws IOException {
      distanceToLeafNode.set(distanceMeasure.distance(testInstance, leafNodeVector.get()));
      outputCollector.collect(distanceToLeafNode, leafNodePK);
    }
  }