storeMapping should not been called when toLongID() is called
-------------------------------------------------------------

                 Key: MAHOUT-213
                 URL: https://issues.apache.org/jira/browse/MAHOUT-213
             Project: Mahout
          Issue Type: Improvement
          Components: Collaborative Filtering
    Affects Versions: 0.4
            Reporter: Jeff Zhang
             Fix For: 0.4


In the trunk, storeMapping is called always when toLongID() is called. In my 
opinion storeMapping should been called only in method initialize().
storeMapping will cost a lot when you use database to store the id mapping. I 
believe the code should like this:

{code}
  public void initialize(Iterable<String> stringIDs) throws TasteException {
    for (String stringID : stringIDs) {
      long longID = hash(stringID);
      storeMapping(longID, stringID);
    }
  }
{code}


-- 
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