public class DelimitedTextFileWriter extends java.lang.Object implements DataStoreWriter<java.util.List<java.lang.String>>
DelimitedTextFileWriter
is a DataStoreWriter
implementation
able to write String
s into raw hdfs files as delimited fields.Modifier and Type | Field and Description |
---|---|
static byte[] |
CSV
CSV Mode
|
static byte[] |
TAB
TAB Mode
|
Constructor and Description |
---|
DelimitedTextFileWriter(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.fs.Path basePath,
CodecInfo codec)
Instantiates a new delimited text file writer.
|
DelimitedTextFileWriter(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.fs.Path basePath,
CodecInfo codec,
byte[] fieldDelimiter)
Instantiates a new delimited text file writer.
|
DelimitedTextFileWriter(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.fs.Path basePath,
CodecInfo codec,
byte[] fieldDelimiter,
byte[] textDelimiter)
Instantiates a new delimited text file writer.
|
public static final byte[] CSV
public static final byte[] TAB
public DelimitedTextFileWriter(org.apache.hadoop.conf.Configuration configuration, org.apache.hadoop.fs.Path basePath, CodecInfo codec)
configuration
- the configurationbasePath
- the base pathcodec
- the codecpublic DelimitedTextFileWriter(org.apache.hadoop.conf.Configuration configuration, org.apache.hadoop.fs.Path basePath, CodecInfo codec, byte[] fieldDelimiter)
configuration
- the configurationbasePath
- the base pathcodec
- the codecfieldDelimiter
- the field delimiterpublic DelimitedTextFileWriter(org.apache.hadoop.conf.Configuration configuration, org.apache.hadoop.fs.Path basePath, CodecInfo codec, byte[] fieldDelimiter, byte[] textDelimiter)
configuration
- the configurationbasePath
- the base pathcodec
- the codecfieldDelimiter
- the field delimitertextDelimiter
- the text delimiterpublic void write(java.util.List<java.lang.String> entity) throws java.io.IOException
DataWriter
write
in interface DataWriter<java.util.List<java.lang.String>>
entity
- the entity to writejava.io.IOException
- if an I/O error occurspublic void flush() throws java.io.IOException
flush
in interface java.io.Flushable
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException