ambari git commit: AMBARI-21271. Add zeppelin.server.ssl.port in Zeppelin's setting. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 992104de8 -> f905cdb57 AMBARI-21271. Add zeppelin.server.ssl.port in Zeppelin's setting. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f905cdb5 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f905cdb5 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f905cdb5 Branch: refs/heads/branch-2.5 Commit: f905cdb57216e7445889d3014fa6e07510ab21a0 Parents: 992104d Author: Dipayan Bhowmick Authored: Wed Jun 21 16:42:20 2017 +0530 Committer: Dipayan Bhowmick Committed: Wed Jun 21 16:43:05 2017 +0530 -- .../ZEPPELIN/0.6.0.2.5/configuration/zeppelin-config.xml | 7 +++ .../main/resources/stacks/HDP/2.6/upgrades/config-upgrade.xml | 5 + ambari-server/src/test/python/stacks/2.6/configs/default.json | 3 ++- 3 files changed, 14 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/f905cdb5/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/configuration/zeppelin-config.xml -- diff --git a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/configuration/zeppelin-config.xml b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/configuration/zeppelin-config.xml index 85f1859..13d726b 100644 --- a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/configuration/zeppelin-config.xml +++ b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/configuration/zeppelin-config.xml @@ -33,6 +33,13 @@ +zeppelin.server.ssl.port +9995 +Server ssl port. (used when ssl property is set to true) + + + + zeppelin.notebook.dir notebook notebook persist http://git-wip-us.apache.org/repos/asf/ambari/blob/f905cdb5/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/config-upgrade.xml -- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/config-upgrade.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/config-upgrade.xml index df97727..1cbd78b 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/config-upgrade.xml +++ b/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/config-upgrade.xml @@ -26,6 +26,11 @@ + + +zeppelin-config + + http://git-wip-us.apache.org/repos/asf/ambari/blob/f905cdb5/ambari-server/src/test/python/stacks/2.6/configs/default.json -- diff --git a/ambari-server/src/test/python/stacks/2.6/configs/default.json b/ambari-server/src/test/python/stacks/2.6/configs/default.json index 2570657..add31d0 100644 --- a/ambari-server/src/test/python/stacks/2.6/configs/default.json +++ b/ambari-server/src/test/python/stacks/2.6/configs/default.json @@ -334,7 +334,8 @@ "zeppelin_group": "zeppelin" }, "zeppelin-config": { -"zeppelin.server.port": "9995", +"zeppelin.server.port": "9995", +"zeppelin.server.ssl.port": "9995", "zeppelin.ssl.truststore.password": "change me", "zeppelin.interpreters": "org.apache.zeppelin.spark.SparkInterpreter,org.apache.zeppelin.spark.PySparkInterpreter,org.apache.zeppelin.spark.SparkSqlInterpreter,org.apache.zeppelin.spark.DepInterpreter,org.apache.zeppelin.markdown.Markdown,org.apache.zeppelin.angular.AngularInterpreter,org.apache.zeppelin.shell.ShellInterpreter,org.apache.zeppelin.jdbc.JDBCInterpreter,org.apache.zeppelin.phoenix.PhoenixInterpreter,org.apache.zeppelin.livy.LivySparkInterpreter,org.apache.zeppelin.livy.LivyPySparkInterpreter,org.apache.zeppelin.livy.LivySparkRInterpreter,org.apache.zeppelin.livy.LivySparkSQLInterpreter", "zeppelin.interpreter.group.order": "spark,angular,jdbc,livy,md,sh",
ambari git commit: AMBARI-21271. Add zeppelin.server.ssl.port in Zeppelin's setting. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk 134406a65 -> e7fc3a648 AMBARI-21271. Add zeppelin.server.ssl.port in Zeppelin's setting. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e7fc3a64 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e7fc3a64 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e7fc3a64 Branch: refs/heads/trunk Commit: e7fc3a6481a66b7b81afd7c728ace895e1763c3c Parents: 134406a Author: Dipayan Bhowmick Authored: Wed Jun 21 16:42:20 2017 +0530 Committer: Dipayan Bhowmick Committed: Wed Jun 21 16:42:20 2017 +0530 -- .../ZEPPELIN/0.6.0.2.5/configuration/zeppelin-config.xml | 7 +++ .../main/resources/stacks/HDP/2.6/upgrades/config-upgrade.xml | 5 + ambari-server/src/test/python/stacks/2.6/configs/default.json | 3 ++- 3 files changed, 14 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/e7fc3a64/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/configuration/zeppelin-config.xml -- diff --git a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/configuration/zeppelin-config.xml b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/configuration/zeppelin-config.xml index 85f1859..13d726b 100644 --- a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/configuration/zeppelin-config.xml +++ b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/configuration/zeppelin-config.xml @@ -33,6 +33,13 @@ +zeppelin.server.ssl.port +9995 +Server ssl port. (used when ssl property is set to true) + + + + zeppelin.notebook.dir notebook notebook persist http://git-wip-us.apache.org/repos/asf/ambari/blob/e7fc3a64/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/config-upgrade.xml -- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/config-upgrade.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/config-upgrade.xml index df97727..1cbd78b 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/config-upgrade.xml +++ b/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/config-upgrade.xml @@ -26,6 +26,11 @@ + + +zeppelin-config + + http://git-wip-us.apache.org/repos/asf/ambari/blob/e7fc3a64/ambari-server/src/test/python/stacks/2.6/configs/default.json -- diff --git a/ambari-server/src/test/python/stacks/2.6/configs/default.json b/ambari-server/src/test/python/stacks/2.6/configs/default.json index 2570657..add31d0 100644 --- a/ambari-server/src/test/python/stacks/2.6/configs/default.json +++ b/ambari-server/src/test/python/stacks/2.6/configs/default.json @@ -334,7 +334,8 @@ "zeppelin_group": "zeppelin" }, "zeppelin-config": { -"zeppelin.server.port": "9995", +"zeppelin.server.port": "9995", +"zeppelin.server.ssl.port": "9995", "zeppelin.ssl.truststore.password": "change me", "zeppelin.interpreters": "org.apache.zeppelin.spark.SparkInterpreter,org.apache.zeppelin.spark.PySparkInterpreter,org.apache.zeppelin.spark.SparkSqlInterpreter,org.apache.zeppelin.spark.DepInterpreter,org.apache.zeppelin.markdown.Markdown,org.apache.zeppelin.angular.AngularInterpreter,org.apache.zeppelin.shell.ShellInterpreter,org.apache.zeppelin.jdbc.JDBCInterpreter,org.apache.zeppelin.phoenix.PhoenixInterpreter,org.apache.zeppelin.livy.LivySparkInterpreter,org.apache.zeppelin.livy.LivyPySparkInterpreter,org.apache.zeppelin.livy.LivySparkRInterpreter,org.apache.zeppelin.livy.LivySparkSQLInterpreter", "zeppelin.interpreter.group.order": "spark,angular,jdbc,livy,md,sh",
ambari git commit: AMBARI-20901. Improvement needed for creating ACID tables. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk 9eddcc21d -> bfcc42dcc AMBARI-20901. Improvement needed for creating ACID tables. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/bfcc42dc Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/bfcc42dc Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/bfcc42dc Branch: refs/heads/trunk Commit: bfcc42dcc76aabe9e00c123b92ea9d40d643c713 Parents: 9eddcc2 Author: Dipayan Bhowmick Authored: Mon May 1 14:37:45 2017 +0530 Committer: Dipayan Bhowmick Committed: Mon May 1 14:38:30 2017 +0530 -- .../resources/ui/app/components/create-table.js | 32 +++- .../app/templates/components/create-table.hbs | 4 +-- .../ui/app/templates/components/edit-table.hbs | 5 --- 3 files changed, 26 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/bfcc42dc/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js b/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js index 322aab5..1e8e673 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js @@ -66,7 +66,8 @@ export default Ember.Component.extend({ } if (!(this.checkColumnsExists() && this.checkColumnUniqueness() && - this.validateColumns())) { + this.validateColumns() && + this.checkClusteringIfTransactional())) { this.selectTab("create.table.columns"); return false; } @@ -96,11 +97,11 @@ export default Ember.Component.extend({ }, checkColumnsExists() { -this.set('hasEmptyColumnsError'); -this.set('emptyColumnsErrorText'); +this.set('hasTableConfigurationError'); +this.set('tableConfigurationErrorText'); if (this.get('columns.length') === 0) { - this.set('hasEmptyColumnsError', true); - this.set('emptyColumnsErrorText', 'No columns configured. Add some column definitions.'); + this.set('hasTableConfigurationError', true); + this.set('tableConfigurationErrorText', 'No columns configured. Add some column definitions.'); return false; } return true; @@ -132,6 +133,16 @@ export default Ember.Component.extend({ return true; }, + checkClusteringIfTransactional() { +let clusteredColumns = this.get('columns').filterBy('isClustered', true); +if (this.get('settings.transactional') && clusteredColumns.get('length') === 0) { + this.set('hasTableConfigurationError', true); + this.set('tableConfigurationErrorText', 'Table is marked as transactional but no clustered column defined. Add some clustered column definitions.'); + return false; +} +return true; + }, + validateTableProperties() { for (let i = 0; i < this.get('properties.length'); i++) { let property = this.get('properties').objectAt(i); @@ -144,9 +155,14 @@ export default Ember.Component.extend({ validateNumBuckets() { let clusteredColumns = this.get('columns').filterBy('isClustered', true); -if(clusteredColumns.get('length') > 0 && - (Ember.isEmpty(this.get('settings.numBuckets')) || - !Helper.isInteger(this.get('settings.numBuckets' { + + +function isNumBucketsPresentAndIsAnInteger(context) { + return (Ember.isEmpty(context.get('settings.numBuckets')) || + !Helper.isInteger(context.get('settings.numBuckets'))); +} + +if(clusteredColumns.get('length') > 0 && isNumBucketsPresentAndIsAnInteger(this)) { this.get('settingErrors').pushObject({type: 'numBuckets', error: "Some columns are clustered, Number of buckets are required."}); return false; } http://git-wip-us.apache.org/repos/asf/ambari/blob/bfcc42dc/contrib/views/hive20/src/main/resources/ui/app/templates/components/create-table.hbs -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/create-table.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/create-table.hbs index 2ffbd2a..80e05de 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/templates/components/create-table.hbs +++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/create-table.hbs @@ -39,9 +39,9 @@ {{#each tabs as |tab|}} {{#if tab.active}} {{#if (eq tab.link "create.table.columns")}} - {{#if hasEmptyColumnsError}} + {{#if hasTableConfigurationError}} - {{emptyColumnsErrorText}} + {{tableConfi
ambari git commit: AMBARI-20901. Improvement needed for creating ACID tables. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 6ce938366 -> e04896d1b AMBARI-20901. Improvement needed for creating ACID tables. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e04896d1 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e04896d1 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e04896d1 Branch: refs/heads/branch-2.5 Commit: e04896d1b2cfdaaf398d530486dd939587b4c152 Parents: 6ce9383 Author: Dipayan Bhowmick Authored: Mon May 1 14:37:45 2017 +0530 Committer: Dipayan Bhowmick Committed: Mon May 1 14:37:45 2017 +0530 -- .../resources/ui/app/components/create-table.js | 32 +++- .../app/templates/components/create-table.hbs | 4 +-- .../ui/app/templates/components/edit-table.hbs | 5 --- 3 files changed, 26 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/e04896d1/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js b/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js index 322aab5..1e8e673 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js @@ -66,7 +66,8 @@ export default Ember.Component.extend({ } if (!(this.checkColumnsExists() && this.checkColumnUniqueness() && - this.validateColumns())) { + this.validateColumns() && + this.checkClusteringIfTransactional())) { this.selectTab("create.table.columns"); return false; } @@ -96,11 +97,11 @@ export default Ember.Component.extend({ }, checkColumnsExists() { -this.set('hasEmptyColumnsError'); -this.set('emptyColumnsErrorText'); +this.set('hasTableConfigurationError'); +this.set('tableConfigurationErrorText'); if (this.get('columns.length') === 0) { - this.set('hasEmptyColumnsError', true); - this.set('emptyColumnsErrorText', 'No columns configured. Add some column definitions.'); + this.set('hasTableConfigurationError', true); + this.set('tableConfigurationErrorText', 'No columns configured. Add some column definitions.'); return false; } return true; @@ -132,6 +133,16 @@ export default Ember.Component.extend({ return true; }, + checkClusteringIfTransactional() { +let clusteredColumns = this.get('columns').filterBy('isClustered', true); +if (this.get('settings.transactional') && clusteredColumns.get('length') === 0) { + this.set('hasTableConfigurationError', true); + this.set('tableConfigurationErrorText', 'Table is marked as transactional but no clustered column defined. Add some clustered column definitions.'); + return false; +} +return true; + }, + validateTableProperties() { for (let i = 0; i < this.get('properties.length'); i++) { let property = this.get('properties').objectAt(i); @@ -144,9 +155,14 @@ export default Ember.Component.extend({ validateNumBuckets() { let clusteredColumns = this.get('columns').filterBy('isClustered', true); -if(clusteredColumns.get('length') > 0 && - (Ember.isEmpty(this.get('settings.numBuckets')) || - !Helper.isInteger(this.get('settings.numBuckets' { + + +function isNumBucketsPresentAndIsAnInteger(context) { + return (Ember.isEmpty(context.get('settings.numBuckets')) || + !Helper.isInteger(context.get('settings.numBuckets'))); +} + +if(clusteredColumns.get('length') > 0 && isNumBucketsPresentAndIsAnInteger(this)) { this.get('settingErrors').pushObject({type: 'numBuckets', error: "Some columns are clustered, Number of buckets are required."}); return false; } http://git-wip-us.apache.org/repos/asf/ambari/blob/e04896d1/contrib/views/hive20/src/main/resources/ui/app/templates/components/create-table.hbs -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/create-table.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/create-table.hbs index 2ffbd2a..80e05de 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/templates/components/create-table.hbs +++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/create-table.hbs @@ -39,9 +39,9 @@ {{#each tabs as |tab|}} {{#if tab.active}} {{#if (eq tab.link "create.table.columns")}} - {{#if hasEmptyColumnsError}} + {{#if hasTableConfigurationError}} - {{emptyColumnsErrorText}} + {{
ambari git commit: AMBARI-20898. Hive View 2.0 shows Ranger authorizations even if Ranger Hive plugin is disabled. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk d293ec1d8 -> 9eddcc21d AMBARI-20898. Hive View 2.0 shows Ranger authorizations even if Ranger Hive plugin is disabled. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9eddcc21 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9eddcc21 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9eddcc21 Branch: refs/heads/trunk Commit: 9eddcc21dce8939ad5fa6e3507f88b3a912e89e4 Parents: d293ec1 Author: Dipayan Bhowmick Authored: Mon May 1 00:33:32 2017 +0530 Committer: Dipayan Bhowmick Committed: Mon May 1 00:34:05 2017 +0530 -- .../resources/system/ranger/RangerService.java | 17 + 1 file changed, 17 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/9eddcc21/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java index 6c68b2f..a5222ce 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java @@ -46,7 +46,10 @@ import java.util.Map; */ public class RangerService { + public static final String RANGER_HIVE_AUTHORIZER_FACTORY_CLASSNAME = "org.apache.ranger.authorization.hive.authorizer.RangerHiveAuthorizerFactory"; private static final String RANGER_CONFIG_URL = "/api/v1/clusters/%s/configurations/service_config_versions?service_name=RANGER&is_current=true"; + public static final String HIVESERVER2_SITE = "hiveserver2-site"; + public static final String AUTHORIZATION_MANAGER_KEY = "hive.security.authorization.manager"; protected final Logger LOG = LoggerFactory.getLogger(getClass()); @@ -75,6 +78,12 @@ public class RangerService { } private List getPoliciesFromAmbariCluster(String database, String table) { + +if (!isHiveRangerPluginEnabled()) { + LOG.error("Ranger authorization is not enabled for Hive"); + throw new RangerException("Ranger authorization is not enabled for Hive", "CONFIGURATION_ERROR", 500); +} + String rangerUrl = null; try { rangerUrl = getRangerUrlFromAmbari(); @@ -274,6 +283,14 @@ public class RangerService { } /** + * Check if the ranger plugin is enable for hive + */ + private boolean isHiveRangerPluginEnabled() { +String authManagerConf = context.getCluster().getConfigurationValue(HIVESERVER2_SITE, AUTHORIZATION_MANAGER_KEY); +return !StringUtils.isEmpty(authManagerConf) && authManagerConf.equals(RANGER_HIVE_AUTHORIZER_FACTORY_CLASSNAME); + } + + /** * POJO class to store the policy information from Ranger */ public static class Policy {
ambari git commit: AMBARI-20898. Hive View 2.0 shows Ranger authorizations even if Ranger Hive plugin is disabled. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 535883b2c -> 6ce938366 AMBARI-20898. Hive View 2.0 shows Ranger authorizations even if Ranger Hive plugin is disabled. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/6ce93836 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6ce93836 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6ce93836 Branch: refs/heads/branch-2.5 Commit: 6ce93836697d80a70e93f127f817956d3fb1513f Parents: 535883b Author: Dipayan Bhowmick Authored: Mon May 1 00:33:32 2017 +0530 Committer: Dipayan Bhowmick Committed: Mon May 1 00:33:32 2017 +0530 -- .../resources/system/ranger/RangerService.java | 17 + 1 file changed, 17 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/6ce93836/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java index 6c68b2f..a5222ce 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java @@ -46,7 +46,10 @@ import java.util.Map; */ public class RangerService { + public static final String RANGER_HIVE_AUTHORIZER_FACTORY_CLASSNAME = "org.apache.ranger.authorization.hive.authorizer.RangerHiveAuthorizerFactory"; private static final String RANGER_CONFIG_URL = "/api/v1/clusters/%s/configurations/service_config_versions?service_name=RANGER&is_current=true"; + public static final String HIVESERVER2_SITE = "hiveserver2-site"; + public static final String AUTHORIZATION_MANAGER_KEY = "hive.security.authorization.manager"; protected final Logger LOG = LoggerFactory.getLogger(getClass()); @@ -75,6 +78,12 @@ public class RangerService { } private List getPoliciesFromAmbariCluster(String database, String table) { + +if (!isHiveRangerPluginEnabled()) { + LOG.error("Ranger authorization is not enabled for Hive"); + throw new RangerException("Ranger authorization is not enabled for Hive", "CONFIGURATION_ERROR", 500); +} + String rangerUrl = null; try { rangerUrl = getRangerUrlFromAmbari(); @@ -274,6 +283,14 @@ public class RangerService { } /** + * Check if the ranger plugin is enable for hive + */ + private boolean isHiveRangerPluginEnabled() { +String authManagerConf = context.getCluster().getConfigurationValue(HIVESERVER2_SITE, AUTHORIZATION_MANAGER_KEY); +return !StringUtils.isEmpty(authManagerConf) && authManagerConf.equals(RANGER_HIVE_AUTHORIZER_FACTORY_CLASSNAME); + } + + /** * POJO class to store the policy information from Ranger */ public static class Policy {
ambari git commit: AMBARI-20722. Ranger authorizations tab prompts for Hive Authentication password if admin credentials are incorrect in Hive View 2.0 config. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk 4d59c595a -> 7d3435e36 AMBARI-20722. Ranger authorizations tab prompts for Hive Authentication password if admin credentials are incorrect in Hive View 2.0 config. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7d3435e3 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7d3435e3 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7d3435e3 Branch: refs/heads/trunk Commit: 7d3435e36724adba270e222d074ca273e43d66b1 Parents: 4d59c59 Author: Dipayan Bhowmick Authored: Sat Apr 29 23:15:08 2017 +0530 Committer: Dipayan Bhowmick Committed: Sat Apr 29 23:16:12 2017 +0530 -- .../view/hive20/resources/system/ranger/RangerService.java | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/7d3435e3/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java index 816d0e0..6c68b2f 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java @@ -33,6 +33,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.inject.Inject; +import javax.ws.rs.core.Response; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; @@ -119,7 +120,9 @@ public class RangerService { if (parsedResult instanceof JSONObject) { JSONObject obj = (JSONObject) parsedResult; LOG.error("Bad response from Ranger: {}", rangerResponse); - throw new RangerException((String)obj.get("msgDesc"), "RANGER_ERROR", ((Long)obj.get("statusCode")).intValue()); + int status = ((Long) obj.get("statusCode")).intValue(); + status = status == Response.Status.UNAUTHORIZED.getStatusCode() ? Response.Status.FORBIDDEN.getStatusCode() : status; + throw new RangerException((String) obj.get("msgDesc"), "RANGER_ERROR", status); } JSONArray jsonArray = (JSONArray) parsedResult; if (jsonArray.size() == 0) { @@ -143,7 +146,7 @@ public class RangerService { JSONArray policyItems = (JSONArray) policyJson.get("policyItems"); Policy policy = new Policy(name); -for(Object item: policyItems) { +for (Object item : policyItems) { PolicyCondition condition = new PolicyCondition(); JSONObject policyItem = (JSONObject) item; JSONArray usersJson = (JSONArray) policyItem.get("users"); @@ -239,7 +242,7 @@ public class RangerService { private RangerCred getRangerCredFromConfig() { return new RangerCred(context.getProperties().get("hive.ranger.username"), -context.getProperties().get("hive.ranger.password")); + context.getProperties().get("hive.ranger.password")); } public String getRangerUrlFromAmbari() throws AmbariHttpException {
ambari git commit: AMBARI-20722. Ranger authorizations tab prompts for Hive Authentication password if admin credentials are incorrect in Hive View 2.0 config. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 9339282a1 -> ffee064a8 AMBARI-20722. Ranger authorizations tab prompts for Hive Authentication password if admin credentials are incorrect in Hive View 2.0 config. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ffee064a Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ffee064a Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ffee064a Branch: refs/heads/branch-2.5 Commit: ffee064a87a5540e9f174bd99401eddcd637e67c Parents: 9339282 Author: Dipayan Bhowmick Authored: Sat Apr 29 23:15:08 2017 +0530 Committer: Dipayan Bhowmick Committed: Sat Apr 29 23:15:08 2017 +0530 -- .../view/hive20/resources/system/ranger/RangerService.java | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/ffee064a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java index 816d0e0..6c68b2f 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java @@ -33,6 +33,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.inject.Inject; +import javax.ws.rs.core.Response; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; @@ -119,7 +120,9 @@ public class RangerService { if (parsedResult instanceof JSONObject) { JSONObject obj = (JSONObject) parsedResult; LOG.error("Bad response from Ranger: {}", rangerResponse); - throw new RangerException((String)obj.get("msgDesc"), "RANGER_ERROR", ((Long)obj.get("statusCode")).intValue()); + int status = ((Long) obj.get("statusCode")).intValue(); + status = status == Response.Status.UNAUTHORIZED.getStatusCode() ? Response.Status.FORBIDDEN.getStatusCode() : status; + throw new RangerException((String) obj.get("msgDesc"), "RANGER_ERROR", status); } JSONArray jsonArray = (JSONArray) parsedResult; if (jsonArray.size() == 0) { @@ -143,7 +146,7 @@ public class RangerService { JSONArray policyItems = (JSONArray) policyJson.get("policyItems"); Policy policy = new Policy(name); -for(Object item: policyItems) { +for (Object item : policyItems) { PolicyCondition condition = new PolicyCondition(); JSONObject policyItem = (JSONObject) item; JSONArray usersJson = (JSONArray) policyItem.get("users"); @@ -239,7 +242,7 @@ public class RangerService { private RangerCred getRangerCredFromConfig() { return new RangerCred(context.getProperties().get("hive.ranger.username"), -context.getProperties().get("hive.ranger.password")); + context.getProperties().get("hive.ranger.password")); } public String getRangerUrlFromAmbari() throws AmbariHttpException {
ambari git commit: AMBARI-20635. Implement XML processing best practices in Hive View. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk 904370a60 -> 43f02f903 AMBARI-20635. Implement XML processing best practices in Hive View. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/43f02f90 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/43f02f90 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/43f02f90 Branch: refs/heads/trunk Commit: 43f02f903202761c0ba8b226e7fe7ca89dcd96bf Parents: 904370a Author: Dipayan Bhowmick Authored: Thu Mar 30 22:02:31 2017 +0530 Committer: Dipayan Bhowmick Committed: Thu Mar 30 22:03:14 2017 +0530 -- .../ambari/view/hive2/resources/uploads/parsers/xml/XMLParser.java | 2 ++ .../view/hive20/resources/uploads/parsers/xml/XMLParser.java | 2 ++ 2 files changed, 4 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/43f02f90/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/uploads/parsers/xml/XMLParser.java -- diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/uploads/parsers/xml/XMLParser.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/uploads/parsers/xml/XMLParser.java index 95e996c..e2be5db 100644 --- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/uploads/parsers/xml/XMLParser.java +++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/uploads/parsers/xml/XMLParser.java @@ -63,6 +63,8 @@ public class XMLParser extends Parser { super(reader, parseOptions); XMLInputFactory factory = XMLInputFactory.newInstance(); try { + factory.setProperty(XMLInputFactory.SUPPORT_DTD, false); + factory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false); this.xmlReader = factory.createXMLEventReader(reader); } catch (XMLStreamException e) { LOG.error("error occurred while creating xml reader : ", e); http://git-wip-us.apache.org/repos/asf/ambari/blob/43f02f90/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/parsers/xml/XMLParser.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/parsers/xml/XMLParser.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/parsers/xml/XMLParser.java index abcf2c0..05ef34f 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/parsers/xml/XMLParser.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/parsers/xml/XMLParser.java @@ -63,6 +63,8 @@ public class XMLParser extends Parser { super(reader, parseOptions); XMLInputFactory factory = XMLInputFactory.newInstance(); try { + factory.setProperty(XMLInputFactory.SUPPORT_DTD, false); + factory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false); this.xmlReader = factory.createXMLEventReader(reader); } catch (XMLStreamException e) { LOG.error("error occurred while creating xml reader : ", e);
ambari git commit: AMBARI-20635. Implement XML processing best practices in Hive View. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 85af32f2d -> a43407b9c AMBARI-20635. Implement XML processing best practices in Hive View. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a43407b9 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a43407b9 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a43407b9 Branch: refs/heads/branch-2.5 Commit: a43407b9c42432bcaf7bd8bb40d8d8c0bca1abb0 Parents: 85af32f Author: Dipayan Bhowmick Authored: Thu Mar 30 22:02:31 2017 +0530 Committer: Dipayan Bhowmick Committed: Thu Mar 30 22:02:31 2017 +0530 -- .../ambari/view/hive2/resources/uploads/parsers/xml/XMLParser.java | 2 ++ .../view/hive20/resources/uploads/parsers/xml/XMLParser.java | 2 ++ 2 files changed, 4 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/a43407b9/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/uploads/parsers/xml/XMLParser.java -- diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/uploads/parsers/xml/XMLParser.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/uploads/parsers/xml/XMLParser.java index 95e996c..e2be5db 100644 --- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/uploads/parsers/xml/XMLParser.java +++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/uploads/parsers/xml/XMLParser.java @@ -63,6 +63,8 @@ public class XMLParser extends Parser { super(reader, parseOptions); XMLInputFactory factory = XMLInputFactory.newInstance(); try { + factory.setProperty(XMLInputFactory.SUPPORT_DTD, false); + factory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false); this.xmlReader = factory.createXMLEventReader(reader); } catch (XMLStreamException e) { LOG.error("error occurred while creating xml reader : ", e); http://git-wip-us.apache.org/repos/asf/ambari/blob/a43407b9/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/parsers/xml/XMLParser.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/parsers/xml/XMLParser.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/parsers/xml/XMLParser.java index abcf2c0..05ef34f 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/parsers/xml/XMLParser.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/parsers/xml/XMLParser.java @@ -63,6 +63,8 @@ public class XMLParser extends Parser { super(reader, parseOptions); XMLInputFactory factory = XMLInputFactory.newInstance(); try { + factory.setProperty(XMLInputFactory.SUPPORT_DTD, false); + factory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false); this.xmlReader = factory.createXMLEventReader(reader); } catch (XMLStreamException e) { LOG.error("error occurred while creating xml reader : ", e);
ambari git commit: AMBARI-20587. Hive2: Enable LDAP support for Hive2.0. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk accbb0048 -> 1c79ca6bb AMBARI-20587. Hive2: Enable LDAP support for Hive2.0. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1c79ca6b Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1c79ca6b Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1c79ca6b Branch: refs/heads/trunk Commit: 1c79ca6bb687332a01fe0ad48eff8d9d2be65bf5 Parents: accbb00 Author: Dipayan Bhowmick Authored: Tue Mar 28 11:30:36 2017 +0530 Committer: Dipayan Bhowmick Committed: Tue Mar 28 11:30:36 2017 +0530 -- .../ambari/view/hive20/actor/JdbcConnector.java | 29 .../actor/message/job/AuthenticationFailed.java | 27 +++ .../view/hive20/actor/message/job/Failure.java | 2 +- .../view/hive20/client/DDLDelegatorImpl.java| 5 ++ .../resources/browser/ConnectionService.java| 21 +++-- .../view/hive20/resources/jobs/JobService.java | 2 +- .../resources/ui/app/adapters/application.js| 12 - .../src/main/resources/ui/app/adapters/auth.js | 27 +++ .../ui/app/components/top-application-bar.js| 3 +- .../resources/ui/app/controllers/application.js | 5 +- .../resources/ui/app/controllers/password.js| 44 ++ .../ui/app/controllers/service-check.js | 8 .../hive20/src/main/resources/ui/app/router.js | 1 + .../main/resources/ui/app/routes/application.js | 17 +++ .../main/resources/ui/app/routes/password.js| 41 + .../resources/ui/app/routes/service-check.js| 1 + .../main/resources/ui/app/services/ldap-auth.js | 35 ++ .../resources/ui/app/templates/application.hbs | 5 ++ .../components/top-application-bar.hbs | 10 +++- .../resources/ui/app/templates/password.hbs | 48 20 files changed, 322 insertions(+), 21 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/1c79ca6b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/JdbcConnector.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/JdbcConnector.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/JdbcConnector.java index 45fc786..4b218b1 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/JdbcConnector.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/JdbcConnector.java @@ -36,6 +36,7 @@ import org.apache.ambari.view.hive20.actor.message.ResultInformation; import org.apache.ambari.view.hive20.actor.message.ResultNotReady; import org.apache.ambari.view.hive20.actor.message.RunStatement; import org.apache.ambari.view.hive20.actor.message.SQLStatementJob; +import org.apache.ambari.view.hive20.actor.message.job.AuthenticationFailed; import org.apache.ambari.view.hive20.actor.message.job.CancelJob; import org.apache.ambari.view.hive20.actor.message.job.ExecuteNextStatement; import org.apache.ambari.view.hive20.actor.message.job.ExecutionFailed; @@ -397,24 +398,34 @@ public class JdbcConnector extends HiveActor { } private void notifyConnectFailure(Exception ex) { +boolean loginError = false; executing = false; isFailure = true; this.failure = new Failure("Cannot connect to hive", ex); +if(ex instanceof ConnectionException){ + ConnectionException connectionException = (ConnectionException) ex; + Throwable cause = connectionException.getCause(); + if(cause instanceof SQLException){ +SQLException sqlException = (SQLException) cause; +if(isLoginError(sqlException)) + loginError = true; + } +} + if (isAsync()) { updateJobStatus(jobId.get(), Job.JOB_STATE_ERROR); - if(ex instanceof ConnectionException){ -ConnectionException connectionException = (ConnectionException) ex; -Throwable cause = connectionException.getCause(); -if(cause instanceof SQLException){ - SQLException sqlException = (SQLException) cause; - if(isLoginError(sqlException)) -return; -} + if (loginError) { +return; } } else { - sender().tell(new ExecutionFailed("Cannot connect to hive"), ActorRef.noSender()); + if (loginError) { +sender().tell(new AuthenticationFailed("Hive authentication error", ex), ActorRef.noSender()); + } else { +sender().tell(new ExecutionFailed("Cannot connect to hive", ex), ActorRef.noSender()); + } + } // Do not clean up in case of failed authorizations // The failure is bubbled to the user for requesting credentials http://git-wip-us.apache.org/repos/asf/ambari/blob/1c79c
ambari git commit: AMBARI-20410. Need to remove Tech Preview label from Hive View config for HSI. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk e2818c61c -> c3b5615cd AMBARI-20410. Need to remove Tech Preview label from Hive View config for HSI. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c3b5615c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c3b5615c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c3b5615c Branch: refs/heads/trunk Commit: c3b5615cdf38d9edc3aafd63808ccefa7901cb61 Parents: e2818c6 Author: Dipayan Bhowmick Authored: Tue Mar 14 17:01:29 2017 +0530 Committer: Dipayan Bhowmick Committed: Tue Mar 14 17:06:55 2017 +0530 -- contrib/views/hive-next/src/main/resources/view.xml | 2 +- contrib/views/hive20/src/main/resources/view.xml| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/c3b5615c/contrib/views/hive-next/src/main/resources/view.xml -- diff --git a/contrib/views/hive-next/src/main/resources/view.xml b/contrib/views/hive-next/src/main/resources/view.xml index 4c131b5..2a4628f 100644 --- a/contrib/views/hive-next/src/main/resources/view.xml +++ b/contrib/views/hive-next/src/main/resources/view.xml @@ -226,7 +226,7 @@ use.hive.interactive.mode Connects to the hive interactive server if set true -Use Interactive Mode(Tech Preview) +Use Interactive Mode false true http://git-wip-us.apache.org/repos/asf/ambari/blob/c3b5615c/contrib/views/hive20/src/main/resources/view.xml -- diff --git a/contrib/views/hive20/src/main/resources/view.xml b/contrib/views/hive20/src/main/resources/view.xml index f0e9e34..8349b14 100644 --- a/contrib/views/hive20/src/main/resources/view.xml +++ b/contrib/views/hive20/src/main/resources/view.xml @@ -253,7 +253,7 @@ use.hive.interactive.mode Connects to the hive interactive server if set true -Use Interactive Mode(Tech Preview) +Use Interactive Mode false true
ambari git commit: AMBARI-20410. Need to remove Tech Preview label from Hive View config for HSI. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 bf03c8ee2 -> 8620f4c4e AMBARI-20410. Need to remove Tech Preview label from Hive View config for HSI. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8620f4c4 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8620f4c4 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8620f4c4 Branch: refs/heads/branch-2.5 Commit: 8620f4c4ec30ca7257241bc70cd4eb8595b2254d Parents: bf03c8e Author: Dipayan Bhowmick Authored: Tue Mar 14 17:01:29 2017 +0530 Committer: Dipayan Bhowmick Committed: Tue Mar 14 17:01:53 2017 +0530 -- contrib/views/hive-next/src/main/resources/view.xml | 2 +- contrib/views/hive20/src/main/resources/view.xml| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/8620f4c4/contrib/views/hive-next/src/main/resources/view.xml -- diff --git a/contrib/views/hive-next/src/main/resources/view.xml b/contrib/views/hive-next/src/main/resources/view.xml index 4c131b5..2a4628f 100644 --- a/contrib/views/hive-next/src/main/resources/view.xml +++ b/contrib/views/hive-next/src/main/resources/view.xml @@ -226,7 +226,7 @@ use.hive.interactive.mode Connects to the hive interactive server if set true -Use Interactive Mode(Tech Preview) +Use Interactive Mode false true http://git-wip-us.apache.org/repos/asf/ambari/blob/8620f4c4/contrib/views/hive20/src/main/resources/view.xml -- diff --git a/contrib/views/hive20/src/main/resources/view.xml b/contrib/views/hive20/src/main/resources/view.xml index f0e9e34..8349b14 100644 --- a/contrib/views/hive20/src/main/resources/view.xml +++ b/contrib/views/hive20/src/main/resources/view.xml @@ -253,7 +253,7 @@ use.hive.interactive.mode Connects to the hive interactive server if set true -Use Interactive Mode(Tech Preview) +Use Interactive Mode false true
ambari git commit: AMBARI-20383. Not able to view the error log details on UI. (Padma Priya via dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk 3d4a83644 -> 8f579c122 AMBARI-20383. Not able to view the error log details on UI. (Padma Priya via dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8f579c12 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8f579c12 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8f579c12 Branch: refs/heads/trunk Commit: 8f579c122876d00ebad034a2cc12ccfa5daa8869 Parents: 3d4a836 Author: Dipayan Bhowmick Authored: Mon Mar 13 18:27:56 2017 +0530 Committer: Dipayan Bhowmick Committed: Mon Mar 13 18:29:17 2017 +0530 -- .../src/main/resources/ui/app/validators/workflow-dag.js | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/8f579c12/contrib/views/wfmanager/src/main/resources/ui/app/validators/workflow-dag.js -- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/validators/workflow-dag.js b/contrib/views/wfmanager/src/main/resources/ui/app/validators/workflow-dag.js index 18da25b..2a419eb 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/validators/workflow-dag.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/validators/workflow-dag.js @@ -14,20 +14,19 @@ *See the License for the specific language governing permissions and *limitations under the License. */ -import Ember from 'ember'; import BaseValidator from 'ember-cp-validations/validators/base'; -const DuplicateDataNodeName = BaseValidator.extend({ +const WorkflowDag = BaseValidator.extend({ validate(value, options, model, attribute) { -if (model.get('dataNodes')) { +if (model.get('dataNodes') && model.get('dataNodes').length) { if(!model.get('flowRenderer').isWorkflowValid()){ -return "Invalid workflow structure. There is no flow to end node." +return "Invalid workflow structure. There is no flow to end node."; } } } }); -DuplicateDataNodeName.reopenClass({ +WorkflowDag.reopenClass({ /** * Define attribute specific dependent keys for your validator * @@ -40,4 +39,4 @@ DuplicateDataNodeName.reopenClass({ } }); -export default DuplicateDataNodeName; +export default WorkflowDag;
ambari git commit: AMBARI-20383. Not able to view the error log details on UI. (Padma Priya via dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 c0e2209c0 -> be10018f6 AMBARI-20383. Not able to view the error log details on UI. (Padma Priya via dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/be10018f Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/be10018f Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/be10018f Branch: refs/heads/branch-2.5 Commit: be10018f64deeaa479d7b0b6797d38e38c48ca4c Parents: c0e2209 Author: Dipayan Bhowmick Authored: Mon Mar 13 18:27:56 2017 +0530 Committer: Dipayan Bhowmick Committed: Mon Mar 13 18:28:29 2017 +0530 -- .../src/main/resources/ui/app/validators/workflow-dag.js | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/be10018f/contrib/views/wfmanager/src/main/resources/ui/app/validators/workflow-dag.js -- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/validators/workflow-dag.js b/contrib/views/wfmanager/src/main/resources/ui/app/validators/workflow-dag.js index 18da25b..2a419eb 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/validators/workflow-dag.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/validators/workflow-dag.js @@ -14,20 +14,19 @@ *See the License for the specific language governing permissions and *limitations under the License. */ -import Ember from 'ember'; import BaseValidator from 'ember-cp-validations/validators/base'; -const DuplicateDataNodeName = BaseValidator.extend({ +const WorkflowDag = BaseValidator.extend({ validate(value, options, model, attribute) { -if (model.get('dataNodes')) { +if (model.get('dataNodes') && model.get('dataNodes').length) { if(!model.get('flowRenderer').isWorkflowValid()){ -return "Invalid workflow structure. There is no flow to end node." +return "Invalid workflow structure. There is no flow to end node."; } } } }); -DuplicateDataNodeName.reopenClass({ +WorkflowDag.reopenClass({ /** * Define attribute specific dependent keys for your validator * @@ -40,4 +39,4 @@ DuplicateDataNodeName.reopenClass({ } }); -export default DuplicateDataNodeName; +export default WorkflowDag;
ambari git commit: AMBARI-20360. Need to show appropriate error message in cases of UI failures. (M Madhan Mohan Reddy via dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk 03a832e6d -> 7f3bee582 AMBARI-20360. Need to show appropriate error message in cases of UI failures. (M Madhan Mohan Reddy via dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7f3bee58 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7f3bee58 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7f3bee58 Branch: refs/heads/trunk Commit: 7f3bee58260080c786bd8882663c9daa67c81d81 Parents: 03a832e Author: Dipayan Bhowmick Authored: Fri Mar 10 17:27:21 2017 +0530 Committer: Dipayan Bhowmick Committed: Fri Mar 10 17:27:56 2017 +0530 -- .../ui/app/components/bundle-config.js | 15 .../resources/ui/app/components/coord-config.js | 25 ++-- .../ui/app/components/designer-errors.js| 3 +++ .../ui/app/components/flow-designer.js | 25 +++- .../ui/app/domain/bundle/bundle-xml-importer.js | 4 .../coordinator/coordinator-xml-importer.js | 4 .../ui/app/domain/workflow-importer.js | 12 +++--- .../templates/components/designer-errors.hbs| 11 ++--- 8 files changed, 76 insertions(+), 23 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/7f3bee58/contrib/views/wfmanager/src/main/resources/ui/app/components/bundle-config.js -- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/bundle-config.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/bundle-config.js index e94d51a..7c63b47 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/components/bundle-config.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/bundle-config.js @@ -144,9 +144,12 @@ export default Ember.Component.extend(Ember.Evented, Validations, { return deferred; }, importBundle (filePath){ -this.set("bundleFilePath", filePath); +if (!filePath) { + return; +} this.set("isImporting", true); filePath = this.appendFileName(filePath, 'bundle'); +this.set("bundleFilePath", filePath); var deferred = this.getBundleFromHdfs(filePath); deferred.promise.then(function(response){ if(response.type === 'xml'){ @@ -209,9 +212,11 @@ export default Ember.Component.extend(Ember.Evented, Validations, { getBundleFromXml(bundleXml){ var bundleXmlImporter = BundleXmlImporter.create(); var bundleObj = bundleXmlImporter.importBundle(bundleXml); -this.set("bundle", bundleObj.bundle); this.get("errors").clear(); this.get("errors").pushObjects(bundleObj.errors); +if (bundleObj.bundle) { + this.set("bundle", bundleObj.bundle); +} }, getJobProperties(coordinatorPath){ var deferred = Ember.RSVP.defer(); @@ -386,8 +391,10 @@ export default Ember.Component.extend(Ember.Evented, Validations, { var deferred = this.importSampleBundle(); deferred.promise.then(function(data){ this.getBundleFromXml(data); - }.bind(this)).catch(function(e){ -throw new Error(e); + }.bind(this)).catch(function(data){ +console.error(data); +this.set("errorMsg", "There is some problem while importing."); +this.set("data", data); }); }, openTab(type, path){ http://git-wip-us.apache.org/repos/asf/ambari/blob/7f3bee58/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js -- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js index c87ea99..e8f8cc1 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js @@ -76,7 +76,7 @@ export default Ember.Component.extend(Validations, Ember.Evented, { }.on('willDestroyElement'), initialize : function(){ var self = this; - +this.set('errors', Ember.A([])); this.get('workspaceManager').restoreWorkInProgress(this.get('tabInfo.id')).promise.then(function(draftCoordinator){ self.loadCoordinator(draftCoordinator); }.bind(this)).catch(function(data){ @@ -262,9 +262,12 @@ export default Ember.Component.extend(Validations, Ember.Evented, { return deferred; }, importCoordinator (filePath){ +if (!filePath) { + return; +} +this.set("isImporting", true); filePath = this.appendFileName(filePath, 'coord'); this.set("coordinatorFilePath", filePath); -this.set("isImporting", false); var deferred = this.readCoordinatorFromHdfs(filePath); deferred.promis
ambari git commit: AMBARI-20360. Need to show appropriate error message in cases of UI failures. (M Madhan Mohan Reddy via dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 f70081119 -> f2a48c0ac AMBARI-20360. Need to show appropriate error message in cases of UI failures. (M Madhan Mohan Reddy via dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f2a48c0a Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f2a48c0a Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f2a48c0a Branch: refs/heads/branch-2.5 Commit: f2a48c0ac781389305af0b6768d62b449ed772a2 Parents: f700811 Author: Dipayan Bhowmick Authored: Fri Mar 10 17:27:21 2017 +0530 Committer: Dipayan Bhowmick Committed: Fri Mar 10 17:27:21 2017 +0530 -- .../ui/app/components/bundle-config.js | 15 .../resources/ui/app/components/coord-config.js | 25 ++-- .../ui/app/components/designer-errors.js| 3 +++ .../ui/app/components/flow-designer.js | 25 +++- .../ui/app/domain/bundle/bundle-xml-importer.js | 4 .../coordinator/coordinator-xml-importer.js | 4 .../ui/app/domain/workflow-importer.js | 12 +++--- .../templates/components/designer-errors.hbs| 11 ++--- 8 files changed, 76 insertions(+), 23 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/f2a48c0a/contrib/views/wfmanager/src/main/resources/ui/app/components/bundle-config.js -- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/bundle-config.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/bundle-config.js index e94d51a..7c63b47 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/components/bundle-config.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/bundle-config.js @@ -144,9 +144,12 @@ export default Ember.Component.extend(Ember.Evented, Validations, { return deferred; }, importBundle (filePath){ -this.set("bundleFilePath", filePath); +if (!filePath) { + return; +} this.set("isImporting", true); filePath = this.appendFileName(filePath, 'bundle'); +this.set("bundleFilePath", filePath); var deferred = this.getBundleFromHdfs(filePath); deferred.promise.then(function(response){ if(response.type === 'xml'){ @@ -209,9 +212,11 @@ export default Ember.Component.extend(Ember.Evented, Validations, { getBundleFromXml(bundleXml){ var bundleXmlImporter = BundleXmlImporter.create(); var bundleObj = bundleXmlImporter.importBundle(bundleXml); -this.set("bundle", bundleObj.bundle); this.get("errors").clear(); this.get("errors").pushObjects(bundleObj.errors); +if (bundleObj.bundle) { + this.set("bundle", bundleObj.bundle); +} }, getJobProperties(coordinatorPath){ var deferred = Ember.RSVP.defer(); @@ -386,8 +391,10 @@ export default Ember.Component.extend(Ember.Evented, Validations, { var deferred = this.importSampleBundle(); deferred.promise.then(function(data){ this.getBundleFromXml(data); - }.bind(this)).catch(function(e){ -throw new Error(e); + }.bind(this)).catch(function(data){ +console.error(data); +this.set("errorMsg", "There is some problem while importing."); +this.set("data", data); }); }, openTab(type, path){ http://git-wip-us.apache.org/repos/asf/ambari/blob/f2a48c0a/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js -- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js index c87ea99..e8f8cc1 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js @@ -76,7 +76,7 @@ export default Ember.Component.extend(Validations, Ember.Evented, { }.on('willDestroyElement'), initialize : function(){ var self = this; - +this.set('errors', Ember.A([])); this.get('workspaceManager').restoreWorkInProgress(this.get('tabInfo.id')).promise.then(function(draftCoordinator){ self.loadCoordinator(draftCoordinator); }.bind(this)).catch(function(data){ @@ -262,9 +262,12 @@ export default Ember.Component.extend(Validations, Ember.Evented, { return deferred; }, importCoordinator (filePath){ +if (!filePath) { + return; +} +this.set("isImporting", true); filePath = this.appendFileName(filePath, 'coord'); this.set("coordinatorFilePath", filePath); -this.set("isImporting", false); var deferred = this.readCoordinatorFromHdfs(filePath); defer
ambari git commit: AMBARI-20381. User is not able to import workflows, coordinators and bundles. (Padma Priya N. via dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk b0fc5da42 -> aa974b0a7 AMBARI-20381. User is not able to import workflows, coordinators and bundles. (Padma Priya N. via dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/aa974b0a Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/aa974b0a Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/aa974b0a Branch: refs/heads/trunk Commit: aa974b0a72a07898c2762587738c7e497e0ac433 Parents: b0fc5da Author: Dipayan Bhowmick Authored: Fri Mar 10 15:24:12 2017 +0530 Committer: Dipayan Bhowmick Committed: Fri Mar 10 15:24:41 2017 +0530 -- .../org/apache/oozie/ambari/view/Utils.java | 51 +++- 1 file changed, 27 insertions(+), 24 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/aa974b0a/contrib/views/wfmanager/src/main/java/org/apache/oozie/ambari/view/Utils.java -- diff --git a/contrib/views/wfmanager/src/main/java/org/apache/oozie/ambari/view/Utils.java b/contrib/views/wfmanager/src/main/java/org/apache/oozie/ambari/view/Utils.java index 8f427bd..1ff68c9 100644 --- a/contrib/views/wfmanager/src/main/java/org/apache/oozie/ambari/view/Utils.java +++ b/contrib/views/wfmanager/src/main/java/org/apache/oozie/ambari/view/Utils.java @@ -169,28 +169,31 @@ public class Utils { return false; } } - public StreamingOutput streamResponse(final InputStream is) { - return new StreamingOutput() { - @Override - public void write(OutputStream os) throws IOException, - WebApplicationException { - BufferedInputStream bis=new BufferedInputStream(is); - BufferedOutputStream bos=new BufferedOutputStream(os); - try { - int data; - while ((data = bis.read()) != -1) { - bos.write(data); - } - is.close(); - os.close(); - }catch (IOException e){ - LOGGER.error(e.getMessage(),e); - throw e; - }catch (Exception e){ - LOGGER.error(e.getMessage(),e); - throw new RuntimeException(e); - } - } - }; - } + + public StreamingOutput streamResponse(final InputStream is) { +return new StreamingOutput() { + @Override + public void write(OutputStream os) throws IOException, +WebApplicationException { +BufferedInputStream bis = new BufferedInputStream(is); +BufferedOutputStream bos = new BufferedOutputStream(os); +try { + int data; + while ((data = bis.read()) != -1) { +bos.write(data); + } + bos.flush(); + is.close(); +} catch (IOException e) { + LOGGER.error(e.getMessage(), e); + throw e; +} catch (Exception e) { + LOGGER.error(e.getMessage(), e); + throw new RuntimeException(e); +} finally { + bis.close(); +} + } +}; + } }
ambari git commit: AMBARI-20381. User is not able to import workflows, coordinators and bundles. (Padma Priya N. via dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 99766861c -> 9237968da AMBARI-20381. User is not able to import workflows, coordinators and bundles. (Padma Priya N. via dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9237968d Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9237968d Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9237968d Branch: refs/heads/branch-2.5 Commit: 9237968da117b6ed45a39fad77c1ec0ed789bca8 Parents: 9976686 Author: Dipayan Bhowmick Authored: Fri Mar 10 15:24:12 2017 +0530 Committer: Dipayan Bhowmick Committed: Fri Mar 10 15:24:12 2017 +0530 -- .../org/apache/oozie/ambari/view/Utils.java | 51 +++- 1 file changed, 27 insertions(+), 24 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/9237968d/contrib/views/wfmanager/src/main/java/org/apache/oozie/ambari/view/Utils.java -- diff --git a/contrib/views/wfmanager/src/main/java/org/apache/oozie/ambari/view/Utils.java b/contrib/views/wfmanager/src/main/java/org/apache/oozie/ambari/view/Utils.java index 8f427bd..1ff68c9 100644 --- a/contrib/views/wfmanager/src/main/java/org/apache/oozie/ambari/view/Utils.java +++ b/contrib/views/wfmanager/src/main/java/org/apache/oozie/ambari/view/Utils.java @@ -169,28 +169,31 @@ public class Utils { return false; } } - public StreamingOutput streamResponse(final InputStream is) { - return new StreamingOutput() { - @Override - public void write(OutputStream os) throws IOException, - WebApplicationException { - BufferedInputStream bis=new BufferedInputStream(is); - BufferedOutputStream bos=new BufferedOutputStream(os); - try { - int data; - while ((data = bis.read()) != -1) { - bos.write(data); - } - is.close(); - os.close(); - }catch (IOException e){ - LOGGER.error(e.getMessage(),e); - throw e; - }catch (Exception e){ - LOGGER.error(e.getMessage(),e); - throw new RuntimeException(e); - } - } - }; - } + + public StreamingOutput streamResponse(final InputStream is) { +return new StreamingOutput() { + @Override + public void write(OutputStream os) throws IOException, +WebApplicationException { +BufferedInputStream bis = new BufferedInputStream(is); +BufferedOutputStream bos = new BufferedOutputStream(os); +try { + int data; + while ((data = bis.read()) != -1) { +bos.write(data); + } + bos.flush(); + is.close(); +} catch (IOException e) { + LOGGER.error(e.getMessage(), e); + throw e; +} catch (Exception e) { + LOGGER.error(e.getMessage(), e); + throw new RuntimeException(e); +} finally { + bis.close(); +} + } +}; + } }
ambari git commit: AMBARI-20253. HiveView2.0: Auto refresh not working.(dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk d62755233 -> a6dac1fdf AMBARI-20253. HiveView2.0: Auto refresh not working.(dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a6dac1fd Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a6dac1fd Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a6dac1fd Branch: refs/heads/trunk Commit: a6dac1fdf6728c7dfb1d14a072052ebe47df83bd Parents: d627552 Author: Dipayan Bhowmick Authored: Wed Mar 8 01:02:16 2017 +0530 Committer: Dipayan Bhowmick Committed: Wed Mar 8 01:02:45 2017 +0530 -- .../main/resources/ui/app/routes/databases.js | 23 +++ .../ui/app/routes/databases/database/tables.js | 57 ++- .../app/routes/databases/database/tables/new.js | 18 ++- .../resources/ui/app/services/auto-refresh.js | 148 +++ .../app/templates/databases/database/tables.hbs | 1 + .../main/resources/ui/app/transforms/date.js| 50 +++ .../src/main/resources/ui/config/environment.js | 6 +- 7 files changed, 289 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/a6dac1fd/contrib/views/hive20/src/main/resources/ui/app/routes/databases.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/databases.js b/contrib/views/hive20/src/main/resources/ui/app/routes/databases.js index e5efbe9..02dbcac 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/routes/databases.js +++ b/contrib/views/hive20/src/main/resources/ui/app/routes/databases.js @@ -18,9 +18,32 @@ import Ember from 'ember'; import UILoggerMixin from '../mixins/ui-logger'; +import ENV from 'ui/config/environment'; export default Ember.Route.extend(UILoggerMixin, { tableOperations: Ember.inject.service(), + autoRefresh: Ember.inject.service(), + + activate() { +if(ENV.APP.SHOULD_AUTO_REFRESH_DATABASES) { + this.get('autoRefresh').startDatabasesAutoRefresh(() => { +console.log("Databases AutoRefresh started"); + }, this._databasesRefreshed.bind(this)); +} + + }, + + deactivate() { +this.get('autoRefresh').stopDatabasesAutoRefresh(); + }, + + _databasesRefreshed() { +let model = this.store.peekAll('database'); +if(this.controller) { + console.log(model.get('length')); + this.setupController(this.controller, model); +} + }, model() { return this.store.findAll('database', {reload: true}); http://git-wip-us.apache.org/repos/asf/ambari/blob/a6dac1fd/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables.js b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables.js index d4a39cb..f5940e3 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables.js +++ b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables.js @@ -17,8 +17,46 @@ */ import Ember from 'ember'; +import ENV from 'ui/config/environment'; +import UILoggerMixin from '../../../mixins/ui-logger'; + +export default Ember.Route.extend(UILoggerMixin, { + autoRefresh: Ember.inject.service(), + + activate() { +if(ENV.APP.SHOULD_AUTO_REFRESH_TABLES) { + let selectedDatabase = this.modelFor('databases.database'); + this.get('autoRefresh').startTablesAutoRefresh(selectedDatabase.get('name'), +this.tableRefreshStarting.bind(this), this.tableRefreshed.bind(this)); +} + }, + + deactivate() { + this.get('autoRefresh').stopTablesAutoRefresh(this.controller.get('database.name')); + }, + + tableRefreshStarting(databaseName) { +this.controller.set('tableRefreshing', true); + }, + + tableRefreshed(databaseName, deletedTablesCount) { +this.controller.set('tableRefreshing', false); +let currentTablesForDatabase = this.store.peekAll('table').filterBy('database.name', databaseName); +let paramsForTable = this.paramsFor('databases.database.tables.table'); +let currentTableNamesForDatabase = currentTablesForDatabase.mapBy('name'); +if (currentTableNamesForDatabase.length <= 0 || !currentTableNamesForDatabase.contains(paramsForTable.name)) { + if(deletedTablesCount !== 0) { +this.get('logger').info(`Current selected table '${paramsForTable.name}' has been deleted from Hive Server. Transitioning out.`); +this.transitionTo('databases.database', databaseName); +return; + } +} +if(currentTablesForDatabase.get('length') > 0) { + this.selectTable(currentTablesForDatabase); + this.controller.set('model', currentTablesForDataba
ambari git commit: AMBARI-20253. HiveView2.0: Auto refresh not working.(dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 a92b7c802 -> dff7754b7 AMBARI-20253. HiveView2.0: Auto refresh not working.(dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/dff7754b Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/dff7754b Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/dff7754b Branch: refs/heads/branch-2.5 Commit: dff7754b7cb718de7e3bcfaac7afa0a4ce936afe Parents: a92b7c8 Author: Dipayan Bhowmick Authored: Wed Mar 8 01:02:16 2017 +0530 Committer: Dipayan Bhowmick Committed: Wed Mar 8 01:02:16 2017 +0530 -- .../main/resources/ui/app/routes/databases.js | 23 +++ .../ui/app/routes/databases/database/tables.js | 57 ++- .../app/routes/databases/database/tables/new.js | 18 ++- .../resources/ui/app/services/auto-refresh.js | 148 +++ .../app/templates/databases/database/tables.hbs | 1 + .../main/resources/ui/app/transforms/date.js| 50 +++ .../src/main/resources/ui/config/environment.js | 6 +- 7 files changed, 289 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/dff7754b/contrib/views/hive20/src/main/resources/ui/app/routes/databases.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/databases.js b/contrib/views/hive20/src/main/resources/ui/app/routes/databases.js index e5efbe9..02dbcac 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/routes/databases.js +++ b/contrib/views/hive20/src/main/resources/ui/app/routes/databases.js @@ -18,9 +18,32 @@ import Ember from 'ember'; import UILoggerMixin from '../mixins/ui-logger'; +import ENV from 'ui/config/environment'; export default Ember.Route.extend(UILoggerMixin, { tableOperations: Ember.inject.service(), + autoRefresh: Ember.inject.service(), + + activate() { +if(ENV.APP.SHOULD_AUTO_REFRESH_DATABASES) { + this.get('autoRefresh').startDatabasesAutoRefresh(() => { +console.log("Databases AutoRefresh started"); + }, this._databasesRefreshed.bind(this)); +} + + }, + + deactivate() { +this.get('autoRefresh').stopDatabasesAutoRefresh(); + }, + + _databasesRefreshed() { +let model = this.store.peekAll('database'); +if(this.controller) { + console.log(model.get('length')); + this.setupController(this.controller, model); +} + }, model() { return this.store.findAll('database', {reload: true}); http://git-wip-us.apache.org/repos/asf/ambari/blob/dff7754b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables.js b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables.js index d4a39cb..f5940e3 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables.js +++ b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables.js @@ -17,8 +17,46 @@ */ import Ember from 'ember'; +import ENV from 'ui/config/environment'; +import UILoggerMixin from '../../../mixins/ui-logger'; + +export default Ember.Route.extend(UILoggerMixin, { + autoRefresh: Ember.inject.service(), + + activate() { +if(ENV.APP.SHOULD_AUTO_REFRESH_TABLES) { + let selectedDatabase = this.modelFor('databases.database'); + this.get('autoRefresh').startTablesAutoRefresh(selectedDatabase.get('name'), +this.tableRefreshStarting.bind(this), this.tableRefreshed.bind(this)); +} + }, + + deactivate() { + this.get('autoRefresh').stopTablesAutoRefresh(this.controller.get('database.name')); + }, + + tableRefreshStarting(databaseName) { +this.controller.set('tableRefreshing', true); + }, + + tableRefreshed(databaseName, deletedTablesCount) { +this.controller.set('tableRefreshing', false); +let currentTablesForDatabase = this.store.peekAll('table').filterBy('database.name', databaseName); +let paramsForTable = this.paramsFor('databases.database.tables.table'); +let currentTableNamesForDatabase = currentTablesForDatabase.mapBy('name'); +if (currentTableNamesForDatabase.length <= 0 || !currentTableNamesForDatabase.contains(paramsForTable.name)) { + if(deletedTablesCount !== 0) { +this.get('logger').info(`Current selected table '${paramsForTable.name}' has been deleted from Hive Server. Transitioning out.`); +this.transitionTo('databases.database', databaseName); +return; + } +} +if(currentTablesForDatabase.get('length') > 0) { + this.selectTable(currentTablesForDatabase); + this.controller.set('model', currentTable
ambari git commit: AMBARI-20256. Auto Hive 2.0 instance is missing permission for default Ambari roles. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk 434ff1f25 -> d62755233 AMBARI-20256. Auto Hive 2.0 instance is missing permission for default Ambari roles. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d6275523 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d6275523 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d6275523 Branch: refs/heads/trunk Commit: d62755233ccb489cbca1ec78ae2b7e86857d6efe Parents: 434ff1f Author: Dipayan Bhowmick Authored: Wed Mar 8 00:59:27 2017 +0530 Committer: Dipayan Bhowmick Committed: Wed Mar 8 01:00:10 2017 +0530 -- contrib/views/hive20/src/main/resources/view.xml | 7 +++ 1 file changed, 7 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/d6275523/contrib/views/hive20/src/main/resources/view.xml -- diff --git a/contrib/views/hive20/src/main/resources/view.xml b/contrib/views/hive20/src/main/resources/view.xml index 37ddf56..f0e9e34 100644 --- a/contrib/views/hive20/src/main/resources/view.xml +++ b/contrib/views/hive20/src/main/resources/view.xml @@ -395,5 +395,12 @@ HIVE + +CLUSTER.ADMINISTRATOR +CLUSTER.OPERATOR +SERVICE.ADMINISTRATOR +SERVICE.OPERATOR +CLUSTER.USER +
ambari git commit: AMBARI-20256. Auto Hive 2.0 instance is missing permission for default Ambari roles. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 7e8a8150e -> a92b7c802 AMBARI-20256. Auto Hive 2.0 instance is missing permission for default Ambari roles. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a92b7c80 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a92b7c80 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a92b7c80 Branch: refs/heads/branch-2.5 Commit: a92b7c80210ab180c6782600c38c0566e8d9acb6 Parents: 7e8a815 Author: Dipayan Bhowmick Authored: Wed Mar 8 00:59:27 2017 +0530 Committer: Dipayan Bhowmick Committed: Wed Mar 8 00:59:27 2017 +0530 -- contrib/views/hive20/src/main/resources/view.xml | 7 +++ 1 file changed, 7 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/a92b7c80/contrib/views/hive20/src/main/resources/view.xml -- diff --git a/contrib/views/hive20/src/main/resources/view.xml b/contrib/views/hive20/src/main/resources/view.xml index 37ddf56..f0e9e34 100644 --- a/contrib/views/hive20/src/main/resources/view.xml +++ b/contrib/views/hive20/src/main/resources/view.xml @@ -395,5 +395,12 @@ HIVE + +CLUSTER.ADMINISTRATOR +CLUSTER.OPERATOR +SERVICE.ADMINISTRATOR +SERVICE.OPERATOR +CLUSTER.USER +
ambari git commit: AMBARI-20177. HiveView2.0: Text 'Create Database' is shown on UI with status of editing a table. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk 4fb86de56 -> 04039a654 AMBARI-20177. HiveView2.0: Text 'Create Database' is shown on UI with status of editing a table. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/04039a65 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/04039a65 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/04039a65 Branch: refs/heads/trunk Commit: 04039a6542c6f9cd4d44ead1107aac69dec1e8ff Parents: 4fb86de Author: Dipayan Bhowmick Authored: Wed Mar 1 12:17:28 2017 +0530 Committer: Dipayan Bhowmick Committed: Wed Mar 1 12:18:11 2017 +0530 -- .../src/main/resources/ui/app/templates/components/edit-table.hbs | 2 +- .../ui/app/templates/components/table-advanced-settings.hbs| 2 +- .../ui/app/templates/databases/database/tables/table/edit.hbs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/04039a65/contrib/views/hive20/src/main/resources/ui/app/templates/components/edit-table.hbs -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/edit-table.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/edit-table.hbs index 70e7824..7a02d3a 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/templates/components/edit-table.hbs +++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/edit-table.hbs @@ -47,7 +47,7 @@ - + {{fa-icon "edit"}} Edit {{fa-icon "times"}} Cancel http://git-wip-us.apache.org/repos/asf/ambari/blob/04039a65/contrib/views/hive20/src/main/resources/ui/app/templates/components/table-advanced-settings.hbs -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/table-advanced-settings.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/table-advanced-settings.hbs index 4aca56d..da1c0b4 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/templates/components/table-advanced-settings.hbs +++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/table-advanced-settings.hbs @@ -39,7 +39,7 @@ Number of buckets - {{input type="number" class="form-control" value=settings.numBuckets disabled=disableNumBucketsInput}} + {{input type="number" min="0" class="form-control" value=settings.numBuckets disabled=disableNumBucketsInput}} {{#if hasNumBucketError}} {{numBucketErrorText}} {{/if}} http://git-wip-us.apache.org/repos/asf/ambari/blob/04039a65/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table/edit.hbs -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table/edit.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table/edit.hbs index 79f1701..6e4de64 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table/edit.hbs +++ b/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table/edit.hbs @@ -35,7 +35,7 @@ container-class="modal-dialog modal-sm"}} -{{fa-icon "plus"}}Â Â Â Create Database +{{fa-icon "plus"}}Â Â Â Edit Table {{modalMessage}}
ambari git commit: AMBARI-20177. HiveView2.0: Text 'Create Database' is shown on UI with status of editing a table. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 e9475c479 -> ad94fcc2e AMBARI-20177. HiveView2.0: Text 'Create Database' is shown on UI with status of editing a table. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ad94fcc2 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ad94fcc2 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ad94fcc2 Branch: refs/heads/branch-2.5 Commit: ad94fcc2e86fee88f723f36f9472f9ef137c9be3 Parents: e9475c4 Author: Dipayan Bhowmick Authored: Wed Mar 1 12:17:28 2017 +0530 Committer: Dipayan Bhowmick Committed: Wed Mar 1 12:17:28 2017 +0530 -- .../src/main/resources/ui/app/templates/components/edit-table.hbs | 2 +- .../ui/app/templates/components/table-advanced-settings.hbs| 2 +- .../ui/app/templates/databases/database/tables/table/edit.hbs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/ad94fcc2/contrib/views/hive20/src/main/resources/ui/app/templates/components/edit-table.hbs -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/edit-table.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/edit-table.hbs index 70e7824..7a02d3a 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/templates/components/edit-table.hbs +++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/edit-table.hbs @@ -47,7 +47,7 @@ - + {{fa-icon "edit"}} Edit {{fa-icon "times"}} Cancel http://git-wip-us.apache.org/repos/asf/ambari/blob/ad94fcc2/contrib/views/hive20/src/main/resources/ui/app/templates/components/table-advanced-settings.hbs -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/table-advanced-settings.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/table-advanced-settings.hbs index 4aca56d..da1c0b4 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/templates/components/table-advanced-settings.hbs +++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/table-advanced-settings.hbs @@ -39,7 +39,7 @@ Number of buckets - {{input type="number" class="form-control" value=settings.numBuckets disabled=disableNumBucketsInput}} + {{input type="number" min="0" class="form-control" value=settings.numBuckets disabled=disableNumBucketsInput}} {{#if hasNumBucketError}} {{numBucketErrorText}} {{/if}} http://git-wip-us.apache.org/repos/asf/ambari/blob/ad94fcc2/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table/edit.hbs -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table/edit.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table/edit.hbs index 79f1701..6e4de64 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table/edit.hbs +++ b/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table/edit.hbs @@ -35,7 +35,7 @@ container-class="modal-dialog modal-sm"}} -{{fa-icon "plus"}}Â Â Â Create Database +{{fa-icon "plus"}}Â Â Â Edit Table {{modalMessage}}
ambari git commit: AMBARI-20199. HiveView2.0 query fails if we have an additional newline after the last query statement ending with '; '. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk 0712ef69f -> 4fb86de56 AMBARI-20199. HiveView2.0 query fails if we have an additional newline after the last query statement ending with ';'. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4fb86de5 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4fb86de5 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4fb86de5 Branch: refs/heads/trunk Commit: 4fb86de568347276c99a5cab739b4cab60f49b24 Parents: 0712ef6 Author: Dipayan Bhowmick Authored: Wed Mar 1 12:09:42 2017 +0530 Committer: Dipayan Bhowmick Committed: Wed Mar 1 12:10:14 2017 +0530 -- .../jobs/viewJobs/JobControllerImpl.java| 28 +++ .../jobs/viewJobs/JobControllerImpl.java| 29 2 files changed, 45 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/4fb86de5/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/jobs/viewJobs/JobControllerImpl.java -- diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/jobs/viewJobs/JobControllerImpl.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/jobs/viewJobs/JobControllerImpl.java index 66b8334..f1afc0f 100644 --- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/jobs/viewJobs/JobControllerImpl.java +++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/jobs/viewJobs/JobControllerImpl.java @@ -39,7 +39,7 @@ import org.apache.ambari.view.hive2.utils.ServiceFormattedException; import org.apache.ambari.view.utils.hdfs.HdfsApi; import org.apache.ambari.view.utils.hdfs.HdfsApiException; import org.apache.ambari.view.utils.hdfs.HdfsUtil; -import org.apache.commons.lang3.ArrayUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -47,6 +47,13 @@ import java.io.IOException; import java.lang.reflect.Proxy; import java.text.SimpleDateFormat; import java.util.Date; +import java.util.List; +import javax.annotation.Nullable; + +import com.google.common.base.Function; +import com.google.common.base.Predicate; +import com.google.common.collect.FluentIterable; +import com.google.common.collect.Lists; public class JobControllerImpl implements JobController, ModifyNotificationDelegate { private final static Logger LOG = @@ -113,11 +120,20 @@ public class JobControllerImpl implements JobController, ModifyNotificationDeleg } private String[] getStatements(String jobDatabase, String query) { - String[] queries = query.split(";"); - - - String[] strings = {"use " + jobDatabase}; - return ArrayUtils.addAll(strings, queries); +List queries = Lists.asList("use " + jobDatabase, query.split(";")); +List cleansedQueries = FluentIterable.from(queries).transform(new Function() { +@Nullable +@Override +public String apply(@Nullable String s) { +return s.trim(); +} +}).filter(new Predicate() { +@Override +public boolean apply(@Nullable String s) { +return !StringUtils.isEmpty(s); +} +}).toList(); +return cleansedQueries.toArray(new String[0]); } http://git-wip-us.apache.org/repos/asf/ambari/blob/4fb86de5/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/jobs/viewJobs/JobControllerImpl.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/jobs/viewJobs/JobControllerImpl.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/jobs/viewJobs/JobControllerImpl.java index 1511e5b..2886e65 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/jobs/viewJobs/JobControllerImpl.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/jobs/viewJobs/JobControllerImpl.java @@ -39,7 +39,7 @@ import org.apache.ambari.view.hive20.utils.ServiceFormattedException; import org.apache.ambari.view.utils.hdfs.HdfsApi; import org.apache.ambari.view.utils.hdfs.HdfsApiException; import org.apache.ambari.view.utils.hdfs.HdfsUtil; -import org.apache.commons.lang3.ArrayUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -47,6 +47,14 @@ import java.io.IOException; import java.lang.reflect.Proxy; import java.text.SimpleDateFormat; import java.util.Date; +import java.util.List; + +import javax.annotation.Nullable;
ambari git commit: AMBARI-20199. HiveView2.0 query fails if we have an additional newline after the last query statement ending with '; '. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 da9669763 -> e9475c479 AMBARI-20199. HiveView2.0 query fails if we have an additional newline after the last query statement ending with ';'. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e9475c47 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e9475c47 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e9475c47 Branch: refs/heads/branch-2.5 Commit: e9475c4795aca8040c69c61b46d8d0406ce5dcaa Parents: da96697 Author: Dipayan Bhowmick Authored: Wed Mar 1 12:09:42 2017 +0530 Committer: Dipayan Bhowmick Committed: Wed Mar 1 12:09:42 2017 +0530 -- .../jobs/viewJobs/JobControllerImpl.java| 28 +++ .../jobs/viewJobs/JobControllerImpl.java| 29 2 files changed, 45 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/e9475c47/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/jobs/viewJobs/JobControllerImpl.java -- diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/jobs/viewJobs/JobControllerImpl.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/jobs/viewJobs/JobControllerImpl.java index 66b8334..f1afc0f 100644 --- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/jobs/viewJobs/JobControllerImpl.java +++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/jobs/viewJobs/JobControllerImpl.java @@ -39,7 +39,7 @@ import org.apache.ambari.view.hive2.utils.ServiceFormattedException; import org.apache.ambari.view.utils.hdfs.HdfsApi; import org.apache.ambari.view.utils.hdfs.HdfsApiException; import org.apache.ambari.view.utils.hdfs.HdfsUtil; -import org.apache.commons.lang3.ArrayUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -47,6 +47,13 @@ import java.io.IOException; import java.lang.reflect.Proxy; import java.text.SimpleDateFormat; import java.util.Date; +import java.util.List; +import javax.annotation.Nullable; + +import com.google.common.base.Function; +import com.google.common.base.Predicate; +import com.google.common.collect.FluentIterable; +import com.google.common.collect.Lists; public class JobControllerImpl implements JobController, ModifyNotificationDelegate { private final static Logger LOG = @@ -113,11 +120,20 @@ public class JobControllerImpl implements JobController, ModifyNotificationDeleg } private String[] getStatements(String jobDatabase, String query) { - String[] queries = query.split(";"); - - - String[] strings = {"use " + jobDatabase}; - return ArrayUtils.addAll(strings, queries); +List queries = Lists.asList("use " + jobDatabase, query.split(";")); +List cleansedQueries = FluentIterable.from(queries).transform(new Function() { +@Nullable +@Override +public String apply(@Nullable String s) { +return s.trim(); +} +}).filter(new Predicate() { +@Override +public boolean apply(@Nullable String s) { +return !StringUtils.isEmpty(s); +} +}).toList(); +return cleansedQueries.toArray(new String[0]); } http://git-wip-us.apache.org/repos/asf/ambari/blob/e9475c47/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/jobs/viewJobs/JobControllerImpl.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/jobs/viewJobs/JobControllerImpl.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/jobs/viewJobs/JobControllerImpl.java index 1511e5b..2886e65 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/jobs/viewJobs/JobControllerImpl.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/jobs/viewJobs/JobControllerImpl.java @@ -39,7 +39,7 @@ import org.apache.ambari.view.hive20.utils.ServiceFormattedException; import org.apache.ambari.view.utils.hdfs.HdfsApi; import org.apache.ambari.view.utils.hdfs.HdfsApiException; import org.apache.ambari.view.utils.hdfs.HdfsUtil; -import org.apache.commons.lang3.ArrayUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -47,6 +47,14 @@ import java.io.IOException; import java.lang.reflect.Proxy; import java.text.SimpleDateFormat; import java.util.Date; +import java.util.List; + +import javax.annotation
ambari git commit: AMBARI-20207. Proper error is not thrown on hive view authorization page. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk 561f65d57 -> 0712ef69f AMBARI-20207. Proper error is not thrown on hive view authorization page. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0712ef69 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0712ef69 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0712ef69 Branch: refs/heads/trunk Commit: 0712ef69fd81611e80273259660ef23d49187334 Parents: 561f65d Author: Dipayan Bhowmick Authored: Wed Mar 1 12:05:03 2017 +0530 Committer: Dipayan Bhowmick Committed: Wed Mar 1 12:05:37 2017 +0530 -- .../view/hive20/resources/system/ranger/RangerService.java | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/0712ef69/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java index d300d9a..816d0e0 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java @@ -115,7 +115,13 @@ public class RangerService { } private List parseResponse(String rangerResponse) { -JSONArray jsonArray = (JSONArray) JSONValue.parse(rangerResponse); +Object parsedResult = JSONValue.parse(rangerResponse); +if (parsedResult instanceof JSONObject) { + JSONObject obj = (JSONObject) parsedResult; + LOG.error("Bad response from Ranger: {}", rangerResponse); + throw new RangerException((String)obj.get("msgDesc"), "RANGER_ERROR", ((Long)obj.get("statusCode")).intValue()); +} +JSONArray jsonArray = (JSONArray) parsedResult; if (jsonArray.size() == 0) { return new ArrayList<>(); } @@ -184,6 +190,7 @@ public class RangerService { LOG.error("Ranger returned an empty stream."); throw new RangerException("Ranger returned an empty stream.", "RANGER_ERROR", 500); } + return IOUtils.toString(stream); } catch (IOException e) { LOG.error("Bad response from Ranger. Exception: {}", e);
ambari git commit: AMBARI-20207. Proper error is not thrown on hive view authorization page. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 952ee58de -> da9669763 AMBARI-20207. Proper error is not thrown on hive view authorization page. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/da966976 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/da966976 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/da966976 Branch: refs/heads/branch-2.5 Commit: da9669763fd5225423f99bdd9364303009b1a8bb Parents: 952ee58 Author: Dipayan Bhowmick Authored: Wed Mar 1 12:05:03 2017 +0530 Committer: Dipayan Bhowmick Committed: Wed Mar 1 12:05:03 2017 +0530 -- .../view/hive20/resources/system/ranger/RangerService.java | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/da966976/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java index d300d9a..816d0e0 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java @@ -115,7 +115,13 @@ public class RangerService { } private List parseResponse(String rangerResponse) { -JSONArray jsonArray = (JSONArray) JSONValue.parse(rangerResponse); +Object parsedResult = JSONValue.parse(rangerResponse); +if (parsedResult instanceof JSONObject) { + JSONObject obj = (JSONObject) parsedResult; + LOG.error("Bad response from Ranger: {}", rangerResponse); + throw new RangerException((String)obj.get("msgDesc"), "RANGER_ERROR", ((Long)obj.get("statusCode")).intValue()); +} +JSONArray jsonArray = (JSONArray) parsedResult; if (jsonArray.size() == 0) { return new ArrayList<>(); } @@ -184,6 +190,7 @@ public class RangerService { LOG.error("Ranger returned an empty stream."); throw new RangerException("Ranger returned an empty stream.", "RANGER_ERROR", 500); } + return IOUtils.toString(stream); } catch (IOException e) { LOG.error("Bad response from Ranger. Exception: {}", e);
ambari git commit: AMBARI-20186. Result tab prints nothing for select query on empty table. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk 4c0690ac5 -> 561f65d57 AMBARI-20186. Result tab prints nothing for select query on empty table. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/561f65d5 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/561f65d5 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/561f65d5 Branch: refs/heads/trunk Commit: 561f65d573b568db09b842e4c9bb70fc77ae7723 Parents: 4c0690a Author: Dipayan Bhowmick Authored: Wed Mar 1 11:59:25 2017 +0530 Committer: Dipayan Bhowmick Committed: Wed Mar 1 12:01:01 2017 +0530 -- .../ambari/view/hive2/actor/ResultSetIterator.java | 2 +- .../view/hive2/actor/message/job/NoMoreItems.java | 16 +++- .../view/hive2/client/NonPersistentCursor.java | 3 +++ .../ambari/view/hive20/actor/ResultSetIterator.java | 2 +- .../view/hive20/actor/message/job/NoMoreItems.java | 16 +++- .../view/hive20/client/NonPersistentCursor.java | 3 +++ 6 files changed, 38 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/561f65d5/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/ResultSetIterator.java -- diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/ResultSetIterator.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/ResultSetIterator.java index 5bde12d..5a2eed8 100644 --- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/ResultSetIterator.java +++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/ResultSetIterator.java @@ -124,7 +124,7 @@ public class ResultSetIterator extends HiveActor { if (index == 0) { // We have hit end of resultSet -sender().tell(new NoMoreItems(), self()); +sender().tell(new NoMoreItems(columnDescriptions), self()); if(!async) { cleanUpResources(); } http://git-wip-us.apache.org/repos/asf/ambari/blob/561f65d5/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/NoMoreItems.java -- diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/NoMoreItems.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/NoMoreItems.java index aca5ba9..71a6e87 100644 --- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/NoMoreItems.java +++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/NoMoreItems.java @@ -18,4 +18,18 @@ package org.apache.ambari.view.hive2.actor.message.job; -public class NoMoreItems {} +import java.util.List; + +import org.apache.ambari.view.hive2.client.ColumnDescription; + +public class NoMoreItems { + private final List columns; + + public NoMoreItems(List columns) { +this.columns = columns; + } + + public List getColumns() { +return columns; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/561f65d5/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/NonPersistentCursor.java -- diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/NonPersistentCursor.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/NonPersistentCursor.java index ef015dc..0be2683 100644 --- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/NonPersistentCursor.java +++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/NonPersistentCursor.java @@ -141,6 +141,9 @@ public class NonPersistentCursor implements Cursor { } if (receive instanceof NoMoreItems) { + if(descriptions.isEmpty()) { +descriptions.addAll(((NoMoreItems)receive).getColumns()); + } endReached = true; } http://git-wip-us.apache.org/repos/asf/ambari/blob/561f65d5/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/ResultSetIterator.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/ResultSetIterator.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/ResultSetIterator.java index 5da5ee1..7e0e2d1 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/ResultSetIterator.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/ResultSetIterator.java @@
ambari git commit: AMBARI-20186. Result tab prints nothing for select query on empty table. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 eb0733e74 -> 952ee58de AMBARI-20186. Result tab prints nothing for select query on empty table. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/952ee58d Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/952ee58d Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/952ee58d Branch: refs/heads/branch-2.5 Commit: 952ee58de5406663a4e7df4060928664ecd576cb Parents: eb0733e Author: Dipayan Bhowmick Authored: Wed Mar 1 11:59:25 2017 +0530 Committer: Dipayan Bhowmick Committed: Wed Mar 1 11:59:25 2017 +0530 -- .../ambari/view/hive2/actor/ResultSetIterator.java | 2 +- .../view/hive2/actor/message/job/NoMoreItems.java | 16 +++- .../view/hive2/client/NonPersistentCursor.java | 3 +++ .../ambari/view/hive20/actor/ResultSetIterator.java | 2 +- .../view/hive20/actor/message/job/NoMoreItems.java | 16 +++- .../view/hive20/client/NonPersistentCursor.java | 3 +++ 6 files changed, 38 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/952ee58d/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/ResultSetIterator.java -- diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/ResultSetIterator.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/ResultSetIterator.java index 5bde12d..5a2eed8 100644 --- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/ResultSetIterator.java +++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/ResultSetIterator.java @@ -124,7 +124,7 @@ public class ResultSetIterator extends HiveActor { if (index == 0) { // We have hit end of resultSet -sender().tell(new NoMoreItems(), self()); +sender().tell(new NoMoreItems(columnDescriptions), self()); if(!async) { cleanUpResources(); } http://git-wip-us.apache.org/repos/asf/ambari/blob/952ee58d/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/NoMoreItems.java -- diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/NoMoreItems.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/NoMoreItems.java index aca5ba9..71a6e87 100644 --- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/NoMoreItems.java +++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/NoMoreItems.java @@ -18,4 +18,18 @@ package org.apache.ambari.view.hive2.actor.message.job; -public class NoMoreItems {} +import java.util.List; + +import org.apache.ambari.view.hive2.client.ColumnDescription; + +public class NoMoreItems { + private final List columns; + + public NoMoreItems(List columns) { +this.columns = columns; + } + + public List getColumns() { +return columns; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/952ee58d/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/NonPersistentCursor.java -- diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/NonPersistentCursor.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/NonPersistentCursor.java index ef015dc..0be2683 100644 --- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/NonPersistentCursor.java +++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/NonPersistentCursor.java @@ -141,6 +141,9 @@ public class NonPersistentCursor implements Cursor { } if (receive instanceof NoMoreItems) { + if(descriptions.isEmpty()) { +descriptions.addAll(((NoMoreItems)receive).getColumns()); + } endReached = true; } http://git-wip-us.apache.org/repos/asf/ambari/blob/952ee58d/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/ResultSetIterator.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/ResultSetIterator.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/ResultSetIterator.java index 5da5ee1..7e0e2d1 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/ResultSetIterator.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/ResultSetIterat
ambari git commit: AMBARI-20213. HiveView2.0 - order jobs with most recent first. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk 0ffa4789a -> 4c0690ac5 AMBARI-20213. HiveView2.0 - order jobs with most recent first. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4c0690ac Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4c0690ac Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4c0690ac Branch: refs/heads/trunk Commit: 4c0690ac5460d64c09bc0799d1a11b02520a0cba Parents: 0ffa478 Author: Dipayan Bhowmick Authored: Wed Mar 1 11:51:57 2017 +0530 Committer: Dipayan Bhowmick Committed: Wed Mar 1 11:53:03 2017 +0530 -- .../main/resources/ui/app/components/jobs-browser.js | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/4c0690ac/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js b/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js index 7179d45..be2771c 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js @@ -25,11 +25,20 @@ export default Ember.Component.extend({ statusFilter: null, titleFilter: null, - titleFilteredJobs: Ember.computed('jobs', 'titleFilter', function() { + sortedJobs: Ember.computed.sort('jobs', function (m1, m2) { +if (m1.get('dateSubmitted') < m2.get('dateSubmitted')) { + return 1; +} else if (m1.get('dateSubmitted') > m2.get('dateSubmitted')) { + return -1; +} +return 0; + }), + + titleFilteredJobs: Ember.computed('sortedJobs', 'titleFilter', function() { if (!Ember.isEmpty(this.get('titleFilter'))) { - return (this.get('jobs').filter((entry) => entry.get('title').toLowerCase().indexOf(this.get('titleFilter').toLowerCase()) >= 0)); + return (this.get('sortedJobs').filter((entry) => entry.get('title').toLowerCase().indexOf(this.get('titleFilter').toLowerCase()) >= 0)); } else { - return this.get('jobs'); + return this.get('sortedJobs'); } }),
ambari git commit: AMBARI-20213. HiveView2.0 - order jobs with most recent first. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 f4bee9dff -> eb0733e74 AMBARI-20213. HiveView2.0 - order jobs with most recent first. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/eb0733e7 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/eb0733e7 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/eb0733e7 Branch: refs/heads/branch-2.5 Commit: eb0733e7477b3a303568fb87391a212e90bd1423 Parents: f4bee9d Author: Dipayan Bhowmick Authored: Wed Mar 1 11:51:57 2017 +0530 Committer: Dipayan Bhowmick Committed: Wed Mar 1 11:51:57 2017 +0530 -- .../main/resources/ui/app/components/jobs-browser.js | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/eb0733e7/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js b/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js index 7179d45..be2771c 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js @@ -25,11 +25,20 @@ export default Ember.Component.extend({ statusFilter: null, titleFilter: null, - titleFilteredJobs: Ember.computed('jobs', 'titleFilter', function() { + sortedJobs: Ember.computed.sort('jobs', function (m1, m2) { +if (m1.get('dateSubmitted') < m2.get('dateSubmitted')) { + return 1; +} else if (m1.get('dateSubmitted') > m2.get('dateSubmitted')) { + return -1; +} +return 0; + }), + + titleFilteredJobs: Ember.computed('sortedJobs', 'titleFilter', function() { if (!Ember.isEmpty(this.get('titleFilter'))) { - return (this.get('jobs').filter((entry) => entry.get('title').toLowerCase().indexOf(this.get('titleFilter').toLowerCase()) >= 0)); + return (this.get('sortedJobs').filter((entry) => entry.get('title').toLowerCase().indexOf(this.get('titleFilter').toLowerCase()) >= 0)); } else { - return this.get('jobs'); + return this.get('sortedJobs'); } }),
ambari git commit: AMBARI-20216. HiveView2.0: Database and tables info doesn't match after navigating between tabs and landing back on Tables tab. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk 7808134f5 -> 0ffa4789a AMBARI-20216. HiveView2.0: Database and tables info doesn't match after navigating between tabs and landing back on Tables tab. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0ffa4789 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0ffa4789 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0ffa4789 Branch: refs/heads/trunk Commit: 0ffa4789ad2372859287b8c0264e8b080fd1d8df Parents: 7808134 Author: Dipayan Bhowmick Authored: Wed Mar 1 11:44:14 2017 +0530 Committer: Dipayan Bhowmick Committed: Wed Mar 1 11:44:59 2017 +0530 -- .../main/resources/ui/app/routes/databases.js | 24 ++-- .../ui/app/routes/databases/database/tables.js | 14 ++-- 2 files changed, 29 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/0ffa4789/contrib/views/hive20/src/main/resources/ui/app/routes/databases.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/databases.js b/contrib/views/hive20/src/main/resources/ui/app/routes/databases.js index 6b0eab2..e5efbe9 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/routes/databases.js +++ b/contrib/views/hive20/src/main/resources/ui/app/routes/databases.js @@ -46,13 +46,24 @@ export default Ember.Route.extend(UILoggerMixin, { }, selectDatabase(model) { -// check if default database is present -let toSelect = model.findBy('name', 'default'); -if (Ember.isEmpty(toSelect)) { - let sortedModel = model.sortBy('name'); - toSelect = sortedModel.get('firstObject'); +let alreadySelected = model.findBy('selected', true); +if (Ember.isEmpty(alreadySelected)) { + // Check if params present + let paramsForDatabase = this.paramsFor('databases.database'); + let toSelect = null; + if (!Ember.isEmpty(paramsForDatabase.databaseId)) { +toSelect = model.findBy('name', paramsForDatabase.databaseId); + } else { +// check if default database is present +toSelect = model.findBy('name', 'default'); + } + + if (Ember.isEmpty(toSelect)) { +let sortedModel = model.sortBy('name'); +toSelect = sortedModel.get('firstObject'); + } + toSelect.set('selected', true); } -toSelect.set('selected', true); }, actions: { @@ -68,7 +79,6 @@ export default Ember.Route.extend(UILoggerMixin, { } this.get('controller').set('databaseToDelete', selectedModel); - if (selectedModel.get('tables.length') > 0) { this.get('controller').set('databaseNotEmpty', true); console.log('database not empty'); http://git-wip-us.apache.org/repos/asf/ambari/blob/0ffa4789/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables.js b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables.js index 92f483f..d4a39cb 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables.js +++ b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables.js @@ -31,8 +31,18 @@ export default Ember.Route.extend({ }, selectTable(model) { let sortedModel = model.sortBy('name'); -let toSelect = sortedModel.get('firstObject'); -toSelect.set('selected', true); +let alreadySelected = sortedModel.findBy('selected', true); +if (Ember.isEmpty(alreadySelected)) { + let paramsForTable = this.paramsFor('databases.database.tables.table'); + let toSelect = null; + if (!Ember.isEmpty(paramsForTable.name)) { +toSelect = sortedModel.findBy('name', paramsForTable.name); + } else { +toSelect = sortedModel.get('firstObject'); + } + + toSelect.set('selected', true); +} }, actions: { tableSelected(table) {
ambari git commit: AMBARI-20216. HiveView2.0: Database and tables info doesn't match after navigating between tabs and landing back on Tables tab. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 b53fc82a7 -> f4bee9dff AMBARI-20216. HiveView2.0: Database and tables info doesn't match after navigating between tabs and landing back on Tables tab. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f4bee9df Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f4bee9df Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f4bee9df Branch: refs/heads/branch-2.5 Commit: f4bee9dff583cce1bff6cc4de02032e876a20b95 Parents: b53fc82 Author: Dipayan Bhowmick Authored: Wed Mar 1 11:44:14 2017 +0530 Committer: Dipayan Bhowmick Committed: Wed Mar 1 11:44:14 2017 +0530 -- .../main/resources/ui/app/routes/databases.js | 24 ++-- .../ui/app/routes/databases/database/tables.js | 14 ++-- 2 files changed, 29 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/f4bee9df/contrib/views/hive20/src/main/resources/ui/app/routes/databases.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/databases.js b/contrib/views/hive20/src/main/resources/ui/app/routes/databases.js index 6b0eab2..e5efbe9 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/routes/databases.js +++ b/contrib/views/hive20/src/main/resources/ui/app/routes/databases.js @@ -46,13 +46,24 @@ export default Ember.Route.extend(UILoggerMixin, { }, selectDatabase(model) { -// check if default database is present -let toSelect = model.findBy('name', 'default'); -if (Ember.isEmpty(toSelect)) { - let sortedModel = model.sortBy('name'); - toSelect = sortedModel.get('firstObject'); +let alreadySelected = model.findBy('selected', true); +if (Ember.isEmpty(alreadySelected)) { + // Check if params present + let paramsForDatabase = this.paramsFor('databases.database'); + let toSelect = null; + if (!Ember.isEmpty(paramsForDatabase.databaseId)) { +toSelect = model.findBy('name', paramsForDatabase.databaseId); + } else { +// check if default database is present +toSelect = model.findBy('name', 'default'); + } + + if (Ember.isEmpty(toSelect)) { +let sortedModel = model.sortBy('name'); +toSelect = sortedModel.get('firstObject'); + } + toSelect.set('selected', true); } -toSelect.set('selected', true); }, actions: { @@ -68,7 +79,6 @@ export default Ember.Route.extend(UILoggerMixin, { } this.get('controller').set('databaseToDelete', selectedModel); - if (selectedModel.get('tables.length') > 0) { this.get('controller').set('databaseNotEmpty', true); console.log('database not empty'); http://git-wip-us.apache.org/repos/asf/ambari/blob/f4bee9df/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables.js b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables.js index 92f483f..d4a39cb 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables.js +++ b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables.js @@ -31,8 +31,18 @@ export default Ember.Route.extend({ }, selectTable(model) { let sortedModel = model.sortBy('name'); -let toSelect = sortedModel.get('firstObject'); -toSelect.set('selected', true); +let alreadySelected = sortedModel.findBy('selected', true); +if (Ember.isEmpty(alreadySelected)) { + let paramsForTable = this.paramsFor('databases.database.tables.table'); + let toSelect = null; + if (!Ember.isEmpty(paramsForTable.name)) { +toSelect = sortedModel.findBy('name', paramsForTable.name); + } else { +toSelect = sortedModel.get('firstObject'); + } + + toSelect.set('selected', true); +} }, actions: { tableSelected(table) {
ambari git commit: AMBARI-20150. Hive View 2.0 Tables tab does not open at all if Ranger policy does not include access to the 'admin' user. (diapyanb)
Repository: ambari Updated Branches: refs/heads/trunk 42d3305db -> 869bc6386 AMBARI-20150. Hive View 2.0 Tables tab does not open at all if Ranger policy does not include access to the 'admin' user. (diapyanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/869bc638 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/869bc638 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/869bc638 Branch: refs/heads/trunk Commit: 869bc63861aa2beaf82b15aee447d104d0f3d213 Parents: 42d3305 Author: Dipayan Bhowmick Authored: Fri Feb 24 22:24:08 2017 +0530 Committer: Dipayan Bhowmick Committed: Fri Feb 24 22:24:40 2017 +0530 -- .../ui/app/components/notification-message.js | 30 .../ui/app/controllers/messages/message.js | 31 - .../resources/ui/app/routes/databases-error.js | 27 +++ .../ui/app/routes/databases/database-error.js | 27 +++ .../routes/databases/database/tables-error.js | 27 +++ .../databases/database/tables/table-error.js| 27 +++ .../resources/ui/app/services/alert-messages.js | 12 +++-- .../ui/app/styles/bootstrap-overrides.scss | 20 .../components/notification-message.hbs | 48 .../ui/app/templates/databases-error.hbs| 19 .../app/templates/databases/database-error.hbs | 19 .../databases/database/tables-error.hbs | 19 .../databases/database/tables/table-error.hbs | 19 .../ui/app/templates/messages/message.hbs | 31 + 14 files changed, 290 insertions(+), 66 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/869bc638/contrib/views/hive20/src/main/resources/ui/app/components/notification-message.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/notification-message.js b/contrib/views/hive20/src/main/resources/ui/app/components/notification-message.js new file mode 100644 index 000..339e095 --- /dev/null +++ b/contrib/views/hive20/src/main/resources/ui/app/components/notification-message.js @@ -0,0 +1,30 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import Ember from 'ember'; + +export default Ember.Component.extend({ + showStatus: Ember.computed('notification', function() { +return this.get('notification.status') !== -1; + }), + + displayBody: Ember.computed('notification', function() { +return !(Ember.isBlank(this.get('notification.responseMessage')) +&& Ember.isBlank(this.get('notification.trace'))); + }) +}); http://git-wip-us.apache.org/repos/asf/ambari/blob/869bc638/contrib/views/hive20/src/main/resources/ui/app/controllers/messages/message.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/controllers/messages/message.js b/contrib/views/hive20/src/main/resources/ui/app/controllers/messages/message.js deleted file mode 100644 index d46c1f6..000 --- a/contrib/views/hive20/src/main/resources/ui/app/controllers/messages/message.js +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import Ember from 'emb
ambari git commit: AMBARI-20150. Hive View 2.0 Tables tab does not open at all if Ranger policy does not include access to the 'admin' user. (diapyanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 b856c5f37 -> ab8b821e2 AMBARI-20150. Hive View 2.0 Tables tab does not open at all if Ranger policy does not include access to the 'admin' user. (diapyanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ab8b821e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ab8b821e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ab8b821e Branch: refs/heads/branch-2.5 Commit: ab8b821e2c8f8c54dbde788357c1995c7027b28b Parents: b856c5f Author: Dipayan Bhowmick Authored: Fri Feb 24 22:24:08 2017 +0530 Committer: Dipayan Bhowmick Committed: Fri Feb 24 22:24:08 2017 +0530 -- .../ui/app/components/notification-message.js | 30 .../ui/app/controllers/messages/message.js | 31 - .../resources/ui/app/routes/databases-error.js | 27 +++ .../ui/app/routes/databases/database-error.js | 27 +++ .../routes/databases/database/tables-error.js | 27 +++ .../databases/database/tables/table-error.js| 27 +++ .../resources/ui/app/services/alert-messages.js | 12 +++-- .../ui/app/styles/bootstrap-overrides.scss | 20 .../components/notification-message.hbs | 48 .../ui/app/templates/databases-error.hbs| 19 .../app/templates/databases/database-error.hbs | 19 .../databases/database/tables-error.hbs | 19 .../databases/database/tables/table-error.hbs | 19 .../ui/app/templates/messages/message.hbs | 31 + 14 files changed, 290 insertions(+), 66 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8b821e/contrib/views/hive20/src/main/resources/ui/app/components/notification-message.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/notification-message.js b/contrib/views/hive20/src/main/resources/ui/app/components/notification-message.js new file mode 100644 index 000..339e095 --- /dev/null +++ b/contrib/views/hive20/src/main/resources/ui/app/components/notification-message.js @@ -0,0 +1,30 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import Ember from 'ember'; + +export default Ember.Component.extend({ + showStatus: Ember.computed('notification', function() { +return this.get('notification.status') !== -1; + }), + + displayBody: Ember.computed('notification', function() { +return !(Ember.isBlank(this.get('notification.responseMessage')) +&& Ember.isBlank(this.get('notification.trace'))); + }) +}); http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8b821e/contrib/views/hive20/src/main/resources/ui/app/controllers/messages/message.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/controllers/messages/message.js b/contrib/views/hive20/src/main/resources/ui/app/controllers/messages/message.js deleted file mode 100644 index d46c1f6..000 --- a/contrib/views/hive20/src/main/resources/ui/app/controllers/messages/message.js +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import Ember
ambari git commit: AMBARI-20138. HiveView2.0: Settings page is case sensitive. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk 8e549208c -> 15f763e24 AMBARI-20138. HiveView2.0: Settings page is case sensitive. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/15f763e2 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/15f763e2 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/15f763e2 Branch: refs/heads/trunk Commit: 15f763e24ac46e6748d56bd422a5ee12f0f0874e Parents: 8e54920 Author: Dipayan Bhowmick Authored: Fri Feb 24 22:09:50 2017 +0530 Committer: Dipayan Bhowmick Committed: Fri Feb 24 22:11:21 2017 +0530 -- .../src/main/resources/ui/app/components/edit-setting-item.js | 2 +- .../views/hive20/src/main/resources/ui/app/routes/settings.js | 5 + 2 files changed, 6 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/15f763e2/contrib/views/hive20/src/main/resources/ui/app/components/edit-setting-item.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/edit-setting-item.js b/contrib/views/hive20/src/main/resources/ui/app/components/edit-setting-item.js index 4bc8787..161c17c 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/edit-setting-item.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/edit-setting-item.js @@ -52,7 +52,7 @@ export default Ember.Component.extend({ return {valid: true}; } -if (setting.get('values') && setting.get('values').mapBy('value').contains(value)) { +if (setting.get('values') && setting.get('values').mapBy('value').contains(value.toLowerCase())) { return {valid: true}; } else if (setting.get('values')) { error = `Value should be in (${setting.get('values').mapBy('value').join(', ')})`; http://git-wip-us.apache.org/repos/asf/ambari/blob/15f763e2/contrib/views/hive20/src/main/resources/ui/app/routes/settings.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/settings.js b/contrib/views/hive20/src/main/resources/ui/app/routes/settings.js index affc126..f45881b 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/routes/settings.js +++ b/contrib/views/hive20/src/main/resources/ui/app/routes/settings.js @@ -63,6 +63,11 @@ export default Ember.Route.extend(UILoggerMixin, { return setting.destroyRecord().then(data => { let model = this.get('controller.model'); model.removeObject(data); +let hiveParameters = this.controller.get('hiveParameters'); +let existingHiveParams = hiveParameters.findBy('name', setting.get('key')); +if(existingHiveParams) { + existingHiveParams.set('disabled', false); +} }, err => { this.get('logger').danger(`Failed to delete setting with key: '${setting.get('key')}`, this.extractError(err)); })
ambari git commit: AMBARI-20138. HiveView2.0: Settings page is case sensitive. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 c5c6d5962 -> 7702c4714 AMBARI-20138. HiveView2.0: Settings page is case sensitive. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7702c471 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7702c471 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7702c471 Branch: refs/heads/branch-2.5 Commit: 7702c47141d95a43ec16d6f5e6ae4f22a05f0e50 Parents: c5c6d59 Author: Dipayan Bhowmick Authored: Fri Feb 24 22:09:50 2017 +0530 Committer: Dipayan Bhowmick Committed: Fri Feb 24 22:09:50 2017 +0530 -- .../src/main/resources/ui/app/components/edit-setting-item.js | 2 +- .../views/hive20/src/main/resources/ui/app/routes/settings.js | 5 + 2 files changed, 6 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/7702c471/contrib/views/hive20/src/main/resources/ui/app/components/edit-setting-item.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/edit-setting-item.js b/contrib/views/hive20/src/main/resources/ui/app/components/edit-setting-item.js index 4bc8787..161c17c 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/edit-setting-item.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/edit-setting-item.js @@ -52,7 +52,7 @@ export default Ember.Component.extend({ return {valid: true}; } -if (setting.get('values') && setting.get('values').mapBy('value').contains(value)) { +if (setting.get('values') && setting.get('values').mapBy('value').contains(value.toLowerCase())) { return {valid: true}; } else if (setting.get('values')) { error = `Value should be in (${setting.get('values').mapBy('value').join(', ')})`; http://git-wip-us.apache.org/repos/asf/ambari/blob/7702c471/contrib/views/hive20/src/main/resources/ui/app/routes/settings.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/settings.js b/contrib/views/hive20/src/main/resources/ui/app/routes/settings.js index affc126..f45881b 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/routes/settings.js +++ b/contrib/views/hive20/src/main/resources/ui/app/routes/settings.js @@ -63,6 +63,11 @@ export default Ember.Route.extend(UILoggerMixin, { return setting.destroyRecord().then(data => { let model = this.get('controller.model'); model.removeObject(data); +let hiveParameters = this.controller.get('hiveParameters'); +let existingHiveParams = hiveParameters.findBy('name', setting.get('key')); +if(existingHiveParams) { + existingHiveParams.set('disabled', false); +} }, err => { this.get('logger').danger(`Failed to delete setting with key: '${setting.get('key')}`, this.extractError(err)); })
ambari git commit: AMBARI-20087. HiveView 2.0: Table search is case sensitive, show table only if name match exactly. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 2a0d22354 -> d31511969 AMBARI-20087. HiveView 2.0: Table search is case sensitive, show table only if name match exactly. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d3151196 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d3151196 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d3151196 Branch: refs/heads/branch-2.5 Commit: d31511969f3de260a932ffc396b3f9fa7eceb5ac Parents: 2a0d223 Author: Dipayan Bhowmick Authored: Wed Feb 22 12:55:09 2017 +0530 Committer: Dipayan Bhowmick Committed: Wed Feb 22 12:55:09 2017 +0530 -- .../hive20/src/main/resources/ui/app/components/list-filter.js | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/d3151196/contrib/views/hive20/src/main/resources/ui/app/components/list-filter.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/list-filter.js b/contrib/views/hive20/src/main/resources/ui/app/components/list-filter.js index d538aa3..db0b5c0 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/list-filter.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/list-filter.js @@ -22,6 +22,7 @@ export default Ember.Component.extend({ classNames: ['list-filter'], header: '', subHeader: '', + caseInsensitive: true, items: [], filterText: '', emptyFilterText: Ember.computed('filterText', function() { @@ -29,7 +30,9 @@ export default Ember.Component.extend({ }), filteredItems: Ember.computed('filterText', 'items.@each', function() { return this.get('items').filter((item) => { - return item.get('name').indexOf(this.get('filterText')) !== -1; + let filterText = this.get('caseInsensitive') ? this.get('filterText').toLowerCase() : this.get('filterText'); + let itemName = this.get('caseInsensitive') ? item.get('name').toLowerCase() : item.get('name') + return itemName.indexOf(filterText) !== -1; }); }),
ambari git commit: AMBARI-20087. HiveView 2.0: Table search is case sensitive, show table only if name match exactly. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk 4e7bf34a7 -> c655d7c08 AMBARI-20087. HiveView 2.0: Table search is case sensitive, show table only if name match exactly. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c655d7c0 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c655d7c0 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c655d7c0 Branch: refs/heads/trunk Commit: c655d7c08edd82fa5de1a009a7af399dd4b09eb7 Parents: 4e7bf34 Author: Dipayan Bhowmick Authored: Wed Feb 22 12:55:09 2017 +0530 Committer: Dipayan Bhowmick Committed: Wed Feb 22 12:55:36 2017 +0530 -- .../hive20/src/main/resources/ui/app/components/list-filter.js | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/c655d7c0/contrib/views/hive20/src/main/resources/ui/app/components/list-filter.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/list-filter.js b/contrib/views/hive20/src/main/resources/ui/app/components/list-filter.js index d538aa3..db0b5c0 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/list-filter.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/list-filter.js @@ -22,6 +22,7 @@ export default Ember.Component.extend({ classNames: ['list-filter'], header: '', subHeader: '', + caseInsensitive: true, items: [], filterText: '', emptyFilterText: Ember.computed('filterText', function() { @@ -29,7 +30,9 @@ export default Ember.Component.extend({ }), filteredItems: Ember.computed('filterText', 'items.@each', function() { return this.get('items').filter((item) => { - return item.get('name').indexOf(this.get('filterText')) !== -1; + let filterText = this.get('caseInsensitive') ? this.get('filterText').toLowerCase() : this.get('filterText'); + let itemName = this.get('caseInsensitive') ? item.get('name').toLowerCase() : item.get('name') + return itemName.indexOf(filterText) !== -1; }); }),
ambari git commit: AMBARI-20092. Hive View 2.0: User should be shown with appropriate error message when compute statistics action fails. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk 3e76e47c5 -> 4e7bf34a7 AMBARI-20092. Hive View 2.0: User should be shown with appropriate error message when compute statistics action fails. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4e7bf34a Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4e7bf34a Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4e7bf34a Branch: refs/heads/trunk Commit: 4e7bf34a7435148a8ab96fb9e46059189355edf8 Parents: 3e76e47 Author: Dipayan Bhowmick Authored: Wed Feb 22 12:42:34 2017 +0530 Committer: Dipayan Bhowmick Committed: Wed Feb 22 12:43:08 2017 +0530 -- .../src/main/resources/ui/app/components/table-statistics.js| 5 - .../resources/ui/app/routes/databases/database/tables/table.js | 2 ++ .../ui/app/routes/databases/database/tables/table/edit.js | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/4e7bf34a/contrib/views/hive20/src/main/resources/ui/app/components/table-statistics.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/table-statistics.js b/contrib/views/hive20/src/main/resources/ui/app/components/table-statistics.js index 1623e0e..0310cbc 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/table-statistics.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/table-statistics.js @@ -17,8 +17,9 @@ */ import Ember from 'ember'; +import UILoggerMixin from '../mixins/ui-logger'; -export default Ember.Component.extend({ +export default Ember.Component.extend(UILoggerMixin, { statsService: Ember.inject.service(), analyseWithStatistics: false, @@ -76,6 +77,7 @@ export default Ember.Component.extend({ Ember.run.later(() => this.closeAndRefresh(), 2 * 1000); }).catch((err) => { this.set('analyseMessage', 'Job failed for analysing statistics of table'); + this.get('logger').danger(`Job failed for analysing statistics of table '${tableName}'`, this.extractError(err)); Ember.run.later(() => this.closeAndRefresh(), 2 * 1000); }); }, @@ -96,6 +98,7 @@ export default Ember.Component.extend({ }).catch((err) => { column.set('isFetchingStats', false); column.set('statsError', true); + this.get('logger').danger(`Job failed for fetching column statistics for column '${column.name}' of table '${tableName}'`, this.extractError(err)); }); }, http://git-wip-us.apache.org/repos/asf/ambari/blob/4e7bf34a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table.js b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table.js index 6ee8100..53055cf 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table.js +++ b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table.js @@ -38,6 +38,8 @@ export default Ember.Route.extend(UILoggerMixin, { console.log(model.get('detailedInfo.tableType').toLowerCase()); if (model.get('detailedInfo.tableType').toLowerCase().indexOf('view') === -1) { newTabs = newTabs.rejectBy('name', 'viewInfo'); +} else { + newTabs = newTabs.rejectBy('name', 'statistics'); } controller.set('tabs', newTabs); }, http://git-wip-us.apache.org/repos/asf/ambari/blob/4e7bf34a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/edit.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/edit.js b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/edit.js index d9f80e1..2fa61b4 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/edit.js +++ b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/edit.js @@ -57,7 +57,7 @@ export default TableMetaRouter.extend(UILoggerMixin, { this._transitionToTables(); }).catch((err) => { this._modalStatus(false, 'Failed to edit table'); -this.get('logger').danger(`Failed to altered table '${settings.table}'`, this.extractError(err)); +this.get('logger').danger(`Failed to alter table '${settings.table}'`, this.extractError(err)); }); }
ambari git commit: AMBARI-20092. Hive View 2.0: User should be shown with appropriate error message when compute statistics action fails. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 2e664f6b2 -> 2a0d22354 AMBARI-20092. Hive View 2.0: User should be shown with appropriate error message when compute statistics action fails. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2a0d2235 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2a0d2235 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2a0d2235 Branch: refs/heads/branch-2.5 Commit: 2a0d2235487a61a3914ef2b5dc203dff366231bf Parents: 2e664f6 Author: Dipayan Bhowmick Authored: Wed Feb 22 12:42:34 2017 +0530 Committer: Dipayan Bhowmick Committed: Wed Feb 22 12:42:34 2017 +0530 -- .../src/main/resources/ui/app/components/table-statistics.js| 5 - .../resources/ui/app/routes/databases/database/tables/table.js | 2 ++ .../ui/app/routes/databases/database/tables/table/edit.js | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/2a0d2235/contrib/views/hive20/src/main/resources/ui/app/components/table-statistics.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/table-statistics.js b/contrib/views/hive20/src/main/resources/ui/app/components/table-statistics.js index 1623e0e..0310cbc 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/table-statistics.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/table-statistics.js @@ -17,8 +17,9 @@ */ import Ember from 'ember'; +import UILoggerMixin from '../mixins/ui-logger'; -export default Ember.Component.extend({ +export default Ember.Component.extend(UILoggerMixin, { statsService: Ember.inject.service(), analyseWithStatistics: false, @@ -76,6 +77,7 @@ export default Ember.Component.extend({ Ember.run.later(() => this.closeAndRefresh(), 2 * 1000); }).catch((err) => { this.set('analyseMessage', 'Job failed for analysing statistics of table'); + this.get('logger').danger(`Job failed for analysing statistics of table '${tableName}'`, this.extractError(err)); Ember.run.later(() => this.closeAndRefresh(), 2 * 1000); }); }, @@ -96,6 +98,7 @@ export default Ember.Component.extend({ }).catch((err) => { column.set('isFetchingStats', false); column.set('statsError', true); + this.get('logger').danger(`Job failed for fetching column statistics for column '${column.name}' of table '${tableName}'`, this.extractError(err)); }); }, http://git-wip-us.apache.org/repos/asf/ambari/blob/2a0d2235/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table.js b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table.js index 6ee8100..53055cf 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table.js +++ b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table.js @@ -38,6 +38,8 @@ export default Ember.Route.extend(UILoggerMixin, { console.log(model.get('detailedInfo.tableType').toLowerCase()); if (model.get('detailedInfo.tableType').toLowerCase().indexOf('view') === -1) { newTabs = newTabs.rejectBy('name', 'viewInfo'); +} else { + newTabs = newTabs.rejectBy('name', 'statistics'); } controller.set('tabs', newTabs); }, http://git-wip-us.apache.org/repos/asf/ambari/blob/2a0d2235/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/edit.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/edit.js b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/edit.js index d9f80e1..2fa61b4 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/edit.js +++ b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/edit.js @@ -57,7 +57,7 @@ export default TableMetaRouter.extend(UILoggerMixin, { this._transitionToTables(); }).catch((err) => { this._modalStatus(false, 'Failed to edit table'); -this.get('logger').danger(`Failed to altered table '${settings.table}'`, this.extractError(err)); +this.get('logger').danger(`Failed to alter table '${settings.table}'`, this.extractError(err)); }); }
ambari git commit: AMBARI-20086. Hive View 2.0: Code Refactoring. Removal of the database cache. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk bc4b8bced -> 3e76e47c5 AMBARI-20086. Hive View 2.0: Code Refactoring. Removal of the database cache. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/3e76e47c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3e76e47c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3e76e47c Branch: refs/heads/trunk Commit: 3e76e47c5430704723801819e7f5b59759242e61 Parents: bc4b8bc Author: Dipayan Bhowmick Authored: Wed Feb 22 12:35:57 2017 +0530 Committer: Dipayan Bhowmick Committed: Wed Feb 22 12:36:46 2017 +0530 -- .../ambari/view/hive20/ConnectionSystem.java| 27 -- .../hive20/actor/DatabaseChangeNotifier.java| 168 -- .../view/hive20/actor/DatabaseManager.java | 313 --- .../ambari/view/hive20/actor/JdbcConnector.java | 4 - .../ambari/view/hive20/actor/LogAggregator.java | 4 +- .../view/hive20/actor/MetaDataManager.java | 137 .../view/hive20/actor/MetaDataRetriever.java| 173 -- .../view/hive20/actor/TableChangeNotifier.java | 95 -- .../ambari/view/hive20/actor/message/Ping.java | 50 --- .../ambari/view/hive20/client/DDLDelegator.java | 7 +- .../view/hive20/client/DDLDelegatorImpl.java| 52 ++- .../view/hive20/internal/dto/TableInfo.java | 12 +- .../view/hive20/internal/dto/TableResponse.java | 9 - .../view/hive20/resources/browser/DDLProxy.java | 67 ++-- .../resources/browser/HiveBrowserService.java | 259 --- .../hive20/resources/system/SystemService.java | 28 +- .../utils/MetaDataManagerEventSubmitter.java| 43 --- .../src/main/resources/ui/app/adapters/ping.js | 35 --- .../main/resources/ui/app/adapters/ranger.js| 27 ++ .../src/main/resources/ui/app/models/table.js | 9 +- .../main/resources/ui/app/routes/application.js | 5 - .../databases/database/tables/table/auth.js | 2 +- .../resources/ui/app/serializers/database.js| 25 ++ .../main/resources/ui/app/serializers/table.js | 22 ++ .../resources/ui/app/services/keep-alive.js | 31 -- .../views/hive20/src/main/resources/view.xml| 5 - 26 files changed, 152 insertions(+), 1457 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/3e76e47c/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/ConnectionSystem.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/ConnectionSystem.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/ConnectionSystem.java index a6c7334..d7fbf41 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/ConnectionSystem.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/ConnectionSystem.java @@ -28,7 +28,6 @@ import com.typesafe.config.Config; import com.typesafe.config.ConfigFactory; import org.apache.ambari.view.ViewContext; import org.apache.ambari.view.hive20.actor.DeathWatch; -import org.apache.ambari.view.hive20.actor.MetaDataManager; import org.apache.ambari.view.hive20.actor.OperationController; import org.apache.ambari.view.hive20.internal.ConnectionSupplier; import org.apache.ambari.view.hive20.internal.DataStorageSupplier; @@ -47,7 +46,6 @@ public class ConnectionSystem { private static volatile ConnectionSystem instance = null; private static final Object lock = new Object(); private static Map> operationControllerMap = new ConcurrentHashMap<>(); - private final Map metaDataManagerMap = new ConcurrentHashMap<>(); // credentials map stores usernames and passwords private static Map credentialsMap = new ConcurrentHashMap<>(); @@ -107,31 +105,6 @@ public class ConnectionSystem { return ref; } - /** - * Returns one MetaDataManager actor per view instance - * @param context - View context - * @return MetaDataManager actor - */ - public synchronized ActorRef getMetaDataManager(ViewContext context) { -SafeViewContext safeViewContext = new SafeViewContext(context); -String instanceName = safeViewContext.getInstanceName(); -ActorRef metaDataManager = metaDataManagerMap.get(instanceName); -if(metaDataManager == null) { - metaDataManager = createMetaDataManager(safeViewContext); - metaDataManagerMap.put(instanceName, metaDataManager); -} - -return metaDataManager; - } - - public synchronized Optional getMetaDataManagerIfPresent(String instanceName) { -return Optional.fromNullable(metaDataManagerMap.get(instanceName)); - } - - private ActorRef createMetaDataManager(SafeViewContext safeViewContext) { -return actorSystem.actorOf(MetaDataManager.props(safeViewContext)); - } - public synchronized void
ambari git commit: AMBARI-20086. Hive View 2.0: Code Refactoring. Removal of the database cache. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 1e8f7c6ff -> 2e664f6b2 AMBARI-20086. Hive View 2.0: Code Refactoring. Removal of the database cache. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2e664f6b Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2e664f6b Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2e664f6b Branch: refs/heads/branch-2.5 Commit: 2e664f6b2098ffd31f420f8db41690f781a97b1c Parents: 1e8f7c6 Author: Dipayan Bhowmick Authored: Wed Feb 22 12:35:57 2017 +0530 Committer: Dipayan Bhowmick Committed: Wed Feb 22 12:35:57 2017 +0530 -- .../ambari/view/hive20/ConnectionSystem.java| 27 -- .../hive20/actor/DatabaseChangeNotifier.java| 168 -- .../view/hive20/actor/DatabaseManager.java | 313 --- .../ambari/view/hive20/actor/JdbcConnector.java | 4 - .../ambari/view/hive20/actor/LogAggregator.java | 4 +- .../view/hive20/actor/MetaDataManager.java | 137 .../view/hive20/actor/MetaDataRetriever.java| 173 -- .../view/hive20/actor/TableChangeNotifier.java | 95 -- .../ambari/view/hive20/actor/message/Ping.java | 50 --- .../ambari/view/hive20/client/DDLDelegator.java | 7 +- .../view/hive20/client/DDLDelegatorImpl.java| 52 ++- .../view/hive20/internal/dto/TableInfo.java | 12 +- .../view/hive20/internal/dto/TableResponse.java | 9 - .../view/hive20/resources/browser/DDLProxy.java | 67 ++-- .../resources/browser/HiveBrowserService.java | 259 --- .../hive20/resources/system/SystemService.java | 28 +- .../utils/MetaDataManagerEventSubmitter.java| 43 --- .../src/main/resources/ui/app/adapters/ping.js | 35 --- .../main/resources/ui/app/adapters/ranger.js| 27 ++ .../src/main/resources/ui/app/models/table.js | 9 +- .../main/resources/ui/app/routes/application.js | 5 - .../databases/database/tables/table/auth.js | 2 +- .../resources/ui/app/serializers/database.js| 25 ++ .../main/resources/ui/app/serializers/table.js | 22 ++ .../resources/ui/app/services/keep-alive.js | 31 -- .../views/hive20/src/main/resources/view.xml| 5 - 26 files changed, 152 insertions(+), 1457 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/2e664f6b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/ConnectionSystem.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/ConnectionSystem.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/ConnectionSystem.java index a6c7334..d7fbf41 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/ConnectionSystem.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/ConnectionSystem.java @@ -28,7 +28,6 @@ import com.typesafe.config.Config; import com.typesafe.config.ConfigFactory; import org.apache.ambari.view.ViewContext; import org.apache.ambari.view.hive20.actor.DeathWatch; -import org.apache.ambari.view.hive20.actor.MetaDataManager; import org.apache.ambari.view.hive20.actor.OperationController; import org.apache.ambari.view.hive20.internal.ConnectionSupplier; import org.apache.ambari.view.hive20.internal.DataStorageSupplier; @@ -47,7 +46,6 @@ public class ConnectionSystem { private static volatile ConnectionSystem instance = null; private static final Object lock = new Object(); private static Map> operationControllerMap = new ConcurrentHashMap<>(); - private final Map metaDataManagerMap = new ConcurrentHashMap<>(); // credentials map stores usernames and passwords private static Map credentialsMap = new ConcurrentHashMap<>(); @@ -107,31 +105,6 @@ public class ConnectionSystem { return ref; } - /** - * Returns one MetaDataManager actor per view instance - * @param context - View context - * @return MetaDataManager actor - */ - public synchronized ActorRef getMetaDataManager(ViewContext context) { -SafeViewContext safeViewContext = new SafeViewContext(context); -String instanceName = safeViewContext.getInstanceName(); -ActorRef metaDataManager = metaDataManagerMap.get(instanceName); -if(metaDataManager == null) { - metaDataManager = createMetaDataManager(safeViewContext); - metaDataManagerMap.put(instanceName, metaDataManager); -} - -return metaDataManager; - } - - public synchronized Optional getMetaDataManagerIfPresent(String instanceName) { -return Optional.fromNullable(metaDataManagerMap.get(instanceName)); - } - - private ActorRef createMetaDataManager(SafeViewContext safeViewContext) { -return actorSystem.actorOf(MetaDataManager.props(safeViewContext)); - } - public synchro
ambari git commit: Hive View 2.0: Alter table should not allow setting existing column or new columns as partitioned or clustered. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk fb01ba548 -> e585eb6ee Hive View 2.0: Alter table should not allow setting existing column or new columns as partitioned or clustered. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e585eb6e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e585eb6e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e585eb6e Branch: refs/heads/trunk Commit: e585eb6ee1aeff2e391aabae9789a0f85cb76728 Parents: fb01ba5 Author: Dipayan Bhowmick Authored: Tue Feb 21 13:20:30 2017 +0530 Committer: Dipayan Bhowmick Committed: Tue Feb 21 13:21:25 2017 +0530 -- .../main/resources/ui/app/templates/components/column-item.hbs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/e585eb6e/contrib/views/hive20/src/main/resources/ui/app/templates/components/column-item.hbs -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/column-item.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/column-item.hbs index 21418c1..762c77c 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/templates/components/column-item.hbs +++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/column-item.hbs @@ -91,14 +91,14 @@ -{{input type="checkbox" checked=column.isPartitioned disabled=(not column.editing)}} Partitioned +{{input type="checkbox" checked=column.isPartitioned disabled=(or (not column.editing) editMode)}} Partitioned -{{input type="checkbox" checked=column.isClustered disabled=(not column.editing)}} Clustered +{{input type="checkbox" checked=column.isClustered disabled=(or (not column.editing) editMode)}} Clustered
ambari git commit: Hive View 2.0: Alter table should not allow setting existing column or new columns as partitioned or clustered. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 010305d39 -> 2a38ff199 Hive View 2.0: Alter table should not allow setting existing column or new columns as partitioned or clustered. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2a38ff19 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2a38ff19 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2a38ff19 Branch: refs/heads/branch-2.5 Commit: 2a38ff1997919bc1c7c2269818586d4d7437e043 Parents: 010305d Author: Dipayan Bhowmick Authored: Tue Feb 21 13:20:30 2017 +0530 Committer: Dipayan Bhowmick Committed: Tue Feb 21 13:20:30 2017 +0530 -- .../main/resources/ui/app/templates/components/column-item.hbs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/2a38ff19/contrib/views/hive20/src/main/resources/ui/app/templates/components/column-item.hbs -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/column-item.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/column-item.hbs index 21418c1..762c77c 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/templates/components/column-item.hbs +++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/column-item.hbs @@ -91,14 +91,14 @@ -{{input type="checkbox" checked=column.isPartitioned disabled=(not column.editing)}} Partitioned +{{input type="checkbox" checked=column.isPartitioned disabled=(or (not column.editing) editMode)}} Partitioned -{{input type="checkbox" checked=column.isClustered disabled=(not column.editing)}} Clustered +{{input type="checkbox" checked=column.isClustered disabled=(or (not column.editing) editMode)}} Clustered
ambari git commit: AMBARI-20042. HiveView2.0 : For large datasets, query results overlaps. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk 60aaaeab5 -> fb01ba548 AMBARI-20042. HiveView2.0 : For large datasets, query results overlaps. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/fb01ba54 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/fb01ba54 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/fb01ba54 Branch: refs/heads/trunk Commit: fb01ba548464e87d3d7ec8b45eefc9e7378d4af6 Parents: 60aaaea Author: Dipayan Bhowmick Authored: Tue Feb 21 12:57:09 2017 +0530 Committer: Dipayan Bhowmick Committed: Tue Feb 21 13:10:54 2017 +0530 -- .../ui/app/components/query-result-table.js | 22 +++- .../resources/ui/app/helpers/extract-value.js | 27 + .../resources/ui/app/mixins/table-common.js | 86 .../resources/ui/app/routes/queries/query.js| 2 - .../src/main/resources/ui/app/styles/app.scss | 101 ++- .../templates/components/query-result-table.hbs | 67 ++-- .../hive20/src/main/resources/ui/package.json | 1 - 7 files changed, 91 insertions(+), 215 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/fb01ba54/contrib/views/hive20/src/main/resources/ui/app/components/query-result-table.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/query-result-table.js b/contrib/views/hive20/src/main/resources/ui/app/components/query-result-table.js index ea6dbc9..a2eb349 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/query-result-table.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/query-result-table.js @@ -17,8 +17,6 @@ */ import Ember from 'ember'; -import Table from 'ember-light-table'; -import TableCommon from '../mixins/table-common'; export default Ember.Component.extend({ @@ -28,6 +26,15 @@ export default Ember.Component.extend({ queryResult: {'schema' :[], 'rows' :[]}, + columnFilterText: null, + columnFilter: null, + + columnFilterDebounced: Ember.observer('columnFilterText', function() { +Ember.run.debounce(this, () => { + this.set('columnFilter', this.get('columnFilterText')) +}, 500); + }), + columns: Ember.computed('queryResult', function() { let queryResult = this.get('queryResult'); let columnArr =[]; @@ -61,8 +68,11 @@ export default Ember.Component.extend({ return rowArr; }), - table: Ember.computed('queryResult', 'rows', 'columns', function() { -return new Table(this.get('columns'), this.get('rows')); + filteredColumns: Ember.computed('columns', 'columnFilter', function() { +if (!Ember.isEmpty(this.get('columnFilter'))) { + return this.get('columns').filter((item) => item.label.indexOf(this.get('columnFilter')) > -1 ); +} +return this.get('columns'); }), showSaveHdfsModal:false, @@ -130,6 +140,10 @@ export default Ember.Component.extend({ showVisualExplain(){ this.sendAction('showVisualExplain'); +}, + +clearColumnsFilter() { + this.set('columnFilterText'); } } http://git-wip-us.apache.org/repos/asf/ambari/blob/fb01ba54/contrib/views/hive20/src/main/resources/ui/app/helpers/extract-value.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/helpers/extract-value.js b/contrib/views/hive20/src/main/resources/ui/app/helpers/extract-value.js new file mode 100644 index 000..76b3dee --- /dev/null +++ b/contrib/views/hive20/src/main/resources/ui/app/helpers/extract-value.js @@ -0,0 +1,27 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import Ember from 'ember'; + +export function extractValue(params,/*, hash*/) { + let map = params[0]; + let key = params[1]; + return map[key]; +} + +export default Ember.Helper.helper(extractValue); http://git-wip-us.apache.org/repos/asf/ambari/blob/fb01ba54/contrib/views/hive20/src/main/resources/ui/app/mixins/table-co
ambari git commit: AMBARI-20042. HiveView2.0 : For large datasets, query results overlaps. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 5e8f9dc3d -> 010305d39 AMBARI-20042. HiveView2.0 : For large datasets, query results overlaps. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/010305d3 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/010305d3 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/010305d3 Branch: refs/heads/branch-2.5 Commit: 010305d39419f9bf0ad86663b13fd4f97caec8df Parents: 5e8f9dc Author: Dipayan Bhowmick Authored: Tue Feb 21 12:57:09 2017 +0530 Committer: Dipayan Bhowmick Committed: Tue Feb 21 12:57:09 2017 +0530 -- .../ui/app/components/query-result-table.js | 22 +++- .../resources/ui/app/helpers/extract-value.js | 27 + .../resources/ui/app/mixins/table-common.js | 86 .../resources/ui/app/routes/queries/query.js| 2 - .../src/main/resources/ui/app/styles/app.scss | 101 ++- .../templates/components/query-result-table.hbs | 67 ++-- .../hive20/src/main/resources/ui/package.json | 1 - 7 files changed, 91 insertions(+), 215 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/010305d3/contrib/views/hive20/src/main/resources/ui/app/components/query-result-table.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/query-result-table.js b/contrib/views/hive20/src/main/resources/ui/app/components/query-result-table.js index ea6dbc9..a2eb349 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/query-result-table.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/query-result-table.js @@ -17,8 +17,6 @@ */ import Ember from 'ember'; -import Table from 'ember-light-table'; -import TableCommon from '../mixins/table-common'; export default Ember.Component.extend({ @@ -28,6 +26,15 @@ export default Ember.Component.extend({ queryResult: {'schema' :[], 'rows' :[]}, + columnFilterText: null, + columnFilter: null, + + columnFilterDebounced: Ember.observer('columnFilterText', function() { +Ember.run.debounce(this, () => { + this.set('columnFilter', this.get('columnFilterText')) +}, 500); + }), + columns: Ember.computed('queryResult', function() { let queryResult = this.get('queryResult'); let columnArr =[]; @@ -61,8 +68,11 @@ export default Ember.Component.extend({ return rowArr; }), - table: Ember.computed('queryResult', 'rows', 'columns', function() { -return new Table(this.get('columns'), this.get('rows')); + filteredColumns: Ember.computed('columns', 'columnFilter', function() { +if (!Ember.isEmpty(this.get('columnFilter'))) { + return this.get('columns').filter((item) => item.label.indexOf(this.get('columnFilter')) > -1 ); +} +return this.get('columns'); }), showSaveHdfsModal:false, @@ -130,6 +140,10 @@ export default Ember.Component.extend({ showVisualExplain(){ this.sendAction('showVisualExplain'); +}, + +clearColumnsFilter() { + this.set('columnFilterText'); } } http://git-wip-us.apache.org/repos/asf/ambari/blob/010305d3/contrib/views/hive20/src/main/resources/ui/app/helpers/extract-value.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/helpers/extract-value.js b/contrib/views/hive20/src/main/resources/ui/app/helpers/extract-value.js new file mode 100644 index 000..76b3dee --- /dev/null +++ b/contrib/views/hive20/src/main/resources/ui/app/helpers/extract-value.js @@ -0,0 +1,27 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import Ember from 'ember'; + +export function extractValue(params,/*, hash*/) { + let map = params[0]; + let key = params[1]; + return map[key]; +} + +export default Ember.Helper.helper(extractValue); http://git-wip-us.apache.org/repos/asf/ambari/blob/010305d3/contrib/views/hive20/src/main/resources/ui/app/mixin
ambari git commit: AMBARI-19981. Hive View 2.0: Enable Notifications. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk d797c7eb2 -> 6bb86b103 AMBARI-19981. Hive View 2.0: Enable Notifications. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/6bb86b10 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6bb86b10 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6bb86b10 Branch: refs/heads/trunk Commit: 6bb86b10360cfa1611a401f08f06b05c5a63a535 Parents: d797c7e Author: Dipayan Bhowmick Authored: Tue Feb 14 12:17:11 2017 +0530 Committer: Dipayan Bhowmick Committed: Tue Feb 14 13:27:48 2017 +0530 -- .../resources/ui/app/components/create-table.js | 6 +++- .../resources/ui/app/configs/file-format.js | 4 ++- .../resources/ui/app/controllers/messages.js| 30 .../ui/app/controllers/messages/message.js | 31 .../app/helpers/alert-message-context-class.js | 27 ++ .../ui/app/helpers/alert-message-icon-class.js | 37 .../resources/ui/app/helpers/shorten-text.js| 32 + .../main/resources/ui/app/mixins/ui-logger.js | 33 + .../main/resources/ui/app/routes/databases.js | 12 --- .../databases/database/tables/new-database.js | 15 .../app/routes/databases/database/tables/new.js | 8 +++-- .../routes/databases/database/tables/table.js | 8 +++-- .../databases/database/tables/table/edit.js | 16 - .../databases/database/tables/table/rename.js | 15 .../src/main/resources/ui/app/routes/jobs.js| 3 -- .../main/resources/ui/app/routes/settings.js| 10 +++--- .../resources/ui/app/services/alert-messages.js | 13 --- .../ui/app/templates/databases-loading.hbs | 21 +++ .../databases/database/tables-loading.hbs | 24 + .../databases/database/tables/table-loading.hbs | 21 +++ .../resources/ui/app/templates/jobs-loading.hbs | 20 +++ .../resources/ui/app/templates/messages.hbs | 14 +++- .../ui/app/templates/messages/message.hbs | 6 ++-- .../ui/app/templates/savedqueries-loading.hbs | 21 +++ .../ui/app/templates/settings-loading.hbs | 21 +++ .../resources/ui/app/templates/udfs-loading.hbs | 21 +++ .../src/main/resources/ui/config/environment.js | 2 +- 27 files changed, 405 insertions(+), 66 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/6bb86b10/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js b/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js index f31d37f..670ebd7 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js @@ -18,13 +18,17 @@ import Ember from 'ember'; import Helper from '../configs/helpers'; +import FileFormats from '../configs/file-format'; export default Ember.Component.extend({ init() { this._super(...arguments); +let defaultFileFormat = FileFormats.findBy('default', true); this.set('columns', Ember.A()); this.set('properties', []); -this.set('settings', {}); +this.set('settings', { + fileFormat: { type: defaultFileFormat.name} +}); this.set('shouldAddBuckets', null); this.set('settingErrors', []); }, http://git-wip-us.apache.org/repos/asf/ambari/blob/6bb86b10/contrib/views/hive20/src/main/resources/ui/app/configs/file-format.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/configs/file-format.js b/contrib/views/hive20/src/main/resources/ui/app/configs/file-format.js index 4042b63..afcba6e 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/configs/file-format.js +++ b/contrib/views/hive20/src/main/resources/ui/app/configs/file-format.js @@ -16,7 +16,7 @@ * limitations under the License. */ -export default [ +let fileFormats = [ {name: "SEQUENCEFILE", default: false, custom: false}, {name: "TEXTFILE", default: false, custom: false}, {name: "RCFILE", default: false, custom: false}, @@ -24,3 +24,5 @@ export default [ {name: "AVRO", default: false, custom: false}, {name: "CUSTOM SerDe", default: false, custom: true}, ]; + +export default fileFormats; http://git-wip-us.apache.org/repos/asf/ambari/blob/6bb86b10/contrib/views/hive20/src/main/resources/ui/app/controllers/messages.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/controllers/messages.js b/contrib/views/hive20/
ambari git commit: AMBARI-19981. Hive View 2.0: Enable Notifications. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 706a3dfe0 -> c2952d059 AMBARI-19981. Hive View 2.0: Enable Notifications. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c2952d05 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c2952d05 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c2952d05 Branch: refs/heads/branch-2.5 Commit: c2952d059b69bf27d4953105e3278782b664ce03 Parents: 706a3df Author: Dipayan Bhowmick Authored: Tue Feb 14 12:17:11 2017 +0530 Committer: Dipayan Bhowmick Committed: Tue Feb 14 13:26:53 2017 +0530 -- .../resources/ui/app/components/create-table.js | 6 +++- .../resources/ui/app/configs/file-format.js | 4 ++- .../resources/ui/app/controllers/messages.js| 30 .../ui/app/controllers/messages/message.js | 31 .../app/helpers/alert-message-context-class.js | 27 ++ .../ui/app/helpers/alert-message-icon-class.js | 37 .../resources/ui/app/helpers/shorten-text.js| 32 + .../main/resources/ui/app/mixins/ui-logger.js | 33 + .../main/resources/ui/app/routes/databases.js | 12 --- .../databases/database/tables/new-database.js | 15 .../app/routes/databases/database/tables/new.js | 8 +++-- .../routes/databases/database/tables/table.js | 8 +++-- .../databases/database/tables/table/edit.js | 16 - .../databases/database/tables/table/rename.js | 15 .../src/main/resources/ui/app/routes/jobs.js| 3 -- .../main/resources/ui/app/routes/settings.js| 10 +++--- .../resources/ui/app/services/alert-messages.js | 13 --- .../ui/app/templates/databases-loading.hbs | 21 +++ .../databases/database/tables-loading.hbs | 24 + .../databases/database/tables/table-loading.hbs | 21 +++ .../resources/ui/app/templates/jobs-loading.hbs | 20 +++ .../resources/ui/app/templates/messages.hbs | 14 +++- .../ui/app/templates/messages/message.hbs | 6 ++-- .../ui/app/templates/savedqueries-loading.hbs | 21 +++ .../ui/app/templates/settings-loading.hbs | 21 +++ .../resources/ui/app/templates/udfs-loading.hbs | 21 +++ .../src/main/resources/ui/config/environment.js | 2 +- 27 files changed, 405 insertions(+), 66 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/c2952d05/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js b/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js index f31d37f..670ebd7 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js @@ -18,13 +18,17 @@ import Ember from 'ember'; import Helper from '../configs/helpers'; +import FileFormats from '../configs/file-format'; export default Ember.Component.extend({ init() { this._super(...arguments); +let defaultFileFormat = FileFormats.findBy('default', true); this.set('columns', Ember.A()); this.set('properties', []); -this.set('settings', {}); +this.set('settings', { + fileFormat: { type: defaultFileFormat.name} +}); this.set('shouldAddBuckets', null); this.set('settingErrors', []); }, http://git-wip-us.apache.org/repos/asf/ambari/blob/c2952d05/contrib/views/hive20/src/main/resources/ui/app/configs/file-format.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/configs/file-format.js b/contrib/views/hive20/src/main/resources/ui/app/configs/file-format.js index 4042b63..afcba6e 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/configs/file-format.js +++ b/contrib/views/hive20/src/main/resources/ui/app/configs/file-format.js @@ -16,7 +16,7 @@ * limitations under the License. */ -export default [ +let fileFormats = [ {name: "SEQUENCEFILE", default: false, custom: false}, {name: "TEXTFILE", default: false, custom: false}, {name: "RCFILE", default: false, custom: false}, @@ -24,3 +24,5 @@ export default [ {name: "AVRO", default: false, custom: false}, {name: "CUSTOM SerDe", default: false, custom: true}, ]; + +export default fileFormats; http://git-wip-us.apache.org/repos/asf/ambari/blob/c2952d05/contrib/views/hive20/src/main/resources/ui/app/controllers/messages.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/controllers/messages.js b/contrib/vie
ambari git commit: AMBARI-19981. Hive View 2.0: Enable Notifications. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk a6445ac83 -> 6c4cbc4f7 AMBARI-19981. Hive View 2.0: Enable Notifications. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/6c4cbc4f Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6c4cbc4f Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6c4cbc4f Branch: refs/heads/trunk Commit: 6c4cbc4f7efddd55e063dbff470fa04eee2e68bf Parents: a6445ac Author: Dipayan Bhowmick Authored: Mon Feb 13 18:59:11 2017 +0530 Committer: Dipayan Bhowmick Committed: Mon Feb 13 18:59:54 2017 +0530 -- .../resources/ui/app/components/create-table.js | 6 +++- .../resources/ui/app/configs/file-format.js | 4 ++- .../resources/ui/app/controllers/messages.js| 30 .../ui/app/controllers/messages/message.js | 31 .../app/helpers/alert-message-context-class.js | 27 ++ .../ui/app/helpers/alert-message-icon-class.js | 37 .../resources/ui/app/helpers/shorten-text.js| 32 + .../main/resources/ui/app/mixins/ui-logger.js | 15 .../main/resources/ui/app/routes/databases.js | 12 --- .../databases/database/tables/new-database.js | 15 .../app/routes/databases/database/tables/new.js | 8 +++-- .../routes/databases/database/tables/table.js | 8 +++-- .../databases/database/tables/table/edit.js | 16 - .../databases/database/tables/table/rename.js | 15 .../src/main/resources/ui/app/routes/jobs.js| 3 -- .../main/resources/ui/app/routes/settings.js| 10 +++--- .../resources/ui/app/services/alert-messages.js | 13 --- .../ui/app/templates/databases-loading.hbs | 21 +++ .../databases/database/tables-loading.hbs | 24 + .../databases/database/tables/table-loading.hbs | 21 +++ .../resources/ui/app/templates/jobs-loading.hbs | 20 +++ .../resources/ui/app/templates/messages.hbs | 14 +++- .../ui/app/templates/messages/message.hbs | 6 ++-- .../ui/app/templates/savedqueries-loading.hbs | 21 +++ .../ui/app/templates/settings-loading.hbs | 21 +++ .../resources/ui/app/templates/udfs-loading.hbs | 21 +++ .../src/main/resources/ui/config/environment.js | 2 +- 27 files changed, 387 insertions(+), 66 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/6c4cbc4f/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js b/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js index f31d37f..670ebd7 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js @@ -18,13 +18,17 @@ import Ember from 'ember'; import Helper from '../configs/helpers'; +import FileFormats from '../configs/file-format'; export default Ember.Component.extend({ init() { this._super(...arguments); +let defaultFileFormat = FileFormats.findBy('default', true); this.set('columns', Ember.A()); this.set('properties', []); -this.set('settings', {}); +this.set('settings', { + fileFormat: { type: defaultFileFormat.name} +}); this.set('shouldAddBuckets', null); this.set('settingErrors', []); }, http://git-wip-us.apache.org/repos/asf/ambari/blob/6c4cbc4f/contrib/views/hive20/src/main/resources/ui/app/configs/file-format.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/configs/file-format.js b/contrib/views/hive20/src/main/resources/ui/app/configs/file-format.js index 4042b63..afcba6e 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/configs/file-format.js +++ b/contrib/views/hive20/src/main/resources/ui/app/configs/file-format.js @@ -16,7 +16,7 @@ * limitations under the License. */ -export default [ +let fileFormats = [ {name: "SEQUENCEFILE", default: false, custom: false}, {name: "TEXTFILE", default: false, custom: false}, {name: "RCFILE", default: false, custom: false}, @@ -24,3 +24,5 @@ export default [ {name: "AVRO", default: false, custom: false}, {name: "CUSTOM SerDe", default: false, custom: true}, ]; + +export default fileFormats; http://git-wip-us.apache.org/repos/asf/ambari/blob/6c4cbc4f/contrib/views/hive20/src/main/resources/ui/app/controllers/messages.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/controllers/messages.js b/contrib/views/hive20/src/main/
ambari git commit: AMBARI-19981. Hive View 2.0: Enable Notifications. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 25f16ef35 -> 692bf9759 AMBARI-19981. Hive View 2.0: Enable Notifications. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/692bf975 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/692bf975 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/692bf975 Branch: refs/heads/branch-2.5 Commit: 692bf97591a3538421720409bc3253451b8d8e0e Parents: 25f16ef Author: Dipayan Bhowmick Authored: Mon Feb 13 18:59:11 2017 +0530 Committer: Dipayan Bhowmick Committed: Mon Feb 13 18:59:11 2017 +0530 -- .../resources/ui/app/components/create-table.js | 6 +++- .../resources/ui/app/configs/file-format.js | 4 ++- .../resources/ui/app/controllers/messages.js| 30 .../ui/app/controllers/messages/message.js | 31 .../app/helpers/alert-message-context-class.js | 27 ++ .../ui/app/helpers/alert-message-icon-class.js | 37 .../resources/ui/app/helpers/shorten-text.js| 32 + .../main/resources/ui/app/mixins/ui-logger.js | 15 .../main/resources/ui/app/routes/databases.js | 12 --- .../databases/database/tables/new-database.js | 15 .../app/routes/databases/database/tables/new.js | 8 +++-- .../routes/databases/database/tables/table.js | 8 +++-- .../databases/database/tables/table/edit.js | 16 - .../databases/database/tables/table/rename.js | 15 .../src/main/resources/ui/app/routes/jobs.js| 3 -- .../main/resources/ui/app/routes/settings.js| 10 +++--- .../resources/ui/app/services/alert-messages.js | 13 --- .../ui/app/templates/databases-loading.hbs | 21 +++ .../databases/database/tables-loading.hbs | 24 + .../databases/database/tables/table-loading.hbs | 21 +++ .../resources/ui/app/templates/jobs-loading.hbs | 20 +++ .../resources/ui/app/templates/messages.hbs | 14 +++- .../ui/app/templates/messages/message.hbs | 6 ++-- .../ui/app/templates/savedqueries-loading.hbs | 21 +++ .../ui/app/templates/settings-loading.hbs | 21 +++ .../resources/ui/app/templates/udfs-loading.hbs | 21 +++ .../src/main/resources/ui/config/environment.js | 2 +- 27 files changed, 387 insertions(+), 66 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/692bf975/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js b/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js index f31d37f..670ebd7 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js @@ -18,13 +18,17 @@ import Ember from 'ember'; import Helper from '../configs/helpers'; +import FileFormats from '../configs/file-format'; export default Ember.Component.extend({ init() { this._super(...arguments); +let defaultFileFormat = FileFormats.findBy('default', true); this.set('columns', Ember.A()); this.set('properties', []); -this.set('settings', {}); +this.set('settings', { + fileFormat: { type: defaultFileFormat.name} +}); this.set('shouldAddBuckets', null); this.set('settingErrors', []); }, http://git-wip-us.apache.org/repos/asf/ambari/blob/692bf975/contrib/views/hive20/src/main/resources/ui/app/configs/file-format.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/configs/file-format.js b/contrib/views/hive20/src/main/resources/ui/app/configs/file-format.js index 4042b63..afcba6e 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/configs/file-format.js +++ b/contrib/views/hive20/src/main/resources/ui/app/configs/file-format.js @@ -16,7 +16,7 @@ * limitations under the License. */ -export default [ +let fileFormats = [ {name: "SEQUENCEFILE", default: false, custom: false}, {name: "TEXTFILE", default: false, custom: false}, {name: "RCFILE", default: false, custom: false}, @@ -24,3 +24,5 @@ export default [ {name: "AVRO", default: false, custom: false}, {name: "CUSTOM SerDe", default: false, custom: true}, ]; + +export default fileFormats; http://git-wip-us.apache.org/repos/asf/ambari/blob/692bf975/contrib/views/hive20/src/main/resources/ui/app/controllers/messages.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/controllers/messages.js b/contrib/views/hive20
ambari git commit: AMBARI-19950. Hive View 2.0: Restrict user to change the bucket while editing a clustered table. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk 232b585bd -> 92cf56152 AMBARI-19950. Hive View 2.0: Restrict user to change the bucket while editing a clustered table. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/92cf5615 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/92cf5615 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/92cf5615 Branch: refs/heads/trunk Commit: 92cf561520572ac65ca6e593729bb13a3edff8e1 Parents: 232b585 Author: Dipayan Bhowmick Authored: Fri Feb 10 15:13:26 2017 +0530 Committer: Dipayan Bhowmick Committed: Fri Feb 10 15:14:37 2017 +0530 -- .../main/resources/ui/app/components/table-advanced-settings.js | 5 + .../ui/app/templates/components/table-advanced-settings.hbs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/92cf5615/contrib/views/hive20/src/main/resources/ui/app/components/table-advanced-settings.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/table-advanced-settings.js b/contrib/views/hive20/src/main/resources/ui/app/components/table-advanced-settings.js index 99a9bb6..5e58cd8 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/table-advanced-settings.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/table-advanced-settings.js @@ -31,6 +31,7 @@ export default Ember.Component.extend({ errors: [], editMode: false, disableTransactionInput: false, + disableNumBucketsInput: false, settings: {}, @@ -72,6 +73,10 @@ export default Ember.Component.extend({ if(!Ember.isEmpty(this.get('settings.transactional')) && this.get('settings.transactional') && this.get('editMode')) { this.set('disableTransactionInput', true); } + +if(!Ember.isEmpty(this.get('settings.numBuckets')) && this.get('settings.numBuckets') && this.get('editMode')) { + this.set('disableNumBucketsInput', true); +} }, locationInputObserver: Ember.observer('showLocationInput', function () { http://git-wip-us.apache.org/repos/asf/ambari/blob/92cf5615/contrib/views/hive20/src/main/resources/ui/app/templates/components/table-advanced-settings.hbs -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/table-advanced-settings.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/table-advanced-settings.hbs index f7a92ce..4aca56d 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/templates/components/table-advanced-settings.hbs +++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/table-advanced-settings.hbs @@ -39,7 +39,7 @@ Number of buckets - {{input type="number" class="form-control" value=settings.numBuckets}} + {{input type="number" class="form-control" value=settings.numBuckets disabled=disableNumBucketsInput}} {{#if hasNumBucketError}} {{numBucketErrorText}} {{/if}}
ambari git commit: AMBARI-19950. Hive View 2.0: Restrict user to change the bucket while editing a clustered table. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 9fb94ade5 -> cd31e0ccf AMBARI-19950. Hive View 2.0: Restrict user to change the bucket while editing a clustered table. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/cd31e0cc Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/cd31e0cc Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/cd31e0cc Branch: refs/heads/branch-2.5 Commit: cd31e0ccf21001b7add6e7283ccf719de7b25c80 Parents: 9fb94ad Author: Dipayan Bhowmick Authored: Fri Feb 10 15:13:26 2017 +0530 Committer: Dipayan Bhowmick Committed: Fri Feb 10 15:13:26 2017 +0530 -- .../main/resources/ui/app/components/table-advanced-settings.js | 5 + .../ui/app/templates/components/table-advanced-settings.hbs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/cd31e0cc/contrib/views/hive20/src/main/resources/ui/app/components/table-advanced-settings.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/table-advanced-settings.js b/contrib/views/hive20/src/main/resources/ui/app/components/table-advanced-settings.js index 99a9bb6..5e58cd8 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/table-advanced-settings.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/table-advanced-settings.js @@ -31,6 +31,7 @@ export default Ember.Component.extend({ errors: [], editMode: false, disableTransactionInput: false, + disableNumBucketsInput: false, settings: {}, @@ -72,6 +73,10 @@ export default Ember.Component.extend({ if(!Ember.isEmpty(this.get('settings.transactional')) && this.get('settings.transactional') && this.get('editMode')) { this.set('disableTransactionInput', true); } + +if(!Ember.isEmpty(this.get('settings.numBuckets')) && this.get('settings.numBuckets') && this.get('editMode')) { + this.set('disableNumBucketsInput', true); +} }, locationInputObserver: Ember.observer('showLocationInput', function () { http://git-wip-us.apache.org/repos/asf/ambari/blob/cd31e0cc/contrib/views/hive20/src/main/resources/ui/app/templates/components/table-advanced-settings.hbs -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/table-advanced-settings.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/table-advanced-settings.hbs index f7a92ce..4aca56d 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/templates/components/table-advanced-settings.hbs +++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/table-advanced-settings.hbs @@ -39,7 +39,7 @@ Number of buckets - {{input type="number" class="form-control" value=settings.numBuckets}} + {{input type="number" class="form-control" value=settings.numBuckets disabled=disableNumBucketsInput}} {{#if hasNumBucketError}} {{numBucketErrorText}} {{/if}}
ambari git commit: AMBARI-19949. Hive View 2.0: Introduce validation for expression precision >= scale. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk 09e35e1e3 -> 232b585bd AMBARI-19949. Hive View 2.0: Introduce validation for expression precision >= scale. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/232b585b Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/232b585b Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/232b585b Branch: refs/heads/trunk Commit: 232b585bdd0350f5b2fb8c2c7ebf200cd3286fa7 Parents: 09e35e1 Author: Dipayan Bhowmick Authored: Fri Feb 10 15:09:29 2017 +0530 Committer: Dipayan Bhowmick Committed: Fri Feb 10 15:10:17 2017 +0530 -- contrib/views/hive20/src/main/resources/ui/app/models/column.js | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/232b585b/contrib/views/hive20/src/main/resources/ui/app/models/column.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/models/column.js b/contrib/views/hive20/src/main/resources/ui/app/models/column.js index 1d9ccce..f38309b 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/models/column.js +++ b/contrib/views/hive20/src/main/resources/ui/app/models/column.js @@ -87,6 +87,8 @@ let Column = Ember.Object.extend(Ember.Copyable,{ this.get('errors').pushObject({type: 'precision', error: "Precision can only be a number"}); } else if(this.get('precision') <= 0) { this.get('errors').pushObject({type: 'precision', error: "Precision can only be greater than zero"}); + } else if(this.get('type.hasScale') && this.get('scale') && (this.get('precision') < this.get('scale'))) { +this.get('errors').pushObject({type: 'precision', error: "Precision can only be greater than scale"}); } }
ambari git commit: AMBARI-19949. Hive View 2.0: Introduce validation for expression precision >= scale. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 20a224cec -> 9fb94ade5 AMBARI-19949. Hive View 2.0: Introduce validation for expression precision >= scale. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9fb94ade Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9fb94ade Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9fb94ade Branch: refs/heads/branch-2.5 Commit: 9fb94ade5fc47aa8731e6cfdfdf9559f29bcb364 Parents: 20a224c Author: Dipayan Bhowmick Authored: Fri Feb 10 15:09:29 2017 +0530 Committer: Dipayan Bhowmick Committed: Fri Feb 10 15:09:29 2017 +0530 -- contrib/views/hive20/src/main/resources/ui/app/models/column.js | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/9fb94ade/contrib/views/hive20/src/main/resources/ui/app/models/column.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/models/column.js b/contrib/views/hive20/src/main/resources/ui/app/models/column.js index 1d9ccce..f38309b 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/models/column.js +++ b/contrib/views/hive20/src/main/resources/ui/app/models/column.js @@ -87,6 +87,8 @@ let Column = Ember.Object.extend(Ember.Copyable,{ this.get('errors').pushObject({type: 'precision', error: "Precision can only be a number"}); } else if(this.get('precision') <= 0) { this.get('errors').pushObject({type: 'precision', error: "Precision can only be greater than zero"}); + } else if(this.get('type.hasScale') && this.get('scale') && (this.get('precision') < this.get('scale'))) { +this.get('errors').pushObject({type: 'precision', error: "Precision can only be greater than scale"}); } }
ambari git commit: AMBARI-19940. Hive View 2.0: Remove aria tags from templates. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk 2ce104231 -> 09e35e1e3 AMBARI-19940. Hive View 2.0: Remove aria tags from templates. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/09e35e1e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/09e35e1e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/09e35e1e Branch: refs/heads/trunk Commit: 09e35e1e3de0206edbf139ed5cbf9a33b470c7f1 Parents: 2ce1042 Author: Dipayan Bhowmick Authored: Fri Feb 10 15:06:13 2017 +0530 Committer: Dipayan Bhowmick Committed: Fri Feb 10 15:06:46 2017 +0530 -- .../main/resources/ui/app/templates/components/alert-message.hbs | 2 +- .../main/resources/ui/app/templates/components/column-item.hbs | 2 +- .../resources/ui/app/templates/components/confirm-dialog.hbs | 2 +- .../main/resources/ui/app/templates/components/export-result.hbs | 2 +- .../resources/ui/app/templates/components/hdfs-viewer-modal.hbs | 2 +- .../main/resources/ui/app/templates/components/info-dialog.hbs | 2 +- .../resources/ui/app/templates/components/query-result-table.hbs | 4 ++-- .../hive20/src/main/resources/ui/app/templates/databases.hbs | 2 +- .../ui/app/templates/databases/database/tables/table.hbs | 4 ++-- .../hive20/src/main/resources/ui/app/templates/queries/query.hbs | 4 ++-- .../hive20/src/main/resources/ui/app/templates/savedqueries.hbs | 4 ++-- .../hive20/src/main/resources/ui/app/templates/service-check.hbs | 2 +- 12 files changed, 16 insertions(+), 16 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/09e35e1e/contrib/views/hive20/src/main/resources/ui/app/templates/components/alert-message.hbs -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/alert-message.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/alert-message.hbs index ce8d941..2f114f9 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/templates/components/alert-message.hbs +++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/alert-message.hbs @@ -17,7 +17,7 @@ }} - × + × {{#fa-stack size=2}} {{fa-icon "circle-thin" stack=2}} http://git-wip-us.apache.org/repos/asf/ambari/blob/09e35e1e/contrib/views/hive20/src/main/resources/ui/app/templates/components/column-item.hbs -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/column-item.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/column-item.hbs index b649d5b..21418c1 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/templates/components/column-item.hbs +++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/column-item.hbs @@ -75,7 +75,7 @@ container-class="modal-dialog"}} - × + × {{fa-icon "cog" size="lg"}} Advance Column Options http://git-wip-us.apache.org/repos/asf/ambari/blob/09e35e1e/contrib/views/hive20/src/main/resources/ui/app/templates/components/confirm-dialog.hbs -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/confirm-dialog.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/confirm-dialog.hbs index d940237..b62e98b 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/templates/components/confirm-dialog.hbs +++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/confirm-dialog.hbs @@ -24,7 +24,7 @@ {{#if closable}} -× +× {{/if}} {{#if titleIcon}}{{fa-icon titleIcon size="lg"}}{{/if}} {{title}} http://git-wip-us.apache.org/repos/asf/ambari/blob/09e35e1e/contrib/views/hive20/src/main/resources/ui/app/templates/components/export-result.hbs -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/export-result.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/export-result.hbs index 0b462cb..69991f1 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/templates/components/export-result.hbs +++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/export-result.hbs @@ -23,7 +23,7 @@ container-class="modal-dialog"}} -× +× {{#if labelIcon}}{{fa-icon labelIcon size="lg"}}{{/if}} {{label}} http://git-wip-us.apache.org/repos/asf/ambari/blob/09e35e1e/contrib/views/hive20/src/main/resources/ui/app/templates/components/hdfs-viewer-modal
ambari git commit: AMBARI-19940. Hive View 2.0: Remove aria tags from templates. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 13e30b393 -> 20a224cec AMBARI-19940. Hive View 2.0: Remove aria tags from templates. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/20a224ce Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/20a224ce Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/20a224ce Branch: refs/heads/branch-2.5 Commit: 20a224cecedbda9fe042867cf061ef0d8e8d5172 Parents: 13e30b3 Author: Dipayan Bhowmick Authored: Fri Feb 10 15:06:13 2017 +0530 Committer: Dipayan Bhowmick Committed: Fri Feb 10 15:06:13 2017 +0530 -- .../main/resources/ui/app/templates/components/alert-message.hbs | 2 +- .../main/resources/ui/app/templates/components/column-item.hbs | 2 +- .../resources/ui/app/templates/components/confirm-dialog.hbs | 2 +- .../main/resources/ui/app/templates/components/export-result.hbs | 2 +- .../resources/ui/app/templates/components/hdfs-viewer-modal.hbs | 2 +- .../main/resources/ui/app/templates/components/info-dialog.hbs | 2 +- .../resources/ui/app/templates/components/query-result-table.hbs | 4 ++-- .../hive20/src/main/resources/ui/app/templates/databases.hbs | 2 +- .../ui/app/templates/databases/database/tables/table.hbs | 4 ++-- .../hive20/src/main/resources/ui/app/templates/queries/query.hbs | 4 ++-- .../hive20/src/main/resources/ui/app/templates/savedqueries.hbs | 4 ++-- .../hive20/src/main/resources/ui/app/templates/service-check.hbs | 2 +- 12 files changed, 16 insertions(+), 16 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/20a224ce/contrib/views/hive20/src/main/resources/ui/app/templates/components/alert-message.hbs -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/alert-message.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/alert-message.hbs index ce8d941..2f114f9 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/templates/components/alert-message.hbs +++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/alert-message.hbs @@ -17,7 +17,7 @@ }} - × + × {{#fa-stack size=2}} {{fa-icon "circle-thin" stack=2}} http://git-wip-us.apache.org/repos/asf/ambari/blob/20a224ce/contrib/views/hive20/src/main/resources/ui/app/templates/components/column-item.hbs -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/column-item.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/column-item.hbs index b649d5b..21418c1 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/templates/components/column-item.hbs +++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/column-item.hbs @@ -75,7 +75,7 @@ container-class="modal-dialog"}} - × + × {{fa-icon "cog" size="lg"}} Advance Column Options http://git-wip-us.apache.org/repos/asf/ambari/blob/20a224ce/contrib/views/hive20/src/main/resources/ui/app/templates/components/confirm-dialog.hbs -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/confirm-dialog.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/confirm-dialog.hbs index d940237..b62e98b 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/templates/components/confirm-dialog.hbs +++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/confirm-dialog.hbs @@ -24,7 +24,7 @@ {{#if closable}} -× +× {{/if}} {{#if titleIcon}}{{fa-icon titleIcon size="lg"}}{{/if}} {{title}} http://git-wip-us.apache.org/repos/asf/ambari/blob/20a224ce/contrib/views/hive20/src/main/resources/ui/app/templates/components/export-result.hbs -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/export-result.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/export-result.hbs index 0b462cb..69991f1 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/templates/components/export-result.hbs +++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/export-result.hbs @@ -23,7 +23,7 @@ container-class="modal-dialog"}} -× +× {{#if labelIcon}}{{fa-icon labelIcon size="lg"}}{{/if}} {{label}} http://git-wip-us.apache.org/repos/asf/ambari/blob/20a224ce/contrib/views/hive20/src/main/resources/ui/app/templates/components/hdfs-vi
ambari git commit: AMBARI-19935. Details of multi-condition Ranger Access policy are not visible in Hive View - Table Authorizations column. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk bc8066599 -> 2ce104231 AMBARI-19935. Details of multi-condition Ranger Access policy are not visible in Hive View - Table Authorizations column. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2ce10423 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2ce10423 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2ce10423 Branch: refs/heads/trunk Commit: 2ce10423190f999b794140a270601a62dc6b7f95 Parents: bc80665 Author: Dipayan Bhowmick Authored: Fri Feb 10 14:59:33 2017 +0530 Committer: Dipayan Bhowmick Committed: Fri Feb 10 15:00:03 2017 +0530 -- .../resources/system/ranger/RangerService.java | 32 ++- .../databases/database/tables/table/auth.hbs| 41 2 files changed, 47 insertions(+), 26 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/2ce10423/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java index 9debe42..d300d9a 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java @@ -137,8 +137,9 @@ public class RangerService { JSONArray policyItems = (JSONArray) policyJson.get("policyItems"); Policy policy = new Policy(name); -if (policyItems.size() > 0) { - JSONObject policyItem = (JSONObject) policyItems.get(0); +for(Object item: policyItems) { + PolicyCondition condition = new PolicyCondition(); + JSONObject policyItem = (JSONObject) item; JSONArray usersJson = (JSONArray) policyItem.get("users"); JSONArray groupsJson = (JSONArray) policyItem.get("groups"); JSONArray accesses = (JSONArray) policyItem.get("accesses"); @@ -148,19 +149,20 @@ public class RangerService { JSONObject access = (JSONObject) accessJson; Boolean isAllowed = (Boolean) access.get("isAllowed"); if (isAllowed) { - policy.addAccess((String) access.get("type")); + condition.addAccess((String) access.get("type")); } } for (Object user : usersJson) { -policy.addUser((String) user); +condition.addUser((String) user); } for (Object group : groupsJson) { -policy.addGroup((String) group); +condition.addGroup((String) group); } -} + policy.addCondition(condition); +} return policy; } @@ -266,9 +268,7 @@ public class RangerService { */ public static class Policy { private String name; -private List users = new ArrayList<>(); -private List groups = new ArrayList<>(); -private List accesses = new ArrayList<>(); +private List conditions = new ArrayList<>(); public Policy(String name) { this.name = name; @@ -282,6 +282,20 @@ public class RangerService { this.name = name; } +public List getConditions() { + return conditions; +} + +public void addCondition(PolicyCondition condition) { + this.conditions.add(condition); +} + } + + public static class PolicyCondition { +private List users = new ArrayList<>(); +private List groups = new ArrayList<>(); +private List accesses = new ArrayList<>(); + public List getUsers() { return users; } http://git-wip-us.apache.org/repos/asf/ambari/blob/2ce10423/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table/auth.hbs -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table/auth.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table/auth.hbs index 416f12f..e00eeb8 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table/auth.hbs +++ b/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table/auth.hbs @@ -25,7 +25,7 @@ - POLICY NAME + USERS GROUPS ACCESS @@ -34,23 +34,30 @@ {{#each model.policies as |policy|}} -{{policy.name}} - - {{#each policy.users as |user|}} -{{user}} - {{/each}} - - - {{#each policy.groups as |group|}}
ambari git commit: AMBARI-19935. Details of multi-condition Ranger Access policy are not visible in Hive View - Table Authorizations column. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 711a92dfa -> 13e30b393 AMBARI-19935. Details of multi-condition Ranger Access policy are not visible in Hive View - Table Authorizations column. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/13e30b39 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/13e30b39 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/13e30b39 Branch: refs/heads/branch-2.5 Commit: 13e30b393ffefa0bf40422f22498649f0e3bc418 Parents: 711a92d Author: Dipayan Bhowmick Authored: Fri Feb 10 14:59:33 2017 +0530 Committer: Dipayan Bhowmick Committed: Fri Feb 10 14:59:33 2017 +0530 -- .../resources/system/ranger/RangerService.java | 32 ++- .../databases/database/tables/table/auth.hbs| 41 2 files changed, 47 insertions(+), 26 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/13e30b39/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java index 9debe42..d300d9a 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java @@ -137,8 +137,9 @@ public class RangerService { JSONArray policyItems = (JSONArray) policyJson.get("policyItems"); Policy policy = new Policy(name); -if (policyItems.size() > 0) { - JSONObject policyItem = (JSONObject) policyItems.get(0); +for(Object item: policyItems) { + PolicyCondition condition = new PolicyCondition(); + JSONObject policyItem = (JSONObject) item; JSONArray usersJson = (JSONArray) policyItem.get("users"); JSONArray groupsJson = (JSONArray) policyItem.get("groups"); JSONArray accesses = (JSONArray) policyItem.get("accesses"); @@ -148,19 +149,20 @@ public class RangerService { JSONObject access = (JSONObject) accessJson; Boolean isAllowed = (Boolean) access.get("isAllowed"); if (isAllowed) { - policy.addAccess((String) access.get("type")); + condition.addAccess((String) access.get("type")); } } for (Object user : usersJson) { -policy.addUser((String) user); +condition.addUser((String) user); } for (Object group : groupsJson) { -policy.addGroup((String) group); +condition.addGroup((String) group); } -} + policy.addCondition(condition); +} return policy; } @@ -266,9 +268,7 @@ public class RangerService { */ public static class Policy { private String name; -private List users = new ArrayList<>(); -private List groups = new ArrayList<>(); -private List accesses = new ArrayList<>(); +private List conditions = new ArrayList<>(); public Policy(String name) { this.name = name; @@ -282,6 +282,20 @@ public class RangerService { this.name = name; } +public List getConditions() { + return conditions; +} + +public void addCondition(PolicyCondition condition) { + this.conditions.add(condition); +} + } + + public static class PolicyCondition { +private List users = new ArrayList<>(); +private List groups = new ArrayList<>(); +private List accesses = new ArrayList<>(); + public List getUsers() { return users; } http://git-wip-us.apache.org/repos/asf/ambari/blob/13e30b39/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table/auth.hbs -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table/auth.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table/auth.hbs index 416f12f..e00eeb8 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table/auth.hbs +++ b/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table/auth.hbs @@ -25,7 +25,7 @@ - POLICY NAME + USERS GROUPS ACCESS @@ -34,23 +34,30 @@ {{#each model.policies as |policy|}} -{{policy.name}} - - {{#each policy.users as |user|}} -{{user}} - {{/each}} - - - {{#each policy.groups as
ambari git commit: AMBARI-19916. HiveView2.0: No option to search for jobs in the jobs tab. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk e6dcc0920 -> 9c07b8b54 AMBARI-19916. HiveView2.0: No option to search for jobs in the jobs tab. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9c07b8b5 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9c07b8b5 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9c07b8b5 Branch: refs/heads/trunk Commit: 9c07b8b54c52d332d3f0268e9cbf920e959af208 Parents: e6dcc09 Author: Dipayan Bhowmick Authored: Thu Feb 9 15:54:11 2017 +0530 Committer: Dipayan Bhowmick Committed: Thu Feb 9 15:54:38 2017 +0530 -- .../resources/ui/app/components/jobs-browser.js | 39 ++-- .../src/main/resources/ui/app/styles/app.scss | 2 +- .../app/templates/components/jobs-browser.hbs | 17 +++-- 3 files changed, 49 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/9c07b8b5/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js b/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js index b0a82b0..7179d45 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js @@ -22,15 +22,33 @@ export default Ember.Component.extend({ startTime: null, endTime: null, maxEndTime: null, - statusCounts: Ember.computed('jobs', function() { -return this.get('jobs').reduce((acc, item, index) => { + statusFilter: null, + titleFilter: null, + + titleFilteredJobs: Ember.computed('jobs', 'titleFilter', function() { +if (!Ember.isEmpty(this.get('titleFilter'))) { + return (this.get('jobs').filter((entry) => entry.get('title').toLowerCase().indexOf(this.get('titleFilter').toLowerCase()) >= 0)); +} else { + return this.get('jobs'); +} + }), + + filteredJobs: Ember.computed('titleFilteredJobs', 'statusFilter', function () { +if (this.get('statusFilter')) { + return this.get('titleFilteredJobs').filter((entry) => entry.get('status').toLowerCase() === this.get('statusFilter')); +} else { + return this.get('titleFilteredJobs'); +} + }), + + statusCounts: Ember.computed('titleFilteredJobs', function () { +return this.get('titleFilteredJobs').reduce((acc, item, index) => { let status = item.get('status').toLowerCase(); - if(Ember.isEmpty(acc[status])) { + if (Ember.isEmpty(acc[status])) { acc[status] = 1; } else { acc[status] = acc[status] + 1; } - return acc; }, {}); }), @@ -39,6 +57,19 @@ export default Ember.Component.extend({ actions: { setDateRange(startDate, endDate) { this.sendAction('filterChanged', startDate, endDate); +}, + +selectJobForStatus(status) { + let s = status.toLowerCase(); + if (s === 'all') { +this.set('statusFilter'); + } else { +this.set('statusFilter', s); + } +}, + +clearTitleFilter() { + this.set('titleFilter'); } } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/9c07b8b5/contrib/views/hive20/src/main/resources/ui/app/styles/app.scss -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/styles/app.scss b/contrib/views/hive20/src/main/resources/ui/app/styles/app.scss index 4f73ef8..0dae396 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/styles/app.scss +++ b/contrib/views/hive20/src/main/resources/ui/app/styles/app.scss @@ -787,7 +787,7 @@ pre { border-top: 1px solid darken($body-bg, 10%); border-bottom: 1px solid darken($body-bg, 10%); .strip { -margin-top: 25px; +margin-top: 20px; } } http://git-wip-us.apache.org/repos/asf/ambari/blob/9c07b8b5/contrib/views/hive20/src/main/resources/ui/app/templates/components/jobs-browser.hbs -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/jobs-browser.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/jobs-browser.hbs index abb4a97..014691e 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/templates/components/jobs-browser.hbs +++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/jobs-browser.hbs @@ -18,15 +18,24 @@ - + - + + {{titleFilteredJobs.length}} All {{#each-in statusCounts as |status count|}} -{{count}} {{status}} +{{count}} {{status}} {{/each-in}}
ambari git commit: AMBARI-19916. HiveView2.0: No option to search for jobs in the jobs tab. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 38cf7a63d -> a512b3e67 AMBARI-19916. HiveView2.0: No option to search for jobs in the jobs tab. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a512b3e6 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a512b3e6 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a512b3e6 Branch: refs/heads/branch-2.5 Commit: a512b3e67f6023166471dd6b05e9fb2e5c497454 Parents: 38cf7a6 Author: Dipayan Bhowmick Authored: Thu Feb 9 15:54:11 2017 +0530 Committer: Dipayan Bhowmick Committed: Thu Feb 9 15:54:11 2017 +0530 -- .../resources/ui/app/components/jobs-browser.js | 39 ++-- .../src/main/resources/ui/app/styles/app.scss | 2 +- .../app/templates/components/jobs-browser.hbs | 17 +++-- 3 files changed, 49 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/a512b3e6/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js b/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js index b0a82b0..7179d45 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js @@ -22,15 +22,33 @@ export default Ember.Component.extend({ startTime: null, endTime: null, maxEndTime: null, - statusCounts: Ember.computed('jobs', function() { -return this.get('jobs').reduce((acc, item, index) => { + statusFilter: null, + titleFilter: null, + + titleFilteredJobs: Ember.computed('jobs', 'titleFilter', function() { +if (!Ember.isEmpty(this.get('titleFilter'))) { + return (this.get('jobs').filter((entry) => entry.get('title').toLowerCase().indexOf(this.get('titleFilter').toLowerCase()) >= 0)); +} else { + return this.get('jobs'); +} + }), + + filteredJobs: Ember.computed('titleFilteredJobs', 'statusFilter', function () { +if (this.get('statusFilter')) { + return this.get('titleFilteredJobs').filter((entry) => entry.get('status').toLowerCase() === this.get('statusFilter')); +} else { + return this.get('titleFilteredJobs'); +} + }), + + statusCounts: Ember.computed('titleFilteredJobs', function () { +return this.get('titleFilteredJobs').reduce((acc, item, index) => { let status = item.get('status').toLowerCase(); - if(Ember.isEmpty(acc[status])) { + if (Ember.isEmpty(acc[status])) { acc[status] = 1; } else { acc[status] = acc[status] + 1; } - return acc; }, {}); }), @@ -39,6 +57,19 @@ export default Ember.Component.extend({ actions: { setDateRange(startDate, endDate) { this.sendAction('filterChanged', startDate, endDate); +}, + +selectJobForStatus(status) { + let s = status.toLowerCase(); + if (s === 'all') { +this.set('statusFilter'); + } else { +this.set('statusFilter', s); + } +}, + +clearTitleFilter() { + this.set('titleFilter'); } } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/a512b3e6/contrib/views/hive20/src/main/resources/ui/app/styles/app.scss -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/styles/app.scss b/contrib/views/hive20/src/main/resources/ui/app/styles/app.scss index 4f73ef8..0dae396 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/styles/app.scss +++ b/contrib/views/hive20/src/main/resources/ui/app/styles/app.scss @@ -787,7 +787,7 @@ pre { border-top: 1px solid darken($body-bg, 10%); border-bottom: 1px solid darken($body-bg, 10%); .strip { -margin-top: 25px; +margin-top: 20px; } } http://git-wip-us.apache.org/repos/asf/ambari/blob/a512b3e6/contrib/views/hive20/src/main/resources/ui/app/templates/components/jobs-browser.hbs -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/jobs-browser.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/jobs-browser.hbs index abb4a97..014691e 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/templates/components/jobs-browser.hbs +++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/jobs-browser.hbs @@ -18,15 +18,24 @@ - + - + + {{titleFilteredJobs.length}} All {{#each-in statusCounts as |status count|}} -{{count}} {{status}} +{{count}} {{status}} {{/each-in}}
ambari git commit: AMBARI-19914. Hive View 2.0: Go to Table manager and click on statistics, the panel does not come up. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk 170497e92 -> e6dcc0920 AMBARI-19914. Hive View 2.0: Go to Table manager and click on statistics, the panel does not come up. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e6dcc092 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e6dcc092 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e6dcc092 Branch: refs/heads/trunk Commit: e6dcc0920b053f6b294323575f2c28982af4e943 Parents: 170497e Author: Dipayan Bhowmick Authored: Thu Feb 9 15:43:14 2017 +0530 Committer: Dipayan Bhowmick Committed: Thu Feb 9 15:44:01 2017 +0530 -- .../src/main/resources/ui/app/components/table-statistics.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/e6dcc092/contrib/views/hive20/src/main/resources/ui/app/components/table-statistics.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/table-statistics.js b/contrib/views/hive20/src/main/resources/ui/app/components/table-statistics.js index d53a41f..1623e0e 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/table-statistics.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/table-statistics.js @@ -28,7 +28,7 @@ export default Ember.Component.extend({ columnStatsAccurate: Ember.computed('table.tableStats.columnStatsAccurate', function () { let columnStatsJson = this.get('table.tableStats.columnStatsAccurate'); -return JSON.parse(columnStatsJson.replace(/\\\"/g, '"')); +return Ember.isEmpty(columnStatsJson) ? {} : JSON.parse(columnStatsJson.replace(/\\\"/g, '"')); }), columnsWithStatistics: Ember.computed('columnStatsAccurate', function () {
ambari git commit: AMBARI-19914. Hive View 2.0: Go to Table manager and click on statistics, the panel does not come up. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 a2c5addcf -> 38cf7a63d AMBARI-19914. Hive View 2.0: Go to Table manager and click on statistics, the panel does not come up. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/38cf7a63 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/38cf7a63 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/38cf7a63 Branch: refs/heads/branch-2.5 Commit: 38cf7a63dfd1e5b0f9f538ce114d8cc4b50f1acb Parents: a2c5add Author: Dipayan Bhowmick Authored: Thu Feb 9 15:43:14 2017 +0530 Committer: Dipayan Bhowmick Committed: Thu Feb 9 15:43:14 2017 +0530 -- .../src/main/resources/ui/app/components/table-statistics.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/38cf7a63/contrib/views/hive20/src/main/resources/ui/app/components/table-statistics.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/table-statistics.js b/contrib/views/hive20/src/main/resources/ui/app/components/table-statistics.js index d53a41f..1623e0e 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/table-statistics.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/table-statistics.js @@ -28,7 +28,7 @@ export default Ember.Component.extend({ columnStatsAccurate: Ember.computed('table.tableStats.columnStatsAccurate', function () { let columnStatsJson = this.get('table.tableStats.columnStatsAccurate'); -return JSON.parse(columnStatsJson.replace(/\\\"/g, '"')); +return Ember.isEmpty(columnStatsJson) ? {} : JSON.parse(columnStatsJson.replace(/\\\"/g, '"')); }), columnsWithStatistics: Ember.computed('columnStatsAccurate', function () {
ambari git commit: AMBARI-19898. Hive View 2.0: Ability to edit table through UI. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk f2329600c -> e3eda328d AMBARI-19898. Hive View 2.0: Ability to edit table through UI. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e3eda328 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e3eda328 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e3eda328 Branch: refs/heads/trunk Commit: e3eda328d42adcc69610bdb767cf1a66f944e1f2 Parents: f232960 Author: Dipayan Bhowmick Authored: Wed Feb 8 21:05:23 2017 +0530 Committer: Dipayan Bhowmick Committed: Wed Feb 8 21:05:59 2017 +0530 -- .../view/hive20/internal/dto/ColumnInfo.java| 28 +- .../view/hive20/internal/dto/TableStats.java| 11 + .../internal/parsers/TableMetaParserImpl.java | 8 + .../generators/AlterTableQueryGenerator.java| 82 +++--- .../query/generators/QueryGenerationUtils.java | 5 +- .../view/hive20/resources/browser/DDLProxy.java | 2 +- .../src/main/resources/ui/app/adapters/table.js | 6 + .../resources/ui/app/components/column-item.js | 1 + .../resources/ui/app/components/edit-table.js | 220 ++ .../ui/app/components/property-item.js | 1 + .../app/components/table-advanced-settings.js | 5 + .../ui/app/components/table-columns.js | 3 +- .../ui/app/components/table-properties.js | 3 +- .../resources/ui/app/configs/edit-table-tabs.js | 48 +++ .../hive20/src/main/resources/ui/app/router.js | 1 + .../databases/database/tables/table/edit.js | 86 ++ .../ui/app/services/table-operations.js | 24 ++ .../src/main/resources/ui/app/styles/app.scss | 3 + .../ui/app/templates/components/column-item.hbs | 13 +- .../ui/app/templates/components/edit-table.hbs | 65 .../app/templates/components/property-item.hbs | 10 +- .../components/table-advanced-settings.hbs | 295 ++- .../app/templates/components/table-columns.hbs | 1 + .../templates/components/table-properties.hbs | 1 + .../templates/components/table-statistics.hbs | 4 + .../databases/database/tables/table.hbs | 2 +- .../databases/database/tables/table/edit.hbs| 45 +++ .../AlterTableQueryGenerationSpecTest.groovy| 59 .../AlterTableQueryGeneratorTest.java | 161 +- 29 files changed, 911 insertions(+), 282 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/e3eda328/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/dto/ColumnInfo.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/dto/ColumnInfo.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/dto/ColumnInfo.java index 5daab91..9f179d1 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/dto/ColumnInfo.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/dto/ColumnInfo.java @@ -20,6 +20,8 @@ package org.apache.ambari.view.hive20.internal.dto; import org.apache.commons.lang3.builder.EqualsBuilder; +import java.util.Objects; + /** * */ @@ -82,28 +84,20 @@ public class ColumnInfo { } @Override - public int hashCode() { -int result = name.hashCode(); -result = 31 * result + type.hashCode(); -result = 31 * result + (precision != null ? precision.hashCode() : 0); -result = 31 * result + (scale != null ? scale.hashCode() : 0); -result = 31 * result + (comment != null ? comment.hashCode() : 0); -return result; - } - - @Override public boolean equals(Object o) { if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - ColumnInfo that = (ColumnInfo) o; +return ((name == that.name) || (name != null && name.equalsIgnoreCase(that.name))) && +((type == that.type) || (type != null && type.equalsIgnoreCase(that.type))) && +Objects.equals(precision, that.precision) && +Objects.equals(scale, that.scale) && +Objects.equals(comment, that.comment); + } -return new EqualsBuilder() -.append(getName(), that.getName()) -.append(getType(), that.getType()) -.append(getComment(), that.getComment()) -.isEquals(); + @Override + public int hashCode() { +return Objects.hash(name); } @Override http://git-wip-us.apache.org/repos/asf/ambari/blob/e3eda328/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/dto/TableStats.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/dto/TableStats.java b/contrib/views/hive20/src/main/
ambari git commit: AMBARI-19898. Hive View 2.0: Ability to edit table through UI. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 90d1ff1ad -> 151d2f167 AMBARI-19898. Hive View 2.0: Ability to edit table through UI. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/151d2f16 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/151d2f16 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/151d2f16 Branch: refs/heads/branch-2.5 Commit: 151d2f1671c42db3e77c0305b29f6b1a5672f7a9 Parents: 90d1ff1 Author: Dipayan Bhowmick Authored: Wed Feb 8 21:05:23 2017 +0530 Committer: Dipayan Bhowmick Committed: Wed Feb 8 21:05:23 2017 +0530 -- .../view/hive20/internal/dto/ColumnInfo.java| 28 +- .../view/hive20/internal/dto/TableStats.java| 11 + .../internal/parsers/TableMetaParserImpl.java | 8 + .../generators/AlterTableQueryGenerator.java| 82 +++--- .../query/generators/QueryGenerationUtils.java | 5 +- .../view/hive20/resources/browser/DDLProxy.java | 2 +- .../src/main/resources/ui/app/adapters/table.js | 6 + .../resources/ui/app/components/column-item.js | 1 + .../resources/ui/app/components/edit-table.js | 220 ++ .../ui/app/components/property-item.js | 1 + .../app/components/table-advanced-settings.js | 5 + .../ui/app/components/table-columns.js | 3 +- .../ui/app/components/table-properties.js | 3 +- .../resources/ui/app/configs/edit-table-tabs.js | 48 +++ .../hive20/src/main/resources/ui/app/router.js | 1 + .../databases/database/tables/table/edit.js | 86 ++ .../ui/app/services/table-operations.js | 24 ++ .../src/main/resources/ui/app/styles/app.scss | 3 + .../ui/app/templates/components/column-item.hbs | 13 +- .../ui/app/templates/components/edit-table.hbs | 65 .../app/templates/components/property-item.hbs | 10 +- .../components/table-advanced-settings.hbs | 295 ++- .../app/templates/components/table-columns.hbs | 1 + .../templates/components/table-properties.hbs | 1 + .../templates/components/table-statistics.hbs | 4 + .../databases/database/tables/table.hbs | 2 +- .../databases/database/tables/table/edit.hbs| 45 +++ .../AlterTableQueryGenerationSpecTest.groovy| 59 .../AlterTableQueryGeneratorTest.java | 161 +- 29 files changed, 911 insertions(+), 282 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/151d2f16/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/dto/ColumnInfo.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/dto/ColumnInfo.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/dto/ColumnInfo.java index 5daab91..9f179d1 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/dto/ColumnInfo.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/dto/ColumnInfo.java @@ -20,6 +20,8 @@ package org.apache.ambari.view.hive20.internal.dto; import org.apache.commons.lang3.builder.EqualsBuilder; +import java.util.Objects; + /** * */ @@ -82,28 +84,20 @@ public class ColumnInfo { } @Override - public int hashCode() { -int result = name.hashCode(); -result = 31 * result + type.hashCode(); -result = 31 * result + (precision != null ? precision.hashCode() : 0); -result = 31 * result + (scale != null ? scale.hashCode() : 0); -result = 31 * result + (comment != null ? comment.hashCode() : 0); -return result; - } - - @Override public boolean equals(Object o) { if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - ColumnInfo that = (ColumnInfo) o; +return ((name == that.name) || (name != null && name.equalsIgnoreCase(that.name))) && +((type == that.type) || (type != null && type.equalsIgnoreCase(that.type))) && +Objects.equals(precision, that.precision) && +Objects.equals(scale, that.scale) && +Objects.equals(comment, that.comment); + } -return new EqualsBuilder() -.append(getName(), that.getName()) -.append(getType(), that.getType()) -.append(getComment(), that.getComment()) -.isEquals(); + @Override + public int hashCode() { +return Objects.hash(name); } @Override http://git-wip-us.apache.org/repos/asf/ambari/blob/151d2f16/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/dto/TableStats.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/dto/TableStats.java b/contrib/views/hive20
ambari git commit: AMBARI-19844. Hive View 2.0: Allow user to rename table.(dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk 515c083e0 -> e113777b9 AMBARI-19844. Hive View 2.0: Allow user to rename table.(dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e113777b Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e113777b Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e113777b Branch: refs/heads/trunk Commit: e113777b9eb7cdd029ebc32fe520d8442e7a8e45 Parents: 515c083 Author: Dipayan Bhowmick Authored: Mon Feb 6 11:43:04 2017 +0530 Committer: Dipayan Bhowmick Committed: Mon Feb 6 11:43:33 2017 +0530 -- .../hive20/resources/browser/DDLService.java| 20 +++-- .../resources/ui/app/adapters/application.js| 33 .../src/main/resources/ui/app/adapters/table.js | 9 +++ .../ui/app/components/table-rename-form.js | 63 +++ .../resources/ui/app/controllers/application.js | 5 +- .../hive20/src/main/resources/ui/app/router.js | 1 + .../main/resources/ui/app/routes/application.js | 3 +- .../databases/database/tables/table/rename.js | 83 .../ui/app/services/table-operations.js | 11 +++ .../templates/components/table-rename-form.hbs | 31 .../databases/database/tables/table.hbs | 1 + .../databases/database/tables/table/rename.hbs | 46 +++ .../src/main/resources/ui/config/environment.js | 6 ++ 13 files changed, 290 insertions(+), 22 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/e113777b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLService.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLService.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLService.java index af8e1cd..89b9d84 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLService.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLService.java @@ -158,18 +158,17 @@ public class DDLService extends BaseService { @PUT @Path("databases/{database_id}/tables/{table_id}/rename") @Produces(MediaType.APPLICATION_JSON) - @Consumes(MediaType.APPLICATION_FORM_URLENCODED) + @Consumes(MediaType.APPLICATION_JSON) public Response renameTable(@PathParam("database_id") String oldDatabaseName, @PathParam("table_id") String oldTableName, - @FormParam("new_database_id") String newDatabaseName, @FormParam("new_table_id") - String newTableName) { + TableRenameRequest request) { try { - Job job = proxy.renameTable(oldDatabaseName, oldTableName, newDatabaseName, newTableName, getResourceManager()); + Job job = proxy.renameTable(oldDatabaseName, oldTableName, request.newDatabase, request.newTable, getResourceManager()); JSONObject response = new JSONObject(); response.put("job", job); return Response.status(Response.Status.ACCEPTED).entity(response).build(); } catch (ServiceException e) { LOG.error("Exception occurred while renaming table for oldDatabaseName {}, oldTableName: {}, newDatabaseName : {}," + -" newTableName : {}", oldDatabaseName, oldTableName, newDatabaseName, newTableName, e); +" newTableName : {}", oldDatabaseName, oldTableName, request.newDatabase, request.newTable, e); throw new ServiceFormattedException(e); } } @@ -346,4 +345,15 @@ public class DDLService extends BaseService { public static class CreateDatabaseRequest { public String name; } + + /** + * Wrapper class for table rename request + */ + public static class TableRenameRequest { +/* New database name */ +public String newDatabase; + +/* New table name */ +public String newTable; + } } http://git-wip-us.apache.org/repos/asf/ambari/blob/e113777b/contrib/views/hive20/src/main/resources/ui/app/adapters/application.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/adapters/application.js b/contrib/views/hive20/src/main/resources/ui/app/adapters/application.js index 1cdab9e..9cc8658 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/adapters/application.js +++ b/contrib/views/hive20/src/main/resources/ui/app/adapters/application.js @@ -21,14 +21,14 @@ import DS from 'ember-data'; import ENV from 'ui/config/environment'; export default DS.RESTAdapter.extend({ - init: function() { + init: function () { Ember.$.ajaxSetup({ cache: false }); }, - namespace: Ember.computed(function
ambari git commit: AMBARI-19844. Hive View 2.0: Allow user to rename table.(dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 b5f29c9d3 -> 5a9f3817e AMBARI-19844. Hive View 2.0: Allow user to rename table.(dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/5a9f3817 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/5a9f3817 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/5a9f3817 Branch: refs/heads/branch-2.5 Commit: 5a9f3817eef2a163d24dee8c20598136f6dd5e1f Parents: b5f29c9 Author: Dipayan Bhowmick Authored: Mon Feb 6 11:43:04 2017 +0530 Committer: Dipayan Bhowmick Committed: Mon Feb 6 11:43:04 2017 +0530 -- .../hive20/resources/browser/DDLService.java| 20 +++-- .../resources/ui/app/adapters/application.js| 33 .../src/main/resources/ui/app/adapters/table.js | 9 +++ .../ui/app/components/table-rename-form.js | 63 +++ .../resources/ui/app/controllers/application.js | 5 +- .../hive20/src/main/resources/ui/app/router.js | 1 + .../main/resources/ui/app/routes/application.js | 3 +- .../databases/database/tables/table/rename.js | 83 .../ui/app/services/table-operations.js | 11 +++ .../templates/components/table-rename-form.hbs | 31 .../databases/database/tables/table.hbs | 1 + .../databases/database/tables/table/rename.hbs | 46 +++ .../src/main/resources/ui/config/environment.js | 6 ++ 13 files changed, 290 insertions(+), 22 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/5a9f3817/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLService.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLService.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLService.java index af8e1cd..89b9d84 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLService.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLService.java @@ -158,18 +158,17 @@ public class DDLService extends BaseService { @PUT @Path("databases/{database_id}/tables/{table_id}/rename") @Produces(MediaType.APPLICATION_JSON) - @Consumes(MediaType.APPLICATION_FORM_URLENCODED) + @Consumes(MediaType.APPLICATION_JSON) public Response renameTable(@PathParam("database_id") String oldDatabaseName, @PathParam("table_id") String oldTableName, - @FormParam("new_database_id") String newDatabaseName, @FormParam("new_table_id") - String newTableName) { + TableRenameRequest request) { try { - Job job = proxy.renameTable(oldDatabaseName, oldTableName, newDatabaseName, newTableName, getResourceManager()); + Job job = proxy.renameTable(oldDatabaseName, oldTableName, request.newDatabase, request.newTable, getResourceManager()); JSONObject response = new JSONObject(); response.put("job", job); return Response.status(Response.Status.ACCEPTED).entity(response).build(); } catch (ServiceException e) { LOG.error("Exception occurred while renaming table for oldDatabaseName {}, oldTableName: {}, newDatabaseName : {}," + -" newTableName : {}", oldDatabaseName, oldTableName, newDatabaseName, newTableName, e); +" newTableName : {}", oldDatabaseName, oldTableName, request.newDatabase, request.newTable, e); throw new ServiceFormattedException(e); } } @@ -346,4 +345,15 @@ public class DDLService extends BaseService { public static class CreateDatabaseRequest { public String name; } + + /** + * Wrapper class for table rename request + */ + public static class TableRenameRequest { +/* New database name */ +public String newDatabase; + +/* New table name */ +public String newTable; + } } http://git-wip-us.apache.org/repos/asf/ambari/blob/5a9f3817/contrib/views/hive20/src/main/resources/ui/app/adapters/application.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/adapters/application.js b/contrib/views/hive20/src/main/resources/ui/app/adapters/application.js index 1cdab9e..9cc8658 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/adapters/application.js +++ b/contrib/views/hive20/src/main/resources/ui/app/adapters/application.js @@ -21,14 +21,14 @@ import DS from 'ember-data'; import ENV from 'ui/config/environment'; export default DS.RESTAdapter.extend({ - init: function() { + init: function () { Ember.$.ajaxSetup({ cache: false }); }, - namespace: Ember.compute
ambari git commit: AMBARI-19848. Hive View 2.0: Allow user to create database. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk e4bac844b -> 515c083e0 AMBARI-19848. Hive View 2.0: Allow user to create database. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/515c083e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/515c083e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/515c083e Branch: refs/heads/trunk Commit: 515c083e0536d84ef19b5a98d5087f8be1c5f809 Parents: e4bac84 Author: Dipayan Bhowmick Authored: Mon Feb 6 11:24:12 2017 +0530 Committer: Dipayan Bhowmick Committed: Mon Feb 6 11:24:55 2017 +0530 -- .../CreateDatabaseQueryGenerator.java | 44 + .../DeleteDatabaseQueryGenerator.java | 2 +- .../view/hive20/resources/browser/DDLProxy.java | 12 .../hive20/resources/browser/DDLService.java| 31 + .../main/resources/ui/app/adapters/database.js | 8 +++ .../ui/app/components/create-database-form.js | 59 + .../hive20/src/main/resources/ui/app/router.js | 1 + .../main/resources/ui/app/routes/databases.js | 4 -- .../databases/database/tables/new-database.js | 68 .../ui/app/services/table-operations.js | 11 .../components/create-database-form.hbs | 31 + .../resources/ui/app/templates/databases.hbs| 2 +- .../databases/database/tables/new-database.hbs | 47 ++ 13 files changed, 314 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/515c083e/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/CreateDatabaseQueryGenerator.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/CreateDatabaseQueryGenerator.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/CreateDatabaseQueryGenerator.java new file mode 100644 index 000..c72df03 --- /dev/null +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/CreateDatabaseQueryGenerator.java @@ -0,0 +1,44 @@ +/** +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package org.apache.ambari.view.hive20.internal.query.generators; + +import org.apache.ambari.view.hive20.exceptions.ServiceException; +import org.apache.commons.lang3.StringUtils; +import com.google.common.base.Optional; + +public class CreateDatabaseQueryGenerator implements QueryGenerator { + public final String databaseName; + + public CreateDatabaseQueryGenerator(String databaseName) { +this.databaseName = databaseName; + } + + public String getDatabaseName() { +return databaseName; + } + + @Override + public Optional getQuery() throws ServiceException { +if(StringUtils.isEmpty(this.getDatabaseName())){ + throw new ServiceException("Database name cannot be null or empty."); +} + +return Optional.of("CREATE DATABASE `" + this.getDatabaseName() + "`"); + } +} http://git-wip-us.apache.org/repos/asf/ambari/blob/515c083e/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/DeleteDatabaseQueryGenerator.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/DeleteDatabaseQueryGenerator.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/DeleteDatabaseQueryGenerator.java index 6e1e1a5..189cd5e 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/DeleteDatabaseQueryGenerator.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/DeleteDatabaseQueryGenerator.java @@ -1,4 +1,4 @@ -/* +/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this
ambari git commit: AMBARI-19848. Hive View 2.0: Allow user to create database. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 e8cef81e4 -> b5f29c9d3 AMBARI-19848. Hive View 2.0: Allow user to create database. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b5f29c9d Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b5f29c9d Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b5f29c9d Branch: refs/heads/branch-2.5 Commit: b5f29c9d322ca5b3c6d3d177ff2a916e5418243b Parents: e8cef81 Author: Dipayan Bhowmick Authored: Mon Feb 6 11:24:12 2017 +0530 Committer: Dipayan Bhowmick Committed: Mon Feb 6 11:24:12 2017 +0530 -- .../CreateDatabaseQueryGenerator.java | 44 + .../DeleteDatabaseQueryGenerator.java | 2 +- .../view/hive20/resources/browser/DDLProxy.java | 12 .../hive20/resources/browser/DDLService.java| 31 + .../main/resources/ui/app/adapters/database.js | 8 +++ .../ui/app/components/create-database-form.js | 59 + .../hive20/src/main/resources/ui/app/router.js | 1 + .../main/resources/ui/app/routes/databases.js | 4 -- .../databases/database/tables/new-database.js | 68 .../ui/app/services/table-operations.js | 11 .../components/create-database-form.hbs | 31 + .../resources/ui/app/templates/databases.hbs| 2 +- .../databases/database/tables/new-database.hbs | 47 ++ 13 files changed, 314 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/b5f29c9d/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/CreateDatabaseQueryGenerator.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/CreateDatabaseQueryGenerator.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/CreateDatabaseQueryGenerator.java new file mode 100644 index 000..c72df03 --- /dev/null +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/CreateDatabaseQueryGenerator.java @@ -0,0 +1,44 @@ +/** +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package org.apache.ambari.view.hive20.internal.query.generators; + +import org.apache.ambari.view.hive20.exceptions.ServiceException; +import org.apache.commons.lang3.StringUtils; +import com.google.common.base.Optional; + +public class CreateDatabaseQueryGenerator implements QueryGenerator { + public final String databaseName; + + public CreateDatabaseQueryGenerator(String databaseName) { +this.databaseName = databaseName; + } + + public String getDatabaseName() { +return databaseName; + } + + @Override + public Optional getQuery() throws ServiceException { +if(StringUtils.isEmpty(this.getDatabaseName())){ + throw new ServiceException("Database name cannot be null or empty."); +} + +return Optional.of("CREATE DATABASE `" + this.getDatabaseName() + "`"); + } +} http://git-wip-us.apache.org/repos/asf/ambari/blob/b5f29c9d/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/DeleteDatabaseQueryGenerator.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/DeleteDatabaseQueryGenerator.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/DeleteDatabaseQueryGenerator.java index 6e1e1a5..189cd5e 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/DeleteDatabaseQueryGenerator.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/DeleteDatabaseQueryGenerator.java @@ -1,4 +1,4 @@ -/* +/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed
ambari git commit: AMBARI-19817. Hive View 2.0: Introduce service checks. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk 318f35225 -> d1f26f98f AMBARI-19817. Hive View 2.0: Introduce service checks. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d1f26f98 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d1f26f98 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d1f26f98 Branch: refs/heads/trunk Commit: d1f26f98f5faf1d45035922c585c0c7bcebf154a Parents: 318f352 Author: Dipayan Bhowmick Authored: Thu Feb 2 12:07:37 2017 +0530 Committer: Dipayan Bhowmick Committed: Thu Feb 2 12:08:25 2017 +0530 -- .../resources/ui/app/adapters/application.js| 16 +++ .../resources/ui/app/adapters/service-check.js | 42 +++ .../ui/app/components/service-check-entry.js| 50 .../ui/app/components/top-application-bar.js| 1 + .../ui/app/configs/service-check-status.js | 19 +++ .../resources/ui/app/controllers/application.js | 25 .../ui/app/controllers/service-check.js | 66 +++ .../hive20/src/main/resources/ui/app/router.js | 2 + .../main/resources/ui/app/routes/application.js | 9 ++ .../resources/ui/app/routes/service-check.js| 28 + .../resources/ui/app/services/service-check.js | 117 +++ .../resources/ui/app/templates/application.hbs | 13 ++- .../components/service-check-entry.hbs | 47 .../components/top-application-bar.hbs | 12 +- .../ui/app/templates/service-check.hbs | 42 +++ 15 files changed, 480 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/d1f26f98/contrib/views/hive20/src/main/resources/ui/app/adapters/application.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/adapters/application.js b/contrib/views/hive20/src/main/resources/ui/app/adapters/application.js index c0189cc..1cdab9e 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/adapters/application.js +++ b/contrib/views/hive20/src/main/resources/ui/app/adapters/application.js @@ -57,7 +57,23 @@ export default DS.RESTAdapter.extend({ // basic authorization. This is for default admin/admin username/password combination. headers['Authorization'] = 'Basic YWRtaW46YWRtaW4='; //headers['Authorization'] = 'Basic aGl2ZTpoaXZl'; + //headers['Authorization'] = 'Basic ZGlwYXlhbjpkaXBheWFu'; } return headers; }), + + parseErrorResponse(responseText) { +let json = this._super(responseText); +let error = {}; +error.message = json.message; +error.trace = json.trace; +error.status = json.status; + +delete json.trace; +delete json.status; +delete json.message; + +json.errors = error; +return json; + } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/d1f26f98/contrib/views/hive20/src/main/resources/ui/app/adapters/service-check.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/adapters/service-check.js b/contrib/views/hive20/src/main/resources/ui/app/adapters/service-check.js new file mode 100644 index 000..22bf1b6 --- /dev/null +++ b/contrib/views/hive20/src/main/resources/ui/app/adapters/service-check.js @@ -0,0 +1,42 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import ApplicationAdapter from './application'; + +export default ApplicationAdapter.extend({ + + doHdfsSeriveCheck() { +let url = this.buildURL() + '/hive/hdfsStatus'; +return this.ajax(url, 'GET'); + }, + + doUserHomeCheck() { +let url = this.buildURL() + '/hive/userhomeStatus'; +return this.ajax(url, 'GET'); + }, + + doAtsCheck() { +let url = this.buildURL() + '/hive/atsStatus'; +return this.ajax(url, 'GET'); + }, + + doHiveCheck() { +let url = this.buildURL() + '/connection/connect'; +return this.ajax(url, 'GET'); + } +}); http://git-wip-us.apache.org/repos/asf/ambari/blob/d1f26f98/c
ambari git commit: AMBARI-19817. Hive View 2.0: Introduce service checks. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 3f41dbc80 -> d1c9c9174 AMBARI-19817. Hive View 2.0: Introduce service checks. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d1c9c917 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d1c9c917 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d1c9c917 Branch: refs/heads/branch-2.5 Commit: d1c9c9174a86958ddbc0eb4d89d39d43c3928d58 Parents: 3f41dbc Author: Dipayan Bhowmick Authored: Thu Feb 2 12:07:37 2017 +0530 Committer: Dipayan Bhowmick Committed: Thu Feb 2 12:07:37 2017 +0530 -- .../resources/ui/app/adapters/application.js| 16 +++ .../resources/ui/app/adapters/service-check.js | 42 +++ .../ui/app/components/service-check-entry.js| 50 .../ui/app/components/top-application-bar.js| 1 + .../ui/app/configs/service-check-status.js | 19 +++ .../resources/ui/app/controllers/application.js | 25 .../ui/app/controllers/service-check.js | 66 +++ .../hive20/src/main/resources/ui/app/router.js | 2 + .../main/resources/ui/app/routes/application.js | 9 ++ .../resources/ui/app/routes/service-check.js| 28 + .../resources/ui/app/services/service-check.js | 117 +++ .../resources/ui/app/templates/application.hbs | 13 ++- .../components/service-check-entry.hbs | 47 .../components/top-application-bar.hbs | 12 +- .../ui/app/templates/service-check.hbs | 42 +++ 15 files changed, 480 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/d1c9c917/contrib/views/hive20/src/main/resources/ui/app/adapters/application.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/adapters/application.js b/contrib/views/hive20/src/main/resources/ui/app/adapters/application.js index c0189cc..1cdab9e 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/adapters/application.js +++ b/contrib/views/hive20/src/main/resources/ui/app/adapters/application.js @@ -57,7 +57,23 @@ export default DS.RESTAdapter.extend({ // basic authorization. This is for default admin/admin username/password combination. headers['Authorization'] = 'Basic YWRtaW46YWRtaW4='; //headers['Authorization'] = 'Basic aGl2ZTpoaXZl'; + //headers['Authorization'] = 'Basic ZGlwYXlhbjpkaXBheWFu'; } return headers; }), + + parseErrorResponse(responseText) { +let json = this._super(responseText); +let error = {}; +error.message = json.message; +error.trace = json.trace; +error.status = json.status; + +delete json.trace; +delete json.status; +delete json.message; + +json.errors = error; +return json; + } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/d1c9c917/contrib/views/hive20/src/main/resources/ui/app/adapters/service-check.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/adapters/service-check.js b/contrib/views/hive20/src/main/resources/ui/app/adapters/service-check.js new file mode 100644 index 000..22bf1b6 --- /dev/null +++ b/contrib/views/hive20/src/main/resources/ui/app/adapters/service-check.js @@ -0,0 +1,42 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import ApplicationAdapter from './application'; + +export default ApplicationAdapter.extend({ + + doHdfsSeriveCheck() { +let url = this.buildURL() + '/hive/hdfsStatus'; +return this.ajax(url, 'GET'); + }, + + doUserHomeCheck() { +let url = this.buildURL() + '/hive/userhomeStatus'; +return this.ajax(url, 'GET'); + }, + + doAtsCheck() { +let url = this.buildURL() + '/hive/atsStatus'; +return this.ajax(url, 'GET'); + }, + + doHiveCheck() { +let url = this.buildURL() + '/connection/connect'; +return this.ajax(url, 'GET'); + } +}); http://git-wip-us.apache.org/repos/asf/ambari/blob/
ambari git commit: AMBARI-19792. Hive View 2.0: Jobs page shows 'Invalid date - Jan 24'. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 e29fa051c -> 3f41dbc80 AMBARI-19792. Hive View 2.0: Jobs page shows 'Invalid date - Jan 24'. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/3f41dbc8 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3f41dbc8 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3f41dbc8 Branch: refs/heads/branch-2.5 Commit: 3f41dbc80fcc1fe2a3620df8df5d1da58c5bb126 Parents: e29fa05 Author: Dipayan Bhowmick Authored: Thu Feb 2 12:05:14 2017 +0530 Committer: Dipayan Bhowmick Committed: Thu Feb 2 12:05:14 2017 +0530 -- .../hive20/src/main/resources/ui/app/app.js | 9 --- .../resources/ui/app/components/jobs-browser.js | 4 .../main/resources/ui/app/controllers/jobs.js | 7 +++--- .../src/main/resources/ui/app/routes/jobs.js| 25 .../app/templates/components/jobs-browser.hbs | 1 + .../src/main/resources/ui/config/environment.js | 2 -- 6 files changed, 20 insertions(+), 28 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/3f41dbc8/contrib/views/hive20/src/main/resources/ui/app/app.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/app.js b/contrib/views/hive20/src/main/resources/ui/app/app.js index 0f83ee5..af4fdc4 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/app.js +++ b/contrib/views/hive20/src/main/resources/ui/app/app.js @@ -26,15 +26,6 @@ let App; Ember.MODEL_FACTORY_INJECTIONS = true; App = Ember.Application.extend({ - // Basic logging, e.g. "Transitioned into 'post'" - LOG_TRANSITIONS: false, - - // Extremely detailed logging, highlighting every internal - // step made while transitioning into a route, including - // `beforeModel`, `model`, and `afterModel` hooks, and - // information about redirects and aborted transitions - LOG_TRANSITIONS_INTERNAL: false, - modulePrefix: config.modulePrefix, podModulePrefix: config.podModulePrefix, Resolver http://git-wip-us.apache.org/repos/asf/ambari/blob/3f41dbc8/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js b/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js index e3b22e9..b0a82b0 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js @@ -39,10 +39,6 @@ export default Ember.Component.extend({ actions: { setDateRange(startDate, endDate) { this.sendAction('filterChanged', startDate, endDate); -}, - -expandJob(jobId) { - console.log("Job to be expanded", jobId); } } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/3f41dbc8/contrib/views/hive20/src/main/resources/ui/app/controllers/jobs.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/controllers/jobs.js b/contrib/views/hive20/src/main/resources/ui/app/controllers/jobs.js index 9ab46f3..2ca4474 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/controllers/jobs.js +++ b/contrib/views/hive20/src/main/resources/ui/app/controllers/jobs.js @@ -26,12 +26,13 @@ export default Ember.Controller.extend({ startTimeText: Ember.computed('startTime', function() { -return this.get('moment').moment(this.get('startTime')).format('-MM-DD'); +let st = typeof(this.get('startTime')) === 'string' ? parseInt(this.get('startTime')) : this.get('startTime'); +return this.get('moment').moment(st).format('-MM-DD'); }), endTimeText: Ember.computed('endTime', function() { -return this.get('moment').moment(this.get('endTime')).format('-MM-DD'); +let et = typeof(this.get('endTime')) === 'string' ? parseInt(this.get('endTime')) : this.get('endTime'); +return this.get('moment').moment(et).format('-MM-DD'); }) - }); http://git-wip-us.apache.org/repos/asf/ambari/blob/3f41dbc8/contrib/views/hive20/src/main/resources/ui/app/routes/jobs.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/jobs.js b/contrib/views/hive20/src/main/resources/ui/app/routes/jobs.js index a2ebc25..419fd07 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/routes/jobs.js +++ b/contrib/views/hive20/src/main/resources/ui/app/routes/jobs.js @@ -34,22 +34,24 @@ export default Ember.Route.extend({ model(params) { let now = this.get('moment').moment(); if(Ember.isEmpty(params.startTime) || Ember.i
ambari git commit: AMBARI-19792. Hive View 2.0: Jobs page shows 'Invalid date - Jan 24'. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk 1d17baf9f -> 318f35225 AMBARI-19792. Hive View 2.0: Jobs page shows 'Invalid date - Jan 24'. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/318f3522 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/318f3522 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/318f3522 Branch: refs/heads/trunk Commit: 318f352252d31e97d9110f0fb5013d006dd0adab Parents: 1d17baf Author: Dipayan Bhowmick Authored: Thu Feb 2 12:05:14 2017 +0530 Committer: Dipayan Bhowmick Committed: Thu Feb 2 12:05:46 2017 +0530 -- .../hive20/src/main/resources/ui/app/app.js | 9 --- .../resources/ui/app/components/jobs-browser.js | 4 .../main/resources/ui/app/controllers/jobs.js | 7 +++--- .../src/main/resources/ui/app/routes/jobs.js| 25 .../app/templates/components/jobs-browser.hbs | 1 + .../src/main/resources/ui/config/environment.js | 2 -- 6 files changed, 20 insertions(+), 28 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/318f3522/contrib/views/hive20/src/main/resources/ui/app/app.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/app.js b/contrib/views/hive20/src/main/resources/ui/app/app.js index 0f83ee5..af4fdc4 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/app.js +++ b/contrib/views/hive20/src/main/resources/ui/app/app.js @@ -26,15 +26,6 @@ let App; Ember.MODEL_FACTORY_INJECTIONS = true; App = Ember.Application.extend({ - // Basic logging, e.g. "Transitioned into 'post'" - LOG_TRANSITIONS: false, - - // Extremely detailed logging, highlighting every internal - // step made while transitioning into a route, including - // `beforeModel`, `model`, and `afterModel` hooks, and - // information about redirects and aborted transitions - LOG_TRANSITIONS_INTERNAL: false, - modulePrefix: config.modulePrefix, podModulePrefix: config.podModulePrefix, Resolver http://git-wip-us.apache.org/repos/asf/ambari/blob/318f3522/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js b/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js index e3b22e9..b0a82b0 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js @@ -39,10 +39,6 @@ export default Ember.Component.extend({ actions: { setDateRange(startDate, endDate) { this.sendAction('filterChanged', startDate, endDate); -}, - -expandJob(jobId) { - console.log("Job to be expanded", jobId); } } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/318f3522/contrib/views/hive20/src/main/resources/ui/app/controllers/jobs.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/controllers/jobs.js b/contrib/views/hive20/src/main/resources/ui/app/controllers/jobs.js index 9ab46f3..2ca4474 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/controllers/jobs.js +++ b/contrib/views/hive20/src/main/resources/ui/app/controllers/jobs.js @@ -26,12 +26,13 @@ export default Ember.Controller.extend({ startTimeText: Ember.computed('startTime', function() { -return this.get('moment').moment(this.get('startTime')).format('-MM-DD'); +let st = typeof(this.get('startTime')) === 'string' ? parseInt(this.get('startTime')) : this.get('startTime'); +return this.get('moment').moment(st).format('-MM-DD'); }), endTimeText: Ember.computed('endTime', function() { -return this.get('moment').moment(this.get('endTime')).format('-MM-DD'); +let et = typeof(this.get('endTime')) === 'string' ? parseInt(this.get('endTime')) : this.get('endTime'); +return this.get('moment').moment(et).format('-MM-DD'); }) - }); http://git-wip-us.apache.org/repos/asf/ambari/blob/318f3522/contrib/views/hive20/src/main/resources/ui/app/routes/jobs.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/jobs.js b/contrib/views/hive20/src/main/resources/ui/app/routes/jobs.js index a2ebc25..419fd07 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/routes/jobs.js +++ b/contrib/views/hive20/src/main/resources/ui/app/routes/jobs.js @@ -34,22 +34,24 @@ export default Ember.Route.extend({ model(params) { let now = this.get('moment').moment(); if(Ember.isEmpty(params.startTime) || Ember.isEmpty(par
ambari git commit: AMBARI-19798. Hive View 2.0: Tab switching on in table view broken. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk a9ddb2fd2 -> 1d17baf9f AMBARI-19798. Hive View 2.0: Tab switching on in table view broken. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1d17baf9 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1d17baf9 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1d17baf9 Branch: refs/heads/trunk Commit: 1d17baf9f8cb6f89cc3b2c316b4a5603f1b111d5 Parents: a9ddb2f Author: Dipayan Bhowmick Authored: Thu Feb 2 12:02:12 2017 +0530 Committer: Dipayan Bhowmick Committed: Thu Feb 2 12:02:55 2017 +0530 -- .../resources/ui/app/components/tabs-item.js| 20 +--- .../ui/app/styles/bootstrap-overrides.scss | 15 --- 2 files changed, 13 insertions(+), 22 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/1d17baf9/contrib/views/hive20/src/main/resources/ui/app/components/tabs-item.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/tabs-item.js b/contrib/views/hive20/src/main/resources/ui/app/components/tabs-item.js index e790c55..16dacac 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/tabs-item.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/tabs-item.js @@ -32,30 +32,12 @@ export default Ember.Component.extend({ } }), - didInsertElement: function() { -Ember.run.later(() => this.send('changeActiveState')); -this.$('a').click(() => { - Ember.run.later(() => { -this.send('changeActiveState'); - }); -}); - }, actions : { selected() { - this.get('tabs').forEach((x) => x.set('active', false)); + this.get('tabs').setEach('active', false); this.set('active', true); this.sendAction('activate', this.get('tab.link')); -}, - -changeActiveState: function() { - if(this.get('shouldTransition')) { -let classes = this.$('a').attr('class').split(' '); -if(classes.contains('active')) { - this.get('tabs').forEach((x) => x.set('active', false)); - this.set('active', true); -} - } } } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/1d17baf9/contrib/views/hive20/src/main/resources/ui/app/styles/bootstrap-overrides.scss -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/styles/bootstrap-overrides.scss b/contrib/views/hive20/src/main/resources/ui/app/styles/bootstrap-overrides.scss index ee9d373..b06db65 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/styles/bootstrap-overrides.scss +++ b/contrib/views/hive20/src/main/resources/ui/app/styles/bootstrap-overrides.scss @@ -35,10 +35,14 @@ $nav-tabs-active-link-hover-border-color: darken($body-bg, 15%); .nav-tabs { &.inverse { -li.active { +li { a { - background-color: $gray-dark; - color: #fff; + &.active { + background-color: $gray-dark; + color: #fff; + border: 1px solid darken($body-bg, 15%); + border-bottom: none; + } } } } @@ -46,6 +50,11 @@ $nav-tabs-active-link-hover-border-color: darken($body-bg, 15%); a { font-weight: bold; color: darken($body-bg, 50%); + &.active { +background-color: #fff; +border: 1px solid darken($body-bg, 15%); +border-bottom: none; + } } } }
ambari git commit: AMBARI-19798. Hive View 2.0: Tab switching on in table view broken. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 952bf9de3 -> e29fa051c AMBARI-19798. Hive View 2.0: Tab switching on in table view broken. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e29fa051 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e29fa051 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e29fa051 Branch: refs/heads/branch-2.5 Commit: e29fa051c9481b016fdfc85236e25f2eaa672702 Parents: 952bf9d Author: Dipayan Bhowmick Authored: Thu Feb 2 12:02:12 2017 +0530 Committer: Dipayan Bhowmick Committed: Thu Feb 2 12:02:12 2017 +0530 -- .../resources/ui/app/components/tabs-item.js| 20 +--- .../ui/app/styles/bootstrap-overrides.scss | 15 --- 2 files changed, 13 insertions(+), 22 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/e29fa051/contrib/views/hive20/src/main/resources/ui/app/components/tabs-item.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/tabs-item.js b/contrib/views/hive20/src/main/resources/ui/app/components/tabs-item.js index e790c55..16dacac 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/tabs-item.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/tabs-item.js @@ -32,30 +32,12 @@ export default Ember.Component.extend({ } }), - didInsertElement: function() { -Ember.run.later(() => this.send('changeActiveState')); -this.$('a').click(() => { - Ember.run.later(() => { -this.send('changeActiveState'); - }); -}); - }, actions : { selected() { - this.get('tabs').forEach((x) => x.set('active', false)); + this.get('tabs').setEach('active', false); this.set('active', true); this.sendAction('activate', this.get('tab.link')); -}, - -changeActiveState: function() { - if(this.get('shouldTransition')) { -let classes = this.$('a').attr('class').split(' '); -if(classes.contains('active')) { - this.get('tabs').forEach((x) => x.set('active', false)); - this.set('active', true); -} - } } } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/e29fa051/contrib/views/hive20/src/main/resources/ui/app/styles/bootstrap-overrides.scss -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/styles/bootstrap-overrides.scss b/contrib/views/hive20/src/main/resources/ui/app/styles/bootstrap-overrides.scss index ee9d373..b06db65 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/styles/bootstrap-overrides.scss +++ b/contrib/views/hive20/src/main/resources/ui/app/styles/bootstrap-overrides.scss @@ -35,10 +35,14 @@ $nav-tabs-active-link-hover-border-color: darken($body-bg, 15%); .nav-tabs { &.inverse { -li.active { +li { a { - background-color: $gray-dark; - color: #fff; + &.active { + background-color: $gray-dark; + color: #fff; + border: 1px solid darken($body-bg, 15%); + border-bottom: none; + } } } } @@ -46,6 +50,11 @@ $nav-tabs-active-link-hover-border-color: darken($body-bg, 15%); a { font-weight: bold; color: darken($body-bg, 50%); + &.active { +background-color: #fff; +border: 1px solid darken($body-bg, 15%); +border-bottom: none; + } } } }
ambari git commit: AMBARI-19771. Hive View 2.0 - query duration changes to 0 when expanded. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk 55e35a65d -> b99bfe7a7 AMBARI-19771. Hive View 2.0 - query duration changes to 0 when expanded. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b99bfe7a Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b99bfe7a Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b99bfe7a Branch: refs/heads/trunk Commit: b99bfe7a791aff2dc228c76af06ada488ec410ad Parents: 55e35a6 Author: Dipayan Bhowmick Authored: Tue Jan 31 16:07:09 2017 +0530 Committer: Dipayan Bhowmick Committed: Tue Jan 31 16:08:51 2017 +0530 -- .../resources/ui/app/components/job-item.js | 21 .../src/main/resources/ui/app/models/job.js | 2 +- .../src/main/resources/ui/app/services/jobs.js | 10 +++--- 3 files changed, 21 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/b99bfe7a/contrib/views/hive20/src/main/resources/ui/app/components/job-item.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/job-item.js b/contrib/views/hive20/src/main/resources/ui/app/components/job-item.js index 3d37df8..8a6d318 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/job-item.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/job-item.js @@ -25,14 +25,19 @@ export default Ember.Component.extend({ expandedValue: null, actions: { toggleExpandJob(jobId) { - this.toggleProperty('expanded'); - this.set('valueLoading', true); - this.get('jobs').getQuery(jobId).then((queryFile) => { -this.set('queryFile', queryFile); -this.set('valueLoading', false); - }).catch((err) => { -this.set('valueLoading', false); - }) + if(this.get('expanded')) { +this.set('expanded', false); + } else { +this.set('expanded', true); +this.set('valueLoading', true); +this.get('jobs').getQuery(jobId).then((queryFile) => { + this.set('queryFile', queryFile); + this.set('valueLoading', false); +}).catch((err) => { + this.set('valueLoading', false); +}); + } + } } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/b99bfe7a/contrib/views/hive20/src/main/resources/ui/app/models/job.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/models/job.js b/contrib/views/hive20/src/main/resources/ui/app/models/job.js index 76132d1..fb39a88 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/models/job.js +++ b/contrib/views/hive20/src/main/resources/ui/app/models/job.js @@ -25,7 +25,7 @@ export default DS.Model.extend({ queryFile: DS.attr('string'), owner: DS.attr('string'), dataBase: DS.attr('string'), - duration: DS.attr(), + duration: DS.attr('number'), status: DS.attr('string'), statusMessage: DS.attr('string'), dateSubmitted: DS.attr('date'), http://git-wip-us.apache.org/repos/asf/ambari/blob/b99bfe7a/contrib/views/hive20/src/main/resources/ui/app/services/jobs.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/services/jobs.js b/contrib/views/hive20/src/main/resources/ui/app/services/jobs.js index 5db22d0..b3c2725 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/services/jobs.js +++ b/contrib/views/hive20/src/main/resources/ui/app/services/jobs.js @@ -21,18 +21,22 @@ import Ember from 'ember'; export default Ember.Service.extend({ store: Ember.inject.service(), getQuery(jobId) { -return this.get('store').findRecord('job', jobId).then((job) => { +let job = this.get('store').peekRecord('job', jobId); +if (job) { return this.get('store').findRecord('file', job.get('queryFile')); -}) +} }, waitForJobToComplete(jobId, after, fetchDummyResult = true) { return new Ember.RSVP.Promise((resolve, reject) => { Ember.run.later(() => { -this.get('store').findRecord('job', jobId, { reload: true }) +this.get('store').findRecord('job', jobId, {reload: true}) .then((job) => { let status = job.get('status').toLowerCase(); if (status === 'succeeded') { + if (fetchDummyResult) { +this._fetchDummyResult(jobId); + } resolve(status); } else if (status === 'error') { reject(status)
ambari git commit: AMBARI-19771. Hive View 2.0 - query duration changes to 0 when expanded. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 65be27b59 -> 8474d83ec AMBARI-19771. Hive View 2.0 - query duration changes to 0 when expanded. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8474d83e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8474d83e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8474d83e Branch: refs/heads/branch-2.5 Commit: 8474d83ecfe322ade36c2b357930c0b0bd23560e Parents: 65be27b Author: Dipayan Bhowmick Authored: Tue Jan 31 16:07:09 2017 +0530 Committer: Dipayan Bhowmick Committed: Tue Jan 31 16:07:09 2017 +0530 -- .../resources/ui/app/components/job-item.js | 21 .../src/main/resources/ui/app/models/job.js | 2 +- .../src/main/resources/ui/app/services/jobs.js | 10 +++--- 3 files changed, 21 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/8474d83e/contrib/views/hive20/src/main/resources/ui/app/components/job-item.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/job-item.js b/contrib/views/hive20/src/main/resources/ui/app/components/job-item.js index 3d37df8..8a6d318 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/job-item.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/job-item.js @@ -25,14 +25,19 @@ export default Ember.Component.extend({ expandedValue: null, actions: { toggleExpandJob(jobId) { - this.toggleProperty('expanded'); - this.set('valueLoading', true); - this.get('jobs').getQuery(jobId).then((queryFile) => { -this.set('queryFile', queryFile); -this.set('valueLoading', false); - }).catch((err) => { -this.set('valueLoading', false); - }) + if(this.get('expanded')) { +this.set('expanded', false); + } else { +this.set('expanded', true); +this.set('valueLoading', true); +this.get('jobs').getQuery(jobId).then((queryFile) => { + this.set('queryFile', queryFile); + this.set('valueLoading', false); +}).catch((err) => { + this.set('valueLoading', false); +}); + } + } } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/8474d83e/contrib/views/hive20/src/main/resources/ui/app/models/job.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/models/job.js b/contrib/views/hive20/src/main/resources/ui/app/models/job.js index 76132d1..fb39a88 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/models/job.js +++ b/contrib/views/hive20/src/main/resources/ui/app/models/job.js @@ -25,7 +25,7 @@ export default DS.Model.extend({ queryFile: DS.attr('string'), owner: DS.attr('string'), dataBase: DS.attr('string'), - duration: DS.attr(), + duration: DS.attr('number'), status: DS.attr('string'), statusMessage: DS.attr('string'), dateSubmitted: DS.attr('date'), http://git-wip-us.apache.org/repos/asf/ambari/blob/8474d83e/contrib/views/hive20/src/main/resources/ui/app/services/jobs.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/services/jobs.js b/contrib/views/hive20/src/main/resources/ui/app/services/jobs.js index 5db22d0..b3c2725 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/services/jobs.js +++ b/contrib/views/hive20/src/main/resources/ui/app/services/jobs.js @@ -21,18 +21,22 @@ import Ember from 'ember'; export default Ember.Service.extend({ store: Ember.inject.service(), getQuery(jobId) { -return this.get('store').findRecord('job', jobId).then((job) => { +let job = this.get('store').peekRecord('job', jobId); +if (job) { return this.get('store').findRecord('file', job.get('queryFile')); -}) +} }, waitForJobToComplete(jobId, after, fetchDummyResult = true) { return new Ember.RSVP.Promise((resolve, reject) => { Ember.run.later(() => { -this.get('store').findRecord('job', jobId, { reload: true }) +this.get('store').findRecord('job', jobId, {reload: true}) .then((job) => { let status = job.get('status').toLowerCase(); if (status === 'succeeded') { + if (fetchDummyResult) { +this._fetchDummyResult(jobId); + } resolve(status); } else if (status === 'error') { reject(status)
ambari git commit: AMBARI-19744. Hive View 2.0: Hive view starts with an empty page. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk abcd0637c -> 37b414241 AMBARI-19744. Hive View 2.0: Hive view starts with an empty page. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/37b41424 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/37b41424 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/37b41424 Branch: refs/heads/trunk Commit: 37b414241b9b8a7b909278335037b7c0fe6fa441 Parents: abcd063 Author: Dipayan Bhowmick Authored: Mon Jan 30 14:32:50 2017 +0530 Committer: Dipayan Bhowmick Committed: Mon Jan 30 14:33:41 2017 +0530 -- .../src/main/resources/ui/app/routes/index.js | 26 1 file changed, 26 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/37b41424/contrib/views/hive20/src/main/resources/ui/app/routes/index.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/index.js b/contrib/views/hive20/src/main/resources/ui/app/routes/index.js new file mode 100644 index 000..ddaff8a --- /dev/null +++ b/contrib/views/hive20/src/main/resources/ui/app/routes/index.js @@ -0,0 +1,26 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import Ember from 'ember'; + +export default Ember.Route.extend({ + beforeModel() { +this.transitionTo('queries'); + } + +});
ambari git commit: AMBARI-19744. Hive View 2.0: Hive view starts with an empty page. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 c9ab7a680 -> b75046d60 AMBARI-19744. Hive View 2.0: Hive view starts with an empty page. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b75046d6 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b75046d6 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b75046d6 Branch: refs/heads/branch-2.5 Commit: b75046d6034198b4cc645e27d0dadee942c1bf94 Parents: c9ab7a6 Author: Dipayan Bhowmick Authored: Mon Jan 30 14:32:50 2017 +0530 Committer: Dipayan Bhowmick Committed: Mon Jan 30 14:32:50 2017 +0530 -- .../src/main/resources/ui/app/routes/index.js | 26 1 file changed, 26 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/b75046d6/contrib/views/hive20/src/main/resources/ui/app/routes/index.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/index.js b/contrib/views/hive20/src/main/resources/ui/app/routes/index.js new file mode 100644 index 000..ddaff8a --- /dev/null +++ b/contrib/views/hive20/src/main/resources/ui/app/routes/index.js @@ -0,0 +1,26 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import Ember from 'ember'; + +export default Ember.Route.extend({ + beforeModel() { +this.transitionTo('queries'); + } + +});
ambari git commit: AMBARI-19770. Hive View 2.0: New Job and New Table button does nothing. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk ea1fbaa02 -> 985dafff5 AMBARI-19770. Hive View 2.0: New Job and New Table button does nothing. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/985dafff Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/985dafff Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/985dafff Branch: refs/heads/trunk Commit: 985dafff5330b97e4b92f1c4cf67ee201a8e6edd Parents: ea1fbaa Author: Dipayan Bhowmick Authored: Mon Jan 30 14:26:07 2017 +0530 Committer: Dipayan Bhowmick Committed: Mon Jan 30 14:28:04 2017 +0530 -- .../hive20/src/main/resources/ui/app/app.js | 9 .../resources/ui/app/controllers/queries.js | 22 + .../main/resources/ui/app/models/worksheet.js | 2 +- .../hive20/src/main/resources/ui/app/router.js | 2 + .../main/resources/ui/app/routes/application.js | 4 +- .../ui/app/routes/databases/newtable.js | 30 .../src/main/resources/ui/app/routes/queries.js | 49 +--- .../resources/ui/app/routes/queries/index.js| 9 ++-- .../main/resources/ui/app/routes/queries/new.js | 38 +++ .../resources/ui/app/routes/queries/query.js| 17 --- .../src/main/resources/ui/app/services/jobs.js | 6 ++- .../components/top-application-bar.hbs | 4 +- .../src/main/resources/ui/config/environment.js | 2 + 13 files changed, 130 insertions(+), 64 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/985dafff/contrib/views/hive20/src/main/resources/ui/app/app.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/app.js b/contrib/views/hive20/src/main/resources/ui/app/app.js index af4fdc4..0f83ee5 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/app.js +++ b/contrib/views/hive20/src/main/resources/ui/app/app.js @@ -26,6 +26,15 @@ let App; Ember.MODEL_FACTORY_INJECTIONS = true; App = Ember.Application.extend({ + // Basic logging, e.g. "Transitioned into 'post'" + LOG_TRANSITIONS: false, + + // Extremely detailed logging, highlighting every internal + // step made while transitioning into a route, including + // `beforeModel`, `model`, and `afterModel` hooks, and + // information about redirects and aborted transitions + LOG_TRANSITIONS_INTERNAL: false, + modulePrefix: config.modulePrefix, podModulePrefix: config.podModulePrefix, Resolver http://git-wip-us.apache.org/repos/asf/ambari/blob/985dafff/contrib/views/hive20/src/main/resources/ui/app/controllers/queries.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/controllers/queries.js b/contrib/views/hive20/src/main/resources/ui/app/controllers/queries.js new file mode 100644 index 000..dc99fd1 --- /dev/null +++ b/contrib/views/hive20/src/main/resources/ui/app/controllers/queries.js @@ -0,0 +1,22 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import Ember from 'ember'; + +export default Ember.Controller.extend({ +}); http://git-wip-us.apache.org/repos/asf/ambari/blob/985dafff/contrib/views/hive20/src/main/resources/ui/app/models/worksheet.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/models/worksheet.js b/contrib/views/hive20/src/main/resources/ui/app/models/worksheet.js index 23f16b0..9021e90 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/models/worksheet.js +++ b/contrib/views/hive20/src/main/resources/ui/app/models/worksheet.js @@ -20,7 +20,7 @@ import DS from 'ember-data'; export default DS.Model.extend({ title: DS.attr('string'), - query: DS.attr('string'), + query: DS.attr('string', {defaultValue: ''}), selectedDb: DS.attr('string'), owner: DS.attr('string'), queryResult: DS.attr({defaultValue: {'schema' :[], 'rows' :[]}}), http://git-wip-us.apache.org/repos/asf/ambari/blob/985dafff/contrib/
ambari git commit: AMBARI-19770. Hive View 2.0: New Job and New Table button does nothing. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 c850ad731 -> fe1523fcb AMBARI-19770. Hive View 2.0: New Job and New Table button does nothing. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/fe1523fc Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/fe1523fc Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/fe1523fc Branch: refs/heads/branch-2.5 Commit: fe1523fcb36b3ce69209fd5b1a6f693756f7526f Parents: c850ad7 Author: Dipayan Bhowmick Authored: Mon Jan 30 14:26:07 2017 +0530 Committer: Dipayan Bhowmick Committed: Mon Jan 30 14:27:09 2017 +0530 -- .../hive20/src/main/resources/ui/app/app.js | 9 .../resources/ui/app/controllers/queries.js | 22 + .../main/resources/ui/app/models/worksheet.js | 2 +- .../hive20/src/main/resources/ui/app/router.js | 2 + .../main/resources/ui/app/routes/application.js | 4 +- .../ui/app/routes/databases/newtable.js | 30 .../src/main/resources/ui/app/routes/queries.js | 49 +--- .../resources/ui/app/routes/queries/index.js| 9 ++-- .../main/resources/ui/app/routes/queries/new.js | 38 +++ .../resources/ui/app/routes/queries/query.js| 17 --- .../src/main/resources/ui/app/services/jobs.js | 6 ++- .../components/top-application-bar.hbs | 4 +- .../src/main/resources/ui/config/environment.js | 2 + 13 files changed, 130 insertions(+), 64 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/fe1523fc/contrib/views/hive20/src/main/resources/ui/app/app.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/app.js b/contrib/views/hive20/src/main/resources/ui/app/app.js index af4fdc4..0f83ee5 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/app.js +++ b/contrib/views/hive20/src/main/resources/ui/app/app.js @@ -26,6 +26,15 @@ let App; Ember.MODEL_FACTORY_INJECTIONS = true; App = Ember.Application.extend({ + // Basic logging, e.g. "Transitioned into 'post'" + LOG_TRANSITIONS: false, + + // Extremely detailed logging, highlighting every internal + // step made while transitioning into a route, including + // `beforeModel`, `model`, and `afterModel` hooks, and + // information about redirects and aborted transitions + LOG_TRANSITIONS_INTERNAL: false, + modulePrefix: config.modulePrefix, podModulePrefix: config.podModulePrefix, Resolver http://git-wip-us.apache.org/repos/asf/ambari/blob/fe1523fc/contrib/views/hive20/src/main/resources/ui/app/controllers/queries.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/controllers/queries.js b/contrib/views/hive20/src/main/resources/ui/app/controllers/queries.js new file mode 100644 index 000..dc99fd1 --- /dev/null +++ b/contrib/views/hive20/src/main/resources/ui/app/controllers/queries.js @@ -0,0 +1,22 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import Ember from 'ember'; + +export default Ember.Controller.extend({ +}); http://git-wip-us.apache.org/repos/asf/ambari/blob/fe1523fc/contrib/views/hive20/src/main/resources/ui/app/models/worksheet.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/models/worksheet.js b/contrib/views/hive20/src/main/resources/ui/app/models/worksheet.js index 23f16b0..9021e90 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/models/worksheet.js +++ b/contrib/views/hive20/src/main/resources/ui/app/models/worksheet.js @@ -20,7 +20,7 @@ import DS from 'ember-data'; export default DS.Model.extend({ title: DS.attr('string'), - query: DS.attr('string'), + query: DS.attr('string', {defaultValue: ''}), selectedDb: DS.attr('string'), owner: DS.attr('string'), queryResult: DS.attr({defaultValue: {'schema' :[], 'rows' :[]}}), http://git-wip-us.apache.org/repos/asf/ambari/blob/fe1523f
ambari git commit: AMBARI-19628. Hive View 2.0: Ability to view and create table and column statistics. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk f88aca8e1 -> 22d4e1816 AMBARI-19628. Hive View 2.0: Ability to view and create table and column statistics. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/22d4e181 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/22d4e181 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/22d4e181 Branch: refs/heads/trunk Commit: 22d4e18168935d9a9400591ebcd1a05c2b2ebf7d Parents: f88aca8 Author: Dipayan Bhowmick Authored: Fri Jan 27 12:03:24 2017 +0530 Committer: Dipayan Bhowmick Committed: Fri Jan 27 12:03:56 2017 +0530 -- .../src/main/resources/ui/app/adapters/table.js | 27 +++- .../ui/app/components/table-statistics.js | 120 +++ .../main/resources/ui/app/models/table-info.js | 1 + .../routes/databases/database/tables/table.js | 4 + .../src/main/resources/ui/app/services/jobs.js | 10 +- .../resources/ui/app/services/stats-service.js | 76 + .../src/main/resources/ui/app/styles/app.scss | 23 +-- .../templates/components/table-statistics.hbs | 153 +++ .../app/templates/databases/database/tables.hbs | 2 +- .../databases/database/tables/table/stats.hbs | 4 +- 10 files changed, 399 insertions(+), 21 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/22d4e181/contrib/views/hive20/src/main/resources/ui/app/adapters/table.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/adapters/table.js b/contrib/views/hive20/src/main/resources/ui/app/adapters/table.js index 9a4692d..e878899 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/adapters/table.js +++ b/contrib/views/hive20/src/main/resources/ui/app/adapters/table.js @@ -22,14 +22,14 @@ import DDLAdapter from './ddl'; export default DDLAdapter.extend({ buildURL(modelName, id, snapshot, requestType, query) { // Check if the query is to find all tables for a particular database -if(Ember.isEmpty(id) && (requestType === 'query' || requestType == 'queryRecord')) { +if (Ember.isEmpty(id) && (requestType === 'query' || requestType == 'queryRecord')) { let dbId = query.databaseId; let tableName = query.tableName; let origFindAllUrl = this._super(...arguments); let prefix = origFindAllUrl.substr(0, origFindAllUrl.lastIndexOf("/")); delete query.databaseId; delete query.tableName; - if(Ember.isEmpty(tableName)) { + if (Ember.isEmpty(tableName)) { return `${prefix}/databases/${dbId}/tables`; } else { return `${prefix}/databases/${dbId}/tables/${tableName}`; @@ -40,12 +40,29 @@ export default DDLAdapter.extend({ createTable(tableMetaInfo) { -let postURL = this.buildURL('table', null, null, 'query', {databaseId: tableMetaInfo.database}); -return this.ajax(postURL, 'POST', { data: {tableInfo: tableMetaInfo} }); +let postURL = this.buildURL('table', null, null, 'query', { databaseId: tableMetaInfo.database }); +return this.ajax(postURL, 'POST', { data: { tableInfo: tableMetaInfo } }); }, deleteTable(database, tableName) { -let deletURL = this.buildURL('table', null, null, 'query', {databaseId: database, tableName: tableName}); +let deletURL = this.buildURL('table', null, null, 'query', { databaseId: database, tableName: tableName }); return this.ajax(deletURL, 'DELETE'); + }, + + analyseTable(databaseName, tableName, withColumns = false) { +let analyseUrl = this.buildURL('table', null, null, 'query', { databaseId: databaseName, tableName: tableName }) + + '/analyze' + + (withColumns ? '?analyze_columns=true' : ''); +return this.ajax(analyseUrl, 'PUT'); + }, + + generateColumnStats(databaseName, tableName, columnName) { +let url = this.buildURL('table', null, null, 'query', {databaseId: databaseName, tableName: tableName}) + `/column/${columnName}/stats`; +return this.ajax(url, 'GET'); + }, + + fetchColumnStats(databaseName, tableName, columnName, jobId) { +let url = this.buildURL('table', null, null, 'query', {databaseId: databaseName, tableName: tableName}) + `/column/${columnName}/fetch_stats?job_id=${jobId}`; +return this.ajax(url, 'GET'); } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/22d4e181/contrib/views/hive20/src/main/resources/ui/app/components/table-statistics.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/table-statistics.js b/contrib/views/hive20/src/main/resources/ui/app/components/table-statistics.js new file mode 100644 index 000..d53a41f --- /dev/null +++ b/contrib/views/hive20/src/main/resources/ui/
ambari git commit: AMBARI-19628. Hive View 2.0: Ability to view and create table and column statistics. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 635191c8a -> 8934da1e1 AMBARI-19628. Hive View 2.0: Ability to view and create table and column statistics. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8934da1e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8934da1e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8934da1e Branch: refs/heads/branch-2.5 Commit: 8934da1e1bff4fb9b5f3dfd6f5987c3fb247b450 Parents: 635191c Author: Dipayan Bhowmick Authored: Fri Jan 27 12:03:24 2017 +0530 Committer: Dipayan Bhowmick Committed: Fri Jan 27 12:03:24 2017 +0530 -- .../src/main/resources/ui/app/adapters/table.js | 27 +++- .../ui/app/components/table-statistics.js | 120 +++ .../main/resources/ui/app/models/table-info.js | 1 + .../routes/databases/database/tables/table.js | 4 + .../src/main/resources/ui/app/services/jobs.js | 10 +- .../resources/ui/app/services/stats-service.js | 76 + .../src/main/resources/ui/app/styles/app.scss | 23 +-- .../templates/components/table-statistics.hbs | 153 +++ .../app/templates/databases/database/tables.hbs | 2 +- .../databases/database/tables/table/stats.hbs | 4 +- 10 files changed, 399 insertions(+), 21 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/8934da1e/contrib/views/hive20/src/main/resources/ui/app/adapters/table.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/adapters/table.js b/contrib/views/hive20/src/main/resources/ui/app/adapters/table.js index 9a4692d..e878899 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/adapters/table.js +++ b/contrib/views/hive20/src/main/resources/ui/app/adapters/table.js @@ -22,14 +22,14 @@ import DDLAdapter from './ddl'; export default DDLAdapter.extend({ buildURL(modelName, id, snapshot, requestType, query) { // Check if the query is to find all tables for a particular database -if(Ember.isEmpty(id) && (requestType === 'query' || requestType == 'queryRecord')) { +if (Ember.isEmpty(id) && (requestType === 'query' || requestType == 'queryRecord')) { let dbId = query.databaseId; let tableName = query.tableName; let origFindAllUrl = this._super(...arguments); let prefix = origFindAllUrl.substr(0, origFindAllUrl.lastIndexOf("/")); delete query.databaseId; delete query.tableName; - if(Ember.isEmpty(tableName)) { + if (Ember.isEmpty(tableName)) { return `${prefix}/databases/${dbId}/tables`; } else { return `${prefix}/databases/${dbId}/tables/${tableName}`; @@ -40,12 +40,29 @@ export default DDLAdapter.extend({ createTable(tableMetaInfo) { -let postURL = this.buildURL('table', null, null, 'query', {databaseId: tableMetaInfo.database}); -return this.ajax(postURL, 'POST', { data: {tableInfo: tableMetaInfo} }); +let postURL = this.buildURL('table', null, null, 'query', { databaseId: tableMetaInfo.database }); +return this.ajax(postURL, 'POST', { data: { tableInfo: tableMetaInfo } }); }, deleteTable(database, tableName) { -let deletURL = this.buildURL('table', null, null, 'query', {databaseId: database, tableName: tableName}); +let deletURL = this.buildURL('table', null, null, 'query', { databaseId: database, tableName: tableName }); return this.ajax(deletURL, 'DELETE'); + }, + + analyseTable(databaseName, tableName, withColumns = false) { +let analyseUrl = this.buildURL('table', null, null, 'query', { databaseId: databaseName, tableName: tableName }) + + '/analyze' + + (withColumns ? '?analyze_columns=true' : ''); +return this.ajax(analyseUrl, 'PUT'); + }, + + generateColumnStats(databaseName, tableName, columnName) { +let url = this.buildURL('table', null, null, 'query', {databaseId: databaseName, tableName: tableName}) + `/column/${columnName}/stats`; +return this.ajax(url, 'GET'); + }, + + fetchColumnStats(databaseName, tableName, columnName, jobId) { +let url = this.buildURL('table', null, null, 'query', {databaseId: databaseName, tableName: tableName}) + `/column/${columnName}/fetch_stats?job_id=${jobId}`; +return this.ajax(url, 'GET'); } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/8934da1e/contrib/views/hive20/src/main/resources/ui/app/components/table-statistics.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/table-statistics.js b/contrib/views/hive20/src/main/resources/ui/app/components/table-statistics.js new file mode 100644 index 000..d53a41f --- /dev/null +++ b/contrib/views/hive20/src/main/res
ambari git commit: AMBARI-19631. Hive View 2.0: Show the table accesses in the authorization sceen. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk d38fed3d4 -> f88aca8e1 AMBARI-19631. Hive View 2.0: Show the table accesses in the authorization sceen. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f88aca8e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f88aca8e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f88aca8e Branch: refs/heads/trunk Commit: f88aca8e1f97311d416da92ec43f9e19535cdf9e Parents: d38fed3 Author: Dipayan Bhowmick Authored: Fri Jan 27 11:56:15 2017 +0530 Committer: Dipayan Bhowmick Committed: Fri Jan 27 11:56:52 2017 +0530 -- .../resources/system/ranger/RangerService.java | 41 +++- .../databases/database/tables/table/auth.hbs| 10 - 2 files changed, 39 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/f88aca8e/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java index 95ab27c..9debe42 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java @@ -25,7 +25,7 @@ import org.apache.ambari.view.hive20.utils.AuthorizationChecker; import org.apache.ambari.view.utils.ambari.AmbariApi; import org.apache.commons.codec.binary.Base64; import org.apache.commons.io.IOUtils; -import org.apache.hadoop.hbase.util.Strings; +import org.apache.commons.lang.StringUtils; import org.json.simple.JSONArray; import org.json.simple.JSONObject; import org.json.simple.JSONValue; @@ -81,7 +81,7 @@ public class RangerService { LOG.error("Failed to fetch Ranger URL from ambari. Exception: {}", e); throw new RangerException("Failed to fetch Ranger URL from Ambari", "AMBARI_FETCH_FAILED", 500, e); } -if (Strings.isEmpty(rangerUrl)) { +if (StringUtils.isEmpty(rangerUrl)) { LOG.info("Ranger url is not configured for the instance"); throw new RangerException("Ranger url is not configured in Ambari.", "CONFIGURATION_ERROR", 500); } @@ -91,7 +91,7 @@ public class RangerService { private List getPoliciesFromNonAmbariCluster(String database, String table) { String rangerUrl = getRangerUrlFromConfig(); -if (Strings.isEmpty(rangerUrl)) { +if (StringUtils.isEmpty(rangerUrl)) { LOG.info("Ranger url is not configured for the instance"); throw new RangerException("Ranger url is not configured in Ambari Instance.", "CONFIGURATION_ERROR", 500); } @@ -107,7 +107,7 @@ public class RangerService { } String rangerResponse = fetchResponseFromRanger(rangerUrl, cred.username, cred.password, database, table); -if (Strings.isEmpty(rangerResponse)) { +if (StringUtils.isEmpty(rangerResponse)) { return Lists.newArrayList(); } @@ -141,8 +141,17 @@ public class RangerService { JSONObject policyItem = (JSONObject) policyItems.get(0); JSONArray usersJson = (JSONArray) policyItem.get("users"); JSONArray groupsJson = (JSONArray) policyItem.get("groups"); + JSONArray accesses = (JSONArray) policyItem.get("accesses"); + for (Object accessJson : accesses) { +JSONObject access = (JSONObject) accessJson; +Boolean isAllowed = (Boolean) access.get("isAllowed"); +if (isAllowed) { + policy.addAccess((String) access.get("type")); +} + } + for (Object user : usersJson) { policy.addUser((String) user); } @@ -159,7 +168,7 @@ public class RangerService { private String fetchResponseFromRanger(String rangerUrl, String username, String password, String database, String table) { String serviceName = context.getProperties().get("hive.ranger.servicename"); -if(Strings.isEmpty(serviceName)) { +if (StringUtils.isEmpty(serviceName)) { LOG.error("Bad service name configured"); throw new RangerException("Ranger service name is not configured in Ambari Instance.", "CONFIGURATION_ERROR", 500); } @@ -182,15 +191,15 @@ public class RangerService { private StringBuilder getRangerUrl(String rangerUrl, String database, String table, String serviceName) { StringBuilder queryParams = new StringBuilder(); -if (!Strings.isEmpty(database)) { +if (!StringUtils.isEmpty(database)) { queryParams.append("resource:database="); queryParams.append(databa
ambari git commit: AMBARI-19631. Hive View 2.0: Show the table accesses in the authorization sceen. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 4313fec21 -> 635191c8a AMBARI-19631. Hive View 2.0: Show the table accesses in the authorization sceen. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/635191c8 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/635191c8 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/635191c8 Branch: refs/heads/branch-2.5 Commit: 635191c8ae2aedd1ac1912e142f1b7afdcafe461 Parents: 4313fec Author: Dipayan Bhowmick Authored: Fri Jan 27 11:56:15 2017 +0530 Committer: Dipayan Bhowmick Committed: Fri Jan 27 11:56:15 2017 +0530 -- .../resources/system/ranger/RangerService.java | 41 +++- .../databases/database/tables/table/auth.hbs| 10 - 2 files changed, 39 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/635191c8/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java index 95ab27c..9debe42 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/ranger/RangerService.java @@ -25,7 +25,7 @@ import org.apache.ambari.view.hive20.utils.AuthorizationChecker; import org.apache.ambari.view.utils.ambari.AmbariApi; import org.apache.commons.codec.binary.Base64; import org.apache.commons.io.IOUtils; -import org.apache.hadoop.hbase.util.Strings; +import org.apache.commons.lang.StringUtils; import org.json.simple.JSONArray; import org.json.simple.JSONObject; import org.json.simple.JSONValue; @@ -81,7 +81,7 @@ public class RangerService { LOG.error("Failed to fetch Ranger URL from ambari. Exception: {}", e); throw new RangerException("Failed to fetch Ranger URL from Ambari", "AMBARI_FETCH_FAILED", 500, e); } -if (Strings.isEmpty(rangerUrl)) { +if (StringUtils.isEmpty(rangerUrl)) { LOG.info("Ranger url is not configured for the instance"); throw new RangerException("Ranger url is not configured in Ambari.", "CONFIGURATION_ERROR", 500); } @@ -91,7 +91,7 @@ public class RangerService { private List getPoliciesFromNonAmbariCluster(String database, String table) { String rangerUrl = getRangerUrlFromConfig(); -if (Strings.isEmpty(rangerUrl)) { +if (StringUtils.isEmpty(rangerUrl)) { LOG.info("Ranger url is not configured for the instance"); throw new RangerException("Ranger url is not configured in Ambari Instance.", "CONFIGURATION_ERROR", 500); } @@ -107,7 +107,7 @@ public class RangerService { } String rangerResponse = fetchResponseFromRanger(rangerUrl, cred.username, cred.password, database, table); -if (Strings.isEmpty(rangerResponse)) { +if (StringUtils.isEmpty(rangerResponse)) { return Lists.newArrayList(); } @@ -141,8 +141,17 @@ public class RangerService { JSONObject policyItem = (JSONObject) policyItems.get(0); JSONArray usersJson = (JSONArray) policyItem.get("users"); JSONArray groupsJson = (JSONArray) policyItem.get("groups"); + JSONArray accesses = (JSONArray) policyItem.get("accesses"); + for (Object accessJson : accesses) { +JSONObject access = (JSONObject) accessJson; +Boolean isAllowed = (Boolean) access.get("isAllowed"); +if (isAllowed) { + policy.addAccess((String) access.get("type")); +} + } + for (Object user : usersJson) { policy.addUser((String) user); } @@ -159,7 +168,7 @@ public class RangerService { private String fetchResponseFromRanger(String rangerUrl, String username, String password, String database, String table) { String serviceName = context.getProperties().get("hive.ranger.servicename"); -if(Strings.isEmpty(serviceName)) { +if (StringUtils.isEmpty(serviceName)) { LOG.error("Bad service name configured"); throw new RangerException("Ranger service name is not configured in Ambari Instance.", "CONFIGURATION_ERROR", 500); } @@ -182,15 +191,15 @@ public class RangerService { private StringBuilder getRangerUrl(String rangerUrl, String database, String table, String serviceName) { StringBuilder queryParams = new StringBuilder(); -if (!Strings.isEmpty(database)) { +if (!StringUtils.isEmpty(database)) { queryParams.append("resource:database="); queryParams.app
ambari git commit: AMBARI-19595. HiveView2.0 not loading in secure environment. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk bc77c9ca0 -> 15233860e AMBARI-19595. HiveView2.0 not loading in secure environment. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/15233860 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/15233860 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/15233860 Branch: refs/heads/trunk Commit: 15233860e631e8db568e797b3d894c0da465bf72 Parents: bc77c9c Author: Dipayan Bhowmick Authored: Wed Jan 18 13:03:36 2017 +0530 Committer: Dipayan Bhowmick Committed: Wed Jan 18 13:04:19 2017 +0530 -- .../src/main/java/org/apache/ambari/view/hive20/AuthParams.java| 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/15233860/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/AuthParams.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/AuthParams.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/AuthParams.java index 98e6caf..60df377 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/AuthParams.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/AuthParams.java @@ -68,6 +68,8 @@ public class AuthParams { public UserGroupInformation getProxyUser() throws IOException { UserGroupInformation ugi; String proxyuser = null; + +UserGroupInformation.isSecurityEnabled(); if(context.getCluster() != null) { proxyuser = context.getCluster().getConfigurationValue("cluster-env","ambari_principal_name"); }
ambari git commit: AMBARI-19595. HiveView2.0 not loading in secure environment. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 d73bf7e08 -> c89874255 AMBARI-19595. HiveView2.0 not loading in secure environment. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c8987425 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c8987425 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c8987425 Branch: refs/heads/branch-2.5 Commit: c898742554b81190857b3fb4ac4dfdc08273d64e Parents: d73bf7e Author: Dipayan Bhowmick Authored: Wed Jan 18 13:03:36 2017 +0530 Committer: Dipayan Bhowmick Committed: Wed Jan 18 13:03:36 2017 +0530 -- .../src/main/java/org/apache/ambari/view/hive20/AuthParams.java| 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/c8987425/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/AuthParams.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/AuthParams.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/AuthParams.java index 98e6caf..60df377 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/AuthParams.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/AuthParams.java @@ -68,6 +68,8 @@ public class AuthParams { public UserGroupInformation getProxyUser() throws IOException { UserGroupInformation ugi; String proxyuser = null; + +UserGroupInformation.isSecurityEnabled(); if(context.getCluster() != null) { proxyuser = context.getCluster().getConfigurationValue("cluster-env","ambari_principal_name"); }
ambari git commit: AMBARI-19579. Hive View 2.0: Show precision and scale of a column in table manager view. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 cf949607a -> ba96c7fe0 AMBARI-19579. Hive View 2.0: Show precision and scale of a column in table manager view. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ba96c7fe Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ba96c7fe Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ba96c7fe Branch: refs/heads/branch-2.5 Commit: ba96c7fe07f6dc415e37a9bf0a024e69d7e95059 Parents: cf94960 Author: Dipayan Bhowmick Authored: Wed Jan 18 00:19:39 2017 +0530 Committer: Dipayan Bhowmick Committed: Wed Jan 18 00:19:39 2017 +0530 -- .../app/components/table-advanced-settings.js | 1 - .../ui/app/helpers/format-column-size.js| 39 .../databases/database/tables/table/columns.js | 10 + .../ui/app/templates/components/column-item.hbs | 2 +- .../databases/database/tables/table/columns.hbs | 14 +-- .../database/tables/table/partitions.hbs| 2 +- 6 files changed, 61 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/ba96c7fe/contrib/views/hive20/src/main/resources/ui/app/components/table-advanced-settings.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/table-advanced-settings.js b/contrib/views/hive20/src/main/resources/ui/app/components/table-advanced-settings.js index 181816a..5e50a5c 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/table-advanced-settings.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/table-advanced-settings.js @@ -58,7 +58,6 @@ export default Ember.Component.extend({ } else { let defaultFileFormat = this.get('fileFormats').findBy('default', true); this.set('settings.fileFormat', {}); - debugger; this.set('settings.fileFormat.type', defaultFileFormat.name); } if (!Ember.isEmpty(this.get('settings.rowFormat'))) { http://git-wip-us.apache.org/repos/asf/ambari/blob/ba96c7fe/contrib/views/hive20/src/main/resources/ui/app/helpers/format-column-size.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/helpers/format-column-size.js b/contrib/views/hive20/src/main/resources/ui/app/helpers/format-column-size.js new file mode 100644 index 000..a24f797 --- /dev/null +++ b/contrib/views/hive20/src/main/resources/ui/app/helpers/format-column-size.js @@ -0,0 +1,39 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import Ember from 'ember'; + +export function formatColumnSize(params/*, hash*/) { + const precision = params[0]; + const scale = params[1]; + if (Ember.isEmpty(precision) && Ember.isEmpty(scale)) { +return ''; + } + let sizeString = '( '; + if (precision) { +sizeString = `${sizeString}${precision}` + } + if (scale) { +sizeString = `${sizeString}, ${scale}`; + } + sizeString = `${sizeString} )`; + + return sizeString; +} + +export default Ember.Helper.helper(formatColumnSize); http://git-wip-us.apache.org/repos/asf/ambari/blob/ba96c7fe/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/columns.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/columns.js b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/columns.js index a11a4de..694cf21 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/columns.js +++ b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/columns.js @@ -20,4 +20,14 @@ import TableMetaRouter from './table-meta-router'; export default TableMetaRouter.extend({ + setupController: function (controller, model) { +this._super(controller, model); +let table = controller.get
ambari git commit: AMBARI-19579. Hive View 2.0: Show precision and scale of a column in table manager view. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk e83837e10 -> fecf197c7 AMBARI-19579. Hive View 2.0: Show precision and scale of a column in table manager view. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/fecf197c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/fecf197c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/fecf197c Branch: refs/heads/trunk Commit: fecf197c710dcd99cc2c8d1189e393fc227e5fb3 Parents: e83837e Author: Dipayan Bhowmick Authored: Wed Jan 18 00:19:39 2017 +0530 Committer: Dipayan Bhowmick Committed: Wed Jan 18 00:20:12 2017 +0530 -- .../app/components/table-advanced-settings.js | 1 - .../ui/app/helpers/format-column-size.js| 39 .../databases/database/tables/table/columns.js | 10 + .../ui/app/templates/components/column-item.hbs | 2 +- .../databases/database/tables/table/columns.hbs | 14 +-- .../database/tables/table/partitions.hbs| 2 +- 6 files changed, 61 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/fecf197c/contrib/views/hive20/src/main/resources/ui/app/components/table-advanced-settings.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/table-advanced-settings.js b/contrib/views/hive20/src/main/resources/ui/app/components/table-advanced-settings.js index 181816a..5e50a5c 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/table-advanced-settings.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/table-advanced-settings.js @@ -58,7 +58,6 @@ export default Ember.Component.extend({ } else { let defaultFileFormat = this.get('fileFormats').findBy('default', true); this.set('settings.fileFormat', {}); - debugger; this.set('settings.fileFormat.type', defaultFileFormat.name); } if (!Ember.isEmpty(this.get('settings.rowFormat'))) { http://git-wip-us.apache.org/repos/asf/ambari/blob/fecf197c/contrib/views/hive20/src/main/resources/ui/app/helpers/format-column-size.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/helpers/format-column-size.js b/contrib/views/hive20/src/main/resources/ui/app/helpers/format-column-size.js new file mode 100644 index 000..a24f797 --- /dev/null +++ b/contrib/views/hive20/src/main/resources/ui/app/helpers/format-column-size.js @@ -0,0 +1,39 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import Ember from 'ember'; + +export function formatColumnSize(params/*, hash*/) { + const precision = params[0]; + const scale = params[1]; + if (Ember.isEmpty(precision) && Ember.isEmpty(scale)) { +return ''; + } + let sizeString = '( '; + if (precision) { +sizeString = `${sizeString}${precision}` + } + if (scale) { +sizeString = `${sizeString}, ${scale}`; + } + sizeString = `${sizeString} )`; + + return sizeString; +} + +export default Ember.Helper.helper(formatColumnSize); http://git-wip-us.apache.org/repos/asf/ambari/blob/fecf197c/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/columns.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/columns.js b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/columns.js index a11a4de..694cf21 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/columns.js +++ b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/columns.js @@ -20,4 +20,14 @@ import TableMetaRouter from './table-meta-router'; export default TableMetaRouter.extend({ + setupController: function (controller, model) { +this._super(controller, model); +let table = controller.get('table');
ambari git commit: AMBARI-19570. Hive View 2.0.0: Enable view of ranger authorization for a table. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk badf9f7bb -> 285666fac AMBARI-19570. Hive View 2.0.0: Enable view of ranger authorization for a table. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/285666fa Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/285666fa Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/285666fa Branch: refs/heads/trunk Commit: 285666fac5a14f461950386d2687d172a3574283 Parents: badf9f7 Author: Dipayan Bhowmick Authored: Tue Jan 17 12:08:54 2017 +0530 Committer: Dipayan Bhowmick Committed: Tue Jan 17 12:09:27 2017 +0530 -- .../view/hive20/actor/MetaDataManager.java | 8 +- .../hive20/resources/system/SystemService.java | 29 ++ .../system/ranger/RangerException.java | 56 .../resources/system/ranger/RangerService.java | 317 +++ .../view/hive20/utils/AuthorizationChecker.java | 74 + .../resources/ui/app/adapters/application.js| 1 + .../src/main/resources/ui/app/adapters/ping.js | 5 + .../ui/app/configs/table-level-tabs.js | 6 + .../hive20/src/main/resources/ui/app/router.js | 1 + .../databases/database/tables/table/auth.js | 27 ++ .../src/main/resources/ui/app/styles/app.scss | 12 + .../templates/components/table-properties.hbs | 2 +- .../database/tables/table/auth-error.hbs| 35 ++ .../database/tables/table/auth-loading.hbs | 23 ++ .../databases/database/tables/table/auth.hbs| 53 .../views/hive20/src/main/resources/view.xml| 33 ++ 16 files changed, 677 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/285666fa/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/MetaDataManager.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/MetaDataManager.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/MetaDataManager.java index 43733e4..525ec0d 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/MetaDataManager.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/MetaDataManager.java @@ -69,15 +69,15 @@ public class MetaDataManager extends HiveActor { ActorRef databaseManager = databaseManagers.get(message.getUsername()); if (databaseManager == null) { databaseManager = createDatabaseManager(message.getUsername(), message.getInstanceName()); - databaseManagers.put(context.getUsername(), databaseManager); - databaseManager.tell(new DatabaseManager.Refresh(context.getUsername()), getSelf()); + databaseManagers.put(message.getUsername(), databaseManager); + databaseManager.tell(new DatabaseManager.Refresh(message.getUsername()), getSelf()); } else { if(message.isImmediate()) { -databaseManager.tell(new DatabaseManager.Refresh(context.getUsername(), false), getSelf()); +databaseManager.tell(new DatabaseManager.Refresh(message.getUsername(), false), getSelf()); } cancelTerminationScheduler(message.getUsername()); } -scheduleTermination(context.getUsername()); +scheduleTermination(message.getUsername()); } private void handleTerminate(Terminate message) { http://git-wip-us.apache.org/repos/asf/ambari/blob/285666fa/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/SystemService.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/SystemService.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/SystemService.java index 0afe43c..1399ee4 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/SystemService.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/SystemService.java @@ -22,16 +22,29 @@ import akka.actor.ActorRef; import org.apache.ambari.view.hive20.BaseService; import org.apache.ambari.view.hive20.ConnectionSystem; import org.apache.ambari.view.hive20.actor.message.Ping; +import org.apache.ambari.view.hive20.resources.system.ranger.RangerService; +import org.json.simple.JSONObject; +import javax.inject.Inject; +import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.Path; +import javax.ws.rs.QueryParam; import javax.ws.rs.core.Response; +import java.util.List; /** * System services which are required for the working of the application */ public class SystemService extends BaseService { + private final RangerService rangerService; + + @Inject + public SystemService
ambari git commit: AMBARI-19570. Hive View 2.0.0: Enable view of ranger authorization for a table. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 d54fab9ae -> 552c418bc AMBARI-19570. Hive View 2.0.0: Enable view of ranger authorization for a table. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/552c418b Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/552c418b Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/552c418b Branch: refs/heads/branch-2.5 Commit: 552c418bc1f8971a2ef9b959fde30d51edf20df0 Parents: d54fab9 Author: Dipayan Bhowmick Authored: Tue Jan 17 12:08:54 2017 +0530 Committer: Dipayan Bhowmick Committed: Tue Jan 17 12:08:54 2017 +0530 -- .../view/hive20/actor/MetaDataManager.java | 8 +- .../hive20/resources/system/SystemService.java | 29 ++ .../system/ranger/RangerException.java | 56 .../resources/system/ranger/RangerService.java | 317 +++ .../view/hive20/utils/AuthorizationChecker.java | 74 + .../resources/ui/app/adapters/application.js| 1 + .../src/main/resources/ui/app/adapters/ping.js | 5 + .../ui/app/configs/table-level-tabs.js | 6 + .../hive20/src/main/resources/ui/app/router.js | 1 + .../databases/database/tables/table/auth.js | 27 ++ .../src/main/resources/ui/app/styles/app.scss | 12 + .../templates/components/table-properties.hbs | 2 +- .../database/tables/table/auth-error.hbs| 35 ++ .../database/tables/table/auth-loading.hbs | 23 ++ .../databases/database/tables/table/auth.hbs| 53 .../views/hive20/src/main/resources/view.xml| 33 ++ 16 files changed, 677 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/552c418b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/MetaDataManager.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/MetaDataManager.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/MetaDataManager.java index 43733e4..525ec0d 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/MetaDataManager.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/MetaDataManager.java @@ -69,15 +69,15 @@ public class MetaDataManager extends HiveActor { ActorRef databaseManager = databaseManagers.get(message.getUsername()); if (databaseManager == null) { databaseManager = createDatabaseManager(message.getUsername(), message.getInstanceName()); - databaseManagers.put(context.getUsername(), databaseManager); - databaseManager.tell(new DatabaseManager.Refresh(context.getUsername()), getSelf()); + databaseManagers.put(message.getUsername(), databaseManager); + databaseManager.tell(new DatabaseManager.Refresh(message.getUsername()), getSelf()); } else { if(message.isImmediate()) { -databaseManager.tell(new DatabaseManager.Refresh(context.getUsername(), false), getSelf()); +databaseManager.tell(new DatabaseManager.Refresh(message.getUsername(), false), getSelf()); } cancelTerminationScheduler(message.getUsername()); } -scheduleTermination(context.getUsername()); +scheduleTermination(message.getUsername()); } private void handleTerminate(Terminate message) { http://git-wip-us.apache.org/repos/asf/ambari/blob/552c418b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/SystemService.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/SystemService.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/SystemService.java index 0afe43c..1399ee4 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/SystemService.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/system/SystemService.java @@ -22,16 +22,29 @@ import akka.actor.ActorRef; import org.apache.ambari.view.hive20.BaseService; import org.apache.ambari.view.hive20.ConnectionSystem; import org.apache.ambari.view.hive20.actor.message.Ping; +import org.apache.ambari.view.hive20.resources.system.ranger.RangerService; +import org.json.simple.JSONObject; +import javax.inject.Inject; +import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.Path; +import javax.ws.rs.QueryParam; import javax.ws.rs.core.Response; +import java.util.List; /** * System services which are required for the working of the application */ public class SystemService extends BaseService { + private final RangerService rangerService; + + @Inject + public Sys
ambari git commit: AMBARI-19443. Hive View 2.0: Ability to delete a database from UI. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk 8152afcf0 -> 6483710a2 AMBARI-19443. Hive View 2.0: Ability to delete a database from UI. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/6483710a Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6483710a Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6483710a Branch: refs/heads/trunk Commit: 6483710a28ec72ead21d44b13e02be268e229a16 Parents: 8152afc Author: Dipayan Bhowmick Authored: Thu Jan 12 00:03:06 2017 +0530 Committer: Dipayan Bhowmick Committed: Thu Jan 12 00:03:55 2017 +0530 -- .../hive20/resources/browser/DDLService.java| 2 +- .../main/resources/ui/app/adapters/database.js | 4 ++ .../ui/app/components/confirm-dialog.js | 46 .../ui/app/components/database-drop-confirm.js | 32 -- .../ui/app/components/database-not-empty.js | 29 .../resources/ui/app/components/info-dialog.js | 38 .../main/resources/ui/app/routes/databases.js | 43 +++--- .../resources/ui/app/routes/databases/index.js | 1 + .../ui/app/services/table-operations.js | 11 + .../app/templates/components/confirm-dialog.hbs | 39 + .../components/database-drop-confirm.hbs| 37 .../templates/components/database-not-empty.hbs | 38 .../ui/app/templates/components/info-dialog.hbs | 38 .../resources/ui/app/templates/databases.hbs| 41 +++-- 14 files changed, 253 insertions(+), 146 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/6483710a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLService.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLService.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLService.java index b82dd3f..e142baf 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLService.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLService.java @@ -103,7 +103,7 @@ public class DDLService extends BaseService { job = proxy.deleteDatabase(databaseId, getResourceManager()); JSONObject response = new JSONObject(); response.put("job", job); - return Response.status(Response.Status.ACCEPTED).entity(job).build(); + return Response.status(Response.Status.ACCEPTED).entity(response).build(); } catch (ServiceException e) { LOG.error("Exception occurred while delete database {}", databaseId, e); throw new ServiceFormattedException(e); http://git-wip-us.apache.org/repos/asf/ambari/blob/6483710a/contrib/views/hive20/src/main/resources/ui/app/adapters/database.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/adapters/database.js b/contrib/views/hive20/src/main/resources/ui/app/adapters/database.js index 6594309..6333ae6 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/adapters/database.js +++ b/contrib/views/hive20/src/main/resources/ui/app/adapters/database.js @@ -19,4 +19,8 @@ import DDLAdapter from './ddl'; export default DDLAdapter.extend({ + deleteDatabase(databaseName) { +let deletURL = this.urlForFindRecord(databaseName, 'database'); +return this.ajax(deletURL, 'DELETE'); + } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/6483710a/contrib/views/hive20/src/main/resources/ui/app/components/confirm-dialog.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/confirm-dialog.js b/contrib/views/hive20/src/main/resources/ui/app/components/confirm-dialog.js new file mode 100644 index 000..9935254 --- /dev/null +++ b/contrib/views/hive20/src/main/resources/ui/app/components/confirm-dialog.js @@ -0,0 +1,46 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDIT
ambari git commit: AMBARI-19443. Hive View 2.0: Ability to delete a database from UI. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 0b3058d4d -> 0378a6f04 AMBARI-19443. Hive View 2.0: Ability to delete a database from UI. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0378a6f0 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0378a6f0 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0378a6f0 Branch: refs/heads/branch-2.5 Commit: 0378a6f04110b864e3a0265b56daecac481fcd51 Parents: 0b3058d Author: Dipayan Bhowmick Authored: Thu Jan 12 00:03:06 2017 +0530 Committer: Dipayan Bhowmick Committed: Thu Jan 12 00:03:06 2017 +0530 -- .../hive20/resources/browser/DDLService.java| 2 +- .../main/resources/ui/app/adapters/database.js | 4 ++ .../ui/app/components/confirm-dialog.js | 46 .../ui/app/components/database-drop-confirm.js | 32 -- .../ui/app/components/database-not-empty.js | 29 .../resources/ui/app/components/info-dialog.js | 38 .../main/resources/ui/app/routes/databases.js | 43 +++--- .../resources/ui/app/routes/databases/index.js | 1 + .../ui/app/services/table-operations.js | 11 + .../app/templates/components/confirm-dialog.hbs | 39 + .../components/database-drop-confirm.hbs| 37 .../templates/components/database-not-empty.hbs | 38 .../ui/app/templates/components/info-dialog.hbs | 38 .../resources/ui/app/templates/databases.hbs| 41 +++-- 14 files changed, 253 insertions(+), 146 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/0378a6f0/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLService.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLService.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLService.java index b82dd3f..e142baf 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLService.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLService.java @@ -103,7 +103,7 @@ public class DDLService extends BaseService { job = proxy.deleteDatabase(databaseId, getResourceManager()); JSONObject response = new JSONObject(); response.put("job", job); - return Response.status(Response.Status.ACCEPTED).entity(job).build(); + return Response.status(Response.Status.ACCEPTED).entity(response).build(); } catch (ServiceException e) { LOG.error("Exception occurred while delete database {}", databaseId, e); throw new ServiceFormattedException(e); http://git-wip-us.apache.org/repos/asf/ambari/blob/0378a6f0/contrib/views/hive20/src/main/resources/ui/app/adapters/database.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/adapters/database.js b/contrib/views/hive20/src/main/resources/ui/app/adapters/database.js index 6594309..6333ae6 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/adapters/database.js +++ b/contrib/views/hive20/src/main/resources/ui/app/adapters/database.js @@ -19,4 +19,8 @@ import DDLAdapter from './ddl'; export default DDLAdapter.extend({ + deleteDatabase(databaseName) { +let deletURL = this.urlForFindRecord(databaseName, 'database'); +return this.ajax(deletURL, 'DELETE'); + } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/0378a6f0/contrib/views/hive20/src/main/resources/ui/app/components/confirm-dialog.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/confirm-dialog.js b/contrib/views/hive20/src/main/resources/ui/app/components/confirm-dialog.js new file mode 100644 index 000..9935254 --- /dev/null +++ b/contrib/views/hive20/src/main/resources/ui/app/components/confirm-dialog.js @@ -0,0 +1,46 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES
ambari git commit: AMBARI-19379. Hive View 2.0: Ability to delete a table from UI. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk 03cd5cedb -> 901b56df2 AMBARI-19379. Hive View 2.0: Ability to delete a table from UI. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/901b56df Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/901b56df Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/901b56df Branch: refs/heads/trunk Commit: 901b56df2900688b6d5993eca95c4efe3148635e Parents: 03cd5ce Author: Dipayan Bhowmick Authored: Mon Jan 9 11:43:36 2017 +0530 Committer: Dipayan Bhowmick Committed: Mon Jan 9 11:45:04 2017 +0530 -- .../ambari/view/hive20/ConnectionSystem.java| 4 + .../view/hive20/actor/DatabaseManager.java | 44 - .../ambari/view/hive20/actor/JdbcConnector.java | 6 + .../view/hive20/actor/MetaDataManager.java | 3 + .../view/hive20/actor/MetaDataRetriever.java| 12 +- .../ambari/view/hive20/actor/message/Ping.java | 10 + .../hive20/resources/browser/DDLService.java| 4 +- .../utils/MetaDataManagerEventSubmitter.java| 43 + .../src/main/resources/ui/app/adapters/table.js | 7 +- .../ui/app/routes/databases/database/tables.js | 5 + .../app/routes/databases/database/tables/new.js | 25 ++- .../routes/databases/database/tables/table.js | 53 - .../resources/ui/app/services/create-table.js | 182 - .../ui/app/services/table-operations.js | 193 +++ .../app/templates/components/jobs-browser.hbs | 2 +- .../databases/database/tables/table.hbs | 20 +- .../databases/database/tables/table/details.hbs | 2 +- .../databases/database/tables/table/storage.hbs | 2 +- 18 files changed, 411 insertions(+), 206 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/901b56df/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/ConnectionSystem.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/ConnectionSystem.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/ConnectionSystem.java index 40b4c04..a6c7334 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/ConnectionSystem.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/ConnectionSystem.java @@ -124,6 +124,10 @@ public class ConnectionSystem { return metaDataManager; } + public synchronized Optional getMetaDataManagerIfPresent(String instanceName) { +return Optional.fromNullable(metaDataManagerMap.get(instanceName)); + } + private ActorRef createMetaDataManager(SafeViewContext safeViewContext) { return actorSystem.actorOf(MetaDataManager.props(safeViewContext)); } http://git-wip-us.apache.org/repos/asf/ambari/blob/901b56df/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/DatabaseManager.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/DatabaseManager.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/DatabaseManager.java index 6dc4ad9..bd7c6bd 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/DatabaseManager.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/DatabaseManager.java @@ -75,7 +75,7 @@ public class DatabaseManager extends HiveActor { Object message = hiveMessage.getMessage(); if (message instanceof Refresh) { - handleRefresh(); + handleRefresh((Refresh) message); } else if (message instanceof SelfRefresh) { handleSelfRefresh(); } else if (message instanceof MetaDataRetriever.DBRefreshed) { @@ -83,7 +83,7 @@ public class DatabaseManager extends HiveActor { } else if (message instanceof MetaDataRetriever.TableRefreshed) { handleTableRefreshed((MetaDataRetriever.TableRefreshed) message); } else if (message instanceof MetaDataRetriever.AllTableRefreshed) { - handleAllTableRefeshed((MetaDataRetriever.AllTableRefreshed) message); + handleAllTableRefreshed((MetaDataRetriever.AllTableRefreshed) message); } else if (message instanceof GetDatabases) { handleGetDatabases((GetDatabases) message); } @@ -96,11 +96,11 @@ public class DatabaseManager extends HiveActor { getSelf(), new SelfRefresh(), getContext().dispatcher(), getSelf()); } else { selfRefreshQueued = false; - refresh(); + refresh(true); } } - private void handleRefresh() { + private void handleRefresh(Refresh message) { if (refreshInProgress && selfRefreshQueued) { return; // We will not honor refresh message when a refresh is going o
ambari git commit: AMBARI-19379. Hive View 2.0: Ability to delete a table from UI. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 d346558c1 -> 1e2fe429b AMBARI-19379. Hive View 2.0: Ability to delete a table from UI. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1e2fe429 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1e2fe429 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1e2fe429 Branch: refs/heads/branch-2.5 Commit: 1e2fe429b88e1963d1cf40285dd5cf248fc556fd Parents: d346558 Author: Dipayan Bhowmick Authored: Mon Jan 9 11:43:36 2017 +0530 Committer: Dipayan Bhowmick Committed: Mon Jan 9 11:43:36 2017 +0530 -- .../ambari/view/hive20/ConnectionSystem.java| 4 + .../view/hive20/actor/DatabaseManager.java | 44 - .../ambari/view/hive20/actor/JdbcConnector.java | 6 + .../view/hive20/actor/MetaDataManager.java | 3 + .../view/hive20/actor/MetaDataRetriever.java| 12 +- .../ambari/view/hive20/actor/message/Ping.java | 10 + .../hive20/resources/browser/DDLService.java| 4 +- .../utils/MetaDataManagerEventSubmitter.java| 43 + .../src/main/resources/ui/app/adapters/table.js | 7 +- .../ui/app/routes/databases/database/tables.js | 5 + .../app/routes/databases/database/tables/new.js | 25 ++- .../routes/databases/database/tables/table.js | 53 - .../resources/ui/app/services/create-table.js | 182 - .../ui/app/services/table-operations.js | 193 +++ .../app/templates/components/jobs-browser.hbs | 2 +- .../databases/database/tables/table.hbs | 20 +- .../databases/database/tables/table/details.hbs | 2 +- .../databases/database/tables/table/storage.hbs | 2 +- 18 files changed, 411 insertions(+), 206 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/1e2fe429/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/ConnectionSystem.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/ConnectionSystem.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/ConnectionSystem.java index 40b4c04..a6c7334 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/ConnectionSystem.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/ConnectionSystem.java @@ -124,6 +124,10 @@ public class ConnectionSystem { return metaDataManager; } + public synchronized Optional getMetaDataManagerIfPresent(String instanceName) { +return Optional.fromNullable(metaDataManagerMap.get(instanceName)); + } + private ActorRef createMetaDataManager(SafeViewContext safeViewContext) { return actorSystem.actorOf(MetaDataManager.props(safeViewContext)); } http://git-wip-us.apache.org/repos/asf/ambari/blob/1e2fe429/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/DatabaseManager.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/DatabaseManager.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/DatabaseManager.java index 6dc4ad9..bd7c6bd 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/DatabaseManager.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/DatabaseManager.java @@ -75,7 +75,7 @@ public class DatabaseManager extends HiveActor { Object message = hiveMessage.getMessage(); if (message instanceof Refresh) { - handleRefresh(); + handleRefresh((Refresh) message); } else if (message instanceof SelfRefresh) { handleSelfRefresh(); } else if (message instanceof MetaDataRetriever.DBRefreshed) { @@ -83,7 +83,7 @@ public class DatabaseManager extends HiveActor { } else if (message instanceof MetaDataRetriever.TableRefreshed) { handleTableRefreshed((MetaDataRetriever.TableRefreshed) message); } else if (message instanceof MetaDataRetriever.AllTableRefreshed) { - handleAllTableRefeshed((MetaDataRetriever.AllTableRefreshed) message); + handleAllTableRefreshed((MetaDataRetriever.AllTableRefreshed) message); } else if (message instanceof GetDatabases) { handleGetDatabases((GetDatabases) message); } @@ -96,11 +96,11 @@ public class DatabaseManager extends HiveActor { getSelf(), new SelfRefresh(), getContext().dispatcher(), getSelf()); } else { selfRefreshQueued = false; - refresh(); + refresh(true); } } - private void handleRefresh() { + private void handleRefresh(Refresh message) { if (refreshInProgress && selfRefreshQueued) { return; // We will not honor refresh message when a refresh
ambari git commit: AMBARI-19036. Add default roles to auto created views. (Ashwin Rajeev via dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk b2d2ef168 -> 8fbc2718e AMBARI-19036. Add default roles to auto created views. (Ashwin Rajeev via dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8fbc2718 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8fbc2718 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8fbc2718 Branch: refs/heads/trunk Commit: 8fbc2718e65a3771a6af9acc48f1b06d13c32bd4 Parents: b2d2ef1 Author: Dipayan Bhowmick Authored: Tue Dec 6 01:01:43 2016 +0530 Committer: Dipayan Bhowmick Committed: Tue Dec 6 01:03:08 2016 +0530 -- .../src/main/resources/view.xml | 23 +++- contrib/views/files/src/main/resources/view.xml | 7 ++ .../views/hive-next/src/main/resources/view.xml | 7 ++ contrib/views/tez/src/main/resources/view.xml | 7 ++ 4 files changed, 34 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/8fbc2718/contrib/views/capacity-scheduler/src/main/resources/view.xml -- diff --git a/contrib/views/capacity-scheduler/src/main/resources/view.xml b/contrib/views/capacity-scheduler/src/main/resources/view.xml index 84a9ee0..cba243c 100644 --- a/contrib/views/capacity-scheduler/src/main/resources/view.xml +++ b/contrib/views/capacity-scheduler/src/main/resources/view.xml @@ -23,19 +23,22 @@ 2.1.* AMBARI-ONLY - - scheduler - org.apache.ambari.view.capacityscheduler.CapacitySchedulerService + +scheduler + org.apache.ambari.view.capacityscheduler.CapacitySchedulerService - AUTO_CS_INSTANCE - YARN Queue Manager - Manage YARN Capacity Scheduler Queues - HDP-2.* - -YARN - +AUTO_CS_INSTANCE +YARN Queue Manager +Manage YARN Capacity Scheduler Queues +HDP-2.* + +YARN + + +CLUSTER.ADMINISTRATOR + http://git-wip-us.apache.org/repos/asf/ambari/blob/8fbc2718/contrib/views/files/src/main/resources/view.xml -- diff --git a/contrib/views/files/src/main/resources/view.xml b/contrib/views/files/src/main/resources/view.xml index d6b2fde..640cee9 100644 --- a/contrib/views/files/src/main/resources/view.xml +++ b/contrib/views/files/src/main/resources/view.xml @@ -155,5 +155,12 @@ HDFS + +CLUSTER.ADMINISTRATOR +CLUSTER.OPERATOR +SERVICE.ADMINISTRATOR +SERVICE.OPERATOR +CLUSTER.USER + http://git-wip-us.apache.org/repos/asf/ambari/blob/8fbc2718/contrib/views/hive-next/src/main/resources/view.xml -- diff --git a/contrib/views/hive-next/src/main/resources/view.xml b/contrib/views/hive-next/src/main/resources/view.xml index 02e632c..1107cd1 100644 --- a/contrib/views/hive-next/src/main/resources/view.xml +++ b/contrib/views/hive-next/src/main/resources/view.xml @@ -337,5 +337,12 @@ HIVE + +CLUSTER.ADMINISTRATOR +CLUSTER.OPERATOR +SERVICE.ADMINISTRATOR +SERVICE.OPERATOR +CLUSTER.USER + http://git-wip-us.apache.org/repos/asf/ambari/blob/8fbc2718/contrib/views/tez/src/main/resources/view.xml -- diff --git a/contrib/views/tez/src/main/resources/view.xml b/contrib/views/tez/src/main/resources/view.xml index 2bb2bb0..41ffdbc 100644 --- a/contrib/views/tez/src/main/resources/view.xml +++ b/contrib/views/tez/src/main/resources/view.xml @@ -91,5 +91,12 @@ limitations under the License. Kerberos, LDAP, Custom. Binary/Htt TEZ + + CLUSTER.ADMINISTRATOR + CLUSTER.OPERATOR + SERVICE.ADMINISTRATOR + SERVICE.OPERATOR + CLUSTER.USER +
ambari git commit: AMBARI-19036. Add default roles to auto created views. (Ashwin Rajeev via dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 cae500898 -> 829304fbc AMBARI-19036. Add default roles to auto created views. (Ashwin Rajeev via dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/829304fb Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/829304fb Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/829304fb Branch: refs/heads/branch-2.5 Commit: 829304fbcdcfbbc1fd0e5d189eeed5758dd144f4 Parents: cae5008 Author: Dipayan Bhowmick Authored: Tue Dec 6 01:01:43 2016 +0530 Committer: Dipayan Bhowmick Committed: Tue Dec 6 01:01:43 2016 +0530 -- .../src/main/resources/view.xml | 23 +++- contrib/views/files/src/main/resources/view.xml | 7 ++ .../views/hive-next/src/main/resources/view.xml | 7 ++ contrib/views/tez/src/main/resources/view.xml | 7 ++ 4 files changed, 34 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/829304fb/contrib/views/capacity-scheduler/src/main/resources/view.xml -- diff --git a/contrib/views/capacity-scheduler/src/main/resources/view.xml b/contrib/views/capacity-scheduler/src/main/resources/view.xml index 84a9ee0..cba243c 100644 --- a/contrib/views/capacity-scheduler/src/main/resources/view.xml +++ b/contrib/views/capacity-scheduler/src/main/resources/view.xml @@ -23,19 +23,22 @@ 2.1.* AMBARI-ONLY - - scheduler - org.apache.ambari.view.capacityscheduler.CapacitySchedulerService + +scheduler + org.apache.ambari.view.capacityscheduler.CapacitySchedulerService - AUTO_CS_INSTANCE - YARN Queue Manager - Manage YARN Capacity Scheduler Queues - HDP-2.* - -YARN - +AUTO_CS_INSTANCE +YARN Queue Manager +Manage YARN Capacity Scheduler Queues +HDP-2.* + +YARN + + +CLUSTER.ADMINISTRATOR + http://git-wip-us.apache.org/repos/asf/ambari/blob/829304fb/contrib/views/files/src/main/resources/view.xml -- diff --git a/contrib/views/files/src/main/resources/view.xml b/contrib/views/files/src/main/resources/view.xml index d6b2fde..640cee9 100644 --- a/contrib/views/files/src/main/resources/view.xml +++ b/contrib/views/files/src/main/resources/view.xml @@ -155,5 +155,12 @@ HDFS + +CLUSTER.ADMINISTRATOR +CLUSTER.OPERATOR +SERVICE.ADMINISTRATOR +SERVICE.OPERATOR +CLUSTER.USER + http://git-wip-us.apache.org/repos/asf/ambari/blob/829304fb/contrib/views/hive-next/src/main/resources/view.xml -- diff --git a/contrib/views/hive-next/src/main/resources/view.xml b/contrib/views/hive-next/src/main/resources/view.xml index 02e632c..1107cd1 100644 --- a/contrib/views/hive-next/src/main/resources/view.xml +++ b/contrib/views/hive-next/src/main/resources/view.xml @@ -337,5 +337,12 @@ HIVE + +CLUSTER.ADMINISTRATOR +CLUSTER.OPERATOR +SERVICE.ADMINISTRATOR +SERVICE.OPERATOR +CLUSTER.USER + http://git-wip-us.apache.org/repos/asf/ambari/blob/829304fb/contrib/views/tez/src/main/resources/view.xml -- diff --git a/contrib/views/tez/src/main/resources/view.xml b/contrib/views/tez/src/main/resources/view.xml index 2bb2bb0..41ffdbc 100644 --- a/contrib/views/tez/src/main/resources/view.xml +++ b/contrib/views/tez/src/main/resources/view.xml @@ -91,5 +91,12 @@ limitations under the License. Kerberos, LDAP, Custom. Binary/Htt TEZ + + CLUSTER.ADMINISTRATOR + CLUSTER.OPERATOR + SERVICE.ADMINISTRATOR + SERVICE.OPERATOR + CLUSTER.USER +
ambari git commit: AMBARI-18913. Hive view service check fails first time after server restart. (Ashwin Rajeev via dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.4 9fd886dbf -> 37f7815e5 AMBARI-18913. Hive view service check fails first time after server restart. (Ashwin Rajeev via dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/37f7815e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/37f7815e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/37f7815e Branch: refs/heads/branch-2.4 Commit: 37f7815e57e0dec6d2ff230aacc4b2d99cf681a9 Parents: 9fd886d Author: Dipayan Bhowmick Authored: Fri Nov 18 00:42:26 2016 +0530 Committer: Dipayan Bhowmick Committed: Fri Nov 18 00:45:50 2016 +0530 -- .../resources/ui/hive-web/app/routes/splash.js | 56 +++- 1 file changed, 30 insertions(+), 26 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/37f7815e/contrib/views/hive-next/src/main/resources/ui/hive-web/app/routes/splash.js -- diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/routes/splash.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/routes/splash.js index e2601f9..179a912 100644 --- a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/routes/splash.js +++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/routes/splash.js @@ -44,56 +44,60 @@ export default Ember.Route.extend({ var self = this; function loadView(){ - controller.startTests().then(function() { + if (model.get("hiveserverTest") +&& model.get("hdfsTest") +&& model.get("atsTest") +&& model.get("userhomeTest")) { +Ember.run.later(this, function() { + self.send('transition'); +}, 2000); + } + +} -if (model.get("hiveserverTest") -&& model.get("hdfsTest") -&& model.get("atsTest") -&& model.get("userhomeTest")) { - Ember.run.later(this, function() { -self.send('transition'); - }, 2000); -} - }); -} -controller.checkConnection().then(function(){ - var percent = model.get('percent'); - model.set("hiveserverTest",true); - model.set("hiveserver" + 'TestDone', true); - model.set('percent', percent + 25); - loadView(); -},function(){ -if(model.get('ldapFailure')) { +function checkHive() { + controller.checkConnection().then(function () { +var percent = model.get('percent'); +model.set("hiveserverTest", true); +model.set("hiveserver" + 'TestDone', true); +model.set('percent', percent + 25); +loadView(); + }, function () { +if (model.get('ldapFailure')) { var percent = model.get('percent'); - controller.requestLdapPassword(function(){ + controller.requestLdapPassword(function () { // check the connection again -controller.checkConnection().then(function(){ - model.set("hiveserverTest",true); +controller.checkConnection().then(function () { + model.set("hiveserverTest", true); model.set("hiveserver" + 'TestDone', true); model.set('percent', percent + 25); loadView(); -},function(){ +}, function () { var percent = model.get('percent'); var checkFailedMessage = "Hive authentication failed"; var errors = controller.get("errors"); errors += checkFailedMessage; errors += ''; controller.set("errors", errors); - model.get("hiveserverTest",false); + model.get("hiveserverTest", false); model.set("hiveserver" + 'TestDone', true); model.set('percent', percent + 25); loadView(); }); }); } else { - model.get("hiveserverTest",false); + model.get("hiveserverTest", false); model.set("hiveserver" + 'TestDone', true); model.set('percent', model.get('percent') + 25); loadView(); } -}); + }); +} +controller.startTests().then(function() { + checkHive(); +}); },