Package io.trino.plugin.accumulo.io
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:
AccumuloPageSinkProvider
-
-
Field Summary
Fields Modifier and Type Field Description static org.apache.hadoop.io.TextROW_ID_COLUMN-
Fields inherited from interface io.trino.spi.connector.ConnectorPageSink
NOT_BLOCKED
-
-
Constructor Summary
Constructors Constructor Description AccumuloPageSink(org.apache.accumulo.core.client.Connector connector, AccumuloTable table, String username)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidabort()CompletableFuture<?>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, wait
-
Methods inherited from interface io.trino.spi.connector.ConnectorPageSink
getCompletedBytes, getSystemMemoryUsage, getValidationCpuNanos
-
-
-
-
Constructor Detail
-
AccumuloPageSink
public AccumuloPageSink(org.apache.accumulo.core.client.Connector connector, AccumuloTable table, String username)
-
-
Method Detail
-
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
public CompletableFuture<?> appendPage(Page page)
- Specified by:
appendPagein interfaceConnectorPageSink
-
finish
public CompletableFuture<Collection<io.airlift.slice.Slice>> finish()
- Specified by:
finishin interfaceConnectorPageSink
-
abort
public void abort()
- Specified by:
abortin interfaceConnectorPageSink
-
-