liuml07 commented on a change in pull request #1485: HBASE-23969 Meta browser
should show all `info` columns
URL: https://github.com/apache/hbase/pull/1485#discussion_r409237003
##########
File path:
hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java
##########
@@ -966,6 +965,33 @@ public static ServerName getServerName(final Result r,
final int replicaId) {
}
}
+ /**
+ * Returns the {@link ServerName} from catalog table {@link Result} where
the region is
+ * transitioning on. It should be the same as {@link
MetaTableAccessor#getServerName(Result,int)}
+ * if the server is at OPEN state.
+ *
+ * @param r Result to pull the transitioning server name from
+ * @return A ServerName instance or {@link
MetaTableAccessor#getServerName(Result,int)}
+ * if necessary fields not found or empty.
+ */
+ @Nullable
+ public static ServerName getTargetServerName(final Result r, final int
replicaId) {
Review comment:
@saintstack This method is used so far by both `RegionStateStore` and
`RegionReplicaInfo` (new for table.jsp). So it can not be private to
RegoinStateStore. We can keep it there and make it public, or we move to
`MetaTableAccessor` which is more generic place for Read/write hbase:meta
operations. I see all `getXXColumn` and `getXX` stuff are static methods in
MetaTableAccessor which are similar to what this method does. So I moved the
logic reading "info:sn" columns to `MetaTableAccessor`.
This also came from my coding experience. When I write the first patch, I
implemented my version in MetaTableAccessor instead of calling the
implementation in RegoinStateStore. I simply did not know existing logic is
already someplace there. Meanwhile, both `RegionStateStore` and
`MetaTableAccessor` have their own `getServerNameColumn()` method. I guess
someone previously may have missed existing implementation as I did :) So
overall I prefer the central place of getting columns and data from hbase:meta.
But I understand this move makes it public in client module. If that is a
concern, I can move it back.
----------------------------------------------------------------
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