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

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

public class SequenceFileVectorWriter
extends java.lang.Object
implements VectorWriter

Closes the writer when done


Constructor Summary
SequenceFileVectorWriter(org.apache.hadoop.io.SequenceFile.Writer writer)
           
 
Method Summary
 void close()
          Close any internally held resources.
 org.apache.hadoop.io.SequenceFile.Writer getWriter()
           
 long write(java.lang.Iterable<Vector> iterable)
          Write all values in the Iterable to the output
 long write(java.lang.Iterable<Vector> iterable, long maxDocs)
          Write the first maxDocs to the output.
 
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(java.lang.Iterable<Vector> iterable,
                  long maxDocs)
           throws java.io.IOException
Description copied from interface: VectorWriter
Write the first maxDocs to the output.

Specified by:
write in interface VectorWriter
maxDocs - the maximum number of docs to write
Returns:
The number of docs written
Throws:
java.io.IOException - if there was a problem writing

write

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

Specified by:
write in interface VectorWriter
Returns:
the number of docs written
Throws:
java.io.IOException - if there was a problem writing

close

public void close()
           throws java.io.IOException
Description copied from interface: VectorWriter
Close any internally held resources. If external Writers are passed in, the implementation should indicate whether it also closes them

Specified by:
close in interface VectorWriter
Throws:
java.io.IOException - if there was an issue closing the item

getWriter

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


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