|
||||||||||
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.
Field Summary | |
---|---|
protected Serializer |
compressedValSerializer
|
protected Serializer |
keySerializer
|
protected Serializer |
uncompressedValSerializer
|
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,
int bufferSize,
short replication,
long blockSize,
Progressable progress,
SequenceFile.Metadata metadata)
Create the named file with write-progress reporter. |
|
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(Object key,
Object val)
Append a key/value pair. |
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 |
void |
syncFs()
flush all currently written data to the file system |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Serializer keySerializer
protected Serializer uncompressedValSerializer
protected Serializer compressedValSerializer
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
public SequenceFile.Writer(FileSystem fs, Configuration conf, Path name, Class keyClass, Class valClass, int bufferSize, short replication, long blockSize, 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 syncFs() throws IOException
IOException
public void close() throws IOException
close
in interface Closeable
IOException
public void append(Writable key, Writable val) throws IOException
IOException
public void append(Object key, Object 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 |