This is an automated email from the ASF dual-hosted git repository. sunilg pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push: new 7f46dda YARN-8947. [UI2] Active User info missing from UI2. Contributed by Akhil PB. 7f46dda is described below commit 7f46dda513fb79c349acb73bdb90b689df9cc18d Author: Sunil G <sun...@apache.org> AuthorDate: Mon Jun 3 12:24:20 2019 +0530 YARN-8947. [UI2] Active User info missing from UI2. Contributed by Akhil PB. --- .../src/main/webapp/app/models/yarn-user.js | 11 ++++- .../app/serializers/yarn-queue/capacity-queue.js | 11 +++++ .../src/main/webapp/app/styles/app.scss | 18 +++++++++ .../main/webapp/app/templates/yarn-queue/apps.hbs | 47 +++++++++++++++++++++- 4 files changed, 84 insertions(+), 3 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-user.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-user.js index 84b0fab..9016e92 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-user.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-user.js @@ -22,5 +22,14 @@ export default DS.Model.extend({ name: DS.attr('string'), queueName: DS.attr('string'), usedMemoryMB: DS.attr('number'), - usedVCore: DS.attr('number') + usedVCore: DS.attr('number'), + maxMemoryMB: DS.attr('number'), + maxVCore: DS.attr('number'), + amUsedMemoryMB: DS.attr('number'), + amUsedVCore: DS.attr('number'), + maxAMMemoryMB: DS.attr('number'), + maxAMVCore: DS.attr('number'), + userWeight: DS.attr('string'), + activeApps: DS.attr('number'), + pendingApps: DS.attr('number') }); \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-queue/capacity-queue.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-queue/capacity-queue.js index 57714e3..2dec520 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-queue/capacity-queue.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-queue/capacity-queue.js @@ -36,6 +36,8 @@ export default DS.JSONAPISerializer.extend({ // update user models if (payload.users && payload.users.user) { payload.users.user.forEach(function(u) { + var defaultPartitionResource = u.resources.resourceUsagesByPartition[0]; + var maxAMResource = defaultPartitionResource.amLimit; includedData.push({ type: "YarnUser", id: u.username + "_" + payload.queueName, @@ -44,6 +46,15 @@ export default DS.JSONAPISerializer.extend({ queueName: payload.queueName, usedMemoryMB: u.resourcesUsed.memory || 0, usedVCore: u.resourcesUsed.vCores || 0, + maxMemoryMB: u.userResourceLimit.memory || 0, + maxVCore: u.userResourceLimit.vCores || 0, + amUsedMemoryMB: u.AMResourceUsed.memory || 0, + amUsedVCore: u.AMResourceUsed.vCores || 0, + maxAMMemoryMB: maxAMResource.memory || 0, + maxAMVCore: maxAMResource.vCores || 0, + userWeight: u.userWeight || '', + activeApps: u.numActiveApplications || 0, + pendingApps: u.numPendingApplications || 0 } }); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/styles/app.scss b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/styles/app.scss index 01dc9f5..59e437a 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/styles/app.scss +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/styles/app.scss @@ -754,4 +754,22 @@ div.loggedin-user { border: none; border-radius: 2px; } +} + +/** + * Active User Info table styles + */ +.active-user-panel { + margin-top: 10px; +} + +table.active-user-table { + border: 1px solid #ddd; + > thead > tr > th { + background-color: #f7f7f7; + } + &.table-bordered > thead > tr > th, + &.table-bordered > tbody > tr > td { + border: 1px solid #dcdcdc !important; + } } \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-queue/apps.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-queue/apps.hbs index 97820c9..dc5413e 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-queue/apps.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-queue/apps.hbs @@ -17,7 +17,7 @@ }} <div class="row"> - <div class="col-lg-12"> + <div class="col-lg-12 col-md-12"> <div class="row"> {{#if (eq model.queues.firstObject.type "capacity")}} {{yarn-queue.capacity-queue-info model=model}} @@ -28,7 +28,7 @@ {{/if}} </div> </div> - <div class="col-lg-12 yarn-applications-container"> + <div class="col-lg-12 col-md-12 yarn-applications-container"> {{#if model.apps}} {{em-table columns=columns rows=model.apps definition=tableDefinitio}} {{else}} @@ -38,4 +38,47 @@ </div> {{/if}} </div> + {{!-- Active User Info --}} + {{#if model.selectedQueue.users}} + <div class="col-lg-12 col-md-12"> + <div class="panel panel-default active-user-panel"> + <div class="panel-heading"> + Active User Info: {{ model.selected }} + </div> + <div class="panel-body"> + <table class="table table-striped table-bordered active-user-table"> + <thead> + <tr> + <th>User Name</th> + <th>Max Resource</th> + <th>Used Resource</th> + <th>Max AM Resource</th> + <th>Used AM Resource</th> + <th>Active Apps</th> + <th>Pending Apps</th> + <th>Weight</th> + </tr> + </thead> + <tbody> + <tr style="display: none"> + {{!-- Fix to start odd row background color from third row --}} + </tr> + {{#each model.selectedQueue.users as |user|}} + <tr> + <td>{{ user.name }}</td> + <td><memory: {{user.maxMemoryMB}} MB, vCores: {{user.maxVCore}}></td> + <td><memory: {{user.usedMemoryMB}} MB, vCores: {{user.usedVCore}}></td> + <td><memory: {{user.maxAMMemoryMB}} MB, vCores: {{user.maxAMVCore}}></td> + <td><memory: {{user.amUsedMemoryMB}} MB, vCores: {{user.amUsedVCore}}></td> + <td>{{user.activeApps}}</td> + <td>{{user.pendingApps}}</td> + <td>{{user.userWeight}}</td> + </tr> + {{/each}} + </tbody> + </table> + </div> + </div> + </div> + {{/if}} </div> --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org