[
https://issues.apache.org/jira/browse/HBASE-21987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16788569#comment-16788569
]
Hudson commented on HBASE-21987:
--------------------------------
Results for branch branch-2.2
[build #96 on
builds.a.o|https://builds.apache.org/job/HBase%20Nightly/job/branch-2.2/96/]:
(x) *{color:red}-1 overall{color}*
----
details (if available):
(/) {color:green}+1 general checks{color}
-- For more information [see general
report|https://builds.apache.org/job/HBase%20Nightly/job/branch-2.2/96//General_Nightly_Build_Report/]
(x) {color:red}-1 jdk8 hadoop2 checks{color}
-- For more information [see jdk8 (hadoop2)
report|https://builds.apache.org/job/HBase%20Nightly/job/branch-2.2/96//JDK8_Nightly_Build_Report_(Hadoop2)/]
(/) {color:green}+1 jdk8 hadoop3 checks{color}
-- For more information [see jdk8 (hadoop3)
report|https://builds.apache.org/job/HBase%20Nightly/job/branch-2.2/96//JDK8_Nightly_Build_Report_(Hadoop3)/]
(x) {color:red}-1 source release artifact{color}
-- See build output for details.
(x) {color:red}-1 client integration test{color}
-- Something went wrong with this stage, [check relevant console
output|https://builds.apache.org/job/HBase%20Nightly/job/branch-2.2/96//console].
> Simplify RSGroupInfoManagerImpl#flushConfig() for offline mode
> --------------------------------------------------------------
>
> Key: HBASE-21987
> URL: https://issues.apache.org/jira/browse/HBASE-21987
> Project: HBase
> Issue Type: Improvement
> Components: rsgroup
> Reporter: Xiang Li
> Assignee: Xiang Li
> Priority: Minor
> Labels: rsgroup
> Attachments: HBASE-21987.branch-1.000.patch,
> HBASE-21987.master.000.patch, HBASE-21987.master.001.patch,
> HBASE-21987.master.002.patch, HBASE-21987.master.003.patch,
> HBASE-21987.master.004.patch
>
>
> The logic to handle offline mode in
> RSGroupInfoManagerImpl#flushConfig(Map<String, RSGroupInfo> newGroupMap)
> could be simplified.
> {code:title=RSGroupInfoManagerImpl.java # flushConfig(Map<String,
> RSGroupInfo> newGroupMap)|borderStyle=solid}
> if (!isOnline()) {
> Map<String, RSGroupInfo> m = Maps.newHashMap(rsGroupMap);
> RSGroupInfo oldDefaultGroup = m.remove(RSGroupInfo.DEFAULT_GROUP);
> RSGroupInfo newDefaultGroup =
> newGroupMap.remove(RSGroupInfo.DEFAULT_GROUP);
> if (!m.equals(newGroupMap) ||
> !oldDefaultGroup.getTables().equals(newDefaultGroup.getTables())) {
> throw new IOException("Only default servers can be updated during
> offline mode");
> }
> newGroupMap.put(RSGroupInfo.DEFAULT_GROUP, newDefaultGroup);
> rsGroupMap = newGroupMap;
> return;
> }
> {code}
> The logic is to make a copy of the private member called "rsGroupMap" as m,
> and get the default group out of m and newGroupMap and then compare. Then
> restore the newGroupMap and update rsGroupMap.
> This function is called by
> {code:title=RSGroupInfoManagerImpl.java # flushConfig() |borderStyle=solid}
> private synchronized void flushConfig() throws IOException {
> flushConfig(this.rsGroupMap);
> }
> {code}
> by RSGroupInfoManagerImpl.RSGroupStartupWorker#waitForGroupTableOnline()
> during HMaster starts, in which, newGroupMap (the input of flushConfig()) is
> this.rsGroupMap, the comparison is not needed, because they are the same.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)