O - type of values accepted by this outputR - type of result returned by the underlying outputpublic class StringOutput<O,R> extends Output<O,R>
Object.toString() (or an arbitrary
other String-valued Function that is Serializable) on them,
adds an optional terminator, encodes the resulting String according to a
Charset, and writes the result to an underlying Output.
Unmappable characters will be replaced (see CodingErrorAction.REPLACE).| Constructor and Description |
|---|
StringOutput(com.google.common.base.Function<O,String> fn,
String terminator,
String charsetName,
Output<ByteBuffer,R> sink) |
StringOutput(String terminator,
Output<ByteBuffer,R> sink) |
StringOutput(String terminator,
String charsetName,
Output<ByteBuffer,R> sink) |
| Modifier and Type | Method and Description |
|---|---|
List<? extends OutputWriter<O>> |
createWriters(int numShards)
Returns a list of writers, one for each shard, for this output.
|
R |
finish(Collection<? extends OutputWriter<O>> writers)
Returns whatever the underlying
Output's finish(java.util.Collection<? extends com.google.appengine.tools.mapreduce.OutputWriter<O>>) method returns. |
getContext, setContextpublic StringOutput(com.google.common.base.Function<O,String> fn, String terminator, String charsetName, Output<ByteBuffer,R> sink)
public StringOutput(String terminator, String charsetName, Output<ByteBuffer,R> sink)
public StringOutput(String terminator, Output<ByteBuffer,R> sink)
public List<? extends OutputWriter<O>> createWriters(int numShards)
OutputcreateWriters in class Output<O,R>numShards - The number of shards which should be equal to the number of
OutputWriters returned.public R finish(Collection<? extends OutputWriter<O>> writers) throws IOException
Output's finish(java.util.Collection<? extends com.google.appengine.tools.mapreduce.OutputWriter<O>>) method returns.finish in class Output<O,R>IOExceptionCopyright © 2015 Google. All rights reserved.