git commit: AMBARI-6647. Ambari starts hiveserver2 in remote thrift metastore mode due to passing hive.metastore.uris=, .(vbrodetskyi)
Repository: ambari Updated Branches: refs/heads/trunk 9986f6c15 - 7d2c4f00f AMBARI-6647. Ambari starts hiveserver2 in remote thrift metastore mode due to passing hive.metastore.uris=,.(vbrodetskyi) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7d2c4f00 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7d2c4f00 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7d2c4f00 Branch: refs/heads/trunk Commit: 7d2c4f00f0c2652f6429473f44efb4c72b86710f Parents: 9986f6c Author: Vitaly Brodetskyi vbrodets...@hortonworks.com Authored: Tue Jul 29 10:40:56 2014 +0300 Committer: Vitaly Brodetskyi vbrodets...@hortonworks.com Committed: Tue Jul 29 10:40:56 2014 +0300 -- .../2.0.6/services/HIVE/package/templates/startHiveserver2.sh.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/7d2c4f00/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/templates/startHiveserver2.sh.j2 -- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/templates/startHiveserver2.sh.j2 b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/templates/startHiveserver2.sh.j2 index 62ab19e..a8fe21c 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/templates/startHiveserver2.sh.j2 +++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/templates/startHiveserver2.sh.j2 @@ -19,11 +19,11 @@ # # -HIVE_SERVER2_OPTS= -hiveconf hive.metastore.uris=\ \ -hiveconf hive.log.file=hiveserver2.log -hiveconf hive.log.dir=$5 +HIVE_SERVER2_OPTS= -hiveconf hive.log.file=hiveserver2.log -hiveconf hive.log.dir=$5 {% if hive_authorization_enabled == True and str(hdp_stack_version).startswith('2.1') %} # HiveServer 2 -hiveconf options HIVE_SERVER2_OPTS=${HIVE_SERVER2_OPTS} -hiveconf hive.security.authenticator.manager=org.apache.hadoop.hive.ql.security.SessionStateUserAuthenticator -hiveconf hive.security.authorization.manager=org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory {% endif %} -HIVE_CONF_DIR=$4 /usr/lib/hive/bin/hiveserver2 ${HIVE_SERVER2_OPTS} $1 2 $2 +HIVE_CONF_DIR=$4 /usr/lib/hive/bin/hiveserver2 -hiveconf hive.metastore.uris= ${HIVE_SERVER2_OPTS} $1 2 $2 echo $!|cat$3
git commit: AMBARI-6649 Case in HCatalog from service name. (Max Shepel via atkach)
Repository: ambari Updated Branches: refs/heads/trunk 05e5476c7 - 569acf801 AMBARI-6649 Case in HCatalog from service name. (Max Shepel via atkach) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/569acf80 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/569acf80 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/569acf80 Branch: refs/heads/trunk Commit: 569acf80142937e6da57eb8b75a848bf41fbc9fa Parents: 05e5476 Author: atkach atk...@hortonworks.com Authored: Tue Jul 29 12:44:46 2014 +0300 Committer: atkach atk...@hortonworks.com Committed: Tue Jul 29 12:44:46 2014 +0300 -- ambari-web/app/utils/helper.js | 1 + ambari-web/test/utils/helper_test.js | 1 + 2 files changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/569acf80/ambari-web/app/utils/helper.js -- diff --git a/ambari-web/app/utils/helper.js b/ambari-web/app/utils/helper.js index e6a8060..61d6e03 100644 --- a/ambari-web/app/utils/helper.js +++ b/ambari-web/app/utils/helper.js @@ -326,6 +326,7 @@ App.format = { 'HBASE': 'HBase', 'HBASE_REGIONSERVER': 'RegionServer', 'HCAT': 'HCat', +'HCATALOG': 'HCatalog', 'HDFS': 'HDFS', 'HISTORYSERVER': 'History Server', 'HIVE_SERVER': 'HiveServer2', http://git-wip-us.apache.org/repos/asf/ambari/blob/569acf80/ambari-web/test/utils/helper_test.js -- diff --git a/ambari-web/test/utils/helper_test.js b/ambari-web/test/utils/helper_test.js index 27b1c2f..9efb06b 100644 --- a/ambari-web/test/utils/helper_test.js +++ b/ambari-web/test/utils/helper_test.js @@ -229,6 +229,7 @@ describe('utils/helper', function() { 'HBASE_REGIONSERVER': 'RegionServer', 'HBASE_SERVICE_CHECK': 'HBase Service Check', 'HCAT': 'HCat', + 'HCATALOG': 'HCatalog', 'HCAT_SERVICE_CHECK': 'HCat Service Check', 'HDFS': 'HDFS', 'HDFS_CLIENT': 'HDFS Client',
[2/2] git commit: AMBARI-6651. Create job-details page. (onechiporenko)
AMBARI-6651. Create job-details page. (onechiporenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/85362043 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/85362043 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/85362043 Branch: refs/heads/trunk Commit: 85362043f7365fe59c2900284ef12057f00cf0b1 Parents: 569acf8 Author: Oleg Nechiporenko onechipore...@apache.org Authored: Tue Jul 29 14:58:06 2014 +0300 Committer: Oleg Nechiporenko onechipore...@apache.org Committed: Tue Jul 29 14:58:06 2014 +0300 -- .../jobs/src/main/resources/ui/Gruntfile.js | 6 + .../jobs/src/main/resources/ui/app/index.html | 4 + .../src/main/resources/ui/app/scripts/app.js| 14 +- .../app/scripts/controllers/job_controller.js | 87 +- .../resources/ui/app/scripts/helpers/ajax.js| 24 + .../resources/ui/app/scripts/helpers/jobs.js| 255 + .../resources/ui/app/scripts/helpers/number.js | 36 +- .../resources/ui/app/scripts/helpers/string.js | 59 ++ .../app/scripts/mappers/jobs/hive_job_mapper.js | 58 +- .../scripts/mappers/jobs/hive_jobs_mapper.js| 4 + .../ui/app/scripts/models/jobs/hive_job.js | 6 +- .../ui/app/scripts/models/jobs/tez_dag.js | 105 ++- .../src/main/resources/ui/app/scripts/router.js | 2 +- .../ui/app/scripts/routes/application_route.js | 13 +- .../resources/ui/app/scripts/translations.js| 37 +- .../views/job/hive_job_details_tez_dag_view.js | 925 +++ .../scripts/views/job/hive_job_details_view.js | 327 +++ .../resources/ui/app/scripts/views/job_view.js | 19 - .../resources/ui/app/scripts/views/jobs_view.js | 6 +- .../src/main/resources/ui/app/styles/main.less | 353 ++- .../ui/app/templates/job/error_popup.hbs| 19 + .../templates/job/hive_job_details_tez_dag.hbs | 44 + .../ui/app/templates/job/hover_op_table.hbs | 39 + .../main/resources/ui/app/templates/job/job.hbs | 228 + .../views/jobs/src/main/resources/ui/bower.json | 4 +- 25 files changed, 2537 insertions(+), 137 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/85362043/contrib/views/jobs/src/main/resources/ui/Gruntfile.js -- diff --git a/contrib/views/jobs/src/main/resources/ui/Gruntfile.js b/contrib/views/jobs/src/main/resources/ui/Gruntfile.js index 444acb1..d223202 100644 --- a/contrib/views/jobs/src/main/resources/ui/Gruntfile.js +++ b/contrib/views/jobs/src/main/resources/ui/Gruntfile.js @@ -267,6 +267,12 @@ module.exports = function (grunt) { flatten: true, src: '%= yeoman.app %/bower_components/jquery-ui/themes/base/images/*', dest: '%= yeoman.dist %/styles/images/' + }, + { +expand: true, +flatten: true, +src: '%= yeoman.app %/bower_components/font-awesome/font/*', +dest: '%= yeoman.dist %/font/' } ] } http://git-wip-us.apache.org/repos/asf/ambari/blob/85362043/contrib/views/jobs/src/main/resources/ui/app/index.html -- diff --git a/contrib/views/jobs/src/main/resources/ui/app/index.html b/contrib/views/jobs/src/main/resources/ui/app/index.html index f5ae0de..feb8bcb 100644 --- a/contrib/views/jobs/src/main/resources/ui/app/index.html +++ b/contrib/views/jobs/src/main/resources/ui/app/index.html @@ -27,7 +27,10 @@ /head body !-- build:js(app) scripts/components.js -- +script src=bower_components/cldr/plurals.js/script script src=bower_components/jquery/jquery.js/script +script src=bower_components/bootstrap/js/bootstrap-dropdown.js/script +script src=bower_components/bootstrap/js/bootstrap-button.js/script script src=bower_components/bootstrap/js/bootstrap-tooltip.js/script script src=bower_components/jquery-ui/ui/datepicker.js/script script src=bower_components/moment/moment.js/script @@ -39,6 +42,7 @@ script src=bower_components/ember-addons.bs_for_ember/dist/js/bs-core.min.js/script script src=bower_components/ember-addons.bs_for_ember/dist/js/bs-button.min.js/script script src=bower_components/ember-addons.bs_for_ember/dist/js/bs-modal.min.js/script +script src=bower_components/d3/d3.v2.js/script !-- endbuild -- !-- build:js(.tmp) scripts/templates.js -- http://git-wip-us.apache.org/repos/asf/ambari/blob/85362043/contrib/views/jobs/src/main/resources/ui/app/scripts/app.js -- diff --git a/contrib/views/jobs/src/main/resources/ui/app/scripts/app.js b/contrib/views/jobs/src/main/resources/ui/app/scripts/app.js index b7c6d2b..1067704 100644 ---
[1/2] AMBARI-6651. Create job-details page. (onechiporenko)
Repository: ambari Updated Branches: refs/heads/trunk 569acf801 - 85362043f http://git-wip-us.apache.org/repos/asf/ambari/blob/85362043/contrib/views/jobs/src/main/resources/ui/app/scripts/views/job/hive_job_details_view.js -- diff --git a/contrib/views/jobs/src/main/resources/ui/app/scripts/views/job/hive_job_details_view.js b/contrib/views/jobs/src/main/resources/ui/app/scripts/views/job/hive_job_details_view.js new file mode 100644 index 000..122f236 --- /dev/null +++ b/contrib/views/jobs/src/main/resources/ui/app/scripts/views/job/hive_job_details_view.js @@ -0,0 +1,327 @@ +/** + * 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. + */ + +App.JobView = Em.View.extend({ + + templateName: 'job/job', + + selectedVertex: null, + + content: null, + + zoomScaleFrom: 1, + + zoomScaleTo: 2, + + zoomScale: 1, + + showQuery: false, + + willInsertElement: function () { +this.get('controller').loadJobDetails(); + }, + + zoomStep: function () { +var zoomStep = 0.01; +var zoomFrom = this.get('zoomScaleFrom'); +var zoomTo = this.get('zoomScaleTo'); +if (zoomFrom zoomTo) { + zoomStep = (zoomTo - zoomFrom) / 5; +} +return zoomStep; + }.property('zoomScaleFrom', 'zoomScaleTo'), + + isGraphMaximized: false, + + actions: { + +doSelectSummaryMetricType: function (summaryType) { + switch (summaryType) { +case Em.I18n.t('jobs.hive.tez.metric.input'): + summaryType = 'input'; + break; +case Em.I18n.t('jobs.hive.tez.metric.output'): + summaryType = 'output'; + break; +case Em.I18n.t('jobs.hive.tez.metric.recordsRead'): + summaryType = 'recordsRead'; + break; +case Em.I18n.t('jobs.hive.tez.metric.recordsWrite'): + summaryType = 'recordsWrite'; + break; +case Em.I18n.t('jobs.hive.tez.metric.tezTasks'): + summaryType = 'tezTasks'; + break; +case Em.I18n.t('jobs.hive.tez.metric.spilledRecords'): + summaryType = 'spilledRecords'; + break; +default: + break; + } + this.set('summaryMetricType', summaryType); +}, + +toggleShowQuery: function () { + this.toggleProperty('showQuery'); + var queryBlock = $('.query-info'); + if (this.get('showQuery')) { +queryBlock.slideDown(); + } + else { +queryBlock.slideUp(); + } +}, + +actionDoSelectVertex: function (event, notTableClick) { + this.doSelectVertex(event, notTableClick); +}, + +doGraphZoomIn: function () { + var zoomTo = this.get('zoomScaleTo'), +zoomScale = this.get('zoomScale'), +zoomStep = this.get('zoomStep'); + if (zoomScale zoomTo) { +var step = Math.min(zoomStep, (zoomTo - zoomScale)); +zoomScale += step; +this.set('zoomScale', zoomScale); + } +}, + +doGraphZoomOut: function () { + var zoomFrom = this.get('zoomScaleFrom'), +zoomScale = this.get('zoomScale'), +zoomStep = this.get('zoomStep'); + if (zoomScale zoomFrom) { +var step = Math.min(zoomStep, (zoomScale - zoomFrom)); +zoomScale -= step; +this.set('zoomScale', zoomScale); + } +}, + +doGraphMaximize: function () { + this.set('isGraphMaximized', true); +}, + +doGraphMinimize: function () { + this.set('isGraphMaximized', false); +} + + }, + + toggleShowQueryText: function () { +return this.get('showQuery') ? Em.I18n.t('jobs.hive.less') : Em.I18n.t('jobs.hive.more'); + }.property('showQuery'), + + summaryMetricType: 'input', + + summaryMetricTypesDisplay: [ +Em.I18n.t('jobs.hive.tez.metric.input'), +Em.I18n.t('jobs.hive.tez.metric.output'), +/* Em.I18n.t('jobs.hive.tez.metric.recordsRead'), + Em.I18n.t('jobs.hive.tez.metric.recordsWrite'), */ +Em.I18n.t('jobs.hive.tez.metric.tezTasks'), +Em.I18n.t('jobs.hive.tez.metric.spilledRecords') + ], + + summaryMetricTypeDisplay: function () { +return Em.I18n.t('jobs.hive.tez.metric.' + this.get('summaryMetricType')); + }.property('summaryMetricType'), + + sortedVertices: function
[1/2] AMBARI-6627 - Views : Admin - Add custom permissions
Repository: ambari Updated Branches: refs/heads/trunk 85362043f - 11336361f http://git-wip-us.apache.org/repos/asf/ambari/blob/11336361/ambari-views/examples/pom.xml -- diff --git a/ambari-views/examples/pom.xml b/ambari-views/examples/pom.xml index 0951f19..4e93c35 100644 --- a/ambari-views/examples/pom.xml +++ b/ambari-views/examples/pom.xml @@ -29,6 +29,7 @@ modulephone-list-view/module modulecalculator-view/module moduleweather-view/module +modulerestricted-view/module /modules build pluginManagement http://git-wip-us.apache.org/repos/asf/ambari/blob/11336361/ambari-views/examples/restricted-view/docs/index.md -- diff --git a/ambari-views/examples/restricted-view/docs/index.md b/ambari-views/examples/restricted-view/docs/index.md new file mode 100644 index 000..78aced4 --- /dev/null +++ b/ambari-views/examples/restricted-view/docs/index.md @@ -0,0 +1,261 @@ +!--- +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](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. +-- + +Restricted View Example + +Description +- +The Restricted view is another simple view example. Like the HelloWorld view example, it demonstrates the basics of how to write and deploy a view in Ambari but also includes a couple of simple resources and a custom view permission. The Restricted resources use JAX-RS annotations to define the actions that can be performed on the resources. + +Package +- + +All views are packaged as a view archive. The view archive contains the configuration file and various optional components of the view. + +#view.xml + +The view.xml file is the only required file for a view archive. The view.xml is the configuration that describes the view and view instances for Ambari. + + view +nameRESTRICTED/name +labelThe Restricted View/label +version1.0.0/version +resource + namerestricted/name + service-classorg.apache.ambari.view.restricted.RestrictedResource/service-class +/resource +resource + nameunrestricted/name + service-classorg.apache.ambari.view.restricted.UnrestrictedResource/service-class +/resource +permission + nameRESTRICTED/name + description +Access permission for a restricted view resource. + /description +/permission +instance + nameINSTANCE_1/name +/instance + /view + +The configuration in this case defines a view named RESTRICTED that has a single instance. The view also defines a resource named 'unrestricted' and a resource name 'restricted'. + + + +#UnrestrictedResource.java + +The UnrestrictedResource class defines a simple resource for the view. It uses JAX-RS annotations to define the actions that can be performed on the resource. + +@GET +@Produces({text/html}) +public Response getUnrestricted() throws IOException{ + return Response.ok(bYou have accessed an unrestricted resource./b).type(text/html).build(); +} + +The getUnrestricted method will service requests to **'INSTANCE_1/resources/unrestricted'** for INSTANCE_1 of the RESTRICTED view. + +For example ... + + http://server:8080/api/v1/views/RESTRICTED/versions/1.0.0/instances/INSTANCE_1/resources/unrestricted + +#RestrictedResource.java + +The RestrictedResource class defines a simple resource for the view. It uses JAX-RS annotations to define the actions that can be performed on the resource. + +@GET +@Produces({text/html}) +public Response getRestricted() throws IOException{ + + String userName = context.getUsername(); + + try { +context.hasPermission(userName, RESTRICTED); + } catch (org.apache.ambari.view.SecurityException e) { +return Response.status(401).build(); + } + + return Response.ok(bYou have accessed a restricted resource./b).type(text/html).build(); +} + +The getRestricted method will service requests to **'INSTANCE_1/resources/restricted'** for INSTANCE_1 of the RESTRICTED view. + +For example ... + +
[2/2] git commit: AMBARI-6627 - Views : Admin - Add custom permissions
AMBARI-6627 - Views : Admin - Add custom permissions Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/11336361 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/11336361 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/11336361 Branch: refs/heads/trunk Commit: 11336361fa4b0e180961f29b95802bb51090c196 Parents: 8536204 Author: tbeerbower tbeerbo...@hortonworks.com Authored: Sun Jul 27 09:33:45 2014 -0400 Committer: tbeerbower tbeerbo...@hortonworks.com Committed: Tue Jul 29 08:01:54 2014 -0400 -- .../resources/ResourceInstanceFactoryImpl.java | 4 + .../ViewPermissionResourceDefinition.java | 58 + .../ViewVersionResourceDefinition.java | 7 +- .../api/services/ViewPermissionService.java | 185 + .../server/api/services/ViewVersionService.java | 13 + .../ambari/server/controller/AmbariServer.java | 7 +- .../internal/DefaultProviderModule.java | 2 + .../internal/PrivilegeResourceProvider.java | 23 +- .../ViewPermissionResourceProvider.java | 178 + .../ambari/server/controller/spi/Resource.java | 4 +- .../apache/ambari/server/orm/dao/MemberDAO.java | 9 +- .../ambari/server/orm/dao/PermissionDAO.java| 20 +- .../ambari/server/orm/dao/PrivilegeDAO.java | 25 +- .../server/orm/entities/PermissionEntity.java | 15 +- .../server/orm/entities/ResourceTypeEntity.java | 21 ++ .../ambari/server/orm/entities/ViewEntity.java | 47 .../ambari/server/view/ViewContextImpl.java | 43 ++- .../apache/ambari/server/view/ViewRegistry.java | 172 +--- .../view/configuration/PermissionConfig.java| 39 +++ .../server/view/configuration/ViewConfig.java | 15 ++ .../main/resources/Ambari-DDL-MySQL-CREATE.sql | 1 + .../main/resources/Ambari-DDL-Oracle-CREATE.sql | 1 + .../resources/Ambari-DDL-Postgres-CREATE.sql| 1 + .../Ambari-DDL-Postgres-EMBEDDED-CREATE.sql | 1 + .../ViewPermissionResourceDefinitionTest.java | 49 .../ViewVersionResourceDefinitionTest.java | 7 +- .../api/services/ViewPermissionServiceTest.java | 100 +++ .../ambari/server/view/ViewRegistryTest.java| 70 +++-- .../configuration/PermissionConfigTest.java | 69 + ambari-views/examples/pom.xml | 1 + .../examples/restricted-view/docs/index.md | 261 +++ ambari-views/examples/restricted-view/pom.xml | 89 +++ .../view/restricted/RestrictedResource.java | 57 .../view/restricted/UnrestrictedResource.java | 49 .../restricted-view/src/main/resources/view.xml | 38 +++ .../apache/ambari/view/SecurityException.java | 44 .../org/apache/ambari/view/ViewContext.java | 12 + 37 files changed, 1638 insertions(+), 99 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/11336361/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java index 892ac22..5399404 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java @@ -254,6 +254,10 @@ public class ResourceInstanceFactoryImpl implements ResourceInstanceFactory { resourceDefinition = new PrivilegeResourceDefinition(Resource.Type.ViewPrivilege); break; + case ViewPermission: +resourceDefinition = new ViewPermissionResourceDefinition(); +break; + default: throw new IllegalArgumentException(Unsupported resource type: + type); } http://git-wip-us.apache.org/repos/asf/ambari/blob/11336361/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ViewPermissionResourceDefinition.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ViewPermissionResourceDefinition.java b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ViewPermissionResourceDefinition.java new file mode 100644 index 000..1ff360d --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ViewPermissionResourceDefinition.java @@ -0,0 +1,58 @@ +/** + * 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
git commit: AMBARI-5956. DB connection check error if jdk_name does not exist.(vbrodetskyi)
Repository: ambari Updated Branches: refs/heads/trunk 11336361f - 5214ea465 AMBARI-5956. DB connection check error if jdk_name does not exist.(vbrodetskyi) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/5214ea46 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/5214ea46 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/5214ea46 Branch: refs/heads/trunk Commit: 5214ea465eec7836ff92bb0af6cca3573bdd16d5 Parents: 1133636 Author: Vitaly Brodetskyi vbrodets...@hortonworks.com Authored: Tue Jul 29 13:52:24 2014 +0300 Committer: Vitaly Brodetskyi vbrodets...@hortonworks.com Committed: Tue Jul 29 13:52:24 2014 +0300 -- .../src/main/resources/custom_actions/check_host.py | 8 ambari-server/src/test/python/TestCheckHost.py | 8 2 files changed, 8 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/5214ea46/ambari-server/src/main/resources/custom_actions/check_host.py -- diff --git a/ambari-server/src/main/resources/custom_actions/check_host.py b/ambari-server/src/main/resources/custom_actions/check_host.py index 7c6b299..3543f96 100644 --- a/ambari-server/src/main/resources/custom_actions/check_host.py +++ b/ambari-server/src/main/resources/custom_actions/check_host.py @@ -136,14 +136,13 @@ class CheckHost(Script): environment = { no_proxy: format({ambari_server_hostname}) } artifact_dir = /tmp/HDP-artifacts/ -jdk_name = config['commandParams']['jdk_name'] -jdk_curl_target = format({artifact_dir}/{jdk_name}) java_dir = os.path.dirname(java64_home) -# download DBConnectionVerification.jar from ambari-server resources - +# download and install java if it doesn't exists if not os.path.isfile(java_exec): try: +jdk_name = config['commandParams']['jdk_name'] +jdk_curl_target = format({artifact_dir}/{jdk_name}) Execute(format(mkdir -p {artifact_dir} ; curl -kf --retry 10 {jdk_location}/{jdk_name} -o {jdk_curl_target}), path = [/bin,/usr/bin/], @@ -169,6 +168,7 @@ class CheckHost(Script): db_connection_check_structured_output = {exit_code : 1, message: message} return db_connection_check_structured_output +# download DBConnectionVerification.jar from ambari-server resources try: cmd = format(/bin/sh -c 'cd /usr/lib/ambari-agent/ curl -kf --retry 5 {jdk_location}{check_db_connection_jar_name} http://git-wip-us.apache.org/repos/asf/ambari/blob/5214ea46/ambari-server/src/test/python/TestCheckHost.py -- diff --git a/ambari-server/src/test/python/TestCheckHost.py b/ambari-server/src/test/python/TestCheckHost.py index bf4281a..c20f428 100644 --- a/ambari-server/src/test/python/TestCheckHost.py +++ b/ambari-server/src/test/python/TestCheckHost.py @@ -83,10 +83,10 @@ class TestCheckHost(TestCase): 'DBConnectionVerification.jar from Ambari Server resources. Check network access to Ambari ' \ 'Server.\ntest exception', 'exit_code': 1}}) -self.assertEquals(format_mock.call_args_list[2][0][0], /bin/sh -c 'cd /usr/lib/ambari-agent/ curl -kf \ +self.assertEquals(format_mock.call_args_list[1][0][0], /bin/sh -c 'cd /usr/lib/ambari-agent/ curl -kf \ --retry 5 {jdk_location}{check_db_connection_jar_name} -o {check_db_connection_jar_name}') -self.assertEquals(format_mock.call_args_list[3][0][0], [ -f /usr/lib/ambari-agent/{check_db_connection_jar_name}]) +self.assertEquals(format_mock.call_args_list[2][0][0], [ -f /usr/lib/ambari-agent/{check_db_connection_jar_name}]) # test, download jdbc driver failed mock_config.return_value = {commandParams : {check_execute_list : db_connection_check, @@ -111,10 +111,10 @@ class TestCheckHost(TestCase): 'Server host to make the JDBC driver available for download and to enable testing ' 'the database connection.\n') self.assertEquals(structured_out_mock.call_args[0][0]['db_connection_check']['exit_code'], 1) -self.assertEquals(format_mock.call_args_list[4][0][0], /bin/sh -c 'cd /usr/lib/ambari-agent/ curl -kf \ +self.assertEquals(format_mock.call_args_list[3][0][0], /bin/sh -c 'cd /usr/lib/ambari-agent/ curl -kf \ --retry 5 {jdbc_url} -o {jdbc_name}') -self.assertEquals(format_mock.call_args_list[5][0][0], [ -f /usr/lib/ambari-agent/{jdbc_name}]) +self.assertEquals(format_mock.call_args_list[4][0][0], [ -f /usr/lib/ambari-agent/{jdbc_name}]) #
git commit: AMBARI-6653 UI requests metrics, which not shown to user. (atkach)
Repository: ambari Updated Branches: refs/heads/trunk 5214ea465 - 7f759df50 AMBARI-6653 UI requests metrics, which not shown to user. (atkach) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7f759df5 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7f759df5 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7f759df5 Branch: refs/heads/trunk Commit: 7f759df5002b3dc5e37f6ae5420e0eeb31d4edc3 Parents: 5214ea4 Author: atkach atk...@hortonworks.com Authored: Tue Jul 29 16:51:58 2014 +0300 Committer: atkach atk...@hortonworks.com Committed: Tue Jul 29 16:51:58 2014 +0300 -- .../app/controllers/global/update_controller.js | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/7f759df5/ambari-web/app/controllers/global/update_controller.js -- diff --git a/ambari-web/app/controllers/global/update_controller.js b/ambari-web/app/controllers/global/update_controller.js index 22f13bc..5427794 100644 --- a/ambari-web/app/controllers/global/update_controller.js +++ b/ambari-web/app/controllers/global/update_controller.js @@ -151,23 +151,24 @@ App.UpdateController = Em.Controller.extend({ var testUrl = App.get('isHadoop2Stack') ? '/data/hosts/HDP2/hosts.json' : '/data/hosts/hosts.json', self = this, hostDetailsFilter = ''; -var realUrl = '/hosts?parametersfields=Hosts/host_name,Hosts/maintenance_state,Hosts/public_host_name,Hosts/cpu_count,Hosts/ph_cpu_count,Hosts/total_mem,' + - 'Hosts/host_status,Hosts/last_heartbeat_time,Hosts/os_arch,Hosts/os_type,Hosts/ip,host_components/HostRoles/state,host_components/HostRoles/maintenance_state,' + - 'host_components/HostRoles/stale_configs,host_components/HostRoles/service_name,metrics/disk,metrics/load/load_one,metrics/cpu/cpu_system,metrics/cpu/cpu_user,' + - 'metrics/memory/mem_total,metrics/memory/mem_free,alerts/summaryminimal_response=true'; +var realUrl = '/hosts?parametersfields=Hosts/host_name,Hosts/maintenance_state,Hosts/public_host_name,Hosts/cpu_count,Hosts/ph_cpu_count,' + + 'Hosts/host_status,Hosts/last_heartbeat_time,Hosts/ip,host_components/HostRoles/state,host_components/HostRoles/maintenance_state,' + + 'host_components/HostRoles/stale_configs,host_components/HostRoles/service_name,metrics/disk,metrics/load/load_one,Hosts/total_mem,' + + 'alerts/summaryhostAuxiliaryInfominimal_response=true'; +var hostAuxiliaryInfo = ',Hosts/os_arch,Hosts/os_type,metrics/cpu/cpu_system,metrics/cpu/cpu_user,metrics/memory/mem_total,metrics/memory/mem_free'; if (App.router.get('currentState.name') == 'index' App.router.get('currentState.parentState.name') == 'hosts') { App.updater.updateInterval('updateHost', App.get('contentUpdateInterval')); } else { - if(App.router.get('currentState.name') == 'summary' App.router.get('currentState.parentState.name') == 'hostDetails') { + if (App.router.get('currentState.name') == 'summary' App.router.get('currentState.parentState.name') == 'hostDetails') { hostDetailsFilter = App.router.get('location.lastSetURL').match(/\/hosts\/(.*)\/summary/)[1]; App.updater.updateInterval('updateHost', App.get('componentsUpdateInterval')); } else { callback(); // On pages except for hosts/hostDetails, making sure hostsMapper loaded only once on page load, no need to update, but at least once -if (this.get('queryParams.Hosts') this.get('queryParams.Hosts').length 0) { +if (App.router.get('clusterController.isLoaded')) { return; } } @@ -184,8 +185,11 @@ App.UpdateController = Em.Controller.extend({ } ]); } else { + hostAuxiliaryInfo = ''; this.get('queryParams').set('Hosts', mainHostController.getQueryParameters(true)); } +realUrl = realUrl.replace('hostAuxiliaryInfo', hostAuxiliaryInfo); + var clientCallback = function (skipCall, queryParams) { if (skipCall) { //no hosts match filter by component
git commit: AMBARI-6635. Fix upgrade to respect -env (aonishuk)
Repository: ambari Updated Branches: refs/heads/trunk 7f759df50 - bdc6a7898 AMBARI-6635. Fix upgrade to respect -env (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/bdc6a789 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/bdc6a789 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/bdc6a789 Branch: refs/heads/trunk Commit: bdc6a78980d275c7d2437e13448e58e72b7fb3f6 Parents: 7f759df Author: Andrew Onishuk aonis...@hortonworks.com Authored: Tue Jul 29 18:56:11 2014 +0300 Committer: Andrew Onishuk aonis...@hortonworks.com Committed: Tue Jul 29 18:56:11 2014 +0300 -- .../ambari/server/orm/dao/ClusterDAO.java | 8 ++ .../ambari/server/state/ConfigHelper.java | 112 ++- .../server/upgrade/AbstractUpgradeCatalog.java | 31 +++-- .../server/upgrade/UpgradeCatalog150.java | 2 +- .../server/upgrade/UpgradeCatalog160.java | 2 +- .../server/upgrade/UpgradeCatalog161.java | 8 +- .../server/upgrade/UpgradeCatalog170.java | 138 ++- .../server/upgrade/UpgradeCatalog160Test.java | 2 +- .../server/upgrade/UpgradeCatalog161Test.java | 8 +- .../server/upgrade/UpgradeCatalogTest.java | 6 +- 10 files changed, 288 insertions(+), 29 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/bdc6a789/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ClusterDAO.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ClusterDAO.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ClusterDAO.java index 7f5b3ce..6ae785a 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ClusterDAO.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ClusterDAO.java @@ -93,6 +93,14 @@ public class ClusterDAO { public void createConfig(ClusterConfigEntity entity) { entityManagerProvider.get().persist(entity); } + + /** + * Remove a cluster configuration in the DB. + */ + @Transactional + public void removeConfig(ClusterConfigEntity entity) { +entityManagerProvider.get().remove(entity); + } /** * Retrieve entity data from DB http://git-wip-us.apache.org/repos/asf/ambari/blob/bdc6a789/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java index 5a09b2c..3afc918 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java @@ -33,12 +33,19 @@ import java.util.concurrent.TimeUnit; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; import com.google.inject.Singleton; + import org.apache.ambari.server.AmbariException; import org.apache.ambari.server.api.services.AmbariMetaInfo; import com.google.inject.Inject; -import org.apache.ambari.server.configuration.Configuration; +import com.google.inject.persist.Transactional; +import org.apache.ambari.server.configuration.Configuration; +import org.apache.ambari.server.controller.AmbariManagementController; +import org.apache.ambari.server.controller.ConfigurationRequest; +import org.apache.ambari.server.orm.dao.ClusterDAO; +import org.apache.ambari.server.orm.entities.ClusterConfigEntity; +import org.apache.ambari.server.orm.entities.ClusterConfigEntityPK; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** @@ -49,6 +56,7 @@ public class ConfigHelper { private Clusters clusters = null; private AmbariMetaInfo ambariMetaInfo = null; + private ClusterDAO clusterDAO = null; private static final String DELETED = DELETED_; public static final String CLUSTER_DEFAULT_TAG = tag; private final boolean STALE_CONFIGS_CACHE_ENABLED; @@ -59,9 +67,10 @@ public class ConfigHelper { LoggerFactory.getLogger(ConfigHelper.class); @Inject - public ConfigHelper(Clusters c, AmbariMetaInfo metaInfo, Configuration configuration) { + public ConfigHelper(Clusters c, AmbariMetaInfo metaInfo, Configuration configuration, ClusterDAO clusterDAO) { clusters = c; ambariMetaInfo = metaInfo; +this.clusterDAO = clusterDAO; STALE_CONFIGS_CACHE_ENABLED = configuration.isStaleConfigCacheEnabled(); staleConfigsCache = CacheBuilder.newBuilder(). expireAfterWrite(STALE_CONFIGS_CACHE_EXPIRATION_TIME, TimeUnit.SECONDS).build(); @@ -355,6 +364,105 @@ public class ConfigHelper { public void
git commit: AMBARI-6659. Create tooltip for tez dag on job's details page. (onechiporenko)
Repository: ambari Updated Branches: refs/heads/trunk bdc6a7898 - 968ac4cdf AMBARI-6659. Create tooltip for tez dag on job's details page. (onechiporenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/968ac4cd Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/968ac4cd Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/968ac4cd Branch: refs/heads/trunk Commit: 968ac4cdfef345a9c9d89264dfa73c7d71a310aa Parents: bdc6a78 Author: Oleg Nechiporenko onechipore...@apache.org Authored: Tue Jul 29 19:19:07 2014 +0300 Committer: Oleg Nechiporenko onechipore...@apache.org Committed: Tue Jul 29 19:19:07 2014 +0300 -- .../resources/ui/app/scripts/helpers/string.js | 2 +- .../views/job/hive_job_details_tez_dag_view.js | 66 .../ui/app/templates/job/hover_op_table.hbs | 24 +++ 3 files changed, 38 insertions(+), 54 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/968ac4cd/contrib/views/jobs/src/main/resources/ui/app/scripts/helpers/string.js -- diff --git a/contrib/views/jobs/src/main/resources/ui/app/scripts/helpers/string.js b/contrib/views/jobs/src/main/resources/ui/app/scripts/helpers/string.js index 487f4a3..053802e 100644 --- a/contrib/views/jobs/src/main/resources/ui/app/scripts/helpers/string.js +++ b/contrib/views/jobs/src/main/resources/ui/app/scripts/helpers/string.js @@ -80,7 +80,7 @@ App.Helpers.string = { } multi = multi || ''; var value = null, - str = this.valueOf(); + str = s.valueOf(); if (typeof multi == 'object') { for ( var key in multi) { if (value != null) { http://git-wip-us.apache.org/repos/asf/ambari/blob/968ac4cd/contrib/views/jobs/src/main/resources/ui/app/scripts/views/job/hive_job_details_tez_dag_view.js -- diff --git a/contrib/views/jobs/src/main/resources/ui/app/scripts/views/job/hive_job_details_tez_dag_view.js b/contrib/views/jobs/src/main/resources/ui/app/scripts/views/job/hive_job_details_tez_dag_view.js index 7d73f06..1224d1e 100644 --- a/contrib/views/jobs/src/main/resources/ui/app/scripts/views/job/hive_job_details_tez_dag_view.js +++ b/contrib/views/jobs/src/main/resources/ui/app/scripts/views/job/hive_job_details_tez_dag_view.js @@ -125,12 +125,10 @@ App.MainHiveJobDetailsTezDagView = Em.View.extend({ }, zoomScaleObserver: function () { -var tezRoot = this.get(svgTezRoot); -var newScale = this.get('zoomScale'); -var newScaleFrom = this.get('zoomScaleFrom'); -var newScaleTo = this.get('zoomScaleTo'); -var zoomTranslate = this.get('zoomTranslate'); -var zoomBehavior = this.get('zoomBehavior'); +var tezRoot = this.get(svgTezRoot), + newScale = this.get('zoomScale'), + zoomTranslate = this.get('zoomTranslate'), + zoomBehavior = this.get('zoomBehavior'); if (d3.event == null this.get('svgCreated')) { // Values were set from actions instead of UI events // We need to center in on selected vertex if available. @@ -146,14 +144,14 @@ App.MainHiveJobDetailsTezDagView = Em.View.extend({ }) } if (selectedNode != null) { -var cX = selectedNode.x + selectedNode.width / 2; -var cY = selectedNode.y + selectedNode.height / 2; -var mX = (cX * zoomBehavior.scale()) + zoomTranslate[0]; -var mY = (cY * zoomBehavior.scale()) + zoomTranslate[1]; -var pX = (cX * newScale) + zoomTranslate[0]; -var pY = (cY * newScale) + zoomTranslate[1]; -var nX = (mX - pX); -var nY = (mY - pY); +var cX = selectedNode.x + selectedNode.width / 2, + cY = selectedNode.y + selectedNode.height / 2, + mX = (cX * zoomBehavior.scale()) + zoomTranslate[0], + mY = (cY * zoomBehavior.scale()) + zoomTranslate[1], + pX = (cX * newScale) + zoomTranslate[0], + pY = (cY * newScale) + zoomTranslate[1], + nX = (mX - pX), + nY = (mY - pY); zoomTranslate[0] += nX; zoomTranslate[1] += nY; this.set('zoomTranslate', zoomTranslate); @@ -169,12 +167,11 @@ App.MainHiveJobDetailsTezDagView = Em.View.extend({ * Summary section. */ adjustGraphHeight: function () { -var rhsDiv = document.getElementById('tez-vertices-rhs'); -var lhsDiv = document.getElementById('tez-dag-section'); +var rhsDiv = document.getElementById('tez-vertices-rhs'), + lhsDiv = document.getElementById('tez-dag-section'); if (lhsDiv rhsDiv) { - var rhsHeight = rhsDiv.clientHeight - 26; // box boundary - var currentWidth = lhsDiv.clientWidth; - var currentHeight = lhsDiv.clientHeight; + var rhsHeight =
[1/2] git commit: Fix: Adding known contributors that are current
Repository: ambari Updated Branches: refs/heads/trunk a1e8f545c - 0f79b23bc Fix: Adding known contributors that are current Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/488e4d3c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/488e4d3c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/488e4d3c Branch: refs/heads/trunk Commit: 488e4d3cc755df0f8f6c0c716f082431139aba7e Parents: a1e8f54 Author: Mahadev Konar maha...@apache.org Authored: Mon Jul 28 08:32:03 2014 -0700 Committer: Mahadev Konar maha...@apache.org Committed: Tue Jul 29 11:56:59 2014 -0700 -- docs/pom.xml | 8 1 file changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/488e4d3c/docs/pom.xml -- diff --git a/docs/pom.xml b/docs/pom.xml index 5b3b27e..3ffc6da 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -578,11 +578,11 @@ contributors contributor nameScott Creeley/name - organizationRedHat/organization + organizationRedhat/organization /contributor contributor nameMichael Harp/name - organizationTeraData/organization + organizationTeradata/organization /contributor contributor nameJanos Matyas/name @@ -590,11 +590,11 @@ /contributor contributor nameGreg Hill/name - organizationOpenStack/organization + organizationRackspace/organization /contributor contributor nameSteve Ratay/name - organizationTeraData/organization + organizationTeradata/organization /contributor /contributors
git commit: AMBARI-6635. Fix upgrade to respect -env (aonishuk)
Repository: ambari Updated Branches: refs/heads/trunk 0f79b23bc - 77d613663 AMBARI-6635. Fix upgrade to respect -env (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/77d61366 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/77d61366 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/77d61366 Branch: refs/heads/trunk Commit: 77d613663fc85e017ea380c7f7c1f2681df5a62a Parents: 0f79b23 Author: Andrew Onishuk aonis...@hortonworks.com Authored: Tue Jul 29 23:25:01 2014 +0300 Committer: Andrew Onishuk aonis...@hortonworks.com Committed: Tue Jul 29 23:25:01 2014 +0300 -- .../org/apache/ambari/server/upgrade/UpgradeCatalog160Test.java| 2 +- .../org/apache/ambari/server/upgrade/UpgradeCatalog161Test.java| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/77d61366/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog160Test.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog160Test.java b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog160Test.java index 328dfff..1b2526c 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog160Test.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog160Test.java @@ -89,7 +89,7 @@ public class UpgradeCatalog160Test { DBAccessor dbAccessor = createNiceMock(DBAccessor.class); Method m = AbstractUpgradeCatalog.class.getDeclaredMethod - (updateConfigurationProperties, String.class, Map.class, boolean.class); + (updateConfigurationProperties, String.class, Map.class, boolean.class, boolean.class); UpgradeCatalog160 upgradeCatalog = createMockBuilder(UpgradeCatalog160.class) .addMockedMethod(m).createMock(); http://git-wip-us.apache.org/repos/asf/ambari/blob/77d61366/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog161Test.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog161Test.java b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog161Test.java index 2942c7a..330b7b3 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog161Test.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog161Test.java @@ -124,7 +124,7 @@ public class UpgradeCatalog161Test { TypedQuery query = createMock(TypedQuery.class); Method m = AbstractUpgradeCatalog.class.getDeclaredMethod -(updateConfigurationProperties, String.class, Map.class, boolean.class); +(updateConfigurationProperties, String.class, Map.class, boolean.class, boolean.class); UpgradeCatalog161 upgradeCatalog = createMockBuilder(UpgradeCatalog161.class) .addMockedMethod(m).createMock();
git commit: AMBARI-6662. API required to provide temporal min/max/avg/sum/rate for a Flume metric (ncole)
Repository: ambari Updated Branches: refs/heads/trunk 77d613663 - 58347de3d AMBARI-6662. API required to provide temporal min/max/avg/sum/rate for a Flume metric (ncole) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/58347de3 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/58347de3 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/58347de3 Branch: refs/heads/trunk Commit: 58347de3d90bfe2d26bb71553d7931bd4f7d37d0 Parents: 77d6136 Author: Nate Cole nc...@hortonworks.com Authored: Tue Jul 29 14:58:54 2014 -0400 Committer: Nate Cole nc...@hortonworks.com Committed: Tue Jul 29 17:40:01 2014 -0400 -- .../main/python/ambari_agent/AmbariConfig.py| 2 +- .../nagios/NagiosPropertyProvider.java | 25 --- .../HDP/2.0.6/services/FLUME/metrics.json | 128 ++ .../services/FLUME/package/scripts/flume.py | 2 +- .../GANGLIA/package/templates/rrd.py.j2 | 172 +-- .../nagios/NagiosPropertyProviderTest.java | 18 -- .../server/upgrade/UpgradeCatalog160Test.java | 6 +- .../python/stacks/2.0.6/FLUME/test_flume.py | 6 +- 8 files changed, 291 insertions(+), 68 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/58347de3/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py -- diff --git a/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py b/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py index b27097a..688dc74 100644 --- a/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py +++ b/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py @@ -31,7 +31,7 @@ secured_url_port=8441 [agent] prefix=/tmp/ambari-agent -tmp_dir=/tmp/ambari-agent/tmp # For test purposes +tmp_dir=/tmp/ambari-agent/tmp data_cleanup_interval=86400 data_cleanup_max_age=2592000 ping_port=8670 http://git-wip-us.apache.org/repos/asf/ambari/blob/58347de3/ambari-server/src/main/java/org/apache/ambari/server/controller/nagios/NagiosPropertyProvider.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/nagios/NagiosPropertyProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/nagios/NagiosPropertyProvider.java index cc0f939..64d5e58 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/nagios/NagiosPropertyProvider.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/nagios/NagiosPropertyProvider.java @@ -155,7 +155,6 @@ public class NagiosPropertyProvider extends BaseProvider implements PropertyProv } catch (Exception e) { LOG.error(Could not load Nagios alerts: + e.getMessage()); } - alerts.addAll(convertAlerts(clusterName)); CLUSTER_ALERTS.put(clusterName, alerts); } } @@ -164,30 +163,6 @@ public class NagiosPropertyProvider extends BaseProvider implements PropertyProv /** - * Convert Alert from cluster to NagiosAlert - * @param clusterName the cluster name - * @return Collection of NagiosAlerts - * @throws AmbariException - */ - public ListNagiosAlert convertAlerts(String clusterName) { -Cluster cluster; -try { - cluster = clusters.getCluster(clusterName); -} catch (AmbariException ex) { - return new ArrayListNagiosAlert(); -} -CollectionAlert clusterAlerts = cluster.getAlerts(); -ListNagiosAlert results = new ArrayListNagiosAlert(); -if (clusterAlerts != null) { - for (Alert alert : clusterAlerts) { -NagiosAlert a = new NagiosAlert(alert); -results.add(a); - } -} -return results; - } - - /** * Use only for testing to remove all cached alerts. */ public void forceReset() { http://git-wip-us.apache.org/repos/asf/ambari/blob/58347de3/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/FLUME/metrics.json -- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/FLUME/metrics.json b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/FLUME/metrics.json index c560d2a..2114c12 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/FLUME/metrics.json +++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/FLUME/metrics.json @@ -288,7 +288,71 @@ metric:(\\w+).SOURCE.(\\w+).EventAcceptedCount, pointInTime:true, temporal:true + }, + + metrics/flume/$1.substring(0)/CHANNEL/$2.replaceAll(\[^-]+\,\\)EventTakeSuccessCount/rate/min: { +metric:(\\w+).CHANNEL.(\\w+).EventTakeSuccessCount._rate._min, +
git commit: AMBARI-6666. Ambari deployment, Ganglia installation failed in Ubuntu12 (aonishuk)
Repository: ambari Updated Branches: refs/heads/trunk 58347de3d - c84c7a14e AMBARI-. Ambari deployment, Ganglia installation failed in Ubuntu12 (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c84c7a14 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c84c7a14 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c84c7a14 Branch: refs/heads/trunk Commit: c84c7a14e1d4df417524574cbe23b8cb95824290 Parents: 58347de Author: Andrew Onishuk aonis...@hortonworks.com Authored: Wed Jul 30 01:10:04 2014 +0300 Committer: Andrew Onishuk aonis...@hortonworks.com Committed: Wed Jul 30 01:10:04 2014 +0300 -- .../core/providers/package/apt.py | 12 ++-- .../resource_management/TestPackageResource.py | 31 2 files changed, 36 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/c84c7a14/ambari-agent/src/main/python/resource_management/core/providers/package/apt.py -- diff --git a/ambari-agent/src/main/python/resource_management/core/providers/package/apt.py b/ambari-agent/src/main/python/resource_management/core/providers/package/apt.py index 03d27df..4c6e2dd 100644 --- a/ambari-agent/src/main/python/resource_management/core/providers/package/apt.py +++ b/ambari-agent/src/main/python/resource_management/core/providers/package/apt.py @@ -23,7 +23,8 @@ from resource_management.core.providers.package import PackageProvider from resource_management.core import shell from resource_management.core.logger import Logger -INSTALL_CMD = env DEBIAN_FRONTEND=noninteractive /usr/bin/apt-get -q -o Dpkg::Options::='--force-confdef' --allow-unauthenticated --assume-yes install %s +INSTALL_CMD = DEBIAN_FRONTEND=noninteractive /usr/bin/apt-get -q -o Dpkg::Options::='--force-confdef' --allow-unauthenticated --assume-yes install %s +REPO_UPDATE_CMD = apt-get update -qq REMOVE_CMD = /usr/bin/apt-get -y -q remove %s CHECK_CMD = dpkg --get-selections %s | grep -v deinstall @@ -32,7 +33,14 @@ class AptProvider(PackageProvider): if not self._check_existence(name): cmd = INSTALL_CMD % (name) Logger.info(Installing package %s ('%s') % (name, cmd)) - shell.checked_call(cmd) + code = shell.call(cmd)[0] + + # apt-get update wasn't done too long + if code: +Logger.info(Failed to install package %s. Executing `apt-get update` % (name)) +shell.checked_call(REPO_UPDATE_CMD) +Logger.info(Retrying to install package %s % (name)) +shell.checked_call(cmd) else: Logger.info(Skipping installing existent package %s % (name)) http://git-wip-us.apache.org/repos/asf/ambari/blob/c84c7a14/ambari-agent/src/test/python/resource_management/TestPackageResource.py -- diff --git a/ambari-agent/src/test/python/resource_management/TestPackageResource.py b/ambari-agent/src/test/python/resource_management/TestPackageResource.py index 08c7ac3..d36c543 100644 --- a/ambari-agent/src/test/python/resource_management/TestPackageResource.py +++ b/ambari-agent/src/test/python/resource_management/TestPackageResource.py @@ -17,7 +17,7 @@ limitations under the License. ''' from unittest import TestCase -from mock.mock import patch, MagicMock +from mock.mock import patch, MagicMock, call from resource_management.core import Environment, Fail from resource_management.core.system import System @@ -26,17 +26,38 @@ from resource_management.core.resources import Package from resource_management.core import shell class TestPackageResource(TestCase): - @patch.object(shell, call) @patch.object(shell, checked_call) @patch.object(System, os_family, new = 'debian') - def test_action_install_debian(self, shell_mock, call_mock): + def test_action_install_debian_update(self, shell_mock, call_mock): call_mock.return_value= (1, None) with Environment('/') as env: Package(some_package, ) -call_mock.assert_called_with('dpkg --get-selections some_package | grep -v deinstall') -shell_mock.assert_called_with(env DEBIAN_FRONTEND=noninteractive /usr/bin/apt-get -q -o Dpkg::Options::='--force-confdef' --allow-unauthenticated --assume-yes install some_package) +call_mock.assert_has_calls([call(dpkg --get-selections some_package | grep -v deinstall), +call(DEBIAN_FRONTEND=noninteractive /usr/bin/apt-get -q -o Dpkg::Options::='--force-confdef' + --allow-unauthenticated --assume-yes install some_package) + ]) + +shell_mock.assert_has_calls([call(apt-get update -qq), +