public class GoogleCloudStorageSortOutput extends Output<KeyValue<ByteBuffer,List<ByteBuffer>>,FilesByShard>
| Constructor and Description |
|---|
GoogleCloudStorageSortOutput(String bucket,
String mrJobId,
Sharder sharder) |
| Modifier and Type | Method and Description |
|---|---|
List<? extends OutputWriter<KeyValue<ByteBuffer,List<ByteBuffer>>>> |
createWriters(int shards)
Returns a list of writers, one for each shard, for this output.
|
FilesByShard |
finish(Collection<? extends OutputWriter<KeyValue<ByteBuffer,List<ByteBuffer>>>> writers)
Returns a result to be made available through
MapReduceResult.getOutputResult(). |
getContext, setContextpublic List<? extends OutputWriter<KeyValue<ByteBuffer,List<ByteBuffer>>>> createWriters(int shards)
OutputcreateWriters in class Output<KeyValue<ByteBuffer,List<ByteBuffer>>,FilesByShard>shards - The number of shards which should be equal to the number of
OutputWriters returned.public FilesByShard finish(Collection<? extends OutputWriter<KeyValue<ByteBuffer,List<ByteBuffer>>>> writers)
OutputMapReduceResult.getOutputResult().
This method allows the Output to inspect the final state of its OutputWriters
to produce a final result object. For example, if the OutputWriters 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 OutputWriters 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<KeyValue<ByteBuffer,List<ByteBuffer>>,FilesByShard>Copyright © 2015 Google. All rights reserved.