use of org.apache.drill.exec.store.mapr.db.MapRDBFormatMatcher in project drill by apache.
the class MapRDBIndexDiscover method getNativeDrillTable.
@Override
public DrillTable getNativeDrillTable(IndexDescriptor idxDescriptor) {
try {
final AbstractDbGroupScan origScan = getOriginalScan();
if (!(origScan instanceof MapRDBGroupScan)) {
return null;
}
MapRDBFormatPlugin maprFormatPlugin = ((MapRDBGroupScan) origScan).getFormatPlugin();
FileSystemPlugin fsPlugin = (FileSystemPlugin) (origScan.getStoragePlugin());
DrillFileSystem fs = ImpersonationUtil.createFileSystem(origScan.getUserName(), fsPlugin.getFsConf());
MapRDBFormatMatcher matcher = (MapRDBFormatMatcher) (maprFormatPlugin.getMatcher());
FileSelection fsSelection = deriveFSSelection(fs, idxDescriptor);
return matcher.isReadableIndex(fs, fsSelection, fsPlugin, fsPlugin.getName(), origScan.getUserName(), idxDescriptor);
} catch (Exception e) {
logger.error("Failed to get native DrillTable.", e);
}
return null;
}
Aggregations