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, endSlice
cleanup, close, open
public void beginShard() throws IOException
OutputWriter
beginShard
in class ForwardingOutputWriter<O>
IOException
- in the event of failurepublic void write(O value) throws IOException
OutputWriter
write
in class OutputWriter<O>
IOException
protected 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()
OutputWriter
estimateMemoryRequirement
in class ForwardingOutputWriter<O>
public boolean allowSliceRetry()
allowSliceRetry
in class ForwardingOutputWriter<O>
public void setContext(ShardContext context)
OutputWriter
setContext
in class ForwardingOutputWriter<O>
public ShardContext getContext()
OutputWriter
getContext
in class ForwardingOutputWriter<O>
Copyright © 2015 Google. All rights reserved.