HDFS-15013. Reduce NameNode overview tab response time. Contributed by HuangTao.
This commit is contained in:
parent
0384687811
commit
44f7b9159d
@ -65,8 +65,9 @@
|
||||
};
|
||||
|
||||
var data = {};
|
||||
var non_ha = false;
|
||||
|
||||
$.ajax({'url': '/conf', 'dataType': 'xml', 'async': false}).done(
|
||||
$.ajax({'url': '/conf', 'dataType': 'xml', 'async': true}).done(
|
||||
function(d) {
|
||||
var $xml = $(d);
|
||||
var namespace, nnId;
|
||||
@ -80,6 +81,8 @@
|
||||
});
|
||||
if (namespace && nnId) {
|
||||
data['HAInfo'] = {"Namespace": namespace, "NamenodeID": nnId};
|
||||
} else {
|
||||
non_ha = true;
|
||||
}
|
||||
});
|
||||
|
||||
@ -109,7 +112,17 @@
|
||||
|
||||
data.fs.ObjectsTotal = data.fs.FilesTotal + data.fs.BlocksTotal;
|
||||
|
||||
render();
|
||||
var wait_for_conf = setInterval(function() {
|
||||
if (non_ha ||
|
||||
(('HAInfo' in data) &&
|
||||
("Namespace" in data['HAInfo']) &&
|
||||
("NamenodeID" in data['HAInfo'])
|
||||
)
|
||||
) {
|
||||
render();
|
||||
clearInterval(wait_for_conf);
|
||||
}
|
||||
}, 5);
|
||||
}),
|
||||
function (url, jqxhr, text, err) {
|
||||
show_err_msg('<p>Failed to retrieve data from ' + url + ', cause: ' + err + '</p>');
|
||||
|
Loading…
Reference in New Issue
Block a user