Skip to content

Commit a400a66

Browse files
tomscutwenwj0
authored andcommitted
HBASE-27066 The Region Visualizer display failed (apache#4472)
Signed-off-by: Andrew Purtell <apurtell@apache.org>
1 parent 9936c39 commit a400a66

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ AssignmentManager assignmentManager = master.getAssignmentManager();
278278
</section>
279279
<section>
280280
<h2><a name="region_visualizer"></a>Region Visualizer</h2>
281-
<& RegionVisualizerTmpl &>
281+
<& RegionVisualizerTmpl; master = master &>
282282
</section>
283283
<section>
284284
<h2><a name="peers">Peers</a></h2>

hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/RegionVisualizerTmpl.jamon

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,21 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1616
See the License for the specific language governing permissions and
1717
limitations under the License.
1818
</%doc>
19+
<%args>
20+
HMaster master;
21+
</%args>
22+
<%import>
23+
org.apache.hadoop.hbase.master.HMaster;
24+
org.apache.hadoop.hbase.ServerName;
25+
org.apache.hbase.thirdparty.com.google.common.base.Preconditions;
26+
</%import>
27+
28+
<%java>
29+
ServerName active_master = master.getActiveMaster().orElse(null);
30+
Preconditions.checkState(active_master != null, "Failed to retrieve active master's ServerName!");
31+
String activeHostname = active_master.getHostname();
32+
int activeInfoPort = master.getActiveMasterInfoPort();
33+
</%java>
1934

2035
<script type="text/javascript" src="/static/js/vega@5.19.1.min.js"></script>
2136
<script type="text/javascript" src="/static/js/vega-lite@5.0.0.min.js"></script>
@@ -29,7 +44,7 @@ limitations under the License.
2944
description: 'Total `storefileSize` per Region Server',
3045
data: {
3146
name: 'region_info',
32-
url: 'http://localhost:16010/api/v1/admin/cluster_metrics/live_servers',
47+
url: 'http://<% activeHostname %>:<% activeInfoPort %>/api/v1/admin/cluster_metrics/live_servers',
3348
format: { type: 'json', property: 'data' }
3449
},
3550
transform: [

0 commit comments

Comments
 (0)