queryPlan.iterator(MapReduceParallelScanGrouper.getInstance()); return queryPlan; } catch (Exception exception) {
@Override public List<HRegionLocation> getRegionBoundaries(StatementContext context, byte[] tableName) throws SQLException { String snapshotName; Configuration conf = context.getConnection().getQueryServices().getConfiguration(); if((snapshotName = getSnapshotName(conf)) != null) { try { Path rootDir = new Path(conf.get(HConstants.HBASE_DIR)); FileSystem fs = rootDir.getFileSystem(conf); Path snapshotDir = SnapshotDescriptionUtils.getCompletedSnapshotDir(snapshotName, rootDir); SnapshotDescription snapshotDescription = SnapshotDescriptionUtils.readSnapshotInfo(fs, snapshotDir); SnapshotManifest manifest = SnapshotManifest.open(conf, fs, snapshotDir, snapshotDescription); return getRegionLocationsFromManifest(manifest); } catch (Exception e) { throw new RuntimeException(e); } } else { return context.getConnection().getQueryServices().getAllTableRegions(tableName); } }
/** * Get list of region locations from SnapshotManifest * BaseResultIterators assume that regions are sorted using RegionInfo.COMPARATOR */ private List<HRegionLocation> getRegionLocationsFromManifest(SnapshotManifest manifest) { List<SnapshotRegionManifest> regionManifests = manifest.getRegionManifests(); Preconditions.checkNotNull(regionManifests); List<RegionInfo> regionInfos = Lists.newArrayListWithCapacity(regionManifests.size()); List<HRegionLocation> hRegionLocations = Lists.newArrayListWithCapacity(regionManifests.size()); for (SnapshotRegionManifest regionManifest : regionManifests) { RegionInfo regionInfo = ProtobufUtil.toRegionInfo(regionManifest.getRegionInfo()); if (isValidRegion(regionInfo)) { regionInfos.add(regionInfo); } } regionInfos.sort(RegionInfo.COMPARATOR); for (RegionInfo regionInfo : regionInfos) { hRegionLocations.add(new HRegionLocation(regionInfo, null)); } return hRegionLocations; }
queryPlan.iterator(MapReduceParallelScanGrouper.getInstance()); return queryPlan;
@Override public List<HRegionLocation> getRegionBoundaries(StatementContext context, byte[] tableName) throws SQLException { String snapshotName; Configuration conf = context.getConnection().getQueryServices().getConfiguration(); if((snapshotName = getSnapshotName(conf)) != null) { try { Path rootDir = new Path(conf.get(HConstants.HBASE_DIR)); FileSystem fs = rootDir.getFileSystem(conf); Path snapshotDir = SnapshotDescriptionUtils.getCompletedSnapshotDir(snapshotName, rootDir); SnapshotDescription snapshotDescription = SnapshotDescriptionUtils.readSnapshotInfo(fs, snapshotDir); SnapshotManifest manifest = SnapshotManifest.open(conf, fs, snapshotDir, snapshotDescription); return getRegionLocationsFromManifest(manifest); } catch (Exception e) { throw new RuntimeException(e); } } else { return context.getConnection().getQueryServices().getAllTableRegions(tableName); } }
/** * Get list of region locations from SnapshotManifest * BaseResultIterators assume that regions are sorted using RegionInfo.COMPARATOR */ private List<HRegionLocation> getRegionLocationsFromManifest(SnapshotManifest manifest) { List<SnapshotRegionManifest> regionManifests = manifest.getRegionManifests(); Preconditions.checkNotNull(regionManifests); List<RegionInfo> regionInfos = Lists.newArrayListWithCapacity(regionManifests.size()); List<HRegionLocation> hRegionLocations = Lists.newArrayListWithCapacity(regionManifests.size()); for (SnapshotRegionManifest regionManifest : regionManifests) { RegionInfo regionInfo = ProtobufUtil.toRegionInfo(regionManifest.getRegionInfo()); if (isValidRegion(regionInfo)) { regionInfos.add(regionInfo); } } regionInfos.sort(RegionInfo.COMPARATOR); for (RegionInfo regionInfo : regionInfos) { hRegionLocations.add(new HRegionLocation(regionInfo, null)); } return hRegionLocations; }
queryPlan.iterator(MapReduceParallelScanGrouper.getInstance());
@Override public List<HRegionLocation> getRegionBoundaries(StatementContext context, byte[] tableName) throws SQLException { String snapshotName; Configuration conf = context.getConnection().getQueryServices().getConfiguration(); if((snapshotName = getSnapshotName(conf)) != null) { try { Path rootDir = new Path(conf.get(HConstants.HBASE_DIR)); FileSystem fs = rootDir.getFileSystem(conf); Path snapshotDir = SnapshotDescriptionUtils.getCompletedSnapshotDir(snapshotName, rootDir); SnapshotDescription snapshotDescription = SnapshotDescriptionUtils.readSnapshotInfo(fs, snapshotDir); SnapshotManifest manifest = SnapshotManifest.open(conf, fs, snapshotDir, snapshotDescription); return getRegionLocationsFromManifest(manifest); } catch (Exception e) { throw new RuntimeException(e); } } else { return context.getConnection().getQueryServices().getAllTableRegions(tableName); } }
final TableResultIterator tableResultIterator = new TableResultIterator( queryPlan.getContext().getConnection().getMutationState(), scan, scanMetricsHolder, renewScannerLeaseThreshold, queryPlan, MapReduceParallelScanGrouper.getInstance());
queryPlan.getContext().getConnection().getMutationState(), scan, scanMetricsHolder, renewScannerLeaseThreshold, queryPlan, MapReduceParallelScanGrouper.getInstance()); peekingResultIterator = LookAheadResultIterator.wrap(tableResultIterator); LOG.info("Adding TableResultIterator for scan: " + scan);
queryPlan.getContext().getConnection().getMutationState(), scan, scanMetricsHolder, renewScannerLeaseThreshold, queryPlan, MapReduceParallelScanGrouper.getInstance()); peekingResultIterator = LookAheadResultIterator.wrap(tableResultIterator); iterators.add(peekingResultIterator);
queryPlan.iterator(MapReduceParallelScanGrouper.getInstance()); return queryPlan; } catch (Exception exception) {
queryPlan.iterator(MapReduceParallelScanGrouper.getInstance()); return queryPlan;
queryPlan.iterator(MapReduceParallelScanGrouper.getInstance()); return queryPlan;
queryPlan.getContext().getConnection().getMutationState(), scan, scanMetricsHolder, renewScannerLeaseThreshold, queryPlan, MapReduceParallelScanGrouper.getInstance()); peekingResultIterator = LookAheadResultIterator.wrap(tableResultIterator);
queryPlan.getContext().getConnection().getMutationState(), scan, scanMetricsHolder, renewScannerLeaseThreshold, queryPlan, MapReduceParallelScanGrouper.getInstance()); peekingResultIterator = LookAheadResultIterator.wrap(tableResultIterator);