public class FanoutDataWriter<T>
extends java.lang.Object
Constructor and Description |
---|
FanoutDataWriter(FileWriterFactory<T> writerFactory,
OutputFileFactory fileFactory,
FileIO io,
long targetFileSizeInBytes) |
Modifier and Type | Method and Description |
---|---|
protected void |
addResult(DataWriteResult result) |
protected DataWriteResult |
aggregatedResult() |
void |
close() |
protected FileWriter<T,DataWriteResult> |
newWriter(PartitionSpec spec,
StructLike partition) |
R |
result()
Returns a result that contains information about written
DataFile s or DeleteFile s. |
void |
write(T row,
PartitionSpec spec,
StructLike partition)
Writes a row to the provided spec/partition.
|
public FanoutDataWriter(FileWriterFactory<T> writerFactory, OutputFileFactory fileFactory, FileIO io, long targetFileSizeInBytes)
protected FileWriter<T,DataWriteResult> newWriter(PartitionSpec spec, StructLike partition)
protected void addResult(DataWriteResult result)
protected DataWriteResult aggregatedResult()
public void write(T row, PartitionSpec spec, StructLike partition)
PartitioningWriter
write
in interface PartitioningWriter<T,R>
row
- a data or delete recordspec
- a partition specpartition
- a partition or null if the spec is unpartitionedpublic void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public final R result()
PartitioningWriter
DataFile
s or DeleteFile
s. The result is valid only after the writer is closed.result
in interface PartitioningWriter<T,R>