Procházet zdrojové kódy

AMBARI-10081 Jobs View: Record counters (read/write) not being generated for Hive queries. (atkach)

Andrii Tkach před 10 roky
rodič
revize
8bba8c7e27

+ 4 - 4
contrib/views/jobs/src/main/resources/ui/app/scripts/helpers/jobs.js

@@ -221,10 +221,10 @@ App.Helpers.jobs = {
                       };
                       break;
                     case 'HIVE':
-                      cNameToPropetyMap = {
-                        'RECORDS_READ': 'recordReadCount',
-                        'RECORDS_WRITE': 'recordWriteCount'
-                      };
+                      var vertexNameFormatted = App.Helpers.string.convertSpacesToUnderscores(data.otherinfo.vertexName);
+                      cNameToPropetyMap = {};
+                      cNameToPropetyMap['RECORDS_IN_' + vertexNameFormatted] = 'recordReadCount';
+                      cNameToPropetyMap['RECORDS_OUT_' + vertexNameFormatted] = 'recordWriteCount';
                       break;
                     default:
                       break;

+ 10 - 0
contrib/views/jobs/src/main/resources/ui/app/scripts/helpers/string.js

@@ -99,6 +99,16 @@ App.Helpers.string = {
       }
     }
     return value;
+  },
+
+  /**
+   * Convert spaces to underscores
+   * @method convertSpacesToUnderscores
+   * @param {string} str
+   * @returns {string}
+   */
+  convertSpacesToUnderscores: function (str) {
+    return Em.isNone(str) ? '' : str.replace(' ', '_');
   }
 
 };

+ 2 - 2
contrib/views/jobs/src/main/resources/ui/app/scripts/views/job/hive_job_details_view.js

@@ -180,8 +180,8 @@ App.JobView = Em.View.extend({
   summaryMetricTypesDisplay: [
     Em.I18n.t('jobs.hive.tez.metric.input'),
     Em.I18n.t('jobs.hive.tez.metric.output'),
-    /* Em.I18n.t('jobs.hive.tez.metric.recordsRead'),
-     Em.I18n.t('jobs.hive.tez.metric.recordsWrite'), */
+    Em.I18n.t('jobs.hive.tez.metric.recordsRead'),
+    Em.I18n.t('jobs.hive.tez.metric.recordsWrite'),
     Em.I18n.t('jobs.hive.tez.metric.tezTasks'),
     Em.I18n.t('jobs.hive.tez.metric.spilledRecords')
   ],