You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mahout.apache.org by sr...@apache.org on 2010/03/31 13:09:55 UTC

svn commit: r929477 - /lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/MapFilesMap.java

Author: srowen
Date: Wed Mar 31 11:09:55 2010
New Revision: 929477

URL: http://svn.apache.org/viewvc?rev=929477&view=rev
Log:
Add possibly helpful log statements

Modified:
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/MapFilesMap.java

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/MapFilesMap.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/MapFilesMap.java?rev=929477&r1=929476&r2=929477&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/MapFilesMap.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/MapFilesMap.java Wed Mar 31 11:09:55 2010
@@ -30,6 +30,8 @@ import org.apache.hadoop.fs.PathFilter;
 import org.apache.hadoop.io.MapFile;
 import org.apache.hadoop.io.Writable;
 import org.apache.hadoop.io.WritableComparable;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Represents a series of {@link MapFile}s, from which one might want to look up values based on keys. It just
@@ -37,6 +39,8 @@ import org.apache.hadoop.io.WritableComp
  */
 @SuppressWarnings("unchecked")
 public final class MapFilesMap<K extends WritableComparable,V extends Writable> implements Closeable {
+
+  private static final Logger log = LoggerFactory.getLogger(MapFilesMap.class);
   
   private static final PathFilter PARTS_FILTER = new PathFilter() {
     @Override
@@ -48,10 +52,13 @@ public final class MapFilesMap<K extends
   private final List<MapFile.Reader> readers;
   
   public MapFilesMap(FileSystem fs, Path parentDir, Configuration conf) throws IOException {
+    log.info("Creating MapFileMap from parent directory {}", parentDir);
     readers = new ArrayList<MapFile.Reader>();
     try {
       for (FileStatus status : fs.listStatus(parentDir, PARTS_FILTER)) {
-        readers.add(new MapFile.Reader(fs, status.getPath().toString(), conf));
+        String path = status.getPath().toString();
+        log.info("Adding MapFile.Reader at {}", path);
+        readers.add(new MapFile.Reader(fs, path, conf));
       }
     } catch (IOException ioe) {
       close();
@@ -71,6 +78,7 @@ public final class MapFilesMap<K extends
         return value;
       }
     }
+    log.debug("No value for key {}", key);
     return null;
   }