private ReportRegionStateTransitionRequest
    createReportRegionStateTransitionRequest(final RegionStateTransitionContext context) {
    final TransitionCode code = context.getCode();
    final long openSeqNum = context.getOpenSeqNum();
    final RegionInfo[] hris = context.getHris();
    final long[] procIds = context.getProcIds();

    ReportRegionStateTransitionRequest.Builder builder =
      ReportRegionStateTransitionRequest.newBuilder();
    builder.setServer(ProtobufUtil.toServerName(serverName));
    RegionStateTransition.Builder transition = builder.addTransitionBuilder();
    transition.setTransitionCode(code);
    if (code == TransitionCode.OPENED && openSeqNum >= 0) {
      transition.setOpenSeqNum(openSeqNum);
    }
    for (RegionInfo hri : hris) {
      transition.addRegionInfo(ProtobufUtil.toRegionInfo(hri));
    }
    for (long procId : procIds) {
      transition.addProcId(procId);
    }
    transition.setInitiatingMasterActiveTime(context.getInitiatingMasterActiveTime());

    return builder.build();
  }
Helper method for use in tests. Skip the region transition report when there's no master around
to receive it.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java