Package io.trino.plugin.accumulo.io
Class AccumuloPageSink
java.lang.Object
io.trino.plugin.accumulo.io.AccumuloPageSink
- All Implemented Interfaces:
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 Summary
FieldsFields inherited from interface io.trino.spi.connector.ConnectorPageSink
NOT_BLOCKED -
Constructor Summary
ConstructorsConstructorDescriptionAccumuloPageSink(org.apache.accumulo.core.client.Connector connector, AccumuloTable table, String username) -
Method Summary
Modifier and TypeMethodDescriptionvoidabort()appendPage(Page page) CompletableFuture<Collection<io.airlift.slice.Slice>>finish()static org.apache.accumulo.core.data.MutationtoMutation(Row row, int rowIdOrdinal, List<AccumuloColumnHandle> columns, AccumuloRowSerializer serializer) Converts aRowto an Accumulo mutation.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.trino.spi.connector.ConnectorPageSink
getCompletedBytes, getMemoryUsage, getValidationCpuNanos
-
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 aRowto an Accumulo mutation.- Parameters:
row- Row objectrowIdOrdinal- 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 ofAccumuloRowSerializerused to encode the values of the row to the Mutation- Returns:
- Mutation
-
appendPage
- Specified by:
appendPagein interfaceConnectorPageSink
-
finish
- Specified by:
finishin interfaceConnectorPageSink
-
abort
public void abort()- Specified by:
abortin interfaceConnectorPageSink
-