ambari git commit: AMBARI-20641. Pig view fails to load when using ambari thru KNOX. (gauravn7)
Repository: ambari Updated Branches: refs/heads/branch-2.5 a5b2b5e35 -> ecd504c92 AMBARI-20641. Pig view fails to load when using ambari thru KNOX. (gauravn7) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ecd504c9 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ecd504c9 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ecd504c9 Branch: refs/heads/branch-2.5 Commit: ecd504c92c0d028637c32d335c4424ca5fb342f5 Parents: a5b2b5e Author: Gaurav NagarAuthored: Sat Apr 1 08:59:53 2017 +0530 Committer: Gaurav Nagar Committed: Sat Apr 1 09:01:09 2017 +0530 -- .../pig/src/main/resources/ui/pig-web/app/app.js | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/ecd504c9/contrib/views/pig/src/main/resources/ui/pig-web/app/app.js -- diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/app.js b/contrib/views/pig/src/main/resources/ui/pig-web/app/app.js index c683f72..35cce9d 100644 --- a/contrib/views/pig/src/main/resources/ui/pig-web/app/app.js +++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/app.js @@ -25,16 +25,19 @@ module.exports = Em.Application.create({ errorLog: "", getNamespaceUrl: function() { -var parts = window.location.pathname.match(/\/[^\/]*/g); -var view = parts[1]; -var version = '/versions' + parts[2]; -var instance = parts[3]; -if (parts.length == 4) { // version is not present - instance = parts[2]; +var parts = window.location.pathname.split('/').filter(function (i) { + return i !== ""; +}); +var view = parts[parts.length - 3]; +var version = '/versions/' + parts[parts.length - 2]; +var instance = parts[parts.length - 1]; + +if (!/^(\d+\.){2,3}\d+$/.test(parts[parts.length - 2])) { // version is not present + instance = parts[parts.length - 2]; version = ''; } -var namespaceUrl = 'api/v1/views' + view + version + '/instances' + instance; -return namespaceUrl; +var namespaceUrl = 'api/v1/views/' + view + version + '/instances/' + instance; +return namespaceUrl.replace(/^\/|\/$/g, ''); //remove starting slash if proxied through knox }, Resolver: Ember.DefaultResolver.extend({
ambari git commit: AMBARI-20641. Pig view fails to load when using ambari thru KNOX. (gauravn7)
Repository: ambari Updated Branches: refs/heads/trunk 1a08c4980 -> b88512e71 AMBARI-20641. Pig view fails to load when using ambari thru KNOX. (gauravn7) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b88512e7 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b88512e7 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b88512e7 Branch: refs/heads/trunk Commit: b88512e719f894d9ab3d5cb956a29f21e44fc29a Parents: 1a08c49 Author: Gaurav NagarAuthored: Sat Apr 1 08:59:53 2017 +0530 Committer: Gaurav Nagar Committed: Sat Apr 1 08:59:53 2017 +0530 -- .../pig/src/main/resources/ui/pig-web/app/app.js | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/b88512e7/contrib/views/pig/src/main/resources/ui/pig-web/app/app.js -- diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/app.js b/contrib/views/pig/src/main/resources/ui/pig-web/app/app.js index c683f72..35cce9d 100644 --- a/contrib/views/pig/src/main/resources/ui/pig-web/app/app.js +++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/app.js @@ -25,16 +25,19 @@ module.exports = Em.Application.create({ errorLog: "", getNamespaceUrl: function() { -var parts = window.location.pathname.match(/\/[^\/]*/g); -var view = parts[1]; -var version = '/versions' + parts[2]; -var instance = parts[3]; -if (parts.length == 4) { // version is not present - instance = parts[2]; +var parts = window.location.pathname.split('/').filter(function (i) { + return i !== ""; +}); +var view = parts[parts.length - 3]; +var version = '/versions/' + parts[parts.length - 2]; +var instance = parts[parts.length - 1]; + +if (!/^(\d+\.){2,3}\d+$/.test(parts[parts.length - 2])) { // version is not present + instance = parts[parts.length - 2]; version = ''; } -var namespaceUrl = 'api/v1/views' + view + version + '/instances' + instance; -return namespaceUrl; +var namespaceUrl = 'api/v1/views/' + view + version + '/instances/' + instance; +return namespaceUrl.replace(/^\/|\/$/g, ''); //remove starting slash if proxied through knox }, Resolver: Ember.DefaultResolver.extend({
ambari git commit: AMBARI-20646 - Large Long Running Requests Can Slow Down the ActionScheduler (jonathanhurley)
Repository: ambari Updated Branches: refs/heads/branch-2.5 9d15dd3fd -> a5b2b5e35 AMBARI-20646 - Large Long Running Requests Can Slow Down the ActionScheduler (jonathanhurley) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a5b2b5e3 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a5b2b5e3 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a5b2b5e3 Branch: refs/heads/branch-2.5 Commit: a5b2b5e3592c71d19e11bd17ea6eb47f31f1531f Parents: 9d15dd3 Author: Jonathan HurleyAuthored: Fri Mar 31 12:35:25 2017 -0400 Committer: Jonathan Hurley Committed: Fri Mar 31 21:15:42 2017 -0400 -- .../server/actionmanager/ActionDBAccessor.java | 16 +- .../actionmanager/ActionDBAccessorImpl.java | 13 +- .../server/actionmanager/ActionScheduler.java | 2 +- .../apache/ambari/server/orm/dao/StageDAO.java | 73 - .../ambari/server/orm/entities/StageEntity.java | 9 +- .../serveraction/ServerActionExecutor.java | 120 +++--- .../actionmanager/TestActionDBAccessorImpl.java | 27 ++-- .../actionmanager/TestActionScheduler.java | 157 +++ .../ambari/server/orm/dao/RequestDAOTest.java | 21 ++- .../serveraction/ServerActionExecutorTest.java | 2 +- .../services/RetryUpgradeActionServiceTest.java | 25 +-- 11 files changed, 251 insertions(+), 214 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/a5b2b5e3/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java index 9325d03..b0550c0 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java @@ -76,17 +76,19 @@ public interface ActionDBAccessor { boolean skipSupported, boolean hostUnknownState); /** - * Returns all the pending stages, including queued and not-queued. A stage is - * considered in progress if it is in progress for any host. + * Returns the next stage which is in-progress for every in-progress request + * in the system. Since stages are always synchronous, there is no reason to + * return more than the most recent stage per request. Returning every single + * stage in the requesrt would be extremely inffecient and wasteful. However, + * since requests can run in parallel, this method must return the most recent + * stage for every request. The results will be sorted by request ID. * - * The results will be sorted by request ID and then stage ID making this call - * expensive in some scenarios. Use {@link #getCommandsInProgressCount()} in - * order to determine if there are stages that are in progress before getting - * the stages from this method. + * Use {@link #getCommandsInProgressCount()} in order to determine if there + * are stages that are in progress before getting the stages from this method. * * @see HostRoleStatus#IN_PROGRESS_STATUSES */ - public List getStagesInProgress(); + public List getFirstStageInProgressPerRequest(); /** * Returns all the pending stages in a request, including queued and not-queued. A stage is http://git-wip-us.apache.org/repos/asf/ambari/blob/a5b2b5e3/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java index 04feda0..27ddd62 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java @@ -282,11 +282,16 @@ public class ActionDBAccessorImpl implements ActionDBAccessor { * {@inheritDoc} */ @Override - @Experimental(feature = ExperimentalFeature.PARALLEL_PROCESSING) - public List getStagesInProgress() { -List stageEntities = stageDAO.findByCommandStatuses( + public List getFirstStageInProgressPerRequest() { +List stageEntities = stageDAO.findFirstStageByStatus( HostRoleStatus.IN_PROGRESS_STATUSES); -return getStagesForEntities(stageEntities); + +List stages = new ArrayList<>(stageEntities.size()); +for (StageEntity stageEntity : stageEntities) { +
ambari git commit: AMBARI-20646 - Large Long Running Requests Can Slow Down the ActionScheduler (jonathanhurley)
Repository: ambari Updated Branches: refs/heads/trunk 320a8f5b4 -> 1a08c4980 AMBARI-20646 - Large Long Running Requests Can Slow Down the ActionScheduler (jonathanhurley) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1a08c498 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1a08c498 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1a08c498 Branch: refs/heads/trunk Commit: 1a08c4980295ebda1b71db17eb6389fb71f928fd Parents: 320a8f5 Author: Jonathan HurleyAuthored: Fri Mar 31 12:35:25 2017 -0400 Committer: Jonathan Hurley Committed: Fri Mar 31 21:14:45 2017 -0400 -- .../server/actionmanager/ActionDBAccessor.java | 16 ++- .../actionmanager/ActionDBAccessorImpl.java | 13 +- .../server/actionmanager/ActionScheduler.java | 2 +- .../apache/ambari/server/orm/dao/StageDAO.java | 68 - .../ambari/server/orm/entities/StageEntity.java | 9 +- .../serveraction/ServerActionExecutor.java | 114 +++ .../actionmanager/TestActionDBAccessorImpl.java | 27 ++-- .../actionmanager/TestActionScheduler.java | 139 +++ .../ambari/server/orm/dao/RequestDAOTest.java | 21 ++- .../serveraction/ServerActionExecutorTest.java | 2 +- .../services/RetryUpgradeActionServiceTest.java | 12 +- 11 files changed, 227 insertions(+), 196 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/1a08c498/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java index 9325d03..b0550c0 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java @@ -76,17 +76,19 @@ public interface ActionDBAccessor { boolean skipSupported, boolean hostUnknownState); /** - * Returns all the pending stages, including queued and not-queued. A stage is - * considered in progress if it is in progress for any host. + * Returns the next stage which is in-progress for every in-progress request + * in the system. Since stages are always synchronous, there is no reason to + * return more than the most recent stage per request. Returning every single + * stage in the requesrt would be extremely inffecient and wasteful. However, + * since requests can run in parallel, this method must return the most recent + * stage for every request. The results will be sorted by request ID. * - * The results will be sorted by request ID and then stage ID making this call - * expensive in some scenarios. Use {@link #getCommandsInProgressCount()} in - * order to determine if there are stages that are in progress before getting - * the stages from this method. + * Use {@link #getCommandsInProgressCount()} in order to determine if there + * are stages that are in progress before getting the stages from this method. * * @see HostRoleStatus#IN_PROGRESS_STATUSES */ - public List getStagesInProgress(); + public List getFirstStageInProgressPerRequest(); /** * Returns all the pending stages in a request, including queued and not-queued. A stage is http://git-wip-us.apache.org/repos/asf/ambari/blob/1a08c498/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java index ab4feaa..8c4eae8 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java @@ -285,11 +285,16 @@ public class ActionDBAccessorImpl implements ActionDBAccessor { * {@inheritDoc} */ @Override - @Experimental(feature = ExperimentalFeature.PARALLEL_PROCESSING) - public List getStagesInProgress() { -List stageEntities = stageDAO.findByStatuses( + public List getFirstStageInProgressPerRequest() { +List stageEntities = stageDAO.findFirstStageByStatus( HostRoleStatus.IN_PROGRESS_STATUSES); -return getStagesForEntities(stageEntities); + +List stages = new ArrayList<>(stageEntities.size()); +for (StageEntity stageEntity : stageEntities) { +
ambari git commit: AMBARI-20647. Druid Superset Password gets printed in installation logs. (Nishant Bangarwa via Swapan Shridhar).
Repository: ambari Updated Branches: refs/heads/branch-2.5 cc1b9cb66 -> 9d15dd3fd AMBARI-20647. Druid Superset Password gets printed in installation logs. (Nishant Bangarwa via Swapan Shridhar). Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9d15dd3f Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9d15dd3f Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9d15dd3f Branch: refs/heads/branch-2.5 Commit: 9d15dd3fd3e5b8b4855c7aa7a334d4e77c03d1a9 Parents: cc1b9cb Author: Swapan ShridharAuthored: Fri Mar 31 14:56:49 2017 -0700 Committer: Swapan Shridhar Committed: Fri Mar 31 16:46:49 2017 -0700 -- .../common-services/DRUID/0.9.2/package/scripts/superset.py| 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/9d15dd3f/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/superset.py -- diff --git a/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/superset.py b/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/superset.py index 9173b09..50e5b6e 100644 --- a/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/superset.py +++ b/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/superset.py @@ -76,7 +76,7 @@ class Superset(Script): # Initialize DB and create admin user. Execute(format("source {params.superset_config_dir}/superset-env.sh ; {params.superset_bin_dir}/superset db upgrade"), user=params.druid_user) -Execute(format("source {params.superset_config_dir}/superset-env.sh ; {params.superset_bin_dir}/fabmanager create-admin --app superset --username '{params.superset_admin_user}' --password '{params.superset_admin_password}' --firstname '{params.superset_admin_firstname}' --lastname '{params.superset_admin_lastname}' --email '{params.superset_admin_email}'"), +Execute(format("source {params.superset_config_dir}/superset-env.sh ; {params.superset_bin_dir}/fabmanager create-admin --app superset --username '{params.superset_admin_user}' --password '{params.superset_admin_password!p}' --firstname '{params.superset_admin_firstname}' --lastname '{params.superset_admin_lastname}' --email '{params.superset_admin_email}'"), user=params.druid_user) Execute(format("source {params.superset_config_dir}/superset-env.sh ; {params.superset_bin_dir}/superset init"), user=params.druid_user)
ambari git commit: AMBARI-20649. Add public repo URLs for HDP-2.6 repo (smohanty)
Repository: ambari Updated Branches: refs/heads/trunk 7b8ca7f69 -> 320a8f5b4 AMBARI-20649. Add public repo URLs for HDP-2.6 repo (smohanty) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/320a8f5b Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/320a8f5b Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/320a8f5b Branch: refs/heads/trunk Commit: 320a8f5b4ee9581663836d05489eabb9cf195c52 Parents: 7b8ca7f Author: Sumit MohantyAuthored: Fri Mar 31 16:40:37 2017 -0700 Committer: Sumit Mohanty Committed: Fri Mar 31 16:41:24 2017 -0700 -- .../resources/stacks/HDP/2.6/repos/repoinfo.xml | 16 1 file changed, 8 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/320a8f5b/ambari-server/src/main/resources/stacks/HDP/2.6/repos/repoinfo.xml -- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/repos/repoinfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/repos/repoinfo.xml index 34abae5..81a70a5 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.6/repos/repoinfo.xml +++ b/ambari-server/src/main/resources/stacks/HDP/2.6/repos/repoinfo.xml @@ -19,7 +19,7 @@ http://s3.amazonaws.com/dev.hortonworks.com/HDP/hdp_urlinfo.json - http://s3.amazonaws.com/dev.hortonworks.com/HDP/centos6/2.x/updates/2.6.0.0 + http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.6.0.3 HDP-2.6 HDP true @@ -33,7 +33,7 @@ - http://s3.amazonaws.com/dev.hortonworks.com/HDP/centos7/2.x/updates/2.6.0.0 + http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.0.3 HDP-2.6 HDP true @@ -47,7 +47,7 @@ - http://s3.amazonaws.com/dev.hortonworks.com/HDP/suse11sp3/2.x/updates/2.6.0.0 + http://public-repo-1.hortonworks.com/HDP/suse11sp3/2.x/updates/2.6.0.3 HDP-2.6 HDP true @@ -61,7 +61,7 @@ - http://s3.amazonaws.com/dev.hortonworks.com/HDP/sles12/2.x/updates/2.6.0.0 + http://public-repo-1.hortonworks.com/HDP/sles12/2.x/updates/2.6.0.3 HDP-2.6 HDP true @@ -75,7 +75,7 @@ - http://s3.amazonaws.com/dev.hortonworks.com/HDP/ubuntu12/2.x/updates/2.6.0.0 + http://public-repo-1.hortonworks.com/HDP/ubuntu12/2.x/updates/2.6.0.3 HDP-2.6 HDP true @@ -89,7 +89,7 @@ - http://s3.amazonaws.com/dev.hortonworks.com/HDP/debian7/2.x/updates/2.6.0.0 + http://public-repo-1.hortonworks.com/HDP/debian7/2.x/updates/2.6.0.3 HDP-2.6 HDP true @@ -103,7 +103,7 @@ - http://s3.amazonaws.com/dev.hortonworks.com/HDP/ubuntu14/2.x/updates/2.6.0.0 + http://public-repo-1.hortonworks.com/HDP/ubuntu14/2.x/updates/2.6.0.3 HDP-2.6 HDP true @@ -117,7 +117,7 @@ - http://s3.amazonaws.com/dev.hortonworks.com/HDP/ubuntu14/2.x/updates/2.6.0.0 + http://public-repo-1.hortonworks.com/HDP/ubuntu16/2.x/updates/2.6.0.3 HDP-2.6 HDP true
ambari git commit: AMBARI-20649. Add public repo URLs for HDP-2.6 repo (smohanty)
Repository: ambari Updated Branches: refs/heads/branch-2.5 8058ccebe -> cc1b9cb66 AMBARI-20649. Add public repo URLs for HDP-2.6 repo (smohanty) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/cc1b9cb6 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/cc1b9cb6 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/cc1b9cb6 Branch: refs/heads/branch-2.5 Commit: cc1b9cb66274c9d4618142c5e80ea87ee2bc5f89 Parents: 8058cce Author: Sumit MohantyAuthored: Fri Mar 31 16:40:37 2017 -0700 Committer: Sumit Mohanty Committed: Fri Mar 31 16:40:37 2017 -0700 -- .../resources/stacks/HDP/2.6/repos/repoinfo.xml | 16 1 file changed, 8 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/cc1b9cb6/ambari-server/src/main/resources/stacks/HDP/2.6/repos/repoinfo.xml -- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/repos/repoinfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/repos/repoinfo.xml index 34abae5..81a70a5 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.6/repos/repoinfo.xml +++ b/ambari-server/src/main/resources/stacks/HDP/2.6/repos/repoinfo.xml @@ -19,7 +19,7 @@ http://s3.amazonaws.com/dev.hortonworks.com/HDP/hdp_urlinfo.json - http://s3.amazonaws.com/dev.hortonworks.com/HDP/centos6/2.x/updates/2.6.0.0 + http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.6.0.3 HDP-2.6 HDP true @@ -33,7 +33,7 @@ - http://s3.amazonaws.com/dev.hortonworks.com/HDP/centos7/2.x/updates/2.6.0.0 + http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.0.3 HDP-2.6 HDP true @@ -47,7 +47,7 @@ - http://s3.amazonaws.com/dev.hortonworks.com/HDP/suse11sp3/2.x/updates/2.6.0.0 + http://public-repo-1.hortonworks.com/HDP/suse11sp3/2.x/updates/2.6.0.3 HDP-2.6 HDP true @@ -61,7 +61,7 @@ - http://s3.amazonaws.com/dev.hortonworks.com/HDP/sles12/2.x/updates/2.6.0.0 + http://public-repo-1.hortonworks.com/HDP/sles12/2.x/updates/2.6.0.3 HDP-2.6 HDP true @@ -75,7 +75,7 @@ - http://s3.amazonaws.com/dev.hortonworks.com/HDP/ubuntu12/2.x/updates/2.6.0.0 + http://public-repo-1.hortonworks.com/HDP/ubuntu12/2.x/updates/2.6.0.3 HDP-2.6 HDP true @@ -89,7 +89,7 @@ - http://s3.amazonaws.com/dev.hortonworks.com/HDP/debian7/2.x/updates/2.6.0.0 + http://public-repo-1.hortonworks.com/HDP/debian7/2.x/updates/2.6.0.3 HDP-2.6 HDP true @@ -103,7 +103,7 @@ - http://s3.amazonaws.com/dev.hortonworks.com/HDP/ubuntu14/2.x/updates/2.6.0.0 + http://public-repo-1.hortonworks.com/HDP/ubuntu14/2.x/updates/2.6.0.3 HDP-2.6 HDP true @@ -117,7 +117,7 @@ - http://s3.amazonaws.com/dev.hortonworks.com/HDP/ubuntu14/2.x/updates/2.6.0.0 + http://public-repo-1.hortonworks.com/HDP/ubuntu16/2.x/updates/2.6.0.3 HDP-2.6 HDP true
ambari git commit: AMBARI-20647. Druid Superset Password gets printed in installation logs. (Nishant Bangarwa via Swapan Shridhar).
Repository: ambari Updated Branches: refs/heads/trunk 8959f366e -> 7b8ca7f69 AMBARI-20647. Druid Superset Password gets printed in installation logs. (Nishant Bangarwa via Swapan Shridhar). Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7b8ca7f6 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7b8ca7f6 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7b8ca7f6 Branch: refs/heads/trunk Commit: 7b8ca7f690d835a6845dbd57e7aaf366951876a1 Parents: 8959f36 Author: Swapan ShridharAuthored: Fri Mar 31 14:56:49 2017 -0700 Committer: Swapan Shridhar Committed: Fri Mar 31 14:57:03 2017 -0700 -- .../common-services/DRUID/0.9.2/package/scripts/superset.py| 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/7b8ca7f6/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/superset.py -- diff --git a/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/superset.py b/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/superset.py index f835418..b837b24 100644 --- a/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/superset.py +++ b/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/superset.py @@ -82,7 +82,7 @@ class Superset(Script): # Initialize DB and create admin user. Execute(format("source {params.superset_config_dir}/superset-env.sh ; {params.superset_bin_dir}/superset db upgrade"), user=params.druid_user) -Execute(format("source {params.superset_config_dir}/superset-env.sh ; {params.superset_bin_dir}/fabmanager create-admin --app superset --username '{params.superset_admin_user}' --password '{params.superset_admin_password}' --firstname '{params.superset_admin_firstname}' --lastname '{params.superset_admin_lastname}' --email '{params.superset_admin_email}'"), +Execute(format("source {params.superset_config_dir}/superset-env.sh ; {params.superset_bin_dir}/fabmanager create-admin --app superset --username '{params.superset_admin_user}' --password '{params.superset_admin_password!p}' --firstname '{params.superset_admin_firstname}' --lastname '{params.superset_admin_lastname}' --email '{params.superset_admin_email}'"), user=params.druid_user) Execute(format("source {params.superset_config_dir}/superset-env.sh ; {params.superset_bin_dir}/superset init"), user=params.druid_user)
ambari git commit: AMBARI-20644. Ambari Log Search Web - fix some build npm errors (oleewere)
Repository: ambari Updated Branches: refs/heads/trunk cd92d2df8 -> 8959f366e AMBARI-20644. Ambari Log Search Web - fix some build npm errors (oleewere) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8959f366 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8959f366 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8959f366 Branch: refs/heads/trunk Commit: 8959f366ec7490800525447409ade29e25d285aa Parents: cd92d2d Author: oleewereAuthored: Fri Mar 31 14:42:34 2017 +0200 Committer: oleewere Committed: Fri Mar 31 22:31:33 2017 +0200 -- ambari-logsearch/ambari-logsearch-web/package.json | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/8959f366/ambari-logsearch/ambari-logsearch-web/package.json -- diff --git a/ambari-logsearch/ambari-logsearch-web/package.json b/ambari-logsearch/ambari-logsearch-web/package.json index 9dad560..92fd245 100644 --- a/ambari-logsearch/ambari-logsearch-web/package.json +++ b/ambari-logsearch/ambari-logsearch-web/package.json @@ -1,13 +1,16 @@ { "name": "ambari-logsearch-web", "version": "0.5.0", - "description":
[1/2] ambari git commit: AMBARI-20586. Add (optional) master_kdcs to kerberos-env and generated krb5.conf file (Balazs Bence Sari via adoroszlai)
Repository: ambari Updated Branches: refs/heads/branch-2.5 0cf0c70e6 -> 8058ccebe refs/heads/trunk e14cc6059 -> cd92d2df8 AMBARI-20586. Add (optional) master_kdcs to kerberos-env and generated krb5.conf file (Balazs Bence Sari via adoroszlai) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8058cceb Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8058cceb Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8058cceb Branch: refs/heads/branch-2.5 Commit: 8058ccebe2ef218d660de563224e053567c7a746 Parents: 0cf0c70 Author: Balazs Bence SariAuthored: Fri Mar 31 19:53:10 2017 +0200 Committer: Attila Doroszlai Committed: Fri Mar 31 19:53:43 2017 +0200 -- .../BlueprintConfigurationProcessor.java| 1 + .../1.10.3-10/configuration/kerberos-env.xml| 15 + .../1.10.3-10/configuration/krb5-conf.xml | 43 ++ .../package/scripts/kerberos_common.py | 5 +- .../1.10.3-10/package/scripts/params.py | 2 + .../1.10.3-10/package/templates/krb5_conf.j2| 54 -- .../KERBEROS/1.10.3-10/properties/krb5_conf.j2 | 60 .../KERBEROS/configuration/kerberos-env.xml | 15 + .../KERBEROS/configuration/krb5-conf.xml| 43 ++ .../KERBEROS/package/scripts/kerberos_common.py | 5 +- .../services/KERBEROS/package/scripts/params.py | 2 + .../KERBEROS/package/templates/krb5_conf.j2 | 54 -- .../services/KERBEROS/properties/krb5_conf.j2 | 60 .../BlueprintConfigurationProcessorTest.java| 5 +- .../stacks/2.2/KERBEROS/test_kerberos_client.py | 4 +- .../python/stacks/2.2/KERBEROS/use_cases.py | 5 +- 16 files changed, 174 insertions(+), 199 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/8058cceb/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java index 9faa2ce..ae927c7 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java @@ -164,6 +164,7 @@ public class BlueprintConfigurationProcessor { new SimplePropertyNameExportFilter("tez.tez-ui.history-url.base", "tez-site"), new SimplePropertyNameExportFilter("admin_server_host", "kerberos-env"), new SimplePropertyNameExportFilter("kdc_hosts", "kerberos-env"), + new SimplePropertyNameExportFilter("master_kdc", "kerberos-env"), new SimplePropertyNameExportFilter("realm", "kerberos-env"), new SimplePropertyNameExportFilter("kdc_type", "kerberos-env"), new SimplePropertyNameExportFilter("ldap-url", "kerberos-env"), http://git-wip-us.apache.org/repos/asf/ambari/blob/8058cceb/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/kerberos-env.xml -- diff --git a/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/kerberos-env.xml b/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/kerberos-env.xml index 965ee13..e07e28e 100644 --- a/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/kerberos-env.xml +++ b/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/kerberos-env.xml @@ -147,6 +147,21 @@ +master_kdc + + The IP address or FQDN of the master KDC host in a master-slave KDC deployment. + Optionally a port number may be included. + Example: kdc1.example.com:88 + +Master KDC host + + + true + false + + + + admin_server_host Kadmin host http://git-wip-us.apache.org/repos/asf/ambari/blob/8058cceb/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/krb5-conf.xml -- diff --git a/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/krb5-conf.xml b/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/krb5-conf.xml index c692b92..1963e2c 100644 --- a/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/krb5-conf.xml +++
[2/2] ambari git commit: AMBARI-20586. Add (optional) master_kdcs to kerberos-env and generated krb5.conf file (Balazs Bence Sari via adoroszlai)
AMBARI-20586. Add (optional) master_kdcs to kerberos-env and generated krb5.conf file (Balazs Bence Sari via adoroszlai) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/cd92d2df Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/cd92d2df Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/cd92d2df Branch: refs/heads/trunk Commit: cd92d2df89b3166c82fbd95fca1b605574b27bcd Parents: e14cc60 Author: Balazs Bence SariAuthored: Fri Mar 31 19:53:10 2017 +0200 Committer: Attila Doroszlai Committed: Fri Mar 31 19:58:48 2017 +0200 -- .../BlueprintConfigurationProcessor.java| 1 + .../1.10.3-10/configuration/kerberos-env.xml| 15 + .../1.10.3-10/configuration/krb5-conf.xml | 43 ++ .../package/scripts/kerberos_common.py | 5 +- .../1.10.3-10/package/scripts/params.py | 2 + .../1.10.3-10/package/templates/krb5_conf.j2| 54 -- .../KERBEROS/1.10.3-10/properties/krb5_conf.j2 | 60 .../KERBEROS/configuration/kerberos-env.xml | 15 + .../KERBEROS/configuration/krb5-conf.xml| 43 ++ .../KERBEROS/package/scripts/kerberos_common.py | 5 +- .../services/KERBEROS/package/scripts/params.py | 2 + .../KERBEROS/package/templates/krb5_conf.j2 | 54 -- .../services/KERBEROS/properties/krb5_conf.j2 | 60 .../BlueprintConfigurationProcessorTest.java| 5 +- .../stacks/2.2/KERBEROS/test_kerberos_client.py | 4 +- .../python/stacks/2.2/KERBEROS/use_cases.py | 5 +- 16 files changed, 174 insertions(+), 199 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/cd92d2df/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java index e5927d6..db1aa07 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java @@ -160,6 +160,7 @@ public class BlueprintConfigurationProcessor { new SimplePropertyNameExportFilter("tez.tez-ui.history-url.base", "tez-site"), new SimplePropertyNameExportFilter("admin_server_host", "kerberos-env"), new SimplePropertyNameExportFilter("kdc_hosts", "kerberos-env"), + new SimplePropertyNameExportFilter("master_kdc", "kerberos-env"), new SimplePropertyNameExportFilter("realm", "kerberos-env"), new SimplePropertyNameExportFilter("kdc_type", "kerberos-env"), new SimplePropertyNameExportFilter("ldap-url", "kerberos-env"), http://git-wip-us.apache.org/repos/asf/ambari/blob/cd92d2df/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/kerberos-env.xml -- diff --git a/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/kerberos-env.xml b/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/kerberos-env.xml index 965ee13..e07e28e 100644 --- a/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/kerberos-env.xml +++ b/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/kerberos-env.xml @@ -147,6 +147,21 @@ +master_kdc + + The IP address or FQDN of the master KDC host in a master-slave KDC deployment. + Optionally a port number may be included. + Example: kdc1.example.com:88 + +Master KDC host + + + true + false + + + + admin_server_host Kadmin host http://git-wip-us.apache.org/repos/asf/ambari/blob/cd92d2df/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/krb5-conf.xml -- diff --git a/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/krb5-conf.xml b/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/krb5-conf.xml index c692b92..1963e2c 100644 --- a/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/krb5-conf.xml +++ b/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/krb5-conf.xml @@ -61,48 +61,13 @@ content krb5-conf template
ambari git commit: AMBARI-20609 Fix Install Wizard data attribute. (ababiichuk)
Repository: ambari Updated Branches: refs/heads/trunk 52bca5cc6 -> e14cc6059 AMBARI-20609 Fix Install Wizard data attribute. (ababiichuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e14cc605 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e14cc605 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e14cc605 Branch: refs/heads/trunk Commit: e14cc6059e1d85819c8ef6d241fb57708256603f Parents: 52bca5c Author: ababiichukAuthored: Fri Mar 31 19:40:08 2017 +0300 Committer: ababiichuk Committed: Fri Mar 31 20:53:37 2017 +0300 -- .../app/controllers/wizard/step9_controller.js | 3 +- ambari-web/app/templates/wizard/step9.hbs | 46 ++-- .../wizard/step9/step9HostTasksLogPopup.hbs | 2 +- ambari-web/app/views/wizard/step9_view.js | 1 + 4 files changed, 26 insertions(+), 26 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/e14cc605/ambari-web/app/controllers/wizard/step9_controller.js -- diff --git a/ambari-web/app/controllers/wizard/step9_controller.js b/ambari-web/app/controllers/wizard/step9_controller.js index a009334..4697dad 100644 --- a/ambari-web/app/controllers/wizard/step9_controller.js +++ b/ambari-web/app/controllers/wizard/step9_controller.js @@ -607,7 +607,8 @@ App.WizardStep9Controller = Em.Controller.extend(App.ReloadPopupMixin, { primary: Em.I18n.t('ok'), header: Em.I18n.t('installer.step9.service.start.header'), secondary: false, - body: Em.I18n.t('installer.step9.service.start.failed') + body: Em.I18n.t('installer.step9.service.start.failed'), + 'data-qa': 'start-failed-modal' }); }, http://git-wip-us.apache.org/repos/asf/ambari/blob/e14cc605/ambari-web/app/templates/wizard/step9.hbs -- diff --git a/ambari-web/app/templates/wizard/step9.hbs b/ambari-web/app/templates/wizard/step9.hbs index f079d92..3b7d17f 100644 --- a/ambari-web/app/templates/wizard/step9.hbs +++ b/ambari-web/app/templates/wizard/step9.hbs @@ -22,23 +22,21 @@ - - - - - - + + + + - {{view.progressMessage}} +{{view.progressMessage}} {{#if controller.showRetry}} - + {{t common.retry}} @@ -63,43 +61,43 @@ - + - + {{t common.host}} - {{t common.status}} + {{t common.status}} - {{t common.message}} + {{t common.message}} {{#if view.pageContent}} {{#each host in view.pageContent}} - {{#view App.HostStatusView objBinding="host" controllerBinding="controller"}} - -{{host.name}} + {{#view App.HostStatusView objBinding="host" controllerBinding="controller" data-qa="hosts-table-body-row"}} + +{{host.name}} - + - + -{{host.progress}}% +{{host.progress}}% - + {{host.message}} +data-toggle="modal" {{action hostLogPopup target="view"}} {{QAAttr "host-status-message"}}>{{host.message}} {{/view}} {{/each}} {{else}} - -{{t installer.step3.hosts.noHosts}} + +{{t installer.step3.hosts.noHosts}} {{/if}} @@ -114,7 +112,7 @@ {{#if view.resultMsg}} -{{view.resultMsg}} +{{view.resultMsg}} {{#if view.isHostHeartbeatLost}} {{t common.showDetails}} @@ -129,7 +127,7 @@ - + {{#if App.router.nextBtnClickInProgress}} {{view App.SpinnerView tagName="span" classNames="service-button-spinner"}} {{/if}}
[2/2] ambari git commit: AMBARI-20540. Referenced Kerberos identity definitions should be created and distributed only if the referenced service or component is installed
AMBARI-20540. Referenced Kerberos identity definitions should be created and distributed only if the referenced service or component is installed Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0cf0c70e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0cf0c70e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0cf0c70e Branch: refs/heads/branch-2.5 Commit: 0cf0c70e6079ac6ef76a63e709a27a7c2009d85d Parents: 52fdbb9 Author: Attila MagyarAuthored: Fri Mar 31 19:40:32 2017 +0200 Committer: Attila Doroszlai Committed: Fri Mar 31 19:40:32 2017 +0200 -- .../AbstractKerberosDescriptorContainer.java| 33 +++-- .../kerberos/KerberosIdentityDescriptor.java| 20 +- .../state/kerberos/KerberosDescriptorTest.java | 33 +++-- .../test_filtering_identity_descriptor.json | 74 4 files changed, 148 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/0cf0c70e/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptorContainer.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptorContainer.java b/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptorContainer.java index ad2437a..ec80c76 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptorContainer.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptorContainer.java @@ -18,19 +18,26 @@ package org.apache.ambari.server.state.kerberos; -import org.apache.ambari.server.AmbariException; - import java.util.ArrayList; import java.util.Collection; import java.util.Collections; -import java.util.TreeMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.TreeMap; import java.util.TreeSet; import java.util.regex.Pattern; +import org.apache.ambari.server.AmbariException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.common.base.Function; +import com.google.common.base.Functions; +import com.google.common.base.Predicates; +import com.google.common.collect.Sets; + /** * AbstractKerberosDescriptorContainer is an abstract class implementing AbstractKerberosDescriptor * and providing facility to handle common descriptor container functionality. @@ -85,6 +92,7 @@ import java.util.regex.Pattern; * left up to the implementing class to do so. */ public abstract class AbstractKerberosDescriptorContainer extends AbstractKerberosDescriptor { + private static final Logger LOG = LoggerFactory.getLogger(AbstractKerberosDescriptorContainer.class); /** * Regular expression pattern used to parse auth_to_local property specifications into the following @@ -244,14 +252,29 @@ public abstract class AbstractKerberosDescriptorContainer extends AbstractKerber // Make sure this Kerberos Identity is not to be filtered out based on its "when" clause if ((identityToAdd != null) && ((contextForFilter == null) || identityToAdd.shouldInclude(contextForFilter))) { - list.add(identityToAdd); + if (isReferredServiceInstalled(identity, contextForFilter)) { +list.add(identityToAdd); + } else { +LOG.info("Skipping identity {} because referred service is not installed.", identityToAdd.getName()); + } } } - return list; } } + private static boolean isReferredServiceInstalled(KerberosIdentityDescriptor identity, Map contextForFilter) { +if (contextForFilter == null || !(contextForFilter.get("services") instanceof Collection)) { + return true; +} +Set installedServices = Sets.newHashSet((Collection) contextForFilter.get("services")); +return identity.getReferencedServiceName().transform(contains(installedServices)).or(true); + } + + private static Function contains(final Set installed) { +return Functions.forPredicate(Predicates.in(installed)); + } + /** * Return a KerberosIdentityDescriptor with the specified name. * http://git-wip-us.apache.org/repos/asf/ambari/blob/0cf0c70e/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosIdentityDescriptor.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosIdentityDescriptor.java
[1/2] ambari git commit: AMBARI-20540. Referenced Kerberos identity definitions should be created and distributed only if the referenced service or component is installed
Repository: ambari Updated Branches: refs/heads/branch-2.5 52fdbb9d0 -> 0cf0c70e6 refs/heads/trunk 3dcfe53f3 -> 52bca5cc6 AMBARI-20540. Referenced Kerberos identity definitions should be created and distributed only if the referenced service or component is installed Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/52bca5cc Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/52bca5cc Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/52bca5cc Branch: refs/heads/trunk Commit: 52bca5cc6d93f139326a53953d4e73f9a9c29fad Parents: 3dcfe53 Author: Attila MagyarAuthored: Fri Mar 31 19:37:50 2017 +0200 Committer: Attila Doroszlai Committed: Fri Mar 31 19:37:50 2017 +0200 -- .../AbstractKerberosDescriptorContainer.java| 27 ++- .../kerberos/KerberosIdentityDescriptor.java| 18 + .../state/kerberos/KerberosDescriptorTest.java | 19 + .../test_filtering_identity_descriptor.json | 74 4 files changed, 136 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/52bca5cc/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptorContainer.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptorContainer.java b/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptorContainer.java index 73381ee..0a89c1d 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptorContainer.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptorContainer.java @@ -30,6 +30,13 @@ import java.util.TreeSet; import java.util.regex.Pattern; import org.apache.ambari.server.AmbariException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.common.base.Function; +import com.google.common.base.Functions; +import com.google.common.base.Predicates; +import com.google.common.collect.Sets; /** * AbstractKerberosDescriptorContainer is an abstract class implementing AbstractKerberosDescriptor @@ -85,6 +92,7 @@ import org.apache.ambari.server.AmbariException; * left up to the implementing class to do so. */ public abstract class AbstractKerberosDescriptorContainer extends AbstractKerberosDescriptor { + private static final Logger LOG = LoggerFactory.getLogger(AbstractKerberosDescriptorContainer.class); /** * Regular expression pattern used to parse auth_to_local property specifications into the following @@ -244,14 +252,29 @@ public abstract class AbstractKerberosDescriptorContainer extends AbstractKerber // Make sure this Kerberos Identity is not to be filtered out based on its "when" clause if ((identityToAdd != null) && ((contextForFilter == null) || identityToAdd.shouldInclude(contextForFilter))) { - list.add(identityToAdd); + if (isReferredServiceInstalled(identity, contextForFilter)) { +list.add(identityToAdd); + } else { +LOG.info("Skipping identity {} because referred service is not installed.", identityToAdd.getName()); + } } } - return list; } } + private static boolean isReferredServiceInstalled(KerberosIdentityDescriptor identity, Map contextForFilter) { +if (contextForFilter == null || !(contextForFilter.get("services") instanceof Collection)) { + return true; +} +Set installedServices = Sets.newHashSet((Collection) contextForFilter.get("services")); +return identity.getReferencedServiceName().transform(contains(installedServices)).or(true); + } + + private static Function contains(final Set installed) { +return Functions.forPredicate(Predicates.in(installed)); + } + /** * Return a KerberosIdentityDescriptor with the specified name. * http://git-wip-us.apache.org/repos/asf/ambari/blob/52bca5cc/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosIdentityDescriptor.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosIdentityDescriptor.java b/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosIdentityDescriptor.java index ae78de6..7c32732 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosIdentityDescriptor.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosIdentityDescriptor.java @@ -22,6 +22,8 @@ import
ambari git commit: AMBARI-20609 Fix Install Wizard data attribute. (akovalenko)
Repository: ambari Updated Branches: refs/heads/trunk 8342abd21 -> 3dcfe53f3 AMBARI-20609 Fix Install Wizard data attribute. (akovalenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/3dcfe53f Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3dcfe53f Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3dcfe53f Branch: refs/heads/trunk Commit: 3dcfe53f378101998d822168f153649355e9714f Parents: 8342abd Author: Aleksandr KovalenkoAuthored: Fri Mar 31 18:49:25 2017 +0300 Committer: Aleksandr Kovalenko Committed: Fri Mar 31 19:07:47 2017 +0300 -- .../templates/common/configs/overriddenProperty.hbs | 4 ++-- .../common/configs/service_config_category.hbs | 16 .../templates/common/configs/services_config.hbs| 6 +++--- ambari-web/app/templates/common/modal_popup.hbs | 4 ++-- ambari-web/app/templates/wizard/step7.hbs | 4 ++-- .../configs/service_configs_by_category_view.js | 6 +- ambari-web/app/views/common/controls_view.js| 5 ++--- 7 files changed, 24 insertions(+), 21 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/3dcfe53f/ambari-web/app/templates/common/configs/overriddenProperty.hbs -- diff --git a/ambari-web/app/templates/common/configs/overriddenProperty.hbs b/ambari-web/app/templates/common/configs/overriddenProperty.hbs index ff3e812..3c34d70 100644 --- a/ambari-web/app/templates/common/configs/overriddenProperty.hbs +++ b/ambari-web/app/templates/common/configs/overriddenProperty.hbs @@ -16,7 +16,7 @@ * limitations under the License. }} {{! Here serviceConfigBinding should ideally be serviceConfigPropertyBinding }} - + {{view view.overriddenSCP.viewClass serviceConfigBinding="view.overriddenSCP" categoryConfigsBinding="view.parentView.categoryConfigs"}} @@ -51,7 +51,7 @@ {{/isAuthorized}} {{#if view.overriddenSCP.errorMessage}} -{{view.overriddenSCP.errorMessage}} +{{view.overriddenSCP.errorMessage}} {{/if}} {{else}} {{view.overriddenSCP.group.switchGroupTextShort}} http://git-wip-us.apache.org/repos/asf/ambari/blob/3dcfe53f/ambari-web/app/templates/common/configs/service_config_category.hbs -- diff --git a/ambari-web/app/templates/common/configs/service_config_category.hbs b/ambari-web/app/templates/common/configs/service_config_category.hbs index 0a4bf7f..87a716c 100644 --- a/ambari-web/app/templates/common/configs/service_config_category.hbs +++ b/ambari-web/app/templates/common/configs/service_config_category.hbs @@ -19,8 +19,8 @@ - -{{view.category.displayName}} + +{{view.category.displayName}} {{#if view.category.errorCount}} {{view.category.errorCount}} {{/if}} @@ -28,16 +28,16 @@ - + {{#each view.categoryConfigs}} {{#unless widget}} {{! configs with widgets should be shown only on the EnhancedConfigs tabs }} - + {{#if showLabel}} {{#unless rightSideLabel}} - + {{formatWordBreak displayName}} {{#if isSecureConfig}} {{! Here serviceConfigBinding should ideally be serviceConfigPropertyBinding }} {{#if this.isOriginalSCP}} - + {{view viewClass serviceConfigBinding="this" categoryConfigsAllBinding="view.categoryConfigsAll" }} {{#if rightSideLabel}} {{formatWordBreak displayName}} @@ -75,11 +75,11 @@ {{/if}} {{view App.ControlsView serviceConfigPropertyBinding="this"}} {{#if errorMessage}} -{{errorMessage}} +{{errorMessage}} {{/if}} {{#if warnMessage}} - {{warnMessage}} + {{warnMessage}} {{/if}} http://git-wip-us.apache.org/repos/asf/ambari/blob/3dcfe53f/ambari-web/app/templates/common/configs/services_config.hbs -- diff --git a/ambari-web/app/templates/common/configs/services_config.hbs b/ambari-web/app/templates/common/configs/services_config.hbs index d052424..914a1dc 100644 --- a/ambari-web/app/templates/common/configs/services_config.hbs +++
ambari git commit: AMBARI-20609. Fix Install Wizard data attribute. Step 10 (alexantonenko)
Repository: ambari Updated Branches: refs/heads/trunk d245d1ee3 -> 8342abd21 AMBARI-20609. Fix Install Wizard data attribute. Step 10 (alexantonenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8342abd2 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8342abd2 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8342abd2 Branch: refs/heads/trunk Commit: 8342abd210dff3cce7982ea91d17379f0b6270fe Parents: d245d1e Author: Alex AntonenkoAuthored: Fri Mar 31 18:44:14 2017 +0300 Committer: Alex Antonenko Committed: Fri Mar 31 18:55:48 2017 +0300 -- ambari-web/app/templates/wizard/step10.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/8342abd2/ambari-web/app/templates/wizard/step10.hbs -- diff --git a/ambari-web/app/templates/wizard/step10.hbs b/ambari-web/app/templates/wizard/step10.hbs index 2e242eb..3c1012e 100644 --- a/ambari-web/app/templates/wizard/step10.hbs +++ b/ambari-web/app/templates/wizard/step10.hbs @@ -27,7 +27,7 @@ - + {{#each item in clusterInfo}}
[1/2] ambari git commit: AMBARI-20643: Remove configuring JDBC dependencies that are getting configured for Zeppelin interpreter as it causes more confusion than the resolution. (Prabhjyot Singh via r
Repository: ambari Updated Branches: refs/heads/branch-2.5 adbc4e848 -> 52fdbb9d0 refs/heads/trunk f615c6760 -> d245d1ee3 AMBARI-20643: Remove configuring JDBC dependencies that are getting configured for Zeppelin interpreter as it causes more confusion than the resolution. (Prabhjyot Singh via r-kamath) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d245d1ee Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d245d1ee Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d245d1ee Branch: refs/heads/trunk Commit: d245d1ee3f992a64cb086a6e3692ad8712814845 Parents: f615c67 Author: Renjith KamathAuthored: Fri Mar 31 20:07:09 2017 +0530 Committer: Renjith Kamath Committed: Fri Mar 31 20:07:09 2017 +0530 -- .../ZEPPELIN/0.6.0.2.5/package/scripts/master.py | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/d245d1ee/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py -- diff --git a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py index 2b21f8f..fbf2246 100644 --- a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py +++ b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py @@ -371,13 +371,6 @@ class Master(Script): params.hive_server_interactive_hosts + \ ':' + params.hive_server_port -if params.hive_server_host or params.hive_server_interactive_hosts: - interpreter['dependencies'].append( -{"groupArtifactVersion": "org.apache.hive:hive-jdbc:2.0.1", "local": "false"}) - interpreter['dependencies'].append( -{"groupArtifactVersion": "org.apache.hadoop:hadoop-common:2.7.2", "local": "false"}) - interpreter['dependencies'].append( -{"groupArtifactVersion": "org.apache.hive.shims:hive-shims-0.23:2.1.0", "local": "false"}) if params.zookeeper_znode_parent \ and params.hbase_zookeeper_quorum: @@ -388,8 +381,7 @@ class Master(Script): interpreter['properties']['phoenix.url'] = "jdbc:phoenix:" + \ params.hbase_zookeeper_quorum + ':' + \ params.zookeeper_znode_parent -interpreter['dependencies'].append( -{"groupArtifactVersion": "org.apache.phoenix:phoenix-core:4.7.0-HBase-1.1", "local": "false"}) + elif interpreter['group'] == 'livy' and interpreter['name'] == 'livy': if params.livy_livyserver_host: interpreter['properties']['zeppelin.livy.url'] = "http://; + params.livy_livyserver_host + \
[2/2] ambari git commit: AMBARI-20643: Remove configuring JDBC dependencies that are getting configured for Zeppelin interpreter as it causes more confusion than the resolution. (Prabhjyot Singh via r
AMBARI-20643: Remove configuring JDBC dependencies that are getting configured for Zeppelin interpreter as it causes more confusion than the resolution. (Prabhjyot Singh via r-kamath) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/52fdbb9d Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/52fdbb9d Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/52fdbb9d Branch: refs/heads/branch-2.5 Commit: 52fdbb9d03a7af8f3db5f61ee7266868a03d65e0 Parents: adbc4e8 Author: Renjith KamathAuthored: Fri Mar 31 20:07:09 2017 +0530 Committer: Renjith Kamath Committed: Fri Mar 31 20:08:54 2017 +0530 -- .../ZEPPELIN/0.6.0.2.5/package/scripts/master.py | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/52fdbb9d/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py -- diff --git a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py index 38bfeb4..65c7f2b 100644 --- a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py +++ b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py @@ -355,13 +355,6 @@ class Master(Script): params.hive_server_interactive_hosts + \ ':' + params.hive_server_port -if params.hive_server_host or params.hive_server_interactive_hosts: - interpreter['dependencies'].append( -{"groupArtifactVersion": "org.apache.hive:hive-jdbc:2.0.1", "local": "false"}) - interpreter['dependencies'].append( -{"groupArtifactVersion": "org.apache.hadoop:hadoop-common:2.7.2", "local": "false"}) - interpreter['dependencies'].append( -{"groupArtifactVersion": "org.apache.hive.shims:hive-shims-0.23:2.1.0", "local": "false"}) if params.zookeeper_znode_parent \ and params.hbase_zookeeper_quorum: @@ -372,8 +365,7 @@ class Master(Script): interpreter['properties']['phoenix.url'] = "jdbc:phoenix:" + \ params.hbase_zookeeper_quorum + ':' + \ params.zookeeper_znode_parent -interpreter['dependencies'].append( -{"groupArtifactVersion": "org.apache.phoenix:phoenix-core:4.7.0-HBase-1.1", "local": "false"}) + elif interpreter['group'] == 'livy' and interpreter['name'] == 'livy': if params.livy_livyserver_host: interpreter['properties']['zeppelin.livy.url'] = "http://; + params.livy_livyserver_host + \
ambari git commit: AMBARI-20637 Cover service views with unit tests. (atkach)
Repository: ambari Updated Branches: refs/heads/trunk 9741236f3 -> f615c6760 AMBARI-20637 Cover service views with unit tests. (atkach) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f615c676 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f615c676 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f615c676 Branch: refs/heads/trunk Commit: f615c6760211f3d23625c4c952d47ce5db85af2a Parents: 9741236 Author: Andrii TkachAuthored: Thu Mar 30 19:23:05 2017 +0300 Committer: Andrii Tkach Committed: Fri Mar 31 16:16:16 2017 +0300 -- ambari-web/app/assets/test/tests.js | 4 + .../main/service/manage_config_groups_view.js | 2 +- ambari-web/app/views/main/service/menu.js | 40 +-- .../app/views/main/service/reconfigure.js | 8 +- ambari-web/app/views/main/service/service.js| 23 +- ambari-web/test/views/main/service/item_test.js | 163 +++- .../service/manage_config_groups_view_test.js | 125 + ambari-web/test/views/main/service/menu_test.js | 210 --- .../views/main/service/reassign_view_test.js| 128 + .../test/views/main/service/reconfigure_test.js | 126 + .../test/views/main/service/service_test.js | 266 +++ 11 files changed, 1001 insertions(+), 94 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/f615c676/ambari-web/app/assets/test/tests.js -- diff --git a/ambari-web/app/assets/test/tests.js b/ambari-web/app/assets/test/tests.js index d404d1f..8859a29 100644 --- a/ambari-web/app/assets/test/tests.js +++ b/ambari-web/app/assets/test/tests.js @@ -332,6 +332,10 @@ var files = [ 'test/views/main/charts/heatmap_test', 'test/views/main/charts/heatmap/heatmap_host_test', 'test/views/main/service/item_test', + 'test/views/main/service/manage_config_groups_view_test', + 'test/views/main/service/reassign_view_test', + 'test/views/main/service/reconfigure_test', + 'test/views/main/service/service_test', 'test/views/main/service/info/config_test', 'test/views/main/service/info/summary_test', 'test/views/main/service/info/menu_test', http://git-wip-us.apache.org/repos/asf/ambari/blob/f615c676/ambari-web/app/views/main/service/manage_config_groups_view.js -- diff --git a/ambari-web/app/views/main/service/manage_config_groups_view.js b/ambari-web/app/views/main/service/manage_config_groups_view.js index 7517b43..4973984 100644 --- a/ambari-web/app/views/main/service/manage_config_groups_view.js +++ b/ambari-web/app/views/main/service/manage_config_groups_view.js @@ -85,7 +85,7 @@ App.MainServiceManageConfigGroupView = Em.View.extend({ if (!selectedConfigGroup.get('isDefault') && selectedConfigGroup.get('isAddHostsDisabled')) { return Em.I18n.t('services.service.config_groups_popup.addHostDisabled'); } else { - return Em.I18n.t('services.service.config_groups_popup.addHost'); + return Em.I18n.t('services.service.config_groups_popup.addHost'); } }.property('controller.selectedConfigGroup.isDefault', 'controller.selectedConfigGroup.isAddHostsDisabled'), http://git-wip-us.apache.org/repos/asf/ambari/blob/f615c676/ambari-web/app/views/main/service/menu.js -- diff --git a/ambari-web/app/views/main/service/menu.js b/ambari-web/app/views/main/service/menu.js index c168e54..3695bfe 100644 --- a/ambari-web/app/views/main/service/menu.js +++ b/ambari-web/app/views/main/service/menu.js @@ -22,28 +22,28 @@ App.MainServiceMenuView = Em.CollectionView.extend({ disabledServices: [], content: function () { -return App.router.get('mainServiceController.content').filter(function(item){ +return App.router.get('mainServiceController.content').filter(function (item) { return !this.get('disabledServices').contains(item.get('id')); }, this); }.property('App.router.mainServiceController.content', 'App.router.mainServiceController.content.length'), - didInsertElement:function () { + didInsertElement: function () { App.router.location.addObserver('lastSetURL', this, 'renderOnRoute'); this.renderOnRoute(); -App.tooltip(this.$(".restart-required-service"), {html:true, placement:"right"}); +App.tooltip(this.$(".restart-required-service"), {html: true, placement: "right"}); }, - willDestroyElement: function() { + willDestroyElement: function () { App.router.location.removeObserver('lastSetURL', this, 'renderOnRoute'); this.$(".restart-required-service").tooltip('destroy'); }, - activeServiceId:null, +
ambari git commit: AMBARI-20628. Ambari doesn't set properties correctly (magyari_sandor)
Repository: ambari Updated Branches: refs/heads/branch-2.5 0345d1bf2 -> adbc4e848 AMBARI-20628. Ambari doesn't set properties correctly (magyari_sandor) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/adbc4e84 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/adbc4e84 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/adbc4e84 Branch: refs/heads/branch-2.5 Commit: adbc4e848504dd3d25e9c09f81371a8880279231 Parents: 0345d1b Author: Sandor MagyariAuthored: Thu Mar 30 12:04:19 2017 +0200 Committer: Sandor Magyari Committed: Fri Mar 31 14:54:34 2017 +0200 -- .../stackadvisor/StackAdvisorBlueprintProcessor.java | 8 ++-- .../stackadvisor/StackAdvisorBlueprintProcessorTest.java | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/adbc4e84/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessor.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessor.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessor.java index eb3d7e2..b7365fb 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessor.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessor.java @@ -176,7 +176,11 @@ public class StackAdvisorBlueprintProcessor { Preconditions.checkArgument(response.getRecommendations().getBlueprint().getConfigurations() != null, "Configurations are missing from the recommendation blueprint response."); -Map > userProvidedProperties = getUserProvidedProperties(topology, existingConfigurations); +Map > userProvidedProperties = existingConfigurations; +if (topology.getConfigRecommendationStrategy() == ConfigRecommendationStrategy.ONLY_STACK_DEFAULTS_APPLY) { + userProvidedProperties = getUserProvidedProperties(topology, existingConfigurations); +} + Map recommendedConfigurations = response.getRecommendations().getBlueprint().getConfigurations(); for (Map.Entry configEntry : recommendedConfigurations.entrySet()) { @@ -184,7 +188,7 @@ public class StackAdvisorBlueprintProcessor { BlueprintConfigurations blueprintConfig = filterBlueprintConfig(configType, configEntry.getValue(), userProvidedProperties, topology); topology.getAdvisedConfigurations().put(configType, new AdvisedConfiguration( -blueprintConfig.getProperties(), blueprintConfig.getPropertyAttributes())); + blueprintConfig.getProperties(), blueprintConfig.getPropertyAttributes())); } } http://git-wip-us.apache.org/repos/asf/ambari/blob/adbc4e84/ambari-server/src/test/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessorTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessorTest.java index 3f4b273..91fdda2 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessorTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessorTest.java @@ -113,7 +113,7 @@ public class StackAdvisorBlueprintProcessorTest { expect(clusterTopology.getAdvisedConfigurations()).andReturn(advisedConfigurations).anyTimes(); expect(clusterTopology.getConfiguration()).andReturn(configuration).anyTimes(); expect(clusterTopology.isClusterKerberosEnabled()).andReturn(false).anyTimes(); - expect(clusterTopology.getConfigRecommendationStrategy()).andReturn(ConfigRecommendationStrategy.ONLY_STACK_DEFAULTS_APPLY); + expect(clusterTopology.getConfigRecommendationStrategy()).andReturn(ConfigRecommendationStrategy.ONLY_STACK_DEFAULTS_APPLY).anyTimes(); expect(blueprint.getStack()).andReturn(stack).anyTimes(); expect(stack.getVersion()).andReturn("2.3").anyTimes(); expect(stack.getName()).andReturn("HDP").anyTimes(); @@ -148,7 +148,7 @@ public class StackAdvisorBlueprintProcessorTest {
ambari git commit: AMBARI-20628. Ambari doesn't set properties correctly (magyari_sandor)
Repository: ambari Updated Branches: refs/heads/trunk f37a342a0 -> 9741236f3 AMBARI-20628. Ambari doesn't set properties correctly (magyari_sandor) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9741236f Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9741236f Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9741236f Branch: refs/heads/trunk Commit: 9741236f3c8b4a8a293fa0b7db5c64c0e7aa704d Parents: f37a342 Author: Sandor MagyariAuthored: Thu Mar 30 12:04:19 2017 +0200 Committer: Sandor Magyari Committed: Fri Mar 31 14:52:03 2017 +0200 -- .../stackadvisor/StackAdvisorBlueprintProcessor.java | 8 ++-- .../stackadvisor/StackAdvisorBlueprintProcessorTest.java | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/9741236f/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessor.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessor.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessor.java index 0abcc14..b7eca71 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessor.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessor.java @@ -175,7 +175,11 @@ public class StackAdvisorBlueprintProcessor { Preconditions.checkArgument(response.getRecommendations().getBlueprint().getConfigurations() != null, "Configurations are missing from the recommendation blueprint response."); -Map > userProvidedProperties = getUserProvidedProperties(topology, existingConfigurations); +Map > userProvidedProperties = existingConfigurations; +if (topology.getConfigRecommendationStrategy() == ConfigRecommendationStrategy.ONLY_STACK_DEFAULTS_APPLY) { + userProvidedProperties = getUserProvidedProperties(topology, existingConfigurations); +} + Map recommendedConfigurations = response.getRecommendations().getBlueprint().getConfigurations(); for (Map.Entry configEntry : recommendedConfigurations.entrySet()) { @@ -183,7 +187,7 @@ public class StackAdvisorBlueprintProcessor { BlueprintConfigurations blueprintConfig = filterBlueprintConfig(configType, configEntry.getValue(), userProvidedProperties, topology); topology.getAdvisedConfigurations().put(configType, new AdvisedConfiguration( -blueprintConfig.getProperties(), blueprintConfig.getPropertyAttributes())); + blueprintConfig.getProperties(), blueprintConfig.getPropertyAttributes())); } } http://git-wip-us.apache.org/repos/asf/ambari/blob/9741236f/ambari-server/src/test/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessorTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessorTest.java index 49f070a..3febd48 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessorTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessorTest.java @@ -114,7 +114,7 @@ public class StackAdvisorBlueprintProcessorTest { expect(clusterTopology.getAdvisedConfigurations()).andReturn(advisedConfigurations).anyTimes(); expect(clusterTopology.getConfiguration()).andReturn(configuration).anyTimes(); expect(clusterTopology.isClusterKerberosEnabled()).andReturn(false).anyTimes(); - expect(clusterTopology.getConfigRecommendationStrategy()).andReturn(ConfigRecommendationStrategy.ONLY_STACK_DEFAULTS_APPLY); + expect(clusterTopology.getConfigRecommendationStrategy()).andReturn(ConfigRecommendationStrategy.ONLY_STACK_DEFAULTS_APPLY).anyTimes(); expect(blueprint.getStack()).andReturn(stack).anyTimes(); expect(stack.getVersion()).andReturn("2.3").anyTimes(); expect(stack.getName()).andReturn("HDP").anyTimes(); @@ -149,7 +149,7 @@ public class StackAdvisorBlueprintProcessorTest {
ambari git commit: AMBARI-20609 Fix Install Wizard data attribute. (ababiichuk)
Repository: ambari Updated Branches: refs/heads/trunk 388c6c102 -> f37a342a0 AMBARI-20609 Fix Install Wizard data attribute. (ababiichuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f37a342a Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f37a342a Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f37a342a Branch: refs/heads/trunk Commit: f37a342a040a1a9b4ae951c2dfabbf43b3bb1173 Parents: 388c6c1 Author: ababiichukAuthored: Fri Mar 31 15:08:53 2017 +0300 Committer: ababiichuk Committed: Fri Mar 31 15:08:53 2017 +0300 -- .../main/resources/ui/admin-web/app/index.html | 4 +- ambari-web/app/controllers/installer.js | 6 +- .../app/controllers/wizard/step1_controller.js | 6 +- .../app/controllers/wizard/step3_controller.js | 2 + ambari-web/app/messages.js | 8 +- ambari-web/app/models/repository.js | 15 +- ambari-web/app/templates/application.hbs| 6 +- ambari-web/app/templates/common/modal_popup.hbs | 2 +- ambari-web/app/templates/common/pagination.hbs | 2 +- ambari-web/app/templates/login.hbs | 12 +- ambari-web/app/templates/main.hbs | 2 +- ambari-web/app/templates/wizard/step0.hbs | 9 +- ambari-web/app/templates/wizard/step1.hbs | 70 +++--- ambari-web/app/templates/wizard/step2.hbs | 246 ++- ambari-web/app/templates/wizard/step3.hbs | 63 ++--- .../step3/step3_host_warning_popup_footer.hbs | 5 +- .../wizard/step3/step3_host_warnings_popup.hbs | 29 ++- .../step3/step3_registered_hosts_popup.hbs | 2 +- ambari-web/app/utils/helper.js | 5 +- ambari-web/app/views/common/checkbox_view.js| 1 + ambari-web/app/views/login.js | 6 +- ambari-web/app/views/wizard/step1_view.js | 6 +- ambari-web/app/views/wizard/step2_view.js | 4 +- .../wizard/step3/hostWarningPopupBody_view.js | 3 +- ambari-web/test/controllers/installer_test.js | 6 +- ambari-web/test/views/wizard/step1_view_test.js | 16 +- 26 files changed, 279 insertions(+), 257 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/f37a342a/ambari-admin/src/main/resources/ui/admin-web/app/index.html -- diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/index.html b/ambari-admin/src/main/resources/ui/admin-web/app/index.html index d17ec53..32f9ba7 100644 --- a/ambari-admin/src/main/resources/ui/admin-web/app/index.html +++ b/ambari-admin/src/main/resources/ui/admin-web/app/index.html @@ -48,8 +48,8 @@ - -{{'common.ambari' | translate}} + +{{'common.ambari' | translate}} http://git-wip-us.apache.org/repos/asf/ambari/blob/f37a342a/ambari-web/app/controllers/installer.js -- diff --git a/ambari-web/app/controllers/installer.js b/ambari-web/app/controllers/installer.js index 35056f7..553ec43 100644 --- a/ambari-web/app/controllers/installer.js +++ b/ambari-web/app/controllers/installer.js @@ -856,7 +856,7 @@ App.InstallerController = App.WizardController.extend(App.UserPref, { repo.setProperties({ errorTitle: '', errorContent: '', - validation: App.Repository.validation.INPROGRESS + validation: 'INPROGRESS' }); this.set('content.isCheckInProgress', true); App.ajax.send({ @@ -896,7 +896,7 @@ App.InstallerController = App.WizardController.extend(App.UserPref, { var os = selectedStack.get('operatingSystems').findProperty('id', data.osId); var repo = os.get('repositories').findProperty('repoId', data.repoId); if (repo) { -repo.set('validation', App.Repository.validation.OK); +repo.set('validation', 'OK'); } } this.set('validationCnt', this.get('validationCnt') - 1); @@ -916,7 +916,7 @@ App.InstallerController = App.WizardController.extend(App.UserPref, { var repo = os.get('repositories').findProperty('repoId', params.repoId); if (repo) { repo.setProperties({ - validation: App.Repository.validation.INVALID, + validation: 'INVALID', errorTitle: request.status + ":" + request.statusText, errorContent: $.parseJSON(request.responseText) ? $.parseJSON(request.responseText).message : "" }); http://git-wip-us.apache.org/repos/asf/ambari/blob/f37a342a/ambari-web/app/controllers/wizard/step1_controller.js
ambari git commit: AMBARI-20609. Fix Install Wizard data attribute (onechiporenko)
Repository: ambari Updated Branches: refs/heads/trunk ee24a25d1 -> 388c6c102 AMBARI-20609. Fix Install Wizard data attribute (onechiporenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/388c6c10 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/388c6c10 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/388c6c10 Branch: refs/heads/trunk Commit: 388c6c102a346b7d0859f9f30fcd3c99164d0a63 Parents: ee24a25 Author: Oleg NechiporenkoAuthored: Fri Mar 31 11:50:22 2017 +0300 Committer: Oleg Nechiporenko Committed: Fri Mar 31 11:50:22 2017 +0300 -- ambari-web/app/templates/wizard/step8.hbs | 8 1 file changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/388c6c10/ambari-web/app/templates/wizard/step8.hbs -- diff --git a/ambari-web/app/templates/wizard/step8.hbs b/ambari-web/app/templates/wizard/step8.hbs index 9e50e30..f0e7b83 100644 --- a/ambari-web/app/templates/wizard/step8.hbs +++ b/ambari-web/app/templates/wizard/step8.hbs @@ -27,7 +27,7 @@ - + {{#each item in controller.clusterInfo}} @@ -62,12 +62,12 @@ {{t menu.item.services}}: {{#each controller.services}} - -{{display_name}} + +{{display_name}} {{#each component in this.service_components}} - {{component.display_name }} : {{component.component_value}} + {{component.display_name }} : {{component.component_value}} {{/each}}
[18/55] [abbrv] ambari git commit: AMBARI-19149. Code cleanup: redundant type arguments
http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog221.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog221.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog221.java index 3d263cf..c235cf8 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog221.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog221.java @@ -393,7 +393,7 @@ public class UpgradeCatalog221 extends AbstractUpgradeCatalog { VersionUtils.compareVersions(stackId.getStackVersion(), "2.3") >= 0); if (isStackNotLess23) { - Mapupdates = new HashMap (); + Map updates = new HashMap<>(); if (tezCountersMaxProperty != null && tezCountersMaxProperty.equals("2000")) { updates.put(TEZ_COUNTERS_MAX, "1"); } http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog222.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog222.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog222.java index ab3b493..f0f9253 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog222.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog222.java @@ -226,7 +226,7 @@ public class UpgradeCatalog222 extends AbstractUpgradeCatalog { if (zooEnv != null && zooEnv.getProperties().containsKey("zk_server_heapsize")) { String heapSizeValue = zooEnv.getProperties().get("zk_server_heapsize"); if(!heapSizeValue.endsWith("m")) { - Map updates = new HashMap (); + Map updates = new HashMap<>(); updates.put("zk_server_heapsize", heapSizeValue+"m"); updateConfigurationPropertiesForCluster(cluster, "zookeeper-env", updates, true, false); } @@ -290,7 +290,7 @@ public class UpgradeCatalog222 extends AbstractUpgradeCatalog { for (final Cluster cluster : clusterMap.values()) { if (cluster.getDesiredConfigByType("storm-site") != null && cluster.getDesiredConfigByType("storm-site").getProperties().containsKey("storm.zookeeper.superACL") && cluster.getDesiredConfigByType("storm-site").getProperties().get("storm.zookeeper.superACL").equals("sasl:{{storm_base_jaas_principal}}")) { -Map newStormProps = new HashMap (); +Map newStormProps = new HashMap<>(); newStormProps.put("storm.zookeeper.superACL", "sasl:{{storm_bare_jaas_principal}}"); updateConfigurationPropertiesForCluster(cluster, "storm-site", newStormProps, true, false); } @@ -669,7 +669,7 @@ public class UpgradeCatalog222 extends AbstractUpgradeCatalog { VersionUtils.compareVersions(stackId.getStackVersion(), "2.3") >= 0); List atlasHost = cluster.getServiceComponentHosts("ATLAS", "ATLAS_SERVER"); - Map updates = new HashMap (); + Map updates = new HashMap<>(); if (isStackNotLess23 && atlasHost.size() != 0 && hiveSiteConfig != null) { http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog230.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog230.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog230.java index 6cda590..a53ac95 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog230.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog230.java @@ -279,7 +279,7 @@ public class UpgradeCatalog230 extends AbstractUpgradeCatalog { Collection administratorOnly = Collections.singleton(administratorPermission); // A map of the authorizations to the relevant roles -Map map = new HashMap (); +Map map = new HashMap<>(); map.put("VIEW.USE", viewUserAndAdministrator); map.put("SERVICE.VIEW_METRICS", clusterUserAndUp); map.put("SERVICE.VIEW_STATUS_INFO", clusterUserAndUp); @@ -351,14 +351,14 @@ public class UpgradeCatalog230 extends AbstractUpgradeCatalog { // Add roleauthorization table LOG.info("Creating " + ROLE_AUTHORIZATION_TABLE + " table"); -columns = new ArrayList(); +columns = new ArrayList<>();
[20/55] [abbrv] ambari git commit: AMBARI-19149. Code cleanup: redundant type arguments
http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java index 6c89b88..2bc1e68 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java @@ -101,12 +101,12 @@ public class ClustersImpl implements Clusters { private static final Logger LOG = LoggerFactory.getLogger(ClustersImpl.class); - private final ConcurrentHashMapclusters = new ConcurrentHashMap (); - private final ConcurrentHashMap clustersById = new ConcurrentHashMap (); - private final ConcurrentHashMap hosts = new ConcurrentHashMap (); - private final ConcurrentHashMap hostsById = new ConcurrentHashMap (); - private final ConcurrentHashMap hostClusterMap = new ConcurrentHashMap (); - private final ConcurrentHashMap clusterHostMap = new ConcurrentHashMap (); + private final ConcurrentHashMap clusters = new ConcurrentHashMap<>(); + private final ConcurrentHashMap clustersById = new ConcurrentHashMap<>(); + private final ConcurrentHashMap hosts = new ConcurrentHashMap<>(); + private final ConcurrentHashMap hostsById = new ConcurrentHashMap<>(); + private final ConcurrentHashMap hostClusterMap = new ConcurrentHashMap<>(); + private final ConcurrentHashMap clusterHostMap = new ConcurrentHashMap<>(); @Inject private ClusterDAO clusterDAO; @@ -324,7 +324,7 @@ public class ClustersImpl implements Clusters { @Override public List getHosts() { -return new ArrayList(hosts.values()); +return new ArrayList<>(hosts.values()); } @Override @@ -413,7 +413,7 @@ public class ClustersImpl implements Clusters { // not stored to DB Host host = hostFactory.create(hostEntity); host.setAgentVersion(new AgentVersion("")); -List emptyDiskList = new CopyOnWriteArrayList(); +List emptyDiskList = new CopyOnWriteArrayList<>(); host.setDisksInfo(emptyDiskList); host.setHealthStatus(new HostHealthStatus(HealthStatus.UNKNOWN, "")); host.setHostAttributes(new ConcurrentHashMap ()); @@ -486,7 +486,7 @@ public class ClustersImpl implements Clusters { private Map getHostsMap(Collection hostSet) throws HostNotFoundException { -Map hostMap = new HashMap (); +Map hostMap = new HashMap<>(); Host host = null; for (String hostName : hostSet) { if (null != hostName) { @@ -612,7 +612,7 @@ public class ClustersImpl implements Clusters { public Map getHostsForCluster(String clusterName) throws AmbariException { -Map hosts = new HashMap (); +Map hosts = new HashMap<>(); for (Host h : clusterHostMap.get(clusterName)) { hosts.put(h.getHostName(), h); } @@ -623,7 +623,7 @@ public class ClustersImpl implements Clusters { @Override public Map getHostIdsForCluster(String clusterName) throws AmbariException { -Map hosts = new HashMap (); +Map hosts = new HashMap<>(); for (Host h : clusterHostMap.get(clusterName)) { HostEntity hostEntity = hostDAO.findByName(h.getHostName()); http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/state/configgroup/ConfigGroupImpl.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/configgroup/ConfigGroupImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/configgroup/ConfigGroupImpl.java index 03edcf8..89a03aa 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/configgroup/ConfigGroupImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/configgroup/ConfigGroupImpl.java @@ -147,8 +147,8 @@ public class ConfigGroupImpl implements ConfigGroup { configGroupId = configGroupEntity.getGroupId(); configGroupName = configGroupEntity.getGroupName(); -m_configurations = new ConcurrentHashMap (); -m_hosts = new ConcurrentHashMap (); +m_configurations = new ConcurrentHashMap<>(); +m_hosts = new ConcurrentHashMap<>(); // Populate configs for (ConfigGroupConfigMappingEntity configMappingEntity :
[09/55] [abbrv] ambari git commit: AMBARI-19149. Code cleanup: redundant type arguments
http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProviderTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProviderTest.java index 9e60dad..f890e17 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProviderTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProviderTest.java @@ -222,7 +222,7 @@ public class ClusterStackVersionResourceProviderTest { repoVersion.setId(1l); repoVersion.setOperatingSystems(OS_JSON); -MaphostsForCluster = new HashMap (); +Map hostsForCluster = new HashMap<>(); int hostCount = 10; for (int i = 0; i < hostCount; i++) { String hostname = "host" + i; @@ -271,7 +271,7 @@ public class ClusterStackVersionResourceProviderTest { AbstractControllerResourceProvider.init(resourceProviderFactory); -Map > hostConfigTags = new HashMap >(); +Map > hostConfigTags = new HashMap<>(); expect(configHelper.getEffectiveDesiredTags(anyObject(ClusterImpl.class), anyObject(String.class))).andReturn(hostConfigTags); expect(managementController.getClusters()).andReturn(clusters).anyTimes(); @@ -363,9 +363,9 @@ public class ClusterStackVersionResourceProviderTest { injector.injectMembers(provider); // add the property map to a set for the request. add more maps for multiple creates -Set
[43/55] [abbrv] ambari git commit: AMBARI-20617. Display log level, method name from stack_advisor in ambari-server.log (dlysnichenko)
http://git-wip-us.apache.org/repos/asf/ambari/blob/0ef14f56/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py -- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py index b693f9f..2a1113a 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py +++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py @@ -20,7 +20,6 @@ limitations under the License. import math from ambari_commons.str_utils import string_set_equals -from resource_management.core.logger import Logger from resource_management.core.exceptions import Fail from resource_management.libraries.functions.get_bare_principal import get_bare_principal @@ -29,7 +28,7 @@ class HDP25StackAdvisor(HDP24StackAdvisor): def __init__(self): super(HDP25StackAdvisor, self).__init__() -Logger.initialize_logger() +self.initialize_logger("HDP25StackAdvisor") self.HIVE_INTERACTIVE_SITE = 'hive-interactive-site' self.YARN_ROOT_DEFAULT_QUEUE_NAME = 'default' self.AMBARI_MANAGED_LLAP_QUEUE_NAME = 'llap' @@ -42,11 +41,11 @@ class HDP25StackAdvisor(HDP24StackAdvisor): putOozieEnvProperty = self.putProperty(configurations, "oozie-env", services) if not "oozie-env" in services["configurations"] : - Logger.info("No oozie configurations available") + self.logger.info("No oozie configurations available") return if not "FALCON_SERVER" in clusterData["components"] : - Logger.info("Falcon is not part of the installation") + self.logger.info("Falcon is not part of the installation") return falconUser = 'falcon' @@ -54,35 +53,35 @@ class HDP25StackAdvisor(HDP24StackAdvisor): if "falcon-env" in services["configurations"] : if "falcon_user" in services["configurations"]["falcon-env"]["properties"] : falconUser = services["configurations"]["falcon-env"]["properties"]["falcon_user"] -Logger.info("Falcon user from configuration: %s " % falconUser) +self.logger.info("Falcon user from configuration: %s " % falconUser) -Logger.info("Falcon user : %s" % falconUser) +self.logger.info("Falcon user : %s" % falconUser) oozieUser = 'oozie' if "oozie_user" \ in services["configurations"]["oozie-env"]["properties"] : oozieUser = services["configurations"]["oozie-env"]["properties"]["oozie_user"] - Logger.info("Oozie user from configuration %s" % oozieUser) + self.logger.info("Oozie user from configuration %s" % oozieUser) -Logger.info("Oozie user %s" % oozieUser) +self.logger.info("Oozie user %s" % oozieUser) if "oozie_admin_users" \ in services["configurations"]["oozie-env"]["properties"] : currentAdminUsers = services["configurations"]["oozie-env"]["properties"]["oozie_admin_users"] - Logger.info("Oozie admin users from configuration %s" % currentAdminUsers) + self.logger.info("Oozie admin users from configuration %s" % currentAdminUsers) else : currentAdminUsers = "{0}, oozie-admin".format(oozieUser) - Logger.info("Setting default oozie admin users to %s" % currentAdminUsers) + self.logger.info("Setting default oozie admin users to %s" % currentAdminUsers) if falconUser in currentAdminUsers : - Logger.info("Falcon user %s already member of oozie admin users " % falconUser) + self.logger.info("Falcon user %s already member of oozie admin users " % falconUser) return newAdminUsers = "{0},{1}".format(currentAdminUsers, falconUser) -Logger.info("new oozie admin users : %s" % newAdminUsers) +self.logger.info("new oozie admin users : %s" % newAdminUsers) services["forced-configurations"].append({"type" : "oozie-env", "name" : "oozie_admin_users"}) putOozieEnvProperty("oozie_admin_users", newAdminUsers) @@ -158,7 +157,7 @@ class HDP25StackAdvisor(HDP24StackAdvisor): auth_type = application_properties['atlas.authentication.method.ldap.type'] auth_ldap_enable = application_properties['atlas.authentication.method.ldap'].lower() == 'true' -Logger.info("Validating Atlas configs, authentication type: %s" % str(auth_type)) +self.logger.info("Validating Atlas configs, authentication type: %s" % str(auth_type)) # Required props ldap_props = {"atlas.authentication.method.ldap.url": "", @@ -308,7 +307,7 @@ class HDP25StackAdvisor(HDP24StackAdvisor): capacity_scheduler_properties, received_as_key_value_pair = self.getCapacitySchedulerProperties(services) if not capacity_scheduler_properties: - Logger.warning("Couldn't retrieve 'capacity-scheduler' properties while doing validation checks for Hive Server Interactive.") + self.logger.warning("Couldn't retrieve 'capacity-scheduler'
[49/55] [abbrv] ambari git commit: AMBARI-20609. Fix Install Wizard data attribute (alexantonenko)
AMBARI-20609. Fix Install Wizard data attribute (alexantonenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c614fb71 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c614fb71 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c614fb71 Branch: refs/heads/branch-3.0-perf Commit: c614fb71059f9c57ad91f2b5842c9c140d29b9ac Parents: f6917a9 Author: Alex AntonenkoAuthored: Thu Mar 30 19:00:01 2017 +0300 Committer: Andrew Onishuk Committed: Fri Mar 31 10:21:45 2017 +0300 -- .../app/controllers/wizard/step4_controller.js | 2 ++ ambari-web/app/templates/common/modal_popup.hbs | 2 +- ambari-web/app/templates/wizard/step4.hbs | 20 +--- .../step4/step4_ranger_requirements_popup.hbs | 2 +- ambari-web/app/views/common/checkbox_view.js| 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/c614fb71/ambari-web/app/controllers/wizard/step4_controller.js -- diff --git a/ambari-web/app/controllers/wizard/step4_controller.js b/ambari-web/app/controllers/wizard/step4_controller.js index 8165c8d..d82bf34 100644 --- a/ambari-web/app/controllers/wizard/step4_controller.js +++ b/ambari-web/app/controllers/wizard/step4_controller.js @@ -484,6 +484,7 @@ App.WizardStep4Controller = Em.ArrayController.extend({ needToAddServicePopup: function (services, i18nSuffix, serviceName, callback, id) { var self = this; return App.ModalPopup.show({ + 'data-qa': 'need-add-service-confirmation-modal', header: Em.I18n.t('installer.step4.' + i18nSuffix + '.popup.header').format(serviceName), body: Em.I18n.t('installer.step4.' + i18nSuffix + '.popup.body').format(serviceName), onPrimary: function () { @@ -551,6 +552,7 @@ App.WizardStep4Controller = Em.ArrayController.extend({ rangerRequirementsPopup: function (callback, id) { var self = this; return App.ModalPopup.show({ + 'data-qa': 'ranger-requirements-modal', header: Em.I18n.t('installer.step4.rangerRequirements.popup.header'), bodyClass: Em.View.extend({ templateName: require('templates/wizard/step4/step4_ranger_requirements_popup') http://git-wip-us.apache.org/repos/asf/ambari/blob/c614fb71/ambari-web/app/templates/common/modal_popup.hbs -- diff --git a/ambari-web/app/templates/common/modal_popup.hbs b/ambari-web/app/templates/common/modal_popup.hbs index cf3b235..96aa6dc 100644 --- a/ambari-web/app/templates/common/modal_popup.hbs +++ b/ambari-web/app/templates/common/modal_popup.hbs @@ -26,7 +26,7 @@ {{#if view.showCloseButton}} {{/if}} - + {{#if view.headerClass}} {{view view.headerClass}} {{else}} http://git-wip-us.apache.org/repos/asf/ambari/blob/c614fb71/ambari-web/app/templates/wizard/step4.hbs -- diff --git a/ambari-web/app/templates/wizard/step4.hbs b/ambari-web/app/templates/wizard/step4.hbs index 1dbf5e6..c688981 100644 --- a/ambari-web/app/templates/wizard/step4.hbs +++ b/ambari-web/app/templates/wizard/step4.hbs @@ -25,26 +25,24 @@ - {{t common.service}} - {{t common.version}} - {{t common.description}} + {{t common.service}} + {{t common.version}} + {{t common.description}} -{{view App.CheckboxView disabledBinding="isInstalled" checkedBinding="isAllChecked"}} +{{view App.CheckboxView data-qa="toggle-all" disabledBinding="isInstalled" checkedBinding="isAllChecked"}} {{#each controller}} {{#unless isHiddenOnSelectServicePage}} - - -{{displayNameOnSelectServicePage}} - - {{serviceVersionDisplay}} - {{{comments}}} + + {{displayNameOnSelectServicePage}} + {{serviceVersionDisplay}} + {{{comments}}} - {{view App.CheckboxView checkboxClassNamesBinding="serviceName" + {{view App.CheckboxView checkboxClassNamesBinding="serviceName" data-qa="toggle-service" disabledBinding="isDisabled" checkedBinding="isSelected" }} http://git-wip-us.apache.org/repos/asf/ambari/blob/c614fb71/ambari-web/app/templates/wizard/step4/step4_ranger_requirements_popup.hbs -- diff
[40/55] [abbrv] ambari git commit: AMBARI-18714. Move HIVE, PIG, SPARK, SPARK2, SLIDER, SQOOP, ACCUMULO, FALCON, KNOX, , MAHOUT, TEZ role command orders from stack to service definitions (aonishuk)
AMBARI-18714. Move HIVE, PIG, SPARK, SPARK2, SLIDER, SQOOP, ACCUMULO, FALCON, KNOX,, MAHOUT, TEZ role command orders from stack to service definitions (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/47a9421a Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/47a9421a Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/47a9421a Branch: refs/heads/branch-3.0-perf Commit: 47a9421ac9434383fa97a422eeca2347f976dde6 Parents: 441aaa4 Author: Andrew OnishukAuthored: Thu Mar 30 10:24:48 2017 +0300 Committer: Andrew Onishuk Committed: Fri Mar 31 10:21:45 2017 +0300 -- .../ACCUMULO/1.6.1.2.2.0/role_command_order.json | 14 ++ .../FALCON/0.5.0.2.1/role_command_order.json | 7 +++ .../HIVE/0.12.0.2.0/role_command_order.json | 14 ++ .../KNOX/0.5.0.2.2/role_command_order.json| 7 +++ .../MAHOUT/1.0.0.2.3/role_command_order.json | 6 ++ .../PIG/0.12.0.2.0/role_command_order.json| 6 ++ .../SPARK/1.2.1/role_command_order.json | 6 ++ .../SPARK/1.5.2/role_command_order.json | 6 ++ .../SPARK/1.6.0/role_command_order.json | 8 .../SPARK2/2.0.0/role_command_order.json | 6 ++ .../SQOOP/1.4.4.2.0/role_command_order.json | 6 ++ .../TEZ/0.4.0.2.1/role_command_order.json | 6 ++ 12 files changed, 92 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/47a9421a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/role_command_order.json -- diff --git a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/role_command_order.json b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/role_command_order.json new file mode 100644 index 000..c06aba1 --- /dev/null +++ b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/role_command_order.json @@ -0,0 +1,14 @@ +{ + "general_deps" : { +"_comment" : "dependencies for ACCUMUMLO", +"ACCUMULO_MASTER-START": ["ZOOKEEPER_SERVER-START", "NAMENODE-START", "DATANODE-START"], +"ACCUMULO_TSERVER-START": ["ACCUMULO_MASTER-START"], +"ACCUMULO_MONITOR-START": ["ACCUMULO_MASTER-START"], +"ACCUMULO_GC-START": ["ACCUMULO_MASTER-START"], +"ACCUMULO_TRACER-START": ["ACCUMULO_MASTER-START", "ACCUMULO_TSERVER-START"], +"ACCUMULO_MONITOR-STOP" : ["ACCUMULO_MASTER-STOP"], +"ACCUMULO_MASTER-STOP" : ["ACCUMULO_TSERVER-STOP"], +"ACCUMULO_TSERVER-STOP" : ["ACCUMULO_TRACER-STOP", "ACCUMULO_GC-STOP"], +"ACCUMULO_SERVICE_CHECK-SERVICE_CHECK": ["ACCUMULO_MASTER-START", "ACCUMULO_TSERVER-START", "ACCUMULO_TRACER-START"] + } +} http://git-wip-us.apache.org/repos/asf/ambari/blob/47a9421a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/role_command_order.json -- diff --git a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/role_command_order.json b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/role_command_order.json new file mode 100644 index 000..eab306c --- /dev/null +++ b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/role_command_order.json @@ -0,0 +1,7 @@ +{ + "general_deps" : { +"_comment" : "dependencies for FALCON", +"FALCON_SERVER-START": ["OOZIE_SERVER-START"], +"FALCON_SERVICE_CHECK-SERVICE_CHECK": ["FALCON_SERVER-START"] + } +} http://git-wip-us.apache.org/repos/asf/ambari/blob/47a9421a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/role_command_order.json -- diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/role_command_order.json b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/role_command_order.json new file mode 100644 index 000..5e10853 --- /dev/null +++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/role_command_order.json @@ -0,0 +1,14 @@ +{ + "general_deps" : { +"_comment" : "dependencies for HIVE", +"WEBHCAT_SERVER-START": ["NODEMANAGER-START", "HIVE_SERVER-START"], +"WEBHCAT_SERVER-RESTART": ["NODEMANAGER-RESTART", "HIVE_SERVER-RESTART"], +"HIVE_METASTORE-START": ["MYSQL_SERVER-START", "NAMENODE-START"], +"HIVE_METASTORE-RESTART": ["MYSQL_SERVER-RESTART", "NAMENODE-RESTART"], +"HIVE_SERVER-START": ["NODEMANAGER-START", "MYSQL_SERVER-START", "RANGER_USERSYNC-START", "ZOOKEEPER_SERVER-START"], +"HIVE_SERVER-RESTART": ["NODEMANAGER-RESTART",
[47/55] [abbrv] ambari git commit: AMBARI-20544. Prune files contained in jcepolicyinfo.jar to a minimal set (rlevas)
AMBARI-20544. Prune files contained in jcepolicyinfo.jar to a minimal set (rlevas) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/192a30fb Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/192a30fb Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/192a30fb Branch: refs/heads/branch-3.0-perf Commit: 192a30fbaf7969cdb6b541724b65b17a6ab00f80 Parents: 0ef14f5 Author: Robert LevasAuthored: Thu Mar 30 09:16:55 2017 -0400 Committer: Andrew Onishuk Committed: Fri Mar 31 10:21:45 2017 +0300 -- ambari-agent/pom.xml | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/192a30fb/ambari-agent/pom.xml -- diff --git a/ambari-agent/pom.xml b/ambari-agent/pom.xml index fb08ce2..a57ed64 100644 --- a/ambari-agent/pom.xml +++ b/ambari-agent/pom.xml @@ -327,7 +327,7 @@ ${project.build.directory}${dirsep}${project.artifactId}-${project.version}/var/lib/ambari-agent /cred/lib/*.jar -/tools/zkmigrator.jar +/tools/*.jar /cache/stacks/HDP/2.1.GlusterFS/services/STORM/package/files/wordCount.jar /cache/stacks/HDP/2.0.6/hooks/before-START/files/fast-hdfs-resource.jar /cache/common-services/STORM/0.9.1/package/files/wordCount.jar @@ -424,6 +424,14 @@ shade + true + + + commons-cli:commons-cli + org.slf4j:* + log4j:* + + org.apache.ambari.tools.jce.JcePolicyInfo
[33/55] [abbrv] ambari git commit: AMBARI-20609. Fix Install Wizard data attribute (onechiporenko)
AMBARI-20609. Fix Install Wizard data attribute (onechiporenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/27af648e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/27af648e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/27af648e Branch: refs/heads/branch-3.0-perf Commit: 27af648e30affd57191c3fff62760cc0ee9c6ea1 Parents: e808035 Author: Oleg NechiporenkoAuthored: Wed Mar 29 15:59:54 2017 +0300 Committer: Andrew Onishuk Committed: Fri Mar 31 10:21:45 2017 +0300 -- ambari-web/app/assets/index.html| 4 ++-- .../app/controllers/wizard/step6_controller.js | 5 +++- .../mixins/wizard/assign_master_components.js | 1 + ambari-web/app/templates/application.hbs| 4 ++-- .../common/assign_master_components.hbs | 14 ++-- .../app/templates/common/form/dropdown.hbs | 2 +- ambari-web/app/templates/common/modal_popup.hbs | 8 +++ ambari-web/app/templates/installer.hbs | 24 ++-- ambari-web/app/templates/wizard/step6.hbs | 18 +++ .../common/assign_master_components_view.js | 4 ambari-web/app/views/common/modal_popup.js | 1 + .../views/common/modal_popups/alert_popup.js| 1 + .../common/modal_popups/confirmation_popup.js | 1 + ambari-web/app/views/wizard/step6_view.js | 12 ++ 14 files changed, 57 insertions(+), 42 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/27af648e/ambari-web/app/assets/index.html -- diff --git a/ambari-web/app/assets/index.html b/ambari-web/app/assets/index.html index 848df40..efd3c64 100644 --- a/ambari-web/app/assets/index.html +++ b/ambari-web/app/assets/index.html @@ -45,8 +45,8 @@ -http://www.apache.org/licenses/LICENSE-2.0; target="_blank">Licensed under the Apache License, Version 2.0. -See third-party tools/resources that Ambari uses and their respective authors +http://www.apache.org/licenses/LICENSE-2.0; target="_blank">Licensed under the Apache License, Version 2.0. +See third-party tools/resources that Ambari uses and their respective authors http://git-wip-us.apache.org/repos/asf/ambari/blob/27af648e/ambari-web/app/controllers/wizard/step6_controller.js -- diff --git a/ambari-web/app/controllers/wizard/step6_controller.js b/ambari-web/app/controllers/wizard/step6_controller.js index d766c18..fb26dc2 100644 --- a/ambari-web/app/controllers/wizard/step6_controller.js +++ b/ambari-web/app/controllers/wizard/step6_controller.js @@ -163,6 +163,7 @@ App.WizardStep6Controller = Em.Controller.extend(App.HostComponentValidationMixi openSlavesAndClientsIssues: function () { App.ModalPopup.show({ + 'data-qa': 'slave-clients-issues-modal', header: Em.I18n.t('installer.step6.validationSlavesAndClients.popup.header'), bodyClass: Em.View.extend({ controller: this, @@ -405,7 +406,8 @@ App.WizardStep6Controller = Em.Controller.extend(App.HostComponentValidationMixi checked: false, isInstalled: false, isDisabled: header.get('isDisabled'), -uId: _hostName + '-checkbox-' + index +uId: _hostName + '-checkbox-' + index, +dataQaAttr: header.name === 'CLIENT' ? 'client-component' : '' }; }) }; @@ -834,6 +836,7 @@ App.WizardStep6Controller = Em.Controller.extend(App.HostComponentValidationMixi if (self.get('anyWarnings') || self.get('anyErrors')) { App.ModalPopup.show({ +'data-qa': 'validation-issues-modal', primary: Em.I18n.t('common.continueAnyway'), header: Em.I18n.t('installer.step6.validationIssuesAttention.header'), body: Em.I18n.t('installer.step6.validationIssuesAttention'), http://git-wip-us.apache.org/repos/asf/ambari/blob/27af648e/ambari-web/app/mixins/wizard/assign_master_components.js -- diff --git a/ambari-web/app/mixins/wizard/assign_master_components.js b/ambari-web/app/mixins/wizard/assign_master_components.js index 9813da1..3e2a09a 100644 --- a/ambari-web/app/mixins/wizard/assign_master_components.js +++ b/ambari-web/app/mixins/wizard/assign_master_components.js @@ -1205,6 +1205,7 @@ App.AssignMasterComponents = Em.Mixin.create(App.HostComponentValidationMixin, A } App.ModalPopup.show({ + 'data-qa': 'validation-issues-modal', primary: Em.I18n.t('common.continueAnyway'), header:
[53/55] [abbrv] ambari git commit: AMBARI-20623. Cleanup swagger rest api doc for Log Search (oleewere)
AMBARI-20623. Cleanup swagger rest api doc for Log Search (oleewere) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/14c2b80f Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/14c2b80f Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/14c2b80f Branch: refs/heads/branch-3.0-perf Commit: 14c2b80f3a220ce21eaa9f3edf73fd57a1217090 Parents: 9433038 Author: oleewereAuthored: Thu Mar 30 21:47:36 2017 +0200 Committer: Andrew Onishuk Committed: Fri Mar 31 10:21:45 2017 +0300 -- .../FieldAuditLogRequestQueryConverter.java | 1 - .../TopFieldAuditLogRequestQueryConverter.java | 54 + .../logsearch/manager/AuditLogsManager.java | 3 +- .../request/impl/FieldAuditLogRequest.java | 17 +- .../request/impl/TopFieldAuditLogRequest.java | 40 + .../logsearch/rest/AuditLogsResource.java | 4 +- .../logsearch/rest/UserConfigResource.java | 2 +- .../FieldAuditLogRequestQueryConverterTest.java | 3 +- ...pFieldAuditLogRequestQueryConverterTest.java | 61 .../main/webapp/scripts/views/common/Header.js | 6 +- 10 files changed, 165 insertions(+), 26 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/14c2b80f/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/converter/FieldAuditLogRequestQueryConverter.java -- diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/converter/FieldAuditLogRequestQueryConverter.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/converter/FieldAuditLogRequestQueryConverter.java index a4e613b..bf6a457 100644 --- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/converter/FieldAuditLogRequestQueryConverter.java +++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/converter/FieldAuditLogRequestQueryConverter.java @@ -33,7 +33,6 @@ public class FieldAuditLogRequestQueryConverter extends AbstractLogRequestFacetQ @Override public void appendFacetOptions(FacetOptions facetOptions, FieldAuditLogRequest request) { facetOptions.addFacetOnPivot(request.getField(), AUDIT_COMPONENT); -facetOptions.setFacetLimit(request.getTop()); } @Override http://git-wip-us.apache.org/repos/asf/ambari/blob/14c2b80f/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/converter/TopFieldAuditLogRequestQueryConverter.java -- diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/converter/TopFieldAuditLogRequestQueryConverter.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/converter/TopFieldAuditLogRequestQueryConverter.java new file mode 100644 index 000..9985a18 --- /dev/null +++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/converter/TopFieldAuditLogRequestQueryConverter.java @@ -0,0 +1,54 @@ +/* + * 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.logsearch.converter; + +import org.apache.ambari.logsearch.common.LogType; +import org.apache.ambari.logsearch.model.request.impl.TopFieldAuditLogRequest; +import org.springframework.data.solr.core.query.FacetOptions; + +import javax.inject.Named; + +import static org.apache.ambari.logsearch.solr.SolrConstants.AuditLogConstants.AUDIT_COMPONENT; +import static org.apache.ambari.logsearch.solr.SolrConstants.AuditLogConstants.AUDIT_EVTTIME; + +@Named +public class TopFieldAuditLogRequestQueryConverter extends AbstractLogRequestFacetQueryConverter { + + @Override + public void appendFacetOptions(FacetOptions facetOptions, TopFieldAuditLogRequest request) { +facetOptions.addFacetOnPivot(request.getField(),
[38/55] [abbrv] ambari git commit: AMBARI-20610. Unable to scroll down collapsed navigation bar if it's higher that viewport.(xiwang)
AMBARI-20610. Unable to scroll down collapsed navigation bar if it's higher that viewport.(xiwang) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/16b158c3 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/16b158c3 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/16b158c3 Branch: refs/heads/branch-3.0-perf Commit: 16b158c3cb6c94cb6eca5d3434b835d1399bfd33 Parents: 5b71200 Author: Xi WangAuthored: Tue Mar 28 11:30:01 2017 -0700 Committer: Andrew Onishuk Committed: Fri Mar 31 10:21:45 2017 +0300 -- .../app/styles/theme/bootstrap-ambari.css | 6 +--- .../vendor/scripts/theme/bootstrap-ambari.js| 29 +--- 2 files changed, 26 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/16b158c3/ambari-web/app/styles/theme/bootstrap-ambari.css -- diff --git a/ambari-web/app/styles/theme/bootstrap-ambari.css b/ambari-web/app/styles/theme/bootstrap-ambari.css index b289517..b063fcf 100644 --- a/ambari-web/app/styles/theme/bootstrap-ambari.css +++ b/ambari-web/app/styles/theme/bootstrap-ambari.css @@ -1092,10 +1092,6 @@ input.radio:checked + label:after { top: 0; left: 50px; } -.navigation-bar-container.collapsed ul.nav.side-nav-menu li:hover ul.sub-menu, -.navigation-bar-container.collapsed ul.nav.side-nav-footer li:hover ul.sub-menu { - display: block; -} .navigation-bar-container.collapsed ul.nav.side-nav-menu li.submenu-li > a, .navigation-bar-container.collapsed ul.nav.side-nav-footer li.submenu-li > a { padding: 10px 5px 10px 25px; @@ -1166,7 +1162,7 @@ input.radio:checked + label:after { .navigation-bar-fit-height .navigation-bar-container { height: 100%; } -.navigation-bar-fit-height .navigation-bar-container:not(.collapsed) .side-nav-menu { +.navigation-bar-fit-height .navigation-bar-container .side-nav-menu { overflow-y: auto; } .notifications-group { http://git-wip-us.apache.org/repos/asf/ambari/blob/16b158c3/ambari-web/vendor/scripts/theme/bootstrap-ambari.js -- diff --git a/ambari-web/vendor/scripts/theme/bootstrap-ambari.js b/ambari-web/vendor/scripts/theme/bootstrap-ambari.js index 5cdbb55..d7ffdd1 100644 --- a/ambari-web/vendor/scripts/theme/bootstrap-ambari.js +++ b/ambari-web/vendor/scripts/theme/bootstrap-ambari.js @@ -30,6 +30,7 @@ $(document).ready(function () { var settings = $.extend({}, $.fn.navigationBar.defaults, options); return this.each(function () { + var _this = this; var containerSelector = '.navigation-bar-container'; var $navigationContainer = $(this).find(containerSelector); @@ -48,10 +49,10 @@ $(document).ready(function () { $(this).addClass('navigation-bar-fit-height'); // make scrolling effect on side nav ONLY, i.e. not effected on ambari main contents -$(this).find('.side-nav-menu').on('DOMMouseScroll mousewheel', function(ev) { +$(this).find('.side-nav-menu').on('DOMMouseScroll mousewheel', function (ev) { var $this = $(this), -scrollTop = (this).scrollTop, -scrollHeight = (this).scrollHeight, +scrollTop = this.scrollTop, +scrollHeight = this.scrollHeight, height = $this.innerHeight(), delta = ev.originalEvent.wheelDelta, up = delta > 0; @@ -177,7 +178,9 @@ $(document).ready(function () { $dropdownMenu.on('click', function () { // some action was triggered, should hide this icon var moreIcon = $(this).parent(); -setTimeout(function(){ moreIcon.hide(); }, 1000); +setTimeout(function () { + moreIcon.hide(); +}, 1000); }); $navigationContainer.children('.side-nav-menu').scroll(function () { $moreActions.removeClass('open'); @@ -199,6 +202,16 @@ $(document).ready(function () { // set the hover effect when collapsed, should show sub-menu on hovering $subMenuItems.hover(function () { $(this).find(subMenuSelector).show(); + // set sub-menu position + var $parent = $(this); + var $header = $('.side-nav-header'); + if (settings.fitHeight) { +$(this).find(subMenuSelector).css({ + position: 'fixed', + top: $parent.offset().top - $header.offset().top + 'px', + left: 50 + 'px' +}); + } }, function () { $(this).find(subMenuSelector).hide(); }); @@ -209,6 +222,14 @@ $(document).ready(function () { });
[05/55] [abbrv] ambari git commit: AMBARI-19149. Code cleanup: redundant type arguments
http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/test/java/org/apache/ambari/server/notifications/dispatchers/AlertScriptDispatcherTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/notifications/dispatchers/AlertScriptDispatcherTest.java b/ambari-server/src/test/java/org/apache/ambari/server/notifications/dispatchers/AlertScriptDispatcherTest.java index 78f8ba0..68e7d02 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/notifications/dispatchers/AlertScriptDispatcherTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/notifications/dispatchers/AlertScriptDispatcherTest.java @@ -167,7 +167,7 @@ public class AlertScriptDispatcherTest { notification.CallbackIds = Collections.singletonList(UUID.randomUUID().toString()); // put the custom config value -notification.DispatchProperties = new HashMap(); +notification.DispatchProperties = new HashMap<>(); notification.DispatchProperties.put(AlertScriptDispatcher.DISPATCH_PROPERTY_SCRIPT_CONFIG_KEY, customScriptKey); http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/test/java/org/apache/ambari/server/notifications/dispatchers/AmbariSNMPDispatcherTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/notifications/dispatchers/AmbariSNMPDispatcherTest.java b/ambari-server/src/test/java/org/apache/ambari/server/notifications/dispatchers/AmbariSNMPDispatcherTest.java index 64f1c8f..7b248ff 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/notifications/dispatchers/AmbariSNMPDispatcherTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/notifications/dispatchers/AmbariSNMPDispatcherTest.java @@ -91,7 +91,7 @@ public class AmbariSNMPDispatcherTest { Notification notification = mock(AlertNotification.class); notification.Callback = mock(DispatchCallback.class); notification.CallbackIds = new ArrayList<>(); -Map properties = new HashMap (); +Map properties = new HashMap<>(); properties.put(AmbariSNMPDispatcher.PORT_PROPERTY, "3"); properties.put(AmbariSNMPDispatcher.COMMUNITY_PROPERTY, "4"); properties.put(AmbariSNMPDispatcher.SNMP_VERSION_PROPERTY, "SNMPv1"); @@ -110,7 +110,7 @@ public class AmbariSNMPDispatcherTest { Notification notification = mock(AlertNotification.class); notification.Callback = mock(DispatchCallback.class); notification.CallbackIds = new ArrayList<>(); -notification.DispatchProperties = new HashMap (); +notification.DispatchProperties = new HashMap<>(); dispatcher.dispatch(notification); verify(notification.Callback).onFailure(notification.CallbackIds); verify(notification.Callback, never()).onSuccess(notification.CallbackIds); @@ -122,7 +122,7 @@ public class AmbariSNMPDispatcherTest { Notification notification = getAlertNotification(true); notification.Callback = mock(DispatchCallback.class); notification.CallbackIds = new ArrayList<>(); -Map properties = new HashMap (); +Map properties = new HashMap<>(); properties.put(AmbariSNMPDispatcher.PORT_PROPERTY, "3"); properties.put(AmbariSNMPDispatcher.COMMUNITY_PROPERTY, "4"); properties.put(AmbariSNMPDispatcher.SNMP_VERSION_PROPERTY, "SNMPv1"); @@ -138,12 +138,12 @@ public class AmbariSNMPDispatcherTest { Notification notification = getAlertNotification(true); notification.Callback = mock(DispatchCallback.class); notification.CallbackIds = new ArrayList<>(); -Map properties = new HashMap (); +Map properties = new HashMap<>(); properties.put(AmbariSNMPDispatcher.PORT_PROPERTY, "3"); properties.put(AmbariSNMPDispatcher.COMMUNITY_PROPERTY, "4"); properties.put(AmbariSNMPDispatcher.SNMP_VERSION_PROPERTY, "SNMPv1"); notification.DispatchProperties = properties; -notification.Recipients = new ArrayList(); +notification.Recipients = new ArrayList<>(); dispatcher.dispatch(notification); verify(notification.Callback).onFailure(notification.CallbackIds); verify(notification.Callback, never()).onSuccess(notification.CallbackIds); @@ -155,7 +155,7 @@ public class AmbariSNMPDispatcherTest { Notification notification = mock(AlertNotification.class); notification.Callback = mock(DispatchCallback.class); notification.CallbackIds = new ArrayList<>(); -Map properties = new HashMap (); +Map
[26/55] [abbrv] ambari git commit: AMBARI-19149. Code cleanup: redundant type arguments
http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java index f2fd9ac..92e72ed 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java @@ -215,11 +215,11 @@ public class ClusterStackVersionResourceProvider extends AbstractControllerResou @Override public Set getResourcesAuthorized(Request request, Predicate predicate) throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException { -final Set resources = new HashSet(); +final Set resources = new HashSet<>(); final Set requestedIds = getRequestPropertyIds(request, predicate); final Set> propertyMaps = getPropertyMaps(predicate); -List requestedEntities = new ArrayList(); +List requestedEntities = new ArrayList<>(); for (Map propertyMap: propertyMaps) { final String clusterName = propertyMap.get(CLUSTER_STACK_VERSION_CLUSTER_NAME_PROPERTY_ID).toString(); final Long id; @@ -243,7 +243,7 @@ public class ClusterStackVersionResourceProvider extends AbstractControllerResou for (ClusterVersionEntity entity: requestedEntities) { final Resource resource = new ResourceImpl(Resource.Type.ClusterStackVersion); - final Map hostStates = new HashMap (); + final Map hostStates = new HashMap<>(); for (RepositoryVersionState state: RepositoryVersionState.values()) { hostStates.put(state.name(), new ArrayList()); } @@ -299,7 +299,7 @@ public class ClusterStackVersionResourceProvider extends AbstractControllerResou Map propertyMap = iterator.next(); -Set requiredProperties = new HashSet(); +Set requiredProperties = new HashSet<>(); requiredProperties.add(CLUSTER_STACK_VERSION_CLUSTER_NAME_PROPERTY_ID); requiredProperties.add(CLUSTER_STACK_VERSION_REPOSITORY_VERSION_PROPERTY_ID); requiredProperties.add(CLUSTER_STACK_VERSION_STACK_PROPERTY_ID); @@ -490,7 +490,7 @@ public class ClusterStackVersionResourceProvider extends AbstractControllerResou // build the list of OS repos List operatingSystems = repoVersionEnt.getOperatingSystems(); -Map perOsRepos = new HashMap (); +Map perOsRepos = new HashMap<>(); for (OperatingSystemEntity operatingSystem : operatingSystems) { if (operatingSystem.isAmbariManagedRepos()) { @@ -503,7 +503,7 @@ public class ClusterStackVersionResourceProvider extends AbstractControllerResou RequestStageContainer req = createRequest(); Iterator hostIterator = hosts.iterator(); -Map hostLevelParams = new HashMap (); +Map hostLevelParams = new HashMap<>(); hostLevelParams.put(JDK_LOCATION, getManagementController().getJdkResourceUrl()); String hostParamsJson = StageUtils.getGson().toJson(hostLevelParams); @@ -534,7 +534,7 @@ public class ClusterStackVersionResourceProvider extends AbstractControllerResou boolean hasStage = false; -ArrayList stages = new ArrayList(batchCount); +ArrayList stages = new ArrayList<>(batchCount); for (int batchId = 1; batchId <= batchCount; batchId++) { // Create next stage String stageName; @@ -612,8 +612,8 @@ public class ClusterStackVersionResourceProvider extends AbstractControllerResou // determine packages for all services that are installed on host -List packages = new ArrayList(); -Set servicesOnHost = new HashSet(); +List packages = new ArrayList<>(); +Set servicesOnHost = new HashSet<>(); List components = cluster.getServiceComponentHosts(host.getHostName()); for (ServiceComponentHost component : components) { if (repoServices.isEmpty() || repoServices.contains(component.getServiceName())) { @@ -664,7 +664,7 @@ public class ClusterStackVersionResourceProvider extends AbstractControllerResou final String packageList = gson.toJson(packages); final String repoList = gson.toJson(repoInfo); -Map params = new HashMap (); +Map params = new HashMap<>(); params.put("stack_id", stackId.getStackId()); params.put("repository_version", repoVersion.getVersion()); params.put("base_urls", repoList); @@ -781,7 +781,7 @@
[32/55] [abbrv] ambari git commit: AMBARI-19149. Code cleanup: redundant type arguments
AMBARI-19149. Code cleanup: redundant type arguments Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e8080350 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e8080350 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e8080350 Branch: refs/heads/branch-3.0-perf Commit: e8080350f531f30abc129545e5ade90550d45bff Parents: 13423dc Author: Attila DoroszlaiAuthored: Wed Mar 29 12:57:55 2017 +0200 Committer: Andrew Onishuk Committed: Fri Mar 31 10:21:45 2017 +0300 -- .../server/KdcServerConnectionVerification.java | 31 +- .../java/org/apache/ambari/server/Role.java |2 +- .../actionmanager/ActionDBAccessorImpl.java | 14 +- .../server/actionmanager/ActionManager.java |2 +- .../server/actionmanager/ActionScheduler.java | 30 +- .../ambari/server/actionmanager/Request.java| 10 +- .../ambari/server/actionmanager/Stage.java | 22 +- .../apache/ambari/server/agent/ActionQueue.java | 12 +- .../ambari/server/agent/AgentRequests.java |2 +- .../ambari/server/agent/ExecutionCommand.java | 10 +- .../apache/ambari/server/agent/HeartBeat.java |6 +- .../ambari/server/agent/HeartBeatHandler.java | 14 +- .../ambari/server/agent/HeartBeatResponse.java | 10 +- .../ambari/server/agent/HeartbeatMonitor.java |6 +- .../ambari/server/agent/HeartbeatProcessor.java |2 +- .../apache/ambari/server/agent/HostInfo.java|2 +- .../ambari/server/agent/RecoveryReport.java |2 +- .../server/agent/RegistrationResponse.java |2 +- .../ambari/server/agent/StatusCommand.java |4 +- .../alerts/AmbariPerformanceRunnable.java |2 +- .../server/alerts/StaleAlertRunnable.java |2 +- .../server/api/AmbariCsrfProtectionFilter.java |2 +- .../ambari/server/api/AmbariErrorHandler.java |2 +- .../server/api/handlers/QueryCreateHandler.java |6 +- .../ambari/server/api/predicate/QueryLexer.java | 24 +- .../server/api/predicate/QueryParser.java |8 +- .../expressions/AbstractExpression.java |2 +- .../expressions/NotLogicalExpression.java |2 +- .../api/predicate/operators/EqualsOperator.java |2 +- .../operators/GreaterEqualsOperator.java|2 +- .../predicate/operators/GreaterOperator.java|2 +- .../api/predicate/operators/InOperator.java |2 +- .../predicate/operators/LessEqualsOperator.java |2 +- .../api/predicate/operators/LessOperator.java |2 +- .../predicate/operators/NotEqualsOperator.java |2 +- .../query/ExtendedResourcePredicateVisitor.java |2 +- .../server/api/query/JpaPredicateVisitor.java |4 +- .../ambari/server/api/query/JpaSortBuilder.java |2 +- .../api/query/ProcessingPredicateVisitor.java |6 +- .../ambari/server/api/query/QueryImpl.java | 60 +- .../ambari/server/api/query/QueryInfo.java |2 +- .../api/query/SubResourcePredicateVisitor.java |2 +- .../render/AlertSummaryGroupedRenderer.java |6 +- .../api/query/render/AlertSummaryRenderer.java |4 +- .../server/api/query/render/BaseRenderer.java |2 +- .../query/render/ClusterBlueprintRenderer.java | 36 +- .../api/query/render/DefaultRenderer.java |4 +- .../api/query/render/MinimalRenderer.java | 10 +- .../api/resources/BaseResourceDefinition.java |8 +- .../resources/ClusterResourceDefinition.java|2 +- ...ComponentStackVersionResourceDefinition.java |2 +- .../ExtensionLinkResourceDefinition.java|2 +- .../resources/ExtensionResourceDefinition.java |2 +- .../ExtensionVersionResourceDefinition.java |2 +- .../api/resources/FeedResourceDefinition.java |2 +- .../api/resources/GroupResourceDefinition.java |2 +- .../HostComponentResourceDefinition.java|4 +- .../api/resources/JobResourceDefinition.java|2 +- .../resources/PermissionResourceDefinition.java |2 +- .../resources/ResourceInstanceFactoryImpl.java |2 +- ...tServiceHostComponentResourceDefinition.java |2 +- .../RootServiceResourceDefinition.java |2 +- .../resources/ServiceResourceDefinition.java|2 +- .../StackConfigurationResourceDefinition.java |2 +- ...ackLevelConfigurationResourceDefinition.java |2 +- .../api/resources/StackResourceDefinition.java |2 +- .../StackServiceResourceDefinition.java |2 +- .../StackVersionResourceDefinition.java |2 +- .../api/resources/UserResourceDefinition.java |2 +- .../ViewInstanceResourceDefinition.java |2 +- .../ViewVersionResourceDefinition.java |2 +- .../resources/WorkflowResourceDefinition.java |2 +- .../server/api/rest/BootStrapResource.java |4 +-
[45/55] [abbrv] ambari git commit: AMBARI-20617. Display log level, method name from stack_advisor in ambari-server.log (dlysnichenko)
AMBARI-20617. Display log level, method name from stack_advisor in ambari-server.log (dlysnichenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0ef14f56 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0ef14f56 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0ef14f56 Branch: refs/heads/branch-3.0-perf Commit: 0ef14f56ac6fb7b7d3b12383a15f9810fab56887 Parents: 623c12c Author: Lisnichenko DmitroAuthored: Thu Mar 30 15:48:24 2017 +0300 Committer: Andrew Onishuk Committed: Fri Mar 31 10:21:45 2017 +0300 -- .../HDFS/3.0.0.3.0/service_advisor.py | 27 +- .../HIVE/2.1.0.3.0/service_advisor.py | 25 +- .../SLIDER/0.91.0.3.0/service_advisor.py| 7 +- .../SPARK/2.2.0/service_advisor.py | 7 +- .../TEZ/0.9.0.3.0/service_advisor.py| 9 +- .../YARN/3.0.0.3.0/service_advisor.py | 259 - .../ZOOKEEPER/3.4.9/service_advisor.py | 13 +- .../stacks/BIGTOP/0.8/services/stack_advisor.py | 3 +- .../stacks/HDP/2.0.6/services/stack_advisor.py | 7 +- .../stacks/HDP/2.1/services/stack_advisor.py| 3 +- .../stacks/HDP/2.2/services/stack_advisor.py| 3 +- .../stacks/HDP/2.3/services/stack_advisor.py| 3 +- .../stacks/HDP/2.5/services/stack_advisor.py| 277 +-- .../stacks/HDP/2.6/services/stack_advisor.py| 27 +- .../stacks/HDPWIN/2.1/services/stack_advisor.py | 9 +- .../stacks/HDPWIN/2.2/services/stack_advisor.py | 3 +- .../stacks/PERF/1.0/services/stack_advisor.py | 3 +- .../src/main/resources/stacks/stack_advisor.py | 88 +++--- .../stacks/ODPi/2.0/services/stack_advisor.py | 21 +- 19 files changed, 404 insertions(+), 390 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/0ef14f56/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/service_advisor.py -- diff --git a/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/service_advisor.py b/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/service_advisor.py index a37ebc67..356ad59 100644 --- a/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/service_advisor.py +++ b/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/service_advisor.py @@ -24,7 +24,6 @@ import traceback import inspect # Local imports -from resource_management.core.logger import Logger from resource_management.libraries.functions.mounted_dirs_helper import get_mounts_with_multiple_data_dirs @@ -46,6 +45,8 @@ class HDFSServiceAdvisor(service_advisor.ServiceAdvisor): self.as_super = super(HDFSServiceAdvisor, self) self.as_super.__init__(*args, **kwargs) +self.initialize_logger("HDFSServiceAdvisor") + # Always call these methods self.modifyMastersWithMultipleInstances() self.modifyCardinalitiesDict() @@ -120,7 +121,7 @@ class HDFSServiceAdvisor(service_advisor.ServiceAdvisor): Get a list of errors. Must be overriden in child class. """ -Logger.info("Class: %s, Method: %s. Validating Service Component Layout." % +self.logger.info("Class: %s, Method: %s. Validating Service Component Layout." % (self.__class__.__name__, inspect.stack()[0][3])) # HDFS allows NameNode and Secondary NameNode to be on the same host. @@ -131,7 +132,7 @@ class HDFSServiceAdvisor(service_advisor.ServiceAdvisor): Entry point. Must be overriden in child class. """ -Logger.info("Class: %s, Method: %s. Recommending Service Configurations." % +self.logger.info("Class: %s, Method: %s. Recommending Service Configurations." % (self.__class__.__name__, inspect.stack()[0][3])) # Due to the existing stack inheritance, make it clear where each calculation came from. @@ -146,7 +147,7 @@ class HDFSServiceAdvisor(service_advisor.ServiceAdvisor): Validate configurations for the service. Return a list of errors. The code for this function should be the same for each Service Advisor. """ -Logger.info("Class: %s, Method: %s. Validating Configurations." % +self.logger.info("Class: %s, Method: %s. Validating Configurations." % (self.__class__.__name__, inspect.stack()[0][3])) validator = HDFSValidator() @@ -167,7 +168,7 @@ class HDFSRecommender(service_advisor.ServiceAdvisor): """ Recommend configurations for this service based on HDP 2.0.6. """ -Logger.info("Class: %s, Method: %s. Recommending Service Configurations." % +self.logger.info("Class: %s, Method: %s. Recommending Service Configurations." % (self.__class__.__name__,
[06/55] [abbrv] ambari git commit: AMBARI-19149. Code cleanup: redundant type arguments
http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/test/java/org/apache/ambari/server/controller/metrics/JMXPropertyProviderTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/metrics/JMXPropertyProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/metrics/JMXPropertyProviderTest.java index 2225997..bb3240b 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/controller/metrics/JMXPropertyProviderTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/metrics/JMXPropertyProviderTest.java @@ -219,7 +219,7 @@ public class JMXPropertyProviderTest { Request request = PropertyHelper.getReadRequest(Collections.emptySet()); Assert.assertEquals(1, propertyProvider.populateResources(Collections.singleton(resource), request, null).size()); -List expectedSpecs = new ArrayList(); +List expectedSpecs = new ArrayList<>(); expectedSpecs.add(propertyProvider.getSpec("http", "domu-12-31-39-0e-34-e1.compute-1.internal", "50070", "/jmx")); expectedSpecs.add(propertyProvider.getSpec("http", "domu-12-31-39-0e-34-e1.compute-1.internal", "50070", "/jmx?get=Hadoop:service=NameNode,name=FSNamesystem::tag.HAState")); Assert.assertEquals(expectedSpecs, streamProvider.getSpecs()); @@ -258,7 +258,7 @@ public class JMXPropertyProviderTest { // only ask for specific properties -Set properties = new HashSet(); +Set properties = new HashSet<>(); // hbase master resource = new ResourceImpl(Resource.Type.HostComponent); @@ -268,7 +268,7 @@ public class JMXPropertyProviderTest { resource.setProperty(HOST_COMPONENT_STATE_PROPERTY_ID, "STARTED"); // only ask for specific properties -properties = new HashSet(); +properties = new HashSet<>(); properties.add(PropertyHelper.getPropertyId("metrics/jvm", "HeapMemoryMax")); properties.add(PropertyHelper.getPropertyId("metrics/jvm", "HeapMemoryUsed")); properties.add(PropertyHelper.getPropertyId("metrics/jvm", "NonHeapMemoryMax")); @@ -313,7 +313,7 @@ public class JMXPropertyProviderTest { resource.setProperty(HOST_COMPONENT_STATE_PROPERTY_ID, "STARTED"); // only ask for one property -MaptemporalInfoMap = new HashMap (); +Map temporalInfoMap = new HashMap<>(); Request request = PropertyHelper.getReadRequest(Collections.singleton("metrics/rpc/ReceivedBytes"), temporalInfoMap); Assert.assertEquals(1, propertyProvider.populateResources(Collections.singleton(resource), request, null).size()); @@ -349,12 +349,12 @@ public class JMXPropertyProviderTest { // request with an empty set should get all supported properties // only ask for one property -Map temporalInfoMap = new HashMap (); +Map temporalInfoMap = new HashMap<>(); Request request = PropertyHelper.getReadRequest(Collections.singleton("metrics/dfs"), temporalInfoMap); Assert.assertEquals(1, propertyProvider.populateResources(Collections.singleton(resource), request, null).size()); -List expectedSpecs = new ArrayList(); +List expectedSpecs = new ArrayList<>(); expectedSpecs.add(propertyProvider.getSpec("http", "domu-12-31-39-0e-34-e1.compute-1.internal", "50070", "/jmx")); expectedSpecs.add(propertyProvider.getSpec("http", "domu-12-31-39-0e-34-e1.compute-1.internal", "50070", "/jmx?get=Hadoop:service=NameNode,name=FSNamesystem::tag.HAState")); Assert.assertEquals(expectedSpecs, streamProvider.getSpecs()); @@ -389,12 +389,12 @@ public class JMXPropertyProviderTest { // request with an empty set should get all supported properties // only ask for one property -Map temporalInfoMap = new HashMap (); +Map temporalInfoMap = new HashMap<>(); Request request = PropertyHelper.getReadRequest(Collections.singleton("metrics/dfs/FSNamesystem"), temporalInfoMap); Assert.assertEquals(1, propertyProvider.populateResources(Collections.singleton(resource), request, null).size()); -List expectedSpecs = new ArrayList(); +List expectedSpecs = new ArrayList<>(); expectedSpecs.add(propertyProvider.getSpec("http","domu-12-31-39-0e-34-e1.compute-1.internal","50070","/jmx")); expectedSpecs.add(propertyProvider.getSpec("http", "domu-12-31-39-0e-34-e1.compute-1.internal", "50070", "/jmx?get=Hadoop:service=NameNode,name=FSNamesystem::tag.HAState")); @@ -417,7 +417,7 @@ public class JMXPropertyProviderTest { // request with an empty set should get all supported properties // only ask for one property -temporalInfoMap = new HashMap (); +temporalInfoMap = new HashMap<>();
[27/55] [abbrv] ambari git commit: AMBARI-19149. Code cleanup: redundant type arguments
http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertNoticeResourceProvider.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertNoticeResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertNoticeResourceProvider.java index 1dc21b0..6d32868 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertNoticeResourceProvider.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertNoticeResourceProvider.java @@ -65,8 +65,8 @@ public class AlertNoticeResourceProvider extends AbstractControllerResourceProvi public static final String ALERT_NOTICE_HISTORY_ID = "AlertNotice/history_id"; public static final String ALERT_NOTICE_CLUSTER_NAME = "AlertNotice/cluster_name"; - private static final Set PK_PROPERTY_IDS = new HashSet( - Arrays.asList(ALERT_NOTICE_ID)); + private static final Set PK_PROPERTY_IDS = new HashSet<>( +Arrays.asList(ALERT_NOTICE_ID)); /** * Used for querying alert history. @@ -77,13 +77,13 @@ public class AlertNoticeResourceProvider extends AbstractControllerResourceProvi /** * The property ids for an alert history resource. */ - private static final Set PROPERTY_IDS = new HashSet(); + private static final Set PROPERTY_IDS = new HashSet<>(); /** * The key property ids for an alert history resource. */ private static final MapKEY_PROPERTY_IDS = - new HashMap (); +new HashMap<>(); static { // properties @@ -175,7 +175,7 @@ public class AlertNoticeResourceProvider extends AbstractControllerResourceProvi } Set requestPropertyIds = getRequestPropertyIds(request, predicate); -Set results = new LinkedHashSet(); +Set results = new LinkedHashSet<>(); AlertNoticeRequest noticeRequest = new AlertNoticeRequest(); noticeRequest.Predicate = predicate; http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertResourceProvider.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertResourceProvider.java index 4cf41b4..31a1000 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertResourceProvider.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertResourceProvider.java @@ -84,8 +84,8 @@ public class AlertResourceProvider extends ReadOnlyResourceProvider implements protected static final String ALERT_REPEAT_TOLERANCE_REMAINING = "Alert/repeat_tolerance_remaining"; protected static final String ALERT_FIRMNESS = "Alert/firmness"; - private static Set pkPropertyIds = new HashSet( - Arrays.asList(ALERT_ID, ALERT_DEFINITION_NAME)); + private static Set pkPropertyIds = new HashSet<>( +Arrays.asList(ALERT_ID, ALERT_DEFINITION_NAME)); @Inject private static AlertsDAO alertsDAO; @@ -99,12 +99,12 @@ public class AlertResourceProvider extends ReadOnlyResourceProvider implements /** * The property ids for an alert defintion resource. */ - private static final Set PROPERTY_IDS = new HashSet(); + private static final Set PROPERTY_IDS = new HashSet<>(); /** * The key property ids for an alert definition resource. */ - private static final Map KEY_PROPERTY_IDS = new HashMap (); + private static final Map KEY_PROPERTY_IDS = new HashMap<>(); static { // properties @@ -170,7 +170,7 @@ public class AlertResourceProvider extends ReadOnlyResourceProvider implements Set requestPropertyIds = getRequestPropertyIds(request, predicate); // use a collection which preserves order since JPA sorts the results -Set results = new LinkedHashSet(); +Set results = new LinkedHashSet<>(); for (Map propertyMap : getPropertyMaps(predicate)) { http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertSummaryPropertyProvider.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertSummaryPropertyProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertSummaryPropertyProvider.java index 5c6bc85..6227f39 100644 ---
[44/55] [abbrv] ambari git commit: AMBARI-20617. Display log level, method name from stack_advisor in ambari-server.log (dlysnichenko)
http://git-wip-us.apache.org/repos/asf/ambari/blob/0ef14f56/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/service_advisor.py -- diff --git a/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/service_advisor.py b/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/service_advisor.py index 103b934..fc32001 100644 --- a/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/service_advisor.py +++ b/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/service_advisor.py @@ -27,7 +27,6 @@ import math from math import floor, ceil # Local imports -from resource_management.core.logger import Logger SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) @@ -48,6 +47,8 @@ class YARNServiceAdvisor(service_advisor.ServiceAdvisor): self.as_super = super(YARNServiceAdvisor, self) self.as_super.__init__(*args, **kwargs) +self.initialize_logger("YARNServiceAdvisorf") + self.CLUSTER_CREATE_OPERATION = "ClusterCreate" # Always call these methods @@ -112,7 +113,7 @@ class YARNServiceAdvisor(service_advisor.ServiceAdvisor): Get a list of errors. Must be overriden in child class. """ -Logger.info("Class: %s, Method: %s. Validating Service Component Layout." % +self.logger.info("Class: %s, Method: %s. Validating Service Component Layout." % (self.__class__.__name__, inspect.stack()[0][3])) return self.as_super.getServiceComponentLayoutValidations(services, hosts) @@ -122,7 +123,7 @@ class YARNServiceAdvisor(service_advisor.ServiceAdvisor): Entry point. Must be overriden in child class. """ -Logger.info("Class: %s, Method: %s. Recommending Service Configurations." % +self.logger.info("Class: %s, Method: %s. Recommending Service Configurations." % (self.__class__.__name__, inspect.stack()[0][3])) # Due to the existing stack inheritance, make it clear where each calculation came from. @@ -141,7 +142,7 @@ class YARNServiceAdvisor(service_advisor.ServiceAdvisor): Validate configurations for the service. Return a list of errors. The code for this function should be the same for each Service Advisor. """ -Logger.info("Class: %s, Method: %s. Validating Configurations." % +self.logger.info("Class: %s, Method: %s. Validating Configurations." % (self.__class__.__name__, inspect.stack()[0][3])) validator = YARNValidator() @@ -219,7 +220,7 @@ class MAPREDUCE2ServiceAdvisor(service_advisor.ServiceAdvisor): Get a list of errors. Must be overriden in child class. """ -Logger.info("Class: %s, Method: %s. Validating Service Component Layout." % +self.logger.info("Class: %s, Method: %s. Validating Service Component Layout." % (self.__class__.__name__, inspect.stack()[0][3])) return self.as_super.getServiceComponentLayoutValidations(services, hosts) @@ -229,7 +230,7 @@ class MAPREDUCE2ServiceAdvisor(service_advisor.ServiceAdvisor): Entry point. Must be overriden in child class. """ -Logger.info("Class: %s, Method: %s. Recommending Service Configurations." % +self.logger.info("Class: %s, Method: %s. Recommending Service Configurations." % (self.__class__.__name__, inspect.stack()[0][3])) # Due to the existing stack inheritance, make it clear where each calculation came from. @@ -243,7 +244,7 @@ class MAPREDUCE2ServiceAdvisor(service_advisor.ServiceAdvisor): Validate configurations for the service. Return a list of errors. The code for this function should be the same for each Service Advisor. """ -Logger.info("Class: %s, Method: %s. Validating Configurations." % +self.logger.info("Class: %s, Method: %s. Validating Configurations." % (self.__class__.__name__, inspect.stack()[0][3])) validator = YARNValidator() @@ -269,7 +270,7 @@ class YARNRecommender(service_advisor.ServiceAdvisor): """ Recommend configurations for this service based on HDP 2.0.6. """ -Logger.info("Class: %s, Method: %s. Recommending Service Configurations." % +self.logger.info("Class: %s, Method: %s. Recommending Service Configurations." % (self.__class__.__name__, inspect.stack()[0][3])) putYarnProperty = self.putProperty(configurations, "yarn-site", services) @@ -449,21 +450,21 @@ class YARNRecommender(service_advisor.ServiceAdvisor): webapp_address = services["configurations"]["yarn-site"]["properties"]["yarn.timeline-service.webapp.address"] webservice_url = "http://"+webapp_address+"/ws/v1/applicationhistory; else: - Logger.error("Required config yarn.timeline-service.webapp.address in yarn-site does not exist. Unable to set yarn.log.server.web-service.url") + self.logger.error("Required config
[50/55] [abbrv] ambari git commit: AMBARI-18716. Move HDFS, HBASE YARN, GANGLIA, OOZIE RCO from stack to service level (aonishuk)
AMBARI-18716. Move HDFS, HBASE YARN, GANGLIA, OOZIE RCO from stack to service level (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/02e38ad1 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/02e38ad1 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/02e38ad1 Branch: refs/heads/branch-3.0-perf Commit: 02e38ad1b5becb7290c821ebf5303dfcefb01f2d Parents: 8d35583 Author: Andrew OnishukAuthored: Thu Mar 30 10:21:32 2017 +0300 Committer: Andrew Onishuk Committed: Fri Mar 31 10:21:45 2017 +0300 -- .../HBASE/0.96.0.2.0/role_command_order.json| 10 + .../HDFS/2.1.0.2.0/role_command_order.json | 22 .../OOZIE/4.0.0.2.0/role_command_order.json | 9 .../YARN/2.1.0.2.0/role_command_order.json | 21 +++ 4 files changed, 62 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/02e38ad1/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/role_command_order.json -- diff --git a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/role_command_order.json b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/role_command_order.json new file mode 100644 index 000..110b179 --- /dev/null +++ b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/role_command_order.json @@ -0,0 +1,10 @@ +{ + "general_deps" : { +"_comment" : "dependencies for HBase", +"HBASE_REGIONSERVER-START": ["HBASE_MASTER-START"], +"HBASE_SERVICE_CHECK-SERVICE_CHECK": ["HBASE_MASTER-START", "HBASE_REGIONSERVER-START"], +"HBASE_MASTER-STOP": ["HBASE_REGIONSERVER-STOP"], +"HBASE_MASTER-START": ["NAMENODE-START", "DATANODE-START", "ZOOKEEPER_SERVER-START", "RANGER_USERSYNC-START"] + + } +} http://git-wip-us.apache.org/repos/asf/ambari/blob/02e38ad1/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/role_command_order.json -- diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/role_command_order.json b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/role_command_order.json new file mode 100644 index 000..833eb31 --- /dev/null +++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/role_command_order.json @@ -0,0 +1,22 @@ +{ + "general_deps" : { +"_comment" : "dependencies for HDFS", +"SECONDARY_NAMENODE-START": ["NAMENODE-START"], +"SECONDARY_NAMENODE-RESTART": ["NAMENODE-RESTART"], +"HDFS_SERVICE_CHECK-SERVICE_CHECK": ["NAMENODE-START", "DATANODE-START", + "SECONDARY_NAMENODE-START"], +"NAMENODE-STOP": ["RESOURCEMANAGER-STOP", "NODEMANAGER-STOP", + "HISTORYSERVER-STOP", "HBASE_MASTER-STOP", "METRICS_COLLECTOR-STOP"], +"DATANODE-STOP": ["RESOURCEMANAGER-STOP", "NODEMANAGER-STOP", + "HISTORYSERVER-STOP", "HBASE_MASTER-STOP"], +"DATANODE-START" : ["RANGER_USERSYNC-START"], +"NAMENODE-START" : ["RANGER_USERSYNC-START"] + }, + "_comment" : "Dependencies that are used in HA NameNode cluster", + "namenode_optional_ha": { +"NAMENODE-START": ["ZKFC-START", "JOURNALNODE-START", "ZOOKEEPER_SERVER-START"], +"ZKFC-START": ["ZOOKEEPER_SERVER-START"], +"ZKFC-STOP": ["NAMENODE-STOP"], +"JOURNALNODE-STOP": ["NAMENODE-STOP"] + } +} http://git-wip-us.apache.org/repos/asf/ambari/blob/02e38ad1/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/role_command_order.json -- diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/role_command_order.json b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/role_command_order.json new file mode 100644 index 000..769e917 --- /dev/null +++ b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/role_command_order.json @@ -0,0 +1,9 @@ +{ + "general_deps" : { +"_comment" : "dependencies for OOZIE", +"OOZIE_SERVER-START": ["NODEMANAGER-START", "RESOURCEMANAGER-START"], +"OOZIE_SERVER-RESTART": ["NAMENODE-RESTART"], +"OOZIE_SERVICE_CHECK-SERVICE_CHECK": ["OOZIE_SERVER-START", "MAPREDUCE2_SERVICE_CHECK-SERVICE_CHECK"] + + } +} http://git-wip-us.apache.org/repos/asf/ambari/blob/02e38ad1/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/role_command_order.json -- diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/role_command_order.json b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/role_command_order.json new file mode 100644
[19/55] [abbrv] ambari git commit: AMBARI-19149. Code cleanup: redundant type arguments
http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintFactory.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintFactory.java b/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintFactory.java index 3c5314b..40fa2d3 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintFactory.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintFactory.java @@ -137,7 +137,7 @@ public class BlueprintFactory { throw new IllegalArgumentException("At least one host group must be specified in a blueprint"); } -Collection hostGroups = new ArrayList(); +Collection hostGroups = new ArrayList<>(); for (HashMaphostGroupProperties : hostGroupProps) { String hostGroupName = (String) hostGroupProperties.get(HOST_GROUP_NAME_PROPERTY_ID); if (hostGroupName == null || hostGroupName.isEmpty()) { @@ -167,7 +167,7 @@ public class BlueprintFactory { } Collection stackComponentNames = getAllStackComponents(stack); -Collection components = new ArrayList(); +Collection components = new ArrayList<>(); for (HashMap componentProperties : componentProps) { String componentName = componentProperties.get(COMPONENT_NAME_PROPERTY_ID); @@ -200,7 +200,7 @@ public class BlueprintFactory { * @throws IllegalArgumentException if the specified stack doesn't exist */ private Collection getAllStackComponents(Stack stack) { -Collection allComponents = new HashSet(); +Collection allComponents = new HashSet<>(); for (Collection components: stack.getComponents().values()) { allComponents.addAll(components); } http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintImpl.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintImpl.java index faf0c77..c90e35c 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintImpl.java @@ -49,7 +49,7 @@ import com.google.gson.Gson; public class BlueprintImpl implements Blueprint { private String name; - private Map hostGroups = new HashMap (); + private Map hostGroups = new HashMap<>(); private Stack stack; private Configuration configuration; private BlueprintValidator validator; @@ -142,7 +142,7 @@ public class BlueprintImpl implements Blueprint { */ @Override public Collection getServices() { -Collection services = new HashSet(); +Collection services = new HashSet<>(); for (HostGroup group : getHostGroups().values()) { services.addAll(group.getServices()); } @@ -151,7 +151,7 @@ public class BlueprintImpl implements Blueprint { @Override public Collection getComponents(String service) { -Collection components = new HashSet(); +Collection components = new HashSet<>(); for (HostGroup group : getHostGroupsForService(service)) { components.addAll(group.getComponents(service)); } @@ -286,7 +286,7 @@ public class BlueprintImpl implements Blueprint { */ @Override public Collection getHostGroupsForComponent(String component) { -Collection resultGroups = new HashSet(); +Collection resultGroups = new HashSet<>(); for (HostGroup group : hostGroups.values() ) { if (group.getComponentNames().contains(component)) { resultGroups.add(group); @@ -304,7 +304,7 @@ public class BlueprintImpl implements Blueprint { */ @Override public Collection getHostGroupsForService(String service) { -Collection resultGroups = new HashSet(); +Collection resultGroups = new HashSet<>(); for (HostGroup group : hostGroups.values() ) { if (group.getServices().contains(service)) { resultGroups.add(group); @@ -404,7 +404,7 @@ public class BlueprintImpl implements Blueprint { */ private Map > parseConfigurations(Collection configs) { -Map > properties = new HashMap >(); +Map > properties = new HashMap<>(); Gson gson = new Gson(); for (BlueprintConfiguration config : configs) { String type = config.getType(); @@ -422,7 +422,7 @@ public class BlueprintImpl implements Blueprint { */ private Map >> parseSetting(Collection blueprintSetting) { -Map >>
[14/55] [abbrv] ambari git commit: AMBARI-19149. Code cleanup: redundant type arguments
http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/test/java/org/apache/ambari/server/checks/ServicesTezDistributedCacheCheckTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/checks/ServicesTezDistributedCacheCheckTest.java b/ambari-server/src/test/java/org/apache/ambari/server/checks/ServicesTezDistributedCacheCheckTest.java index 334b3b3..3eaf890 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/checks/ServicesTezDistributedCacheCheckTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/checks/ServicesTezDistributedCacheCheckTest.java @@ -95,13 +95,13 @@ public class ServicesTezDistributedCacheCheckTest { final DesiredConfig desiredConfig = Mockito.mock(DesiredConfig.class); Mockito.when(desiredConfig.getTag()).thenReturn("tag"); -MapconfigMap = new HashMap (); +Map configMap = new HashMap<>(); configMap.put("tez-site", desiredConfig); configMap.put("core-site", desiredConfig); Mockito.when(cluster.getDesiredConfigs()).thenReturn(configMap); final Config config = Mockito.mock(Config.class); Mockito.when(cluster.getConfig(Mockito.anyString(), Mockito.anyString())).thenReturn(config); -final Map properties = new HashMap (); +final Map properties = new HashMap<>(); Mockito.when(config.getProperties()).thenReturn(properties); PrerequisiteCheck check = new PrerequisiteCheck(null, null); @@ -169,16 +169,16 @@ public class ServicesTezDistributedCacheCheckTest { final DesiredConfig desiredConfig = Mockito.mock(DesiredConfig.class); Mockito.when(desiredConfig.getTag()).thenReturn("tag"); -Map configMap = new HashMap (); +Map configMap = new HashMap<>(); configMap.put("tez-site", desiredConfig); configMap.put("core-site", desiredConfig); Mockito.when(cluster.getDesiredConfigs()).thenReturn(configMap); final Config config = Mockito.mock(Config.class); Mockito.when(cluster.getConfig(Mockito.anyString(), Mockito.anyString())).thenReturn(config); -final Map properties = new HashMap (); +final Map properties = new HashMap<>(); Mockito.when(config.getProperties()).thenReturn(properties); -Map checkProperties = new HashMap (); +Map checkProperties = new HashMap<>(); checkProperties.put("dfs-protocols-regex","^([^:]*dfs|wasb|ecs):.*"); PrerequisiteCheckConfig prerequisiteCheckConfig = Mockito.mock(PrerequisiteCheckConfig.class); Mockito.when(prerequisiteCheckConfig.getCheckProperties( http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/test/java/org/apache/ambari/server/checks/ServicesUpCheckTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/checks/ServicesUpCheckTest.java b/ambari-server/src/test/java/org/apache/ambari/server/checks/ServicesUpCheckTest.java index 65505fa..1368b8d 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/checks/ServicesUpCheckTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/checks/ServicesUpCheckTest.java @@ -116,7 +116,7 @@ public class ServicesUpCheckTest { final Service tezService = Mockito.mock(Service.class); final Service amsService = Mockito.mock(Service.class); -HashMap clusterServices = new HashMap (); +HashMap clusterServices = new HashMap<>(); clusterServices.put("HDFS", hdfsService); clusterServices.put("TEZ", tezService); clusterServices.put("AMBARI_METRICS", amsService); @@ -148,7 +148,7 @@ public class ServicesUpCheckTest { // Put Components inside Services // HDFS -Map hdfsComponents = new HashMap (); +Map hdfsComponents = new HashMap<>(); ServiceComponent nameNode = Mockito.mock(ServiceComponent.class); Mockito.when(nameNode.getName()).thenReturn("NAMENODE"); @@ -175,7 +175,7 @@ public class ServicesUpCheckTest { Mockito.when(hdfsService.getServiceComponents()).thenReturn(hdfsComponents); // TEZ -Map tezComponents = new HashMap (); +Map tezComponents = new HashMap<>(); ServiceComponent tezClient = Mockito.mock(ServiceComponent.class); Mockito.when(tezClient.getName()).thenReturn("TEZ_CLIENT"); @@ -187,7 +187,7 @@ public class ServicesUpCheckTest { Mockito.when(tezService.getServiceComponents()).thenReturn(tezComponents); //
[30/55] [abbrv] ambari git commit: AMBARI-19149. Code cleanup: redundant type arguments
http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ViewInstanceResourceDefinition.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ViewInstanceResourceDefinition.java b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ViewInstanceResourceDefinition.java index c825497..3654386 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ViewInstanceResourceDefinition.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ViewInstanceResourceDefinition.java @@ -43,7 +43,7 @@ public class ViewInstanceResourceDefinition extends BaseResourceDefinition { super(Resource.Type.ViewInstance); this.subResourceDefinitions = subResourceDefinitions == null ? new HashSet() : -new HashSet(subResourceDefinitions); + new HashSet<>(subResourceDefinitions); this.subResourceDefinitions.add(new SubResourceDefinition(Resource.Type.ViewPrivilege)); } http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ViewVersionResourceDefinition.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ViewVersionResourceDefinition.java b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ViewVersionResourceDefinition.java index f3df120..169af3b 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ViewVersionResourceDefinition.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ViewVersionResourceDefinition.java @@ -53,7 +53,7 @@ public class ViewVersionResourceDefinition extends BaseResourceDefinition { @Override public Set getSubResourceDefinitions() { -Set subResourceDefinitions = new HashSet(); +Set subResourceDefinitions = new HashSet<>(); subResourceDefinitions.add(new SubResourceDefinition(Resource.Type.ViewInstance)); subResourceDefinitions.add(new SubResourceDefinition(Resource.Type.ViewPermission)); return subResourceDefinitions; http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/api/resources/WorkflowResourceDefinition.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/WorkflowResourceDefinition.java b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/WorkflowResourceDefinition.java index 8ba2618..365e9b3 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/WorkflowResourceDefinition.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/WorkflowResourceDefinition.java @@ -47,7 +47,7 @@ public class WorkflowResourceDefinition extends BaseResourceDefinition { @Override public Set getSubResourceDefinitions() { -Set setChildren = new HashSet(); +Set setChildren = new HashSet<>(); setChildren.add(new SubResourceDefinition(Resource.Type.Job)); return setChildren; } http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/api/rest/BootStrapResource.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/rest/BootStrapResource.java b/ambari-server/src/main/java/org/apache/ambari/server/api/rest/BootStrapResource.java index 5672598..4aad530 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/rest/BootStrapResource.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/rest/BootStrapResource.java @@ -133,8 +133,8 @@ public class BootStrapResource { private void normalizeHosts(SshHostInfo info) { -List validHosts = new ArrayList(); -List newHosts = new ArrayList(); +List validHosts = new ArrayList<>(); +List newHosts = new ArrayList<>(); for (String host: info.getHosts()) { try { http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/api/services/ActiveWidgetLayoutService.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ActiveWidgetLayoutService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ActiveWidgetLayoutService.java index 40cd6e0..dd7c917 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ActiveWidgetLayoutService.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ActiveWidgetLayoutService.java @@ -68,7 +68,7 @@ public class
[41/55] [abbrv] ambari git commit: AMBARI-20546 EU/RU service check should skip services that do not have config types (dili)
AMBARI-20546 EU/RU service check should skip services that do not have config types (dili) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9433038b Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9433038b Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9433038b Branch: refs/heads/branch-3.0-perf Commit: 9433038b1446c66c0ae704657c62b97839c3877a Parents: 841e5b8 Author: Di LiAuthored: Thu Mar 30 15:35:20 2017 -0400 Committer: Andrew Onishuk Committed: Fri Mar 31 10:21:45 2017 +0300 -- .../server/api/services/AmbariMetaInfo.java | 6 + .../checks/ServiceCheckValidityCheck.java | 13 +- .../ambari/server/stack/ServiceModule.java | 18 +- .../apache/ambari/server/stack/StackModule.java | 9 + .../apache/ambari/server/state/StackInfo.java | 13 ++ .../server/api/services/AmbariMetaInfoTest.java | 7 + .../checks/ServiceCheckValidityCheckTest.java | 20 ++- .../ambari/server/stack/StackManagerTest.java | 20 ++- .../ambari/server/stack/StackModuleTest.java| 11 ++ .../HDP/2.0.7/services/SYSTEMML/metainfo.xml| 39 + .../stacks/HDP/2.0.8/services/HIVE/metainfo.xml | 174 +++ .../HDP/2.0.8/services/SYSTEMML/metainfo.xml| 39 + 12 files changed, 361 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/9433038b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java index 9f1d988..c655c62 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java @@ -555,6 +555,12 @@ public class AmbariMetaInfo { return removedServices.contains(serviceName); } + public boolean isServiceWithNoConfigs(String stackName, String version, String serviceName) throws AmbariException{ +StackInfo stack = getStack(stackName, version); +List servicesWithNoConfigs = stack.getServicesWithNoConfigs(); +return servicesWithNoConfigs.contains(serviceName); + } + public Collection getMonitoringServiceNames(String stackName, String version) throws AmbariException{ http://git-wip-us.apache.org/repos/asf/ambari/blob/9433038b/ambari-server/src/main/java/org/apache/ambari/server/checks/ServiceCheckValidityCheck.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/ServiceCheckValidityCheck.java b/ambari-server/src/main/java/org/apache/ambari/server/checks/ServiceCheckValidityCheck.java index 34b45bd..4ccdc0a 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/checks/ServiceCheckValidityCheck.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/ServiceCheckValidityCheck.java @@ -47,6 +47,7 @@ import org.apache.ambari.server.state.Cluster; import org.apache.ambari.server.state.MaintenanceState; import org.apache.ambari.server.state.Service; import org.apache.ambari.server.state.ServiceComponent; +import org.apache.ambari.server.state.StackId; import org.apache.ambari.server.state.stack.PrereqCheckStatus; import org.apache.ambari.server.state.stack.PrerequisiteCheck; import org.apache.ambari.server.state.stack.upgrade.UpgradeType; @@ -115,9 +116,15 @@ public class ServiceCheckValidityCheck extends AbstractCheckDescriptor { if (service.getMaintenanceState() != MaintenanceState.OFF || !hasAtLeastOneComponentVersionAdvertised(service)) { continue; } - - ServiceConfigEntity lastServiceConfig = serviceConfigDAO.getLastServiceConfig(clusterId, service.getName()); - lastServiceConfigUpdates.put(service.getName(), lastServiceConfig.getCreateTimestamp()); + StackId stackId = cluster.getCurrentStackVersion(); + boolean isServiceWitNoConfigs = ambariMetaInfo.get().isServiceWithNoConfigs(stackId.getStackName(), stackId.getStackVersion(), service.getName()); + if (isServiceWitNoConfigs){ +LOG.info(String.format("%s in %s version %s does not have customizable configurations. Skip checking service configuration history.", service.getName(), stackId.getStackName(), stackId.getStackVersion())); + } else { +LOG.info(String.format("%s in %s version %s has customizable configurations. Check service configuration history.", service.getName(), stackId.getStackName(), stackId.getStackVersion())); +ServiceConfigEntity
[36/55] [abbrv] ambari git commit: AMBARI-20600 : AMS grafana restart fails with ssl error after upgrading from 2.4.2.0. (avijayan)
AMBARI-20600 : AMS grafana restart fails with ssl error after upgrading from 2.4.2.0. (avijayan) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/179b3565 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/179b3565 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/179b3565 Branch: refs/heads/branch-3.0-perf Commit: 179b3565aafee3a340875380c6ae10aad0cd7534 Parents: 102dcde Author: Aravindan VijayanAuthored: Wed Mar 29 14:20:17 2017 -0700 Committer: Andrew Onishuk Committed: Fri Mar 31 10:21:45 2017 +0300 -- ambari-common/src/main/python/ambari_commons/network.py | 2 ++ .../0.1.0/configuration/ams-grafana-ini.xml | 11 +++ .../0.1.0/package/scripts/metrics_grafana_util.py| 8 .../AMBARI_METRICS/0.1.0/package/scripts/params.py | 1 + 4 files changed, 18 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/179b3565/ambari-common/src/main/python/ambari_commons/network.py -- diff --git a/ambari-common/src/main/python/ambari_commons/network.py b/ambari-common/src/main/python/ambari_commons/network.py index 6ab92b2..4c589f3 100644 --- a/ambari-common/src/main/python/ambari_commons/network.py +++ b/ambari-common/src/main/python/ambari_commons/network.py @@ -53,12 +53,14 @@ def get_http_connection(host, port, https_enabled=False, ca_certs=None): def check_ssl_certificate_and_return_ssl_version(host, port, ca_certs): try: +# Try with TLSv1 first. ssl_version = ssl.PROTOCOL_TLSv1 ssl.get_server_certificate((host, port), ssl_version=ssl_version, ca_certs=ca_certs) except ssl.SSLError as ssl_error: print_warning_msg("Failed to verify the SSL certificate for https://{0}:{1} with CA certificate in {2} using ssl.PROTOCOL_TLSv1." " Trying to use less secure ssl.PROTOCOL_SSLv23. Error : {3}".format(host, port, ca_certs, str(ssl_error))) try: + # Try with SSLv23 only if TLSv1 failed. ssl_version = ssl.PROTOCOL_SSLv23 ssl.get_server_certificate((host, port), ssl_version=ssl_version, ca_certs=ca_certs) except ssl.SSLError as ssl_error: http://git-wip-us.apache.org/repos/asf/ambari/blob/179b3565/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-grafana-ini.xml -- diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-grafana-ini.xml b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-grafana-ini.xml index ee0a4ad..90ff540 100644 --- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-grafana-ini.xml +++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-grafana-ini.xml @@ -46,6 +46,17 @@ +ca_cert + +Path to CA root certificate or bundle to be used to validate the Grafana certificate against. + For self signed certificates, this value can be the same as the value for 'cert_file'. + (If a path is not specified, the certificate validation is skipped) + + true + + + + content ams-grafana-ini template http://git-wip-us.apache.org/repos/asf/ambari/blob/179b3565/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py -- diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py index c8d532f..06a4518 100644 --- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py +++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py @@ -50,7 +50,7 @@ def perform_grafana_get_call(url, server): ca_certs = None if grafana_https_enabled: import params -ca_certs = params.ams_grafana_cert_file +ca_certs = params.ams_grafana_ca_cert for i in xrange(0, GRAFANA_CONNECT_TRIES): try: @@ -90,7 +90,7 @@ def perform_grafana_put_call(url, id, payload, server): ca_certs = None if grafana_https_enabled: import params -ca_certs = params.ams_grafana_cert_file +ca_certs = params.ams_grafana_ca_cert for i in xrange(0, GRAFANA_CONNECT_TRIES): try: @@ -125,7 +125,7 @@ def perform_grafana_post_call(url, payload, server): ca_certs = None if
[02/55] [abbrv] ambari git commit: AMBARI-19149. Code cleanup: redundant type arguments
http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/test/java/org/apache/ambari/server/topology/ConfigurationTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/topology/ConfigurationTest.java b/ambari-server/src/test/java/org/apache/ambari/server/topology/ConfigurationTest.java index 6a52762..b4aac40 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/topology/ConfigurationTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/topology/ConfigurationTest.java @@ -34,16 +34,16 @@ import org.junit.Test; */ public class ConfigurationTest { - private static final Map> EMPTY_PROPERTIES = new HashMap >(); - private static final Map >> EMPTY_ATTRIBUTES = new HashMap >>(); + private static final Map > EMPTY_PROPERTIES = new HashMap<>(); + private static final Map >> EMPTY_ATTRIBUTES = new HashMap<>(); @Test public void testGetProperties_noParent() { -Map > properties = new HashMap >(); -Map typeProperties1 = new HashMap (); +Map > properties = new HashMap<>(); +Map typeProperties1 = new HashMap<>(); typeProperties1.put("prop1", "val1"); typeProperties1.put("prop2", "val2"); -Map typeProperties2 = new HashMap (); +Map typeProperties2 = new HashMap<>(); typeProperties2.put("prop1", "val1"); typeProperties2.put("prop3", "val3"); @@ -57,11 +57,11 @@ public class ConfigurationTest { @Test public void testGetFullProperties_noParent() { -Map > properties = new HashMap >(); -Map typeProperties1 = new HashMap (); +Map > properties = new HashMap<>(); +Map typeProperties1 = new HashMap<>(); typeProperties1.put("prop1", "val1"); typeProperties1.put("prop2", "val2"); -Map typeProperties2 = new HashMap (); +Map typeProperties2 = new HashMap<>(); typeProperties2.put("prop1", "val1"); typeProperties2.put("prop3", "val3"); @@ -75,21 +75,21 @@ public class ConfigurationTest { @Test public void testGetProperties_withParent() { -Map > properties = new HashMap >(); -Map typeProperties1 = new HashMap (); +Map > properties = new HashMap<>(); +Map typeProperties1 = new HashMap<>(); typeProperties1.put("prop1", "val1"); typeProperties1.put("prop2", "val2"); -Map typeProperties2 = new HashMap (); +Map typeProperties2 = new HashMap<>(); typeProperties2.put("prop1", "val1"); typeProperties2.put("prop3", "val3"); properties.put("type1", typeProperties1); properties.put("type2", typeProperties2); -Map > parentProperties = new HashMap >(); -Map parentTypeProperties1 = new HashMap (); +Map > parentProperties = new HashMap<>(); +Map parentTypeProperties1 = new HashMap<>(); parentTypeProperties1.put("prop5", "val5"); -Map parentTypeProperties3 = new HashMap (); +Map parentTypeProperties3 = new HashMap<>(); parentTypeProperties3.put("prop6", "val6"); parentProperties.put("type1", parentTypeProperties1); @@ -195,12 +195,12 @@ public class ConfigurationTest { @Test public void testGetAttributes_noParent() { -Map >> attributes = new HashMap >>(); -Map > attributeProperties = new HashMap >(); -Map properties1 = new HashMap (); +Map >> attributes = new HashMap<>(); +Map > attributeProperties = new HashMap<>(); +Map properties1 = new HashMap<>(); properties1.put("prop1", "val1"); properties1.put("prop2", "val2"); -Map properties2 = new HashMap (); +Map properties2 = new HashMap<>(); properties2.put("prop1", "val3"); attributeProperties.put("attribute1", properties1); attributeProperties.put("attribute2", properties2); @@ -362,12 +362,12 @@
[17/55] [abbrv] ambari git commit: AMBARI-19149. Code cleanup: redundant type arguments
http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java index 718c7ce..2b5d2f3 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java @@ -196,7 +196,7 @@ public class TestActionScheduler { Host host = mock(Host.class); HashMaphosts = -new HashMap (); + new HashMap<>(); hosts.put(hostname, sch); HostEntity hostEntity = new HostEntity(); hostEntity.setHostName(hostname); @@ -210,7 +210,7 @@ public class TestActionScheduler { ActionDBAccessor db = mock(ActionDBAccessorImpl.class); HostRoleCommandDAO hostRoleCommandDAOMock = mock(HostRoleCommandDAO.class); Mockito.doNothing().when(hostRoleCommandDAOMock).publishTaskCreateEvent(anyListOf(HostRoleCommand.class)); -List stages = new ArrayList(); +List stages = new ArrayList<>(); Stage s = StageUtils.getATestStage(1, 977, hostname, CLUSTER_HOST_INFO, "{\"host_param\":\"param_value\"}", "{\"stage_param\":\"param_value\"}"); stages.add(s); @@ -295,7 +295,7 @@ public class TestActionScheduler { when(serviceObj.getCluster()).thenReturn(oneClusterMock); Host host = mock(Host.class); HashMap hosts = -new HashMap (); + new HashMap<>(); hosts.put(hostname, sch); when(scomp.getServiceComponentHosts()).thenReturn(hosts); @@ -307,7 +307,7 @@ public class TestActionScheduler { hostEntity.setHostName(hostname); hostDAO.create(hostEntity); -List stages = new ArrayList(); +List stages = new ArrayList<>(); final Stage s = StageUtils.getATestStage(1, 977, hostname, CLUSTER_HOST_INFO, "{\"host_param\":\"param_value\"}", "{\"stage_param\":\"param_value\"}"); s.addHostRoleExecutionCommand(hostname, Role.SECONDARY_NAMENODE, RoleCommand.INSTALL, @@ -389,7 +389,7 @@ public class TestActionScheduler { when(serviceObj.getCluster()).thenReturn(oneClusterMock); Host host = mock(Host.class); HashMap hosts = -new HashMap (); + new HashMap<>(); hosts.put(hostname, sch); when(scomp.getServiceComponentHosts()).thenReturn(hosts); @@ -397,7 +397,7 @@ public class TestActionScheduler { when(host.getState()).thenReturn(HostState.HEARTBEAT_LOST); when(host.getHostName()).thenReturn(hostname); -final List stages = new ArrayList(); +final List stages = new ArrayList<>(); final Stage s = StageUtils.getATestStage(1, 977, hostname, CLUSTER_HOST_INFO, "{\"host_param\":\"param_value\"}", "{\"stage_param\":\"param_value\"}"); stages.add(s); @@ -464,7 +464,7 @@ public class TestActionScheduler { hostDAO.merge(hostEntity2); HashMap hosts = -new HashMap (); + new HashMap<>(); hosts.put(hostname1, sch1); hosts.put(hostname2, sch2); when(scomp.getServiceComponentHosts()).thenReturn(hosts); @@ -484,7 +484,7 @@ public class TestActionScheduler { when(serviceObj.getServiceComponent(anyString())).thenReturn(scomp); when(serviceObj.getCluster()).thenReturn(oneClusterMock); -final List stages = new ArrayList(); +final List stages = new ArrayList<>(); final Stage stage = stageFactory.createNew(1, "/tmp", "cluster1", 1L, "stageWith2Tasks", CLUSTER_HOST_INFO, "{\"command_param\":\"param_value\"}", "{\"host_param\":\"param_value\"}"); addInstallTaskToStage(stage, hostname1, "cluster1", Role.DATANODE, @@ -606,8 +606,8 @@ public class TestActionScheduler { Clusters fsm = mock(Clusters.class); UnitOfWork unitOfWork = mock(UnitOfWork.class); -List stages = new ArrayList(); -Map payload = new HashMap (); +List stages = new ArrayList<>(); +Map payload = new HashMap<>(); final Stage s = getStageWithServerAction(1, 977, payload, "test", 1200, false, false); stages.add(s); @@ -704,13 +704,13 @@ public class TestActionScheduler { String hostname1 = "ahost.ambari.apache.org"; String hostname2 = "bhost.ambari.apache.org"; HashMap hosts = -new HashMap (); + new HashMap<>(); hosts.put(hostname1, sch); hosts.put(hostname2, sch); hosts.put(Stage.INTERNAL_HOSTNAME, sch);
[39/55] [abbrv] ambari git commit: AMBARI-20614. Auto-Start Services Switch button broken.(xiwang)
AMBARI-20614. Auto-Start Services Switch button broken.(xiwang) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8d35583d Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8d35583d Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8d35583d Branch: refs/heads/branch-3.0-perf Commit: 8d35583dcade309564fa1b5c317b3ebfe0f399f2 Parents: 16b158c Author: Xi WangAuthored: Tue Mar 28 18:24:29 2017 -0700 Committer: Andrew Onishuk Committed: Fri Mar 31 10:21:45 2017 +0300 -- ambari-web/app/styles/widgets.less | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/8d35583d/ambari-web/app/styles/widgets.less -- diff --git a/ambari-web/app/styles/widgets.less b/ambari-web/app/styles/widgets.less index af76e4f..9bf60f0 100644 --- a/ambari-web/app/styles/widgets.less +++ b/ambari-web/app/styles/widgets.less @@ -365,6 +365,7 @@ } .bootstrap-switch { + white-space: nowrap; &, &.bootstrap-switch-focused { border-color: transparent;
[42/55] [abbrv] ambari git commit: AMBARI-20617. Display log level, method name from stack_advisor in ambari-server.log (dlysnichenko)
http://git-wip-us.apache.org/repos/asf/ambari/blob/0ef14f56/ambari-server/src/main/resources/stacks/stack_advisor.py -- diff --git a/ambari-server/src/main/resources/stacks/stack_advisor.py b/ambari-server/src/main/resources/stacks/stack_advisor.py index 975a8f7..4a81dc6 100644 --- a/ambari-server/src/main/resources/stacks/stack_advisor.py +++ b/ambari-server/src/main/resources/stacks/stack_advisor.py @@ -25,13 +25,14 @@ import re import socket import string import traceback +import sys +import logging from math import ceil, floor from urlparse import urlparse # Local imports from resource_management.libraries.functions.data_structure_utils import get_from_dict from resource_management.core.exceptions import Fail -from resource_management.core.logger import Logger class StackAdvisor(object): @@ -332,8 +333,8 @@ class DefaultStackAdvisor(StackAdvisor): def __init__(self): self.services = None - -Logger.initialize_logger() + +self.initialize_logger('DefaultStackAdvisor') # Dictionary that maps serviceName or componentName to serviceAdvisor self.serviceAdvisorsDict = {} @@ -351,6 +352,20 @@ class DefaultStackAdvisor(StackAdvisor): self.componentLayoutSchemes = {} self.loaded_service_advisors = False + def initialize_logger(self, name='DefaultStackAdvisor', logging_level=logging.INFO, format='%(asctime)s %(levelname)s %(name)s %(funcName)s: - %(message)s'): +# set up logging (two separate loggers for stderr and stdout with different loglevels) +self.logger = logging.getLogger(name) +self.logger.setLevel(logging_level) +formatter = logging.Formatter(format) +chout = logging.StreamHandler(sys.stdout) +chout.setLevel(logging_level) +chout.setFormatter(formatter) +cherr = logging.StreamHandler(sys.stderr) +cherr.setLevel(logging.ERROR) +cherr.setFormatter(formatter) +self.logger.handlers = [] +self.logger.addHandler(cherr) +self.logger.addHandler(chout) def getServiceComponentLayoutValidations(self, services, hosts): """ @@ -572,14 +587,13 @@ class DefaultStackAdvisor(StackAdvisor): break if hasattr(service_advisor, best_class_name): -Logger.info("ServiceAdvisor implementation for service {0} was loaded".format(service_name)) +self.logger.info("ServiceAdvisor implementation for service {0} was loaded".format(service_name)) return getattr(service_advisor, best_class_name)() else: -Logger.error("Failed to load or create ServiceAdvisor implementation for service {0}: " \ +self.logger.error("Failed to load or create ServiceAdvisor implementation for service {0}: " \ "Expecting class name {1} but it was not found.".format(service_name, best_class_name)) except Exception as e: -traceback.print_exc() -Logger.error("Failed to load or create ServiceAdvisor implementation for service {0}".format(service_name)) +self.logger.exception("Failed to load or create ServiceAdvisor implementation for service {0}".format(service_name)) return None @@ -717,7 +731,7 @@ class DefaultStackAdvisor(StackAdvisor): # Override the values in "default" with those from the service advisor default.update(advisor.heap_size_properties) except Exception, e: - traceback.print_exc() + self.logger.exception() return default def createComponentLayoutRecommendations(self, services, hosts): @@ -1062,7 +1076,7 @@ class DefaultStackAdvisor(StackAdvisor): if cluster["hBaseInstalled"]: totalAvailableRam -= cluster["hbaseRam"] cluster["totalAvailableRam"] = max(512, totalAvailableRam * 1024) -Logger.info("Memory for YARN apps - cluster[totalAvailableRam]: " + str(cluster["totalAvailableRam"])) +self.logger.info("Memory for YARN apps - cluster[totalAvailableRam]: " + str(cluster["totalAvailableRam"])) suggestedMinContainerRam = 1024 # new smaller value for YARN min container callContext = self.getCallContext(services) @@ -1070,7 +1084,7 @@ class DefaultStackAdvisor(StackAdvisor): operation = self.getUserOperationContext(services, DefaultStackAdvisor.OPERATION) adding_yarn = self.isServiceBeingAdded(services, 'YARN') if operation: - Logger.info("user operation context : " + str(operation)) + self.logger.info("user operation context : " + str(operation)) if services: # its never None but some unit tests pass it as None # If min container value is changed (user is changing it) @@ -1082,7 +1096,7 @@ class DefaultStackAdvisor(StackAdvisor): operation == DefaultStackAdvisor.RECOMMEND_ATTRIBUTE_OPERATION or \ (operation == DefaultStackAdvisor.ADD_SERVICE_OPERATION and not adding_yarn): -Logger.info("Full context: callContext = " +
[23/55] [abbrv] ambari git commit: AMBARI-19149. Code cleanup: redundant type arguments
http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WorkflowResourceProvider.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WorkflowResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WorkflowResourceProvider.java index 35adbcb..9737aaa 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WorkflowResourceProvider.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WorkflowResourceProvider.java @@ -79,9 +79,9 @@ public class WorkflowResourceProvider extends protected static final String WORKFLOW_CONTEXT_PROPERTY_ID = PropertyHelper .getPropertyId("Workflow", "context"); - private static final Set pkPropertyIds = new HashSet( - Arrays.asList(new String[] {WORKFLOW_CLUSTER_NAME_PROPERTY_ID, - WORKFLOW_ID_PROPERTY_ID})); + private static final Set pkPropertyIds = new HashSet<>( +Arrays.asList(new String[]{WORKFLOW_CLUSTER_NAME_PROPERTY_ID, + WORKFLOW_ID_PROPERTY_ID})); protected WorkflowFetcher workflowFetcher; @@ -128,7 +128,7 @@ public class WorkflowResourceProvider extends throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException { -Set resourceSet = new HashSet(); +Set resourceSet = new HashSet<>(); Set requestedIds = getRequestPropertyIds(request, predicate); Set> predicatePropertieSet = getPropertyMaps(predicate); @@ -164,7 +164,7 @@ public class WorkflowResourceProvider extends @Override public Map getKeyPropertyIds() { -Map keyPropertyIds = new HashMap (); +Map keyPropertyIds = new HashMap<>(); keyPropertyIds.put(Type.Cluster, WORKFLOW_CLUSTER_NAME_PROPERTY_ID); keyPropertyIds.put(Type.Workflow, WORKFLOW_ID_PROPERTY_ID); return keyPropertyIds; @@ -246,7 +246,7 @@ public class WorkflowResourceProvider extends @Override public Set fetchWorkflows(Set requestedIds, String clusterName, String workflowId) { - Set workflows = new HashSet(); + Set workflows = new HashSet<>(); ResultSet rs = null; try { rs = getResultSet(requestedIds, workflowId); @@ -309,7 +309,7 @@ public class WorkflowResourceProvider extends @Override protected Map getDBFieldMap() { -Map dbFields = new HashMap (); +Map dbFields = new HashMap<>(); dbFields.put(WORKFLOW_ID_PROPERTY_ID, WorkflowFields.WORKFLOWID); dbFields.put(WORKFLOW_NAME_PROPERTY_ID, WorkflowFields.WORKFLOWNAME); dbFields.put(WORKFLOW_USER_NAME_PROPERTY_ID, WorkflowFields.USERNAME); http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/jdbc/JDBCResourceProvider.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/jdbc/JDBCResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/jdbc/JDBCResourceProvider.java index 1df5bb4..8002087 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/jdbc/JDBCResourceProvider.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/jdbc/JDBCResourceProvider.java @@ -68,7 +68,7 @@ public class JDBCResourceProvider extends BaseProvider implements ResourceProvid /** * Key mappings used for joins. */ -private final Map > importedKeys = new HashMap >(); +private final Map > importedKeys = new HashMap<>(); protected final static Logger LOG = LoggerFactory.getLogger(JDBCResourceProvider.class); @@ -87,7 +87,7 @@ public class JDBCResourceProvider extends BaseProvider implements ResourceProvid public Set getResources(Request request, Predicate predicate) throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException { -Set resources = new HashSet(); +Set resources = new HashSet<>(); Set propertyIds = getRequestPropertyIds(request, predicate); // Can't allow these properties with the old schema... @@ -309,7 +309,7 @@ public class JDBCResourceProvider extends BaseProvider implements ResourceProvid private String getSelectSQL(Set propertyIds, Predicate predicate) { StringBuilder columns = new StringBuilder(); -Set tableSet = new HashSet(); +Set tableSet = new HashSet<>(); for (String propertyId : propertyIds) { if
[54/55] [abbrv] ambari git commit: AMBARI-20630. Integrate stomp client library into agent code (aonishuk)
http://git-wip-us.apache.org/repos/asf/ambari/blob/72b78424/ambari-common/src/main/python/ambari_stomp/protocol.py -- diff --git a/ambari-common/src/main/python/ambari_stomp/protocol.py b/ambari-common/src/main/python/ambari_stomp/protocol.py new file mode 100644 index 000..44e83cc --- /dev/null +++ b/ambari-common/src/main/python/ambari_stomp/protocol.py @@ -0,0 +1,507 @@ +"""Provides the 1.0, 1.1 and 1.2 protocol classes. +""" + +import uuid + +from ambari_stomp.backward import encode +from ambari_stomp.constants import * +from ambari_stomp.exception import ConnectFailedException +from ambari_stomp.listener import * +import ambari_stomp.utils as utils + + +log = logging.getLogger('stomp.py') + + +class Protocol10(ConnectionListener): +""" +Represents version 1.0 of the protocol (see https://stomp.github.io/stomp-specification-1.0.html). + +Most users should not instantiate the protocol directly. See :py:mod:`stomp.connect` for connection classes. + +:param transport: +:param bool auto_content_length: Whether to calculate and send the content-length header automatically if it has not been set +""" +def __init__(self, transport, auto_content_length=True): +self.transport = transport +self.auto_content_length = auto_content_length +transport.set_listener('protocol-listener', self) +self.version = '1.0' + +def send_frame(self, cmd, headers=None, body=''): +""" +Encode and send a stomp frame +through the underlying transport. + +:param str cmd: the protocol command +:param dict headers: a map of headers to include in the frame +:param body: the content of the message +""" +frame = utils.Frame(cmd, headers, body) +self.transport.transmit(frame) + +def abort(self, transaction, headers=None, **keyword_headers): +""" +Abort a transaction. + +:param str transaction: the identifier of the transaction +:param dict headers: a map of any additional headers the broker requires +:param keyword_headers: any additional headers the broker requires +""" +assert transaction is not None, "'transaction' is required" +headers = utils.merge_headers([headers, keyword_headers]) +headers[HDR_TRANSACTION] = transaction +self.send_frame(CMD_ABORT, headers) + +def ack(self, id, transaction=None): +""" +Acknowledge 'consumption' of a message by id. + +:param str id: identifier of the message +:param str transaction: include the acknowledgement in the specified transaction +""" +assert id is not None, "'id' is required" +headers = {HDR_MESSAGE_ID: id} +if transaction: +headers[HDR_TRANSACTION] = transaction +self.send_frame(CMD_ACK, headers) + +def begin(self, transaction=None, headers=None, **keyword_headers): +""" +Begin a transaction. + +:param str transaction: the identifier for the transaction (optional - if not specified +a unique transaction id will be generated) +:param dict headers: a map of any additional headers the broker requires +:param keyword_headers: any additional headers the broker requires + +:return: the transaction id +:rtype: str +""" +headers = utils.merge_headers([headers, keyword_headers]) +if not transaction: +transaction = str(uuid.uuid4()) +headers[HDR_TRANSACTION] = transaction +self.send_frame(CMD_BEGIN, headers) +return transaction + +def commit(self, transaction=None, headers=None, **keyword_headers): +""" +Commit a transaction. + +:param str transaction: the identifier for the transaction +:param dict headers: a map of any additional headers the broker requires +:param keyword_headers: any additional headers the broker requires +""" +assert transaction is not None, "'transaction' is required" +headers = utils.merge_headers([headers, keyword_headers]) +headers[HDR_TRANSACTION] = transaction +self.send_frame(CMD_COMMIT, headers) + +def connect(self, username=None, passcode=None, wait=False, headers=None, **keyword_headers): +""" +Start a connection. + +:param str username: the username to connect with +:param str passcode: the password used to authenticate with +:param bool wait: if True, wait for the connection to be established/acknowledged +:param dict headers: a map of any additional headers the broker requires +:param keyword_headers: any additional headers the broker requires +""" +cmd = CMD_CONNECT +headers = utils.merge_headers([headers, keyword_headers]) +headers[HDR_ACCEPT_VERSION] = self.version + +
[55/55] [abbrv] ambari git commit: AMBARI-20630. Integrate stomp client library into agent code (aonishuk)
AMBARI-20630. Integrate stomp client library into agent code (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/72b78424 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/72b78424 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/72b78424 Branch: refs/heads/branch-3.0-perf Commit: 72b784249cc30da875393a411b9a78242256298c Parents: fc6ab24 Author: Andrew OnishukAuthored: Fri Mar 31 10:21:49 2017 +0300 Committer: Andrew Onishuk Committed: Fri Mar 31 10:21:49 2017 +0300 -- ambari-agent/conf/unix/install-helper.sh| 10 + ambari-agent/pom.xml| 1 + ambari-agent/src/packages/tarball/all.xml | 5 + .../src/main/python/ambari_stomp/__init__.py| 56 ++ .../src/main/python/ambari_stomp/__main__.py| 558 .../python/ambari_stomp/adapter/__init__.py | 2 + .../python/ambari_stomp/adapter/multicast.py| 180 .../src/main/python/ambari_stomp/backward.py| 30 + .../src/main/python/ambari_stomp/backward2.py | 61 ++ .../src/main/python/ambari_stomp/backward3.py | 68 ++ .../main/python/ambari_stomp/backwardsock.py| 11 + .../main/python/ambari_stomp/backwardsock25.py | 32 + .../main/python/ambari_stomp/backwardsock26.py | 16 + .../src/main/python/ambari_stomp/colors.py | 18 + .../src/main/python/ambari_stomp/connect.py | 203 + .../src/main/python/ambari_stomp/constants.py | 29 + .../src/main/python/ambari_stomp/exception.py | 35 + .../src/main/python/ambari_stomp/listener.py| 522 .../src/main/python/ambari_stomp/protocol.py| 507 +++ .../src/main/python/ambari_stomp/transport.py | 843 +++ .../src/main/python/ambari_stomp/utils.py | 250 ++ pom.xml | 2 + 22 files changed, 3439 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/72b78424/ambari-agent/conf/unix/install-helper.sh -- diff --git a/ambari-agent/conf/unix/install-helper.sh b/ambari-agent/conf/unix/install-helper.sh index 0e32d0a..35aec15 100644 --- a/ambari-agent/conf/unix/install-helper.sh +++ b/ambari-agent/conf/unix/install-helper.sh @@ -22,12 +22,14 @@ COMMON_DIR="/usr/lib/python2.6/site-packages/ambari_commons" RESOURCE_MANAGEMENT_DIR="/usr/lib/python2.6/site-packages/resource_management" JINJA_DIR="/usr/lib/python2.6/site-packages/ambari_jinja2" SIMPLEJSON_DIR="/usr/lib/python2.6/site-packages/ambari_simplejson" +STOMP_DIR="/usr/lib/python2.6/site-packages/ambari_stomp" OLD_COMMON_DIR="/usr/lib/python2.6/site-packages/common_functions" INSTALL_HELPER_SERVER="/var/lib/ambari-server/install-helper.sh" COMMON_DIR_AGENT="/usr/lib/ambari-agent/lib/ambari_commons" RESOURCE_MANAGEMENT_DIR_AGENT="/usr/lib/ambari-agent/lib/resource_management" JINJA_AGENT_DIR="/usr/lib/ambari-agent/lib/ambari_jinja2" SIMPLEJSON_AGENT_DIR="/usr/lib/ambari-agent/lib/ambari_simplejson" +STOMP_AGENT_DIR="/usr/lib/ambari-agent/lib/ambari_stomp" AMBARI_AGENT="/usr/lib/python2.6/site-packages/ambari_agent" PYTHON_WRAPER_TARGET="/usr/bin/ambari-python-wrap" AMBARI_AGENT_VAR="/var/lib/ambari-agent" @@ -64,6 +66,10 @@ do_install(){ if [ ! -d "$SIMPLEJSON_DIR" ]; then ln -s "$SIMPLEJSON_AGENT_DIR" "$SIMPLEJSON_DIR" fi + # setting stomp shared resource + if [ ! -d "$STOMP_DIR" ]; then +ln -s "$STOMP_AGENT_DIR" "$STOMP_DIR" + fi # on nano Ubuntu, when umask=027 those folders are created without 'x' bit for 'others'. # which causes failures when hadoop users try to access tmp_dir @@ -149,6 +155,10 @@ do_remove(){ rm -f $SIMPLEJSON_DIR fi + if [ -d "$STOMP_DIR" ]; then +rm -f $STOMP_DIR + fi + if [ -d "$OLD_COMMON_DIR" ]; then rm -f $OLD_COMMON_DIR fi http://git-wip-us.apache.org/repos/asf/ambari/blob/72b78424/ambari-agent/pom.xml -- diff --git a/ambari-agent/pom.xml b/ambari-agent/pom.xml index a57ed64..4807a35 100644 --- a/ambari-agent/pom.xml +++ b/ambari-agent/pom.xml @@ -41,6 +41,7 @@ /usr/lib/ambari-agent/lib/resource_management /usr/lib/ambari-agent/lib/ambari_jinja2 /usr/lib/ambari-agent/lib/ambari_simplejson + /usr/lib/ambari-agent/lib/ambari_stomp /usr/lib/ambari-agent/lib amd64 ../ambari-server http://git-wip-us.apache.org/repos/asf/ambari/blob/72b78424/ambari-agent/src/packages/tarball/all.xml -- diff --git a/ambari-agent/src/packages/tarball/all.xml b/ambari-agent/src/packages/tarball/all.xml index 363941a..a22f0bb 100644 ---
[48/55] [abbrv] ambari git commit: AMBARI-20635. Implement XML processing best practices in Hive View. (dipayanb)
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/f6917a9b Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f6917a9b Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f6917a9b Branch: refs/heads/branch-3.0-perf Commit: f6917a9b8e4946b71b8d4964d56df640e1283bea Parents: 192a30f Author: Dipayan BhowmickAuthored: Thu Mar 30 22:02:31 2017 +0530 Committer: Andrew Onishuk Committed: Fri Mar 31 10:21:45 2017 +0300 -- .../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/f6917a9b/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/f6917a9b/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);
[21/55] [abbrv] ambari git commit: AMBARI-19149. Code cleanup: redundant type arguments
http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/PrepareDisableKerberosServerAction.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/PrepareDisableKerberosServerAction.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/PrepareDisableKerberosServerAction.java index e0d16af..5b65833 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/PrepareDisableKerberosServerAction.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/PrepareDisableKerberosServerAction.java @@ -91,7 +91,7 @@ public class PrepareDisableKerberosServerAction extends AbstractPrepareKerberosS } }); -Map> kerberosConfigurations = new HashMap >(); +Map > kerberosConfigurations = new HashMap<>(); Map commandParameters = getCommandParameters(); String dataDirectory = getCommandParameterValue(commandParameters, DATA_DIRECTORY); @@ -143,7 +143,7 @@ public class PrepareDisableKerberosServerAction extends AbstractPrepareKerberosS // Ensure the cluster-env/security_enabled flag is set properly Map clusterEnvProperties = kerberosConfigurations.get(KerberosHelper.SECURITY_ENABLED_CONFIG_TYPE); if (clusterEnvProperties == null) { - clusterEnvProperties = new HashMap (); + clusterEnvProperties = new HashMap<>(); kerberosConfigurations.put(KerberosHelper.SECURITY_ENABLED_CONFIG_TYPE, clusterEnvProperties); } clusterEnvProperties.put(KerberosHelper.SECURITY_ENABLED_PROPERTY_NAME, "false"); @@ -157,13 +157,13 @@ public class PrepareDisableKerberosServerAction extends AbstractPrepareKerberosS throw new AmbariException(message); } - Map configurationsToRemove = new HashMap (); + Map configurationsToRemove = new HashMap<>(); // Fill the configurationsToRemove map with all Kerberos-related configurations. Values // needed to be kept will have new values from the stack definition and thus pruned from // this map. for (Map.Entry > entry : kerberosConfigurations.entrySet()) { -configurationsToRemove.put(entry.getKey(), new HashSet(entry.getValue().keySet())); +configurationsToRemove.put(entry.getKey(), new HashSet<>(entry.getValue().keySet())); } // Remove cluster-env from the set of configurations to remove since it has no default set @@ -171,7 +171,7 @@ public class PrepareDisableKerberosServerAction extends AbstractPrepareKerberosS configurationsToRemove.remove("cluster-env"); if (!schToProcess.isEmpty()) { -Set visitedServices = new HashSet(); +Set visitedServices = new HashSet<>(); for (ServiceComponentHost sch : schToProcess) { String serviceName = sch.getServiceName(); http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/PrepareEnableKerberosServerAction.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/PrepareEnableKerberosServerAction.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/PrepareEnableKerberosServerAction.java index ed01633..ca15695 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/PrepareEnableKerberosServerAction.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/PrepareEnableKerberosServerAction.java @@ -68,7 +68,7 @@ public class PrepareEnableKerberosServerAction extends PrepareKerberosIdentities Map commandParameters = getCommandParameters(); String dataDirectory = getCommandParameterValue(commandParameters, DATA_DIRECTORY); -Map > kerberosConfigurations = new HashMap >(); +Map > kerberosConfigurations = new HashMap<>(); int schCount = schToProcess.size(); if (schCount == 0) { @@ -100,7 +100,7 @@ public class PrepareEnableKerberosServerAction extends PrepareKerberosIdentities // Ensure the cluster-env/security_enabled flag is set properly Map clusterEnvProperties = kerberosConfigurations.get(KerberosHelper.SECURITY_ENABLED_CONFIG_TYPE); if (clusterEnvProperties == null) { - clusterEnvProperties = new HashMap (); + clusterEnvProperties = new HashMap<>();
[15/55] [abbrv] ambari git commit: AMBARI-19149. Code cleanup: redundant type arguments
http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/test/java/org/apache/ambari/server/api/services/PersistenceManagerImplTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/PersistenceManagerImplTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/PersistenceManagerImplTest.java index d1f9c90..07c3a90 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/PersistenceManagerImplTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/PersistenceManagerImplTest.java @@ -120,18 +120,18 @@ public class PersistenceManagerImplTest { Request serverRequest = createStrictMock(Request.class); RequestBody body = new RequestBody(); -MapmapResourceIds = new HashMap (); +Map mapResourceIds = new HashMap<>(); mapResourceIds.put(Resource.Type.Cluster, "clusterId"); mapResourceIds.put(Resource.Type.Service, "serviceId"); -Map mapProperties = new HashMap (); +Map mapProperties = new HashMap<>(); mapProperties.put("componentId", "id"); mapProperties.put(PropertyHelper.getPropertyId("foo", "bar"), "value"); NamedPropertySet namedPropSet = new NamedPropertySet("", mapProperties); body.addPropertySet(namedPropSet); -Set > setExpected = new HashSet >(); -Map mapExpected = new HashMap (mapProperties); +Set > setExpected = new HashSet<>(); +Map mapExpected = new HashMap<>(mapProperties); mapExpected.put(clusterId, "clusterId"); mapExpected.put(serviceId, "serviceId"); setExpected.add(mapExpected); @@ -164,13 +164,13 @@ public class PersistenceManagerImplTest { Request serverRequest = createStrictMock(Request.class); RequestBody body = new RequestBody(); -Map mapResourceIds = new HashMap (); +Map mapResourceIds = new HashMap<>(); mapResourceIds.put(Resource.Type.Cluster, "clusterId"); mapResourceIds.put(Resource.Type.Service, "serviceId"); mapResourceIds.put(Resource.Type.Component, "componentId"); -Set > setExpected = new HashSet >(); -Map mapExpected = new HashMap (); +Set > setExpected = new HashSet<>(); +Map mapExpected = new HashMap<>(); mapExpected.put(clusterId, "clusterId"); mapExpected.put(serviceId, "serviceId"); mapExpected.put(componentId, "componentId"); @@ -204,15 +204,15 @@ public class PersistenceManagerImplTest { String clusterId = "clusterId"; String serviceId = "serviceId"; -Map mapResourceIds = new HashMap (); +Map mapResourceIds = new HashMap<>(); mapResourceIds.put(Resource.Type.Cluster, "clusterId"); mapResourceIds.put(Resource.Type.Service, "serviceId"); -Map mapResourceProps1 = new HashMap (); +Map mapResourceProps1 = new HashMap<>(); mapResourceProps1.put("componentId", "id1"); mapResourceProps1.put(PropertyHelper.getPropertyId("foo", "bar"), "value"); -Map mapResourceProps2 = new HashMap (); +Map mapResourceProps2 = new HashMap<>(); mapResourceProps1.put("componentId", "id2"); mapResourceProps2.put(PropertyHelper.getPropertyId("foo", "bar2"), "value2"); @@ -222,12 +222,12 @@ public class PersistenceManagerImplTest { body.addPropertySet(namedPropSet1); body.addPropertySet(namedPropSet2); -Set > setExpected = new HashSet >(); -Map mapExpected1 = new HashMap (mapResourceProps1); +Set > setExpected = new HashSet<>(); +Map mapExpected1 = new HashMap<>(mapResourceProps1); mapExpected1.put(clusterId, "clusterId"); mapExpected1.put(serviceId, "serviceId"); setExpected.add(mapExpected1); -Map mapExpected2 = new HashMap (mapResourceProps2); +Map mapExpected2 = new HashMap<>(mapResourceProps2); mapExpected2.put(clusterId, "clusterId"); mapExpected2.put(serviceId, "serviceId"); setExpected.add(mapExpected2); @@ -264,16 +264,16 @@ public class PersistenceManagerImplTest { // because the value is not set in the request String serviceId = null; -Map mapResourceIds = new HashMap (); +Map mapResourceIds = new HashMap<>();
[03/55] [abbrv] ambari git commit: AMBARI-19149. Code cleanup: redundant type arguments
http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterDeadlockTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterDeadlockTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterDeadlockTest.java index 76146b5..d479ca2 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterDeadlockTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterDeadlockTest.java @@ -105,7 +105,7 @@ public class ClusterDeadlockTest { /** * */ - private List hostNames = new ArrayList(NUMBER_OF_HOSTS); + private List hostNames = new ArrayList<>(NUMBER_OF_HOSTS); /** * Creates 100 hosts and adds them to the cluster. @@ -130,7 +130,7 @@ public class ClusterDeadlockTest { Config config2 = configFactory.createNew(cluster, "test-type2", "version1", new HashMap(), new HashMap >()); -cluster.addDesiredConfig("test user", new HashSet(Arrays.asList(config1, config2))); +cluster.addDesiredConfig("test user", new HashSet<>(Arrays.asList(config1, config2))); // 100 hosts for (int i = 0; i < NUMBER_OF_HOSTS; i++) { @@ -170,7 +170,7 @@ public class ClusterDeadlockTest { ServiceComponentHost dataNodeSCH = createNewServiceComponentHost("HDFS", "DATANODE", "c64-0"); -List threads = new ArrayList(); +List threads = new ArrayList<>(); for (int i = 0; i < NUMBER_OF_THREADS; i++) { DeadlockExerciserThread thread = new DeadlockExerciserThread(); thread.setCluster(cluster); @@ -209,7 +209,7 @@ public class ClusterDeadlockTest { ServiceComponent nameNodeComponent = service.getServiceComponent("NAMENODE"); ServiceComponent dataNodeComponent = service.getServiceComponent("DATANODE"); -List threads = new ArrayList(); +List threads = new ArrayList<>(); for (int i = 0; i < 5; i++) { ServiceComponentReaderWriterThread thread = new ServiceComponentReaderWriterThread(); thread.setDataNodeComponent(dataNodeComponent); @@ -241,7 +241,7 @@ public class ClusterDeadlockTest { @Test() public void testDeadlockWhileRestartingComponents() throws Exception { // for each host, install both components -List serviceComponentHosts = new ArrayList(); +List serviceComponentHosts = new ArrayList<>(); for (String hostName : hostNames) { serviceComponentHosts.add(createNewServiceComponentHost("HDFS", "NAMENODE", hostName)); @@ -250,7 +250,7 @@ public class ClusterDeadlockTest { "DATANODE", hostName)); } -List threads = new ArrayList(); +List threads = new ArrayList<>(); for (int i = 0; i < NUMBER_OF_THREADS; i++) { ClusterReaderThread clusterReaderThread = new ClusterReaderThread(); ClusterWriterThread clusterWriterThread = new ClusterWriterThread(); @@ -281,7 +281,7 @@ public class ClusterDeadlockTest { @Test public void testDeadlockWithConfigsUpdate() throws Exception { -List threads = new ArrayList(); +List threads = new ArrayList<>(); for (int i = 0; i < NUMBER_OF_THREADS; i++) { ClusterDesiredConfigsReaderThread readerThread = null; for (int j = 0; j < NUMBER_OF_THREADS; j++) { @@ -559,7 +559,7 @@ public class ClusterDeadlockTest { } private void setOsFamily(Host host, String osFamily, String osVersion) { -Map hostAttributes = new HashMap (2); +Map hostAttributes = new HashMap<>(2); hostAttributes.put("os_family", osFamily); hostAttributes.put("os_release_version", osVersion); host.setHostAttributes(hostAttributes); http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterImplTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterImplTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterImplTest.java index 3172571..76f9130 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterImplTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterImplTest.java @@ -75,7 +75,7 @@ public class ClusterImplTest { @Test public void testAddSessionAttributes() throws Exception { -Map attributes = new HashMap (); +Map attributes = new HashMap<>(); attributes.put("foo", "bar"); AmbariSessionManager sessionManager = createMock(AmbariSessionManager.class); @@ -101,14 +101,14 @@ public class ClusterImplTest { @Test public void testSetSessionAttribute()
[10/55] [abbrv] ambari git commit: AMBARI-19149. Code cleanup: redundant type arguments
http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintResourceProviderTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintResourceProviderTest.java index a386e7f..8ec8603 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintResourceProviderTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintResourceProviderTest.java @@ -128,7 +128,7 @@ public class BlueprintResourceProviderTest { } private Map>> getSettingProperties() { -return new HashMap >>(); +return new HashMap<>(); } @Before @@ -191,7 +191,7 @@ public class BlueprintResourceProviderTest { Request request = createMock(Request.class); Set > setProperties = getBlueprintTestProperties(); -Map requestInfoProperties = new HashMap (); +Map requestInfoProperties = new HashMap<>(); requestInfoProperties.put(Request.REQUEST_INFO_BODY_PROPERTY, null); // set expectations @@ -440,7 +440,7 @@ public class BlueprintResourceProviderTest { BlueprintEntity entity = createEntity(getBlueprintTestProperties().iterator().next()); -List results = new ArrayList(); +List results = new ArrayList<>(); results.add(entity); // set expectations @@ -468,7 +468,7 @@ public class BlueprintResourceProviderTest { setConfigurationProperties(testProperties); BlueprintEntity entity = createEntity(testProperties.iterator().next()); -List results = new ArrayList(); +List results = new ArrayList<>(); results.add(entity); // set expectations @@ -495,8 +495,8 @@ public class BlueprintResourceProviderTest { expectLastCall(); replay(dao); -Predicate predicate = new EqualsPredicate( -BlueprintResourceProvider.BLUEPRINT_NAME_PROPERTY_ID, BLUEPRINT_NAME); +Predicate predicate = new EqualsPredicate<>( + BlueprintResourceProvider.BLUEPRINT_NAME_PROPERTY_ID, BLUEPRINT_NAME); AbstractResourceProviderTest.TestObserver observer = new AbstractResourceProviderTest.TestObserver(); provider.addObserver(observer); @@ -518,7 +518,7 @@ public class BlueprintResourceProviderTest { Set > setProperties = getBlueprintTestProperties(); setConfigurationProperties(setProperties); AmbariManagementController managementController = createMock(AmbariManagementController.class); -Map requestInfoProperties = new HashMap (); +Map requestInfoProperties = new HashMap<>(); Map >> settingProperties = getSettingProperties(); requestInfoProperties.put(Request.REQUEST_INFO_BODY_PROPERTY, "{\"configurations\":[]}"); Request request = createMock(Request.class); @@ -567,7 +567,7 @@ public class BlueprintResourceProviderTest { Set > setProperties = getBlueprintTestProperties(); setConfigurationProperties(setProperties); AmbariManagementController managementController = createMock(AmbariManagementController.class); -Map requestInfoProperties = new HashMap (); +Map requestInfoProperties = new HashMap<>(); Map >> settingProperties = getSettingProperties(); requestInfoProperties.put(Request.REQUEST_INFO_BODY_PROPERTY, "{\"configurations\":[{\"configuration-type\":{\"properties\":{\"property\":\"value\"}}}]}"); Request request = createMock(Request.class); @@ -618,7 +618,7 @@ public class BlueprintResourceProviderTest { Set > setProperties = getBlueprintTestProperties(); -Map requestInfoProperties = new HashMap (); +Map requestInfoProperties = new HashMap<>(); String configurationData = "{\"configurations\":[{\"config-type1\":{\"properties\" :{\"property\":\"property-value\"}}," + "\"config-type2\" : {\"properties_attributes\" : {\"property\" : \"property-value\"}, \"properties\" : {\"property\" : \"property-value\"}}}" + "]}"; @@ -649,7 +649,7 @@ public class BlueprintResourceProviderTest { Set > setProperties = getBlueprintTestProperties(); -Map requestInfoProperties = new HashMap (); +Map requestInfoProperties = new HashMap<>(); String configurationData = "{\"configurations\":[\"config-type1\", \"config-type2\"]}";
[28/55] [abbrv] ambari git commit: AMBARI-19149. Code cleanup: redundant type arguments
http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java index 5204322..6687942 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java @@ -297,8 +297,8 @@ public class KerberosHelperImpl implements KerberosHelper { public void configureServices(Cluster cluster, MapserviceFilter) throws AmbariException, KerberosInvalidConfigurationException { Map > existingConfigurations = calculateExistingConfigurations(cluster, null); -Map installedServices = new HashMap (); -Set previouslyExistingServices = new HashSet(); +Map installedServices = new HashMap<>(); +Set previouslyExistingServices = new HashSet<>(); // Calculate the map of installed services to installed components Map clusterServices = cluster.getServices(); @@ -306,7 +306,7 @@ public class KerberosHelperImpl implements KerberosHelper { for (Service clusterService : clusterServices.values()) { Set installedComponents = installedServices.get(clusterService.getName()); if (installedComponents == null) { - installedComponents = new HashSet(); + installedComponents = new HashSet<>(); installedServices.put(clusterService.getName(), installedComponents); } @@ -351,7 +351,7 @@ public class KerberosHelperImpl implements KerberosHelper { boolean applyStackAdvisorUpdates) throws KerberosInvalidConfigurationException, AmbariException { -Map > kerberosConfigurations = new HashMap >(); +Map > kerberosConfigurations = new HashMap<>(); KerberosDetails kerberosDetails = getKerberosDetails(cluster, null); KerberosDescriptor kerberosDescriptor = getKerberosDescriptor(cluster); @@ -359,17 +359,17 @@ public class KerberosHelperImpl implements KerberosHelper { Map > configurations = addAdditionalConfigurations(cluster, deepCopy(existingConfigurations), null, kerberosDescriptorProperties); -Map propertiesToIgnore = new HashMap (); +Map propertiesToIgnore = new HashMap<>(); // If Ambari is managing it own identities then add AMBARI to the set of installed servcie so // that its Kerberos descriptor entries will be included. if (createAmbariIdentities(existingConfigurations.get("kerberos-env"))) { - installedServices = new HashMap (installedServices); + installedServices = new HashMap<>(installedServices); installedServices.put("AMBARI", Collections.singleton("AMBARI_SERVER")); } // Create the context to use for filtering Kerberos Identities based on the state of the cluster -Map filterContext = new HashMap (); +Map filterContext = new HashMap<>(); filterContext.put("configurations", configurations); filterContext.put("services", installedServices.keySet()); @@ -428,7 +428,7 @@ public class KerberosHelperImpl implements KerberosHelper { StackId stackVersion = cluster.getCurrentStackVersion(); -List hostNames = new ArrayList(); +List hostNames = new ArrayList<>(); Collection hosts = cluster.getHosts(); if (hosts != null) { @@ -442,10 +442,10 @@ public class KerberosHelperImpl implements KerberosHelper { // This could happen when enabling Kerberos while installing a cluster via Blueprints due to the // way hosts are discovered during the install process. if (!hostNames.isEmpty()) { - Map >> requestConfigurations = new HashMap >>(); + Map >> requestConfigurations = new HashMap<>(); if (existingConfigurations != null) { for (Map.Entry > configuration : existingConfigurations.entrySet()) { - Map > properties = new HashMap >(); + Map > properties = new HashMap<>(); String configType = configuration.getKey(); Map configurationProperties = configuration.getValue(); @@ -454,7 +454,7 @@ public class KerberosHelperImpl implements
[12/55] [abbrv] ambari git commit: AMBARI-19149. Code cleanup: redundant type arguments
http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AbstractJDBCResourceProviderTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AbstractJDBCResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AbstractJDBCResourceProviderTest.java index 466b998..f546aab 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AbstractJDBCResourceProviderTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AbstractJDBCResourceProviderTest.java @@ -51,7 +51,7 @@ public class AbstractJDBCResourceProviderTest { @Test public void test() throws SQLException { -Set requestedIds = new TreeSet(); +Set requestedIds = new TreeSet<>(); requestedIds.add(property1); requestedIds.add("none1"); requestedIds.add(property2); @@ -129,7 +129,7 @@ public class AbstractJDBCResourceProviderTest { @Override protected MapgetDBFieldMap() { - Map fields = new HashMap (); + Map fields = new HashMap<>(); fields.put(property1, TestFields.field1); fields.put(property2, TestFields.field2); return fields; http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AbstractResourceProviderTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AbstractResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AbstractResourceProviderTest.java index ed16d68..c761323 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AbstractResourceProviderTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AbstractResourceProviderTest.java @@ -66,7 +66,7 @@ public class AbstractResourceProviderTest { @Test public void testCheckPropertyIds() { -Set propertyIds = new HashSet(); +Set propertyIds = new HashSet<>(); propertyIds.add("foo"); propertyIds.add("cat1/foo"); propertyIds.add("cat2/bar"); @@ -75,7 +75,7 @@ public class AbstractResourceProviderTest { propertyIds.add("cat4/sub2/sub3/bat"); propertyIds.add("cat5/subcat5/map"); -Map keyPropertyIds = new HashMap (); +Map keyPropertyIds = new HashMap<>(); AmbariManagementController managementController = createMock(AmbariManagementController.class); MaintenanceStateHelper maintenanceStateHelper = createNiceMock(MaintenanceStateHelper.class); @@ -105,7 +105,7 @@ public class AbstractResourceProviderTest { @Test public void testGetPropertyIds() { -Set propertyIds = new HashSet(); +Set propertyIds = new HashSet<>(); propertyIds.add("p1"); propertyIds.add("foo"); propertyIds.add("cat1/foo"); @@ -114,7 +114,7 @@ public class AbstractResourceProviderTest { propertyIds.add("cat3/sub1/bam"); propertyIds.add("cat4/sub2/sub3/bat"); -Map keyPropertyIds = new HashMap (); +Map keyPropertyIds = new HashMap<>(); AmbariManagementController managementController = createMock(AmbariManagementController.class); MaintenanceStateHelper maintenanceStateHelper = createNiceMock(MaintenanceStateHelper.class); @@ -131,8 +131,8 @@ public class AbstractResourceProviderTest { @Test public void testGetRequestStatus() { -Set propertyIds = new HashSet(); -Map keyPropertyIds = new HashMap (); +Set propertyIds = new HashSet<>(); +Map keyPropertyIds = new HashMap<>(); AmbariManagementController managementController = createMock(AmbariManagementController.class); MaintenanceStateHelper maintenanceStateHelper = createNiceMock(MaintenanceStateHelper.class); replay(maintenanceStateHelper); @@ -177,7 +177,7 @@ public class AbstractResourceProviderTest { public void testGetPropertyMaps() throws Exception { AbstractResourceProvider provider = new TestResourceProvider(); -Map updatePropertyMap = new HashMap (); +Map updatePropertyMap = new HashMap<>(); updatePropertyMap.put("SomeProperty", "SomeUpdateValue"); updatePropertyMap.put("SomeOtherProperty", 99); @@ -797,26 +797,26 @@ public class AbstractResourceProviderTest { private static Resource.Type testResourceType = new Resource.Type("testResource"); private static Set pkPropertyIds = - new
[08/55] [abbrv] ambari git commit: AMBARI-19149. Code cleanup: redundant type arguments
http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/JobResourceProviderTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/JobResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/JobResourceProviderTest.java index 3e1c4c5..6fd1a23 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/JobResourceProviderTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/JobResourceProviderTest.java @@ -52,7 +52,7 @@ public class JobResourceProviderTest { public void testGetResources() throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException { -Set expected = new HashSet(); +Set expected = new HashSet<>(); expected.add(createJobResponse("Cluster100", "workflow1", "job1")); expected.add(createJobResponse("Cluster100", "workflow2", "job2")); expected.add(createJobResponse("Cluster100", "workflow2", "job3")); @@ -77,7 +77,7 @@ public class JobResourceProviderTest { Set resources = provider.getResources(request, predicate); Assert.assertEquals(3, resources.size()); -Set names = new HashSet(); +Set names = new HashSet<>(); for (Resource resource : resources) { String clusterName = (String) resource .getPropertyValue(JobResourceProvider.JOB_CLUSTER_NAME_PROPERTY_ID); @@ -98,7 +98,7 @@ public class JobResourceProviderTest { public void testJobFetcher1() throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException { -Set requestedIds = new HashSet(); +Set requestedIds = new HashSet<>(); requestedIds.add(JobResourceProvider.JOB_ID_PROPERTY_ID); MapkeyPropertyIds = PropertyHelper @@ -124,7 +124,7 @@ public class JobResourceProviderTest { public void testJobFetcher2() throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException { -Set requestedIds = new HashSet(); +Set requestedIds = new HashSet<>(); requestedIds.add(JobResourceProvider.JOB_ID_PROPERTY_ID); requestedIds.add(JobResourceProvider.JOB_SUBMIT_TIME_PROPERTY_ID); @@ -153,7 +153,7 @@ public class JobResourceProviderTest { public void testJobFetcher3() throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException { -Set requestedIds = new HashSet(); +Set requestedIds = new HashSet<>(); requestedIds.add(JobResourceProvider.JOB_ID_PROPERTY_ID); requestedIds.add(JobResourceProvider.JOB_ELAPSED_TIME_PROPERTY_ID); @@ -182,7 +182,7 @@ public class JobResourceProviderTest { public void testJobFetcher4() throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException { -Set requestedIds = new HashSet(); +Set requestedIds = new HashSet<>(); requestedIds.add(JobResourceProvider.JOB_ID_PROPERTY_ID); requestedIds.add(JobResourceProvider.JOB_SUBMIT_TIME_PROPERTY_ID); requestedIds.add(JobResourceProvider.JOB_ELAPSED_TIME_PROPERTY_ID); http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/LdapSyncEventResourceProviderTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/LdapSyncEventResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/LdapSyncEventResourceProviderTest.java index 7660c2a..5229d3d 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/LdapSyncEventResourceProviderTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/LdapSyncEventResourceProviderTest.java @@ -53,10 +53,10 @@ public class LdapSyncEventResourceProviderTest { LdapSyncEventResourceProvider provider = new TestLdapSyncEventResourceProvider(amc); -Set > properties = new HashSet >(); -Map propertyMap = new HashMap (); +Set > properties = new HashSet<>(); +Map propertyMap = new HashMap<>(); -Set > specs = new HashSet >(); +Set > specs = new HashSet<>(); propertyMap.put(LdapSyncEventResourceProvider.EVENT_SPECS_PROPERTY_ID, specs); properties.add(propertyMap); @@ -73,10 +73,10 @@ public class LdapSyncEventResourceProviderTest { LdapSyncEventResourceProvider provider = new
[04/55] [abbrv] ambari git commit: AMBARI-19149. Code cleanup: redundant type arguments
http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/ADKerberosOperationHandlerTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/ADKerberosOperationHandlerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/ADKerberosOperationHandlerTest.java index ea8b1b0..603f744 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/ADKerberosOperationHandlerTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/ADKerberosOperationHandlerTest.java @@ -465,7 +465,7 @@ public class ADKerberosOperationHandlerTest extends KerberosOperationHandlerTest @Test public void testDigests() throws Exception { PrincipalKeyCredential kc = new PrincipalKeyCredential(DEFAULT_ADMIN_PRINCIPAL, DEFAULT_ADMIN_PASSWORD); -MapkerberosEnvMap = new HashMap (); +Map kerberosEnvMap = new HashMap<>(); kerberosEnvMap.put(ADKerberosOperationHandler.KERBEROS_ENV_LDAP_URL, DEFAULT_LDAP_URL); kerberosEnvMap.put(ADKerberosOperationHandler.KERBEROS_ENV_PRINCIPAL_CONTAINER_DN, DEFAULT_PRINCIPAL_CONTAINER_DN); kerberosEnvMap.put(ADKerberosOperationHandler.KERBEROS_ENV_AD_CREATE_ATTRIBUTES_TEMPLATE, "" + @@ -560,7 +560,7 @@ public class ADKerberosOperationHandlerTest extends KerberosOperationHandlerTest } PrincipalKeyCredential credentials = new PrincipalKeyCredential(principal, password); -Map kerberosEnvMap = new HashMap (); +Map kerberosEnvMap = new HashMap<>(); kerberosEnvMap.put(ADKerberosOperationHandler.KERBEROS_ENV_LDAP_URL, ldapUrl); kerberosEnvMap.put(ADKerberosOperationHandler.KERBEROS_ENV_PRINCIPAL_CONTAINER_DN, containerDN); http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/FinalizeKerberosServerActionTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/FinalizeKerberosServerActionTest.java b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/FinalizeKerberosServerActionTest.java index 9404480..8d6ecc3 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/FinalizeKerberosServerActionTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/FinalizeKerberosServerActionTest.java @@ -82,7 +82,7 @@ public class FinalizeKerberosServerActionTest extends EasyMockSupport { replayAll(); -ConcurrentMap requestSharedDataContext = new ConcurrentHashMap (); +ConcurrentMap requestSharedDataContext = new ConcurrentHashMap<>(); FinalizeKerberosServerAction action = injector.getInstance(FinalizeKerberosServerAction.class); action.setExecutionCommand(executionCommand); @@ -113,7 +113,7 @@ public class FinalizeKerberosServerActionTest extends EasyMockSupport { replayAll(); -ConcurrentMap requestSharedDataContext = new ConcurrentHashMap (); +ConcurrentMap requestSharedDataContext = new ConcurrentHashMap<>(); FinalizeKerberosServerAction action = injector.getInstance(FinalizeKerberosServerAction.class); action.setExecutionCommand(executionCommand); http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/KerberosOperationHandlerTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/KerberosOperationHandlerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/KerberosOperationHandlerTest.java index 3f9ee42..68f6f6d 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/KerberosOperationHandlerTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/KerberosOperationHandlerTest.java @@ -84,7 +84,7 @@ public abstract class KerberosOperationHandlerTest extends EasyMockSupport { File file = folder.newFile(); final String principal1 = "princip...@realm.com"; final String principal2 = "princip...@realm.com"; -Set seenEntries = new HashSet(); +Set seenEntries = new HashSet<>(); Assert.assertTrue(handler.createKeytabFile(principal1, "some password", 0, file)); Assert.assertTrue(handler.createKeytabFile(principal2, "some password", 0, file));
[29/55] [abbrv] ambari git commit: AMBARI-19149. Code cleanup: redundant type arguments
http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/api/services/ValidationService.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ValidationService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ValidationService.java index 87cb6ac..b5b4a42 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ValidationService.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ValidationService.java @@ -60,7 +60,7 @@ public class ValidationService extends BaseService { } ResourceInstance createValidationResource(String stackName, String stackVersion) { -MapmapIds = new HashMap (); +Map mapIds = new HashMap<>(); mapIds.put(Resource.Type.Stack, stackName); mapIds.put(Resource.Type.StackVersion, stackVersion); http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/api/services/VersionDefinitionService.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/VersionDefinitionService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/VersionDefinitionService.java index 6410bd8..af1eb07 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/VersionDefinitionService.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/VersionDefinitionService.java @@ -70,7 +70,7 @@ public class VersionDefinitionService extends BaseService { */ @Path("{versionNumber}/operating_systems") public OperatingSystemService getOperatingSystemsHandler(@PathParam("versionNumber") String versionNumber) { -final Map mapIds = new HashMap (); +final Map mapIds = new HashMap<>(); mapIds.put(Resource.Type.VersionDefinition, versionNumber); return new OperatingSystemService(mapIds); } http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/api/services/ViewExternalSubResourceService.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ViewExternalSubResourceService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ViewExternalSubResourceService.java index 66ccae7..515d4ac 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ViewExternalSubResourceService.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ViewExternalSubResourceService.java @@ -64,7 +64,7 @@ public class ViewExternalSubResourceService extends BaseService { /** * Mapping of resource names to services. */ - private final Map resourceServiceMap = new HashMap (); + private final Map resourceServiceMap = new HashMap<>(); // - Constructors -- @@ -137,7 +137,7 @@ public class ViewExternalSubResourceService extends BaseService { * @return a view instance resource */ private ResourceInstance createResource(String viewName, String instanceName) { -Map mapIds = new HashMap (); +Map mapIds = new HashMap<>(); mapIds.put(Resource.Type.View, viewName); mapIds.put(Resource.Type.ViewVersion, version); mapIds.put(Resource.Type.ViewInstance, instanceName); http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/api/services/ViewInstanceService.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ViewInstanceService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ViewInstanceService.java index 53d4918..b10738d 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ViewInstanceService.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ViewInstanceService.java @@ -257,7 +257,7 @@ public class ViewInstanceService extends BaseService { * @return a view instance resource */ private ResourceInstance createResource(String viewName, String viewVersion, String instanceName) { -Map mapIds = new HashMap (); +Map mapIds = new HashMap<>(); mapIds.put(Resource.Type.View, viewName); mapIds.put(Resource.Type.ViewVersion, viewVersion);
[22/55] [abbrv] ambari git commit: AMBARI-19149. Code cleanup: redundant type arguments
http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/GroupDAO.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/GroupDAO.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/GroupDAO.java index 8b5902c..638a442 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/GroupDAO.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/GroupDAO.java @@ -117,7 +117,7 @@ public class GroupDAO { @Transactional public void create(GroupEntity group) { -create(new HashSet(Arrays.asList(group))); +create(new HashSet<>(Arrays.asList(group))); } @Transactional http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostConfigMappingDAO.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostConfigMappingDAO.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostConfigMappingDAO.java index 0b6c14a..410f5cf 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostConfigMappingDAO.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostConfigMappingDAO.java @@ -68,7 +68,7 @@ public class HostConfigMappingDAO { if (!cacheLoaded) { if (hostConfigMappingByHost == null) { -hostConfigMappingByHost = new ConcurrentHashMap(); +hostConfigMappingByHost = new ConcurrentHashMap<>(); TypedQuery query = entityManagerProvider.get().createNamedQuery( "HostConfigMappingEntity.findAll", HostConfigMappingEntity.class); @@ -86,7 +86,7 @@ public class HostConfigMappingDAO { if (hostConfigMappingByHost.containsKey(hostId)) { setByHost = hostConfigMappingByHost.get(hostId); } else { -setByHost = new HashSet(); +setByHost = new HashSet<>(); hostConfigMappingByHost.put(hostId, setByHost); } @@ -115,7 +115,7 @@ public class HostConfigMappingDAO { if (hostConfigMappingByHost.containsKey(hostId)) { set = hostConfigMappingByHost.get(hostId); } else { -set = new HashSet(); +set = new HashSet<>(); hostConfigMappingByHost.put(hostId, set); } @@ -133,7 +133,7 @@ public class HostConfigMappingDAO { if (hostConfigMappingByHost.containsKey(hostId)) { set = hostConfigMappingByHost.get(hostId); } else { -set = new HashSet(); +set = new HashSet<>(); hostConfigMappingByHost.put(hostId, set); } @@ -154,7 +154,7 @@ public class HostConfigMappingDAO { if (!hostConfigMappingByHost.containsKey(hostId)) return Collections.emptySet(); -Set set = new HashSet(hostConfigMappingByHost.get(hostId)); +Set set = new HashSet<>(hostConfigMappingByHost.get(hostId)); CollectionUtils.filter(set, new Predicate() { @@ -176,7 +176,7 @@ public class HostConfigMappingDAO { if (!hostConfigMappingByHost.containsKey(hostId)) return null; -Set set = new HashSet(hostConfigMappingByHost.get(hostId)); +Set set = new HashSet<>(hostConfigMappingByHost.get(hostId)); HostConfigMapping result = (HostConfigMapping) CollectionUtils.find(set, new Predicate() { @@ -198,7 +198,7 @@ public class HostConfigMappingDAO { if (!hostConfigMappingByHost.containsKey(hostId)) return Collections.emptySet(); -Set set = new HashSet(hostConfigMappingByHost.get(hostId)); +Set set = new HashSet<>(hostConfigMappingByHost.get(hostId)); CollectionUtils.filter(set, new Predicate() { @@ -220,13 +220,13 @@ public class HostConfigMappingDAO { return Collections.emptySet(); } -HashSet result = new HashSet(); +HashSet result = new HashSet<>(); for (final Long hostId : hostIds) { if (!hostConfigMappingByHost.containsKey(hostId)) continue; - Set set = new HashSet(hostConfigMappingByHost.get(hostId)); + Set set = new HashSet<>(hostConfigMappingByHost.get(hostId)); CollectionUtils.filter(set, new Predicate() { @@ -249,7 +249,7 @@ public class HostConfigMappingDAO { Collection types) { populateCache(); -Map mappingsByType = new HashMap (); +Map mappingsByType = new HashMap<>(); for (String type : types) { if (!mappingsByType.containsKey(type)) { @@ -258,7 +258,7 @@ public class HostConfigMappingDAO { } if (!types.isEmpty()) { - List mappings = new ArrayList(); + List mappings = new
[31/55] [abbrv] ambari git commit: AMBARI-19149. Code cleanup: redundant type arguments
http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartbeatMonitor.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartbeatMonitor.java b/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartbeatMonitor.java index 0042f53..a77ed75 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartbeatMonitor.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartbeatMonitor.java @@ -210,7 +210,7 @@ public class HeartbeatMonitor implements Runnable { * @return list of commands to get status of service components on a concrete host */ public List generateStatusCommands(String hostname) throws AmbariException { -List cmds = new ArrayList(); +List cmds = new ArrayList<>(); for (Cluster cl : clusters.getClustersForHost(hostname)) { MapdesiredConfigs = cl.getDesiredConfigs(); @@ -249,8 +249,8 @@ public class HeartbeatMonitor implements Runnable { StackInfo stackInfo = ambariMetaInfo.getStack(stackId.getStackName(), stackId.getStackVersion()); -Map > configurations = new TreeMap >(); -Map >> configurationAttributes = new TreeMap >>(); +Map > configurations = new TreeMap<>(); +Map >> configurationAttributes = new TreeMap<>(); // get the cluster config for type '*-env' // apply config group overrides http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartbeatProcessor.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartbeatProcessor.java b/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartbeatProcessor.java index 4fbc161..8cd2804 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartbeatProcessor.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartbeatProcessor.java @@ -357,7 +357,7 @@ public class HeartbeatProcessor extends AbstractService{ List reports = heartbeat.getReports(); // Cache HostRoleCommand entities because we will need them few times -List taskIds = new ArrayList(); +List taskIds = new ArrayList<>(); for (CommandReport report : reports) { taskIds.add(report.getTaskId()); } http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/agent/HostInfo.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/agent/HostInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/agent/HostInfo.java index 988e78b..d1e5dbc 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/agent/HostInfo.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/agent/HostInfo.java @@ -45,7 +45,7 @@ public class HostInfo { private String macaddress; private long memoryfree; private long memorysize; - private List mounts = new ArrayList(); + private List mounts = new ArrayList<>(); private long memorytotal; private String netmask; private String operatingsystem; http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/agent/RecoveryReport.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/agent/RecoveryReport.java b/ambari-server/src/main/java/org/apache/ambari/server/agent/RecoveryReport.java index 40b2260..47af7c1 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/agent/RecoveryReport.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/agent/RecoveryReport.java @@ -30,7 +30,7 @@ public class RecoveryReport { * One of DISABLED, RECOVERABLE, UNRECOVERABLE, PARTIALLY_RECOVERABLE */ private String summary = "DISABLED"; - private List componentReports = new ArrayList(); + private List componentReports = new ArrayList<>(); @JsonProperty("summary") http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/agent/RegistrationResponse.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/agent/RegistrationResponse.java b/ambari-server/src/main/java/org/apache/ambari/server/agent/RegistrationResponse.java index c12ed82..8efefde 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/agent/RegistrationResponse.java +++
[16/55] [abbrv] ambari git commit: AMBARI-19149. Code cleanup: redundant type arguments
http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/InOperatorTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/InOperatorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/InOperatorTest.java index 256fecb..414d2c9 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/InOperatorTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/InOperatorTest.java @@ -40,9 +40,9 @@ public class InOperatorTest { public void testToPredicate() throws Exception { String prop = "prop"; String val = "one,2,three"; -EqualsPredicate p1 = new EqualsPredicate(prop, "one"); -EqualsPredicate p2 = new EqualsPredicate(prop, "2"); -EqualsPredicate p3 = new EqualsPredicate(prop, "three"); +EqualsPredicate p1 = new EqualsPredicate<>(prop, "one"); +EqualsPredicate p2 = new EqualsPredicate<>(prop, "2"); +EqualsPredicate p3 = new EqualsPredicate<>(prop, "three"); OrPredicate orPredicate = new OrPredicate(p1, p2, p3); assertEquals(orPredicate, new InOperator().toPredicate(prop, val)); http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/LessEqualsOperatorTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/LessEqualsOperatorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/LessEqualsOperatorTest.java index 6e017b9..1702e33 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/LessEqualsOperatorTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/LessEqualsOperatorTest.java @@ -38,7 +38,7 @@ public class LessEqualsOperatorTest { @Test public void testToPredicate() { -assertEquals(new LessEqualsPredicate("1", "2"), +assertEquals(new LessEqualsPredicate<>("1", "2"), new LessEqualsOperator().toPredicate("1", "2")); } http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/LessOperatorTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/LessOperatorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/LessOperatorTest.java index 5311ea7..0f14055 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/LessOperatorTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/LessOperatorTest.java @@ -38,7 +38,7 @@ public class LessOperatorTest { @Test public void testToPredicate() { -assertEquals(new LessPredicate("1", "2"), +assertEquals(new LessPredicate<>("1", "2"), new LessOperator().toPredicate("1", "2")); } http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/NotEqualsOperatorTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/NotEqualsOperatorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/NotEqualsOperatorTest.java index d8e1f6a..4a28203 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/NotEqualsOperatorTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/NotEqualsOperatorTest.java @@ -39,7 +39,7 @@ public class NotEqualsOperatorTest { @Test public void testToPredicate() { -assertEquals(new NotPredicate(new EqualsPredicate("prop", "val")), +assertEquals(new NotPredicate(new EqualsPredicate<>("prop", "val")), new NotEqualsOperator().toPredicate("prop", "val")); } http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/NotOperatorTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/NotOperatorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/NotOperatorTest.java index c23bc3a..ce7c256 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/NotOperatorTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/NotOperatorTest.java @@ -39,7
[37/55] [abbrv] ambari git commit: AMBARI-20622. yarn resource manager failed to start after upgrade with unable to construct queue exception (ncole)
AMBARI-20622. yarn resource manager failed to start after upgrade with unable to construct queue exception (ncole) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/5b71200e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/5b71200e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/5b71200e Branch: refs/heads/branch-3.0-perf Commit: 5b71200e23caad1fbe6b1ec093fa347b9d47e08a Parents: 179b356 Author: Nate ColeAuthored: Wed Mar 29 18:19:20 2017 -0400 Committer: Andrew Onishuk Committed: Fri Mar 31 10:21:45 2017 +0300 -- .../FixCapacitySchedulerOrderingPolicy.java | 118 + .../HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml | 6 + .../stacks/HDP/2.3/upgrades/upgrade-2.6.xml | 5 + .../HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml | 8 +- .../stacks/HDP/2.4/upgrades/upgrade-2.6.xml | 5 + .../HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml | 6 + .../stacks/HDP/2.5/upgrades/upgrade-2.6.xml | 5 + .../FixCapacitySchedulerOrderingPolicyTest.java | 127 +++ 8 files changed, 279 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/5b71200e/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FixCapacitySchedulerOrderingPolicy.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FixCapacitySchedulerOrderingPolicy.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FixCapacitySchedulerOrderingPolicy.java new file mode 100644 index 000..fbb88d8 --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FixCapacitySchedulerOrderingPolicy.java @@ -0,0 +1,118 @@ +/** + * 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.server.serveraction.upgrades; + +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentMap; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.apache.ambari.server.AmbariException; +import org.apache.ambari.server.actionmanager.HostRoleStatus; +import org.apache.ambari.server.agent.CommandReport; +import org.apache.ambari.server.serveraction.AbstractServerAction; +import org.apache.ambari.server.state.Cluster; +import org.apache.ambari.server.state.Clusters; +import org.apache.ambari.server.state.Config; + +import com.google.inject.Inject; + +/** + * In HDP-2.6, the parent queue's cannot have a ordering-policy other than {@code utilization} or + * {@code priority-utilization}. + * + * This class is used when moving from HDP-2.3/HDP-2.4/HDP-2.5 to HDP2.6 + */ +public class FixCapacitySchedulerOrderingPolicy extends AbstractServerAction { + private static final String SOURCE_CONFIG_TYPE = "capacity-scheduler"; + private static final String ORDERING_POLICY_SUFFIX = "ordering-policy"; + + private static final String CAPACITY_SCHEDULER_PREFIX = "yarn.scheduler.capacity"; + private static final String UTILIZATION = "utilization"; + private static final String PRIORITY_UTILIZATION = "priority-utilization"; + + + // queue names with any letter, ., -, or _ + private static final Pattern ROOT_QUEUE_REGEX = Pattern.compile( + String.format("%s.([.\\-_\\w]+).queues", CAPACITY_SCHEDULER_PREFIX)); + + + @Inject + private Clusters clusters; + + @Override + public CommandReport execute(ConcurrentMap requestSharedDataContext) + throws AmbariException, InterruptedException { + + +String clusterName = getExecutionCommand().getClusterName(); +Cluster cluster = clusters.getCluster(clusterName); +Config config = cluster.getDesiredConfigByType(SOURCE_CONFIG_TYPE); + +Map properties = config.getProperties(); + +Set parentQueueNames = new HashSet<>(); + +// first find the parent queue names +for (String key : properties.keySet())
[13/55] [abbrv] ambari git commit: AMBARI-19149. Code cleanup: redundant type arguments
http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java index bf6c41a..483880a 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java @@ -296,7 +296,7 @@ public class AmbariManagementControllerTest { private void setOsFamily(Host host, String osFamily, String osVersion) { -MaphostAttributes = new HashMap (); +Map hostAttributes = new HashMap<>(); hostAttributes.put("os_family", osFamily); hostAttributes.put("os_release_version", osVersion); @@ -341,7 +341,7 @@ public class AmbariManagementControllerTest { dStateStr = desiredState.toString(); } ServiceRequest r1 = new ServiceRequest(clusterName, serviceName, dStateStr); -Set requests = new HashSet(); +Set requests = new HashSet<>(); requests.add(r1); ServiceResourceProviderTest.createServices(controller, requests); @@ -357,7 +357,7 @@ public class AmbariManagementControllerTest { ServiceComponentRequest r = new ServiceComponentRequest(clusterName, serviceName, componentName, dStateStr); Set requests = -new HashSet(); + new HashSet<>(); requests.add(r); ComponentResourceProviderTest.createComponents(controller, requests); } @@ -372,7 +372,7 @@ public class AmbariManagementControllerTest { ServiceComponentHostRequest r = new ServiceComponentHostRequest(clusterName, serviceName, componentName, hostname, dStateStr); Set requests = -new HashSet(); + new HashSet<>(); requests.add(r); controller.createHostComponents(requests); } @@ -387,7 +387,7 @@ public class AmbariManagementControllerTest { ServiceComponentHostRequest r = new ServiceComponentHostRequest(clusterName, serviceName, componentName, hostname, dStateStr); Set requests = -new HashSet(); + new HashSet<>(); requests.add(r); controller.deleteHostComponents(requests); } @@ -396,8 +396,8 @@ public class AmbariManagementControllerTest { List hosts, List configs) throws AmbariException { -Map hostMap = new HashMap (); -Map configMap = new HashMap (); +Map hostMap = new HashMap<>(); +Map configMap = new HashMap<>(); for (String hostname : hosts) { Host host = clusters.getHost(hostname); @@ -421,9 +421,9 @@ public class AmbariManagementControllerTest { boolean runSmokeTests, boolean reconfigureClients) throws AmbariException, AuthorizationException { ServiceRequest r = new ServiceRequest(clusterName, serviceName, State.INSTALLED.toString()); -Set requests = new HashSet(); +Set requests = new HashSet<>(); requests.add(r); -Map mapRequestProps = new HashMap (); +Map mapRequestProps = new HashMap<>(); mapRequestProps.put("context", "Called from a test"); RequestStatusResponse resp = ServiceResourceProviderTest.updateServices(controller, requests, mapRequestProps, runSmokeTests, reconfigureClients); @@ -449,7 +449,7 @@ public class AmbariManagementControllerTest { Cluster c = clusters.getCluster(clusterName); Service s = c.getService(serviceName); Set requests = new - HashSet(); + HashSet<>(); for (ServiceComponent sc : s.getServiceComponents().values()) { for (ServiceComponentHost sch : sc.getServiceComponentHosts().values()) { ServiceComponentHostRequest schr = new ServiceComponentHostRequest @@ -458,7 +458,7 @@ public class AmbariManagementControllerTest { requests.add(schr); } } -Map mapRequestProps = new HashMap (); +Map mapRequestProps = new HashMap<>(); mapRequestProps.put("context", "Called from a test"); RequestStatusResponse resp = HostComponentResourceProviderTest.updateHostComponents(controller, injector, requests, mapRequestProps, false); @@ -487,9 +487,9 @@ public class AmbariManagementControllerTest { AmbariException, AuthorizationException { ServiceRequest r = new ServiceRequest(clusterName, serviceName, State.STARTED.toString()); -Set requests = new HashSet(); +Set requests = new HashSet<>(); requests.add(r); -Map mapRequestProps =
[46/55] [abbrv] ambari git commit: AMBARI-20603. Hadoop QA compiles trunk twice
AMBARI-20603. Hadoop QA compiles trunk twice Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/623c12cd Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/623c12cd Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/623c12cd Branch: refs/heads/branch-3.0-perf Commit: 623c12cd56c3794adc0b5873ecc5e5406b07d73a Parents: 47a9421 Author: Attila DoroszlaiAuthored: Mon Mar 27 10:12:38 2017 +0200 Committer: Andrew Onishuk Committed: Fri Mar 31 10:21:45 2017 +0300 -- dev-support/test-patch.sh | 76 +++--- 1 file changed, 12 insertions(+), 64 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/623c12cd/dev-support/test-patch.sh -- diff --git a/dev-support/test-patch.sh b/dev-support/test-patch.sh index 222a79a..661f871 100755 --- a/dev-support/test-patch.sh +++ b/dev-support/test-patch.sh @@ -51,7 +51,7 @@ printUsage() { echo echo "Where:" echo " patch-file is a local patch file containing the changes to test" - echo " defect-number is a JIRA defect number (e.g. 'HADOOP-1234') to test (Jenkins only)" + echo " defect-number is a JIRA defect number (e.g. 'AMBARI-1234') to test (Jenkins only)" echo echo "Options:" echo "--patch-dir= The directory for working and output files (default '/tmp')" @@ -260,28 +260,14 @@ prebuildWithoutPatch () { echo "==" echo "" echo "" - if [[ ! -d hadoop-common-project ]]; then -cd $bindir/.. -echo "Compiling $(pwd)" -echo "$MVN clean test -DskipTests > $PATCH_DIR/trunkCompile.txt 2>&1" -$MVN clean test -DskipTests > $PATCH_DIR/trunkCompile.txt 2>&1 -if [[ $? != 0 ]] ; then - echo "Top-level trunk compilation is broken?" - JIRA_COMMENT="$JIRA_COMMENT - -{color:red}-1 patch{color}. Top-level trunk compilation may be broken." - return 1 -fi -cd - - fi echo "Compiling $(pwd)" - echo "$MVN clean test -DskipTests -D${PROJECT_NAME}PatchProcess > $PATCH_DIR/trunkJavacWarnings.txt 2>&1" - $MVN clean test -DskipTests -D${PROJECT_NAME}PatchProcess > $PATCH_DIR/trunkJavacWarnings.txt 2>&1 + echo "$MVN clean test -DskipTests -D${PROJECT_NAME}PatchProcess > $PATCH_DIR/trunkJavacWarnings.txt 2>&1" + $MVN clean test -DskipTests -D${PROJECT_NAME}PatchProcess > $PATCH_DIR/trunkJavacWarnings.txt 2>&1 if [[ $? != 0 ]] ; then -echo "Trunk compilation is broken?" +echo "Top-level trunk compilation is broken?" JIRA_COMMENT="$JIRA_COMMENT -{color:red}-1 patch{color}. Trunk compilation may be broken." +{color:red}-1 patch{color}. Top-level trunk compilation may be broken." return 1 fi @@ -643,41 +629,6 @@ runTests () { failed_tests="" modules=$(findModules) - # - # If we are building hadoop-hdfs-project, we must build the native component - # of hadoop-common-project first. In order to accomplish this, we move the - # hadoop-hdfs subprojects to the end of the list so that common will come - # first. - # - # Of course, we may not be building hadoop-common at all-- in this case, we - # explicitly insert a mvn compile -Pnative of common, to ensure that the - # native libraries show up where we need them. - # - building_common=0 - for module in $modules; do - if [[ $module == hadoop-hdfs-project* ]]; then - hdfs_modules="$hdfs_modules $module" - elif [[ $module == hadoop-common-project* ]]; then - ordered_modules="$ordered_modules $module" - building_common=1 - else - ordered_modules="$ordered_modules $module" - fi - done - if [ -n "$hdfs_modules" ]; then - ordered_modules="$ordered_modules $hdfs_modules" - if [[ $building_common -eq 0 ]]; then - echo " Building hadoop-common with -Pnative in order to provide \ -libhadoop.so to the hadoop-hdfs unit tests." - echo " $MVN compile -D${PROJECT_NAME}PatchProcess" - if ! $MVN compile -D${PROJECT_NAME}PatchProcess; then - JIRA_COMMENT="$JIRA_COMMENT -{color:red}-1 core tests{color}. Failed to build the native portion \ -of hadoop-common prior to running the unit tests in $ordered_modules" - return 1 - fi - fi - fi failed_test_builds="" test_timeouts="" @@ -692,7 +643,7 @@ of hadoop-common prior to running the unit tests in $ordered_modules" sed -i -e 's,^[ab]/,,' $TMP fi - for module in $ordered_modules; do + for module in $modules; do cd $module skip_surefiretests=1 module_suffix=`basename ${module}` @@ -842,8 +793,6 @@ runContribTests () { ### Kill any rogue build
[24/55] [abbrv] ambari git commit: AMBARI-19149. Code cleanup: redundant type arguments
http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackArtifactResourceProvider.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackArtifactResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackArtifactResourceProvider.java index e997cb3..63d6994 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackArtifactResourceProvider.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackArtifactResourceProvider.java @@ -111,18 +111,18 @@ public class StackArtifactResourceProvider extends AbstractControllerResourcePro /** * primary key fields */ - public static Set pkPropertyIds = new HashSet(); + public static Set pkPropertyIds = new HashSet<>(); /** * map of resource type to fk field */ public static MapkeyPropertyIds = - new HashMap (); +new HashMap<>(); /** * resource properties */ - public static Set propertyIds = new HashSet(); + public static Set propertyIds = new HashSet<>(); /** * name of the kerberos descriptor artifact. @@ -191,7 +191,7 @@ public class StackArtifactResourceProvider extends AbstractControllerResourcePro NoSuchResourceException, NoSuchParentResourceException { -Set resources = new HashSet(); +Set resources = new HashSet<>(); resources.addAll(getKerberosDescriptors(request, predicate)); resources.addAll(getMetricsDescriptors(request, predicate)); @@ -260,7 +260,7 @@ public class StackArtifactResourceProvider extends AbstractControllerResourcePro NoSuchParentResourceException, NoSuchResourceException { -Set resources = new HashSet(); +Set resources = new HashSet<>(); for (Map properties : getPropertyMaps(predicate)) { String artifactName = (String) properties.get(ARTIFACT_NAME_PROPERTY_ID); @@ -312,7 +312,7 @@ public class StackArtifactResourceProvider extends AbstractControllerResourcePro throws SystemException, UnsupportedPropertyException, NoSuchParentResourceException, NoSuchResourceException { -Set resources = new HashSet(); +Set resources = new HashSet<>(); for (Map properties : getPropertyMaps(predicate)) { String artifactName = (String) properties.get(ARTIFACT_NAME_PROPERTY_ID); @@ -348,7 +348,7 @@ public class StackArtifactResourceProvider extends AbstractControllerResourcePro Map > hostMetrics = PropertyHelper.getMetricPropertyIds(Resource.Type.Host); -descriptor = new HashMap (); +descriptor = new HashMap<>(); descriptor.put(Resource.Type.Cluster.name(), clusterMetrics); descriptor.put(Resource.Type.Host.name(), hostMetrics); } @@ -379,7 +379,7 @@ public class StackArtifactResourceProvider extends AbstractControllerResourcePro throws SystemException, UnsupportedPropertyException, NoSuchParentResourceException, NoSuchResourceException { -Set resources = new HashSet(); +Set resources = new HashSet<>(); for (Map properties : getPropertyMaps(predicate)) { String artifactName = (String) properties.get(ARTIFACT_NAME_PROPERTY_ID); @@ -581,7 +581,7 @@ public class StackArtifactResourceProvider extends AbstractControllerResourcePro * @throws IOException if unable to read or parse a descriptor file */ private Collection getServiceDescriptors(StackInfo stack) throws IOException { -Collection serviceDescriptors = new ArrayList(); +Collection serviceDescriptors = new ArrayList<>(); for (ServiceInfo service : stack.getServices()) { File descriptorFile = service.getKerberosDescriptorFile(); if (descriptorFile != null) { http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackConfigurationDependencyResourceProvider.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackConfigurationDependencyResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackConfigurationDependencyResourceProvider.java index 0712bf7..093aea4 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackConfigurationDependencyResourceProvider.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackConfigurationDependencyResourceProvider.java @@ -60,10 +60,10 @@ public class
[35/55] [abbrv] ambari git commit: AMBARI-20553 : Ambari script error for ams-hbase while writing to Amazon s3 on a cluster with no HDFS. (avijayan)
AMBARI-20553 : Ambari script error for ams-hbase while writing to Amazon s3 on a cluster with no HDFS. (avijayan) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/102dcde8 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/102dcde8 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/102dcde8 Branch: refs/heads/branch-3.0-perf Commit: 102dcde8cfc3b4b189b26a081bf922d9ad0ac34c Parents: 455870b Author: Aravindan VijayanAuthored: Wed Mar 29 14:13:42 2017 -0700 Committer: Andrew Onishuk Committed: Fri Mar 31 10:21:45 2017 +0300 -- .../conf/unix/ambari-metrics-collector | 3 ++- .../AMBARI_METRICS/0.1.0/configuration/ams-env.xml | 11 +++ .../AMBARI_METRICS/0.1.0/package/scripts/hbase.py| 11 ++- .../AMBARI_METRICS/0.1.0/package/scripts/params.py | 4 4 files changed, 27 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/102dcde8/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector -- diff --git a/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector b/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector index c106235..552be48 100644 --- a/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector +++ b/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector @@ -38,6 +38,7 @@ METRIC_COLLECTOR=ambari-metrics-collector NORMALIZER_ENABLED_STUB_FILE=/var/run/ambari-metrics-collector/normalizer_enabled FIFO_ENABLED_STUB_FILE=/var/run/ambari-metrics-collector/fifo_enabled +COLLECTOR_ADDITIONAL_CLASSPATH= STOP_TIMEOUT=5 @@ -256,7 +257,7 @@ function start() rm -f "${PIDFILE}" >/dev/null 2>&1 fi - nohup "${JAVA}" "-Xms$AMS_COLLECTOR_HEAPSIZE" "-Xmx$AMS_COLLECTOR_HEAPSIZE" ${AMS_COLLECTOR_OPTS} "-cp" "/usr/lib/ambari-metrics-collector/*:${COLLECTOR_CONF_DIR}" "-Djava.net.preferIPv4Stack=true" "-Dams.log.dir=${AMS_COLLECTOR_LOG_DIR}" "-Dproc_${DAEMON_NAME}" "${CLASS}" "$@" > $OUTFILE 2>&1 & + nohup "${JAVA}" "-Xms$AMS_COLLECTOR_HEAPSIZE" "-Xmx$AMS_COLLECTOR_HEAPSIZE" ${AMS_COLLECTOR_OPTS} "-cp" "/usr/lib/ambari-metrics-collector/*:${COLLECTOR_CONF_DIR}:${COLLECTOR_ADDITIONAL_CLASSPATH}" "-Djava.net.preferIPv4Stack=true" "-Dams.log.dir=${AMS_COLLECTOR_LOG_DIR}" "-Dproc_${DAEMON_NAME}" "${CLASS}" "$@" > $OUTFILE 2>&1 & PID=$! write_pidfile "${PIDFILE}" sleep 2 http://git-wip-us.apache.org/repos/asf/ambari/blob/102dcde8/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-env.xml -- diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-env.xml b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-env.xml index d79e357..cb66537 100644 --- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-env.xml +++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-env.xml @@ -117,6 +117,15 @@ +ams_classpath_additional + +Additional directory or jars in classpath for Metrics Collector. + + true + + + + content ams-env template @@ -162,6 +171,8 @@ export AMS_COLLECTOR_OPTS="$AMS_COLLECTOR_OPTS $AMS_COLLECTOR_GC_OPTS" # Metrics collector host will be blacklisted for specified number of seconds if metric monitor failed to connect to it. export AMS_FAILOVER_STRATEGY_BLACKLISTED_INTERVAL={{failover_strategy_blacklisted_interval}} +# Extra Java CLASSPATH elements for Metrics Collector. Optional. +export COLLECTOR_ADDITIONAL_CLASSPATH={{ams_classpath_additional}} content http://git-wip-us.apache.org/repos/asf/ambari/blob/102dcde8/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/hbase.py -- diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/hbase.py b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/hbase.py index a5ff4f0..e20ff1d 100644 --- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/hbase.py +++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/hbase.py @@ -117,6 +117,15 @@ def hbase(name=None # 'master' or 'regionserver' or 'client' create_parents = True ) + if params.hbase_wal_dir: +
[52/55] [abbrv] ambari git commit: AMBARI-20400 Yarn should not copy Tez and Slider tar ball if Tez and Sliders are not installed on the cluster (dili)
AMBARI-20400 Yarn should not copy Tez and Slider tar ball if Tez and Sliders are not installed on the cluster (dili) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/77fab90c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/77fab90c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/77fab90c Branch: refs/heads/branch-3.0-perf Commit: 77fab90cb4fe5e25e3ecbbe8b3ba4d8fc0570f19 Parents: c614fb7 Author: Di LiAuthored: Thu Mar 30 15:24:02 2017 -0400 Committer: Andrew Onishuk Committed: Fri Mar 31 10:21:45 2017 +0300 -- .../libraries/functions/copy_tarball.py | 24 +++- .../python/stacks/2.0.6/configs/default.json| 24 2 files changed, 47 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/77fab90c/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py -- diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py b/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py index 31a9be4..82a732b 100644 --- a/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py +++ b/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py @@ -64,6 +64,18 @@ TARBALL_MAP = { "/{0}/apps/{1}/spark2/spark2-{0}-yarn-archive.tar.gz".format(STACK_NAME_PATTERN, STACK_VERSION_PATTERN)) } +SERVICE_MAP = { + "slider": "SLIDER", + "tez": "TEZ_CLIENT", + "pig": "PIG", + "sqoop": "SQOOP", + "hive": "HIVE_CLIENT", + "mapreduce": "HDFS_CLIENT", + "hadoop_streaming": "MAPREDUCE2_CLIENT", + "tez_hive2": "HIVE_CLIENT", + "spark": "SPARK_CLIENT", + "spark2": "SPARK2_CLIENT" +} def get_sysprep_skip_copy_tarballs_hdfs(): import params @@ -199,7 +211,7 @@ def _get_single_version_from_stack_select(): def copy_to_hdfs(name, user_group, owner, file_mode=0444, custom_source_file=None, custom_dest_file=None, force_execute=False, - use_upgrading_version_during_upgrade=True, replace_existing_files=False, skip=False): + use_upgrading_version_during_upgrade=True, replace_existing_files=False, skip=False, skip_component_check=False): """ :param name: Tarball name, e.g., tez, hive, pig, sqoop. :param user_group: Group to own the directory. @@ -210,6 +222,8 @@ def copy_to_hdfs(name, user_group, owner, file_mode=0444, custom_source_file=Non :param force_execute: If true, will execute the HDFS commands immediately, otherwise, will defer to the calling function. :param use_upgrading_version_during_upgrade: If true, will use the version going to during upgrade. Otherwise, use the CURRENT (source) version. :param skip: If true, tarballs will not be copied as the cluster deployment uses prepped VMs. + :param skip_component_check: If true, will skip checking if a given component is installed on the node for a file under its dir to be copied. + This is in case the file is not mapped to a component but rather to a specific location (JDK jar, Ambari jar, etc). :return: Will return True if successful, otherwise, False. """ import params @@ -226,6 +240,14 @@ def copy_to_hdfs(name, user_group, owner, file_mode=0444, custom_source_file=Non Logger.warning("Skipping copying {0} to {1} for {2} as it is a sys prepped host.".format(str(source_file), str(dest_file), str(name))) return True + if not skip_component_check: +#Use components installed on the node to check if a file can be copied into HDFS +local_components = default("/localComponents", []) +component = SERVICE_MAP.get(name) +if component not in local_components: + Logger.info("{0} is not installed on the host. Skip copying {1}".format(component, source_file)) + return False + Logger.info("Source file: {0} , Dest file in HDFS: {1}".format(source_file, dest_file)) if not os.path.exists(source_file): http://git-wip-us.apache.org/repos/asf/ambari/blob/77fab90c/ambari-server/src/test/python/stacks/2.0.6/configs/default.json -- diff --git a/ambari-server/src/test/python/stacks/2.0.6/configs/default.json b/ambari-server/src/test/python/stacks/2.0.6/configs/default.json index fa7419f..94425e0 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/configs/default.json +++ b/ambari-server/src/test/python/stacks/2.0.6/configs/default.json @@ -1,4 +1,25 @@ { +"localComponents": [ +"NAMENODE", +"SECONDARY_NAMENODE", +"ZOOKEEPER_SERVER", +"DATANODE", +
[11/55] [abbrv] ambari git commit: AMBARI-19149. Code cleanup: redundant type arguments
http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java index fa2082b..54d4fcc 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java @@ -80,7 +80,7 @@ import com.google.common.collect.Maps; public class BlueprintConfigurationProcessorTest { private static final Configuration EMPTY_CONFIG = new Configuration(Collections.>emptyMap(), Collections. >>emptyMap()); - private final Map serviceComponents = new HashMap (); + private final Map serviceComponents = new HashMap<>(); @Rule public EasyMockRule mocks = new EasyMockRule(this); @@ -112,73 +112,73 @@ public class BlueprintConfigurationProcessorTest { Collections. emptyMap()).anyTimes(); expect(serviceInfo.getRequiredServices()).andReturn(Collections.emptyList()).anyTimes(); -Collection hdfsComponents = new HashSet(); +Collection hdfsComponents = new HashSet<>(); hdfsComponents.add("NAMENODE"); hdfsComponents.add("SECONDARY_NAMENODE"); hdfsComponents.add("DATANODE"); hdfsComponents.add("HDFS_CLIENT"); serviceComponents.put("HDFS", hdfsComponents); -Collection yarnComponents = new HashSet(); +Collection yarnComponents = new HashSet<>(); yarnComponents.add("RESOURCEMANAGER"); yarnComponents.add("NODEMANAGER"); yarnComponents.add("YARN_CLIENT"); yarnComponents.add("APP_TIMELINE_SERVER"); serviceComponents.put("YARN", yarnComponents); -Collection mrComponents = new HashSet(); +Collection mrComponents = new HashSet<>(); mrComponents.add("MAPREDUCE2_CLIENT"); mrComponents.add("HISTORY_SERVER"); serviceComponents.put("MAPREDUCE2", mrComponents); -Collection zkComponents = new HashSet(); +Collection zkComponents = new HashSet<>(); zkComponents.add("ZOOKEEPER_SERVER"); zkComponents.add("ZOOKEEPER_CLIENT"); serviceComponents.put("ZOOKEEPER", zkComponents); -Collection hiveComponents = new HashSet(); +Collection hiveComponents = new HashSet<>(); hiveComponents.add("MYSQL_SERVER"); hiveComponents.add("HIVE_METASTORE"); hiveComponents.add("HIVE_SERVER"); serviceComponents.put("HIVE", hiveComponents); -Collection falconComponents = new HashSet(); +Collection falconComponents = new HashSet<>(); falconComponents.add("FALCON_SERVER"); falconComponents.add("FALCON_CLIENT"); serviceComponents.put("FALCON", falconComponents); -Collection gangliaComponents = new HashSet(); +Collection gangliaComponents = new HashSet<>(); gangliaComponents.add("GANGLIA_SERVER"); gangliaComponents.add("GANGLIA_CLIENT"); serviceComponents.put("GANGLIA", gangliaComponents); -Collection kafkaComponents = new HashSet(); +Collection kafkaComponents = new HashSet<>(); kafkaComponents.add("KAFKA_BROKER"); serviceComponents.put("KAFKA", kafkaComponents); -Collection knoxComponents = new HashSet(); +Collection knoxComponents = new HashSet<>(); knoxComponents.add("KNOX_GATEWAY"); serviceComponents.put("KNOX", knoxComponents); -Collection oozieComponents = new HashSet(); +Collection oozieComponents = new HashSet<>(); oozieComponents.add("OOZIE_SERVER"); oozieComponents.add("OOZIE_CLIENT"); serviceComponents.put("OOZIE", oozieComponents); -Collection hbaseComponents = new HashSet(); +Collection hbaseComponents = new HashSet<>(); hbaseComponents.add("HBASE_MASTER"); serviceComponents.put("HBASE", hbaseComponents); -Collection atlasComponents = new HashSet(); +Collection atlasComponents = new HashSet<>(); atlasComponents.add("ATLAS_SERVER"); atlasComponents.add("ATLAS_CLIENT"); serviceComponents.put("ATLAS", atlasComponents); -Collection amsComponents = new HashSet(); +Collection amsComponents = new HashSet<>(); amsComponents.add("METRICS_COLLECTOR"); serviceComponents.put("AMBARI_METRICS", amsComponents); -Collection stormComponents = new HashSet(); +Collection stormComponents = new HashSet<>(); stormComponents.add("NIMBUS"); serviceComponents.put("STORM", stormComponents); @@ -202,26 +202,26 @@ public class
[01/55] [abbrv] ambari git commit: AMBARI-19149. Code cleanup: redundant type arguments
Repository: ambari Updated Branches: refs/heads/branch-3.0-perf df752f86e -> 72b784249 http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/test/java/org/apache/ambari/server/view/ViewRegistryTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/view/ViewRegistryTest.java b/ambari-server/src/test/java/org/apache/ambari/server/view/ViewRegistryTest.java index 013023d..daabcb3 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/view/ViewRegistryTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/view/ViewRegistryTest.java @@ -288,7 +288,7 @@ public class ViewRegistryTest { for (ViewInstanceEntity viewInstanceEntity : viewInstanceEntities) { viewInstanceEntity.putInstanceData("p1", "v1"); - Collection entities = new HashSet(); + Collection entities = new HashSet<>(); ViewEntityEntity viewEntityEntity = new ViewEntityEntity(); viewEntityEntity.setId(99L); viewEntityEntity.setIdProperty("id"); @@ -313,7 +313,7 @@ public class ViewRegistryTest { viewInstanceEntity.setResource(resourceEntity); } -Mapfiles = new HashMap (); +Map files = new HashMap<>(); if (System.getProperty("os.name").contains("Windows")) { files.put("\\var\\lib\\ambari-server\\resources\\views\\work", extractedArchiveDir); files.put("\\var\\lib\\ambari-server\\resources\\views\\work\\MY_VIEW{1.0.0}", archiveDir); @@ -331,10 +331,10 @@ public class ViewRegistryTest { files.put("/var/lib/ambari-server/resources/views/work/MY_VIEW{1.0.0}/META-INF", metaInfDir); } -Map outputStreams = new HashMap (); +Map outputStreams = new HashMap<>(); outputStreams.put(entryFile, fos); -Map jarFiles = new HashMap (); +Map jarFiles = new HashMap<>(); jarFiles.put(viewArchive, viewJarFile); // set expectations @@ -414,7 +414,7 @@ public class ViewRegistryTest { expect(autoInstanceDataEntity.getName()).andReturn("p1").anyTimes(); expect(autoInstanceDataEntity.getUser()).andReturn(" ").anyTimes(); -Map serviceMap = new HashMap (); +Map serviceMap = new HashMap<>(); serviceMap.put("HDFS", service); serviceMap.put("HIVE", service); @@ -422,7 +422,7 @@ public class ViewRegistryTest { StackId stackId = new StackId("HDP-2.0"); if(checkAutoInstanceCreation) { - Map allClusters = new HashMap (); + Map allClusters = new HashMap<>(); expect(cluster.getClusterName()).andReturn("c1").anyTimes(); expect(cluster.getCurrentStackVersion()).andReturn(stackId).anyTimes(); expect(cluster.getServices()).andReturn(serviceMap).anyTimes(); @@ -542,7 +542,7 @@ public class ViewRegistryTest { viewInstanceEntity.setResource(resourceEntity); } -Map files = new HashMap (); +Map files = new HashMap<>(); if (System.getProperty("os.name").contains("Windows")) { files.put("\\var\\lib\\ambari-server\\resources\\views\\work", extractedArchiveDir); @@ -561,10 +561,10 @@ public class ViewRegistryTest { files.put("/var/lib/ambari-server/resources/views/work/MY_VIEW{1.0.0}/META-INF", metaInfDir); } -Map outputStreams = new HashMap (); +Map outputStreams = new HashMap<>(); outputStreams.put(entryFile, fos); -Map jarFiles = new HashMap (); +Map jarFiles = new HashMap<>(); jarFiles.put(viewArchive, viewJarFile); // set expectations @@ -831,7 +831,7 @@ public class ViewRegistryTest { Assert.assertEquals(3, subResourceDefinitions.size()); -Set names = new HashSet(); +Set names = new HashSet<>(); for (SubResourceDefinition definition : subResourceDefinitions) { names.add(definition.getType().name()); } @@ -1102,7 +1102,7 @@ public class ViewRegistryTest { ViewInstanceEntity viewInstanceEntity = getViewInstanceEntity(viewEntity, config.getInstances().get(0)); -Map instanceProperties = new HashMap (); +Map instanceProperties = new HashMap<>(); instanceProperties.put("p1", "newV1"); instanceProperties.put("p2", "newV2"); @@ -1339,7 +1339,7 @@ public class ViewRegistryTest { ResourceEntity resourceEntity = createNiceMock(ResourceEntity.class); ResourceTypeEntity resourceTypeEntity = createNiceMock(ResourceTypeEntity.class); -Collection instances = new ArrayList(); +Collection