public class TablesWriter extends Object implements TableWriter
Committer
determines that the current
table should be committed/completed, the table file is completed and a new table file is created.Modifier and Type | Method and Description |
---|---|
void |
close()
Closes a writer, which means the table is complete now.
|
static TablesWriter |
create(TableSchema schema,
Committer committer,
AlluxioURI outputDir) |
long |
getBytes()
Note that the bytes written should take compression and encoding into consideration.
|
int |
getRows() |
void |
write(TableRow row)
Writes a row.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
create
public static TablesWriter create(TableSchema schema, Committer committer, AlluxioURI outputDir) throws IOException
schema
- the table schemacommitter
- the committeroutputDir
- the output directoryIOException
- when failed to create an internal table writerpublic void write(TableRow row) throws IOException
TableWriter
write
in interface TableWriter
row
- a rowIOException
- when write failspublic void close() throws IOException
TableWriter
close
in interface TableWriter
close
in interface Closeable
close
in interface AutoCloseable
IOException
- when failing to close the underlying output streampublic int getRows()
getRows
in interface TableWriter
public long getBytes()
TableWriter
getBytes
in interface TableWriter
Copyright © 2023. All Rights Reserved.