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
2a59ebffaa
commit
f0dcbe78a7
|
@ -24,12 +24,13 @@ java.util.*;
|
|||
org.apache.hadoop.hbase.ServerName;
|
||||
org.apache.hadoop.hbase.ClusterMetrics;
|
||||
org.apache.hadoop.hbase.master.HMaster;
|
||||
org.apache.hbase.thirdparty.com.google.common.base.Preconditions;
|
||||
</%import>
|
||||
<%if (!master.isActiveMaster()) %>
|
||||
<%java>
|
||||
ServerName active_master = master.getActiveMaster().orElse(null);
|
||||
assert active_master != null : "Failed to retrieve active master's ServerName!";
|
||||
int activeInfoPort = active_master == null ? 0 : master.getActiveMasterInfoPort();
|
||||
Preconditions.checkState(active_master != null, "Failed to retrieve active master's ServerName!");
|
||||
int activeInfoPort = master.getActiveMasterInfoPort();
|
||||
</%java>
|
||||
<div class="row inner_header">
|
||||
<div class="page-header">
|
||||
|
|
Loading…
Reference in New Issue