public class TextOutputWriter extends FileOutputWriter<java.lang.String>
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
fieldDelimiter |
protected static java.lang.String |
lineDelimiter |
protected static java.lang.String |
tabDelimiter |
fs, openStreams, outPath, pw, writeMode
Constructor and Description |
---|
TextOutputWriter(FileSystem.WriteMode writeMode,
Path outPath) |
TextOutputWriter(FileSystem.WriteMode writeMode,
Path outPath,
Config cfg) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the writer, flush everything
|
void |
createOutput() |
void |
createOutput(int partition,
FSDataOutputStream out)
Create a suitable output
|
void |
setHeaders(java.lang.String[] headerNames) |
void |
writeRecord(int partition,
java.lang.String data)
Write the record to output
|
void |
writeRecord(java.lang.String data) |
configure, generateRandom, getWriteMode, setWriteMode, write, write
protected static java.lang.String lineDelimiter
protected static java.lang.String fieldDelimiter
protected static java.lang.String tabDelimiter
public TextOutputWriter(FileSystem.WriteMode writeMode, Path outPath)
public TextOutputWriter(FileSystem.WriteMode writeMode, Path outPath, Config cfg)
public void createOutput(int partition, FSDataOutputStream out)
FileOutputWriter
createOutput
in class FileOutputWriter<java.lang.String>
partition
- partition idout
- the out streampublic void writeRecord(int partition, java.lang.String data)
FileOutputWriter
writeRecord
in class FileOutputWriter<java.lang.String>
partition
- partition iddata
- datapublic void setHeaders(java.lang.String[] headerNames)
public void createOutput()
public void writeRecord(java.lang.String data)
writeRecord
in class FileOutputWriter<java.lang.String>
public void close()
OutputWriter
close
in interface OutputWriter<java.lang.String>
close
in class FileOutputWriter<java.lang.String>