use of com.mapr.db.TabletInfo in project drill by apache.
the class JsonTableGroupScan method computeRegionsToScan.
/**
* Compute regions to scan based on the scanSpec
*/
private void computeRegionsToScan() {
boolean foundStartRegion = false;
regionsToScan = new TreeMap<TabletFragmentInfo, String>();
for (TabletInfo tabletInfo : tabletInfos) {
TabletInfoImpl tabletInfoImpl = (TabletInfoImpl) tabletInfo;
if (!foundStartRegion && !isNullOrEmpty(scanSpec.getStartRow()) && !tabletInfoImpl.containsRow(scanSpec.getStartRow())) {
continue;
}
foundStartRegion = true;
regionsToScan.put(new TabletFragmentInfo(tabletInfoImpl), tabletInfo.getLocations()[0]);
if (!isNullOrEmpty(scanSpec.getStopRow()) && tabletInfoImpl.containsRow(scanSpec.getStopRow())) {
break;
}
}
}
use of com.mapr.db.TabletInfo in project drill by apache.
the class JsonTableGroupScan method init.
private void init() {
logger.debug("Getting tablet locations");
try {
Configuration conf = new Configuration();
// Fetch table and tabletInfo only once and cache.
table = MapRDB.getTable(scanSpec.getTableName());
tabletInfos = table.getTabletInfos(scanSpec.getCondition());
// duplicate work and RPCs to MapR DB server.
for (TabletInfo tabletInfo : tabletInfos) {
totalRowCount += tabletInfo.getEstimatedNumRows();
}
computeRegionsToScan();
} catch (Exception e) {
throw new DrillRuntimeException("Error getting region info for table: " + scanSpec.getTableName(), e);
}
}
Aggregations