Package io.trino.plugin.accumulo
Class AccumuloClient
- java.lang.Object
-
- io.trino.plugin.accumulo.AccumuloClient
-
public class AccumuloClient extends Object
This class is the main access point for the Trino connector to interact with Accumulo. It is responsible for creating tables, dropping tables, retrieving table metadata, and getting the ConnectorSplits from a table.
-
-
Constructor Summary
Constructors Constructor Description AccumuloClient(org.apache.accumulo.core.client.Connector connector, AccumuloConfig config, ZooKeeperMetadataManager metaManager, AccumuloTableManager tableManager, IndexLookup indexLookup)
-
Method Summary
-
-
-
Constructor Detail
-
AccumuloClient
@Inject public AccumuloClient(org.apache.accumulo.core.client.Connector connector, AccumuloConfig config, ZooKeeperMetadataManager metaManager, AccumuloTableManager tableManager, IndexLookup indexLookup) throws org.apache.accumulo.core.client.AccumuloException, org.apache.accumulo.core.client.AccumuloSecurityException- Throws:
org.apache.accumulo.core.client.AccumuloExceptionorg.apache.accumulo.core.client.AccumuloSecurityException
-
-
Method Detail
-
createTable
public AccumuloTable createTable(ConnectorTableMetadata meta)
-
dropTable
public void dropTable(AccumuloTable table)
-
renameTable
public void renameTable(SchemaTableName oldName, SchemaTableName newName)
-
createView
public void createView(SchemaTableName viewName, String viewData)
-
createOrReplaceView
public void createOrReplaceView(SchemaTableName viewName, String viewData)
-
dropView
public void dropView(SchemaTableName viewName)
-
renameColumn
public void renameColumn(AccumuloTable table, String source, String target)
-
getTable
public AccumuloTable getTable(SchemaTableName table)
-
getView
public AccumuloView getView(SchemaTableName viewName)
-
getTabletSplits
public List<TabletSplitMetadata> getTabletSplits(ConnectorSession session, String schema, String table, Optional<Domain> rowIdDomain, List<AccumuloColumnConstraint> constraints, AccumuloRowSerializer serializer)
Fetches the TabletSplitMetadata for a query against an Accumulo table.Does a whole bunch of fun stuff! Splitting on row ID ranges, applying secondary indexes, column pruning, all sorts of sweet optimizations. What you have here is an important method.
- Parameters:
session- Current sessionschema- Schema nametable- Table NamerowIdDomain- Domain for the row IDconstraints- Column constraints for the queryserializer- Instance of a row serializer- Returns:
- List of TabletSplitMetadata objects for Trino
-
getRangesFromDomain
public static Collection<org.apache.accumulo.core.data.Range> getRangesFromDomain(Optional<Domain> domain, AccumuloRowSerializer serializer) throws TableNotFoundException
Gets a collection of Accumulo Range objects from the given Trino domain. This maps the column constraints of the given Domain to an Accumulo Range scan.- Parameters:
domain- Domain, can be null (returns (-inf, +inf) Range)serializer- Instance of anAccumuloRowSerializer- Returns:
- A collection of Accumulo Range objects
- Throws:
TableNotFoundException- If the Accumulo table is not found
-
-