public class FileRecordWriter extends Object implements RecordWriter
| Modifier and Type | Field and Description |
|---|---|
protected Configuration |
conf |
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) |
| 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(Collection<Writable> record)
Write a record
|
protected File writeTo
protected DataOutputStream out
public static final String NEW_LINE
public static final String PATH
protected Configuration conf
public FileRecordWriter()
public FileRecordWriter(File path) throws FileNotFoundException
FileNotFoundExceptionpublic FileRecordWriter(File path, boolean append) throws FileNotFoundException
FileNotFoundExceptionpublic FileRecordWriter(Configuration conf) throws FileNotFoundException
conf - the configuration to useFileNotFoundExceptionpublic void write(Collection<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 © 2015. All rights reserved.