## org.apache.mahout.cf.taste.hadoop
Class TasteHadoopUtils

    java.lang.Object
      org.apache.mahout.cf.taste.hadoop.TasteHadoopUtils

    public final class TasteHadoopUtils

extends java.lang.Object

Some helper methods for the hadoop-related stuff in org.apache.mahout.cf.taste

Field Summary
`static org.apache.hadoop.fs.PathFilter` `PARTS_FILTER` A path filter used to read files written by Hadoop.

Method Summary
`static int` `idToIndex(long id)` Maps a long to an int
`static int` `readIntFromFile(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path outputDir)` Reads a text-based outputfile that only contains an int
`static org.apache.mahout.math.map.OpenIntLongHashMap` `readItemIDIndexMap(java.lang.String itemIDIndexPathStr, org.apache.hadoop.conf.Configuration conf)` Reads a binary mapping file
`static java.lang.String[]` `splitPrefTokens(java.lang.CharSequence line)` Splits a preference data line into string tokens

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### PARTS_FILTER

    public static final org.apache.hadoop.fs.PathFilter PARTS_FILTER

  A path filter used to read files written by Hadoop.

Method Detail

### splitPrefTokens

    public static java.lang.String[] splitPrefTokens(java.lang.CharSequence line)

  Splits a preference data line into string tokens

### idToIndex

    public static int idToIndex(long id)

  Maps a long to an int

### readItemIDIndexMap

    public static org.apache.mahout.math.map.OpenIntLongHashMap readItemIDIndexMap(java.lang.String itemIDIndexPathStr,
                                                                                   org.apache.hadoop.conf.Configuration conf)

  Reads a binary mapping file

### readIntFromFile

    public static int readIntFromFile(org.apache.hadoop.conf.Configuration conf,
                                      org.apache.hadoop.fs.Path outputDir)
                               throws java.io.IOException

  Reads a text-based outputfile that only contains an int

  Throws:
    `java.io.IOException`

Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.