private static List<KeyRange> getSplits(Connection conn, long ts, final Scan scan)
throws SQLException {
TableRef tableRef = getTableRef(conn, ts);
PhoenixConnection pconn = conn.unwrap(PhoenixConnection.class);
final List<HRegionLocation> regions = pconn.getQueryServices().getAllTableRegions(tableRef.getTable().getPhysicalName().getBytes());
StatementContext context = new StatementContext(new PhoenixStatement(pconn), null, Collections.emptyList(), scan);
DefaultParallelIteratorRegionSplitter splitter = new DefaultParallelIteratorRegionSplitter(context, tableRef, HintNode.EMPTY_HINT_NODE) {
@Override
protected List<HRegionLocation> getAllRegions() throws SQLException {
return DefaultParallelIteratorRegionSplitter.filterRegions(regions, scan.getStartRow(), scan.getStopRow());
}