public class FileRecordWriter extends Object implements RecordWriter
| Modifier and Type | Field and Description |
|---|---|
protected Configuration |
conf |
static Charset |
DEFAULT_CHARSET |
protected Charset |
encoding |
static String |
NEW_LINE |
protected DataOutputStream |
out |
static String |
PATH |
protected File |
writeTo |
APPEND| Constructor and Description |
|---|
FileRecordWriter() |
FileRecordWriter(Configuration conf)
Initialized based on configuration
Set the following attributes in the conf:
|
FileRecordWriter(File path) |
FileRecordWriter(File path,
boolean append) |
FileRecordWriter(File path,
boolean append,
Charset encoding) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the recod reader
|
Configuration |
getConf()
Return the configuration used by this object.
|
void |
setConf(Configuration conf)
Set the configuration to be used by this object.
|
void |
write(List<Writable> record)
Write a record
|
public static final Charset DEFAULT_CHARSET
protected File writeTo
protected DataOutputStream out
public static final String NEW_LINE
public static final String PATH
protected Charset encoding
protected Configuration conf
public FileRecordWriter()
public FileRecordWriter(File path) throws FileNotFoundException
FileNotFoundExceptionpublic FileRecordWriter(File path, boolean append) throws FileNotFoundException
FileNotFoundExceptionpublic FileRecordWriter(File path, boolean append, Charset encoding) throws FileNotFoundException
FileNotFoundExceptionpublic FileRecordWriter(Configuration conf) throws FileNotFoundException
conf - the configuration to useFileNotFoundExceptionpublic void write(List<Writable> record) throws IOException
RecordWriterwrite in interface RecordWriterrecord - the record to writeIOExceptionpublic void close()
RecordWriterclose in interface Closeableclose in interface AutoCloseableclose in interface RecordWriterpublic void setConf(Configuration conf)
ConfigurablesetConf in interface Configurablepublic Configuration getConf()
ConfigurablegetConf in interface ConfigurableCopyright © 2017. All rights reserved.