Author: yusaku
Date: Fri Jan 11 02:59:13 2013
New Revision: 1431841
URL: http://svn.apache.org/viewvc?rev=1431841&view=rev
Log:
AMBARI-1145. Cluster Management refactoring. (yusaku)
Modified:
incubator/ambari/trunk/ambari-web/app/controllers/wizard/step9_controller.js
incubator/ambari/trunk/ambari-web/app/messages.js
incubator/ambari/trunk/ambari-web/app/styles/application.less
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/hbase.hbs
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/hdfs.hbs
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/mapreduce.hbs
incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service.js
incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/hbase.js
incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/hdfs.js
incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/mapreduce.js
Modified:
incubator/ambari/trunk/ambari-web/app/controllers/wizard/step9_controller.js
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/wizard/step9_controller.js?rev=1431841&r1=1431840&r2=1431841&view=diff
==============================================================================
---
incubator/ambari/trunk/ambari-web/app/controllers/wizard/step9_controller.js
(original)
+++
incubator/ambari/trunk/ambari-web/app/controllers/wizard/step9_controller.js
Fri Jan 11 02:59:13 2013
@@ -120,7 +120,7 @@ App.WizardStep9Controller = Em.Controlle
var hosts = new Ember.Set();
for (var index in hostInfo) {
var obj = Em.Object.create(hostInfo[index]);
- //obj.message = '';
+ obj.message = (obj.message) ? obj.message : 'Waiting';
obj.progress = 0;
obj.status = (obj.status) ? obj.status : 'info';
obj.tasks = [];
Modified: incubator/ambari/trunk/ambari-web/app/messages.js
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/messages.js?rev=1431841&r1=1431840&r2=1431841&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/messages.js (original)
+++ incubator/ambari/trunk/ambari-web/app/messages.js Fri Jan 11 02:59:13 2013
@@ -272,6 +272,8 @@ Em.I18n.translations = {
'services.service.actions.run.smoke':'Run Smoke Test',
'services.service.actions.maintenance':'Maintenance',
'services.service.summary.unknown':'unknown',
+ 'services.service.summary.notRunning':'Not Running',
+ 'services.service.summary.notAvailable':'n/a',
'services.add.header':'Add Service Wizard',
Modified: incubator/ambari/trunk/ambari-web/app/styles/application.less
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/styles/application.less?rev=1431841&r1=1431840&r2=1431841&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/styles/application.less (original)
+++ incubator/ambari/trunk/ambari-web/app/styles/application.less Fri Jan 11
02:59:13 2013
@@ -711,6 +711,7 @@ a:focus {
background-position: 6px 5px;
background-repeat: no-repeat;
list-style: none;
+ float:left;
min-height: 20px;
min-width: 20px;
margin-left: 0;
@@ -1062,6 +1063,7 @@ a:focus {
background-position: 6px 5px;
background-repeat: no-repeat;
list-style: none;
+ float: left;
height: 20px;
width: 20px;
margin-left: 0;
Modified:
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/hbase.hbs
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/hbase.hbs?rev=1431841&r1=1431840&r2=1431841&view=diff
==============================================================================
---
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/hbase.hbs
(original)
+++
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/hbase.hbs
Fri Jan 11 02:59:13 2013
@@ -54,7 +54,7 @@
<!-- Version -->
<tr>
<td>{{t dashboard.services.hbase.version}}</td>
- <td>{{view.service.version}} {{view.service.revision}}</td>
+ <td>{{view.version}} {{view.service.revision}}</td>
</tr>
<!-- HBaseMaster Web UI -->
<tr>
Modified:
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/hdfs.hbs
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/hdfs.hbs?rev=1431841&r1=1431840&r2=1431841&view=diff
==============================================================================
---
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/hdfs.hbs
(original)
+++
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/hdfs.hbs
Fri Jan 11 02:59:13 2013
@@ -62,7 +62,7 @@
<!-- Version -->
<tr>
<td>{{t dashboard.services.hdfs.version}}</td>
- <td>{{view.service.version}}</td>
+ <td>{{view.version}}</td>
</tr>
<!-- NameNode Web UI -->
<tr>
@@ -97,21 +97,21 @@
<!-- Blocks Total -->
<tr>
<td>{{t services.service.summary.blocksTotal}}</td>
- <td>{{view.service.dfsTotalBlocks}}</td>
+ <td>{{view.dfsTotalBlocks}}</td>
</tr>
<!-- Block Errors -->
<tr>
<td>{{t services.service.summary.blockErrors}}</td>
<td>
- {{view.service.dfsCorruptBlocks}} corrupt /
- {{view.service.dfsMissingBlocks}} missing /
- {{view.service.dfsUnderReplicatedBlocks}} under replicated
+ {{view.dfsCorruptBlocks}} corrupt /
+ {{view.dfsMissingBlocks}} missing /
+ {{view.dfsUnderReplicatedBlocks}} under replicated
</td>
</tr>
<!-- Total Files And Directories -->
<tr>
<td>{{t dashboard.services.hdfs.totalFilesAndDirs}}</td>
- <td>{{view.service.dfsTotalFiles}}</td>
+ <td>{{view.dfsTotalFiles}}</td>
</tr>
<!-- Upgrade Status -->
<tr>
Modified:
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/mapreduce.hbs
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/mapreduce.hbs?rev=1431841&r1=1431840&r2=1431841&view=diff
==============================================================================
---
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/mapreduce.hbs
(original)
+++
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/mapreduce.hbs
Fri Jan 11 02:59:13 2013
@@ -54,7 +54,7 @@
<!-- Version -->
<tr>
<td>{{t dashboard.services.hdfs.version}}</td>
- <td>{{view.service.version}}</td>
+ <td>{{view.version}}</td>
</tr>
<!-- JobTracker Web UI -->
<tr>
Modified: incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service.js
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service.js?rev=1431841&r1=1431840&r2=1431841&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service.js
(original)
+++ incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service.js Fri
Jan 11 02:59:13 2013
@@ -22,7 +22,7 @@ require('models/alert');
App.MainDashboardServiceHealthView = Em.View.extend({
classNameBindings: ["healthStatus"],
- template: Em.Handlebars.compile(""),
+ //template: Em.Handlebars.compile(""),
blink: false,
tagName: 'span',
@@ -71,7 +71,7 @@ App.MainDashboardServiceHealthView = Em.
break;
}
- return 'health-status-' + status + " span";
+ return 'health-status-' + status;
}.property('service.healthStatus'),
didInsertElement: function () {
@@ -86,6 +86,10 @@ App.MainDashboardServiceView = Em.View.e
return this.get('controller.data.' + this.get('serviceName'));
}.property('controller.data'),
+ formatUnavailable: function(value){
+ return (value || value == 0) ? value :
this.t('services.service.summary.notAvailable');
+ },
+
criticalAlertsCount: function () {
var alerts = App.router.get('clusterController.alerts');
return alerts.filterProperty('serviceType',
this.get('service.id')).filterProperty('isOk', false).length;
Modified:
incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/hbase.js
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/hbase.js?rev=1431841&r1=1431840&r2=1431841&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/hbase.js
(original)
+++ incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/hbase.js
Fri Jan 11 02:59:13 2013
@@ -31,6 +31,10 @@ App.MainDashboardServiceHbaseView = App.
return
this.t('dashboard.services.hbase.masterServerHeap.summary').format(heapString,
heapMaxString, percent.toFixed(1));
}.property('service.heapMemoryUsed', 'service.heapMemoryMax'),
+ version: function(){
+ return this.formatUnavailable(this.get('service.version'));
+ }.property('service.version'),
+
summaryHeader: function () {
var avgLoad = this.get('service.averageLoad');
if (avgLoad == null) {
@@ -46,7 +50,7 @@ App.MainDashboardServiceHbaseView = App.
averageLoad: function () {
var avgLoad = this.get('service.averageLoad');
if (avgLoad == null) {
- avgLoad = this.t('services.service.summary.unknown');
+ avgLoad = this.t('services.service.summary.notAvailable');
}
return
this.t('dashboard.services.hbase.averageLoadPerServer').format(avgLoad);
}.property("service.averageLoad"),
@@ -61,7 +65,7 @@ App.MainDashboardServiceHbaseView = App.
var formatted = date.timingFormat(diff);
return this.t('dashboard.services.uptime').format(formatted);
}
- return this.t('services.service.summary.unknown');
+ return this.t('services.service.summary.notRunning');
}.property("service.masterStartTime"),
masterActivatedTime: function () {
@@ -74,7 +78,7 @@ App.MainDashboardServiceHbaseView = App.
var formatted = date.timingFormat(diff);
return this.t('dashboard.services.uptime').format(formatted);
}
- return this.t('services.service.summary.unknown');
+ return this.t('services.service.summary.notRunning');
}.property("service.masterActiveTime"),
regionServerComponent: function () {
Modified:
incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/hdfs.js
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/hdfs.js?rev=1431841&r1=1431840&r2=1431841&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/hdfs.js
(original)
+++ incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/hdfs.js
Fri Jan 11 02:59:13 2013
@@ -31,14 +31,36 @@ App.MainDashboardServiceHdfsView = App.M
}.property('service.capacityUsed', 'service.capacityTotal')
}),
+ version: function(){
+ return this.formatUnavailable(this.get('service.version'));
+ }.property('service.version'),
+ dfsTotalBlocks: function(){
+ return this.formatUnavailable(this.get('service.dfsTotalBlocks'));
+ }.property('service.dfsTotalBlocks'),
+ dfsTotalFiles: function(){
+ return this.formatUnavailable(this.get('service.dfsTotalFiles'));
+ }.property('service.dfsTotalFiles'),
+ dfsCorruptBlocks: function(){
+ return this.formatUnavailable(this.get('service.dfsCorruptBlocks'));
+ }.property('service.dfsCorruptBlocks'),
+ dfsMissingBlocks: function(){
+ return this.formatUnavailable(this.get('service.dfsMissingBlocks'));
+ }.property('service.dfsMissingBlocks'),
+ dfsUnderReplicatedBlocks: function(){
+ return
this.formatUnavailable(this.get('service.dfsUnderReplicatedBlocks'));
+ }.property('service.dfsUnderReplicatedBlocks'),
+
nodeUptime: function () {
var uptime = this.get('service').get('nameNodeStartTime');
- var diff = (new Date()).getTime() - uptime;
- if (diff < 0) {
- diff = 0;
+ if (uptime && uptime > 0){
+ var diff = (new Date()).getTime() - uptime;
+ if (diff < 0) {
+ diff = 0;
+ }
+ var formatted = date.timingFormat(diff);
+ return this.t('dashboard.services.uptime').format(formatted);
}
- var formatted = date.timingFormat(diff);
- return this.t('dashboard.services.uptime').format(formatted);
+ return this.t('services.service.summary.notRunning');
}.property("service.nameNodeStartTime"),
nodeWebUrl: function () {
Modified:
incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/mapreduce.js
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/mapreduce.js?rev=1431841&r1=1431840&r2=1431841&view=diff
==============================================================================
---
incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/mapreduce.js
(original)
+++
incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/mapreduce.js
Fri Jan 11 02:59:13 2013
@@ -31,14 +31,22 @@ App.MainDashboardServiceMapreduceView =
}.property('_parentView.data.chart')
}),
+ version: function(){
+ return this.formatUnavailable(this.get('service.version'));
+ }.property('service.version'),
+
jobTrackerUptime: function () {
var uptime = this.get('service').get('jobTrackerStartTime');
- var diff = (new Date()).getTime() - uptime;
- if (diff < 0) {
- diff = 0;
+ if (uptime && uptime > 0){
+ var diff = (new Date()).getTime() - uptime;
+ if (diff < 0) {
+ diff = 0;
+ }
+ var formatted = date.timingFormat(diff);
+ return this.t('dashboard.services.uptime').format(formatted);
+
}
- var formatted = date.timingFormat(diff);
- return this.t('dashboard.services.uptime').format(formatted);
+ return this.t('services.service.summary.notRunning');
}.property("service.jobTrackerStartTime"),
summaryHeader: function () {
@@ -60,8 +68,8 @@ App.MainDashboardServiceMapreduceView =
}.property('service.aliveTrackers', 'service.taskTrackers'),
trackersHeapSummary: function () {
- var heapUsed = this.get('service').get('jobTrackerHeapUsed') || 90;
- var heapMax = this.get('service').get('jobTrackerHeapMax') || 90;
+ var heapUsed = this.get('service').get('jobTrackerHeapUsed') || 0;
+ var heapMax = this.get('service').get('jobTrackerHeapMax') || 0;
var percent = heapMax > 0 ? 100 * heapUsed / heapMax : 0;
return
this.t('dashboard.services.mapreduce.jobTrackerHeapSummary').format(heapUsed.bytesToSize(1,
"parseFloat"), heapMax.bytesToSize(1, "parseFloat"), percent.toFixed(1));
}.property('service.jobTrackerHeapUsed', 'service.jobTrackerHeapMax'),
@@ -69,31 +77,31 @@ App.MainDashboardServiceMapreduceView =
jobsSummary: function () {
var svc = this.get('service');
var template = this.t('dashboard.services.mapreduce.jobsSummary');
- return template.format(svc.get('jobsSubmitted'), svc.get('jobsCompleted'));
+ return template.format(this.formatUnavailable(svc.get('jobsSubmitted')),
this.formatUnavailable(svc.get('jobsCompleted')));
}.property('service.jobsSubmitted', 'service.jobsCompleted'),
mapSlotsSummary: function () {
var svc = this.get('service');
var template = this.t('dashboard.services.mapreduce.mapSlotsSummary');
- return template.format(svc.get('mapSlotsOccupied'),
svc.get('mapSlotsReserved'));
+ return
template.format(this.formatUnavailable(svc.get('mapSlotsOccupied')),
this.formatUnavailable(svc.get('mapSlotsReserved')));
}.property('service.mapSlotsOccupied', 'service.mapSlotsReserved'),
reduceSlotsSummary: function () {
var svc = this.get('service');
var template = this.t('dashboard.services.mapreduce.reduceSlotsSummary');
- return template.format(svc.get('reduceSlotsOccupied'),
svc.get('reduceSlotsReserved'));
+ return
template.format(this.formatUnavailable(svc.get('reduceSlotsOccupied')),
this.formatUnavailable(svc.get('reduceSlotsReserved')));
}.property('service.reduceSlotsOccupied', 'service.reduceSlotsReserved'),
mapTasksSummary: function () {
var svc = this.get('service');
var template = this.t('dashboard.services.mapreduce.tasksSummary');
- return template.format(svc.get('mapsRunning'), svc.get('mapsWaiting'));
+ return template.format(this.formatUnavailable(svc.get('mapsRunning')),
this.formatUnavailable(svc.get('mapsWaiting')));
}.property('service.mapsRunning', 'service.mapsWaiting'),
reduceTasksSummary: function () {
var svc = this.get('service');
var template = this.t('dashboard.services.mapreduce.tasksSummary');
- return template.format(svc.get('reducesRunning'),
svc.get('reducesWaiting'));
+ return template.format(this.formatUnavailable(svc.get('reducesRunning')),
this.formatUnavailable(svc.get('reducesWaiting')));
}.property('service.reducesRunning', 'service.reducesWaiting'),
slotsCapacitySummary: function () {