Package io.trino.plugin.accumulo
Class AccumuloClient
java.lang.Object
io.trino.plugin.accumulo.AccumuloClient
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
ConstructorsConstructorDescriptionAccumuloClient(org.apache.accumulo.core.client.Connector connector, AccumuloConfig config, ZooKeeperMetadataManager metaManager, AccumuloTableManager tableManager, IndexLookup indexLookup) -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateOrReplaceView(SchemaTableName viewName, String viewData) voidcreateSchema(String schemaName) voidcreateView(SchemaTableName viewName, String viewData) voiddropSchema(String schemaName) voiddropTable(AccumuloTable table) voiddropView(SchemaTableName viewName) static Collection<org.apache.accumulo.core.data.Range>getRangesFromDomain(Optional<Domain> domain, AccumuloRowSerializer serializer) Gets a collection of Accumulo Range objects from the given Trino domain.getTable(SchemaTableName table) getTableNames(String schema) 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.getView(SchemaTableName viewName) getViewNames(String schema) voidrenameColumn(AccumuloTable table, String source, String target) voidrenameTable(SchemaTableName oldName, SchemaTableName newName)
-
Constructor Details
-
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 Details
-
createSchema
-
dropSchema
-
createTable
-
dropTable
-
renameTable
-
createView
-
createOrReplaceView
-
dropView
-
renameColumn
-
getSchemaNames
-
getTableNames
-
getTable
-
getViewNames
-
getView
-
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
-