Package io.trino.plugin.accumulo.index
Class IndexLookup
- java.lang.Object
-
- io.trino.plugin.accumulo.index.IndexLookup
-
public class IndexLookup extends Object
Class to assist the Trino connector, and maybe external applications, leverage the secondary * index built by theIndexer. LeveragesColumnCardinalityCacheto assist in * retrieving row IDs. Currently pretty bound to the Trino connector APIs.
-
-
Constructor Summary
Constructors Constructor Description IndexLookup(org.apache.accumulo.core.client.Connector connector, ColumnCardinalityCache cardinalityCache)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanapplyIndex(String schema, String table, ConnectorSession session, Collection<AccumuloColumnConstraint> constraints, Collection<org.apache.accumulo.core.data.Range> rowIdRanges, List<TabletSplitMetadata> tabletSplits, AccumuloRowSerializer serializer, org.apache.accumulo.core.security.Authorizations auths)Scans the index table, applying the index based on the given column constraints to return a set of tablet splits.voidshutdown()
-
-
-
Constructor Detail
-
IndexLookup
@Inject public IndexLookup(org.apache.accumulo.core.client.Connector connector, ColumnCardinalityCache cardinalityCache)
-
-
Method Detail
-
shutdown
@PreDestroy public void shutdown()
-
applyIndex
public boolean applyIndex(String schema, String table, ConnectorSession session, Collection<AccumuloColumnConstraint> constraints, Collection<org.apache.accumulo.core.data.Range> rowIdRanges, List<TabletSplitMetadata> tabletSplits, AccumuloRowSerializer serializer, org.apache.accumulo.core.security.Authorizations auths) throws Exception
Scans the index table, applying the index based on the given column constraints to return a set of tablet splits.If this function returns true, the output parameter tabletSplits contains a list of TabletSplitMetadata objects. These in turn contain a collection of Ranges containing the exact row IDs determined using the index.
If this function returns false, the secondary index should not be used. In this case, either the accumulo session has disabled secondary indexing, or the number of row IDs that would be used by the secondary index is greater than the configured threshold (again retrieved from the session).
- Parameters:
schema- Schema nametable- Table namesession- Current client sessionconstraints- All column constraints (this method will filter for if the column is indexed)rowIdRanges- Collection of Accumulo ranges based on any predicate against a record keytabletSplits- Output parameter containing the bundles of row IDs determined by the use of the index.serializer- Instance of a row serializerauths- Scan-time authorizations- Returns:
- True if the tablet splits are valid and should be used, false otherwise
- Throws:
Exception- If something bad happens. What are the odds?
-
-