saintstack commented on a change in pull request #775: HBASE-23230 Enforce
member visibility in HRegionServer
URL: https://github.com/apache/hbase/pull/775#discussion_r340817211
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
##########
@@ -2285,42 +2245,49 @@ public void postOpenDeployTasks(final
PostOpenDeployContext context) throws IOEx
LOG.debug("Finished post open deploy task for " +
r.getRegionInfo().getRegionNameAsString());
}
- @Override
- public boolean reportRegionStateTransition(final
RegionStateTransitionContext context) {
- TransitionCode code = context.getCode();
- long openSeqNum = context.getOpenSeqNum();
+ /**
+ * Helper method for use in tests. Skip the region transition report when
there's no master
+ * around to receive it.
+ */
+ private boolean skipReportingTransition(final RegionStateTransitionContext
context) {
+ final TransitionCode code = context.getCode();
+ final long openSeqNum = context.getOpenSeqNum();
long masterSystemTime = context.getMasterSystemTime();
- RegionInfo[] hris = context.getHris();
- long[] procIds = context.getProcIds();
-
- if (TEST_SKIP_REPORTING_TRANSITION) {
- // This is for testing only in case there is no master
- // to handle the region transition report at all.
- if (code == TransitionCode.OPENED) {
- Preconditions.checkArgument(hris != null && hris.length == 1);
- if (hris[0].isMetaRegion()) {
- try {
- MetaTableLocator.setMetaLocation(getZooKeeper(), serverName,
- hris[0].getReplicaId(),State.OPEN);
- } catch (KeeperException e) {
- LOG.info("Failed to update meta location", e);
- return false;
- }
- } else {
- try {
-
MetaTableAccessor.updateRegionLocation(asyncClusterConnection.toConnection(),
hris[0],
+ final RegionInfo[] hris = context.getHris();
+
+ if (code == TransitionCode.OPENED) {
+ Preconditions.checkArgument(hris != null && hris.length == 1);
+ if (hris[0].isMetaRegion()) {
+ try {
+ MetaTableLocator.setMetaLocation(getZooKeeper(), serverName,
+ hris[0].getReplicaId(),State.OPEN);
+ } catch (KeeperException e) {
+ LOG.info("Failed to update meta location", e);
+ return false;
+ }
+ } else {
+ try {
+
MetaTableAccessor.updateRegionLocation(asyncClusterConnection.toConnection(),
hris[0],
serverName, openSeqNum, masterSystemTime);
- } catch (IOException e) {
- LOG.info("Failed to update meta", e);
- return false;
- }
+ } catch (IOException e) {
+ LOG.info("Failed to update meta", e);
+ return false;
}
}
- return true;
}
+ return true;
+ }
+
+ private ReportRegionStateTransitionRequest
createReportRegionStateTransitionRequest(
+ final RegionStateTransitionContext context
+ ) {
Review comment:
Odd on different line....
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services