public final class SizeSegmentedGoogleCloudStorageFileOutput extends Output<ByteBuffer,GoogleCloudStorageFileSet>
Output
that writes files to GCS segmented by specified size limit. For e.g. to write
files with size no greater than 100 bytes pass the segmentSizeLimit as 100.Constructor and Description |
---|
SizeSegmentedGoogleCloudStorageFileOutput(String bucket,
long segmentSizeLimit,
String fileNamePattern,
String mimeType) |
Modifier and Type | Method and Description |
---|---|
List<? extends OutputWriter<ByteBuffer>> |
createWriters(int numShards)
Returns
OutputWriter s that write files to GCS but segments the files based on the
maximum allowed file size. |
GoogleCloudStorageFileSet |
finish(Collection<? extends OutputWriter<ByteBuffer>> writers)
Returns a list of all the filenames written by the output writers
|
getContext, setContext
public SizeSegmentedGoogleCloudStorageFileOutput(String bucket, long segmentSizeLimit, String fileNamePattern, String mimeType)
bucket
- GCS bucketsegmentSizeLimit
- Maximum size of the files to be written to the outputfileNamePattern
- a java format string Formatter
containing one int
argument for the shard number and another int argument for the segment number for e.g.
shard-%04d-segment-%04d.mimeType
- The string to be passed as the mimeType to GCS.public List<? extends OutputWriter<ByteBuffer>> createWriters(int numShards)
OutputWriter
s that write files to GCS but segments the files based on the
maximum allowed file size. One writer can write more than one file per shardcreateWriters
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) throws IOException
finish
in class Output<ByteBuffer,GoogleCloudStorageFileSet>
IOException
Copyright © 2015 Google. All rights reserved.