/** * Abstract function getDrillTable will be implemented the IndexDiscover within storage plugin(e.g. HBase, MaprDB) * since the implementations of AbstractStoragePlugin, IndexDescriptor and DrillTable in that storage plugin may have * the implement details. * @param idxDesc * @return */ public DrillTable buildDrillTable(IndexDescriptor idxDesc) { if(idxDesc.getIndexType() == IndexDescriptor.IndexType.EXTERNAL_SECONDARY_INDEX) { return getExternalDrillTable(idxDesc); } else { return getNativeDrillTable(idxDesc); } }
public IndexCollection getTableIndex(String tableName, String storageName, Collection<DrillIndexDefinition> indexDefs ) { Set<DrillIndexDescriptor> idxSet = new HashSet<>(); for (DrillIndexDefinition def : indexDefs) { DrillIndexDescriptor indexDescriptor = new DrillIndexDescriptor(def); materializeIndex(storageName, indexDescriptor); } return new DrillIndexCollection(getOriginalScanRel(), idxSet); }
public void materializeIndex(String storageName, DrillIndexDescriptor index) { index.setStorageName(storageName); index.setDrillTable(buildDrillTable(index)); }