org.apache.mahout.utils.vectors.io
Class SequenceFileVectorWriter

java.lang.Object
  extended by org.apache.mahout.utils.vectors.io.SequenceFileVectorWriter
All Implemented Interfaces:
Closeable, VectorWriter

public class SequenceFileVectorWriter
extends Object
implements VectorWriter

Writes out Vectors to a SequenceFile. Closes the writer when done


Constructor Summary
SequenceFileVectorWriter(org.apache.hadoop.io.SequenceFile.Writer writer)
           
 
Method Summary
 void close()
           
 org.apache.hadoop.io.SequenceFile.Writer getWriter()
           
 long write(Iterable<Vector> iterable)
          Write all values in the Iterable to the output
 long write(Iterable<Vector> iterable, long maxDocs)
          Write the first maxDocs to the output.
 void write(Vector vector)
          Write out a vector
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SequenceFileVectorWriter

public SequenceFileVectorWriter(org.apache.hadoop.io.SequenceFile.Writer writer)
Method Detail

write

public long write(Iterable<Vector> iterable,
                  long maxDocs)
           throws IOException
Description copied from interface: VectorWriter
Write the first maxDocs to the output.

Specified by:
write in interface VectorWriter
Parameters:
iterable - The Iterable to loop over
maxDocs - the maximum number of docs to write
Returns:
The number of docs written
Throws:
IOException - if there was a problem writing

write

public void write(Vector vector)
           throws IOException
Description copied from interface: VectorWriter
Write out a vector

Specified by:
write in interface VectorWriter
Parameters:
vector - The Vector to write
Throws:
IOException

write

public long write(Iterable<Vector> iterable)
           throws IOException
Description copied from interface: VectorWriter
Write all values in the Iterable to the output

Specified by:
write in interface VectorWriter
Parameters:
iterable - The Iterable to loop over
Returns:
the number of docs written
Throws:
IOException - if there was a problem writing

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Throws:
IOException

getWriter

public org.apache.hadoop.io.SequenceFile.Writer getWriter()


Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.