[ 
https://issues.apache.org/jira/browse/MAHOUT-137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12722663#action_12722663
 ] 

Jeff Eastman commented on MAHOUT-137:
-------------------------------------

Here's some code (which depends upon the AbstractVector methods becoming 
public) which encodes the class name in addition to the elements and is 
vector-type agnostic.

{noformat}
  public void readFields(DataInput in) throws IOException {
    this.canopyId = in.readInt();
    this.center = AbstractVector.readVector(in);
  }

  @Override
  public void write(DataOutput out) throws IOException {
    out.writeInt(canopyId);
    AbstractVector.writeVector(out, computeCentroid());
{noformat}

> Convert Clustering Algs to use Vector Writable
> ----------------------------------------------
>
>                 Key: MAHOUT-137
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-137
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Grant Ingersoll
>             Fix For: 0.2
>
>         Attachments: MAHOUT-137.patch, MAHOUT-137.patch, MAHOUT-137.patch
>
>
> All M/R jobs should use Vector writable instead of encoding and decoding 
> strings.  We can have a separate utility that converts serialized GSON, 
> Strings, whatever into the appropriate vectors.  See MAHOUT-136 and 
> http://www.lucidimagination.com/search/document/6a55f260826fd77f/jira_commented_mahout_136_change_canopy_mr_implementation_to_use_vector_writable

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to