public class GoogleCloudStorageLevelDbOutput extends Output<ByteBuffer,GoogleCloudStorageFileSet>
GoogleCloudStorageFileOutput
with
GoogleCloudStorageLevelDbOutput
that pads blocks to GCS write boundaries on end of slice.Constructor and Description |
---|
GoogleCloudStorageLevelDbOutput(String bucket,
String fileNamePattern,
String mimeType)
Creates LevelDb output files who's names follow the provided pattern in the specified bucket.
|
Modifier and Type | Method and Description |
---|---|
List<GoogleCloudStorageLevelDbOutputWriter> |
createWriters(int numShards)
Returns a list of writers, one for each shard, for this output.
|
GoogleCloudStorageFileSet |
finish(Collection<? extends OutputWriter<ByteBuffer>> writers)
Returns a result to be made available through
MapReduceResult.getOutputResult() . |
getContext, setContext
public GoogleCloudStorageLevelDbOutput(String bucket, String fileNamePattern, String mimeType)
fileNamePattern
- a Java format string Formatter
containing one int
argument for the shard number.mimeType
- The string to be passed as the mimeType to GCS.public List<GoogleCloudStorageLevelDbOutputWriter> createWriters(int numShards)
Output
createWriters
in class Output<ByteBuffer,GoogleCloudStorageFileSet>
numShards
- The number of shards which should be equal to the number of
OutputWriter
s returned.public GoogleCloudStorageFileSet finish(Collection<? extends OutputWriter<ByteBuffer>> writers)
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,GoogleCloudStorageFileSet>
Copyright © 2015 Google. All rights reserved.