Class AccumuloPageSink

java.lang.Object
io.trino.plugin.accumulo.io.AccumuloPageSink
All Implemented Interfaces:
ConnectorPageSink

public class AccumuloPageSink extends Object implements ConnectorPageSink
Output class for serializing Trino pages (blocks of rows of data) to Accumulo. This class converts the rows from within a page to a collection of Accumulo Mutations, writing and indexed the rows. Writers are flushed and closed on commit, and if a rollback occurs... we'll you're gonna have a bad time.
See Also:
  • Field Details

    • ROW_ID_COLUMN

      public static final org.apache.hadoop.io.Text ROW_ID_COLUMN
  • Constructor Details

    • AccumuloPageSink

      public AccumuloPageSink(org.apache.accumulo.core.client.Connector connector, AccumuloTable table, String username)
  • Method Details

    • toMutation

      public static org.apache.accumulo.core.data.Mutation toMutation(Row row, int rowIdOrdinal, List<AccumuloColumnHandle> columns, AccumuloRowSerializer serializer)
      Converts a Row to an Accumulo mutation.
      Parameters:
      row - Row object
      rowIdOrdinal - Ordinal in the list of columns that is the row ID. This isn't checked at all, so I hope you're right. Also, it is expected that the list of column handles is sorted in ordinal order. This is a very demanding function.
      columns - All column handles for the Row, sorted by ordinal.
      serializer - Instance of AccumuloRowSerializer used to encode the values of the row to the Mutation
      Returns:
      Mutation
    • appendPage

      public CompletableFuture<?> appendPage(Page page)
      Specified by:
      appendPage in interface ConnectorPageSink
    • finish

      public CompletableFuture<Collection<io.airlift.slice.Slice>> finish()
      Specified by:
      finish in interface ConnectorPageSink
    • abort

      public void abort()
      Specified by:
      abort in interface ConnectorPageSink