Skip to content
This repository was archived by the owner on Oct 22, 2026. It is now read-only.
This repository was archived by the owner on Oct 22, 2026. It is now read-only.

using PD's ScanRegions API #959

Open

Description

@marsishandsome

Is your feature request related to a problem? Please describe.

currently tispark use the following api to get region info

public static List<TiRegion> getRegionsByTable(TiSession session, TiTableInfo table) {
    ArrayList<TiRegion> regionList = new ArrayList<>();
    Key key = RowKey.createMin(table.getId());
    RowKey endRowKey = RowKey.createBeyondMax(table.getId());

    while (key.compareTo(endRowKey) < 0) {
      TiRegion region = session.getRegionManager().getRegionByKey(key.toByteString());
      regionList.add(region);
      key = Key.toRawKey(region.getEndKey());
    }
    return regionList;
  }

it's better to use ScanRegions API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions