edu.umd.cloud9.io
Class SequenceFileUtils

java.lang.Object
  extended by edu.umd.cloud9.io.SequenceFileUtils

public class SequenceFileUtils
extends Object

Class containing a number of utility methods for manipulating SequenceFiles.


Method Summary
static
<K extends Writable,V extends Writable>
List<PairOfWritables<K,V>>
readDirectory(Path path)
           
static
<K extends Writable,V extends Writable>
List<PairOfWritables<K,V>>
readDirectory(Path path, FileSystem fs, int max)
          Reads key-value pairs from a directory containing SequenceFiles.
static
<K extends Writable,V extends Writable>
List<PairOfWritables<K,V>>
readFile(Path path)
           
static
<K extends Writable,V extends Writable>
List<PairOfWritables<K,V>>
readFile(Path path, FileSystem fs)
           
static
<K extends Writable,V extends Writable>
List<PairOfWritables<K,V>>
readFile(Path path, FileSystem fs, int max)
          Reads key-value pairs from a SequenceFile, up to a maximum number.
static
<K extends Writable,V extends Writable>
List<PairOfWritables<K,V>>
readFile(Path path, int max)
           
static
<K extends Writable,V extends Writable>
SortedMap<K,V>
readFileIntoMap(Path path)
           
static
<K extends Writable,V extends Writable>
SortedMap<K,V>
readFileIntoMap(Path path, FileSystem fs)
           
static
<K extends Writable,V extends Writable>
SortedMap<K,V>
readFileIntoMap(Path path, FileSystem fs, int max)
           
static
<K extends Writable,V extends Writable>
SortedMap<K,V>
readFileIntoMap(Path path, int max)
           
static
<K extends Writable>
List<K>
readKeys(Path path)
           
static
<K extends Writable>
List<K>
readKeys(Path path, FileSystem fs)
           
static
<K extends Writable>
List<K>
readKeys(Path path, FileSystem fs, int max)
           
static
<K extends Writable>
List<K>
readKeys(Path path, int max)
           
static
<V extends Writable>
List<V>
readValues(Path path)
           
static
<V extends Writable>
List<V>
readValues(Path path, FileSystem fs)
           
static
<V extends Writable>
List<V>
readValues(Path path, FileSystem fs, int max)
           
static
<V extends Writable>
List<V>
readValues(Path path, int max)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

readFile

public static <K extends Writable,V extends Writable> List<PairOfWritables<K,V>> readFile(Path path)

readFile

public static <K extends Writable,V extends Writable> List<PairOfWritables<K,V>> readFile(Path path,
                                                                                          int max)

readFile

public static <K extends Writable,V extends Writable> List<PairOfWritables<K,V>> readFile(Path path,
                                                                                          FileSystem fs)

readFile

public static <K extends Writable,V extends Writable> List<PairOfWritables<K,V>> readFile(Path path,
                                                                                          FileSystem fs,
                                                                                          int max)
Reads key-value pairs from a SequenceFile, up to a maximum number.

Parameters:
path - path to file
max - maximum of key-value pairs to read
Returns:
list of key-value pairs

readFileIntoMap

public static <K extends Writable,V extends Writable> SortedMap<K,V> readFileIntoMap(Path path)

readFileIntoMap

public static <K extends Writable,V extends Writable> SortedMap<K,V> readFileIntoMap(Path path,
                                                                                     int max)

readFileIntoMap

public static <K extends Writable,V extends Writable> SortedMap<K,V> readFileIntoMap(Path path,
                                                                                     FileSystem fs)

readFileIntoMap

public static <K extends Writable,V extends Writable> SortedMap<K,V> readFileIntoMap(Path path,
                                                                                     FileSystem fs,
                                                                                     int max)

readDirectory

public static <K extends Writable,V extends Writable> List<PairOfWritables<K,V>> readDirectory(Path path)

readDirectory

public static <K extends Writable,V extends Writable> List<PairOfWritables<K,V>> readDirectory(Path path,
                                                                                               FileSystem fs,
                                                                                               int max)
Reads key-value pairs from a directory containing SequenceFiles. A maximum number of key-value pairs is read from each SequenceFile.

Parameters:
path - path to directory
max - maximum of key-value pairs to read per file
Returns:
list of key-value pairs

readKeys

public static <K extends Writable> List<K> readKeys(Path path)

readKeys

public static <K extends Writable> List<K> readKeys(Path path,
                                                    int max)

readKeys

public static <K extends Writable> List<K> readKeys(Path path,
                                                    FileSystem fs)

readKeys

public static <K extends Writable> List<K> readKeys(Path path,
                                                    FileSystem fs,
                                                    int max)

readValues

public static <V extends Writable> List<V> readValues(Path path)

readValues

public static <V extends Writable> List<V> readValues(Path path,
                                                      int max)

readValues

public static <V extends Writable> List<V> readValues(Path path,
                                                      FileSystem fs)

readValues

public static <V extends Writable> List<V> readValues(Path path,
                                                      FileSystem fs,
                                                      int max)