public class GoogleCloudStorageFileOutputWriter extends OutputWriter<ByteBuffer>
OutputWriter
that writes bytes to a GCS file that it creates. 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.Modifier and Type | Field and Description |
---|---|
static long |
MEMORY_REQUIRED |
static long |
MEMORY_REQUIRED_WITHOUT_SLICE_RETRY |
Constructor and Description |
---|
GoogleCloudStorageFileOutputWriter(com.google.appengine.tools.cloudstorage.GcsFilename file,
String mimeType) |
GoogleCloudStorageFileOutputWriter(com.google.appengine.tools.cloudstorage.GcsFilename file,
String mimeType,
boolean supportSliceRetries) |
Modifier and Type | Method and Description |
---|---|
void |
beginShard()
Will be called once before any calls to write.
|
void |
beginSlice()
Prepares the writer for writing after possibly having gone through
serialization or deserialization.
|
void |
cleanup()
called after shards completes for any necessary cleanup.
|
void |
endShard()
Called when no more output will be written to this writer.
|
void |
endSlice()
Prepares the writer for possible serialization.
|
long |
estimateMemoryRequirement()
Returns the estimated memory that will be used by this writer in bytes.
|
com.google.appengine.tools.cloudstorage.GcsFilename |
getFile() |
String |
toString() |
void |
write(ByteBuffer bytes)
Writes a value to the output.
|
allowSliceRetry, close, getContext, open, setContext
public static final long MEMORY_REQUIRED_WITHOUT_SLICE_RETRY
public static final long MEMORY_REQUIRED
public GoogleCloudStorageFileOutputWriter(com.google.appengine.tools.cloudstorage.GcsFilename file, String mimeType)
public GoogleCloudStorageFileOutputWriter(com.google.appengine.tools.cloudstorage.GcsFilename file, String mimeType, boolean supportSliceRetries)
public void cleanup()
OutputWriter
cleanup
in class OutputWriter<ByteBuffer>
public void beginShard() throws IOException
OutputWriter
beginShard
in class OutputWriter<ByteBuffer>
IOException
- in the event of failurepublic void beginSlice() throws IOException
OutputWriter
beginSlice
in class OutputWriter<ByteBuffer>
IOException
- in the event of failurepublic void write(ByteBuffer bytes) throws IOException
OutputWriter
write
in class OutputWriter<ByteBuffer>
IOException
public void endSlice() throws IOException
OutputWriter
endSlice
in class OutputWriter<ByteBuffer>
IOException
- in the event of failurepublic void endShard() throws IOException
OutputWriter
endShard
in class OutputWriter<ByteBuffer>
IOException
public com.google.appengine.tools.cloudstorage.GcsFilename getFile()
public long estimateMemoryRequirement()
OutputWriter
estimateMemoryRequirement
in class OutputWriter<ByteBuffer>
Copyright © 2015 Google. All rights reserved.