mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sro...@apache.org
Subject svn commit: r992740 - /mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/jdbc/AbstractJDBCDataModel.java
Date Sun, 05 Sep 2010 08:52:17 GMT
Author: srowen
Date: Sun Sep  5 08:52:17 2010
New Revision: 992740

URL: http://svn.apache.org/viewvc?rev=992740&view=rev
Log:
Oops, fixed old bug in export methods that would skip data in some cases.

Modified:
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/jdbc/AbstractJDBCDataModel.java

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/jdbc/AbstractJDBCDataModel.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/jdbc/AbstractJDBCDataModel.java?rev=992740&r1=992739&r2=992740&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/jdbc/AbstractJDBCDataModel.java
(original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/jdbc/AbstractJDBCDataModel.java
Sun Sep  5 08:52:17 2010
@@ -317,14 +317,11 @@ public abstract class AbstractJDBCDataMo
       List<Preference> currentPrefs = new ArrayList<Preference>();
       while (rs.next()) {
         long nextUserID = getLongColumn(rs, 1);
-        if ((currentUserID != null) && !currentUserID.equals(nextUserID)) {
-          if (!currentPrefs.isEmpty()) {
-            result.put(currentUserID, new GenericUserPreferenceArray(currentPrefs));
-            currentPrefs.clear();
-          }
-        } else {
-          currentPrefs.add(buildPreference(rs));
+        if ((currentUserID != null) && !currentUserID.equals(nextUserID) &&
!currentPrefs.isEmpty()) {
+          result.put(currentUserID, new GenericUserPreferenceArray(currentPrefs));
+          currentPrefs.clear();
         }
+        currentPrefs.add(buildPreference(rs));
         currentUserID = nextUserID;
       }
       if (!currentPrefs.isEmpty()) {
@@ -366,14 +363,11 @@ public abstract class AbstractJDBCDataMo
       FastIDSet currentItemIDs = new FastIDSet(2);
       while (rs.next()) {
         long nextUserID = getLongColumn(rs, 1);
-        if (currentUserIDSet && (currentUserID != nextUserID)) {
-          if (!currentItemIDs.isEmpty()) {
-            result.put(currentUserID, currentItemIDs);
-            currentItemIDs = new FastIDSet(2);
-          }
-        } else {
-          currentItemIDs.add(getLongColumn(rs, 2));
+        if (currentUserIDSet && (currentUserID != nextUserID) && !currentItemIDs.isEmpty())
{
+          result.put(currentUserID, currentItemIDs);
+          currentItemIDs = new FastIDSet(2);
         }
+        currentItemIDs.add(getLongColumn(rs, 2));
         currentUserID = nextUserID;
         currentUserIDSet = true;
       }



Mime
View raw message