public class RollingDataWriter<T>
extends java.lang.Object
Constructor and Description |
---|
RollingDataWriter(FileWriterFactory<T> writerFactory,
OutputFileFactory fileFactory,
FileIO io,
long targetFileSizeInBytes,
PartitionSpec spec,
StructLike partition) |
Modifier and Type | Method and Description |
---|---|
protected void |
addResult(DataWriteResult result) |
protected DataWriteResult |
aggregatedResult() |
void |
close() |
java.lang.CharSequence |
currentFilePath() |
long |
currentFileRows() |
long |
length()
Returns the number of bytes that were currently written by this writer.
|
protected DataWriter<T> |
newWriter(EncryptedOutputFile file) |
protected void |
openCurrentWriter() |
protected StructLike |
partition() |
R |
result()
Returns a result that contains information about written
DataFile s or DeleteFile s. |
protected PartitionSpec |
spec() |
void |
write(T row)
Writes a row to a predefined spec/partition.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
write
public RollingDataWriter(FileWriterFactory<T> writerFactory, OutputFileFactory fileFactory, FileIO io, long targetFileSizeInBytes, PartitionSpec spec, StructLike partition)
protected DataWriter<T> newWriter(EncryptedOutputFile file)
protected void addResult(DataWriteResult result)
protected DataWriteResult aggregatedResult()
protected PartitionSpec spec()
protected StructLike partition()
public java.lang.CharSequence currentFilePath()
public long currentFileRows()
public long length()
FileWriter
length
in interface FileWriter<T,R>
public void write(T row)
FileWriter
write
in interface FileWriter<T,R>
row
- a data or delete recordprotected void openCurrentWriter()
public 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()
FileWriter
DataFile
s or DeleteFile
s. The result is valid only after the writer is closed.result
in interface FileWriter<T,R>