mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o...@apache.org
Subject svn commit: r765193 - /lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/file/BooleanPrefUserFileDataModel.java
Date Wed, 15 Apr 2009 13:40:50 GMT
Author: otis
Date: Wed Apr 15 13:40:50 2009
New Revision: 765193

URL: http://svn.apache.org/viewvc?rev=765193&view=rev
Log:
- Remove Timer, TimerTask, file last mod date - on more automatic file reloading

Modified:
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/file/BooleanPrefUserFileDataModel.java

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/file/BooleanPrefUserFileDataModel.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/file/BooleanPrefUserFileDataModel.java?rev=765193&r1=765192&r2=765193&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/file/BooleanPrefUserFileDataModel.java
(original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/file/BooleanPrefUserFileDataModel.java
Wed Apr 15 13:40:50 2009
@@ -39,8 +39,6 @@
 import java.util.Collection;
 import java.util.List;
 import java.util.Map;
-import java.util.Timer;
-import java.util.TimerTask;
 import java.util.concurrent.locks.ReentrantLock;
 
 /**
@@ -50,11 +48,7 @@
 
   private static final Logger log = LoggerFactory.getLogger(BooleanPrefUserFileDataModel.class);
 
-  private static final Timer timer = new Timer(true);
-  private static final long RELOAD_CHECK_INTERVAL_MS = 60L * 1000L;
-
   private final File dataFile;
-  private long lastModified;
   private boolean loaded;
   private DataModel delegate;
   private final ReentrantLock reloadLock;
@@ -74,11 +68,7 @@
     log.info("Creating FileDataModel for file " + dataFile);
 
     this.dataFile = dataFile;
-    this.lastModified = dataFile.lastModified();
     this.reloadLock = new ReentrantLock();
-
-//    // Schedule next refresh
-//    timer.schedule(new RefreshTimerTask(), RELOAD_CHECK_INTERVAL_MS, RELOAD_CHECK_INTERVAL_MS);
   }
 
   protected void reload() {
@@ -237,20 +227,4 @@
   public String toString() {
     return "BooleanPrefUserFileDataModel[dataFile:" + dataFile + ']';
   }
-
-//  private final class RefreshTimerTask extends TimerTask {
-//
-//    @Override
-//    public void run() {
-//      if (loaded) {
-//        long newModified = dataFile.lastModified();
-//        if (newModified > lastModified) {
-//          log.debug("File has changed; reloading...");
-//          lastModified = newModified;
-//          reload();
-//        }
-//      }
-//    }
-//  }
-
-}
\ No newline at end of file
+}



Mime
View raw message