HBASE-27068 NPE occurs when the active master has not yet been elected (#4474)
Signed-off-by: Pankaj Kumar <pankajkumar@apache.org> Signed-off-by: Viraj Jasani<virajjasani@apache.org
This commit is contained in:
parent
88d9c4bef4
commit
d532135a26
|
@ -24,12 +24,13 @@ java.util.*;
|
||||||
org.apache.hadoop.hbase.ServerName;
|
org.apache.hadoop.hbase.ServerName;
|
||||||
org.apache.hadoop.hbase.ClusterMetrics;
|
org.apache.hadoop.hbase.ClusterMetrics;
|
||||||
org.apache.hadoop.hbase.master.HMaster;
|
org.apache.hadoop.hbase.master.HMaster;
|
||||||
|
org.apache.hbase.thirdparty.com.google.common.base.Preconditions;
|
||||||
</%import>
|
</%import>
|
||||||
<%if (!master.isActiveMaster()) %>
|
<%if (!master.isActiveMaster()) %>
|
||||||
<%java>
|
<%java>
|
||||||
ServerName active_master = master.getActiveMaster().orElse(null);
|
ServerName active_master = master.getActiveMaster().orElse(null);
|
||||||
assert active_master != null : "Failed to retrieve active master's ServerName!";
|
Preconditions.checkState(active_master != null, "Failed to retrieve active master's ServerName!");
|
||||||
int activeInfoPort = active_master == null ? 0 : master.getActiveMasterInfoPort();
|
int activeInfoPort = master.getActiveMasterInfoPort();
|
||||||
</%java>
|
</%java>
|
||||||
<div class="row inner_header">
|
<div class="row inner_header">
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
|
|
Loading…
Reference in New Issue