Uploaded image for project: 'Mahout'
  1. Mahout
  2. MAHOUT-213

storeMapping should not been called when toLongID() is called

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.3
    • 0.3
    • None
    • None

    Description

      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:

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

      Attachments

        1. Mahout_213.patch
          0.8 kB
          Jeff Zhang

        Activity

          People

            srowen Sean R. Owen
            zjffdu Jeff Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: