ambari git commit: AMBARI-22325 SecurityConfigurationTest, small refactors (benyoka)
Repository: ambari Updated Branches: refs/heads/branch-feature-AMBARI-14714-blueprintv2 45ac9fabd -> c0eaadd60 AMBARI-22325 SecurityConfigurationTest, small refactors (benyoka) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c0eaadd6 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c0eaadd6 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c0eaadd6 Branch: refs/heads/branch-feature-AMBARI-14714-blueprintv2 Commit: c0eaadd6005151e8f9c87b14c7ee109b4660fe98 Parents: 45ac9fa Author: Balazs Bence SariAuthored: Thu Nov 23 18:08:38 2017 +0100 Committer: Balazs Bence Sari Committed: Thu Nov 23 18:10:33 2017 +0100 -- .../server/topology/SecurityConfiguration.java | 24 +++ .../server/topology/ConfigurableTest.java | 17 + .../topology/SecurityConfigurationTest.java | 71 .../server/topology/TopologyManagerTest.java| 1 - .../topology/TopologyTemplateFactoryTest.java | 20 +++--- .../ambari/server/utils/ResourceUtils.java | 34 ++ .../blueprintv2/cluster_template_v2.json| 58 +++- .../resources/blueprintv2/security_config.json | 58 8 files changed, 270 insertions(+), 13 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/c0eaadd6/ambari-server/src/main/java/org/apache/ambari/server/topology/SecurityConfiguration.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/SecurityConfiguration.java b/ambari-server/src/main/java/org/apache/ambari/server/topology/SecurityConfiguration.java index 7a8b8a9..864e802 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/topology/SecurityConfiguration.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/SecurityConfiguration.java @@ -19,10 +19,15 @@ package org.apache.ambari.server.topology; +import java.io.IOException; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonIgnore; import org.apache.ambari.server.state.SecurityType; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; +import org.codehaus.jackson.map.ObjectMapper; /** * Holds security related properties, the securityType and security descriptor (in case of KERBEROS @@ -36,16 +41,19 @@ public class SecurityConfiguration { /** * Security Type */ + @JsonProperty("type") private SecurityType type; /** * Holds a reference to a kerberos_descriptor resource. */ + @JsonProperty("kerberos_descriptor_reference") private String descriptorReference; /** * Content of a kerberos_descriptor as String. */ + @JsonProperty("kerberos_descriptor") private String descriptor; @@ -64,6 +72,7 @@ public class SecurityConfiguration { return type; } + @JsonIgnore public String getDescriptor() { return descriptor; } @@ -71,4 +80,19 @@ public class SecurityConfiguration { public String getDescriptorReference() { return descriptorReference; } + + public void setDescriptorReference(String descriptorReference) { +this.descriptorReference = descriptorReference; + } + + @JsonIgnore + public void setDescriptor(String descriptor) { +this.descriptor = descriptor; + } + + @JsonProperty("kerberos_descriptor") + public void setKerberosDescriptorFromJson(Map kerberosDescriptor) throws IOException { +setDescriptor(new ObjectMapper().writeValueAsString(kerberosDescriptor)); + } + } http://git-wip-us.apache.org/repos/asf/ambari/blob/c0eaadd6/ambari-server/src/test/java/org/apache/ambari/server/topology/ConfigurableTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/topology/ConfigurableTest.java b/ambari-server/src/test/java/org/apache/ambari/server/topology/ConfigurableTest.java index 2c74dc5..080438d 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/topology/ConfigurableTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/topology/ConfigurableTest.java @@ -1,3 +1,20 @@ +/* + * 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
ambari git commit: AMBARI-22504. Enable jira plugin
Repository: ambari Updated Branches: refs/heads/branch-feature-AMBARI-22504 d753dcd6b -> 17ec68243 AMBARI-22504. Enable jira plugin Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/17ec6824 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/17ec6824 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/17ec6824 Branch: refs/heads/branch-feature-AMBARI-22504 Commit: 17ec68243b8b28f898dccd928927c9cee94427d7 Parents: d753dcd Author: Doroszlai, AttilaAuthored: Thu Nov 23 16:56:16 2017 +0100 Committer: Doroszlai, Attila Committed: Thu Nov 23 16:56:16 2017 +0100 -- dev-support/yetus-personality | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/17ec6824/dev-support/yetus-personality -- diff --git a/dev-support/yetus-personality b/dev-support/yetus-personality index cf093a8..841b851 100755 --- a/dev-support/yetus-personality +++ b/dev-support/yetus-personality @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -personality_plugins "maven,asflicense,author,checkstyle,javac,unit" +personality_plugins "jira,maven,asflicense,author,checkstyle,javac,unit" ## @description Globals specific to this personality ## @audience private
[1/4] ambari git commit: AMBARI-22508 Ambari 3.0: Implement new design for Admin View: User Management. (atkach)
Repository: ambari Updated Branches: refs/heads/trunk 8e36662ae -> 99b19e580 http://git-wip-us.apache.org/repos/asf/ambari/blob/99b19e58/ambari-admin/src/main/resources/ui/admin-web/test/unit/controllers/userManagement/UsersListCtrl_test.js -- diff --git a/ambari-admin/src/main/resources/ui/admin-web/test/unit/controllers/userManagement/UsersListCtrl_test.js b/ambari-admin/src/main/resources/ui/admin-web/test/unit/controllers/userManagement/UsersListCtrl_test.js new file mode 100644 index 000..fcafa59 --- /dev/null +++ b/ambari-admin/src/main/resources/ui/admin-web/test/unit/controllers/userManagement/UsersListCtrl_test.js @@ -0,0 +1,344 @@ +/** + * 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. + */ + +describe('#Cluster', function () { + + describe('UsersListCtrl', function() { + +var scope, ctrl, $t, $httpBackend; + +beforeEach(module('ambariAdminConsole', function () {})); + +beforeEach(inject(function($rootScope, $controller, _$translate_, _$httpBackend_) { + scope = $rootScope.$new(); + $t = _$translate_.instant; + $httpBackend = _$httpBackend_; + ctrl = $controller('UsersListCtrl', { +$scope: scope + }); +})); + +describe('#clearFilters()', function () { + + it('should clear filters and reset pagination', function () { +scope.currentPage = 2; +scope.filters.name = 'a'; +scope.filters.status = { + label: $t('common.local'), + value: false +}; +scope.filters.type = { + label: $t('common.local'), + value: 'LOCAL' +}; +scope.clearFilters(); +expect(scope.filters.name).toEqual(''); +expect(scope.filters.status).toEqual({ + label: $t('common.all'), + value: '*' +}); +expect(scope.filters.type).toEqual({ + label: $t('common.all'), + value: '*' +}); +expect(scope.currentPage).toEqual(1); + }); + +}); + +describe('#isNotEmptyFilter', function () { + + var cases = [ +{ + currentNameFilter: '', + currentTypeFilter: null, + currentActiveFilter: null, + isNotEmptyFilter: false, + title: 'no filters' +}, +{ + currentNameFilter: '', + currentTypeFilter: { +value: '*' + }, + currentActiveFilter: { +value: '*' + }, + isNotEmptyFilter: false, + title: 'empty filters' +}, +{ + currentNameFilter: 'a', + currentTypeFilter: { +value: '*' + }, + currentActiveFilter: { +value: '*' + }, + isNotEmptyFilter: true, + title: 'name filter' +}, +{ + currentNameFilter: '0', + currentTypeFilter: { +value: '*' + }, + currentActiveFilter: { +value: '*' + }, + isNotEmptyFilter: true, + title: 'name filter with "0" as string' +}, +{ + currentNameFilter: '', + currentTypeFilter: { +value: 'LOCAL' + }, + currentActiveFilter: { +value: '*' + }, + isNotEmptyFilter: true, + title: 'type filter' +}, +{ + currentNameFilter: '', + currentTypeFilter: { +value: '*' + }, + currentActiveFilter: { +value: false + }, + isNotEmptyFilter: true, + title: 'activity filter' +}, +{ + currentNameFilter: 'a', + currentTypeFilter: { +value: 'LOCAL' + }, + currentActiveFilter: { +value: '*' + }, + isNotEmptyFilter: true, + title: 'name and type filters' +}, +{ + currentNameFilter: 'a', + currentTypeFilter: { +value: '*' + }, + currentActiveFilter: { +value: false + }, + isNotEmptyFilter: true, + title: 'name and activity
[4/4] ambari git commit: AMBARI-22508 Ambari 3.0: Implement new design for Admin View: User Management. (atkach)
AMBARI-22508 Ambari 3.0: Implement new design for Admin View: User Management. (atkach) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/99b19e58 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/99b19e58 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/99b19e58 Branch: refs/heads/trunk Commit: 99b19e5805cf3ac291eca9c8e6a1290637b08ab6 Parents: 8e36662 Author: Andrii TkachAuthored: Thu Nov 23 14:02:00 2017 +0200 Committer: Andrii Tkach Committed: Thu Nov 23 14:02:00 2017 +0200 -- .../main/resources/ui/admin-web/app/index.html | 17 +- .../resources/ui/admin-web/app/scripts/app.js | 3 +- .../controllers/ClusterInformationCtrl.js | 106 --- .../controllers/ambariViews/ViewsListCtrl.js| 4 +- .../clusters/ClusterInformationCtrl.js | 106 +++ .../clusters/ClustersManageAccessCtrl.js| 97 --- .../controllers/clusters/UserAccessListCtrl.js | 351 .../controllers/groups/GroupsCreateCtrl.js | 65 -- .../controllers/groups/GroupsEditCtrl.js| 180 .../controllers/groups/GroupsListCtrl.js| 106 --- .../userManagement/GroupCreateCtrl.js | 112 +++ .../controllers/userManagement/GroupEditCtrl.js | 182 .../userManagement/GroupsListCtrl.js| 170 .../userManagement/UserCreateCtrl.js| 108 +++ .../controllers/userManagement/UserEditCtrl.js | 290 +++ .../userManagement/UserManagementCtrl.js| 23 + .../controllers/userManagement/UsersListCtrl.js | 178 .../controllers/users/UsersCreateCtrl.js| 75 -- .../scripts/controllers/users/UsersListCtrl.js | 122 --- .../scripts/controllers/users/UsersShowCtrl.js | 290 --- .../ui/admin-web/app/scripts/i18n.config.js | 9 +- .../ui/admin-web/app/scripts/routes.js | 61 +- .../ui/admin-web/app/scripts/services/User.js | 5 +- .../resources/ui/admin-web/app/styles/main.css | 46 +- .../ui/admin-web/app/styles/user-management.css | 30 + .../resources/ui/admin-web/app/styles/views.css | 18 - .../app/views/ambariViews/viewsList.html| 26 +- .../admin-web/app/views/clusterInformation.html | 87 -- .../app/views/clusters/clusterInformation.html | 87 ++ .../app/views/clusters/manageAccess.html| 63 -- .../app/views/clusters/userAccessList.html | 102 --- .../ui/admin-web/app/views/groups/create.html | 43 - .../ui/admin-web/app/views/groups/edit.html | 98 --- .../ui/admin-web/app/views/groups/list.html | 80 -- .../ui/admin-web/app/views/sideNav.html | 22 +- .../app/views/userManagement/groupEdit.html | 99 +++ .../app/views/userManagement/groupsList.html| 94 +++ .../app/views/userManagement/main.html | 36 + .../userManagement/modals/changePassword.html | 46 ++ .../userManagement/modals/groupCreate.html | 86 ++ .../views/userManagement/modals/userCreate.html | 147 .../app/views/userManagement/userEdit.html | 122 +++ .../app/views/userManagement/usersList.html | 119 +++ .../ui/admin-web/app/views/users/create.html| 82 -- .../ui/admin-web/app/views/users/list.html | 97 --- .../app/views/users/modals/changePassword.html | 46 -- .../ui/admin-web/app/views/users/show.html | 122 --- .../clusters/UserAccessListCtrl_test.js | 820 --- .../controllers/groups/GroupsListCtrl_test.js | 129 --- .../userManagement/GroupsListCtrl_test.js | 129 +++ .../userManagement/UsersListCtrl_test.js| 344 .../controllers/users/UsersListCtrl_test.js | 383 - .../test/unit/services/Utility_test.js | 10 +- 53 files changed, 2591 insertions(+), 3682 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/99b19e58/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 4a77e62..e3b817e 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 @@ -121,26 +121,25 @@ - + - - - - - - + + + + + + + - - http://git-wip-us.apache.org/repos/asf/ambari/blob/99b19e58/ambari-admin/src/main/resources/ui/admin-web/app/scripts/app.js -- diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/app.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/app.js index 80e2813..225eb12 100644 --- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/app.js +++
[2/4] ambari git commit: AMBARI-22508 Ambari 3.0: Implement new design for Admin View: User Management. (atkach)
http://git-wip-us.apache.org/repos/asf/ambari/blob/99b19e58/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/modals/groupCreate.html -- diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/modals/groupCreate.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/modals/groupCreate.html new file mode 100644 index 000..e0c1144 --- /dev/null +++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/modals/groupCreate.html @@ -0,0 +1,86 @@ + + + + + + {{'groups.createLocal' | translate}} + + + + + +{{'groups.name' | translate}}* + + + +{{'common.alerts.fieldRequired' | translate}} + + +{{'common.alerts.noSpecialChars' | translate}} + + + + + {{'groups.addUsers' | translate}} + + + + + + + + + {{'groups.role' | translate}} + + + + {{'common.select' | translate}} + {{role.permission_label}} + + + {{'common.alerts.fieldRequired' | translate}} + + + + + + +{{'common.controls.cancel' | translate}} +{{'common.controls.save' | translate}} + + http://git-wip-us.apache.org/repos/asf/ambari/blob/99b19e58/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/modals/userCreate.html -- diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/modals/userCreate.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/modals/userCreate.html new file mode 100644 index 000..0af26eb --- /dev/null +++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/modals/userCreate.html @@ -0,0 +1,147 @@ + + + + + + {{'users.create' | translate}} + + + + + +{{'users.username' | translate}}* + + + + +{{'common.alerts.fieldRequired' | translate}} + + +{{'common.alerts.noSpecialChars' | translate}} + + + + + + + {{'users.password' | translate}}* + + + + {{'common.alerts.fieldRequired' | translate}} + + + + + {{'users.confirmPassword' | translate}}* + + + + {{'common.alerts.fieldRequired' | translate}} + + + {{'users.alerts.wrongPassword' | translate}} + + + + + + + + {{'users.role' | translate}}* + + + + {{'common.select' | translate}} + {{role.permission_label}} + + + {{'common.alerts.fieldRequired' | translate}} + + + + + + +{{'users.isAmbariAdmin' | translate}}* + + + + + + + + + +{{'users.isActive' | translate}}* + + + + + + + + + +{{'common.controls.cancel' | translate}} +{{'common.controls.save' | translate}} + + http://git-wip-us.apache.org/repos/asf/ambari/blob/99b19e58/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/userEdit.html -- diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/userEdit.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/userEdit.html new file mode 100644 index 000..0372a11 --- /dev/null +++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/userEdit.html @@ -0,0 +1,122 @@ + + + + + + {{'common.users' | translate}} + {{user.user_name}} + + + +{{'common.delete' | translate: '{term: constants.user}'}} +{{'common.delete' | translate: '{term: constants.user}'}} + + + + + + + {{'common.type' | translate}} + +{{user.userTypeName}} + + + + {{'users.status' | translate}} + + + + + + {{'users.ambariAdmin' | translate}} + + + + + + {{'users.password' | translate}} + + + {{'users.changePassword' | translate}} + {{'users.changePassword' | translate}} + + + + + + {{getUserMembership(user.user_type)}} + + + + + + + {{'common.privileges' | translate}} + + + + + {{'common.cluster' | translate}} + {{'common.clusterRole' | translate}} + + + + + + +
[3/4] ambari git commit: AMBARI-22508 Ambari 3.0: Implement new design for Admin View: User Management. (atkach)
http://git-wip-us.apache.org/repos/asf/ambari/blob/99b19e58/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/userManagement/UsersListCtrl.js -- diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/userManagement/UsersListCtrl.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/userManagement/UsersListCtrl.js new file mode 100644 index 000..abe1780 --- /dev/null +++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/userManagement/UsersListCtrl.js @@ -0,0 +1,178 @@ +/** + * 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. + */ +'use strict'; + +angular.module('ambariAdminConsole') +.controller('UsersListCtrl', +['$scope', 'User', '$modal', '$rootScope', 'UserConstants', '$translate', 'Cluster', 'View', 'ConfirmationModal', 'Settings', +function($scope, User, $modal, $rootScope, UserConstants, $translate, Cluster, View, ConfirmationModal, Settings) { + var $t = $translate.instant; + $scope.constants = { +admin: $t('users.ambariAdmin'), +users: $t('common.users').toLowerCase() + }; + $scope.minRowsToShowPagination = Settings.minRowsToShowPagination; + $scope.isLoading = false; + $scope.users = []; + $scope.usersPerPage = 10; + $scope.currentPage = 1; + $scope.totalUsers = 0; + $scope.filters = { +name: '', +status: null, +type: null + }; + $scope.maxVisiblePages = 20; + $scope.tableInfo = { +total: 0, +showed: 0 + }; + $scope.isNotEmptyFilter = true; + + $scope.pageChanged = function() { +$scope.loadUsers(); + }; + $scope.usersPerPageChanges = function() { +$scope.resetPagination(); + }; + + $scope.loadUsers = function(){ +$scope.isLoading = true; +User.list({ + currentPage: $scope.currentPage, + usersPerPage: $scope.usersPerPage, + searchString: $scope.filters.name, + user_type: $scope.filters.type.value, + active: $scope.filters.status.value +}).then(function(data) { + $scope.isLoading = false; + $scope.totalUsers = data.data.itemTotal; + $scope.users = data.data.items.map(User.makeUser); + $scope.tableInfo.showed = data.data.items.length; + $scope.tableInfo.total = data.data.itemTotal; +}); + }; + + $scope.resetPagination = function() { +$scope.currentPage = 1; +$scope.loadUsers(); + }; + + $scope.activeFilterOptions = [ +{label: $t('common.all'), value: '*'}, +{label: $t('users.active'), value: true}, +{label: $t('users.inactive'), value:false} + ]; + $scope.filters.status = $scope.activeFilterOptions[0]; + + $scope.typeFilterOptions = [{ label: $t('common.all'), value: '*'}] +.concat(Object.keys(UserConstants.TYPES).map(function(key) { + return { +label: $t(UserConstants.TYPES[key].LABEL_KEY), +value: UserConstants.TYPES[key].VALUE + }; +})); + + $scope.filters.type = $scope.typeFilterOptions[0]; + + $scope.clearFilters = function () { +$scope.filters.name = ''; +$scope.filters.type = $scope.typeFilterOptions[0]; +$scope.filters.status = $scope.activeFilterOptions[0]; +$scope.resetPagination(); + }; + + $scope.loadUsers(); + + $scope.$watch( +function (scope) { + return Boolean(scope.filters.name || (scope.filters.status && scope.filters.status.value !== '*') +|| (scope.filters.type && scope.filters.type.value !== '*')); +}, +function (newValue, oldValue, scope) { + scope.isNotEmptyFilter = newValue; +} + ); + + $rootScope.$watch(function(scope) { +return scope.LDAPSynced; + }, function(LDAPSynced) { +if(LDAPSynced === true){ + $rootScope.LDAPSynced = false; + $scope.loadUsers(); +} + }); + + $scope.createUser = function () { +var modalInstance = $modal.open({ + templateUrl: 'views/userManagement/modals/userCreate.html', + controller: 'UserCreateCtrl', + backdrop: 'static' +}); + +modalInstance.result.finally($scope.loadUsers); + }; + + $scope.deleteUser = function(user) { +ConfirmationModal.show( + $t('common.delete', { +term: $t('common.user') + }), +
ambari git commit: AMBARI-22504. Replace test-patch.sh with Yetus (adoroszlai)
Repository: ambari Updated Branches: refs/heads/branch-feature-AMBARI-22504 [created] d753dcd6b AMBARI-22504. Replace test-patch.sh with Yetus (adoroszlai) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d753dcd6 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d753dcd6 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d753dcd6 Branch: refs/heads/branch-feature-AMBARI-22504 Commit: d753dcd6ba5c8fb4c3d32edf4ae0b4d644dc6ad7 Parents: 8e36662 Author: Attila DoroszlaiAuthored: Wed Nov 22 21:09:48 2017 +0100 Committer: Doroszlai, Attila Committed: Thu Nov 23 13:31:49 2017 +0100 -- .gitignore| 1 + dev-support/test-patch.sh | 990 + dev-support/yetus-personality | 58 +++ dev-support/yetus-wrapper | 177 +++ pom.xml | 1 + 5 files changed, 239 insertions(+), 988 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/d753dcd6/.gitignore -- diff --git a/.gitignore b/.gitignore index 77aadb7..05909c7 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ createDDL.jdbc /contrib/views/storm/src/main/resources/ui/node_modules/ /contrib/views/storm/src/main/resources/ui/public/ /contrib/views/storm/src/main/resources/ui/npm-debug.log +patchprocess http://git-wip-us.apache.org/repos/asf/ambari/blob/d753dcd6/dev-support/test-patch.sh -- diff --git a/dev-support/test-patch.sh b/dev-support/test-patch.sh index 6ed8322..7ed99a5 100755 --- a/dev-support/test-patch.sh +++ b/dev-support/test-patch.sh @@ -11,991 +11,5 @@ # See the License for the specific language governing permissions and # limitations under the License. - - -#set -x -ulimit -n 20480 - -### Setup some variables. -### SVN_REVISION and BUILD_URL are set by Hudson if it is run by patch process -### Read variables from properties file -bindir=$(dirname $0) - -# Defaults -if [ -z "$MAVEN_HOME" ]; then - MVN=mvn -else - MVN=$MAVEN_HOME/bin/mvn -fi - -PROJECT_NAME=Ambari -JENKINS=false -PATCH_DIR=/tmp -SUPPORT_DIR=/tmp -BASEDIR=$(pwd) -PS=${PS:-ps} -AWK=${AWK:-awk} -WGET=${WGET:-wget} -GIT=${GIT:-git} -GREP=${GREP:-grep} -PATCH=${PATCH:-patch} -DIFF=${DIFF:-diff} -JIRACLI=${JIRA:-jira} -FINDBUGS_HOME=${FINDBUGS_HOME} -FORREST_HOME=${FORREST_HOME} -ECLIPSE_HOME=${ECLIPSE_HOME} - -### -printUsage() { - echo "Usage: $0 [options] patch-file | defect-number" - 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. 'AMBARI-1234') to test (Jenkins only)" - echo - echo "Options:" - echo "--patch-dir= The directory for working and output files (default '/tmp')" - echo "--basedir=The directory to apply the patch to (default current directory)" - echo "--mvn-cmd=The 'mvn' command to use (default \$MAVEN_HOME/bin/mvn, or 'mvn')" - echo "--ps-cmd= The 'ps' command to use (default 'ps')" - echo "--awk-cmd=The 'awk' command to use (default 'awk')" - echo "--git-cmd=The 'git' command to use (default 'git')" - echo "--grep-cmd= The 'grep' command to use (default 'grep')" - echo "--patch-cmd= The 'patch' command to use (default 'patch')" - echo "--diff-cmd= The 'diff' command to use (default 'diff')" - echo "--findbugs-home= Findbugs home directory (default FINDBUGS_HOME environment variable)" - echo "--forrest-home= Forrest home directory (default FORREST_HOME environment variable)" - echo "--dirty-workspace Allow the local SVN workspace to have uncommitted changes" - echo "--run-testsRun all tests below the base directory" - echo - echo "Jenkins-only options:" - echo "--jenkins Run by Jenkins (runs tests and posts results to JIRA)" - echo "--support-dir=The directory to find support files in" - echo "--wget-cmd= The 'wget' command to use (default 'wget')" - echo "--jira-cmd= The 'jira' command to use (default 'jira')" - echo "--jira-password= The password for the 'jira' command" - echo "--eclipse-home= Eclipse home directory (default ECLIPSE_HOME environment variable)" -} - -### -parseArgs() { - for i in $* - do -case $i in ---jenkins) - JENKINS=true - ;; ---patch-dir=*) - PATCH_DIR=${i#*=} - ;; ---support-dir=*) - SUPPORT_DIR=${i#*=} - ;; ---basedir=*) - BASEDIR=${i#*=} - ;; -
ambari git commit: AMBARI-21569.Users randomly getting "HDFS020 Could not write file" exceptions while running query from Hive View(Venkata Sairam)
Repository: ambari Updated Branches: refs/heads/branch-2.6 099e0185d -> c57e243d2 AMBARI-21569.Users randomly getting "HDFS020 Could not write file" exceptions while running query from Hive View(Venkata Sairam) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c57e243d Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c57e243d Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c57e243d Branch: refs/heads/branch-2.6 Commit: c57e243d2d0c2f480b56693a39e97bb81e258da6 Parents: 099e018 Author: Venkata SairamAuthored: Thu Nov 23 15:52:55 2017 +0530 Committer: Venkata Sairam Committed: Thu Nov 23 15:52:55 2017 +0530 -- .../org/apache/ambari/view/utils/hdfs/HdfsApi.java | 16 +++- .../apache/ambari/view/utils/hdfs/HdfsUtil.java| 17 - 2 files changed, 27 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/c57e243d/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsApi.java -- diff --git a/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsApi.java b/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsApi.java index 3db2081..812cd54 100644 --- a/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsApi.java +++ b/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsApi.java @@ -485,7 +485,20 @@ public class HdfsApi { * @throws IOException * @throws InterruptedException */ - public T execute(PrivilegedExceptionAction action) + public T execute(PrivilegedExceptionAction action) throws IOException, InterruptedException { +return this.execute(action, false); + } + + + /** + * Executes action on HDFS using doAs + * @param action strategy object + * @param result type + * @return result of operation + * @throws IOException + * @throws InterruptedException + */ + public T execute(PrivilegedExceptionAction action, boolean alwaysRetry) throws IOException, InterruptedException { T result = null; @@ -508,6 +521,7 @@ public class HdfsApi { } LOG.info("HDFS threw 'IOException: Cannot obtain block length' exception. " + "Retrying... Try #" + (tryNumber + 1)); +LOG.error("Retrying: " + ex.getMessage(),ex); Thread.sleep(1000); //retry after 1 second } } while (!succeeded); http://git-wip-us.apache.org/repos/asf/ambari/blob/c57e243d/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsUtil.java -- diff --git a/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsUtil.java b/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsUtil.java index 0670f1a..810129b 100644 --- a/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsUtil.java +++ b/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsUtil.java @@ -27,6 +27,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; +import java.security.PrivilegedExceptionAction; import java.util.Map; public class HdfsUtil { @@ -38,13 +39,19 @@ public class HdfsUtil { * @param filePath path to file * @param content new content of file */ - public static void putStringToFile(HdfsApi hdfs, String filePath, String content) throws HdfsApiException { -FSDataOutputStream stream; + public static void putStringToFile(final HdfsApi hdfs,final String filePath, final String content) throws HdfsApiException { + try { synchronized (hdfs) { -stream = hdfs.create(filePath, true); -stream.write(content.getBytes()); -stream.close(); +hdfs.execute(new PrivilegedExceptionAction() { + @Override + public Void run() throws Exception { +final FSDataOutputStream stream = hdfs.create(filePath, true); +stream.write(content.getBytes()); +stream.close(); +return null; + } +}, true); } } catch (IOException e) { throw new HdfsApiException("HDFS020 Could not write file " + filePath, e);
[5/7] ambari git commit: AMBARI-22493. Fix build for test classes in feature branch.(vbrodetskyi)
http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/controller/BackgroundCustomCommandExecutionTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/BackgroundCustomCommandExecutionTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/BackgroundCustomCommandExecutionTest.java index 3d8d161..0b07fb7 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/controller/BackgroundCustomCommandExecutionTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/BackgroundCustomCommandExecutionTest.java @@ -217,8 +217,8 @@ public class BackgroundCustomCommandExecutionTest { if (desiredState != null) { dStateStr = desiredState.toString(); } -ServiceRequest r1 = new ServiceRequest(clusterName, serviceName, -m_repositoryVersion.getId(), dStateStr); +ServiceRequest r1 = new ServiceRequest(clusterName, "", serviceName, +m_repositoryVersion.getId(), dStateStr, null); Set requests = new HashSet<>(); requests.add(r1); @@ -234,7 +234,7 @@ public class BackgroundCustomCommandExecutionTest { if (desiredState != null) { dStateStr = desiredState.toString(); } -ServiceComponentRequest r = new ServiceComponentRequest(clusterName, +ServiceComponentRequest r = new ServiceComponentRequest(clusterName, "", serviceName, componentName, dStateStr); Set requests = new HashSet<>(); @@ -248,7 +248,7 @@ public class BackgroundCustomCommandExecutionTest { if (desiredState != null) { dStateStr = desiredState.toString(); } -ServiceComponentHostRequest r = new ServiceComponentHostRequest(clusterName, +ServiceComponentHostRequest r = new ServiceComponentHostRequest(clusterName, "", serviceName, componentName, hostname, dStateStr); Set requests = new HashSet<>(); http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/controller/ClusterResponseTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/ClusterResponseTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/ClusterResponseTest.java index c9e91e3..40d12de 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/controller/ClusterResponseTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/ClusterResponseTest.java @@ -40,7 +40,7 @@ public class ClusterResponseTest { new ClusterResponse(clusterId, clusterName, provisioningState, securityType, hostNames, hostNames.size(), "bar", null); -Assert.assertEquals(clusterId, r1.getClusterId()); +Assert.assertTrue(clusterId == r1.getClusterId().longValue()); Assert.assertEquals(clusterName, r1.getClusterName()); Assert.assertEquals(provisioningState, r1.getProvisioningState()); Assert.assertEquals(securityType, r1.getSecurityType()); http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/controller/RefreshYarnCapacitySchedulerReleaseConfigTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/RefreshYarnCapacitySchedulerReleaseConfigTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/RefreshYarnCapacitySchedulerReleaseConfigTest.java index ef186f1..3ce6686 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/controller/RefreshYarnCapacitySchedulerReleaseConfigTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/RefreshYarnCapacitySchedulerReleaseConfigTest.java @@ -102,12 +102,12 @@ public class RefreshYarnCapacitySchedulerReleaseConfigTest { // Start ClusterRequest cr = new ClusterRequest(cluster.getClusterId(), "c1", cluster.getDesiredStackVersion().getStackVersion(), null); -cr.setDesiredConfig(Collections.singletonList(new ConfigurationRequest("c1","capacity-scheduler","version2", new HashMap<>(), null))); +cr.setDesiredConfig(Collections.singletonList(new ConfigurationRequest("c1","capacity-scheduler","version2", new HashMap<>(), null, 1L, 1L))); controller.updateClusters(Collections.singleton(cr) , null); -ServiceComponentHostRequest r = new ServiceComponentHostRequest("c1", null, null, null, null); +ServiceComponentHostRequest r = new ServiceComponentHostRequest("c1", null, null, null, null, null); r.setStaleConfig("true"); Set resps = controller.getHostComponents(Collections.singleton(r)); Assert.assertEquals(1, resps.size()); @@ -123,12 +123,12 @@ public class RefreshYarnCapacitySchedulerReleaseConfigTest { // Start
[7/7] ambari git commit: AMBARI-22493. Fix build for test classes in feature branch.(vbrodetskyi)
AMBARI-22493. Fix build for test classes in feature branch.(vbrodetskyi) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1f176845 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1f176845 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1f176845 Branch: refs/heads/branch-feature-AMBARI-14714 Commit: 1f176845ec636adbc1dc710c03f8062f979f5405 Parents: 35d704c Author: Vitaly BrodetskyiAuthored: Thu Nov 23 12:22:11 2017 +0200 Committer: Vitaly Brodetskyi Committed: Thu Nov 23 12:22:11 2017 +0200 -- ambari-server/pom.xml | 2 +- .../ExecutionCommandWrapperTest.java| 2 +- .../TestActionSchedulerThreading.java | 8 +- .../server/agent/HeartbeatProcessorTest.java| 2 +- .../server/agent/TestHeartbeatHandler.java | 2 +- .../server/agent/TestHeartbeatMonitor.java | 10 +- .../render/ClusterBlueprintRendererTest.java| 8 +- .../api/services/ComponentServiceTest.java | 4 +- .../api/services/ConfigurationServiceTest.java | 2 +- .../server/api/services/ServiceServiceTest.java | 8 +- .../StackAdvisorBlueprintProcessorTest.java | 12 +- .../checks/ComponentsInstallationCheckTest.java | 12 +- .../server/checks/ServicesUpCheckTest.java | 16 +- .../configuration/RecoveryConfigHelperTest.java | 12 +- .../AmbariCustomCommandExecutionHelperTest.java | 13 +- .../AmbariManagementControllerImplTest.java | 58 +- .../AmbariManagementControllerTest.java | 892 +-- .../BackgroundCustomCommandExecutionTest.java | 8 +- .../server/controller/ClusterResponseTest.java | 2 +- ...hYarnCapacitySchedulerReleaseConfigTest.java | 16 +- .../internal/AbstractResourceProviderTest.java | 4 +- .../BlueprintConfigurationProcessorTest.java| 306 +++ .../ClientConfigResourceProviderTest.java | 4 +- .../internal/ClusterResourceProviderTest.java | 4 +- .../internal/ComponentResourceProviderTest.java | 20 +- .../ConfigGroupResourceProviderTest.java| 10 +- .../internal/ExportBlueprintRequestTest.java| 2 +- .../HostComponentResourceProviderTest.java | 14 +- .../internal/HostResourceProviderTest.java | 26 +- .../internal/JMXHostProviderTest.java | 24 +- .../internal/ProvisionClusterRequestTest.java | 2 +- .../internal/RequestResourceProviderTest.java | 2 +- .../internal/ScaleClusterRequestTest.java | 2 +- .../internal/ServiceResourceProviderTest.java | 6 +- .../StackConfigurationResourceProviderTest.java | 14 +- .../StackDefinedPropertyProviderTest.java | 8 +- ...kLevelConfigurationResourceProviderTest.java | 14 +- .../server/controller/internal/StackTest.java | 17 +- .../StackUpgradeConfigurationMergeTest.java | 6 +- .../controller/internal/UnitUpdaterTest.java| 8 +- .../internal/UpgradeResourceProviderTest.java | 20 +- .../UpgradeSummaryResourceProviderTest.java | 2 +- .../VersionDefinitionResourceProviderTest.java | 2 +- .../LoggingSearchPropertyProviderTest.java | 6 +- .../utilities/KerberosIdentityCleanerTest.java | 4 +- .../GeneralServiceCalculatedStateTest.java | 2 +- .../apache/ambari/server/events/EventsTest.java | 4 +- .../HostVersionOutOfSyncListenerTest.java | 8 +- .../apache/ambari/server/orm/OrmTestHelper.java | 5 +- .../apache/ambari/server/orm/TestOrmImpl.java | 14 +- .../server/orm/dao/ServiceConfigDAOTest.java| 30 +- .../orm/dao/TopologyLogicalRequestDAOTest.java | 4 +- .../server/orm/dao/TopologyRequestDAOTest.java | 8 +- .../orm/entities/ServiceConfigEntityTest.java | 2 +- .../ComponentVersionCheckActionTest.java| 4 +- .../upgrades/ConfigureActionTest.java | 5 +- .../PreconfigureKerberosActionTest.java | 2 +- .../upgrades/UpgradeActionTest.java | 4 +- .../ambari/server/state/ConfigGroupTest.java| 3 +- .../ambari/server/state/ConfigHelperTest.java | 11 +- .../ambari/server/state/DesiredConfigTest.java | 4 +- .../server/state/ServiceComponentTest.java | 58 +- .../apache/ambari/server/state/ServiceTest.java | 16 +- .../ambari/server/state/UpgradeHelperTest.java | 33 +- .../state/alerts/AlertEventPublisherTest.java | 4 +- .../state/alerts/InitialAlertEventTest.java | 4 +- .../state/cluster/ClusterDeadlockTest.java | 3 +- .../server/state/cluster/ClusterImplTest.java | 4 +- .../server/state/cluster/ClusterTest.java | 137 +-- .../state/cluster/ClustersDeadlockTest.java | 3 +- .../server/state/cluster/ClustersTest.java | 20 +- .../ConcurrentServiceConfigVersionTest.java | 9 +- ...omponentHostConcurrentWriteDeadlockTest.java | 3 +-
[3/7] ambari git commit: AMBARI-22493. Fix build for test classes in feature branch.(vbrodetskyi)
http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java index 110e359..efa351a 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java @@ -244,13 +244,13 @@ public class ComponentResourceProviderTest { expect(service.getServiceComponents()).andReturn(serviceComponentMap).anyTimes(); expect(serviceComponent1.convertToResponse()).andReturn( - new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component100", stackId, "", serviceComponentStateCountMap, + new ServiceComponentResponse(100L, "Cluster100", 1L, "", 1L, "Service100", "", "Component100", stackId, "", serviceComponentStateCountMap, true /* recovery enabled */, "Component100 Client", null, null)); expect(serviceComponent2.convertToResponse()).andReturn( - new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component101", stackId, "", serviceComponentStateCountMap, + new ServiceComponentResponse(100L, "Cluster100", 1L, "", 1L, "Service100", "", "Component101", stackId, "", serviceComponentStateCountMap, false /* recovery not enabled */, "Component101 Client", null, null)); expect(serviceComponent3.convertToResponse()).andReturn( - new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component102", stackId, "", serviceComponentStateCountMap, + new ServiceComponentResponse(100L, "Cluster100", 1L, "", 1L, "Service100", "", "Component102", stackId, "", serviceComponentStateCountMap, true /* recovery enabled */, "Component102 Client", "1.1", RepositoryVersionState.CURRENT)); expect(ambariMetaInfo.getComponent("FOO", "1.0", null, "Component100")).andReturn( @@ -423,13 +423,13 @@ public class ComponentResourceProviderTest { expect(component3Info.getCategory()).andReturn(null); expect(serviceComponent1.convertToResponse()).andReturn( - new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component101", stackId, "", serviceComponentStateCountMap, + new ServiceComponentResponse(100L, "Cluster100", 1L, "", 1L, "Service100", "", "Component101", stackId, "", serviceComponentStateCountMap, false /* recovery not enabled */, "Component101 Client", null, null)); expect(serviceComponent2.convertToResponse()).andReturn( - new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component102", stackId, "", serviceComponentStateCountMap, + new ServiceComponentResponse(100L, "Cluster100", 1L, "", 1L, "Service100", "", "Component102", stackId, "", serviceComponentStateCountMap, false /* recovery not enabled */, "Component102 Client", null, null)); expect(serviceComponent3.convertToResponse()).andReturn( - new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component103", stackId, "", serviceComponentStateCountMap, + new ServiceComponentResponse(100L, "Cluster100", 1L, "", 1L, "Service100", "", "Component103", stackId, "", serviceComponentStateCountMap, false /* recovery not enabled */, "Component103 Client", null, null)); expect(serviceComponent1.getDesiredState()).andReturn(State.INSTALLED).anyTimes(); expect(serviceComponent2.getDesiredState()).andReturn(State.INSTALLED).anyTimes(); @@ -731,7 +731,7 @@ public class ComponentResourceProviderTest { expect(component1Info.getCategory()).andReturn(null); expect(serviceComponent1.convertToResponse()).andReturn( -new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component101", stackId, "", serviceComponentStateCountMap, +new ServiceComponentResponse(100L, "Cluster100", 1L, "", 1L, "Service100", "", "Component101", stackId, "", serviceComponentStateCountMap, false /* recovery not enabled */, "Component101 Client", null, null)); expect(serviceComponent1.getDesiredState()).andReturn(State.INSTALLED).anyTimes(); @@ -897,8 +897,8 @@ public class ComponentResourceProviderTest { expect(component4Info.getCategory()).andReturn(null); expect(service.getName()).andReturn("service1").anyTimes(); -expect(service.getServiceComponent("component1")).andThrow(new ServiceComponentNotFoundException("cluster1", "service1", "component1")); -expect(service.getServiceComponent("component2")).andThrow(new ServiceComponentNotFoundException("cluster1", "service1", "component2")); +
[4/7] ambari git commit: AMBARI-22493. Fix build for test classes in feature branch.(vbrodetskyi)
http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/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 22b0e6b..f9765f2 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 @@ -43,7 +43,7 @@ import java.util.Set; import org.apache.ambari.server.controller.AmbariManagementController; import org.apache.ambari.server.controller.AmbariServer; import org.apache.ambari.server.controller.KerberosHelper; -import org.apache.ambari.server.controller.StackConfigurationResponse; +import org.apache.ambari.server.controller.StackLevelConfigurationResponse; import org.apache.ambari.server.state.Cluster; import org.apache.ambari.server.state.Clusters; import org.apache.ambari.server.state.ConfigHelper; @@ -290,7 +290,7 @@ public class BlueprintConfigurationProcessorTest extends EasyMockSupport { hostGroups.add(group2); ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups); -BlueprintConfigurationProcessor configProcessor = new BlueprintConfigurationProcessor(topology); +BlueprintConfigurationProcessor configProcessor = new BlueprintConfigurationProcessor(topology, null); configProcessor.doUpdateForBlueprintExport(); String updatedVal = properties.get("yarn-site").get("yarn.resourcemanager.hostname"); @@ -338,7 +338,7 @@ public class BlueprintConfigurationProcessorTest extends EasyMockSupport { hostGroups.add(group2); ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups); -BlueprintConfigurationProcessor configProcessor = new BlueprintConfigurationProcessor(topology); +BlueprintConfigurationProcessor configProcessor = new BlueprintConfigurationProcessor(topology, null); configProcessor.doUpdateForBlueprintExport(); assertEquals(properties.size(), 3); @@ -372,7 +372,7 @@ public class BlueprintConfigurationProcessorTest extends EasyMockSupport { ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups); -BlueprintConfigurationProcessor configProcessor = new BlueprintConfigurationProcessor(topology); +BlueprintConfigurationProcessor configProcessor = new BlueprintConfigurationProcessor(topology, null); // When configProcessor.doUpdateForBlueprintExport(); @@ -416,7 +416,7 @@ public class BlueprintConfigurationProcessorTest extends EasyMockSupport { hostGroups.add(group2); ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups); -BlueprintConfigurationProcessor configProcessor = new BlueprintConfigurationProcessor(topology); +BlueprintConfigurationProcessor configProcessor = new BlueprintConfigurationProcessor(topology, null); configProcessor.doUpdateForBlueprintExport(); assertEquals("%HOSTGROUP::group1%", clusterConfig.getPropertyValue("yarn-site", "yarn.resourcemanager.hostname")); @@ -464,7 +464,7 @@ public class BlueprintConfigurationProcessorTest extends EasyMockSupport { hostGroups.add(group2); ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups); -BlueprintConfigurationProcessor configProcessor = new BlueprintConfigurationProcessor(topology); +BlueprintConfigurationProcessor configProcessor = new BlueprintConfigurationProcessor(topology, null); configProcessor.doUpdateForBlueprintExport(); assertEquals("%HOSTGROUP::group1%", properties.get("yarn-site").get("yarn.resourcemanager.hostname")); @@ -499,7 +499,7 @@ public class BlueprintConfigurationProcessorTest extends EasyMockSupport { hostGroups.add(group2); ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups); -BlueprintConfigurationProcessor configProcessor = new BlueprintConfigurationProcessor(topology); +BlueprintConfigurationProcessor configProcessor = new BlueprintConfigurationProcessor(topology, null); configProcessor.doUpdateForBlueprintExport(); String updatedVal = properties.get("core-site").get("fs.defaultFS"); @@ -532,7 +532,7 @@ public class BlueprintConfigurationProcessorTest extends EasyMockSupport { hostGroups.add(group2); ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups); -BlueprintConfigurationProcessor configProcessor = new BlueprintConfigurationProcessor(topology); +BlueprintConfigurationProcessor configProcessor = new
[2/7] ambari git commit: AMBARI-22493. Fix build for test classes in feature branch.(vbrodetskyi)
http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java index 82d5481..e9da564 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java @@ -22,6 +22,7 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import java.lang.reflect.Field; +import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.List; @@ -40,6 +41,7 @@ import org.apache.ambari.server.actionmanager.HostRoleStatus; import org.apache.ambari.server.agent.CommandReport; import org.apache.ambari.server.agent.ExecutionCommand; import org.apache.ambari.server.api.services.AmbariMetaInfo; +import org.apache.ambari.server.api.services.ServiceKey; import org.apache.ambari.server.controller.AmbariManagementController; import org.apache.ambari.server.controller.AmbariServer; import org.apache.ambari.server.controller.ServiceConfigVersionResponse; @@ -602,7 +604,7 @@ public class UpgradeActionTest { try { service = cluster.getService(serviceName); } catch (ServiceNotFoundException e) { - service = serviceFactory.createNew(cluster, serviceName, repositoryVersionEntity); + service = serviceFactory.createNew(cluster, null, new ArrayList(), serviceName, "", repositoryVersionEntity); cluster.addService(service); } http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/state/ConfigGroupTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/ConfigGroupTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/ConfigGroupTest.java index cc23e9b..1296be9 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/state/ConfigGroupTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/state/ConfigGroupTest.java @@ -105,8 +105,7 @@ public class ConfigGroupTest { configs.put(config.getType(), config); hosts.put(host.getHostId(), host); -ConfigGroup configGroup = configGroupFactory.createNew(cluster, "HDFS", "cg-test", - "HDFS", "New HDFS configs for h1", configs, hosts); +ConfigGroup configGroup = configGroupFactory.createNew(cluster, 1L, 1L, "HDFS", "", "New HDFS configs for h1", configs, hosts); cluster.addConfigGroup(configGroup); return configGroup; http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java index 7e1e2da..ff28eb7 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java @@ -156,9 +156,9 @@ public class ConfigHelperTest { cr2.setType("flume-conf"); cr2.setVersionTag("version1"); - cluster.addService("FLUME", repositoryVersion); - cluster.addService("OOZIE", repositoryVersion); - cluster.addService("HDFS", repositoryVersion); + cluster.addService(null, "", "FLUME", repositoryVersion); + cluster.addService(null, "", "OOZIE", repositoryVersion); + cluster.addService(null, "", "HDFS", repositoryVersion); final ClusterRequest clusterRequest2 = new ClusterRequest(cluster.getClusterId(), clusterName, @@ -298,7 +298,10 @@ public class ConfigHelperTest { configMap.put(config.getType(), config); } - ConfigGroup configGroup = configGroupFactory.createNew(cluster, null, name, + long serviceGroupId = 1; + long serviceId = 1; + + ConfigGroup configGroup = configGroupFactory.createNew(cluster, serviceGroupId, serviceId, name, tag, "", configMap, hostMap); LOG.info("Config group created with tag " + tag); configGroup.setTag(tag); http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/state/DesiredConfigTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/DesiredConfigTest.java
[1/7] ambari git commit: AMBARI-22493. Fix build for test classes in feature branch.(vbrodetskyi)
Repository: ambari Updated Branches: refs/heads/branch-feature-AMBARI-14714 35d704cb3 -> 1f176845e http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/topology/ClusterInstallWithoutStartTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/topology/ClusterInstallWithoutStartTest.java b/ambari-server/src/test/java/org/apache/ambari/server/topology/ClusterInstallWithoutStartTest.java index d89c8ca..8d58107 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/topology/ClusterInstallWithoutStartTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/topology/ClusterInstallWithoutStartTest.java @@ -286,7 +286,7 @@ public class ClusterInstallWithoutStartTest extends EasyMockSupport { expect(stack.getExcludedConfigurationTypes("service1")).andReturn(Collections.emptySet()).anyTimes(); expect(stack.getExcludedConfigurationTypes("service2")).andReturn(Collections.emptySet()).anyTimes(); -expect(request.getBlueprint()).andReturn(blueprint).anyTimes(); +expect(request.getBlueprint()).andReturn(null).anyTimes(); expect(request.getClusterId()).andReturn(CLUSTER_ID).anyTimes(); expect(request.getClusterName()).andReturn(CLUSTER_NAME).anyTimes(); expect(request.getDescription()).andReturn("Provision Cluster Test").anyTimes(); @@ -340,7 +340,7 @@ public class ClusterInstallWithoutStartTest extends EasyMockSupport { expect(ambariContext.getPersistedTopologyState()).andReturn(persistedState).anyTimes(); //todo: don't ignore param -ambariContext.createAmbariResources(isA(ClusterTopology.class), eq(CLUSTER_NAME), (SecurityType) isNull(), eq("1"), anyLong()); +ambariContext.createAmbariResources(isA(ClusterTopology.class), eq(CLUSTER_NAME), (SecurityType) isNull()); expectLastCall().once(); expect(ambariContext.getNextRequestId()).andReturn(1L).once(); expect(ambariContext.isClusterKerberosEnabled(CLUSTER_ID)).andReturn(false).anyTimes(); http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/topology/ClusterTopologyImplTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/topology/ClusterTopologyImplTest.java b/ambari-server/src/test/java/org/apache/ambari/server/topology/ClusterTopologyImplTest.java index a8674b3..d8c266d 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/topology/ClusterTopologyImplTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/topology/ClusterTopologyImplTest.java @@ -104,21 +104,21 @@ public class ClusterTopologyImplTest { hostGroupMap.put("group4", group4); Set group1Components = new HashSet<>(); -group1Components.add(new ComponentV2("component1", new Service("service1", stack))); -group1Components.add(new ComponentV2("component2", new Service("service1", stack))); +group1Components.add(null); +group1Components.add(null); Set group1ComponentNames = new HashSet<>(); group1ComponentNames.add("component1"); group1ComponentNames.add("component2"); Set group2Components = new HashSet<>(); -group2Components.add(new ComponentV2("component3", new Service("service1", stack))); +group2Components.add(null); Set group3Components = new HashSet<>(); -group3Components.add(new ComponentV2("component4", new Service("service2", stack))); +group3Components.add(null); Set group4Components = new HashSet<>(); -group4Components.add(new ComponentV2("component5", new Service("service2", stack))); +group4Components.add(null); -expect(blueprint.getHostGroups()).andReturn(hostGroupMap).anyTimes(); +expect(blueprint.getHostGroups()).andReturn(null).anyTimes(); expect(blueprint.getHostGroup("group1")).andReturn(group1).anyTimes(); expect(blueprint.getHostGroup("group2")).andReturn(group2).anyTimes(); expect(blueprint.getHostGroup("group3")).andReturn(group3).anyTimes(); http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/topology/LogicalRequestTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/topology/LogicalRequestTest.java b/ambari-server/src/test/java/org/apache/ambari/server/topology/LogicalRequestTest.java index a5265f6..02e4e75 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/topology/LogicalRequestTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/topology/LogicalRequestTest.java @@ -112,7 +112,7 @@ public class LogicalRequestTest extends EasyMockSupport { expect(clusterTopology.getAmbariContext()).andReturn(ambariContext).anyTimes();
[6/7] ambari git commit: AMBARI-22493. Fix build for test classes in feature branch.(vbrodetskyi)
http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/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 44b46f4..92eced2 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 @@ -77,6 +77,7 @@ import org.apache.ambari.server.agent.ExecutionCommand; import org.apache.ambari.server.agent.HeartBeatHandler; import org.apache.ambari.server.agent.rest.AgentResource; import org.apache.ambari.server.api.services.AmbariMetaInfo; +import org.apache.ambari.server.api.services.ServiceKey; import org.apache.ambari.server.audit.AuditLogger; import org.apache.ambari.server.configuration.Configuration; import org.apache.ambari.server.controller.internal.ClusterStackVersionResourceProviderTest; @@ -377,7 +378,7 @@ public class AmbariManagementControllerTest { dStateStr = desiredState.toString(); } -ServiceRequest r1 = new ServiceRequest(clusterName, serviceName, +ServiceRequest r1 = new ServiceRequest(clusterName, "", serviceName, repositoryVersion.getId(), dStateStr, null); @@ -394,7 +395,7 @@ public class AmbariManagementControllerTest { if (desiredState != null) { dStateStr = desiredState.toString(); } -ServiceComponentRequest r = new ServiceComponentRequest(clusterName, +ServiceComponentRequest r = new ServiceComponentRequest(clusterName, "", serviceName, componentName, dStateStr); Set requests = new HashSet<>(); @@ -409,7 +410,7 @@ public class AmbariManagementControllerTest { if (desiredState != null) { dStateStr = desiredState.toString(); } -ServiceComponentHostRequest r = new ServiceComponentHostRequest(clusterName, +ServiceComponentHostRequest r = new ServiceComponentHostRequest(clusterName, "", serviceName, componentName, hostname, dStateStr); Set requests = new HashSet<>(); @@ -424,7 +425,7 @@ public class AmbariManagementControllerTest { if (desiredState != null) { dStateStr = desiredState.toString(); } -ServiceComponentHostRequest r = new ServiceComponentHostRequest(clusterName, +ServiceComponentHostRequest r = new ServiceComponentHostRequest(clusterName, "", serviceName, componentName, hostname, dStateStr); Set requests = new HashSet<>(); @@ -449,10 +450,9 @@ public class AmbariManagementControllerTest { configMap.put(config.getType(), config); } -ConfigGroup configGroup = configGroupFactory.createNew(cluster, serviceName, name, - tag, "", configMap, hostMap); +ConfigGroup configGroup = configGroupFactory.createNew(cluster, 1L, 1L, serviceName, tag, "", configMap, hostMap); -configGroup.setServiceName(serviceName); +//configGroup.setServiceName(serviceName); cluster.addConfigGroup(configGroup); @@ -462,7 +462,7 @@ public class AmbariManagementControllerTest { private long stopService(String clusterName, String serviceName, boolean runSmokeTests, boolean reconfigureClients) throws AmbariException, AuthorizationException { -ServiceRequest r = new ServiceRequest(clusterName, serviceName, null, State.INSTALLED.toString(), null); +ServiceRequest r = new ServiceRequest(clusterName, "", serviceName, null, State.INSTALLED.toString(), null); Set requests = new HashSet<>(); requests.add(r); MapmapRequestProps = new HashMap<>(); @@ -495,7 +495,7 @@ public class AmbariManagementControllerTest { for (ServiceComponent sc : s.getServiceComponents().values()) { for (ServiceComponentHost sch : sc.getServiceComponentHosts().values()) { ServiceComponentHostRequest schr = new ServiceComponentHostRequest - (clusterName, serviceName, sc.getName(), + (clusterName, "", serviceName, sc.getName(), sch.getHostName(), State.INSTALLED.name()); requests.add(schr); } @@ -527,7 +527,7 @@ public class AmbariManagementControllerTest { boolean runSmokeTests, boolean reconfigureClients, MaintenanceStateHelper maintenanceStateHelper) throws AmbariException, AuthorizationException { -ServiceRequest r = new ServiceRequest(clusterName, serviceName, repositoryVersion02.getId(), +ServiceRequest r = new ServiceRequest(clusterName, "", serviceName, repositoryVersion02.getId(), State.STARTED.toString(), null); Set requests = new HashSet<>(); requests.add(r); @@ -582,7 +582,7 @@ public class
ambari git commit: AMBARI-21569.Users randomly getting "HDFS020 Could not write file" exceptions while running query from Hive View(Venkata Sairam)
Repository: ambari Updated Branches: refs/heads/branch-2.5 603c3fd74 -> adc1fed15 AMBARI-21569.Users randomly getting "HDFS020 Could not write file" exceptions while running query from Hive View(Venkata Sairam) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/adc1fed1 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/adc1fed1 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/adc1fed1 Branch: refs/heads/branch-2.5 Commit: adc1fed15f57b427ee6fbaeb4b747004492f49e4 Parents: 603c3fd Author: Venkata SairamAuthored: Thu Nov 23 15:50:22 2017 +0530 Committer: Venkata Sairam Committed: Thu Nov 23 15:50:22 2017 +0530 -- .../apache/ambari/view/utils/hdfs/HdfsApi.java| 18 -- .../apache/ambari/view/utils/hdfs/HdfsUtil.java | 17 - 2 files changed, 28 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/adc1fed1/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsApi.java -- diff --git a/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsApi.java b/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsApi.java index 90fa483..5bce7ba 100644 --- a/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsApi.java +++ b/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsApi.java @@ -386,7 +386,20 @@ public class HdfsApi { * @throws IOException * @throws InterruptedException */ - public T execute(PrivilegedExceptionAction action) + public T execute(PrivilegedExceptionAction action) throws IOException, InterruptedException { +return this.execute(action, false); + } + + + /** + * Executes action on HDFS using doAs + * @param action strategy object + * @param result type + * @return result of operation + * @throws IOException + * @throws InterruptedException + */ + public T execute(PrivilegedExceptionAction action, boolean alwaysRetry) throws IOException, InterruptedException { T result = null; @@ -401,7 +414,7 @@ public class HdfsApi { result = ugi.doAs(action); succeeded = true; } catch (IOException ex) { -if (!ex.getMessage().contains("Cannot obtain block length for")) { +if (!alwaysRetry && !ex.getMessage().contains("Cannot obtain block length for")) { throw ex; } if (tryNumber >= 3) { @@ -409,6 +422,7 @@ public class HdfsApi { } LOG.info("HDFS threw 'IOException: Cannot obtain block length' exception. " + "Retrying... Try #" + (tryNumber + 1)); +LOG.error("Retrying: " + ex.getMessage(),ex); Thread.sleep(1000); //retry after 1 second } } while (!succeeded); http://git-wip-us.apache.org/repos/asf/ambari/blob/adc1fed1/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsUtil.java -- diff --git a/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsUtil.java b/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsUtil.java index 0670f1a..810129b 100644 --- a/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsUtil.java +++ b/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsUtil.java @@ -27,6 +27,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; +import java.security.PrivilegedExceptionAction; import java.util.Map; public class HdfsUtil { @@ -38,13 +39,19 @@ public class HdfsUtil { * @param filePath path to file * @param content new content of file */ - public static void putStringToFile(HdfsApi hdfs, String filePath, String content) throws HdfsApiException { -FSDataOutputStream stream; + public static void putStringToFile(final HdfsApi hdfs,final String filePath, final String content) throws HdfsApiException { + try { synchronized (hdfs) { -stream = hdfs.create(filePath, true); -stream.write(content.getBytes()); -stream.close(); +hdfs.execute(new PrivilegedExceptionAction() { + @Override + public Void run() throws Exception { +final FSDataOutputStream stream = hdfs.create(filePath, true); +stream.write(content.getBytes()); +stream.close(); +return null; + } +}, true); } } catch (IOException e) { throw new HdfsApiException("HDFS020 Could not write file " + filePath, e);
ambari git commit: AMBARI-21569.Users randomly getting "HDFS020 Could not write file" exceptions while running query from Hive View(Venkata Sairam)
Repository: ambari Updated Branches: refs/heads/trunk 513602198 -> 8e36662ae AMBARI-21569.Users randomly getting "HDFS020 Could not write file" exceptions while running query from Hive View(Venkata Sairam) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8e36662a Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8e36662a Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8e36662a Branch: refs/heads/trunk Commit: 8e36662ae1dffe7cb637b3d1edb38278f0111012 Parents: 5136021 Author: Venkata SairamAuthored: Thu Nov 23 15:48:52 2017 +0530 Committer: Venkata Sairam Committed: Thu Nov 23 15:48:52 2017 +0530 -- .../org/apache/ambari/view/utils/hdfs/HdfsApi.java | 16 +++- .../apache/ambari/view/utils/hdfs/HdfsUtil.java| 17 - 2 files changed, 27 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/8e36662a/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsApi.java -- diff --git a/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsApi.java b/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsApi.java index 3db2081..812cd54 100644 --- a/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsApi.java +++ b/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsApi.java @@ -485,7 +485,20 @@ public class HdfsApi { * @throws IOException * @throws InterruptedException */ - public T execute(PrivilegedExceptionAction action) + public T execute(PrivilegedExceptionAction action) throws IOException, InterruptedException { +return this.execute(action, false); + } + + + /** + * Executes action on HDFS using doAs + * @param action strategy object + * @param result type + * @return result of operation + * @throws IOException + * @throws InterruptedException + */ + public T execute(PrivilegedExceptionAction action, boolean alwaysRetry) throws IOException, InterruptedException { T result = null; @@ -508,6 +521,7 @@ public class HdfsApi { } LOG.info("HDFS threw 'IOException: Cannot obtain block length' exception. " + "Retrying... Try #" + (tryNumber + 1)); +LOG.error("Retrying: " + ex.getMessage(),ex); Thread.sleep(1000); //retry after 1 second } } while (!succeeded); http://git-wip-us.apache.org/repos/asf/ambari/blob/8e36662a/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsUtil.java -- diff --git a/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsUtil.java b/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsUtil.java index 0670f1a..810129b 100644 --- a/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsUtil.java +++ b/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsUtil.java @@ -27,6 +27,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; +import java.security.PrivilegedExceptionAction; import java.util.Map; public class HdfsUtil { @@ -38,13 +39,19 @@ public class HdfsUtil { * @param filePath path to file * @param content new content of file */ - public static void putStringToFile(HdfsApi hdfs, String filePath, String content) throws HdfsApiException { -FSDataOutputStream stream; + public static void putStringToFile(final HdfsApi hdfs,final String filePath, final String content) throws HdfsApiException { + try { synchronized (hdfs) { -stream = hdfs.create(filePath, true); -stream.write(content.getBytes()); -stream.close(); +hdfs.execute(new PrivilegedExceptionAction() { + @Override + public Void run() throws Exception { +final FSDataOutputStream stream = hdfs.create(filePath, true); +stream.write(content.getBytes()); +stream.close(); +return null; + } +}, true); } } catch (IOException e) { throw new HdfsApiException("HDFS020 Could not write file " + filePath, e);
ambari git commit: AMBARI-22502.Workflow Manager View - FS node will overwrite internal commands and replace them with blank "move" commands when reopening the node(Venkata Sairam)
Repository: ambari Updated Branches: refs/heads/branch-2.6 677e27e65 -> 099e0185d AMBARI-22502.Workflow Manager View - FS node will overwrite internal commands and replace them with blank "move" commands when reopening the node(Venkata Sairam) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/099e0185 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/099e0185 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/099e0185 Branch: refs/heads/branch-2.6 Commit: 099e0185dc7d9b8d14f267dce0c113f819275ded Parents: 677e27e Author: Venkata SairamAuthored: Thu Nov 23 15:36:57 2017 +0530 Committer: Venkata Sairam Committed: Thu Nov 23 15:40:57 2017 +0530 -- .../src/main/resources/ui/app/domain/workflow-importer.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/099e0185/contrib/views/wfmanager/src/main/resources/ui/app/domain/workflow-importer.js -- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/domain/workflow-importer.js b/contrib/views/wfmanager/src/main/resources/ui/app/domain/workflow-importer.js index 84a789d..2afc304 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/domain/workflow-importer.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/domain/workflow-importer.js @@ -112,7 +112,8 @@ var WorkflowImporter= Ember.Object.extend({ if (nodeHandler){ if (Ember.isArray(workflowAppJson[key])){ workflowAppJson[key].forEach(function(jsonObj){ -var node=nodeHandler.handleImportNode(key,jsonObj,workflow,xmlDoc); +var actionDom = xmlDoc.find("action[name='" + jsonObj._name + "']"); +var node = nodeHandler.handleImportNode(key,jsonObj,workflow,actionDom); nodeMap.set(jsonObj._name,{json:jsonObj,node:node}); }); }else{
ambari git commit: AMBARI-22502.Workflow Manager View - FS node will overwrite internal commands and replace them with blank "move" commands when reopening the node(Venkata Sairam)
Repository: ambari Updated Branches: refs/heads/branch-2.5 1d19544b9 -> 603c3fd74 AMBARI-22502.Workflow Manager View - FS node will overwrite internal commands and replace them with blank "move" commands when reopening the node(Venkata Sairam) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/603c3fd7 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/603c3fd7 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/603c3fd7 Branch: refs/heads/branch-2.5 Commit: 603c3fd741d115b4009eac5fcf2faee3283f831c Parents: 1d19544 Author: Venkata SairamAuthored: Thu Nov 23 15:36:57 2017 +0530 Committer: Venkata Sairam Committed: Thu Nov 23 15:38:11 2017 +0530 -- .../src/main/resources/ui/app/domain/workflow-importer.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/603c3fd7/contrib/views/wfmanager/src/main/resources/ui/app/domain/workflow-importer.js -- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/domain/workflow-importer.js b/contrib/views/wfmanager/src/main/resources/ui/app/domain/workflow-importer.js index 84a789d..2afc304 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/domain/workflow-importer.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/domain/workflow-importer.js @@ -112,7 +112,8 @@ var WorkflowImporter= Ember.Object.extend({ if (nodeHandler){ if (Ember.isArray(workflowAppJson[key])){ workflowAppJson[key].forEach(function(jsonObj){ -var node=nodeHandler.handleImportNode(key,jsonObj,workflow,xmlDoc); +var actionDom = xmlDoc.find("action[name='" + jsonObj._name + "']"); +var node = nodeHandler.handleImportNode(key,jsonObj,workflow,actionDom); nodeMap.set(jsonObj._name,{json:jsonObj,node:node}); }); }else{
ambari git commit: AMBARI-22502.Workflow Manager View - FS node will overwrite internal commands and replace them with blank "move" commands when reopening the node(Venkata Sairam)
Repository: ambari Updated Branches: refs/heads/trunk 20dee7f81 -> 513602198 AMBARI-22502.Workflow Manager View - FS node will overwrite internal commands and replace them with blank "move" commands when reopening the node(Venkata Sairam) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/51360219 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/51360219 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/51360219 Branch: refs/heads/trunk Commit: 51360219866386d8103326def2a1d412348414ed Parents: 20dee7f Author: Venkata SairamAuthored: Thu Nov 23 15:36:57 2017 +0530 Committer: Venkata Sairam Committed: Thu Nov 23 15:36:57 2017 +0530 -- .../src/main/resources/ui/app/domain/workflow-importer.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/51360219/contrib/views/wfmanager/src/main/resources/ui/app/domain/workflow-importer.js -- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/domain/workflow-importer.js b/contrib/views/wfmanager/src/main/resources/ui/app/domain/workflow-importer.js index 84a789d..2afc304 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/domain/workflow-importer.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/domain/workflow-importer.js @@ -112,7 +112,8 @@ var WorkflowImporter= Ember.Object.extend({ if (nodeHandler){ if (Ember.isArray(workflowAppJson[key])){ workflowAppJson[key].forEach(function(jsonObj){ -var node=nodeHandler.handleImportNode(key,jsonObj,workflow,xmlDoc); +var actionDom = xmlDoc.find("action[name='" + jsonObj._name + "']"); +var node = nodeHandler.handleImportNode(key,jsonObj,workflow,actionDom); nodeMap.set(jsonObj._name,{json:jsonObj,node:node}); }); }else{
ambari git commit: AMBARI-22467. YARN, MapReduce2, Hive, and Oozie Should Conditionally Install LZO (aonishuk)
Repository: ambari Updated Branches: refs/heads/trunk 6b17d0142 -> 20dee7f81 AMBARI-22467. YARN, MapReduce2, Hive, and Oozie Should Conditionally Install LZO (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/20dee7f8 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/20dee7f8 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/20dee7f8 Branch: refs/heads/trunk Commit: 20dee7f817d412088e1ba41a341a9fb5bbf33080 Parents: 6b17d01 Author: Andrew OnishukAuthored: Thu Nov 23 10:38:35 2017 +0200 Committer: Andrew Onishuk Committed: Thu Nov 23 10:38:35 2017 +0200 -- .../common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py| 1 - .../common-services/OOZIE/4.2.0.3.0/package/scripts/oozie.py| 1 - 2 files changed, 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/20dee7f8/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py -- diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py index e9d48c0..29813d3 100644 --- a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py +++ b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py @@ -193,7 +193,6 @@ def oozie(is_server=False, upgrade_type=None): if params.lzo_enabled: install_lzo_if_needed() Execute(format('{sudo} cp {hadoop_lib_home}/hadoop-lzo*.jar {oozie_lib_dir}'), - not_if = no_op_test, ) if is_server: http://git-wip-us.apache.org/repos/asf/ambari/blob/20dee7f8/ambari-server/src/main/resources/common-services/OOZIE/4.2.0.3.0/package/scripts/oozie.py -- diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.2.0.3.0/package/scripts/oozie.py b/ambari-server/src/main/resources/common-services/OOZIE/4.2.0.3.0/package/scripts/oozie.py index 1db16a9..96f1f1a 100644 --- a/ambari-server/src/main/resources/common-services/OOZIE/4.2.0.3.0/package/scripts/oozie.py +++ b/ambari-server/src/main/resources/common-services/OOZIE/4.2.0.3.0/package/scripts/oozie.py @@ -193,7 +193,6 @@ def oozie(is_server=False): if params.lzo_enabled: install_lzo_if_needed() Execute(format('{sudo} cp {hadoop_lib_home}/hadoop-lzo*.jar {oozie_lib_dir}'), - not_if = no_op_test, ) if is_server:
ambari git commit: AMBARI-22467. YARN, MapReduce2, Hive, and Oozie Should Conditionally Install LZO (aonishuk)
Repository: ambari Updated Branches: refs/heads/branch-feature-AMBARI-22457 854182987 -> bc8b3916b AMBARI-22467. YARN, MapReduce2, Hive, and Oozie Should Conditionally Install LZO (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/bc8b3916 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/bc8b3916 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/bc8b3916 Branch: refs/heads/branch-feature-AMBARI-22457 Commit: bc8b3916b8899b0629768ad9f308ac013edcf01c Parents: 8541829 Author: Andrew OnishukAuthored: Thu Nov 23 10:26:46 2017 +0200 Committer: Andrew Onishuk Committed: Thu Nov 23 10:36:29 2017 +0200 -- .../common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py| 1 - 1 file changed, 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/bc8b3916/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py -- diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py index 2316f79..9297337 100644 --- a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py +++ b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py @@ -192,7 +192,6 @@ def oozie(is_server=False, upgrade_type=None): if params.lzo_enabled: install_lzo_if_needed() Execute(format('{sudo} cp {hadoop_lib_home}/hadoop-lzo*.jar {oozie_lib_dir}'), - not_if = no_op_test, ) if is_server: