T
- The type of the elements that are being written by the sink.@Deprecated public class StringWriter<T> extends StreamWriterBase<T>
Writer
that uses toString()
on the input elements and writes them to
the output bucket file separated by newline.Modifier | Constructor and Description |
---|---|
|
StringWriter()
Deprecated.
Creates a new
StringWriter that uses "UTF-8" charset to convert
strings to bytes. |
|
StringWriter(String charsetName)
Deprecated.
Creates a new
StringWriter that uses the given charset to convert
strings to bytes. |
|
StringWriter(String charsetName,
String rowDelimiter)
Deprecated.
Creates a new
StringWriter that uses the given charset and row delimiter to convert
strings to bytes. |
protected |
StringWriter(StringWriter<T> other)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
StringWriter<T> |
duplicate()
Deprecated.
Duplicates the
Writer . |
String |
getRowDelimiter()
Deprecated.
|
void |
open(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path)
Deprecated.
Initializes the
Writer for a newly opened bucket file. |
void |
write(T element)
Deprecated.
Writes one element to the bucket file.
|
close, flush, getPos, getStream, isSyncOnFlush, setSyncOnFlush
public StringWriter()
StringWriter
that uses "UTF-8"
charset to convert
strings to bytes.public StringWriter(String charsetName)
StringWriter
that uses the given charset to convert
strings to bytes.charsetName
- Name of the charset to be used, must be valid input for Charset.forName(charsetName)
public StringWriter(String charsetName, String rowDelimiter)
StringWriter
that uses the given charset and row delimiter to convert
strings to bytes.charsetName
- Name of the charset to be used, must be valid input for Charset.forName(charsetName)
rowDelimiter
- Parameter that specifies which character to use for delimiting rowsprotected StringWriter(StringWriter<T> other)
public void open(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path) throws IOException
Writer
Writer
for a newly opened bucket file.
Any internal per-bucket initialization should be performed here.open
in interface Writer<T>
open
in class StreamWriterBase<T>
fs
- The FileSystem
containing the newly opened file.path
- The Path
of the newly opened file.IOException
public void write(T element) throws IOException
Writer
IOException
public StringWriter<T> duplicate()
Writer
Writer
. This is used to get one Writer
for each
parallel instance of the sink.public String getRowDelimiter()
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.