|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.io.SequenceFile.Writer
public static class SequenceFile.Writer
Write key/value pairs to a sequence-format file.
Constructor Summary | |
---|---|
SequenceFile.Writer(FileSystem fs,
Configuration conf,
Path name,
Class keyClass,
Class valClass)
Create the named file. |
|
SequenceFile.Writer(FileSystem fs,
Configuration conf,
Path name,
Class keyClass,
Class valClass,
Progressable progress,
SequenceFile.Metadata metadata)
Create the named file with write-progress reporter. |
Method Summary | |
---|---|
void |
append(Writable key,
Writable val)
Append a key/value pair. |
void |
appendRaw(byte[] keyData,
int keyOffset,
int keyLength,
SequenceFile.ValueBytes val)
|
void |
close()
Close the file. |
CompressionCodec |
getCompressionCodec()
Returns the compression codec of data in this file. |
Class |
getKeyClass()
Returns the class of keys in this file. |
long |
getLength()
Returns the current length of the output file. |
Class |
getValueClass()
Returns the class of values in this file. |
void |
sync()
create a sync point |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SequenceFile.Writer(FileSystem fs, Configuration conf, Path name, Class keyClass, Class valClass) throws IOException
IOException
public SequenceFile.Writer(FileSystem fs, Configuration conf, Path name, Class keyClass, Class valClass, Progressable progress, SequenceFile.Metadata metadata) throws IOException
IOException
Method Detail |
---|
public Class getKeyClass()
public Class getValueClass()
public CompressionCodec getCompressionCodec()
public void sync() throws IOException
IOException
public void close() throws IOException
IOException
public void append(Writable key, Writable val) throws IOException
IOException
public void appendRaw(byte[] keyData, int keyOffset, int keyLength, SequenceFile.ValueBytes val) throws IOException
IOException
public long getLength() throws IOException
This always returns a synchronized position. In other words,
immediately after calling SequenceFile.Reader.seek(long)
with a position
returned by this method, SequenceFile.Reader.next(Writable)
may be called. However
the key may be earlier in the file than key last written when this
method was called (e.g., with block-compression, it may be the first key
in the block that was being written when this method was called).
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |