R
- type returned by finish(java.util.Collection<? extends com.google.appengine.tools.mapreduce.OutputWriter<java.nio.ByteBuffer>>)
public class LevelDbOutput<R> extends Output<ByteBuffer,R>
Output
that writes LevelDb records.
Data written with this class can be read with
GoogleCloudStorageLevelDbInput
.Constructor and Description |
---|
LevelDbOutput(Output<ByteBuffer,R> sink) |
Modifier and Type | Method and Description |
---|---|
List<LevelDbOutputWriter> |
createWriters(int numShards)
Returns a list of writers, one for each shard, for this output.
|
R |
finish(Collection<? extends OutputWriter<ByteBuffer>> writers)
Returns a result to be made available through
MapReduceResult.getOutputResult() . |
getContext, setContext
public LevelDbOutput(Output<ByteBuffer,R> sink)
sink
- The output where data should be written.public List<LevelDbOutputWriter> createWriters(int numShards)
Output
createWriters
in class Output<ByteBuffer,R>
numShards
- The number of shards which should be equal to the number of
OutputWriter
s returned.public R finish(Collection<? extends OutputWriter<ByteBuffer>> writers) throws IOException
Output
MapReduceResult.getOutputResult()
.
This method allows the Output
to inspect the final state of its OutputWriter
s
to produce a final result object. For example, if the OutputWriter
s produce blobs in
blobstore, finish
could collect and return a list of blob IDs.
Should return null if no such result makes sense for this kind of output.
Called after all OutputWriter
s have been closed (with OutputWriter.close()
). It
is possible for this method to be called more than once with the same writers
collection. It is also possible for the job to fail after this is invoked.
The writers
argument will contain the same writers that Output.createWriters(int)
returned
in the same order. Writers may be serialized and deserialized multiple times. typically,
getWriter
will have been called in a different JVM.
finish
in class Output<ByteBuffer,R>
IOException
Copyright © 2015 Google. All rights reserved.