Example usage for org.apache.mahout.common.iterator.sequencefile SequenceFileDirValueIterator SequenceFileDirValueIterator

List of usage examples for org.apache.mahout.common.iterator.sequencefile SequenceFileDirValueIterator SequenceFileDirValueIterator

Introduction

In this page you can find the example usage for org.apache.mahout.common.iterator.sequencefile SequenceFileDirValueIterator SequenceFileDirValueIterator.

Prototype

public SequenceFileDirValueIterator(Path path, PathType pathType, PathFilter filter,
        Comparator<FileStatus> ordering, boolean reuseKeyValueInstances, Configuration conf)
        throws IOException 

Source Link

Document

Constructor that uses either FileSystem#listStatus(Path) or FileSystem#globStatus(Path) to obtain list of files to iterate over (depending on pathType parameter).

Usage

From source file:org.gpfvic.mahout.cf.taste.hadoop.als.ALS.java

License:Apache License

static Vector readFirstRow(Path dir, Configuration conf) throws IOException {
    Iterator<VectorWritable> iterator = new SequenceFileDirValueIterator<>(dir, PathType.LIST,
            PathFilters.partFilter(), null, true, conf);
    return iterator.hasNext() ? iterator.next().get() : null;
}