Class LocalTableWriterImpl

java.lang.Object
com.illumon.iris.db.tables.appendable.local.LocalTableWriter
com.illumon.iris.db.tables.appendable.local.LocalTableWriterImpl
All Implemented Interfaces:
Entry, Record, Row, TableWriter<Row>, BufferedAppendable
Direct Known Subclasses:
DiskTableWriter

public class LocalTableWriterImpl extends LocalTableWriter
  • Constructor Details

    • LocalTableWriterImpl

      public LocalTableWriterImpl(@NotNull LocalAppendableTable table)
      Construct a writer for the supplied table.
      Parameters:
      table - The table to write to
    • LocalTableWriterImpl

      public LocalTableWriterImpl(@NotNull LocalAppendableTable table, boolean needRowSupport)
      Construct a writer for the supplied table.
      Parameters:
      table - The table to write to
      needRowSupport - Should this local table writer allocate a Row for traditional row-by-row ingest
  • Method Details

    • getColumnNames

      public String[] getColumnNames()
      Description copied from interface: TableWriter
      Gets the column names for the table.
      Returns:
      column names for the table.
    • getColumnTypes

      public Class[] getColumnTypes()
      Description copied from interface: TableWriter
      Gets the column types for the table.
      Returns:
      column types for the table.
    • getSetter

      public RowSetter getSetter(@NotNull String columnName)
      Description copied from interface: TableWriter
      Gets a setter for a column.

      The implementation is likely to delegate to Row.getSetter(String) in a default Row instance.

      Parameters:
      columnName - column name
      Returns:
      setter for the column.
    • getColumn

      public <CT extends LocalAppendableColumn<?>> CT getColumn(@NotNull String name, @NotNull Class<CT> clazz)
      Description copied from class: LocalTableWriter
      Get a LocalAppendableColumn for use by writing code that doesn't use RowSetters.
      Specified by:
      getColumn in class LocalTableWriter
      Parameters:
      name - The column name
      clazz - The expected column class
      Returns:
      The column
    • setFlags

      public void setFlags(@NotNull Row.Flags flags)
      Description copied from interface: TableWriter

      The implementation is likely to delegate to Row.setFlags(Flags) in a default Row instance.

    • startTransaction

      public final void startTransaction()
      Description copied from class: LocalTableWriter
      Begin a transaction. It is an error to call this method if a transaction is already in progress.
      Specified by:
      startTransaction in class LocalTableWriter
    • abortTransaction

      public final void abortTransaction()
      Description copied from class: LocalTableWriter
      Abort a transaction. It is an error to call this method if a transaction is not in progress.
      Specified by:
      abortTransaction in class LocalTableWriter
    • endTransaction

      public final void endTransaction()
      Description copied from class: LocalTableWriter
      End a transaction. It is an error to call this method if a transaction is not in progress or the current transaction is invalid.
      Specified by:
      endTransaction in class LocalTableWriter
    • adviseRowsWritten

      public final void adviseRowsWritten(long count)
      Description copied from class: LocalTableWriter
      Update accounting for rows were written.
      Specified by:
      adviseRowsWritten in class LocalTableWriter
      Parameters:
      count - The number of rows that were written
    • writeRow

      public final void writeRow() throws IOException
      Description copied from interface: TableWriter
      Writes out a new row (values set using setters).

      The implementation is likely to delegate to Row.writeRow() in a default Row instance.

      Throws:
      IOException - problem writing the row
    • dirty

      public boolean dirty()
      Description copied from class: LocalTableWriter
      Test if there is data to flush.
      Specified by:
      dirty in class LocalTableWriter
      Returns:
      Whether there is data to flush
    • flush

      public void flush()
      Description copied from interface: TableWriter
      Flushes data out.
    • prepareCheckpoint

      public void prepareCheckpoint()
      Description copied from interface: BufferedAppendable
      Optional operation. Prepare a checkpoint snapshot for the next call to BufferedAppendable.force(). Should be called directly after BufferedAppendable.flush(), with no intervening modification operations.
    • force

      public void force()
      Description copied from interface: BufferedAppendable
      Force all flushed data to be persisted to permanent storage. Will consistently and atomically persist the last prepared checkpoint in implementations that implement BufferedAppendable.prepareCheckpoint(). Does not imply BufferedAppendable.flush(), as this is a distinct operation in all implementations. May be called concurrently by threads other than the "writing thread".
    • maybeForce

      public boolean maybeForce()
      Description copied from interface: BufferedAppendable
      Perform a BufferedAppendable.force() if there is data pending persistence. Implementations that don't keep track of pending data explicitly will always invoke BufferedAppendable.force() pessimistically.
      Returns:
      Whether this call may have done any actual work (i.e. there was data pending or assumed to be pending)
    • close

      public void close()
      Description copied from interface: TableWriter
      Closes the writer.
    • release

      public void release()
      Description copied from interface: BufferedAppendable
      Release any resources held. Called after an error in preparation for termination. For external callers, this should be done as the final access to this column with the exception of any asynchronous BufferedAppendable.force() operations.
    • updateImportState

      public void updateImportState(@NotNull UnaryOperator<ImportState> updater)
      Description copied from class: LocalTableWriter
      Set the import state object (as in LocalTableWriter.setImportState(ImportState)) after applying the supplied updater function to the existing import state object.
      Specified by:
      updateImportState in class LocalTableWriter
      Parameters:
      updater - The import state updater
    • setImportState

      public void setImportState(ImportState importState)
      Description copied from class: LocalTableWriter
      Set an import state object to be part of checkpoints for the output table.
      Specified by:
      setImportState in class LocalTableWriter
      Parameters:
      importState - The import state
    • setImportDetails

      public void setImportDetails(Properties importDetails)
      Description copied from class: LocalTableWriter
      Set a trivial import state object wrapping the supplied import details to be part of checkpoints for the output table.
      Specified by:
      setImportDetails in class LocalTableWriter
      Parameters:
      importDetails - The import details