| 限定符 | 构造器和说明 |
|---|---|
|
StreamWriterBase() |
protected |
StreamWriterBase(StreamWriterBase<T> other) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
Closes the
Writer. |
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.
|
boolean |
isSyncOnFlush() |
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
WriterWriter for a newly opened bucket file.
Any internal per-bucket initialization should be performed here.open 在接口中 Writer<T>fs - The FileSystem containing the newly opened file.path - The Path of the newly opened file.IOExceptionpublic long flush()
throws IOException
Writerflush 在接口中 Writer<T>IOExceptionpublic long getPos()
throws IOException
WritergetPos 在接口中 Writer<T>IOExceptionpublic void close()
throws IOException
WriterWriter. 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 在接口中 Writer<T>IOExceptionpublic boolean isSyncOnFlush()
Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.