public class GoogleCloudStorageFileOutput extends Output<ByteBuffer,GoogleCloudStorageFileSet>
Output that writes bytes to a set of Cloud Storage files, one per shard.
Produces a single file output (usually on a per-shard basis).
This format does not insert any separator characters, so it by default
cannot be read back with the CloudStorageLineInputReader.| Constructor and Description |
|---|
GoogleCloudStorageFileOutput(String bucket,
String fileNamePattern,
String mimeType)
Creates output files who's names follow the provided pattern in the specified bucket.
|
GoogleCloudStorageFileOutput(String bucket,
String fileNamePattern,
String mimeType,
boolean supportSliceRetries)
Creates output files who's names follow the provided pattern in the specified bucket.
|
| Modifier and Type | Method and Description |
|---|---|
List<GoogleCloudStorageFileOutputWriter> |
createWriters(int numShards)
Returns a list of writers, one for each shard, for this output.
|
GoogleCloudStorageFileSet |
finish(Collection<? extends OutputWriter<ByteBuffer>> writers)
Returns a list of GcsFilename that has one element for each reduce shard.
|
getContext, setContextpublic GoogleCloudStorageFileOutput(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 GoogleCloudStorageFileOutput(String bucket, String fileNamePattern, String mimeType, boolean supportSliceRetries)
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.supportSliceRetries - indicates if slice retries should be supported by this writer.
Slice retries are achieved by writing each slice to a temporary file
and copying it to its destination when processing the next slice.public List<GoogleCloudStorageFileOutputWriter> createWriters(int numShards)
OutputcreateWriters in class Output<ByteBuffer,GoogleCloudStorageFileSet>numShards - The number of shards which should be equal to the number of
OutputWriters returned.public GoogleCloudStorageFileSet finish(Collection<? extends OutputWriter<ByteBuffer>> writers)
finish in class Output<ByteBuffer,GoogleCloudStorageFileSet>Copyright © 2015 Google. All rights reserved.