Class RemoteTableAppender

java.lang.Object
com.illumon.iris.db.util.logging.RemoteTableAppender
All Implemented Interfaces:
AutoCloseable

public class RemoteTableAppender
extends Object
implements AutoCloseable
API to add or replace table data.
  • Constructor Details

    • RemoteTableAppender

      public RemoteTableAppender​(@NotNull com.fishlib.io.logger.Logger log, @NotNull TableDefinition tableDefinition, @NotNull String namespace, @NotNull String tableName, @NotNull String internalPartitionValue, @NotNull String columnPartitionValue, int tableLoggerQueueSize)
      Create a connection for the given 4-tuple and table definition. There are several ways to get and modify a table definition, some of which have namespace and table name set, and some which do not. These values will be ignored if present in the table definition. The columnPartition ultimately determines storage location, and it is essentially a constant column value in that respect. It is not valid to specify both a partitioning column and a column partition value, so the table definition is not allowed to have a partitioning column set.
      Parameters:
      log - logging destination
      tableDefinition - the definition of the table to log
      namespace - the namespace of the table
      tableName - the name of the table
      internalPartitionValue - internal partition value
      columnPartitionValue - column partition value
      tableLoggerQueueSize - size to be passed to the tableLogger initializer
    • RemoteTableAppender

      public RemoteTableAppender​(@NotNull com.fishlib.io.logger.Logger log, @NotNull TableDefinition tableDefinition, @NotNull String namespace, @NotNull String tableName, @NotNull String columnPartitionValue, int tableLoggerQueueSize)
      Delegate to RemoteTableAppender(Logger, TableDefinition, String, String, String, String, int) with the default internal partition value.
    • RemoteTableAppender

      public RemoteTableAppender​(@NotNull com.fishlib.io.logger.Logger log, @NotNull TableDefinition tableDefinition, @NotNull String namespace, @NotNull String tableName, @NotNull String columnPartitionValue)
      Delegates to RemoteTableAppender(Logger, TableDefinition, String, String, String, String, int) with the default internal partition table logger queue size.
    • RemoteTableAppender

      public RemoteTableAppender​(@NotNull com.fishlib.io.logger.Logger log, @NotNull TableDefinition tableDefinition, @NotNull String namespace, @NotNull String tableName, @NotNull String internalPartitionValue, @NotNull String columnPartitionValue)
  • Method Details

    • append

      public void append​(@NotNull Table t) throws IOException
      Append the given table to the partition.
      Parameters:
      t - the table
      Throws:
      IOException
    • appendAtomic

      public void appendAtomic​(@NotNull Table t) throws IOException
      Append the given table to the partition, keeping all rows sequential.
      Parameters:
      t - the table
      Throws:
      IOException
    • append

      public void append​(@NotNull Table t, long offset, long length) throws IOException
      Append the subset of the given table to the partition. Rows offset to offset + length-1 will be included.
      Parameters:
      t - the table
      offset - the starting position
      length - the number of rows to include
      Throws:
      IOException
    • appendAtomic

      public void appendAtomic​(@NotNull Table t, long offset, long length) throws IOException
      Append the subset of the given table to the partition, keeping all rows sequential. Rows offset to offset + length-1 will be included.
      Parameters:
      t - the table
      offset - the starting position
      length - the number of rows to include
      Throws:
      IOException
    • close

      public void close() throws IOException
      Close this RemoteTableAppender and its network connection.
      Specified by:
      close in interface AutoCloseable
      Throws:
      IOException
    • flush

      public void flush() throws IOException
      Request and confirm that all data send so far has been processed by the remote service.
      Throws:
      IOException
    • shutdown

      public void shutdown() throws IOException
      Close this RemoteTableAppender and its network connection.
      Throws:
      IOException
    • removePartition

      public void removePartition() throws IOException
      Delete the table location represented by this connection. The RemoteTableAppender and its network connection will be closed.
      Throws:
      IOException