O - the type of the written values.public abstract class ItemSegmentingOutputWriter<O> extends ForwardingOutputWriter<O>
shouldSegment(O) returns true. This is
used by the Merge output in the event that there are too many files to merge in one pass.| Constructor and Description |
|---|
ItemSegmentingOutputWriter() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
allowSliceRetry() |
void |
beginShard()
Will be called once before any calls to write.
|
protected abstract OutputWriter<O> |
createNextWriter(int fileNum) |
abstract long |
estimateMemoryRequirement()
Returns the estimated memory that will be used by this writer in bytes.
|
ShardContext |
getContext()
Returns the current context, or null if none.
|
protected OutputWriter<O> |
getDelegate() |
void |
setContext(ShardContext context)
Used internally to sets the context to be used for the processing that follows.
|
protected abstract boolean |
shouldSegment(O value) |
void |
write(O value)
Writes a value to the output.
|
beginSlice, endShard, endSlicecleanup, close, openpublic void beginShard()
throws IOException
OutputWriterbeginShard in class ForwardingOutputWriter<O>IOException - in the event of failurepublic void write(O value) throws IOException
OutputWriterwrite in class OutputWriter<O>IOExceptionprotected abstract boolean shouldSegment(O value)
protected abstract OutputWriter<O> createNextWriter(int fileNum)
protected OutputWriter<O> getDelegate()
getDelegate in class ForwardingOutputWriter<O>public abstract long estimateMemoryRequirement()
OutputWriterestimateMemoryRequirement in class ForwardingOutputWriter<O>public boolean allowSliceRetry()
allowSliceRetry in class ForwardingOutputWriter<O>public void setContext(ShardContext context)
OutputWritersetContext in class ForwardingOutputWriter<O>public ShardContext getContext()
OutputWritergetContext in class ForwardingOutputWriter<O>Copyright © 2015 Google. All rights reserved.