In the Admin interface there is a getClusterMetrics method, the return
value is ClusterMetrics, which contains the Region-In-Transation
information.

Make sure that you call the method
with ClusterMetrics.Option.REGIONS_IN_TRANSITION.

Hope this could help.

Thanks.

Debraj Manna <[email protected]> 于2020年4月16日周四 下午4:57写道:

> Thanks for replying.
>
> What is the proto that is now stored under /hbase/region-in-transition as
> explained in the 2.1 documentation
> <
> https://hbase.apache.org/2.1/book.html#regionserver_splitting_implementation
> >?
> I do not observe any change in that section as compared to 1.2
> documentation.
>
> We have some automation script like below in 1.2 that identifies the
> transition status of a region using the ZooKeeperProtos.RegionTransition
> from /hbase/region-in-transition
>
> // RS_ZK_REGION_SPLITTING, RS_ZK_REGION_SPLIT, RS_ZK_REQUEST_REGION_SPLIT
> final Set<String> eventTypesToCheck = new HashSet()
>
> String REGION_IN_TRANSITION_PATH = "/hbase/region-in-transition";
> conn = new ZooKeeperConnection();
> zk = conn.connect(zkConnectStr);
> final Stat stat = zk.exists(REGION_IN_TRANSITION_PATH, false);
> if (stat == null) {
>     return;
> }
> final List<String> regions = zk.getChildren(REGION_IN_TRANSITION_PATH,
> false);
> if (NullOrEmpty.isTrue(regions)) {
>     return;
> }
>
> final Stat stat = zk.exists(REGION_IN_TRANSITION_PATH, false);
> if (stat == null) {
>     return
> }
> final List<String> regions = zk.getChildren(REGION_IN_TRANSITION_PATH,
> false);
> if (NullOrEmpty.isTrue(regions)) {
>     return;
> }
> for (final String region : regions) {
>     final String childPath = REGION_IN_TRANSITION_PATH + "/" + region;
>     Stat childStat = zk.exists(childPath, false);
>     if (childStat == null) {
>             continue;
>     }
>     // Get data from child node
>     final byte[] regionData = zk.getData(childPath, false, childStat);
>     if (regionData == null || regionData.length == 0) {
>         continue;
>     }
>
>     final int protoStart = Bytes.indexOf(regionData,
> ProtobufUtil.PB_MAGIC);
>     if (protoStart < 0) {
>         continue;
>     }
>     final byte[] protoBytes = Arrays.copyOfRange(regionData, protoStart +
> ProtobufUtil.PB_MAGIC.length, regionData.length);
>     final ZooKeeperProtos.RegionTransition regionTransition =
> ZooKeeperProtos.RegionTransition.parseFrom(protoBytes);
>     logger.info("Region in transition data for region:" + region + ":\n" +
> regionTransition.toString());
>     if (eventTypesToCheck.contains(String.valueOf(
>  regionTransition.getEventTypeCode()))) {
>         logger.warn("Found region in transition having event type: " +
> regionTransition.getEventTypeCode());
>
>     }
> }
>
>
>
> On Thu, Apr 16, 2020 at 12:42 PM 张铎(Duo Zhang) <[email protected]>
> wrote:
>
> > It was deleted by this commit
> >
> >
> >
> https://github.com/apache/hbase/commit/17dff6818e80305ea55da0519cbcf44de644992e#diff-7ccbd2d3c7ec87835d40c8a18b90e0e9
> >
> >
> > The related issue is: https://issues.apache.org/jira/browse/HBASE-11611
> >
> > As we do not use zk based assignment any more on hbase 2.x, I'm afraid
> > there is no straight alternative.
> >
> > What is your usage on this proto?
> >
> > Thanks.
> >
> > Debraj Manna <[email protected]> 于2020年4月16日周四 下午12:19写道:
> >
> > > I am trying to upgrade Hbase 1.2 to 2.1.
> > >
> > > Can someone let me know is there any place where I can find the proto
> > > changes?
> > >
> > > For example in 1.2 there was a ZooKeeperProtos.RegionTransition but in
> > 2.1
> > > this class is missing. Can someone let me know if it is moved to a
> > > different dependency or what is its alternative?
> > >
> >
>

Reply via email to