hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r1567065 - /hama/trunk/ml/src/main/java/org/apache/hama/ml/recommendation/cf/OnlineCF.java
Date Tue, 11 Feb 2014 11:43:16 GMT
Author: edwardyoon
Date: Tue Feb 11 11:43:15 2014
New Revision: 1567065

URL: http://svn.apache.org/r1567065
Log:
Add line "reader.close();"

Modified:
    hama/trunk/ml/src/main/java/org/apache/hama/ml/recommendation/cf/OnlineCF.java

Modified: hama/trunk/ml/src/main/java/org/apache/hama/ml/recommendation/cf/OnlineCF.java
URL: http://svn.apache.org/viewvc/hama/trunk/ml/src/main/java/org/apache/hama/ml/recommendation/cf/OnlineCF.java?rev=1567065&r1=1567064&r2=1567065&view=diff
==============================================================================
--- hama/trunk/ml/src/main/java/org/apache/hama/ml/recommendation/cf/OnlineCF.java (original)
+++ hama/trunk/ml/src/main/java/org/apache/hama/ml/recommendation/cf/OnlineCF.java Tue Feb
11 11:43:15 2014
@@ -25,6 +25,7 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Map.Entry;
 import java.util.PriorityQueue;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.commons.math3.util.Pair;
@@ -356,12 +357,12 @@ public class OnlineCF implements Recomme
               continue;
             }
           }
+          reader.close();
         }
         LOG.info("loaded: " + modelUserFactorizedValues.size() + " users, "
                         + modelUserFeatures.size() + " user features, "
                         + modelItemFactorizedValues.size() + " items, "
                         + modelItemFeatures.size() + " item feature values");
-
       } catch (Exception e) {
         e.printStackTrace();
         this.isLazyLoadModel = false;
@@ -458,7 +459,6 @@ public class OnlineCF implements Recomme
     return results;
   }
 
-  @SuppressWarnings("deprecation")
   @Override
   public double calculateUserSimilarity(long user1, long user2) {
     VectorWritable usr1 = this.modelUserFactorizedValues.get(Long.valueOf(user1));
@@ -499,7 +499,6 @@ public class OnlineCF implements Recomme
     return results;
   }
 
-  @SuppressWarnings("deprecation")
   @Override
   public double calculateItemSimilarity(long item1, long item2) {
     VectorWritable itm1 = this.modelUserFactorizedValues.get(Long.valueOf(item1));



Mime
View raw message