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, setContextpublic 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()
OutputWritercleanup in class OutputWriter<ByteBuffer>public void beginShard()
throws IOException
OutputWriterbeginShard in class OutputWriter<ByteBuffer>IOException - in the event of failurepublic void beginSlice()
throws IOException
OutputWriterbeginSlice in class OutputWriter<ByteBuffer>IOException - in the event of failurepublic void write(ByteBuffer bytes) throws IOException
OutputWriterwrite in class OutputWriter<ByteBuffer>IOExceptionpublic void endSlice()
throws IOException
OutputWriterendSlice in class OutputWriter<ByteBuffer>IOException - in the event of failurepublic void endShard()
throws IOException
OutputWriterendShard in class OutputWriter<ByteBuffer>IOExceptionpublic com.google.appengine.tools.cloudstorage.GcsFilename getFile()
public long estimateMemoryRequirement()
OutputWriterestimateMemoryRequirement in class OutputWriter<ByteBuffer>Copyright © 2015 Google. All rights reserved.