public abstract class StreamWriterBase<T> extends Object implements Writer<T>
Writers
that write to a FSDataOutputStream
.Modifier | Constructor and Description |
---|---|
|
StreamWriterBase() |
protected |
StreamWriterBase(StreamWriterBase<T> other) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the
Writer . |
boolean |
equals(Object other) |
long |
flush()
Flushes out any internally held data, and returns the offset that the file
must be truncated to at recovery.
|
long |
getPos()
Retrieves the current position, and thus size, of the output file.
|
protected org.apache.hadoop.fs.FSDataOutputStream |
getStream()
Returns the current output stream, if the stream is open.
|
int |
hashCode() |
void |
open(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path)
Initializes the
Writer for a newly opened bucket file. |
void |
setSyncOnFlush(boolean syncOnFlush)
Controls whether to sync
FSDataOutputStream on flush. |
public StreamWriterBase()
protected StreamWriterBase(StreamWriterBase<T> other)
public void setSyncOnFlush(boolean syncOnFlush)
FSDataOutputStream
on flush.protected org.apache.hadoop.fs.FSDataOutputStream getStream()
public void open(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path) throws IOException
Writer
Writer
for a newly opened bucket file.
Any internal per-bucket initialization should be performed here.open
in interface Writer<T>
fs
- The FileSystem
containing the newly opened file.path
- The Path
of the newly opened file.IOException
public long flush() throws IOException
Writer
flush
in interface Writer<T>
IOException
public long getPos() throws IOException
Writer
getPos
in interface Writer<T>
IOException
public void close() throws IOException
Writer
Writer
. If the writer is already closed, no action will be
taken. The call should close all state related to the current output file,
including the output stream opened in open
.close
in interface Writer<T>
IOException
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.