ambari git commit: AMBARI-18551. Enhance falcon integration to call falcon-config to make sure WEB-INF/lib is present in all cases (Venkat Ranganathan via alejandro)
Repository: ambari Updated Branches: refs/heads/trunk 569020caf -> 72f1f6f63 AMBARI-18551. Enhance falcon integration to call falcon-config to make sure WEB-INF/lib is present in all cases (Venkat Ranganathan via alejandro) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/72f1f6f6 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/72f1f6f6 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/72f1f6f6 Branch: refs/heads/trunk Commit: 72f1f6f635b74e4fe3f5e21fed2d3a60aa6de0ad Parents: 569020c Author: Alejandro FernandezAuthored: Fri Oct 7 16:29:43 2016 -0700 Committer: Alejandro Fernandez Committed: Fri Oct 7 16:29:43 2016 -0700 -- .../FALCON/0.5.0.2.1/package/scripts/falcon.py| 11 +++ .../OOZIE/4.0.0.2.0/package/scripts/oozie_service.py | 2 +- .../python/stacks/2.1/FALCON/test_falcon_server.py| 14 ++ 3 files changed, 26 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/72f1f6f6/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon.py -- diff --git a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon.py b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon.py index 2ac79cb..3ecb65b 100644 --- a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon.py +++ b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon.py @@ -216,6 +216,17 @@ def falcon(type, action = None, upgrade_type=None): process_exists = format("ls {server_pid_file} && ps -p {pid}") if action == 'start': + try: +Execute(format('{falcon_home}/bin/falcon-config.sh server falcon'), + user = params.falcon_user, + path = params.hadoop_bin_dir, + environment=environment_dictionary, + not_if = process_exists, +) + except: +show_logs(params.falcon_log_dir, params.falcon_user) +raise + if not os.path.exists(params.target_jar_file): try : File(params.target_jar_file, http://git-wip-us.apache.org/repos/asf/ambari/blob/72f1f6f6/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_service.py -- diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_service.py b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_service.py index 3257653..a5bd59d 100644 --- a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_service.py +++ b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_service.py @@ -28,7 +28,7 @@ from resource_management.core import sudo from resource_management.core.shell import as_user from resource_management.core.logger import Logger from resource_management.core.resources.service import Service -from resource_management.core.resources.system import Execute, File +from resource_management.core.resources.system import Execute, File, Directory from resource_management.libraries.functions.format import format from resource_management.libraries.functions.show_logs import show_logs from resource_management.libraries.providers.hdfs_resource import WebHDFSUtil http://git-wip-us.apache.org/repos/asf/ambari/blob/72f1f6f6/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py -- diff --git a/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py b/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py index ab053b7..4ad5c0f 100644 --- a/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py +++ b/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py @@ -43,6 +43,13 @@ class TestFalconServer(RMFTestCase): self.assert_configure_default() +self.assertResourceCalled('Execute', '/usr/lib/falcon/bin/falcon-config.sh server falcon', + path = ['/usr/bin'], + user = 'falcon', + environment = {'HADOOP_HOME': '/usr/lib/hadoop'}, + not_if = 'ls /var/run/falcon/falcon.pid && ps -p ', +) + self.assertResourceCalled('File', '/usr/lib/falcon/server/webapp/falcon/WEB-INF/lib/je-5.0.73.jar', content=DownloadSource('http://c6401.ambari.apache.org:8080/resources//je-5.0.73.jar'), mode=0755 @@ -374,6 +381,13 @@ class TestFalconServer(RMFTestCase): create_parents = True, ) +
ambari git commit: AMBARI-18540: Unit test cases required for verifying Ambari username case sensitivity
Repository: ambari Updated Branches: refs/heads/trunk 8813b1f92 -> 569020caf AMBARI-18540: Unit test cases required for verifying Ambari username case sensitivity Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/569020ca Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/569020ca Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/569020ca Branch: refs/heads/trunk Commit: 569020caf1c6f39765d7da9efb8c57b66293844e Parents: 8813b1f Author: Nahappan SomasundaramAuthored: Wed Oct 5 17:25:20 2016 -0700 Committer: Nahappan Somasundaram Committed: Fri Oct 7 14:22:27 2016 -0700 -- .../internal/UserResourceProviderDBTest.java| 280 +++ 1 file changed, 280 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/569020ca/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UserResourceProviderDBTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UserResourceProviderDBTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UserResourceProviderDBTest.java new file mode 100644 index 000..1629b49 --- /dev/null +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UserResourceProviderDBTest.java @@ -0,0 +1,280 @@ +/** + * 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.controller.internal; + +import com.google.inject.Guice; +import com.google.inject.Injector; +import com.google.inject.persist.PersistService; +import org.apache.ambari.server.configuration.Configuration; +import org.apache.ambari.server.controller.AmbariManagementController; +import org.apache.ambari.server.controller.spi.Predicate; +import org.apache.ambari.server.controller.spi.Request; +import org.apache.ambari.server.controller.spi.RequestStatus; +import org.apache.ambari.server.controller.spi.Resource; +import org.apache.ambari.server.controller.utilities.PredicateBuilder; +import org.apache.ambari.server.controller.utilities.PropertyHelper; +import org.apache.ambari.server.orm.InMemoryDefaultTestModule; +import org.apache.ambari.server.security.TestAuthenticationFactory; +import org.apache.ambari.server.security.authorization.AuthorizationHelper; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.context.SecurityContextHolder; + +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.assertEquals; + +/** + * Tests creation, retrieval and deletion of users using an in-memory database. + * Also tests user creation and retrieval using usernames that differ only by case. + * Verifies that usernames are stored as provided. + */ +@PrepareForTest({AuthorizationHelper.class}) +public class UserResourceProviderDBTest { +private static Injector injector; +private static AmbariManagementController amc; +private static Resource.Type userType = Resource.Type.User; +private static UserResourceProvider userResourceProvider; +private static String JDBC_IN_MEMORY_URL_CREATE = +String.format("jdbc:derby:memory:myDB/%s;create=true", Configuration.DEFAULT_DERBY_SCHEMA); +private static String JDBC_IN_MEMORY_URL_DROP = +String.format("jdbc:derby:memory:myDB/%s;drop=true", Configuration.DEFAULT_DERBY_SCHEMA); + +/** + * Sets up the in-memory database for the test suite. + */ +@BeforeClass +public static
ambari git commit: AMBARI-18540: Unit test cases required for verifying Ambari username case sensitivity
Repository: ambari Updated Branches: refs/heads/branch-2.5 13d3b8b06 -> b5f74e059 AMBARI-18540: Unit test cases required for verifying Ambari username case sensitivity Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b5f74e05 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b5f74e05 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b5f74e05 Branch: refs/heads/branch-2.5 Commit: b5f74e059edec1d8fd4573d6a192eef53ed7b576 Parents: 13d3b8b Author: Nahappan SomasundaramAuthored: Wed Oct 5 17:25:20 2016 -0700 Committer: Nahappan Somasundaram Committed: Fri Oct 7 14:18:52 2016 -0700 -- .../internal/UserResourceProviderDBTest.java| 280 +++ 1 file changed, 280 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/b5f74e05/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UserResourceProviderDBTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UserResourceProviderDBTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UserResourceProviderDBTest.java new file mode 100644 index 000..1629b49 --- /dev/null +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UserResourceProviderDBTest.java @@ -0,0 +1,280 @@ +/** + * 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.controller.internal; + +import com.google.inject.Guice; +import com.google.inject.Injector; +import com.google.inject.persist.PersistService; +import org.apache.ambari.server.configuration.Configuration; +import org.apache.ambari.server.controller.AmbariManagementController; +import org.apache.ambari.server.controller.spi.Predicate; +import org.apache.ambari.server.controller.spi.Request; +import org.apache.ambari.server.controller.spi.RequestStatus; +import org.apache.ambari.server.controller.spi.Resource; +import org.apache.ambari.server.controller.utilities.PredicateBuilder; +import org.apache.ambari.server.controller.utilities.PropertyHelper; +import org.apache.ambari.server.orm.InMemoryDefaultTestModule; +import org.apache.ambari.server.security.TestAuthenticationFactory; +import org.apache.ambari.server.security.authorization.AuthorizationHelper; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.context.SecurityContextHolder; + +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.assertEquals; + +/** + * Tests creation, retrieval and deletion of users using an in-memory database. + * Also tests user creation and retrieval using usernames that differ only by case. + * Verifies that usernames are stored as provided. + */ +@PrepareForTest({AuthorizationHelper.class}) +public class UserResourceProviderDBTest { +private static Injector injector; +private static AmbariManagementController amc; +private static Resource.Type userType = Resource.Type.User; +private static UserResourceProvider userResourceProvider; +private static String JDBC_IN_MEMORY_URL_CREATE = +String.format("jdbc:derby:memory:myDB/%s;create=true", Configuration.DEFAULT_DERBY_SCHEMA); +private static String JDBC_IN_MEMORY_URL_DROP = +String.format("jdbc:derby:memory:myDB/%s;drop=true", Configuration.DEFAULT_DERBY_SCHEMA); + +/** + * Sets up the in-memory database for the test suite. + */ +@BeforeClass +
ambari git commit: AMBARI-18245 Upgrade node to version 4.x (zhewang)
Repository: ambari Updated Branches: refs/heads/branch-feature-AMBARI-18245 [created] 2d6722d19 AMBARI-18245 Upgrade node to version 4.x (zhewang) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2d6722d1 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2d6722d1 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2d6722d1 Branch: refs/heads/branch-feature-AMBARI-18245 Commit: 2d6722d19a928aa2aa4fcf22045912e76a425dc9 Parents: 13d3b8b Author: Zhe (Joe) WangAuthored: Fri Oct 7 13:30:59 2016 -0700 Committer: Zhe (Joe) Wang Committed: Fri Oct 7 13:30:59 2016 -0700 -- .gitignore | 1 + ambari-admin/pom.xml| 2 +- ambari-web/app/styles/common.less | 10 +++--- ambari-web/package.json | 6 ++-- ambari-web/pom.xml | 36 contrib/views/capacity-scheduler/pom.xml| 4 +-- .../src/main/resources/ui/package.json | 2 +- contrib/views/files/pom.xml | 4 +-- contrib/views/hawq/pom.xml | 2 +- contrib/views/hive-next/pom.xml | 4 +-- .../src/main/resources/ui/hive-web/package.json | 2 +- contrib/views/hive/pom.xml | 4 +-- .../src/main/resources/ui/hive-web/package.json | 2 +- contrib/views/hueambarimigration/pom.xml| 4 +-- contrib/views/jobs/pom.xml | 4 +-- contrib/views/pig/pom.xml | 4 +-- .../src/main/resources/ui/pig-web/package.json | 2 +- contrib/views/wfmanager/pom.xml | 4 +-- 18 files changed, 61 insertions(+), 36 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/2d6722d1/.gitignore -- diff --git a/.gitignore b/.gitignore index d9f23de..43edfd9 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ target /ambari-web/npm-debug.log /ambari-web/public/ /ambari-web/node_modules/ +/ambari-web/node/ *.pyc *.py~ *.iml http://git-wip-us.apache.org/repos/asf/ambari/blob/2d6722d1/ambari-admin/pom.xml -- diff --git a/ambari-admin/pom.xml b/ambari-admin/pom.xml index e42e5a5..97d5fd4 100644 --- a/ambari-admin/pom.xml +++ b/ambari-admin/pom.xml @@ -63,7 +63,7 @@ frontend-maven-plugin 0.0.16 - v0.10.44 + v4.5.0 2.15.0 src/main/resources/ui/admin-web/ http://git-wip-us.apache.org/repos/asf/ambari/blob/2d6722d1/ambari-web/app/styles/common.less -- diff --git a/ambari-web/app/styles/common.less b/ambari-web/app/styles/common.less index bc11d4d..7941fc7 100644 --- a/ambari-web/app/styles/common.less +++ b/ambari-web/app/styles/common.less @@ -47,19 +47,19 @@ @spinner-small-width: 30px; @spinner-small-height: 30px; -(~".@{health-status-red-icon}") { +.@{health-status-red-icon} { color: @health-status-red; } -(~".@{health-status-green-icon}") { +.@{health-status-green-icon} { color: @health-status-green; } -(~".@{health-status-yellow-icon}") { +.@{health-status-yellow-icon} { color: @health-status-yellow; } -(~".@{health-status-orange-icon}") { +.@{health-status-orange-icon} { color: @health-status-orange; } -(~".@{maintenance-icon}") { +.@{maintenance-icon} { color: @maintenance-black; } http://git-wip-us.apache.org/repos/asf/ambari/blob/2d6722d1/ambari-web/package.json -- diff --git a/ambari-web/package.json b/ambari-web/package.json index 550d293..02b3e77 100644 --- a/ambari-web/package.json +++ b/ambari-web/package.json @@ -12,7 +12,7 @@ "css-brunch": ">= 1.0 < 1.5", "uglify-js-brunch": ">= 1.0 < 1.5", "clean-css-brunch": ">= 1.0 < 1.5", -"ember-precompiler-brunch": ">= 1.0 < 1.5", +"ember-precompile-brunch": "^0.1.0", "ember-radio-button": "0.1.2", "less-brunch": ">= 1.0 < 1.5", "cssstyle": "0.2.3" @@ -25,7 +25,7 @@ "sinon":"=1.7.3", "sinon-chai":"~2.5.0", "express":"2.5.8", -"karma": "=0.11.14", +"karma": ">=0.11.14", "karma-mocha": "0.1.1", "karma-chai": "~0.1.0", "karma-sinon": "~1.0.2", @@ -39,6 +39,6 @@ "test": "mocha-phantomjs -R min public/test/test.html" }, "engines": { -"node": "~0.6.10 || 0.8 || 0.9 || 0.10" +"node": "^4.0.0" } } http://git-wip-us.apache.org/repos/asf/ambari/blob/2d6722d1/ambari-web/pom.xml -- diff --git a/ambari-web/pom.xml
[ambari] Git Push Summary
Repository: ambari Updated Branches: refs/heads/branch-feature-AMBARI-18245 [deleted] e84bc78e6
ambari git commit: AMBARI-18245 Upgrade node to version 4.x (zhewang)
Repository: ambari Updated Branches: refs/heads/branch-feature-AMBARI-18245 8813b1f92 -> e84bc78e6 AMBARI-18245 Upgrade node to version 4.x (zhewang) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e84bc78e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e84bc78e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e84bc78e Branch: refs/heads/branch-feature-AMBARI-18245 Commit: e84bc78e6d6416a5c7ecb14772a686a5af0e9f72 Parents: 8813b1f Author: Zhe (Joe) WangAuthored: Fri Oct 7 13:20:39 2016 -0700 Committer: Zhe (Joe) Wang Committed: Fri Oct 7 13:20:39 2016 -0700 -- .gitignore | 1 + ambari-admin/pom.xml| 2 +- ambari-web/app/styles/common.less | 10 +++--- ambari-web/package.json | 6 ++-- ambari-web/pom.xml | 36 contrib/views/capacity-scheduler/pom.xml| 4 +-- .../src/main/resources/ui/package.json | 2 +- contrib/views/files/pom.xml | 4 +-- contrib/views/hawq/pom.xml | 2 +- contrib/views/hive-next/pom.xml | 4 +-- .../src/main/resources/ui/hive-web/package.json | 2 +- contrib/views/hive/pom.xml | 4 +-- .../src/main/resources/ui/hive-web/package.json | 2 +- contrib/views/hueambarimigration/pom.xml| 4 +-- contrib/views/jobs/pom.xml | 4 +-- contrib/views/pig/pom.xml | 4 +-- .../src/main/resources/ui/pig-web/package.json | 2 +- contrib/views/wfmanager/pom.xml | 4 +-- 18 files changed, 61 insertions(+), 36 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/e84bc78e/.gitignore -- diff --git a/.gitignore b/.gitignore index d9f23de..43edfd9 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ target /ambari-web/npm-debug.log /ambari-web/public/ /ambari-web/node_modules/ +/ambari-web/node/ *.pyc *.py~ *.iml http://git-wip-us.apache.org/repos/asf/ambari/blob/e84bc78e/ambari-admin/pom.xml -- diff --git a/ambari-admin/pom.xml b/ambari-admin/pom.xml index e057178..4a8bba3 100644 --- a/ambari-admin/pom.xml +++ b/ambari-admin/pom.xml @@ -63,7 +63,7 @@ frontend-maven-plugin 0.0.16 - v0.10.44 + v4.5.0 2.15.0 src/main/resources/ui/admin-web/ http://git-wip-us.apache.org/repos/asf/ambari/blob/e84bc78e/ambari-web/app/styles/common.less -- diff --git a/ambari-web/app/styles/common.less b/ambari-web/app/styles/common.less index bc11d4d..7941fc7 100644 --- a/ambari-web/app/styles/common.less +++ b/ambari-web/app/styles/common.less @@ -47,19 +47,19 @@ @spinner-small-width: 30px; @spinner-small-height: 30px; -(~".@{health-status-red-icon}") { +.@{health-status-red-icon} { color: @health-status-red; } -(~".@{health-status-green-icon}") { +.@{health-status-green-icon} { color: @health-status-green; } -(~".@{health-status-yellow-icon}") { +.@{health-status-yellow-icon} { color: @health-status-yellow; } -(~".@{health-status-orange-icon}") { +.@{health-status-orange-icon} { color: @health-status-orange; } -(~".@{maintenance-icon}") { +.@{maintenance-icon} { color: @maintenance-black; } http://git-wip-us.apache.org/repos/asf/ambari/blob/e84bc78e/ambari-web/package.json -- diff --git a/ambari-web/package.json b/ambari-web/package.json index 6702471..68798fb 100644 --- a/ambari-web/package.json +++ b/ambari-web/package.json @@ -13,7 +13,7 @@ "css-brunch": ">= 1.0 < 1.5", "uglify-js-brunch": ">= 1.0 < 1.5", "clean-css-brunch": ">= 1.0 < 1.5", -"ember-precompiler-brunch": ">= 1.0 < 1.5", +"ember-precompile-brunch": "^0.1.0", "ember-radio-button": "0.1.2", "less-brunch": ">= 1.0 < 1.5", "cssstyle": "0.2.3" @@ -26,7 +26,7 @@ "sinon":"=1.7.3", "sinon-chai":"~2.5.0", "express":"2.5.8", -"karma": "=0.11.14", +"karma": ">=0.11.14", "karma-mocha": "0.1.1", "karma-chai": "~0.1.0", "karma-sinon": "~1.0.2", @@ -40,6 +40,6 @@ "test": "mocha-phantomjs -R min public/test/test.html" }, "engines": { -"node": "~0.6.10 || 0.8 || 0.9 || 0.10" +"node": "^4.0.0" } } http://git-wip-us.apache.org/repos/asf/ambari/blob/e84bc78e/ambari-web/pom.xml -- diff --git a/ambari-web/pom.xml
[ambari] Git Push Summary
Repository: ambari Updated Branches: refs/heads/branch-feature-AMBARI-18245 [created] 8813b1f92
[4/4] ambari git commit: Merge branch 'trunk' into branch-feature-AMBARI-18456
Merge branch 'trunk' into branch-feature-AMBARI-18456 Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/fbfcf98a Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/fbfcf98a Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/fbfcf98a Branch: refs/heads/branch-feature-AMBARI-18456 Commit: fbfcf98abd5b8ced11b9b5ef35f73a9d319d0c5e Parents: 197a37f 8813b1f Author: Jonathan HurleyAuthored: Fri Oct 7 15:58:00 2016 -0400 Committer: Jonathan Hurley Committed: Fri Oct 7 15:58:00 2016 -0400 -- .../server/state/DependencyConditionInfo.java | 102 --- .../ambari/server/state/DependencyInfo.java | 36 +-- .../server/topology/BlueprintValidatorImpl.java | 13 --- .../common-services/HDFS/2.1.0.2.0/metainfo.xml | 44 .../topology/BlueprintValidatorImplTest.java| 75 +- .../ambari/view/hive2/ConnectionFactory.java| 37 --- .../ambari/view/hive2/PropertyValidator.java| 8 ++ .../savedQueries/SavedQueryService.java | 47 - .../ui/hive-web/app/controllers/queries.js | 24 - .../ui/hive-web/app/initializers/i18n.js| 5 + .../views/hive-next/src/main/resources/view.xml | 9 ++ .../savedQueries/SavedQueryService.java | 48 +++-- .../ui/hive-web/app/controllers/queries.js | 22 +++- .../ui/hive-web/app/initializers/i18n.js| 5 +- .../savedQueries/SavedQueryServiceTest.java | 16 ++- 15 files changed, 193 insertions(+), 298 deletions(-) --
[1/4] ambari git commit: Revert "AMBARI-18355: Introduce conditional dependencies in stack defition to handle blueprint validation gracefully (Amruta Borkar via dili)"
Repository: ambari Updated Branches: refs/heads/branch-feature-AMBARI-18456 197a37f03 -> fbfcf98ab Revert "AMBARI-18355: Introduce conditional dependencies in stack defition to handle blueprint validation gracefully (Amruta Borkar via dili)" This reverts commit f6124a056d2a8ed16bec917775b9d3554ab5d74d. Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e0d4a871 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e0d4a871 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e0d4a871 Branch: refs/heads/branch-feature-AMBARI-18456 Commit: e0d4a8713ed0ffe86acd18bd798c317d5e51a61c Parents: f6124a0 Author: Jonathan HurleyAuthored: Fri Oct 7 15:36:00 2016 -0400 Committer: Jonathan Hurley Committed: Fri Oct 7 15:36:00 2016 -0400 -- .../server/state/DependencyConditionInfo.java | 102 --- .../ambari/server/state/DependencyInfo.java | 36 +-- .../server/topology/BlueprintValidatorImpl.java | 13 --- .../common-services/HDFS/2.1.0.2.0/metainfo.xml | 44 .../topology/BlueprintValidatorImplTest.java| 75 +- 5 files changed, 2 insertions(+), 268 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/e0d4a871/ambari-server/src/main/java/org/apache/ambari/server/state/DependencyConditionInfo.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/DependencyConditionInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/state/DependencyConditionInfo.java deleted file mode 100644 index 84e186f..000 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/DependencyConditionInfo.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ambari.server.state; - -import java.util.Map; -import java.util.Objects; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.adapters.XmlAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - -import org.apache.commons.lang.NotImplementedException; - -/** - * Represents stack component dependency condition information. - */ -@XmlJavaTypeAdapter(DependencyConditionAdapter.class) -public abstract class DependencyConditionInfo { -public abstract boolean isResolved(Map > properties); -} - -class PropertyExistsDependencyCondition extends DependencyConditionInfo{ - -protected final String configType; -protected final String property; -public PropertyExistsDependencyCondition( String configType, String property) { -this.configType = Objects.requireNonNull(configType, "Config Type must not be null."); -this.property = Objects.requireNonNull(property, "Property Name must not be null."); -} - -@Override -public boolean isResolved(Map > properties) { -return (properties.get(configType).containsKey(property)); -} -} - -class PropertyValueEqualsDependencyCondition extends PropertyExistsDependencyCondition { - -protected final String propertyValue; -public PropertyValueEqualsDependencyCondition(String configType, String property, String propertyValue) { -super(configType, property); -this.propertyValue = Objects.requireNonNull(propertyValue, "Property value must not be null."); -} - -@Override -public boolean isResolved(Map > properties) { -return (super.isResolved(properties) && propertyValue.equals(properties.get(configType).get(property))); -} -} - -class DependencyConditionAdapter extends XmlAdapter { - -static class AdaptedDependencyCondition{ -@XmlElement -private String configType; -@XmlElement -private String property; -@XmlElement -
[3/4] ambari git commit: AMBARI-18496. Include an option to download the saved query in hive view. (Anita Gnanamalar Jebaraj via dipayanb)
AMBARI-18496. Include an option to download the saved query in hive view. (Anita Gnanamalar Jebaraj via dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8813b1f9 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8813b1f9 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8813b1f9 Branch: refs/heads/branch-feature-AMBARI-18456 Commit: 8813b1f9295f052a0f28ac622fdd214964cec7c6 Parents: e7074ec Author: Dipayan BhowmickAuthored: Sat Oct 8 01:16:16 2016 +0530 Committer: Dipayan Bhowmick Committed: Sat Oct 8 01:17:39 2016 +0530 -- .../savedQueries/SavedQueryService.java | 47 +-- .../ui/hive-web/app/controllers/queries.js | 24 +- .../ui/hive-web/app/initializers/i18n.js| 5 ++ .../savedQueries/SavedQueryService.java | 48 +--- .../ui/hive-web/app/controllers/queries.js | 22 - .../ui/hive-web/app/initializers/i18n.js| 5 +- .../savedQueries/SavedQueryServiceTest.java | 16 +-- 7 files changed, 149 insertions(+), 18 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/8813b1f9/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/savedQueries/SavedQueryService.java -- diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/savedQueries/SavedQueryService.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/savedQueries/SavedQueryService.java index ccc4512..9b844d6 100644 --- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/savedQueries/SavedQueryService.java +++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/savedQueries/SavedQueryService.java @@ -37,7 +37,16 @@ import javax.ws.rs.*; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; +import javax.ws.rs.core.StreamingOutput; import javax.ws.rs.core.UriInfo; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.InputStreamReader; +import java.io.IOException; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.Writer; import java.util.List; /** @@ -73,12 +82,40 @@ public class SavedQueryService extends BaseService { @GET @Path("{queryId}") @Produces(MediaType.APPLICATION_JSON) - public Response getOne(@PathParam("queryId") String queryId) { + public Response getOne(@PathParam("queryId") String queryId, +@QueryParam("op") String operation) { try { - SavedQuery savedQuery = getResourceManager().read(queryId); - JSONObject object = new JSONObject(); - object.put("savedQuery", savedQuery); - return Response.ok(object).build(); + final SavedQuery savedQuery = getResourceManager().read(queryId); + if(operation.equals("download")) { + StreamingOutput stream = new StreamingOutput() { + @Override + public void write(OutputStream os) throws IOException, WebApplicationException { + Writer writer = new BufferedWriter(new OutputStreamWriter(os)); + try { +BufferedReader br=new BufferedReader(new InputStreamReader(getSharedObjectsFactory().getHdfsApi().open(savedQuery.getQueryFile(; + String line; + line=br.readLine(); + while (line != null){ + writer.write(line+"\n"); + line = br.readLine(); +} +writer.flush(); + } catch (InterruptedException e) { + e.printStackTrace(); + } finally { + writer.close(); + } + } + }; + return Response.ok(stream). + type(MediaType.TEXT_PLAIN). + build(); + } + else { +JSONObject object = new JSONObject(); + object.put("savedQuery", savedQuery); + return Response.ok(object).build(); + } } catch (WebApplicationException ex) { throw ex; } catch (ItemNotFound itemNotFound) { http://git-wip-us.apache.org/repos/asf/ambari/blob/8813b1f9/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/queries.js -- diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/queries.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/queries.js index cbf6b42..4438c5a 100644 --- a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/queries.js +++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/queries.js @@
[2/4] ambari git commit: AMBARI-18437. Hive view not working on LLAP enabled cluster. (dipayanb)
AMBARI-18437. Hive view not working on LLAP enabled cluster. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e7074eca Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e7074eca Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e7074eca Branch: refs/heads/branch-feature-AMBARI-18456 Commit: e7074ecab2960ea3b8ab9396156413529cff3085 Parents: e0d4a87 Author: Dipayan BhowmickAuthored: Sat Oct 8 01:05:04 2016 +0530 Committer: Dipayan Bhowmick Committed: Sat Oct 8 01:07:32 2016 +0530 -- .../ambari/view/hive2/ConnectionFactory.java| 37 +--- .../ambari/view/hive2/PropertyValidator.java| 8 + .../views/hive-next/src/main/resources/view.xml | 9 + 3 files changed, 42 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/e7074eca/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/ConnectionFactory.java -- diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/ConnectionFactory.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/ConnectionFactory.java index 7295f3a..8fefe15 100644 --- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/ConnectionFactory.java +++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/ConnectionFactory.java @@ -33,7 +33,7 @@ public class ConnectionFactory { private static final String ZK_HIVE_NAMESPACE_KEY = "hive.server2.zookeeper.namespace"; private static final String ZK_HIVE_QUORUM = "hive.zookeeper.quorum"; - private static final String AMBARI_HIVE_SERVICE_NAME = "HIVE"; + private static final String AMBARI_HIVE_SERVICE_NAME = "HIVE"; private static final String AMBARI_HIVESERVER_COMPONENT_NAME = "HIVE_SERVER"; private static final String HIVE_SITE = "hive-site"; @@ -47,6 +47,7 @@ public class ConnectionFactory { private static final String HIVE_TRANSPORT_MODE_KEY = "hive.server2.transport.mode"; private static final String HTTP_PATH_KEY = "hive.server2.thrift.http.path"; private static final String HS2_PROXY_USER = "hive.server2.proxy.user"; + private static final String USE_HIVE_INTERACTIVE_MODE = "use.hive.interactive.mode"; public static ConnectionConfig create(ViewContext context) { @@ -66,9 +67,16 @@ public class ConnectionFactory { } private static String getFromHiveConfiguration(ViewContext context) { +boolean useLLAP = Boolean.valueOf(context.getProperties().get(USE_HIVE_INTERACTIVE_MODE)); String transportMode = context.getCluster().getConfigurationValue(HIVE_SITE, HIVE_TRANSPORT_MODE_KEY); String binaryPort = context.getCluster().getConfigurationValue(HIVE_SITE, BINARY_PORT_KEY); String httpPort = context.getCluster().getConfigurationValue(HIVE_SITE, HTTP_PORT_KEY); +if (useLLAP) { + binaryPort = context.getCluster().getConfigurationValue(HIVE_INTERACTIVE_SITE, BINARY_PORT_KEY); + httpPort = context.getCluster().getConfigurationValue(HIVE_INTERACTIVE_SITE, HTTP_PORT_KEY); +} + + String pathKey = context.getCluster().getConfigurationValue(HIVE_SITE, HTTP_PATH_KEY); List hiveHosts = context.getCluster().getHostsForServiceComponent(AMBARI_HIVE_SERVICE_NAME, AMBARI_HIVESERVER_COMPONENT_NAME); String sessionParams = context.getProperties().get(HIVE_SESSION_PARAMS); @@ -87,9 +95,10 @@ public class ConnectionFactory { StringBuilder builder = new StringBuilder(); builder.append("jdbc:hive2://") - .append(concatHostPorts) - .append(";") - .append(sessionParams); +.append(concatHostPorts); +if(!Strings.isNullOrEmpty(sessionParams)) { + builder.append(";").append(sessionParams); +} if (!isBinary) { builder.append(";").append("transportMode=http;httpPath=").append(pathKey); @@ -99,27 +108,31 @@ public class ConnectionFactory { } private static String getFromClusterZookeeperConfig(ViewContext context) { +boolean useLLAP = Boolean.valueOf(context.getProperties().get(USE_HIVE_INTERACTIVE_MODE)); String quorum = context.getCluster().getConfigurationValue(HIVE_SITE, ZK_HIVE_QUORUM); -if (quorum == null) { - quorum = context.getCluster().getConfigurationValue(HIVE_INTERACTIVE_SITE, ZK_HIVE_QUORUM); -} String namespace = context.getCluster().getConfigurationValue(HIVE_SITE, ZK_HIVE_NAMESPACE_KEY); -if (namespace == null) { +if (useLLAP) { namespace = context.getCluster().getConfigurationValue(HIVE_INTERACTIVE_SITE, ZK_HIVE_NAMESPACE_KEY); } String sessionParams = context.getProperties().get(HIVE_SESSION_PARAMS); String
ambari git commit: AMBARI-18496. Include an option to download the saved query in hive view. (Anita Gnanamalar Jebaraj via dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 061693de1 -> 13d3b8b06 AMBARI-18496. Include an option to download the saved query in hive view. (Anita Gnanamalar Jebaraj via dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/13d3b8b0 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/13d3b8b0 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/13d3b8b0 Branch: refs/heads/branch-2.5 Commit: 13d3b8b0616dd7203d25956ca198ea384f646204 Parents: 061693d Author: Dipayan BhowmickAuthored: Sat Oct 8 01:16:16 2016 +0530 Committer: Dipayan Bhowmick Committed: Sat Oct 8 01:16:16 2016 +0530 -- .../savedQueries/SavedQueryService.java | 47 +-- .../ui/hive-web/app/controllers/queries.js | 24 +- .../ui/hive-web/app/initializers/i18n.js| 5 ++ .../savedQueries/SavedQueryService.java | 48 +--- .../ui/hive-web/app/controllers/queries.js | 22 - .../ui/hive-web/app/initializers/i18n.js| 5 +- .../savedQueries/SavedQueryServiceTest.java | 16 +-- 7 files changed, 149 insertions(+), 18 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/13d3b8b0/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/savedQueries/SavedQueryService.java -- diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/savedQueries/SavedQueryService.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/savedQueries/SavedQueryService.java index ccc4512..9b844d6 100644 --- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/savedQueries/SavedQueryService.java +++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/savedQueries/SavedQueryService.java @@ -37,7 +37,16 @@ import javax.ws.rs.*; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; +import javax.ws.rs.core.StreamingOutput; import javax.ws.rs.core.UriInfo; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.InputStreamReader; +import java.io.IOException; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.Writer; import java.util.List; /** @@ -73,12 +82,40 @@ public class SavedQueryService extends BaseService { @GET @Path("{queryId}") @Produces(MediaType.APPLICATION_JSON) - public Response getOne(@PathParam("queryId") String queryId) { + public Response getOne(@PathParam("queryId") String queryId, +@QueryParam("op") String operation) { try { - SavedQuery savedQuery = getResourceManager().read(queryId); - JSONObject object = new JSONObject(); - object.put("savedQuery", savedQuery); - return Response.ok(object).build(); + final SavedQuery savedQuery = getResourceManager().read(queryId); + if(operation.equals("download")) { + StreamingOutput stream = new StreamingOutput() { + @Override + public void write(OutputStream os) throws IOException, WebApplicationException { + Writer writer = new BufferedWriter(new OutputStreamWriter(os)); + try { +BufferedReader br=new BufferedReader(new InputStreamReader(getSharedObjectsFactory().getHdfsApi().open(savedQuery.getQueryFile(; + String line; + line=br.readLine(); + while (line != null){ + writer.write(line+"\n"); + line = br.readLine(); +} +writer.flush(); + } catch (InterruptedException e) { + e.printStackTrace(); + } finally { + writer.close(); + } + } + }; + return Response.ok(stream). + type(MediaType.TEXT_PLAIN). + build(); + } + else { +JSONObject object = new JSONObject(); + object.put("savedQuery", savedQuery); + return Response.ok(object).build(); + } } catch (WebApplicationException ex) { throw ex; } catch (ItemNotFound itemNotFound) { http://git-wip-us.apache.org/repos/asf/ambari/blob/13d3b8b0/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/queries.js -- diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/queries.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/queries.js index cbf6b42..4438c5a 100644 --- a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/queries.js +++
ambari git commit: AMBARI-18496. Include an option to download the saved query in hive view. (Anita Gnanamalar Jebaraj via dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk e7074ecab -> 8813b1f92 AMBARI-18496. Include an option to download the saved query in hive view. (Anita Gnanamalar Jebaraj via dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8813b1f9 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8813b1f9 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8813b1f9 Branch: refs/heads/trunk Commit: 8813b1f9295f052a0f28ac622fdd214964cec7c6 Parents: e7074ec Author: Dipayan BhowmickAuthored: Sat Oct 8 01:16:16 2016 +0530 Committer: Dipayan Bhowmick Committed: Sat Oct 8 01:17:39 2016 +0530 -- .../savedQueries/SavedQueryService.java | 47 +-- .../ui/hive-web/app/controllers/queries.js | 24 +- .../ui/hive-web/app/initializers/i18n.js| 5 ++ .../savedQueries/SavedQueryService.java | 48 +--- .../ui/hive-web/app/controllers/queries.js | 22 - .../ui/hive-web/app/initializers/i18n.js| 5 +- .../savedQueries/SavedQueryServiceTest.java | 16 +-- 7 files changed, 149 insertions(+), 18 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/8813b1f9/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/savedQueries/SavedQueryService.java -- diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/savedQueries/SavedQueryService.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/savedQueries/SavedQueryService.java index ccc4512..9b844d6 100644 --- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/savedQueries/SavedQueryService.java +++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/savedQueries/SavedQueryService.java @@ -37,7 +37,16 @@ import javax.ws.rs.*; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; +import javax.ws.rs.core.StreamingOutput; import javax.ws.rs.core.UriInfo; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.InputStreamReader; +import java.io.IOException; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.Writer; import java.util.List; /** @@ -73,12 +82,40 @@ public class SavedQueryService extends BaseService { @GET @Path("{queryId}") @Produces(MediaType.APPLICATION_JSON) - public Response getOne(@PathParam("queryId") String queryId) { + public Response getOne(@PathParam("queryId") String queryId, +@QueryParam("op") String operation) { try { - SavedQuery savedQuery = getResourceManager().read(queryId); - JSONObject object = new JSONObject(); - object.put("savedQuery", savedQuery); - return Response.ok(object).build(); + final SavedQuery savedQuery = getResourceManager().read(queryId); + if(operation.equals("download")) { + StreamingOutput stream = new StreamingOutput() { + @Override + public void write(OutputStream os) throws IOException, WebApplicationException { + Writer writer = new BufferedWriter(new OutputStreamWriter(os)); + try { +BufferedReader br=new BufferedReader(new InputStreamReader(getSharedObjectsFactory().getHdfsApi().open(savedQuery.getQueryFile(; + String line; + line=br.readLine(); + while (line != null){ + writer.write(line+"\n"); + line = br.readLine(); +} +writer.flush(); + } catch (InterruptedException e) { + e.printStackTrace(); + } finally { + writer.close(); + } + } + }; + return Response.ok(stream). + type(MediaType.TEXT_PLAIN). + build(); + } + else { +JSONObject object = new JSONObject(); + object.put("savedQuery", savedQuery); + return Response.ok(object).build(); + } } catch (WebApplicationException ex) { throw ex; } catch (ItemNotFound itemNotFound) { http://git-wip-us.apache.org/repos/asf/ambari/blob/8813b1f9/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/queries.js -- diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/queries.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/queries.js index cbf6b42..4438c5a 100644 --- a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/queries.js +++
ambari git commit: Revert "AMBARI-18355: Introduce conditional dependencies in stack defition to handle blueprint validation gracefully (Amruta Borkar via dili)"
Repository: ambari Updated Branches: refs/heads/trunk f6124a056 -> e0d4a8713 Revert "AMBARI-18355: Introduce conditional dependencies in stack defition to handle blueprint validation gracefully (Amruta Borkar via dili)" This reverts commit f6124a056d2a8ed16bec917775b9d3554ab5d74d. Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e0d4a871 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e0d4a871 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e0d4a871 Branch: refs/heads/trunk Commit: e0d4a8713ed0ffe86acd18bd798c317d5e51a61c Parents: f6124a0 Author: Jonathan HurleyAuthored: Fri Oct 7 15:36:00 2016 -0400 Committer: Jonathan Hurley Committed: Fri Oct 7 15:36:00 2016 -0400 -- .../server/state/DependencyConditionInfo.java | 102 --- .../ambari/server/state/DependencyInfo.java | 36 +-- .../server/topology/BlueprintValidatorImpl.java | 13 --- .../common-services/HDFS/2.1.0.2.0/metainfo.xml | 44 .../topology/BlueprintValidatorImplTest.java| 75 +- 5 files changed, 2 insertions(+), 268 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/e0d4a871/ambari-server/src/main/java/org/apache/ambari/server/state/DependencyConditionInfo.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/DependencyConditionInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/state/DependencyConditionInfo.java deleted file mode 100644 index 84e186f..000 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/DependencyConditionInfo.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ambari.server.state; - -import java.util.Map; -import java.util.Objects; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.adapters.XmlAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - -import org.apache.commons.lang.NotImplementedException; - -/** - * Represents stack component dependency condition information. - */ -@XmlJavaTypeAdapter(DependencyConditionAdapter.class) -public abstract class DependencyConditionInfo { -public abstract boolean isResolved(Map > properties); -} - -class PropertyExistsDependencyCondition extends DependencyConditionInfo{ - -protected final String configType; -protected final String property; -public PropertyExistsDependencyCondition( String configType, String property) { -this.configType = Objects.requireNonNull(configType, "Config Type must not be null."); -this.property = Objects.requireNonNull(property, "Property Name must not be null."); -} - -@Override -public boolean isResolved(Map > properties) { -return (properties.get(configType).containsKey(property)); -} -} - -class PropertyValueEqualsDependencyCondition extends PropertyExistsDependencyCondition { - -protected final String propertyValue; -public PropertyValueEqualsDependencyCondition(String configType, String property, String propertyValue) { -super(configType, property); -this.propertyValue = Objects.requireNonNull(propertyValue, "Property value must not be null."); -} - -@Override -public boolean isResolved(Map > properties) { -return (super.isResolved(properties) && propertyValue.equals(properties.get(configType).get(property))); -} -} - -class DependencyConditionAdapter extends XmlAdapter { - -static class AdaptedDependencyCondition{ -@XmlElement -private String configType; -@XmlElement -private String property; -@XmlElement -private String propertyValue; -
ambari git commit: AMBARI-18437. Hive view not working on LLAP enabled cluster. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk e0d4a8713 -> e7074ecab AMBARI-18437. Hive view not working on LLAP enabled cluster. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e7074eca Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e7074eca Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e7074eca Branch: refs/heads/trunk Commit: e7074ecab2960ea3b8ab9396156413529cff3085 Parents: e0d4a87 Author: Dipayan BhowmickAuthored: Sat Oct 8 01:05:04 2016 +0530 Committer: Dipayan Bhowmick Committed: Sat Oct 8 01:07:32 2016 +0530 -- .../ambari/view/hive2/ConnectionFactory.java| 37 +--- .../ambari/view/hive2/PropertyValidator.java| 8 + .../views/hive-next/src/main/resources/view.xml | 9 + 3 files changed, 42 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/e7074eca/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/ConnectionFactory.java -- diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/ConnectionFactory.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/ConnectionFactory.java index 7295f3a..8fefe15 100644 --- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/ConnectionFactory.java +++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/ConnectionFactory.java @@ -33,7 +33,7 @@ public class ConnectionFactory { private static final String ZK_HIVE_NAMESPACE_KEY = "hive.server2.zookeeper.namespace"; private static final String ZK_HIVE_QUORUM = "hive.zookeeper.quorum"; - private static final String AMBARI_HIVE_SERVICE_NAME = "HIVE"; + private static final String AMBARI_HIVE_SERVICE_NAME = "HIVE"; private static final String AMBARI_HIVESERVER_COMPONENT_NAME = "HIVE_SERVER"; private static final String HIVE_SITE = "hive-site"; @@ -47,6 +47,7 @@ public class ConnectionFactory { private static final String HIVE_TRANSPORT_MODE_KEY = "hive.server2.transport.mode"; private static final String HTTP_PATH_KEY = "hive.server2.thrift.http.path"; private static final String HS2_PROXY_USER = "hive.server2.proxy.user"; + private static final String USE_HIVE_INTERACTIVE_MODE = "use.hive.interactive.mode"; public static ConnectionConfig create(ViewContext context) { @@ -66,9 +67,16 @@ public class ConnectionFactory { } private static String getFromHiveConfiguration(ViewContext context) { +boolean useLLAP = Boolean.valueOf(context.getProperties().get(USE_HIVE_INTERACTIVE_MODE)); String transportMode = context.getCluster().getConfigurationValue(HIVE_SITE, HIVE_TRANSPORT_MODE_KEY); String binaryPort = context.getCluster().getConfigurationValue(HIVE_SITE, BINARY_PORT_KEY); String httpPort = context.getCluster().getConfigurationValue(HIVE_SITE, HTTP_PORT_KEY); +if (useLLAP) { + binaryPort = context.getCluster().getConfigurationValue(HIVE_INTERACTIVE_SITE, BINARY_PORT_KEY); + httpPort = context.getCluster().getConfigurationValue(HIVE_INTERACTIVE_SITE, HTTP_PORT_KEY); +} + + String pathKey = context.getCluster().getConfigurationValue(HIVE_SITE, HTTP_PATH_KEY); List hiveHosts = context.getCluster().getHostsForServiceComponent(AMBARI_HIVE_SERVICE_NAME, AMBARI_HIVESERVER_COMPONENT_NAME); String sessionParams = context.getProperties().get(HIVE_SESSION_PARAMS); @@ -87,9 +95,10 @@ public class ConnectionFactory { StringBuilder builder = new StringBuilder(); builder.append("jdbc:hive2://") - .append(concatHostPorts) - .append(";") - .append(sessionParams); +.append(concatHostPorts); +if(!Strings.isNullOrEmpty(sessionParams)) { + builder.append(";").append(sessionParams); +} if (!isBinary) { builder.append(";").append("transportMode=http;httpPath=").append(pathKey); @@ -99,27 +108,31 @@ public class ConnectionFactory { } private static String getFromClusterZookeeperConfig(ViewContext context) { +boolean useLLAP = Boolean.valueOf(context.getProperties().get(USE_HIVE_INTERACTIVE_MODE)); String quorum = context.getCluster().getConfigurationValue(HIVE_SITE, ZK_HIVE_QUORUM); -if (quorum == null) { - quorum = context.getCluster().getConfigurationValue(HIVE_INTERACTIVE_SITE, ZK_HIVE_QUORUM); -} String namespace = context.getCluster().getConfigurationValue(HIVE_SITE, ZK_HIVE_NAMESPACE_KEY); -if (namespace == null) { +if (useLLAP) { namespace = context.getCluster().getConfigurationValue(HIVE_INTERACTIVE_SITE, ZK_HIVE_NAMESPACE_KEY); } String sessionParams =
ambari git commit: AMBARI-18437. Hive view not working on LLAP enabled cluster. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 5ef89d5b6 -> 061693de1 AMBARI-18437. Hive view not working on LLAP enabled cluster. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/061693de Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/061693de Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/061693de Branch: refs/heads/branch-2.5 Commit: 061693de16c7db6079b75ab2f36f173ccaa8cb59 Parents: 5ef89d5 Author: Dipayan BhowmickAuthored: Sat Oct 8 01:05:04 2016 +0530 Committer: Dipayan Bhowmick Committed: Sat Oct 8 01:06:27 2016 +0530 -- .../ambari/view/hive2/ConnectionFactory.java| 37 +--- .../ambari/view/hive2/PropertyValidator.java| 8 + .../views/hive-next/src/main/resources/view.xml | 9 + 3 files changed, 42 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/061693de/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/ConnectionFactory.java -- diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/ConnectionFactory.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/ConnectionFactory.java index 7295f3a..8fefe15 100644 --- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/ConnectionFactory.java +++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/ConnectionFactory.java @@ -33,7 +33,7 @@ public class ConnectionFactory { private static final String ZK_HIVE_NAMESPACE_KEY = "hive.server2.zookeeper.namespace"; private static final String ZK_HIVE_QUORUM = "hive.zookeeper.quorum"; - private static final String AMBARI_HIVE_SERVICE_NAME = "HIVE"; + private static final String AMBARI_HIVE_SERVICE_NAME = "HIVE"; private static final String AMBARI_HIVESERVER_COMPONENT_NAME = "HIVE_SERVER"; private static final String HIVE_SITE = "hive-site"; @@ -47,6 +47,7 @@ public class ConnectionFactory { private static final String HIVE_TRANSPORT_MODE_KEY = "hive.server2.transport.mode"; private static final String HTTP_PATH_KEY = "hive.server2.thrift.http.path"; private static final String HS2_PROXY_USER = "hive.server2.proxy.user"; + private static final String USE_HIVE_INTERACTIVE_MODE = "use.hive.interactive.mode"; public static ConnectionConfig create(ViewContext context) { @@ -66,9 +67,16 @@ public class ConnectionFactory { } private static String getFromHiveConfiguration(ViewContext context) { +boolean useLLAP = Boolean.valueOf(context.getProperties().get(USE_HIVE_INTERACTIVE_MODE)); String transportMode = context.getCluster().getConfigurationValue(HIVE_SITE, HIVE_TRANSPORT_MODE_KEY); String binaryPort = context.getCluster().getConfigurationValue(HIVE_SITE, BINARY_PORT_KEY); String httpPort = context.getCluster().getConfigurationValue(HIVE_SITE, HTTP_PORT_KEY); +if (useLLAP) { + binaryPort = context.getCluster().getConfigurationValue(HIVE_INTERACTIVE_SITE, BINARY_PORT_KEY); + httpPort = context.getCluster().getConfigurationValue(HIVE_INTERACTIVE_SITE, HTTP_PORT_KEY); +} + + String pathKey = context.getCluster().getConfigurationValue(HIVE_SITE, HTTP_PATH_KEY); List hiveHosts = context.getCluster().getHostsForServiceComponent(AMBARI_HIVE_SERVICE_NAME, AMBARI_HIVESERVER_COMPONENT_NAME); String sessionParams = context.getProperties().get(HIVE_SESSION_PARAMS); @@ -87,9 +95,10 @@ public class ConnectionFactory { StringBuilder builder = new StringBuilder(); builder.append("jdbc:hive2://") - .append(concatHostPorts) - .append(";") - .append(sessionParams); +.append(concatHostPorts); +if(!Strings.isNullOrEmpty(sessionParams)) { + builder.append(";").append(sessionParams); +} if (!isBinary) { builder.append(";").append("transportMode=http;httpPath=").append(pathKey); @@ -99,27 +108,31 @@ public class ConnectionFactory { } private static String getFromClusterZookeeperConfig(ViewContext context) { +boolean useLLAP = Boolean.valueOf(context.getProperties().get(USE_HIVE_INTERACTIVE_MODE)); String quorum = context.getCluster().getConfigurationValue(HIVE_SITE, ZK_HIVE_QUORUM); -if (quorum == null) { - quorum = context.getCluster().getConfigurationValue(HIVE_INTERACTIVE_SITE, ZK_HIVE_QUORUM); -} String namespace = context.getCluster().getConfigurationValue(HIVE_SITE, ZK_HIVE_NAMESPACE_KEY); -if (namespace == null) { +if (useLLAP) { namespace = context.getCluster().getConfigurationValue(HIVE_INTERACTIVE_SITE, ZK_HIVE_NAMESPACE_KEY); } String
[02/32] ambari git commit: AMBARI-18508. Provide a configurable option for "LLAP's headroom space for YARN container".
AMBARI-18508. Provide a configurable option for "LLAP's headroom space for YARN container". Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7ac93f3a Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7ac93f3a Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7ac93f3a Branch: refs/heads/branch-dev-patch-upgrade Commit: 7ac93f3a8aeeedb71d0feecc1f4ff99972f717f7 Parents: f2bcbbe Author: Swapan ShridharAuthored: Fri Sep 30 14:36:17 2016 -0700 Committer: Swapan Shridhar Committed: Mon Oct 3 12:39:50 2016 -0700 -- .../HIVE/configuration/hive-interactive-env.xml | 11 ++ .../stacks/HDP/2.5/services/stack_advisor.py| 23 +++- 2 files changed, 33 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/7ac93f3a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-interactive-env.xml -- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-interactive-env.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-interactive-env.xml index b14cc8c..c1a7592 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-interactive-env.xml +++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-interactive-env.xml @@ -195,6 +195,17 @@ +llap_headroom_space +6144 +LLAP app headroom space +LLAP's reserved headroom for YARN container + + int + bytes + + + + llap_log_level INFO LLAP app logging level (WARN/INFO/DEBUG/TRACE) http://git-wip-us.apache.org/repos/asf/ambari/blob/7ac93f3a/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 2a4728a..d2cc429 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 @@ -953,7 +953,7 @@ class HDP25StackAdvisor(HDP24StackAdvisor): # Calculate value for prop 'llap_heap_size' - llap_xmx = max(total_mem_for_executors * 0.8, total_mem_for_executors - 1024) + llap_xmx = max(total_mem_for_executors * 0.8, total_mem_for_executors - self.get_llap_headroom_space(services, configurations)) Logger.info("Calculated llap_app_heap_size : {0}, using following : hive_container_size : {1}, " "total_mem_for_executors : {2}".format(llap_xmx, hive_tez_container_size, total_mem_for_executors)) @@ -1149,6 +1149,27 @@ class HDP25StackAdvisor(HDP24StackAdvisor): return hive_container_size """ + Gets HIVE Server Interactive's 'llap_headroom_space' config. (Default value set to 6144 bytes). + """ + def get_llap_headroom_space(self, services, configurations): +llap_headroom_space = None +# Check if 'llap_headroom_space' is modified in current SA invocation. +if 'hive-interactive-env' in configurations and 'llap_headroom_space' in configurations['hive-interactive-env']['properties']: + hive_container_size = float(configurations['hive-interactive-env']['properties']['llap_headroom_space']) + Logger.info("'llap_headroom_space' read from configurations as : {0}".format(llap_headroom_space)) + +if not llap_headroom_space: + # Check if 'llap_headroom_space' is input in services array. + if 'llap_headroom_space' in services['configurations']['hive-interactive-env']['properties']: +llap_headroom_space = float(services['configurations']['hive-interactive-env']['properties']['llap_headroom_space']) +Logger.info("'llap_headroom_space' read from services as : {0}".format(llap_headroom_space)) +if not llap_headroom_space or llap_headroom_space < 1: + llap_headroom_space = 6144 # 6GB + Logger.info("Couldn't read 'llap_headroom_space' from services or configurations. Returing default value : 6144 bytes") + +return llap_headroom_space + + """ Gets YARN's minimum container size (yarn.scheduler.minimum-allocation-mb). Reads from: - configurations (if changed as part of current Stack Advisor invocation (output)), and services["changed-configurations"]
[09/32] ambari git commit: AMBARI-18518 : Sinks should not try to read collector hosts from Zk if AMS is in embedded mode. (avijayan)
AMBARI-18518 : Sinks should not try to read collector hosts from Zk if AMS is in embedded mode. (avijayan) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/98efb571 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/98efb571 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/98efb571 Branch: refs/heads/branch-dev-patch-upgrade Commit: 98efb571d63a17973bb62a510593c2041c14dcf6 Parents: c10053b Author: Aravindan VijayanAuthored: Tue Oct 4 11:23:32 2016 -0700 Committer: Aravindan Vijayan Committed: Tue Oct 4 11:23:32 2016 -0700 -- .../availability/MetricCollectorHAHelper.java | 10 +- .../availability/MetricCollectorHATest.java | 34 +++- 2 files changed, 42 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/98efb571/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/availability/MetricCollectorHAHelper.java -- diff --git a/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/availability/MetricCollectorHAHelper.java b/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/availability/MetricCollectorHAHelper.java index 2254362..e7f7cfd 100644 --- a/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/availability/MetricCollectorHAHelper.java +++ b/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/availability/MetricCollectorHAHelper.java @@ -25,6 +25,7 @@ import org.apache.curator.RetryPolicy; import org.apache.curator.retry.BoundedExponentialBackoffRetry; import org.apache.curator.retry.RetryUntilElapsed; import org.apache.zookeeper.ZooKeeper; +import org.apache.zookeeper.data.Stat; import java.util.Collection; import java.util.HashSet; @@ -44,7 +45,8 @@ public class MetricCollectorHAHelper { private static final int CONNECTION_TIMEOUT = 2000; private static final int SESSION_TIMEOUT = 1; - private static final String ZK_PATH = "/ambari-metrics-cluster/LIVEINSTANCES"; + private static final String ZNODE = "/ambari-metrics-cluster"; + private static final String ZK_PATH = ZNODE + "/LIVEINSTANCES"; private static final String INSTANCE_NAME_DELIMITER = "_"; @@ -72,6 +74,12 @@ public class MetricCollectorHAHelper { try { client.start(); + //Check if Znode exists + Stat stat = client.getZooKeeper().exists(ZNODE, false); + if (stat == null) { +LOG.info("/ambari-metrics-cluster znode does not exist. Skipping requesting live instances from zookeeper"); +return collectors; + } liveInstances = RetryLoop.callWithRetry(client, new Callable () { @Override public List call() throws Exception { http://git-wip-us.apache.org/repos/asf/ambari/blob/98efb571/ambari-metrics/ambari-metrics-common/src/test/java/org/apache/hadoop/metrics2/sink/timeline/availability/MetricCollectorHATest.java -- diff --git a/ambari-metrics/ambari-metrics-common/src/test/java/org/apache/hadoop/metrics2/sink/timeline/availability/MetricCollectorHATest.java b/ambari-metrics/ambari-metrics-common/src/test/java/org/apache/hadoop/metrics2/sink/timeline/availability/MetricCollectorHATest.java index ac1f52d..3d00270 100644 --- a/ambari-metrics/ambari-metrics-common/src/test/java/org/apache/hadoop/metrics2/sink/timeline/availability/MetricCollectorHATest.java +++ b/ambari-metrics/ambari-metrics-common/src/test/java/org/apache/hadoop/metrics2/sink/timeline/availability/MetricCollectorHATest.java @@ -20,9 +20,13 @@ package org.apache.hadoop.metrics2.sink.timeline.availability; import com.google.gson.Gson; import junit.framework.Assert; import org.apache.commons.io.IOUtils; +import org.apache.curator.CuratorZookeeperClient; +import org.apache.curator.retry.BoundedExponentialBackoffRetry; import org.apache.hadoop.metrics2.sink.timeline.AbstractTimelineMetricsSink; +import org.apache.zookeeper.ZooKeeper; import org.junit.Test; import org.junit.runner.RunWith; +import org.powermock.api.easymock.PowerMock; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; import java.io.IOException; @@ -34,13 +38,14 @@ import java.util.Arrays; import java.util.Collection; import static org.easymock.EasyMock.expect; +import static org.easymock.EasyMock.expectLastCall; import static org.powermock.api.easymock.PowerMock.createNiceMock; import static org.powermock.api.easymock.PowerMock.expectNew; import static
[10/32] ambari git commit: AMBARI-18519 - Enable Add/Remove JournalNode on NNHA Wizard Step 2 (rzang)
AMBARI-18519 - Enable Add/Remove JournalNode on NNHA Wizard Step 2 (rzang) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a442efbd Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a442efbd Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a442efbd Branch: refs/heads/branch-dev-patch-upgrade Commit: a442efbde22ac635b60b5650df397fd06c147ae1 Parents: 98efb57 Author: Richard ZangAuthored: Tue Oct 4 14:19:55 2016 -0700 Committer: Richard Zang Committed: Tue Oct 4 14:19:55 2016 -0700 -- .../nameNode/step2_controller.js| 32 +++- .../admin/highAvailability/nameNode/step3.hbs | 10 +++--- 2 files changed, 35 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/a442efbd/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step2_controller.js -- diff --git a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step2_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step2_controller.js index b8d7978..435fe0f 100644 --- a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step2_controller.js +++ b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step2_controller.js @@ -34,7 +34,37 @@ App.HighAvailabilityWizardStep2Controller = Em.Controller.extend(App.BlueprintMi showAdditionalPrefix: ['NAMENODE'], - showInstalledMastersFirst: true + showInstalledMastersFirst: true, + + JOURNALNODES_COUNT_MINIMUM: 3, // TODO get this from stack + + renderComponents: function(masterComponents) { +this._super(masterComponents); +this.showHideJournalNodesAddRemoveControl(); + }, + + addComponent: function(componentName) { +this._super(componentName); +this.showHideJournalNodesAddRemoveControl(); + }, + + removeComponent: function(componentName, serviceComponentId) { +this._super(componentName, serviceComponentId); +this.showHideJournalNodesAddRemoveControl() + }, + + showHideJournalNodesAddRemoveControl: function() { +var masterComponents = this.get('selectedServicesMasters'); +var jns = masterComponents.filterProperty('component_name', 'JOURNALNODE'); +var maxNumMasters = this.getMaxNumberOfMasters('JOURNALNODE') +var showRemoveControl = jns.get('length') > this.get('JOURNALNODES_COUNT_MINIMUM'); +var showAddControl = jns.get('length') < maxNumMasters; +jns.forEach(function(item) { + item.set('showAddControl', false); + item.set('showRemoveControl', showRemoveControl); +}); +jns.set('lastObject.showAddControl', showAddControl); + } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/a442efbd/ambari-web/app/templates/main/admin/highAvailability/nameNode/step3.hbs -- diff --git a/ambari-web/app/templates/main/admin/highAvailability/nameNode/step3.hbs b/ambari-web/app/templates/main/admin/highAvailability/nameNode/step3.hbs index 27653d3..ef2621d 100644 --- a/ambari-web/app/templates/main/admin/highAvailability/nameNode/step3.hbs +++ b/ambari-web/app/templates/main/admin/highAvailability/nameNode/step3.hbs @@ -52,12 +52,10 @@ -{{t admin.highAvailability.wizard.step3.toBeInstalled}} -{{t admin.highAvailability.wizard.step3.toBeInstalled}} -{{t admin.highAvailability.wizard.step3.toBeInstalled}} + {{#each item in view.journalNodes}} + {{t admin.highAvailability.wizard.step3.toBeInstalled}} + {{/each}}
[11/32] ambari git commit: AMBARI-18522 Add Service wizard breaks on large clusters when persisting data in localStorage. (ababiichuk)
AMBARI-18522 Add Service wizard breaks on large clusters when persisting data in localStorage. (ababiichuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/26660f20 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/26660f20 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/26660f20 Branch: refs/heads/branch-dev-patch-upgrade Commit: 26660f20e071d2a01dd0d37414d556e34947018d Parents: a442efb Author: ababiichukAuthored: Tue Oct 4 13:55:21 2016 +0300 Committer: ababiichuk Committed: Wed Oct 5 12:38:50 2016 +0300 -- ambari-web/app/controllers/wizard.js| 14 +-- .../app/controllers/wizard/step7_controller.js | 20 +++- ambari-web/app/utils/config.js | 20 ambari-web/test/controllers/wizard_test.js | 97 +--- 4 files changed, 45 insertions(+), 106 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/26660f20/ambari-web/app/controllers/wizard.js -- diff --git a/ambari-web/app/controllers/wizard.js b/ambari-web/app/controllers/wizard.js index def6b84..e0df4fa 100644 --- a/ambari-web/app/controllers/wizard.js +++ b/ambari-web/app/controllers/wizard.js @@ -920,19 +920,11 @@ App.WizardController = Em.Controller.extend(App.LocalStorage, App.ThemesMappingM if (_content.serviceName === 'YARN') { _content.set('configs', App.config.textareaIntoFileConfigs(_content.get('configs'), 'capacity-scheduler.xml')); } - _content.get('configs').forEach(function (_configProperties) { -if (!Em.isNone(_configProperties.get('group'))) { + _content.get('configs').forEach(function (_configProperty) { +if (!Em.isNone(_configProperty.get('group'))) { return false; } -var configProperty = App.config.createDefaultConfig( - _configProperties.get('name'), - _configProperties.get('filename'), - // need to invert boolean because this argument will be inverted in method body - !_configProperties.get('isUserProperty'), - _configProperties.getProperties('value', 'isRequired', 'errorMessage', 'warnMessage') -); -configProperty = App.config.mergeStaticProperties(configProperty, _configProperties, [], ['name', 'filename', 'isUserProperty', 'value']); - +var configProperty = App.config.createMinifiedConfig(_configProperty); if (this.isExcludedConfig(configProperty)) { configProperty.value = ''; } http://git-wip-us.apache.org/repos/asf/ambari/blob/26660f20/ambari-web/app/controllers/wizard/step7_controller.js -- diff --git a/ambari-web/app/controllers/wizard/step7_controller.js b/ambari-web/app/controllers/wizard/step7_controller.js index dc030be..d5cbe67 100644 --- a/ambari-web/app/controllers/wizard/step7_controller.js +++ b/ambari-web/app/controllers/wizard/step7_controller.js @@ -478,9 +478,7 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E App.config.setPreDefinedServiceConfigs(this.get('addMiscTabToPage')); -var storedConfigs = this.get('content.serviceConfigProperties'); - -var configs = storedConfigs && storedConfigs.length ? storedConfigs : App.configsCollection.getAll(); +var configs = this.getInitialConfigs(this.get('content.serviceConfigProperties')); this.set('groupsToDelete', this.get('wizardController').getDBProperty('groupsToDelete') || []); if (this.get('wizardController.name') === 'addServiceController' && !this.get('content.serviceConfigProperties.length')) { @@ -494,6 +492,22 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E }, /** + * If configs are saved in store returns stored configs merged with stack + * otherwise return stack configs + * @returns {Object[]} + */ + getInitialConfigs: function(storedConfigs) { +if (storedConfigs && storedConfigs.length) { + var mergedConfigs = []; + storedConfigs.forEach(function (c) { +mergedConfigs.push($.extend({}, App.configsCollection.getConfigByName(c.name, c.filename), c)); + }); + return mergedConfigs; +} +return App.configsCollection.getAll(); + }, + + /** * Update hawq configuration depending on the state of the cluster * @param {Array} configs */ http://git-wip-us.apache.org/repos/asf/ambari/blob/26660f20/ambari-web/app/utils/config.js -- diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js index abb2fbf..d562e9e 100644 ---
[14/32] ambari git commit: AMBARI-18513. Optimize ClustersDeadlockTest (aonishuk)
AMBARI-18513. Optimize ClustersDeadlockTest (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a901d8a7 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a901d8a7 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a901d8a7 Branch: refs/heads/branch-dev-patch-upgrade Commit: a901d8a7a8f21cf9e6055a6669883abe47d5e370 Parents: 62dc775 Author: Andrew OnishukAuthored: Wed Oct 5 14:46:46 2016 +0300 Committer: Andrew Onishuk Committed: Wed Oct 5 14:46:46 2016 +0300 -- .../state/cluster/ClustersDeadlockTest.java | 137 +-- 1 file changed, 97 insertions(+), 40 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/a901d8a7/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClustersDeadlockTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClustersDeadlockTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClustersDeadlockTest.java index a0a6444..190f64d 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClustersDeadlockTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClustersDeadlockTest.java @@ -22,8 +22,10 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicInteger; +import com.google.inject.Provider; import junit.framework.Assert; import org.apache.ambari.server.AmbariException; @@ -69,6 +71,9 @@ public class ClustersDeadlockTest { private final AtomicInteger hostNameCounter = new AtomicInteger(0); + private CountDownLatch writerStoppedSignal; + private CountDownLatch readerStoppedSignal; + private final StackId stackId = new StackId("HDP-0.1"); @Inject @@ -109,6 +114,9 @@ public class ClustersDeadlockTest { // install HDFS installService("HDFS"); + +writerStoppedSignal = new CountDownLatch(NUMBER_OF_THREADS); +readerStoppedSignal = new CountDownLatch(NUMBER_OF_THREADS); } @After @@ -117,6 +125,42 @@ public class ClustersDeadlockTest { } /** + * Launches reader and writer threads simultaneously to check for a deadlock. + * The numbers of launched reader and writer threads are equal to + * the {@code}numberOfThreads{@code}. This method expects that reader + * and writer threads are using {@code}readerStoppedSignal{@code} + * and {@code}writerStoppedSignal{@code} correctly. + * + * Reader threads should be stopped after writer threads are finished. + */ + private void doLoadTest(Provider readerProvider, + Provider writerProvider, + final int numberOfThreads, + CountDownLatch writerStoppedSignal, + CountDownLatch readerStoppedSignal) throws Exception { +List writerThreads = new ArrayList(); +for (int i = 0; i < numberOfThreads; i++) { + Thread readerThread = readerProvider.get(); + Thread writerThread = writerProvider.get(); + + writerThreads.add(writerThread); + + readerThread.start(); + writerThread.start(); +} + +for (Thread writerThread : writerThreads) { + writerThread.join(); + // Notify that one writer thread is stopped + writerStoppedSignal.countDown(); +} + +// All writer threads are stopped. Reader threads should finish now. +// Await for all reader threads to stop +readerStoppedSignal.await(); + } + + /** * Tests that no deadlock exists when adding hosts while reading from the * cluster. * @@ -124,21 +168,20 @@ public class ClustersDeadlockTest { */ @Test(timeout = 4) public void testDeadlockWhileMappingHosts() throws Exception { -List threads = new ArrayList(); -for (int i = 0; i < NUMBER_OF_THREADS; i++) { - ClusterReaderThread readerThread = new ClusterReaderThread(); - ClustersHostMapperThread writerThread = new ClustersHostMapperThread(); - - threads.add(readerThread); - threads.add(writerThread); +Provider clustersHostMapperThreadFactory = +new Provider() { - readerThread.start(); - writerThread.start(); -} + @Override + public ClustersHostMapperThread get() { +return new ClustersHostMapperThread(); + } +}; -for (Thread thread : threads) { - thread.join(); -} +doLoadTest(new ClusterReaderThreadFactory(), + clustersHostMapperThreadFactory, + NUMBER_OF_THREADS, + writerStoppedSignal, +
[27/32] ambari git commit: AMBARI-18526. Ambari breaks sudo and user access if Ambari Agent misconfigured (dlysnichenko)
AMBARI-18526. Ambari breaks sudo and user access if Ambari Agent misconfigured (dlysnichenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/cceb7d2d Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/cceb7d2d Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/cceb7d2d Branch: refs/heads/branch-dev-patch-upgrade Commit: cceb7d2d3eb8359e3a25a7c9eec5c92516f28097 Parents: 49c9660 Author: Lisnichenko DmitroAuthored: Thu Oct 6 19:57:25 2016 +0300 Committer: Lisnichenko Dmitro Committed: Thu Oct 6 19:57:25 2016 +0300 -- ambari-agent/conf/unix/ambari-agent | 17 + 1 file changed, 17 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/cceb7d2d/ambari-agent/conf/unix/ambari-agent -- diff --git a/ambari-agent/conf/unix/ambari-agent b/ambari-agent/conf/unix/ambari-agent index ccb0b7a..30897dd 100755 --- a/ambari-agent/conf/unix/ambari-agent +++ b/ambari-agent/conf/unix/ambari-agent @@ -39,6 +39,17 @@ get_agent_property() { echo $value } +valid_path() { + value=${1:?} + value=$(readlink -m ${value}) + if [ "$value" == "/" ]; then +echo "path $1 not valid" 1>&2 +exit 1 + fi + echo $value +} + + export PATH=/usr/sbin:/sbin:/usr/lib/ambari-server/*:$PATH export AMBARI_CONF_DIR=/etc/ambari-server/conf:$PATH @@ -46,8 +57,14 @@ export AMBARI_CONF_DIR=/etc/ambari-server/conf:$PATH export PYTHONPATH=/usr/lib/python2.6/site-packages:${PYTHONPATH:-} export AMBARI_PID_DIR=`get_agent_property piddir` +export AMBARI_PID_DIR=`valid_path "${AMBARI_PID_DIR:?}"` +export AMBARI_PID_DIR="${AMBARI_PID_DIR:?}" export AMBARI_AGENT_LOG_DIR=`get_agent_property logdir` +export AMBARI_AGENT_LOG_DIR=`valid_path "${AMBARI_AGENT_LOG_DIR:?}"` +export AMBARI_AGENT_LOG_DIR="${AMBARI_AGENT_LOG_DIR:?}" KEYSDIR=`get_agent_property keysdir` +KEYSDIR=`valid_path "${KEYSDIR:?}"` +KEYSDIR="${KEYSDIR:?}" AMBARI_AGENT=ambari-agent PYTHON_WRAP=/usr/bin/ambari-python-wrap
[22/32] ambari git commit: AMBARI-18532. Getting errors with max length 1000byte, when using Mysql db with charset UTF8.(vbrodetskyi)
AMBARI-18532. Getting errors with max length 1000byte, when using Mysql db with charset UTF8.(vbrodetskyi) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/46cb4023 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/46cb4023 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/46cb4023 Branch: refs/heads/branch-dev-patch-upgrade Commit: 46cb40233d3e9762c2b44c1b43f3a0c1cf5c96c2 Parents: bce5dbe Author: Vitaly BrodetskyiAuthored: Thu Oct 6 04:12:58 2016 +0300 Committer: Vitaly Brodetskyi Committed: Thu Oct 6 04:12:58 2016 +0300 -- .../src/main/resources/Ambari-DDL-MySQL-CREATE.sql | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/46cb4023/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql -- diff --git a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql index 1d55515..1c17e1a 100644 --- a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql +++ b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql @@ -36,8 +36,8 @@ CREATE TABLE stack( CREATE TABLE extension( extension_id BIGINT NOT NULL, - extension_name VARCHAR(255) NOT NULL, - extension_version VARCHAR(255) NOT NULL, + extension_name VARCHAR(100) NOT NULL, + extension_version VARCHAR(100) NOT NULL, CONSTRAINT PK_extension PRIMARY KEY (extension_id), CONSTRAINT UQ_extension UNIQUE (extension_name, extension_version)); @@ -279,8 +279,8 @@ CREATE TABLE users ( principal_id BIGINT NOT NULL, create_time TIMESTAMP DEFAULT NOW(), ldap_user INTEGER NOT NULL DEFAULT 0, - user_type VARCHAR(255) NOT NULL DEFAULT 'LOCAL', - user_name VARCHAR(255) NOT NULL, + user_type VARCHAR(100) NOT NULL DEFAULT 'LOCAL', + user_name VARCHAR(100) NOT NULL, user_password VARCHAR(255), active INTEGER NOT NULL DEFAULT 1, active_widget_layouts VARCHAR(1024) DEFAULT NULL, @@ -368,13 +368,13 @@ CREATE TABLE host_role_command ( host_id BIGINT, last_attempt_time BIGINT NOT NULL, request_id BIGINT NOT NULL, - role VARCHAR(255), + role VARCHAR(100), role_command VARCHAR(255), stage_id BIGINT NOT NULL, start_time BIGINT NOT NULL, original_start_time BIGINT NOT NULL, end_time BIGINT, - status VARCHAR(255), + status VARCHAR(100), auto_skip_on_failure SMALLINT DEFAULT 0 NOT NULL, std_error LONGBLOB, std_out LONGBLOB,
[25/32] ambari git commit: AMBARI-18521. Stack upgrade fix for Ranger in secure env (mugdha)
AMBARI-18521. Stack upgrade fix for Ranger in secure env (mugdha) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/bce5dbe3 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/bce5dbe3 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/bce5dbe3 Branch: refs/heads/branch-dev-patch-upgrade Commit: bce5dbe3eacda9d35e645a776f1f9aa3edf06e9c Parents: 8b6e45e Author: Mugdha VaradkarAuthored: Thu Oct 6 10:27:02 2016 +0530 Committer: Mugdha Varadkar Committed: Thu Oct 6 11:40:02 2016 +0530 -- .../RangerKerberosConfigCalculation.java| 32 .../RangerKerberosConfigCalculationTest.java| 6 ++-- 2 files changed, 22 insertions(+), 16 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/bce5dbe3/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/RangerKerberosConfigCalculation.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/RangerKerberosConfigCalculation.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/RangerKerberosConfigCalculation.java index c3d71c0..ba0da79 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/RangerKerberosConfigCalculation.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/RangerKerberosConfigCalculation.java @@ -29,6 +29,7 @@ import org.apache.ambari.server.state.Cluster; import org.apache.ambari.server.state.Clusters; import org.apache.ambari.server.state.Config; import org.apache.ambari.server.state.SecurityType; +import org.apache.commons.lang.StringUtils; import com.google.inject.Inject; @@ -47,7 +48,6 @@ public class RangerKerberosConfigCalculation extends AbstractServerAction { private static final String KAFKA_ENV_CONFIG_TYPE = "kafka-env"; private static final String RANGER_KMS_ENV_CONFIG_TYPE = "kms-env"; private static final String HDFS_SITE_CONFIG_TYPE = "hdfs-site"; - private static final String RANGER_SPNEGO_PRINCIPAL = "ranger.spnego.kerberos.principal"; private static final String RANGER_SPNEGO_KEYTAB = "ranger.spnego.kerberos.keytab"; private static final String RANGER_PLUGINS_HDFS_SERVICE_USER = "ranger.plugins.hdfs.serviceuser"; private static final String RANGER_PLUGINS_HIVE_SERVICE_USER = "ranger.plugins.hive.serviceuser"; @@ -168,9 +168,27 @@ public class RangerKerberosConfigCalculation extends AbstractServerAction { Config stormConfig = cluster.getDesiredConfigByType(STORM_ENV_CONFIG_TYPE); if (null != stormConfig) { + String stormValue = null; String stormUser = stormConfig.getProperties().get("storm_user"); + + if (cluster.getSecurityType() == SecurityType.KERBEROS) { +String stormPrincipal = stormConfig.getProperties().get("storm_principal_name"); +if (null != stormPrincipal) { + String[] stormPrincipalParts = stormPrincipal.split("@"); + if(null != stormPrincipalParts && stormPrincipalParts.length > 1) { +String stormPrincipalBareName = stormPrincipalParts[0]; +stormValue = stormPrincipalBareName; + } +} + } + if (null != stormUser) { -targetValues.put(RANGER_PLUGINS_STORM_SERVICE_USER, stormUser); +if(!StringUtils.isBlank(stormValue)) { + stormValue = stormValue + "," + stormUser; +} else { + stormValue = stormUser; +} +targetValues.put(RANGER_PLUGINS_STORM_SERVICE_USER, stormValue); rangerAdminconfig.setProperties(targetValues); rangerAdminconfig.persist(false); sucessMsg = sucessMsg + MessageFormat.format("{0}\n", RANGER_PLUGINS_STORM_SERVICE_USER); @@ -220,18 +238,8 @@ public class RangerKerberosConfigCalculation extends AbstractServerAction { Config hdfsSiteConfig = cluster.getDesiredConfigByType(HDFS_SITE_CONFIG_TYPE); if (null != hdfsSiteConfig) { -String spnegoPrincipal = hdfsSiteConfig.getProperties().get("dfs.web.authentication.kerberos.principal"); String spnegoKeytab = hdfsSiteConfig.getProperties().get("dfs.web.authentication.kerberos.keytab"); -if (null != spnegoPrincipal) { - targetValues.put(RANGER_SPNEGO_PRINCIPAL, spnegoPrincipal); - rangerAdminconfig.setProperties(targetValues); - rangerAdminconfig.persist(false); - sucessMsg = sucessMsg + MessageFormat.format("{0}\n", RANGER_SPNEGO_PRINCIPAL); -} else { - errMsg = errMsg + MessageFormat.format("{0} not found in {1}\n", "dfs.web.authentication.kerberos.principal", HDFS_SITE_CONFIG_TYPE); -} -
[08/32] ambari git commit: AMBARI-18487 : Test and refine Collector writes w.r.t sharing and timeouts. (avijayan)
AMBARI-18487 : Test and refine Collector writes w.r.t sharing and timeouts. (avijayan) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c10053b0 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c10053b0 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c10053b0 Branch: refs/heads/branch-dev-patch-upgrade Commit: c10053b086ae1b4f41c3d4cdba18349144ef7ec4 Parents: 06f3b8e Author: Aravindan VijayanAuthored: Tue Oct 4 11:10:52 2016 -0700 Committer: Aravindan Vijayan Committed: Tue Oct 4 11:10:52 2016 -0700 -- .../timeline/AbstractTimelineMetricsSink.java | 75 +--- .../availability/MetricCollectorHAHelper.java | 9 +-- .../src/main/python/core/blacklisted_set.py | 14 .../src/main/python/core/config_reader.py | 3 +- .../src/main/python/core/emitter.py | 74 +-- 5 files changed, 122 insertions(+), 53 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/c10053b0/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/AbstractTimelineMetricsSink.java -- diff --git a/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/AbstractTimelineMetricsSink.java b/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/AbstractTimelineMetricsSink.java index fa5b694..efa5cba 100644 --- a/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/AbstractTimelineMetricsSink.java +++ b/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/AbstractTimelineMetricsSink.java @@ -55,6 +55,8 @@ import java.util.HashSet; import java.util.List; import java.util.Random; import java.util.Set; +import java.util.SortedSet; +import java.util.TreeSet; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; @@ -78,8 +80,9 @@ public abstract class AbstractTimelineMetricsSink { protected static final AtomicInteger failedCollectorConnectionsCounter = new AtomicInteger(0); public static int NUMBER_OF_SKIPPED_COLLECTOR_EXCEPTIONS = 100; - public int ZK_CONNECT_TRY_TIME = 1; + public int ZK_CONNECT_TRY_COUNT = 10; public int ZK_SLEEP_BETWEEN_RETRY_TIME = 2000; + public boolean shardExpired = true; private SSLSocketFactory sslSocketFactory; @@ -95,7 +98,7 @@ public abstract class AbstractTimelineMetricsSink { // well as timed refresh protected Supplier targetCollectorHostSupplier; - protected final List allKnownLiveCollectors = new ArrayList<>(); + protected final SortedSet allKnownLiveCollectors = new TreeSet<>(); private volatile boolean isInitializedForHA = false; @@ -127,7 +130,7 @@ public abstract class AbstractTimelineMetricsSink { protected void init() { metricSinkWriteShardStrategy = new MetricSinkWriteShardHostnameHashingStrategy(getHostname()); collectorHAHelper = new MetricCollectorHAHelper(getZookeeperQuorum(), - ZK_CONNECT_TRY_TIME, ZK_SLEEP_BETWEEN_RETRY_TIME); + ZK_CONNECT_TRY_COUNT, ZK_SLEEP_BETWEEN_RETRY_TIME); isInitializedForHA = true; } @@ -204,6 +207,8 @@ public abstract class AbstractTimelineMetricsSink { collectorHost = targetCollectorHostSupplier.get(); // Last X attempts have failed - force refresh if (failedCollectorConnectionsCounter.get() > RETRY_COUNT_BEFORE_COLLECTOR_FAILOVER) { +LOG.info("Removing collector " + collectorHost + " from allKnownLiveCollectors."); +allKnownLiveCollectors.remove(collectorHost); targetCollectorHostSupplier = null; collectorHost = findPreferredCollectHost(); } @@ -321,6 +326,7 @@ public abstract class AbstractTimelineMetricsSink { init(); } +shardExpired = false; // Auto expire and re-calculate after 1 hour if (targetCollectorHostSupplier != null) { String targetCollector = targetCollectorHostSupplier.get(); @@ -329,32 +335,12 @@ public abstract class AbstractTimelineMetricsSink { } } -Collection collectorHosts = getConfiguredCollectorHosts(); - -LOG.debug("Trying to find live collector host from : " + collectorHosts); // Reach out to all configured collectors before Zookeeper -if (collectorHosts != null && !collectorHosts.isEmpty()) { - for (String hostStr : collectorHosts) { -hostStr = hostStr.trim(); -if (!hostStr.isEmpty()) { - try { -Collection liveHosts = findLiveCollectorHostsFromKnownCollector(hostStr, getCollectorPort()); -// Update live Hosts - current host will already be a
[21/32] ambari git commit: AMBARI-18544. Update repo base urls for HDP-2.6 stack (smohanty)
AMBARI-18544. Update repo base urls for HDP-2.6 stack (smohanty) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/714d9b52 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/714d9b52 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/714d9b52 Branch: refs/heads/branch-dev-patch-upgrade Commit: 714d9b528e0c671d777452c31f8e79905a5801b0 Parents: 8f8b26a Author: Sumit MohantyAuthored: Wed Oct 5 17:28:49 2016 -0700 Committer: Sumit Mohanty Committed: Wed Oct 5 17:28:49 2016 -0700 -- .../resources/stacks/HDP/2.6/repos/repoinfo.xml | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/714d9b52/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 1385fb4..34abae5 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 @@ -16,10 +16,10 @@ limitations under the License. --> - http://public-repo-1.hortonworks.com/HDP/hdp_urlinfo.json + http://s3.amazonaws.com/dev.hortonworks.com/HDP/hdp_urlinfo.json - http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.5.0.0 + http://s3.amazonaws.com/dev.hortonworks.com/HDP/centos6/2.x/updates/2.6.0.0 HDP-2.6 HDP true @@ -33,7 +33,7 @@ - http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.5.0.0 + http://s3.amazonaws.com/dev.hortonworks.com/HDP/centos7/2.x/updates/2.6.0.0 HDP-2.6 HDP true @@ -47,7 +47,7 @@ - http://public-repo-1.hortonworks.com/HDP/suse11sp3/2.x/updates/2.5.0.0 + http://s3.amazonaws.com/dev.hortonworks.com/HDP/suse11sp3/2.x/updates/2.6.0.0 HDP-2.6 HDP true @@ -61,7 +61,7 @@ - http://public-repo-1.hortonworks.com/HDP/sles12/2.x/updates/2.5.0.0 + http://s3.amazonaws.com/dev.hortonworks.com/HDP/sles12/2.x/updates/2.6.0.0 HDP-2.6 HDP true @@ -75,7 +75,7 @@ - http://public-repo-1.hortonworks.com/HDP/ubuntu12/2.x/updates/2.5.0.0 + http://s3.amazonaws.com/dev.hortonworks.com/HDP/ubuntu12/2.x/updates/2.6.0.0 HDP-2.6 HDP true @@ -89,7 +89,7 @@ - http://public-repo-1.hortonworks.com/HDP/debian7/2.x/updates/2.5.0.0 + http://s3.amazonaws.com/dev.hortonworks.com/HDP/debian7/2.x/updates/2.6.0.0 HDP-2.6 HDP true @@ -103,7 +103,7 @@ - http://public-repo-1.hortonworks.com/HDP/ubuntu14/2.x/updates/2.5.0.0 + http://s3.amazonaws.com/dev.hortonworks.com/HDP/ubuntu14/2.x/updates/2.6.0.0 HDP-2.6 HDP true @@ -117,7 +117,7 @@ - http://public-repo-1.hortonworks.com/HDP/ubuntu14/2.x/updates/2.5.0.0 + http://s3.amazonaws.com/dev.hortonworks.com/HDP/ubuntu14/2.x/updates/2.6.0.0 HDP-2.6 HDP true
[29/32] ambari git commit: AMBARI-18550. Views build failure. (yusaku)
AMBARI-18550. Views build failure. (yusaku) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b81deb0e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b81deb0e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b81deb0e Branch: refs/heads/branch-dev-patch-upgrade Commit: b81deb0e5dea0c4f1ed56567d03e0e04049372ba Parents: 55c1dc5 Author: Yusaku SakoAuthored: Thu Oct 6 15:30:43 2016 -0700 Committer: Yusaku Sako Committed: Thu Oct 6 15:32:28 2016 -0700 -- .../src/main/resources/ui/hueambarimigration-view/package.json | 2 +- contrib/views/wfmanager/src/main/resources/ui/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/b81deb0e/contrib/views/hueambarimigration/src/main/resources/ui/hueambarimigration-view/package.json -- diff --git a/contrib/views/hueambarimigration/src/main/resources/ui/hueambarimigration-view/package.json b/contrib/views/hueambarimigration/src/main/resources/ui/hueambarimigration-view/package.json index b9f832e..64b3270 100644 --- a/contrib/views/hueambarimigration/src/main/resources/ui/hueambarimigration-view/package.json +++ b/contrib/views/hueambarimigration/src/main/resources/ui/hueambarimigration-view/package.json @@ -40,7 +40,7 @@ "ember-cli-selectize": "0.5.3", "ember-cli-sri": "^2.1.0", "ember-cli-uglify": "^1.2.0", -"ember-data": "^2.4.2", +"ember-data": "2.7.0", "ember-export-application-global": "^1.0.5", "ember-load-initializers": "^0.5.1", "ember-power-select": "0.10.4", http://git-wip-us.apache.org/repos/asf/ambari/blob/b81deb0e/contrib/views/wfmanager/src/main/resources/ui/package.json -- diff --git a/contrib/views/wfmanager/src/main/resources/ui/package.json b/contrib/views/wfmanager/src/main/resources/ui/package.json index 92f698f..d04d57c 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/package.json +++ b/contrib/views/wfmanager/src/main/resources/ui/package.json @@ -33,7 +33,7 @@ "ember-cli-release": "0.2.8", "ember-cli-sri": "^2.0.0", "ember-cli-uglify": "^1.2.0", -"ember-data": "^2.3.0", +"ember-data": "2.7.0", "ember-disable-proxy-controllers": "^1.0.1", "ember-export-application-global": "^1.0.4", "ember-load-initializers": "^0.5.0",
[07/32] ambari git commit: AMBARI-18517 : Changes in upgrade path for Kafka metrics collector hosts config. (avijayan)
AMBARI-18517 : Changes in upgrade path for Kafka metrics collector hosts config. (avijayan) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/06f3b8e9 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/06f3b8e9 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/06f3b8e9 Branch: refs/heads/branch-dev-patch-upgrade Commit: 06f3b8e9006ef6ad1533f33baa0c9544547bd244 Parents: 1bf2069 Author: Aravindan VijayanAuthored: Tue Oct 4 11:10:03 2016 -0700 Committer: Aravindan Vijayan Committed: Tue Oct 4 11:10:20 2016 -0700 -- .../server/upgrade/UpgradeCatalog250.java | 30 +- .../server/upgrade/UpgradeCatalog250Test.java | 61 2 files changed, 90 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/06f3b8e9/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java index 185bd58..091c6d9 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java @@ -45,6 +45,9 @@ public class UpgradeCatalog250 extends AbstractUpgradeCatalog { protected static final String HOST_VERSION_TABLE = "host_version"; private static final String AMS_ENV = "ams-env"; + private static final String KAFKA_BROKER = "kafka-broker"; + private static final String KAFKA_TIMELINE_METRICS_HOST = "kafka.timeline.metrics.host"; + /** * Logger. */ @@ -110,6 +113,7 @@ public class UpgradeCatalog250 extends AbstractUpgradeCatalog { protected void executeDMLUpdates() throws AmbariException, SQLException { updateAMSConfigs(); createRoleAuthorizations(); +updateKafkaConfigs(); } protected void updateHostVersionTable() throws SQLException { @@ -181,7 +185,31 @@ public class UpgradeCatalog250 extends AbstractUpgradeCatalog { Arrays.asList("AMBARI.ADMINISTRATOR:AMBARI", "CLUSTER.ADMINISTRATOR:CLUSTER")); addRoleAuthorization("AMBARI.RUN_CUSTOM_COMMAND", "Perform custom administrative actions", -Collections.singletonList("AMBARI.ADMINISTRATOR:AMBARI")); + Collections.singletonList("AMBARI.ADMINISTRATOR:AMBARI")); + } + + protected void updateKafkaConfigs() throws AmbariException { +AmbariManagementController ambariManagementController = injector.getInstance(AmbariManagementController.class); +Clusters clusters = ambariManagementController.getClusters(); + +if (clusters != null) { + Map clusterMap = clusters.getClusters(); + + if (clusterMap != null && !clusterMap.isEmpty()) { +for (final Cluster cluster : clusterMap.values()) { + + Config kafkaBrokerConfig = cluster.getDesiredConfigByType(KAFKA_BROKER); + if (kafkaBrokerConfig != null) { +Map kafkaBrokerProperties = kafkaBrokerConfig.getProperties(); + +if (kafkaBrokerProperties != null && kafkaBrokerProperties.containsKey(KAFKA_TIMELINE_METRICS_HOST)) { + LOG.info("Removing kafka.timeline.metrics.host from kafka-broker"); + removeConfigurationPropertiesFromCluster(cluster, KAFKA_BROKER, Collections.singleton("kafka.timeline.metrics.host")); +} + } +} + } +} } } http://git-wip-us.apache.org/repos/asf/ambari/blob/06f3b8e9/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java index 7b6c3ad..9f34bcc 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java @@ -124,10 +124,12 @@ public class UpgradeCatalog250Test { public void testExecuteDMLUpdates() throws Exception { Method updateAmsConfigs = UpgradeCatalog250.class.getDeclaredMethod("updateAMSConfigs"); Method createRoleAuthorizations = UpgradeCatalog250.class.getDeclaredMethod("createRoleAuthorizations"); +Method updateKafkaConfigs = UpgradeCatalog250.class.getDeclaredMethod("updateKafkaConfigs"); UpgradeCatalog250 upgradeCatalog250 = createMockBuilder(UpgradeCatalog250.class)
[28/32] ambari git commit: AMBARI-18547. No validation errors recieved for empty or removed hadoop.proxyuser.* properties (dlysnichenko)
AMBARI-18547. No validation errors recieved for empty or removed hadoop.proxyuser.* properties (dlysnichenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/55c1dc5c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/55c1dc5c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/55c1dc5c Branch: refs/heads/branch-dev-patch-upgrade Commit: 55c1dc5cb8015e3d114c186792dacd883b7aa820 Parents: cceb7d2 Author: Lisnichenko DmitroAuthored: Thu Oct 6 20:01:13 2016 +0300 Committer: Lisnichenko Dmitro Committed: Thu Oct 6 20:01:13 2016 +0300 -- .../TestDataStructureUtils.py | 47 .../libraries/functions/data_structure_utils.py | 57 .../stacks/HDP/2.0.6/services/stack_advisor.py | 269 --- .../stacks/HDP/2.3/services/stack_advisor.py| 13 +- .../stacks/2.0.6/common/test_stack_advisor.py | 215 +++ 5 files changed, 495 insertions(+), 106 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/55c1dc5c/ambari-agent/src/test/python/resource_management/TestDataStructureUtils.py -- diff --git a/ambari-agent/src/test/python/resource_management/TestDataStructureUtils.py b/ambari-agent/src/test/python/resource_management/TestDataStructureUtils.py new file mode 100644 index 000..a4bdc1c --- /dev/null +++ b/ambari-agent/src/test/python/resource_management/TestDataStructureUtils.py @@ -0,0 +1,47 @@ +''' +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. +''' + +from unittest import TestCase + +from resource_management.libraries.functions.data_structure_utils import get_from_dict +from resource_management.libraries.functions.data_structure_utils import KeyNotFound + + +class TestDictUtils(TestCase): + + def test_get_nested(self): +dict_ = {1: {2: {3: 'data'}}} +empty_dict = {} + +self.assertEquals('data', get_from_dict(dict_, (1, 2, 3))) +self.assertEquals('data', get_from_dict(dict_, [1, 2, 3])) + +self.assertEquals({3: 'data'}, get_from_dict(dict_, (1, 2))) + +self.assertEquals({2: {3: 'data'}}, get_from_dict(dict_, 1)) + +self.assertEquals(KeyNotFound, get_from_dict(dict_, (1, 2, 0))) +self.assertEquals(KeyNotFound, get_from_dict(dict_, [1, 2, 0])) +self.assertEquals(KeyNotFound, get_from_dict(dict_, (1, 0, 3))) +self.assertEquals(KeyNotFound, get_from_dict(dict_, (1, 2, 3, 4))) +self.assertEquals(KeyNotFound, get_from_dict(dict_, (0, 2))) + +self.assertEquals('default', get_from_dict(dict_, (0, 2, 3), default_value='default')) +self.assertEquals('default', get_from_dict(empty_dict, (0, 2, 3), default_value='default')) + +self.assertEquals(KeyNotFound, get_from_dict(empty_dict, [1])) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/55c1dc5c/ambari-common/src/main/python/resource_management/libraries/functions/data_structure_utils.py -- diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/data_structure_utils.py b/ambari-common/src/main/python/resource_management/libraries/functions/data_structure_utils.py new file mode 100644 index 000..59e01aa --- /dev/null +++ b/ambari-common/src/main/python/resource_management/libraries/functions/data_structure_utils.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python +""" +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
[26/32] ambari git commit: AMBARI-18549. oozie server start fails post upgrade to Ambari 2.4.1 (aonishuk)
AMBARI-18549. oozie server start fails post upgrade to Ambari 2.4.1 (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/49c9660c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/49c9660c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/49c9660c Branch: refs/heads/branch-dev-patch-upgrade Commit: 49c9660c39c379b5568f9cff2d0fad44bde03222 Parents: 56e00ac Author: Andrew OnishukAuthored: Thu Oct 6 19:24:08 2016 +0300 Committer: Andrew Onishuk Committed: Thu Oct 6 19:24:08 2016 +0300 -- .../OOZIE/4.0.0.2.0/package/scripts/oozie_service.py | 5 + .../src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py | 8 2 files changed, 13 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/49c9660c/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_service.py -- diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_service.py b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_service.py index 5c97727..3257653 100644 --- a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_service.py +++ b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_service.py @@ -170,6 +170,11 @@ def oozie_service(action = 'start', upgrade_type=None): raise elif action == 'stop': +Directory(params.oozie_tmp_dir, + owner=params.oozie_user, + create_parents = True, +) + stop_cmd = format("cd {oozie_tmp_dir} && {oozie_home}/bin/oozied.sh stop 60 -force") try: http://git-wip-us.apache.org/repos/asf/ambari/blob/49c9660c/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py -- diff --git a/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py b/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py index b0cc2e9..2a512f4 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py +++ b/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py @@ -576,6 +576,10 @@ class TestOozieServer(RMFTestCase): stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) +self.assertResourceCalled('Directory', '/var/tmp/oozie', +owner = 'oozie', +create_parents = True, +) self.assertResourceCalled('Execute', 'cd /var/tmp/oozie && /usr/lib/oozie/bin/oozied.sh stop 60 -force', environment = {'OOZIE_CONFIG': '/etc/oozie/conf'}, only_if = "ambari-sudo.sh su oozie -l -s /bin/bash -c '[RMF_EXPORT_PLACEHOLDER]ls /var/run/oozie/oozie.pid >/dev/null 2>&1 && ps -p `cat /var/run/oozie/oozie.pid` >/dev/null 2>&1'", @@ -706,6 +710,10 @@ class TestOozieServer(RMFTestCase): stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) +self.assertResourceCalled('Directory', '/var/tmp/oozie', +owner = 'oozie', +create_parents = True, +) self.assertResourceCalled('Execute', 'cd /var/tmp/oozie && /usr/lib/oozie/bin/oozied.sh stop 60 -force', environment = {'OOZIE_CONFIG': '/etc/oozie/conf'}, only_if = "ambari-sudo.sh su oozie -l -s /bin/bash -c '[RMF_EXPORT_PLACEHOLDER]ls /var/run/oozie/oozie.pid >/dev/null 2>&1 && ps -p `cat /var/run/oozie/oozie.pid` >/dev/null 2>&1'",
[24/32] ambari git commit: AMBARI-18536. Components can't be started because of failed webhdfs request (aonishuk)
AMBARI-18536. Components can't be started because of failed webhdfs request (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8b6e45e6 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8b6e45e6 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8b6e45e6 Branch: refs/heads/branch-dev-patch-upgrade Commit: 8b6e45e6220bd0304f3ce1cda1b7245ebb322669 Parents: 714d9b5 Author: Andrew OnishukAuthored: Thu Oct 6 07:34:17 2016 +0300 Committer: Andrew Onishuk Committed: Thu Oct 6 07:34:17 2016 +0300 -- .../resource_management/libraries/providers/hdfs_resource.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/8b6e45e6/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py -- diff --git a/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py b/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py index ee41195..f1aa3e1 100644 --- a/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py +++ b/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py @@ -169,7 +169,7 @@ class WebHDFSUtil: cmd = ["curl", "-sS","-L", "-w", "%{http_code}", "-X", method] if file_to_put: - cmd += ["--data-binary", "@"+file_to_put] + cmd += ["--data-binary", "@"+file_to_put, "-H", "Content-Type: application/octet-stream"] if self.security_enabled: cmd += ["--negotiate", "-u", ":"] if self.is_https_enabled:
[19/32] ambari git commit: Revert "AMBARI-14439. Categorize unit tests so can run mvn test -P $PROFILE (alejandro)" This reverts commit 1f7edfba8358ad3f07b168ec5c7f2245e01016d8. This reverts commit ee
Revert "AMBARI-14439. Categorize unit tests so can run mvn test -P $PROFILE (alejandro)" This reverts commit 1f7edfba8358ad3f07b168ec5c7f2245e01016d8. This reverts commit ee02ad9c984b5a15eea13a175e212c0e1f6ff1c2. Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d7a914b3 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d7a914b3 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d7a914b3 Branch: refs/heads/branch-dev-patch-upgrade Commit: d7a914b3ba72630e3301ce23a40d099ceffaf98b Parents: 713f413 Author: Alejandro FernandezAuthored: Wed Oct 5 14:40:48 2016 -0700 Committer: Alejandro Fernandez Committed: Wed Oct 5 14:50:34 2016 -0700 -- ambari-logsearch/pom.xml| 13 --- .../ambari-metrics-timelineservice/pom.xml | 9 -- ambari-metrics/pom.xml | 27 +- ambari-server/pom.xml | 11 --- .../alerts/AggregateAlertListenerTest.java | 2 - .../alerts/AlertDefinitionEqualityTest.java | 2 - .../state/alerts/AlertDefinitionHashTest.java | 2 - .../state/alerts/AlertEventPublisherTest.java | 2 - .../state/alerts/AlertReceivedListenerTest.java | 2 - .../alerts/AlertStateChangedEventTest.java | 2 - .../state/alerts/InitialAlertEventTest.java | 2 - .../KerberosComponentDescriptorTest.java| 2 - .../KerberosConfigurationDescriptorTest.java| 2 - .../state/kerberos/KerberosDescriptorTest.java | 2 - .../KerberosDescriptorUpdateHelperTest.java | 2 - .../KerberosIdentityDescriptorTest.java | 2 - .../kerberos/KerberosKeytabDescriptorTest.java | 2 - .../KerberosPrincipalDescriptorTest.java| 2 - .../kerberos/KerberosServiceDescriptorTest.java | 2 - .../kerberos/VariableReplacementHelperTest.java | 2 - .../state/stack/ConfigUpgradePackTest.java | 2 - .../state/stack/ConfigUpgradeValidityTest.java | 2 - .../ambari/server/state/stack/OSFamilyTest.java | 3 - .../server/state/stack/UpgradePackTest.java | 2 - pom.xml | 86 +--- utility/pom.xml | 49 --- utility/src/main/java/category/AlertTest.java | 27 -- .../main/java/category/AmbariUpgradeTest.java | 27 -- .../src/main/java/category/BlueprintTest.java | 27 -- utility/src/main/java/category/FastTest.java| 27 -- .../src/main/java/category/KerberosTest.java| 27 -- utility/src/main/java/category/MetricsTest.java | 27 -- utility/src/main/java/category/SlowTest.java| 27 -- .../main/java/category/StackUpgradeTest.java| 27 -- 34 files changed, 3 insertions(+), 449 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/ambari-logsearch/pom.xml -- diff --git a/ambari-logsearch/pom.xml b/ambari-logsearch/pom.xml index a1b6c9d..0445c39 100644 --- a/ambari-logsearch/pom.xml +++ b/ambari-logsearch/pom.xml @@ -70,9 +70,6 @@ maven-surefire-plugin ${skipSurefireTests} - - - ${testcase.groups} @@ -177,14 +174,4 @@ - - - - utility - utility - 1.0.0.0-SNAPSHOT - test - - - http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/ambari-metrics/ambari-metrics-timelineservice/pom.xml -- diff --git a/ambari-metrics/ambari-metrics-timelineservice/pom.xml b/ambari-metrics/ambari-metrics-timelineservice/pom.xml index 6896c6b..87e3423 100644 --- a/ambari-metrics/ambari-metrics-timelineservice/pom.xml +++ b/ambari-metrics/ambari-metrics-timelineservice/pom.xml @@ -239,8 +239,6 @@ true always -XX:-UseSplitVerifier - - ${testcase.groups} @@ -630,13 +628,6 @@ test - - - utility - utility - 1.0.0.0-SNAPSHOT - test - http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/ambari-metrics/pom.xml -- diff --git a/ambari-metrics/pom.xml b/ambari-metrics/pom.xml index 80c99dc..6ab8c60 100644 --- a/ambari-metrics/pom.xml +++ b/ambari-metrics/pom.xml @@ -31,7 +31,6 @@ ambari-metrics-host-monitoring ambari-metrics-grafana ambari-metrics-assembly -../utility UTF-8 @@ -169,9 +168,6 @@ maven-surefire-plugin ${skipSurefireTests} - - - ${testcase.groups} @@ -301,28 +297,7 @@ - - - utility -
[30/32] ambari git commit: AMBARI-18537. Update Mirosoft R version in mpack (Balázs Bence Sári via magyari_sandor)
AMBARI-18537. Update Mirosoft R version in mpack (Balázs Bence Sári via magyari_sandor) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c153cfb6 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c153cfb6 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c153cfb6 Branch: refs/heads/branch-dev-patch-upgrade Commit: c153cfb635fc51096c1d350ec6e23e5d5162bef7 Parents: b81deb0 Author: Balázs Bence SáriAuthored: Fri Oct 7 11:28:51 2016 +0200 Committer: Sandor Magyari Committed: Fri Oct 7 11:28:51 2016 +0200 -- .../MICROSOFT_R/8.0.0/kerberos.json | 15 .../MICROSOFT_R/8.0.0/metainfo.xml | 53 .../package/files/microsoft_r_serviceCheck.r| 28 -- .../8.0.0/package/scripts/microsoft_r.py| 47 --- .../MICROSOFT_R/8.0.0/package/scripts/params.py | 31 --- .../8.0.0/package/scripts/params_linux.py | 79 - .../8.0.0/package/scripts/params_windows.py | 26 -- .../8.0.0/package/scripts/service_check.py | 89 .../MICROSOFT_R/8.0.0/role_command_order.json | 6 -- .../MICROSOFT_R/8.0.0/service_advisor.py| 73 .../MICROSOFT_R/8.0.5/kerberos.json | 15 .../MICROSOFT_R/8.0.5/metainfo.xml | 53 .../package/files/microsoft_r_serviceCheck.r| 28 ++ .../8.0.5/package/scripts/microsoft_r.py| 47 +++ .../MICROSOFT_R/8.0.5/package/scripts/params.py | 31 +++ .../8.0.5/package/scripts/params_linux.py | 79 + .../8.0.5/package/scripts/params_windows.py | 26 ++ .../8.0.5/package/scripts/service_check.py | 89 .../MICROSOFT_R/8.0.5/role_command_order.json | 6 ++ .../MICROSOFT_R/8.0.5/service_advisor.py| 73 .../MICROSOFT_R/8.0.0/metainfo.xml | 28 -- .../MICROSOFT_R/8.0.0/repos/repoinfo.xml| 33 .../MICROSOFT_R/8.0.5/metainfo.xml | 28 ++ .../MICROSOFT_R/8.0.5/repos/repoinfo.xml| 33 .../src/main/resources/mpack.json | 2 +- 25 files changed, 509 insertions(+), 509 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/c153cfb6/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/kerberos.json -- diff --git a/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/kerberos.json b/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/kerberos.json deleted file mode 100644 index 86fab2d..000 --- a/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/kerberos.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "services": [ -{ - "name": "MICROSOFT_R", - "identities": [ -{ - "name": "/HDFS/NAMENODE/hdfs" -}, -{ - "name": "/smokeuser" -} - ] -} - ] -} http://git-wip-us.apache.org/repos/asf/ambari/blob/c153cfb6/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/metainfo.xml -- diff --git a/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/metainfo.xml b/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/metainfo.xml deleted file mode 100644 index 709929e..000 --- a/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/metainfo.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - 2.0 - - - MICROSOFT_R - Microsoft R - Microsoft R Server - 8.0.0 - - - - MICROSOFT_R_SERVER_CLIENT - Microsoft R Server Client - CLIENT - 1+ - -scripts/microsoft_r.py -PYTHON -1200 - - - - - -scripts/service_check.py -PYTHON -300 - - - -YARN - - - - http://git-wip-us.apache.org/repos/asf/ambari/blob/c153cfb6/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/package/files/microsoft_r_serviceCheck.r -- diff --git a/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/package/files/microsoft_r_serviceCheck.r
[01/32] ambari git commit: AMBARI-18501. If ambari-server fails to start, appropriate error message should be displayed.(vbrodetskyi)
Repository: ambari Updated Branches: refs/heads/branch-dev-patch-upgrade e6d8cd119 -> 964808275 AMBARI-18501. If ambari-server fails to start, appropriate error message should be displayed.(vbrodetskyi) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/98ba7e07 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/98ba7e07 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/98ba7e07 Branch: refs/heads/branch-dev-patch-upgrade Commit: 98ba7e075458404f63e2ca16c73068a6df32a800 Parents: ee02ad9 Author: Vitaly BrodetskyiAuthored: Mon Oct 3 15:26:52 2016 +0300 Committer: Vitaly Brodetskyi Committed: Mon Oct 3 15:26:52 2016 +0300 -- .../src/main/python/ambari_server/utils.py | 42 +++- .../src/main/python/ambari_server_main.py | 12 -- ambari-server/src/test/python/TestUtils.py | 12 -- 3 files changed, 57 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/98ba7e07/ambari-server/src/main/python/ambari_server/utils.py -- diff --git a/ambari-server/src/main/python/ambari_server/utils.py b/ambari-server/src/main/python/ambari_server/utils.py index 012d428..c0bacc8 100644 --- a/ambari-server/src/main/python/ambari_server/utils.py +++ b/ambari-server/src/main/python/ambari_server/utils.py @@ -26,6 +26,8 @@ import time import glob import subprocess from ambari_commons import OSConst,OSCheck +from ambari_commons.logging_utils import print_error_msg +from ambari_commons.exceptions import FatalException # PostgreSQL settings PG_STATUS_RUNNING_DEFAULT = "running" @@ -139,13 +141,21 @@ def save_main_pid_ex(pids, pidfile, exclude_list=[], kill_exclude_list=False, sk pass -def wait_for_pid(pids, timeout): +def wait_for_pid(pids, server_init_timeout, occupy_port_timeout, init_web_ui_timeout, properties): """ Check pid for existence during timeout """ + ambari_server_ui_port = 8080 + api_ssl = properties.get_property("api.ssl") + ssl_api_port = properties.get_property("client.api.ssl.port") + if api_ssl and str(api_ssl).lower() == "true": +if ssl_api_port: + ambari_server_ui_port = int(ssl_api_port) + + server_ui_port_occupied = False tstart = time.time() pid_live = 0 - while int(time.time()-tstart) <= timeout and len(pids) > 0: + while int(time.time()-tstart) <= occupy_port_timeout and len(pids) > 0: sys.stdout.write('.') sys.stdout.flush() pid_live = 0 @@ -153,6 +163,34 @@ def wait_for_pid(pids, timeout): if pid_exists(item["pid"]): pid_live += 1 time.sleep(1) + +try: + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + sock.settimeout(1) + sock.connect(('localhost', ambari_server_ui_port)) + print "\nServer started listening on " + str(ambari_server_ui_port) + server_ui_port_occupied = True + break +except Exception as e: + #print str(e) + pass + + if not server_ui_port_occupied: +raise FatalException(1, "Server not yet listening on http port " + str(ambari_server_ui_port) + +" after " + str(occupy_port_timeout) + str(server_init_timeout) + " seconds. Exiting.") + + tstart = time.time() + print "Waiting for 10 seconds, for server WEB UI initialization" + while int(time.time()-tstart) <= init_web_ui_timeout and len(pids) > 0: +sys.stdout.write('.') +sys.stdout.flush() +pid_live = 0 +for item in pids: + if pid_exists(item["pid"]): +pid_live += 1 +time.sleep(1) + + return pid_live http://git-wip-us.apache.org/repos/asf/ambari/blob/98ba7e07/ambari-server/src/main/python/ambari_server_main.py -- diff --git a/ambari-server/src/main/python/ambari_server_main.py b/ambari-server/src/main/python/ambari_server_main.py index 57ec58d..a2b50a6 100644 --- a/ambari-server/src/main/python/ambari_server_main.py +++ b/ambari-server/src/main/python/ambari_server_main.py @@ -101,8 +101,9 @@ SERVER_START_CMD_DEBUG_WINDOWS = "{0} " \ "-cp {3} " \ "org.apache.ambari.server.controller.AmbariServer" -SERVER_INIT_TIMEOUT = 5 -SERVER_START_TIMEOUT = 10 +SERVER_INIT_TIMEOUT = 5 #seconds +WEB_UI_INIT_TIME = 10 #seconds +SERVER_START_TIMEOUT = 50 #seconds SERVER_PING_TIMEOUT_WINDOWS = 5 SERVER_PING_ATTEMPTS_WINDOWS = 4 @@ -197,12 +198,17 @@ def wait_for_server_start(pidFile, scmStatus): @OsFamilyFuncImpl(OsFamilyImpl.DEFAULT) def wait_for_server_start(pidFile, scmStatus): + properties = get_ambari_properties() + if properties == -1: +err ="Error getting ambari properties" +raise FatalException(-1, err) +
[03/32] ambari git commit: AMBARI-14439. Categorize unit tests so can run mvn test -P $PROFILE (alejandro)
AMBARI-14439. Categorize unit tests so can run mvn test -P $PROFILE (alejandro) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ee02ad9c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ee02ad9c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ee02ad9c Branch: refs/heads/branch-dev-patch-upgrade Commit: ee02ad9c984b5a15eea13a175e212c0e1f6ff1c2 Parents: 7ac93f3 Author: Alejandro FernandezAuthored: Thu Sep 29 13:35:13 2016 -0700 Committer: Alejandro Fernandez Committed: Mon Oct 3 13:30:19 2016 -0700 -- ambari-logsearch/pom.xml| 13 +++ .../ambari-metrics-timelineservice/pom.xml | 9 ++ ambari-metrics/pom.xml | 26 +- ambari-server/pom.xml | 11 +++ .../alerts/AggregateAlertListenerTest.java | 2 + .../alerts/AlertDefinitionEqualityTest.java | 2 + .../state/alerts/AlertDefinitionHashTest.java | 2 + .../state/alerts/AlertEventPublisherTest.java | 2 + .../state/alerts/AlertReceivedListenerTest.java | 2 + .../alerts/AlertStateChangedEventTest.java | 2 + .../state/alerts/InitialAlertEventTest.java | 2 + .../KerberosComponentDescriptorTest.java| 2 + .../KerberosConfigurationDescriptorTest.java| 2 + .../state/kerberos/KerberosDescriptorTest.java | 2 + .../KerberosDescriptorUpdateHelperTest.java | 2 + .../KerberosIdentityDescriptorTest.java | 2 + .../kerberos/KerberosKeytabDescriptorTest.java | 2 + .../KerberosPrincipalDescriptorTest.java| 2 + .../kerberos/KerberosServiceDescriptorTest.java | 2 + .../kerberos/VariableReplacementHelperTest.java | 2 + .../state/stack/ConfigUpgradePackTest.java | 2 + .../state/stack/ConfigUpgradeValidityTest.java | 2 + .../ambari/server/state/stack/OSFamilyTest.java | 3 + .../server/state/stack/UpgradePackTest.java | 2 + pom.xml | 92 +++- utility/pom.xml | 19 utility/src/main/java/category/AlertTest.java | 27 ++ .../main/java/category/AmbariUpgradeTest.java | 27 ++ .../src/main/java/category/BlueprintTest.java | 27 ++ utility/src/main/java/category/FastTest.java| 27 ++ .../src/main/java/category/KerberosTest.java| 27 ++ utility/src/main/java/category/MetricsTest.java | 27 ++ utility/src/main/java/category/SlowTest.java| 27 ++ .../main/java/category/StackUpgradeTest.java| 27 ++ 34 files changed, 424 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/ee02ad9c/ambari-logsearch/pom.xml -- diff --git a/ambari-logsearch/pom.xml b/ambari-logsearch/pom.xml index 0445c39..a1b6c9d 100644 --- a/ambari-logsearch/pom.xml +++ b/ambari-logsearch/pom.xml @@ -70,6 +70,9 @@ maven-surefire-plugin ${skipSurefireTests} + + + ${testcase.groups} @@ -174,4 +177,14 @@ + + + + utility + utility + 1.0.0.0-SNAPSHOT + test + + + http://git-wip-us.apache.org/repos/asf/ambari/blob/ee02ad9c/ambari-metrics/ambari-metrics-timelineservice/pom.xml -- diff --git a/ambari-metrics/ambari-metrics-timelineservice/pom.xml b/ambari-metrics/ambari-metrics-timelineservice/pom.xml index 87e3423..6896c6b 100644 --- a/ambari-metrics/ambari-metrics-timelineservice/pom.xml +++ b/ambari-metrics/ambari-metrics-timelineservice/pom.xml @@ -239,6 +239,8 @@ true always -XX:-UseSplitVerifier + + ${testcase.groups} @@ -628,6 +630,13 @@ test + + + utility + utility + 1.0.0.0-SNAPSHOT + test + http://git-wip-us.apache.org/repos/asf/ambari/blob/ee02ad9c/ambari-metrics/pom.xml -- diff --git a/ambari-metrics/pom.xml b/ambari-metrics/pom.xml index 6ab8c60..a010f47 100644 --- a/ambari-metrics/pom.xml +++ b/ambari-metrics/pom.xml @@ -168,6 +168,9 @@ maven-surefire-plugin ${skipSurefireTests} + + + ${testcase.groups} @@ -297,7 +300,28 @@ + + + utility + utility + 1.0.0.0-SNAPSHOT + test + - + + + FastTests + +category.FastTest + + + + utility + utility + 1.0.0.0-SNAPSHOT + + + +
[04/32] ambari git commit: AMBARI-18506 Ambari should present message if stack upgrade path is not available
AMBARI-18506 Ambari should present message if stack upgrade path is not available Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/26949484 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/26949484 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/26949484 Branch: refs/heads/branch-dev-patch-upgrade Commit: 269494849cad6d0a56dddaf52316e1d84b08d49f Parents: 98ba7e0 Author: Andrii TkachAuthored: Fri Sep 30 17:04:30 2016 +0300 Committer: Andrii Tkach Committed: Tue Oct 4 17:11:46 2016 +0300 -- ambari-web/app/assets/test/tests.js | 1 + .../main/admin/stack_and_upgrade_controller.js | 45 +--- .../app/mappers/repository_version_mapper.js| 28 +++- ambari-web/app/messages.js | 1 + .../models/stack_version/repository_version.js | 6 ++ .../admin/stack_upgrade/upgrade_version_box.hbs | 2 +- .../stack_upgrade/upgrade_version_column.hbs| 2 +- ambari-web/app/utils/ajax/ajax.js | 5 ++ .../stack_upgrade/upgrade_version_box_view.js | 6 ++ .../upgrade_version_column_view.js | 6 +- .../admin/stack_and_upgrade_controller_test.js | 74 +++- .../mappers/repository_version_mapper_test.js | 46 .../upgrade_version_box_view_test.js| 23 -- 13 files changed, 223 insertions(+), 22 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/26949484/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 78c6196..92def58 100644 --- a/ambari-web/app/assets/test/tests.js +++ b/ambari-web/app/assets/test/tests.js @@ -148,6 +148,7 @@ var files = [ 'test/mappers/users_mapper_test', 'test/mappers/stack_mapper_test', 'test/mappers/stack_service_mapper_test', + 'test/mappers/repository_version_mapper_test', 'test/mappers/stack_upgrade_history_mapper_test', 'test/mappers/configs/config_groups_mapper_test', 'test/mappers/configs/service_config_version_mapper_test', http://git-wip-us.apache.org/repos/asf/ambari/blob/26949484/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js -- diff --git a/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js b/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js index bbf7523..56a7a61 100644 --- a/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js +++ b/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js @@ -241,8 +241,8 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage, * @type {String} */ realRepoUrl: function () { -return App.get('apiPrefix') + App.get('stackVersionURL') + - '/compatible_repository_versions?fields=*,operating_systems/*,operating_systems/repositories/*'; +return App.get('apiPrefix') + '/stacks?fields=versions/repository_versions/RepositoryVersions,' + + 'versions/repository_versions/operating_systems/*,versions/repository_versions/operating_systems/repositories/*'; }.property('App.stackVersionURL'), /** @@ -329,14 +329,16 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage, this.loadUpgradeData(true).done(function() { self.loadStackVersionsToModel(true).done(function () { self.loadRepoVersionsToModel().done(function() { - var currentVersion = App.StackVersion.find().findProperty('state', 'CURRENT'); - if (currentVersion) { -self.set('currentVersion', { - repository_version: currentVersion.get('repositoryVersion.repositoryVersion'), - repository_name: currentVersion.get('repositoryVersion.displayName') -}); - } - dfd.resolve(); + self.loadCompatibleVersions().done(function() { +var currentVersion = App.StackVersion.find().findProperty('state', 'CURRENT'); +if (currentVersion) { + self.set('currentVersion', { +repository_version: currentVersion.get('repositoryVersion.repositoryVersion'), +repository_name: currentVersion.get('repositoryVersion.displayName') + }); +} +dfd.resolve(); + }); }); }); }); @@ -395,6 +397,29 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage, } }, + loadCompatibleVersions: function() { +return App.ajax.send({ + name: 'admin.upgrade.get_compatible_versions', + sender: this, + data: { +stackName:
[13/32] ambari git commit: AMBARI-18313. Capacity Scheduler View: Xml diff view tool to show changes made and queue capacity chart (Akhil PB via pallavkul)
AMBARI-18313. Capacity Scheduler View: Xml diff view tool to show changes made and queue capacity chart (Akhil PB via pallavkul) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/62dc775e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/62dc775e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/62dc775e Branch: refs/heads/branch-dev-patch-upgrade Commit: 62dc775ee4156e1a43ce0b991f3f47f68155128d Parents: 26660f2 Author: Pallav KulshreshthaAuthored: Wed Oct 5 15:32:19 2016 +0530 Committer: Pallav Kulshreshtha Committed: Wed Oct 5 15:32:19 2016 +0530 -- .../src/main/resources/ui/app/components.js | 2 + .../ui/app/components/labelCapacityBar.js | 12 +- .../resources/ui/app/components/queueBadge.js | 6 +- .../ui/app/components/queueHierarchy.js | 11 + .../resources/ui/app/components/queueMapping.js | 25 +- .../resources/ui/app/components/queueSummary.js | 23 +- .../ui/app/components/sunburstChart.js | 339 +++ .../ui/app/components/xmldiffViewer.js | 101 ++ .../resources/ui/app/controllers/advanced.js| 21 +- .../resources/ui/app/controllers/capsched.js| 39 ++- .../resources/ui/app/controllers/editqueue.js | 66 +++- .../resources/ui/app/controllers/queuesconf.js | 106 +- .../resources/ui/app/controllers/scheduler.js | 21 +- .../src/main/resources/ui/app/models/queue.js | 9 +- .../src/main/resources/ui/app/router.js | 49 ++- .../resources/ui/app/styles/application.less| 59 .../src/main/resources/ui/app/templates.js | 2 + .../resources/ui/app/templates/capsched.hbs | 6 + .../ui/app/templates/capsched/advanced.hbs | 13 +- .../capsched/partials/accessControlList.hbs | 4 +- .../capsched/partials/labelCapacity.hbs | 4 +- .../templates/capsched/partials/preemption.hbs | 4 +- .../capsched/partials/queueCapacity.hbs | 34 +- .../capsched/partials/queueResources.hbs| 4 +- .../ui/app/templates/capsched/queuesconf.hbs| 15 +- .../ui/app/templates/capsched/scheduler.hbs | 6 +- .../app/templates/components/queueHierarchy.hbs | 8 +- .../app/templates/components/queueMapping.hbs | 14 +- .../app/templates/components/queueSummary.hbs | 13 - .../app/templates/components/sunburstChart.hbs | 44 +++ .../app/templates/components/xmldiffViewer.hbs | 41 +++ .../src/main/resources/ui/bower.json| 13 +- 32 files changed, 1003 insertions(+), 111 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/62dc775e/contrib/views/capacity-scheduler/src/main/resources/ui/app/components.js -- diff --git a/contrib/views/capacity-scheduler/src/main/resources/ui/app/components.js b/contrib/views/capacity-scheduler/src/main/resources/ui/app/components.js index 8dd7108..8cf9a64 100644 --- a/contrib/views/capacity-scheduler/src/main/resources/ui/app/components.js +++ b/contrib/views/capacity-scheduler/src/main/resources/ui/app/components.js @@ -39,3 +39,5 @@ require('components/editLabelCapacity'); require('components/editQueueCapacity'); require('components/labelCapacityBar'); require('components/displayNodeLabels'); +require('components/xmldiffViewer'); +require('components/sunburstChart'); http://git-wip-us.apache.org/repos/asf/ambari/blob/62dc775e/contrib/views/capacity-scheduler/src/main/resources/ui/app/components/labelCapacityBar.js -- diff --git a/contrib/views/capacity-scheduler/src/main/resources/ui/app/components/labelCapacityBar.js b/contrib/views/capacity-scheduler/src/main/resources/ui/app/components/labelCapacityBar.js index 7776452..032b2ec 100644 --- a/contrib/views/capacity-scheduler/src/main/resources/ui/app/components/labelCapacityBar.js +++ b/contrib/views/capacity-scheduler/src/main/resources/ui/app/components/labelCapacityBar.js @@ -49,10 +49,14 @@ App.LabelCapacityBarComponent = Ember.Component.extend({ warnInvalidLabelCapacity: function() { var totalCap = this.get('childrenQueueLabelsTotalCapacity'); -var isInvalid = false; -if (totalCap > 100 || totalCap < 100) { - isInvalid = true; -} +var isInvalid = totalCap !== 100; +this.get('labels').forEach(function(label) { + if (isInvalid) { +label.set('overCapMessage', 'Invalid Total Capacity for label: '+label.get('name')); + } else { +label.set('overCapMessage', undefined); + } +}); this.get('labels').setEach('overCapacity', isInvalid); this.set('warnInvalidTotalLabelCapacity', isInvalid); return isInvalid;
[18/32] ambari git commit: AMBARI-18527 HostCleanup.py to be able to resolve wildcards in a dir or file path to a list of dirs and files (dili)
AMBARI-18527 HostCleanup.py to be able to resolve wildcards in a dir or file path to a list of dirs and files (dili) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/713f413c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/713f413c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/713f413c Branch: refs/heads/branch-dev-patch-upgrade Commit: 713f413c35c15d08f91bea619ecd7e9d1e877b9b Parents: 1f7edfb Author: Di LiAuthored: Wed Oct 5 16:19:10 2016 -0400 Committer: Di Li Committed: Wed Oct 5 16:19:10 2016 -0400 -- .../src/main/python/ambari_agent/HostCleanup.py | 32 1 file changed, 20 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/713f413c/ambari-agent/src/main/python/ambari_agent/HostCleanup.py -- diff --git a/ambari-agent/src/main/python/ambari_agent/HostCleanup.py b/ambari-agent/src/main/python/ambari_agent/HostCleanup.py index a3c72e6..cca79a8 100644 --- a/ambari-agent/src/main/python/ambari_agent/HostCleanup.py +++ b/ambari-agent/src/main/python/ambari_agent/HostCleanup.py @@ -35,6 +35,7 @@ import optparse import shlex import datetime import tempfile +import glob from AmbariConfig import AmbariConfig from ambari_agent.Constants import AGENT_TMP_DIR from ambari_commons import OSCheck, OSConst @@ -388,18 +389,25 @@ class HostCleanup: def do_erase_dir_silent(self, pathList): if pathList: - for path in pathList: -if path and os.path.exists(path): - if os.path.isdir(path): -try: - shutil.rmtree(path) -except: - logger.warn("Failed to remove dir: " + path + ", error: " + str(sys.exc_info()[0])) - else: -logger.info(path + " is a file and not a directory, deleting file") -self.do_erase_files_silent([path]) -else: - logger.info("Path doesn't exists: " + path) + for aPath in pathList: +pathArr = glob.glob(aPath) +logger.debug("Resolved {0} to {1}".format(aPath, ','.join(pathArr))) +for path in pathArr: + if path: +if os.path.exists(path): + if os.path.isdir(path): +try: + shutil.rmtree(path) +except: + logger.warn("Failed to remove dir {0} , error: {1}".format(path, str(sys.exc_info()[0]))) + else: +logger.info("{0} is a file, deleting file".format(path)) +self.do_erase_files_silent([path]) +elif os.path.islink(path): + logger.info("Deleting broken symbolic link {0}".format(path)) + self.do_erase_files_silent([path]) +else: + logger.info("Path doesn't exists: {0}".format(path)) return 0 def do_erase_files_silent(self, pathList):
[23/32] ambari git commit: AMBARI-18516. Add ability to have services declare itself as tech-preview or mandatory.(vbrodetskyi)
AMBARI-18516. Add ability to have services declare itself as tech-preview or mandatory.(vbrodetskyi) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/56e00acd Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/56e00acd Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/56e00acd Branch: refs/heads/branch-dev-patch-upgrade Commit: 56e00acdc8d7357ba811fcd4dca4fbb23bad33be Parents: 46cb402 Author: Vitaly BrodetskyiAuthored: Thu Oct 6 04:59:49 2016 +0300 Committer: Vitaly Brodetskyi Committed: Thu Oct 6 04:59:49 2016 +0300 -- .../server/controller/StackServiceResponse.java | 16 +-- .../internal/StackServiceResourceProvider.java | 6 .../ambari/server/stack/ServiceModule.java | 6 +++- .../apache/ambari/server/state/ServiceInfo.java | 27 ++ .../src/main/resources/properties.json | 1 + .../ambari/server/stack/ServiceModuleTest.java | 19 + .../ambari/server/state/ServiceInfoTest.java| 30 7 files changed, 101 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/56e00acd/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceResponse.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceResponse.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceResponse.java index 5865e20..75f65c0 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceResponse.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceResponse.java @@ -38,6 +38,7 @@ public class StackServiceResponse { private String userName; private String comments; private String serviceVersion; + private ServiceInfo.Selection selection; private boolean serviceCheckSupported; private List customCommands; @@ -73,6 +74,7 @@ public class StackServiceResponse { excludedConfigTypes = service.getExcludedConfigTypes(); requiredServices = service.getRequiredServices(); serviceCheckSupported = null != service.getCommandScript(); +selection = service.getSelection(); // the custom command names defined at the service (not component) level List definitions = service.getCustomCommands(); @@ -90,6 +92,14 @@ public class StackServiceResponse { serviceProperties = service.getServiceProperties(); } + public ServiceInfo.Selection getSelection() { +return selection; + } + + public void setSelection(ServiceInfo.Selection selection) { +this.selection = selection; + } + public String getStackName() { return stackName; } @@ -115,14 +125,14 @@ public class StackServiceResponse { } public String getServiceType() { - return serviceType; +return serviceType; } public void setServiceType(String serviceType) { - this.serviceType = serviceType; +this.serviceType = serviceType; } -public String getServiceDisplayName() { + public String getServiceDisplayName() { return serviceDisplayName; } http://git-wip-us.apache.org/repos/asf/ambari/blob/56e00acd/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackServiceResourceProvider.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackServiceResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackServiceResourceProvider.java index 16713dd..0fc65eb 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackServiceResourceProvider.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackServiceResourceProvider.java @@ -67,6 +67,9 @@ public class StackServiceResourceProvider extends ReadOnlyResourceProvider { private static final String COMMENTS_PROPERTY_ID = PropertyHelper.getPropertyId( "StackServices", "comments"); + private static final String SELECTION_PROPERTY_ID = PropertyHelper.getPropertyId( + "StackServices", "selection"); + private static final String VERSION_PROPERTY_ID = PropertyHelper.getPropertyId( "StackServices", "service_version"); @@ -166,6 +169,9 @@ public class StackServiceResourceProvider extends ReadOnlyResourceProvider { setResourceProperty(resource, VERSION_PROPERTY_ID, response.getServiceVersion(), requestedIds); +setResourceProperty(resource, SELECTION_PROPERTY_ID, +response.getSelection(), requestedIds); + setResourceProperty(resource, CONFIG_TYPES,
[16/32] ambari git commit: AMBARI-18520: Ambari usernames should not be converted to lowercase before storing in the DB.
AMBARI-18520: Ambari usernames should not be converted to lowercase before storing in the DB. Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/76ea14ed Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/76ea14ed Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/76ea14ed Branch: refs/heads/branch-dev-patch-upgrade Commit: 76ea14ed31b27204907010100705eeaa2922e00e Parents: 2fc9a47 Author: Nahappan SomasundaramAuthored: Mon Oct 3 19:54:16 2016 -0700 Committer: Nahappan Somasundaram Committed: Wed Oct 5 08:45:00 2016 -0700 -- .../ambari/server/api/services/UserService.java | 2 +- .../internal/UserResourceProvider.java | 25 ++- .../predicate/ComparisonPredicate.java | 16 - .../controller/predicate/EqualsPredicate.java | 15 + .../server/security/authorization/User.java | 2 +- .../server/security/authorization/Users.java| 8 +-- .../server/api/services/UserServiceTest.java| 71 .../server/security/SecurityHelperImplTest.java | 4 +- .../AmbariUserAuthenticationFilterTest.java | 2 +- .../server/upgrade/UpgradeCatalog240Test.java | 6 +- 10 files changed, 65 insertions(+), 86 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/76ea14ed/ambari-server/src/main/java/org/apache/ambari/server/api/services/UserService.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/UserService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/UserService.java index c46c373..a0fccad 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/UserService.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/UserService.java @@ -172,6 +172,6 @@ public class UserService extends BaseService { */ private ResourceInstance createUserResource(String userName) { return createResource(Resource.Type.User, -Collections.singletonMap(Resource.Type.User, StringUtils.lowerCase(userName))); +Collections.singletonMap(Resource.Type.User, userName)); } } http://git-wip-us.apache.org/repos/asf/ambari/blob/76ea14ed/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserResourceProvider.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserResourceProvider.java index 0324d38..adf660b 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserResourceProvider.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserResourceProvider.java @@ -21,6 +21,7 @@ import org.apache.ambari.server.AmbariException; import org.apache.ambari.server.controller.AmbariManagementController; import org.apache.ambari.server.controller.UserRequest; import org.apache.ambari.server.controller.UserResponse; +import org.apache.ambari.server.controller.predicate.EqualsPredicate; import org.apache.ambari.server.controller.spi.*; import org.apache.ambari.server.controller.utilities.PropertyHelper; import org.apache.ambari.server.security.authorization.AuthorizationException; @@ -35,7 +36,7 @@ import java.util.Set; /** * Resource provider for user resources. */ -public class UserResourceProvider extends AbstractControllerResourceProvider { +public class UserResourceProvider extends AbstractControllerResourceProvider implements ResourcePredicateEvaluator { // - Property ID constants - @@ -188,6 +189,28 @@ public class UserResourceProvider extends AbstractControllerResourceProvider { return getRequestStatus(null); } + /** + * ResourcePredicateEvaluator implementation. If property type is User/user_name, + * we do a case insensitive comparison so that we can return the retrieved + * username when it differs only in case with respect to the requested username. + * + * @param predicate the predicate + * @param resource the resource + * + * @return + */ + @Override + public boolean evaluate(Predicate predicate, Resource resource) { +if (predicate instanceof EqualsPredicate) { + EqualsPredicate equalsPredicate = (EqualsPredicate)predicate; + String propertyId = equalsPredicate.getPropertyId(); + if (propertyId.equals(USER_USERNAME_PROPERTY_ID)) { +return equalsPredicate.evaluateIgnoreCase(resource); + } +} +return predicate.evaluate(resource); + } + @Override
[06/32] ambari git commit: AMBARI-18463. Regression: krb5JAASLogin.conf is not updated during secure BP install (rlevas)
AMBARI-18463. Regression: krb5JAASLogin.conf is not updated during secure BP install (rlevas) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1bf20690 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1bf20690 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1bf20690 Branch: refs/heads/branch-dev-patch-upgrade Commit: 1bf206907ea26eeeada640406ae2c130aa4140c9 Parents: 2694948 Author: Robert LevasAuthored: Tue Oct 4 13:15:43 2016 -0400 Committer: Robert Levas Committed: Tue Oct 4 13:16:08 2016 -0400 -- .../server/controller/KerberosHelperImpl.java | 243 ++- .../ConfigureAmbariIdentitiesServerAction.java | 190 +++ .../kerberos/FinalizeKerberosServerAction.java | 118 - .../kerberos/KerberosOperationHandler.java | 2 +- .../ambari/server/utils/ShellCommandUtil.java | 121 + .../resources/stacks/HDP/2.0.6/kerberos.json| 14 +- .../server/controller/KerberosHelperTest.java | 195 --- ...nfigureAmbariIdentitiesServerActionTest.java | 204 8 files changed, 936 insertions(+), 151 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/1bf20690/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 a3c6fd4..cd4a0b5 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 @@ -54,7 +54,6 @@ import org.apache.ambari.server.metadata.RoleCommandOrder; import org.apache.ambari.server.orm.dao.ArtifactDAO; import org.apache.ambari.server.orm.dao.KerberosPrincipalDAO; import org.apache.ambari.server.orm.entities.ArtifactEntity; -import org.apache.ambari.server.orm.entities.KerberosPrincipalEntity; import org.apache.ambari.server.security.credential.Credential; import org.apache.ambari.server.security.credential.PrincipalKeyCredential; import org.apache.ambari.server.security.encryption.CredentialStoreService; @@ -133,7 +132,7 @@ public class KerberosHelperImpl implements KerberosHelper { /** * The set of states a component may be in, indicating that is have been previously installed on * the cluster. - * + * * These values are important when trying to determine the state of the cluster when adding new components */ private static final Set PREVIOUSLY_INSTALLED_STATES = EnumSet.of(State.INSTALLED, State.STARTED, State.DISABLED); @@ -711,7 +710,7 @@ public class KerberosHelperImpl implements KerberosHelper { identityDescriptors = serviceDescriptor.getIdentities(true, filterContext); if (identityDescriptors != null) { for (KerberosIdentityDescriptor identityDescriptor : identityDescriptors) { -createUserIdentity(identityDescriptor, kerberosConfiguration, kerberosOperationHandler, configurations); +createIdentity(identityDescriptor, KerberosPrincipalType.USER, kerberosConfiguration, kerberosOperationHandler, configurations, null); } } @@ -719,7 +718,7 @@ public class KerberosHelperImpl implements KerberosHelper { identityDescriptors = componentDescriptor.getIdentities(true, filterContext); if (identityDescriptors != null) { for (KerberosIdentityDescriptor identityDescriptor : identityDescriptors) { -createUserIdentity(identityDescriptor, kerberosConfiguration, kerberosOperationHandler, configurations); +createIdentity(identityDescriptor, KerberosPrincipalType.USER, kerberosConfiguration, kerberosOperationHandler, configurations, null); } } } @@ -730,16 +729,7 @@ public class KerberosHelperImpl implements KerberosHelper { // create Ambari principal & keytab, configure JAAS only if 'kerberos-env.create_ambari_principal = true' if (kerberosDetails.createAmbariPrincipal()) { -KerberosIdentityDescriptor ambariServerIdentity = kerberosDescriptor.getIdentity(KerberosHelper.AMBARI_IDENTITY_NAME); -if (ambariServerIdentity != null) { - createUserIdentity(ambariServerIdentity, kerberosConfiguration, kerberosOperationHandler, configurations); - installAmbariIdentity(ambariServerIdentity, configurations); - try { -
[20/32] ambari git commit: AMBARI-14439. Categorize unit tests so can run mvn test -P $PROFILE (alejandro)
AMBARI-14439. Categorize unit tests so can run mvn test -P $PROFILE (alejandro) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8f8b26a1 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8f8b26a1 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8f8b26a1 Branch: refs/heads/branch-dev-patch-upgrade Commit: 8f8b26a1805e600bd0276733cf73aed9bc130b44 Parents: d7a914b Author: Alejandro FernandezAuthored: Wed Oct 5 16:14:38 2016 -0700 Committer: Alejandro Fernandez Committed: Wed Oct 5 16:14:41 2016 -0700 -- ambari-logsearch/pom.xml| 13 +++ .../ambari-metrics-timelineservice/pom.xml | 9 ++ ambari-metrics/pom.xml | 30 ++- ambari-server/pom.xml | 11 +++ .../alerts/AggregateAlertListenerTest.java | 2 + .../alerts/AlertDefinitionEqualityTest.java | 2 + .../state/alerts/AlertDefinitionHashTest.java | 2 + .../state/alerts/AlertEventPublisherTest.java | 2 + .../state/alerts/AlertReceivedListenerTest.java | 2 + .../alerts/AlertStateChangedEventTest.java | 2 + .../state/alerts/InitialAlertEventTest.java | 2 + .../KerberosComponentDescriptorTest.java| 2 + .../KerberosConfigurationDescriptorTest.java| 2 + .../state/kerberos/KerberosDescriptorTest.java | 2 + .../KerberosDescriptorUpdateHelperTest.java | 2 + .../KerberosIdentityDescriptorTest.java | 2 + .../kerberos/KerberosKeytabDescriptorTest.java | 2 + .../KerberosPrincipalDescriptorTest.java| 2 + .../kerberos/KerberosServiceDescriptorTest.java | 2 + .../kerberos/VariableReplacementHelperTest.java | 2 + .../state/stack/ConfigUpgradePackTest.java | 2 + .../state/stack/ConfigUpgradeValidityTest.java | 2 + .../ambari/server/state/stack/OSFamilyTest.java | 3 + .../server/state/stack/UpgradePackTest.java | 2 + pom.xml | 86 +++- utility/pom.xml | 49 +++ utility/src/main/java/category/AlertTest.java | 27 ++ .../main/java/category/AmbariUpgradeTest.java | 27 ++ .../src/main/java/category/BlueprintTest.java | 27 ++ utility/src/main/java/category/FastTest.java| 27 ++ .../src/main/java/category/KerberosTest.java| 27 ++ utility/src/main/java/category/MetricsTest.java | 27 ++ utility/src/main/java/category/SlowTest.java| 27 ++ .../main/java/category/StackUpgradeTest.java| 27 ++ 34 files changed, 451 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/ambari-logsearch/pom.xml -- diff --git a/ambari-logsearch/pom.xml b/ambari-logsearch/pom.xml index 0445c39..a1b6c9d 100644 --- a/ambari-logsearch/pom.xml +++ b/ambari-logsearch/pom.xml @@ -70,6 +70,9 @@ maven-surefire-plugin ${skipSurefireTests} + + + ${testcase.groups} @@ -174,4 +177,14 @@ + + + + utility + utility + 1.0.0.0-SNAPSHOT + test + + + http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/ambari-metrics/ambari-metrics-timelineservice/pom.xml -- diff --git a/ambari-metrics/ambari-metrics-timelineservice/pom.xml b/ambari-metrics/ambari-metrics-timelineservice/pom.xml index 87e3423..6896c6b 100644 --- a/ambari-metrics/ambari-metrics-timelineservice/pom.xml +++ b/ambari-metrics/ambari-metrics-timelineservice/pom.xml @@ -239,6 +239,8 @@ true always -XX:-UseSplitVerifier + + ${testcase.groups} @@ -628,6 +630,13 @@ test + + + utility + utility + 1.0.0.0-SNAPSHOT + test + http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/ambari-metrics/pom.xml -- diff --git a/ambari-metrics/pom.xml b/ambari-metrics/pom.xml index 6ab8c60..2d88912 100644 --- a/ambari-metrics/pom.xml +++ b/ambari-metrics/pom.xml @@ -14,13 +14,15 @@ 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. --->http://maven.apache.org/POM/4.0.0; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd;> +--> +http://maven.apache.org/POM/4.0.0;
[05/32] ambari git commit: AMBARI-18463. Regression: krb5JAASLogin.conf is not updated during secure BP install (rlevas)
http://git-wip-us.apache.org/repos/asf/ambari/blob/1bf20690/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/ConfigureAmbariIdentitiesServerActionTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/ConfigureAmbariIdentitiesServerActionTest.java b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/ConfigureAmbariIdentitiesServerActionTest.java new file mode 100644 index 000..439bcae --- /dev/null +++ b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/ConfigureAmbariIdentitiesServerActionTest.java @@ -0,0 +1,204 @@ +/* + * 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.kerberos; + +import com.google.inject.AbstractModule; +import com.google.inject.Guice; +import com.google.inject.Injector; +import junit.framework.Assert; +import org.apache.ambari.server.audit.AuditLogger; +import org.apache.ambari.server.controller.KerberosHelper; +import org.apache.ambari.server.orm.DBAccessor; +import org.apache.ambari.server.orm.dao.HostDAO; +import org.apache.ambari.server.orm.dao.KerberosPrincipalHostDAO; +import org.apache.ambari.server.orm.entities.HostEntity; +import org.apache.ambari.server.serveraction.ActionLog; +import org.apache.ambari.server.state.Clusters; +import org.apache.ambari.server.utils.StageUtils; +import org.apache.commons.io.FileUtils; +import org.easymock.EasyMockSupport; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; + +import javax.persistence.EntityManager; +import java.io.File; +import java.lang.reflect.Method; + +import static org.easymock.EasyMock.expect; +import static org.easymock.EasyMock.expectLastCall; + +public class ConfigureAmbariIdentitiesServerActionTest extends EasyMockSupport { + @Rule + public TemporaryFolder testFolder = new TemporaryFolder(); + + @Test + public void installAmbariServerIdentity() throws Exception { +installAmbariServerIdentity(createNiceMock(ActionLog.class), true); + } + + @Test + public void installAmbariServerIdentityWithNoAgentOnAmbariServer() throws Exception { +installAmbariServerIdentity(createNiceMock(ActionLog.class), false); + } + + @Test + public void installAmbariServerIdentityWithNullActionLog() throws Exception { +installAmbariServerIdentity(null, true); + } + + private void installAmbariServerIdentity(ActionLog actionLog, boolean ambariServerHasAgent) throws Exception { + +String principal = "ambari-ser...@example.com"; +File srcKeytabFile = testFolder.newFile(); +File destKeytabFile = new File(testFolder.getRoot().getAbsolutePath(), "ambari-server.keytab"); + +Injector injector = createInjector(); + +HostEntity hostEntity; + +if (ambariServerHasAgent) { + KerberosPrincipalHostDAO kerberosPrincipalHostDAO = injector.getInstance(KerberosPrincipalHostDAO.class); + expect(kerberosPrincipalHostDAO.exists(principal, 1L)).andReturn(false).once(); + kerberosPrincipalHostDAO.create(principal, 1L); + expectLastCall().once(); + + hostEntity = createMock(HostEntity.class); + expect(hostEntity.getHostId()).andReturn(1L).once(); +} else { + hostEntity = null; +} + +HostDAO hostDAO = injector.getInstance(HostDAO.class); + expect(hostDAO.findByName(StageUtils.getHostName())).andReturn(hostEntity).once(); + +// Mock the methods that do the actual file manipulation to avoid having to deal with ambari-sudo.sh used in +// ShellCommandUtil#mkdir, ShellCommandUtil#copyFile, etc.. +Method methodCopyFile = ConfigureAmbariIdentitiesServerAction.class.getDeclaredMethod("copyFile", +String.class, String.class); +Method methodSetFileACL = ConfigureAmbariIdentitiesServerAction.class.getDeclaredMethod("setFileACL", +String.class, String.class, boolean.class, boolean.class, String.class, boolean.class, boolean.class); + +ConfigureAmbariIdentitiesServerAction action = createMockBuilder(ConfigureAmbariIdentitiesServerAction.class) +.addMockedMethod(methodCopyFile) +
[17/32] ambari git commit: AMBARI-14439. ADDENDUM. Categorize unit tests so can run mvn test -P $PROFILE (alejandro)
AMBARI-14439. ADDENDUM. Categorize unit tests so can run mvn test -P $PROFILE (alejandro) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1f7edfba Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1f7edfba Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1f7edfba Branch: refs/heads/branch-dev-patch-upgrade Commit: 1f7edfba8358ad3f07b168ec5c7f2245e01016d8 Parents: 76ea14e Author: Alejandro FernandezAuthored: Wed Oct 5 12:53:52 2016 -0700 Committer: Alejandro Fernandez Committed: Wed Oct 5 12:53:55 2016 -0700 -- ambari-metrics/pom.xml | 1 + pom.xml| 6 -- utility/pom.xml| 34 -- 3 files changed, 33 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/1f7edfba/ambari-metrics/pom.xml -- diff --git a/ambari-metrics/pom.xml b/ambari-metrics/pom.xml index a010f47..80c99dc 100644 --- a/ambari-metrics/pom.xml +++ b/ambari-metrics/pom.xml @@ -31,6 +31,7 @@ ambari-metrics-host-monitoring ambari-metrics-grafana ambari-metrics-assembly +../utility UTF-8 http://git-wip-us.apache.org/repos/asf/ambari/blob/1f7edfba/pom.xml -- diff --git a/pom.xml b/pom.xml index 831089d..bd0aa7b 100644 --- a/pom.xml +++ b/pom.xml @@ -745,10 +745,4 @@ instead of a SNAPSHOT. --> - - - -utility - http://git-wip-us.apache.org/repos/asf/ambari/blob/1f7edfba/utility/pom.xml -- diff --git a/utility/pom.xml b/utility/pom.xml index c98e2ed..9f3fe32 100644 --- a/utility/pom.xml +++ b/utility/pom.xml @@ -1,4 +1,20 @@ - + + http://maven.apache.org/POM/4.0.0; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd;> @@ -16,4 +32,18 @@ compile - \ No newline at end of file + + + + +maven-compiler-plugin +3.2 + + 1.7 + 1.7 + false + + + + +
[32/32] ambari git commit: Merge branch 'trunk' into branch-dev-patch-upgrade
Merge branch 'trunk' into branch-dev-patch-upgrade Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/96480827 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/96480827 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/96480827 Branch: refs/heads/branch-dev-patch-upgrade Commit: 964808275c3e792ca7927888b2b9bf84371716d8 Parents: e6d8cd1 f6124a0 Author: Nate ColeAuthored: Fri Oct 7 15:13:42 2016 -0400 Committer: Nate Cole Committed: Fri Oct 7 15:13:42 2016 -0400 -- ambari-agent/conf/unix/ambari-agent | 17 + .../src/main/python/ambari_agent/HostCleanup.py | 32 +- .../python/ambari_agent/alerts/web_alert.py | 12 +- .../TestDataStructureUtils.py | 47 +++ .../main/python/ambari_commons/inet_utils.py| 21 ++ .../libraries/functions/data_structure_utils.py | 57 .../libraries/providers/hdfs_resource.py| 2 +- ambari-logsearch/pom.xml| 13 + .../timeline/AbstractTimelineMetricsSink.java | 75 ++-- .../availability/MetricCollectorHAHelper.java | 19 +- .../availability/MetricCollectorHATest.java | 34 +- .../src/main/python/core/blacklisted_set.py | 14 + .../src/main/python/core/config_reader.py | 3 +- .../src/main/python/core/emitter.py | 74 ++-- .../ambari-metrics-timelineservice/pom.xml | 9 + ambari-metrics/pom.xml | 30 +- ambari-server/pom.xml | 11 + .../ambari/server/api/services/UserService.java | 2 +- .../server/controller/KerberosHelperImpl.java | 243 + .../server/controller/StackServiceResponse.java | 16 +- .../internal/StackServiceResourceProvider.java | 6 + .../internal/UserResourceProvider.java | 25 +- .../predicate/ComparisonPredicate.java | 16 +- .../controller/predicate/EqualsPredicate.java | 15 + .../server/security/authorization/User.java | 2 +- .../server/security/authorization/Users.java| 8 +- .../ConfigureAmbariIdentitiesServerAction.java | 190 --- .../kerberos/FinalizeKerberosServerAction.java | 118 ++- .../kerberos/KerberosOperationHandler.java | 2 +- .../RangerKerberosConfigCalculation.java| 32 +- .../ambari/server/stack/ServiceModule.java | 6 +- .../server/state/DependencyConditionInfo.java | 102 ++ .../ambari/server/state/DependencyInfo.java | 36 +- .../apache/ambari/server/state/ServiceInfo.java | 27 ++ .../server/topology/BlueprintValidatorImpl.java | 13 + .../server/upgrade/UpgradeCatalog250.java | 30 +- .../ambari/server/utils/ShellCommandUtil.java | 121 +++ .../src/main/python/ambari_server/utils.py | 42 ++- .../src/main/python/ambari_server_main.py | 12 +- .../main/resources/Ambari-DDL-MySQL-CREATE.sql | 12 +- .../common-services/HDFS/2.1.0.2.0/metainfo.xml | 44 +++ .../HDFS/2.1.0.2.0/package/scripts/utils.py | 15 +- .../4.0.0.2.0/package/scripts/oozie_service.py | 5 + .../src/main/resources/properties.json | 1 + .../resources/stacks/HDP/2.0.6/kerberos.json| 14 +- .../stacks/HDP/2.0.6/services/stack_advisor.py | 269 +-- .../stacks/HDP/2.3/services/stack_advisor.py| 13 +- .../HIVE/configuration/hive-interactive-env.xml | 11 + .../stacks/HDP/2.5/services/stack_advisor.py| 23 +- .../resources/stacks/HDP/2.6/repos/repoinfo.xml | 18 +- .../server/api/services/UserServiceTest.java| 71 .../server/controller/KerberosHelperTest.java | 195 +-- .../server/security/SecurityHelperImplTest.java | 4 +- .../AmbariUserAuthenticationFilterTest.java | 2 +- ...nfigureAmbariIdentitiesServerActionTest.java | 204 +++ .../RangerKerberosConfigCalculationTest.java| 6 +- .../ambari/server/stack/ServiceModuleTest.java | 19 ++ .../ambari/server/state/ServiceInfoTest.java| 30 ++ .../alerts/AggregateAlertListenerTest.java | 2 + .../alerts/AlertDefinitionEqualityTest.java | 2 + .../state/alerts/AlertDefinitionHashTest.java | 2 + .../state/alerts/AlertEventPublisherTest.java | 2 + .../state/alerts/AlertReceivedListenerTest.java | 2 + .../alerts/AlertStateChangedEventTest.java | 2 + .../state/alerts/InitialAlertEventTest.java | 2 + .../state/cluster/ClustersDeadlockTest.java | 137 +--- .../KerberosComponentDescriptorTest.java| 2 + .../KerberosConfigurationDescriptorTest.java| 2 + .../state/kerberos/KerberosDescriptorTest.java | 2 + .../KerberosDescriptorUpdateHelperTest.java | 2 + .../KerberosIdentityDescriptorTest.java | 2 + .../kerberos/KerberosKeytabDescriptorTest.java | 2 + .../KerberosPrincipalDescriptorTest.java| 2 +
[15/32] ambari git commit: AMBARI-18512. Ambari-Server restart causes all host components to go in Heartbeat Lost state indefinitely. (aonishuk)
AMBARI-18512. Ambari-Server restart causes all host components to go in Heartbeat Lost state indefinitely. (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2fc9a477 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2fc9a477 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2fc9a477 Branch: refs/heads/branch-dev-patch-upgrade Commit: 2fc9a477842ddd25057e07d084b31b7147c4f3bd Parents: a901d8a Author: Andrew OnishukAuthored: Wed Oct 5 15:55:42 2016 +0300 Committer: Andrew Onishuk Committed: Wed Oct 5 15:55:42 2016 +0300 -- .../python/ambari_agent/alerts/web_alert.py | 12 ++- .../main/python/ambari_commons/inet_utils.py| 21 .../HDFS/2.1.0.2.0/package/scripts/utils.py | 15 ++ 3 files changed, 25 insertions(+), 23 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/2fc9a477/ambari-agent/src/main/python/ambari_agent/alerts/web_alert.py -- diff --git a/ambari-agent/src/main/python/ambari_agent/alerts/web_alert.py b/ambari-agent/src/main/python/ambari_agent/alerts/web_alert.py index 42ad96b..6caf1d0 100644 --- a/ambari-agent/src/main/python/ambari_agent/alerts/web_alert.py +++ b/ambari-agent/src/main/python/ambari_agent/alerts/web_alert.py @@ -33,7 +33,7 @@ from resource_management.libraries.functions.get_port_from_url import get_port_f from resource_management.libraries.functions.get_path_from_url import get_path_from_url from resource_management.libraries.functions.curl_krb_request import curl_krb_request from ambari_commons import OSCheck -from ambari_commons.inet_utils import resolve_address +from ambari_commons.inet_utils import resolve_address, ensure_ssl_using_tls_v1 from ambari_agent import Constants # hashlib is supplied as of Python 2.5 as the replacement interface for md5 @@ -54,15 +54,7 @@ DEFAULT_CONNECTION_TIMEOUT = 5 WebResponse = namedtuple('WebResponse', 'status_code time_millis error_msg') -# patch ssl module to fix SSLv3 communication bug -# for more info see http://stackoverflow.com/questions/9835506/urllib-urlopen-works-on-sslv3-urls-with-python-2-6-6-on-1-machine-but-not-wit -def sslwrap(func): -@wraps(func) -def bar(*args, **kw): -kw['ssl_version'] = ssl.PROTOCOL_TLSv1 -return func(*args, **kw) -return bar -ssl.wrap_socket = sslwrap(ssl.wrap_socket) +ensure_ssl_using_tls_v1() class WebAlert(BaseAlert): http://git-wip-us.apache.org/repos/asf/ambari/blob/2fc9a477/ambari-common/src/main/python/ambari_commons/inet_utils.py -- diff --git a/ambari-common/src/main/python/ambari_commons/inet_utils.py b/ambari-common/src/main/python/ambari_commons/inet_utils.py index 987c761..b5cea75 100644 --- a/ambari-common/src/main/python/ambari_commons/inet_utils.py +++ b/ambari-common/src/main/python/ambari_commons/inet_utils.py @@ -22,6 +22,7 @@ import os import sys import urllib2 import socket +from functools import wraps from exceptions import FatalException, NonFatalException, TimeoutError @@ -181,3 +182,23 @@ def resolve_address(address): if address == '0.0.0.0': return '127.0.0.1' return address + +def ensure_ssl_using_tls_v1(): + """ + Monkey patching ssl module to force it use tls_v1. Do this in common module to avoid problems with + PythonReflectiveExecutor. + :return: + """ + from functools import wraps + import ssl + if hasattr(ssl.wrap_socket, "_ambari_patched"): +return # do not create chain of wrappers, patch only once + def sslwrap(func): +@wraps(func) +def bar(*args, **kw): + import ssl + kw['ssl_version'] = ssl.PROTOCOL_TLSv1 + return func(*args, **kw) +bar._ambari_patched = True +return bar + ssl.wrap_socket = sslwrap(ssl.wrap_socket) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/2fc9a477/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/utils.py -- diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/utils.py b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/utils.py index 966efa2..4577ad2 100644 --- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/utils.py +++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/utils.py @@ -34,21 +34,10 @@ from resource_management.libraries.functions.curl_krb_request import curl_krb_re from resource_management.core.exceptions import Fail from
[12/32] ambari git commit: AMBARI-18313. Capacity Scheduler View: Xml diff view tool to show changes made and queue capacity chart (Akhil PB via pallavkul)
http://git-wip-us.apache.org/repos/asf/ambari/blob/62dc775e/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/components/xmldiffViewer.hbs -- diff --git a/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/components/xmldiffViewer.hbs b/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/components/xmldiffViewer.hbs new file mode 100644 index 000..94cc8e0 --- /dev/null +++ b/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/components/xmldiffViewer.hbs @@ -0,0 +1,41 @@ +{{! +* 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. +}} + + + + + + + + {{#if diffConfig}} +XML Diff Tool + {{else}} +Capacity Scheduler XML + {{/if}} + + + + + + + +Close + + + + http://git-wip-us.apache.org/repos/asf/ambari/blob/62dc775e/contrib/views/capacity-scheduler/src/main/resources/ui/bower.json -- diff --git a/contrib/views/capacity-scheduler/src/main/resources/ui/bower.json b/contrib/views/capacity-scheduler/src/main/resources/ui/bower.json index 911856f..582ef3e 100644 --- a/contrib/views/capacity-scheduler/src/main/resources/ui/bower.json +++ b/contrib/views/capacity-scheduler/src/main/resources/ui/bower.json @@ -12,8 +12,10 @@ "font-awesome": "~4.1", "bootstrap3-typeahead": "~3.0.3", "perfect-scrollbar": "~0.5.8", -"file-saver": "*", -"Blob": "*" +"file-saver": "https://github.com/eligrey/FileSaver.js.git#eb8d76f845ef6ad1e39a840c29bb852098c6a401;, +"Blob": "https://github.com/eligrey/Blob.js.git#079824b6c118fbcd0b99c561d57ad192d2c6619b;, +"d3": "~3.5.17", +"jsdifflib": "https://github.com/cemerick/jsdifflib.git#ce74529f9d51943db440dbd7c15d515597cda2e1; }, "overrides": { "jquery": { @@ -41,6 +43,13 @@ }, "Blob": { "main": "Blob.js" +}, +"jsdifflib": { + "main": [ +"difflib.js", +"diffview.js", +"diffview.css" + ] } } }
[31/32] ambari git commit: AMBARI-18355: Introduce conditional dependencies in stack defition to handle blueprint validation gracefully (Amruta Borkar via dili)
AMBARI-18355: Introduce conditional dependencies in stack defition to handle blueprint validation gracefully (Amruta Borkar via dili) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f6124a05 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f6124a05 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f6124a05 Branch: refs/heads/branch-dev-patch-upgrade Commit: f6124a056d2a8ed16bec917775b9d3554ab5d74d Parents: c153cfb Author: Di LiAuthored: Fri Oct 7 13:34:54 2016 -0400 Committer: Di Li Committed: Fri Oct 7 13:34:54 2016 -0400 -- .../server/state/DependencyConditionInfo.java | 102 +++ .../ambari/server/state/DependencyInfo.java | 36 ++- .../server/topology/BlueprintValidatorImpl.java | 13 +++ .../common-services/HDFS/2.1.0.2.0/metainfo.xml | 44 .../topology/BlueprintValidatorImplTest.java| 75 +- 5 files changed, 268 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/f6124a05/ambari-server/src/main/java/org/apache/ambari/server/state/DependencyConditionInfo.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/DependencyConditionInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/state/DependencyConditionInfo.java new file mode 100644 index 000..84e186f --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/DependencyConditionInfo.java @@ -0,0 +1,102 @@ +/** + * 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.state; + +import java.util.Map; +import java.util.Objects; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.adapters.XmlAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + +import org.apache.commons.lang.NotImplementedException; + +/** + * Represents stack component dependency condition information. + */ +@XmlJavaTypeAdapter(DependencyConditionAdapter.class) +public abstract class DependencyConditionInfo { +public abstract boolean isResolved(Map > properties); +} + +class PropertyExistsDependencyCondition extends DependencyConditionInfo{ + +protected final String configType; +protected final String property; +public PropertyExistsDependencyCondition( String configType, String property) { +this.configType = Objects.requireNonNull(configType, "Config Type must not be null."); +this.property = Objects.requireNonNull(property, "Property Name must not be null."); +} + +@Override +public boolean isResolved(Map > properties) { +return (properties.get(configType).containsKey(property)); +} +} + +class PropertyValueEqualsDependencyCondition extends PropertyExistsDependencyCondition { + +protected final String propertyValue; +public PropertyValueEqualsDependencyCondition(String configType, String property, String propertyValue) { +super(configType, property); +this.propertyValue = Objects.requireNonNull(propertyValue, "Property value must not be null."); +} + +@Override +public boolean isResolved(Map > properties) { +return (super.isResolved(properties) && propertyValue.equals(properties.get(configType).get(property))); +} +} + +class DependencyConditionAdapter extends XmlAdapter { + +static class AdaptedDependencyCondition{ +@XmlElement +private String configType; +@XmlElement +private String property; +@XmlElement +private String propertyValue; +@XmlElement(name="condition-type") +private String conditionType; +} + +@Override +public AdaptedDependencyCondition marshal(DependencyConditionInfo arg0)
[7/7] ambari git commit: Merge branch 'trunk' into branch-feature-AMBARI-18456
Merge branch 'trunk' into branch-feature-AMBARI-18456 Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/197a37f0 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/197a37f0 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/197a37f0 Branch: refs/heads/branch-feature-AMBARI-18456 Commit: 197a37f034b2bc10f483d558cde7ab0f874c8d4c Parents: 78a875c f6124a0 Author: Jonathan HurleyAuthored: Fri Oct 7 14:21:34 2016 -0400 Committer: Jonathan Hurley Committed: Fri Oct 7 14:21:34 2016 -0400 -- ambari-agent/conf/unix/ambari-agent | 17 ++ .../TestDataStructureUtils.py | 47 .../libraries/functions/data_structure_utils.py | 57 .../server/state/DependencyConditionInfo.java | 102 +++ .../ambari/server/state/DependencyInfo.java | 36 ++- .../server/topology/BlueprintValidatorImpl.java | 13 + .../common-services/HDFS/2.1.0.2.0/metainfo.xml | 44 +++ .../4.0.0.2.0/package/scripts/oozie_service.py | 5 + .../stacks/HDP/2.0.6/services/stack_advisor.py | 269 --- .../stacks/HDP/2.3/services/stack_advisor.py| 13 +- .../topology/BlueprintValidatorImplTest.java| 75 +- .../stacks/2.0.6/OOZIE/test_oozie_server.py | 8 + .../stacks/2.0.6/common/test_stack_advisor.py | 215 +++ .../MICROSOFT_R/8.0.0/kerberos.json | 15 -- .../MICROSOFT_R/8.0.0/metainfo.xml | 53 .../package/files/microsoft_r_serviceCheck.r| 28 -- .../8.0.0/package/scripts/microsoft_r.py| 47 .../MICROSOFT_R/8.0.0/package/scripts/params.py | 31 --- .../8.0.0/package/scripts/params_linux.py | 79 -- .../8.0.0/package/scripts/params_windows.py | 26 -- .../8.0.0/package/scripts/service_check.py | 89 -- .../MICROSOFT_R/8.0.0/role_command_order.json | 6 - .../MICROSOFT_R/8.0.0/service_advisor.py| 73 - .../MICROSOFT_R/8.0.5/kerberos.json | 15 ++ .../MICROSOFT_R/8.0.5/metainfo.xml | 53 .../package/files/microsoft_r_serviceCheck.r| 28 ++ .../8.0.5/package/scripts/microsoft_r.py| 47 .../MICROSOFT_R/8.0.5/package/scripts/params.py | 31 +++ .../8.0.5/package/scripts/params_linux.py | 79 ++ .../8.0.5/package/scripts/params_windows.py | 26 ++ .../8.0.5/package/scripts/service_check.py | 89 ++ .../MICROSOFT_R/8.0.5/role_command_order.json | 6 + .../MICROSOFT_R/8.0.5/service_advisor.py| 73 + .../MICROSOFT_R/8.0.0/metainfo.xml | 28 -- .../MICROSOFT_R/8.0.0/repos/repoinfo.xml| 33 --- .../MICROSOFT_R/8.0.5/metainfo.xml | 28 ++ .../MICROSOFT_R/8.0.5/repos/repoinfo.xml| 33 +++ .../src/main/resources/mpack.json | 2 +- .../ui/hueambarimigration-view/package.json | 2 +- .../src/main/resources/ui/package.json | 2 +- 40 files changed, 1304 insertions(+), 619 deletions(-) --
[5/7] ambari git commit: AMBARI-18537. Update Mirosoft R version in mpack (Balázs Bence Sári via magyari_sandor)
AMBARI-18537. Update Mirosoft R version in mpack (Balázs Bence Sári via magyari_sandor) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c153cfb6 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c153cfb6 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c153cfb6 Branch: refs/heads/branch-feature-AMBARI-18456 Commit: c153cfb635fc51096c1d350ec6e23e5d5162bef7 Parents: b81deb0 Author: Balázs Bence SáriAuthored: Fri Oct 7 11:28:51 2016 +0200 Committer: Sandor Magyari Committed: Fri Oct 7 11:28:51 2016 +0200 -- .../MICROSOFT_R/8.0.0/kerberos.json | 15 .../MICROSOFT_R/8.0.0/metainfo.xml | 53 .../package/files/microsoft_r_serviceCheck.r| 28 -- .../8.0.0/package/scripts/microsoft_r.py| 47 --- .../MICROSOFT_R/8.0.0/package/scripts/params.py | 31 --- .../8.0.0/package/scripts/params_linux.py | 79 - .../8.0.0/package/scripts/params_windows.py | 26 -- .../8.0.0/package/scripts/service_check.py | 89 .../MICROSOFT_R/8.0.0/role_command_order.json | 6 -- .../MICROSOFT_R/8.0.0/service_advisor.py| 73 .../MICROSOFT_R/8.0.5/kerberos.json | 15 .../MICROSOFT_R/8.0.5/metainfo.xml | 53 .../package/files/microsoft_r_serviceCheck.r| 28 ++ .../8.0.5/package/scripts/microsoft_r.py| 47 +++ .../MICROSOFT_R/8.0.5/package/scripts/params.py | 31 +++ .../8.0.5/package/scripts/params_linux.py | 79 + .../8.0.5/package/scripts/params_windows.py | 26 ++ .../8.0.5/package/scripts/service_check.py | 89 .../MICROSOFT_R/8.0.5/role_command_order.json | 6 ++ .../MICROSOFT_R/8.0.5/service_advisor.py| 73 .../MICROSOFT_R/8.0.0/metainfo.xml | 28 -- .../MICROSOFT_R/8.0.0/repos/repoinfo.xml| 33 .../MICROSOFT_R/8.0.5/metainfo.xml | 28 ++ .../MICROSOFT_R/8.0.5/repos/repoinfo.xml| 33 .../src/main/resources/mpack.json | 2 +- 25 files changed, 509 insertions(+), 509 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/c153cfb6/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/kerberos.json -- diff --git a/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/kerberos.json b/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/kerberos.json deleted file mode 100644 index 86fab2d..000 --- a/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/kerberos.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "services": [ -{ - "name": "MICROSOFT_R", - "identities": [ -{ - "name": "/HDFS/NAMENODE/hdfs" -}, -{ - "name": "/smokeuser" -} - ] -} - ] -} http://git-wip-us.apache.org/repos/asf/ambari/blob/c153cfb6/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/metainfo.xml -- diff --git a/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/metainfo.xml b/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/metainfo.xml deleted file mode 100644 index 709929e..000 --- a/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/metainfo.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - 2.0 - - - MICROSOFT_R - Microsoft R - Microsoft R Server - 8.0.0 - - - - MICROSOFT_R_SERVER_CLIENT - Microsoft R Server Client - CLIENT - 1+ - -scripts/microsoft_r.py -PYTHON -1200 - - - - - -scripts/service_check.py -PYTHON -300 - - - -YARN - - - - http://git-wip-us.apache.org/repos/asf/ambari/blob/c153cfb6/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/package/files/microsoft_r_serviceCheck.r -- diff --git a/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/package/files/microsoft_r_serviceCheck.r
[2/7] ambari git commit: AMBARI-18526. Ambari breaks sudo and user access if Ambari Agent misconfigured (dlysnichenko)
AMBARI-18526. Ambari breaks sudo and user access if Ambari Agent misconfigured (dlysnichenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/cceb7d2d Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/cceb7d2d Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/cceb7d2d Branch: refs/heads/branch-feature-AMBARI-18456 Commit: cceb7d2d3eb8359e3a25a7c9eec5c92516f28097 Parents: 49c9660 Author: Lisnichenko DmitroAuthored: Thu Oct 6 19:57:25 2016 +0300 Committer: Lisnichenko Dmitro Committed: Thu Oct 6 19:57:25 2016 +0300 -- ambari-agent/conf/unix/ambari-agent | 17 + 1 file changed, 17 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/cceb7d2d/ambari-agent/conf/unix/ambari-agent -- diff --git a/ambari-agent/conf/unix/ambari-agent b/ambari-agent/conf/unix/ambari-agent index ccb0b7a..30897dd 100755 --- a/ambari-agent/conf/unix/ambari-agent +++ b/ambari-agent/conf/unix/ambari-agent @@ -39,6 +39,17 @@ get_agent_property() { echo $value } +valid_path() { + value=${1:?} + value=$(readlink -m ${value}) + if [ "$value" == "/" ]; then +echo "path $1 not valid" 1>&2 +exit 1 + fi + echo $value +} + + export PATH=/usr/sbin:/sbin:/usr/lib/ambari-server/*:$PATH export AMBARI_CONF_DIR=/etc/ambari-server/conf:$PATH @@ -46,8 +57,14 @@ export AMBARI_CONF_DIR=/etc/ambari-server/conf:$PATH export PYTHONPATH=/usr/lib/python2.6/site-packages:${PYTHONPATH:-} export AMBARI_PID_DIR=`get_agent_property piddir` +export AMBARI_PID_DIR=`valid_path "${AMBARI_PID_DIR:?}"` +export AMBARI_PID_DIR="${AMBARI_PID_DIR:?}" export AMBARI_AGENT_LOG_DIR=`get_agent_property logdir` +export AMBARI_AGENT_LOG_DIR=`valid_path "${AMBARI_AGENT_LOG_DIR:?}"` +export AMBARI_AGENT_LOG_DIR="${AMBARI_AGENT_LOG_DIR:?}" KEYSDIR=`get_agent_property keysdir` +KEYSDIR=`valid_path "${KEYSDIR:?}"` +KEYSDIR="${KEYSDIR:?}" AMBARI_AGENT=ambari-agent PYTHON_WRAP=/usr/bin/ambari-python-wrap
[1/7] ambari git commit: AMBARI-18549. oozie server start fails post upgrade to Ambari 2.4.1 (aonishuk)
Repository: ambari Updated Branches: refs/heads/branch-feature-AMBARI-18456 78a875cf2 -> 197a37f03 AMBARI-18549. oozie server start fails post upgrade to Ambari 2.4.1 (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/49c9660c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/49c9660c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/49c9660c Branch: refs/heads/branch-feature-AMBARI-18456 Commit: 49c9660c39c379b5568f9cff2d0fad44bde03222 Parents: 56e00ac Author: Andrew OnishukAuthored: Thu Oct 6 19:24:08 2016 +0300 Committer: Andrew Onishuk Committed: Thu Oct 6 19:24:08 2016 +0300 -- .../OOZIE/4.0.0.2.0/package/scripts/oozie_service.py | 5 + .../src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py | 8 2 files changed, 13 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/49c9660c/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_service.py -- diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_service.py b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_service.py index 5c97727..3257653 100644 --- a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_service.py +++ b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_service.py @@ -170,6 +170,11 @@ def oozie_service(action = 'start', upgrade_type=None): raise elif action == 'stop': +Directory(params.oozie_tmp_dir, + owner=params.oozie_user, + create_parents = True, +) + stop_cmd = format("cd {oozie_tmp_dir} && {oozie_home}/bin/oozied.sh stop 60 -force") try: http://git-wip-us.apache.org/repos/asf/ambari/blob/49c9660c/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py -- diff --git a/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py b/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py index b0cc2e9..2a512f4 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py +++ b/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py @@ -576,6 +576,10 @@ class TestOozieServer(RMFTestCase): stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) +self.assertResourceCalled('Directory', '/var/tmp/oozie', +owner = 'oozie', +create_parents = True, +) self.assertResourceCalled('Execute', 'cd /var/tmp/oozie && /usr/lib/oozie/bin/oozied.sh stop 60 -force', environment = {'OOZIE_CONFIG': '/etc/oozie/conf'}, only_if = "ambari-sudo.sh su oozie -l -s /bin/bash -c '[RMF_EXPORT_PLACEHOLDER]ls /var/run/oozie/oozie.pid >/dev/null 2>&1 && ps -p `cat /var/run/oozie/oozie.pid` >/dev/null 2>&1'", @@ -706,6 +710,10 @@ class TestOozieServer(RMFTestCase): stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) +self.assertResourceCalled('Directory', '/var/tmp/oozie', +owner = 'oozie', +create_parents = True, +) self.assertResourceCalled('Execute', 'cd /var/tmp/oozie && /usr/lib/oozie/bin/oozied.sh stop 60 -force', environment = {'OOZIE_CONFIG': '/etc/oozie/conf'}, only_if = "ambari-sudo.sh su oozie -l -s /bin/bash -c '[RMF_EXPORT_PLACEHOLDER]ls /var/run/oozie/oozie.pid >/dev/null 2>&1 && ps -p `cat /var/run/oozie/oozie.pid` >/dev/null 2>&1'",
[6/7] ambari git commit: AMBARI-18355: Introduce conditional dependencies in stack defition to handle blueprint validation gracefully (Amruta Borkar via dili)
AMBARI-18355: Introduce conditional dependencies in stack defition to handle blueprint validation gracefully (Amruta Borkar via dili) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f6124a05 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f6124a05 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f6124a05 Branch: refs/heads/branch-feature-AMBARI-18456 Commit: f6124a056d2a8ed16bec917775b9d3554ab5d74d Parents: c153cfb Author: Di LiAuthored: Fri Oct 7 13:34:54 2016 -0400 Committer: Di Li Committed: Fri Oct 7 13:34:54 2016 -0400 -- .../server/state/DependencyConditionInfo.java | 102 +++ .../ambari/server/state/DependencyInfo.java | 36 ++- .../server/topology/BlueprintValidatorImpl.java | 13 +++ .../common-services/HDFS/2.1.0.2.0/metainfo.xml | 44 .../topology/BlueprintValidatorImplTest.java| 75 +- 5 files changed, 268 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/f6124a05/ambari-server/src/main/java/org/apache/ambari/server/state/DependencyConditionInfo.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/DependencyConditionInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/state/DependencyConditionInfo.java new file mode 100644 index 000..84e186f --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/DependencyConditionInfo.java @@ -0,0 +1,102 @@ +/** + * 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.state; + +import java.util.Map; +import java.util.Objects; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.adapters.XmlAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + +import org.apache.commons.lang.NotImplementedException; + +/** + * Represents stack component dependency condition information. + */ +@XmlJavaTypeAdapter(DependencyConditionAdapter.class) +public abstract class DependencyConditionInfo { +public abstract boolean isResolved(Map > properties); +} + +class PropertyExistsDependencyCondition extends DependencyConditionInfo{ + +protected final String configType; +protected final String property; +public PropertyExistsDependencyCondition( String configType, String property) { +this.configType = Objects.requireNonNull(configType, "Config Type must not be null."); +this.property = Objects.requireNonNull(property, "Property Name must not be null."); +} + +@Override +public boolean isResolved(Map > properties) { +return (properties.get(configType).containsKey(property)); +} +} + +class PropertyValueEqualsDependencyCondition extends PropertyExistsDependencyCondition { + +protected final String propertyValue; +public PropertyValueEqualsDependencyCondition(String configType, String property, String propertyValue) { +super(configType, property); +this.propertyValue = Objects.requireNonNull(propertyValue, "Property value must not be null."); +} + +@Override +public boolean isResolved(Map > properties) { +return (super.isResolved(properties) && propertyValue.equals(properties.get(configType).get(property))); +} +} + +class DependencyConditionAdapter extends XmlAdapter { + +static class AdaptedDependencyCondition{ +@XmlElement +private String configType; +@XmlElement +private String property; +@XmlElement +private String propertyValue; +@XmlElement(name="condition-type") +private String conditionType; +} + +@Override +public AdaptedDependencyCondition marshal(DependencyConditionInfo
[4/7] ambari git commit: AMBARI-18550. Views build failure. (yusaku)
AMBARI-18550. Views build failure. (yusaku) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b81deb0e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b81deb0e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b81deb0e Branch: refs/heads/branch-feature-AMBARI-18456 Commit: b81deb0e5dea0c4f1ed56567d03e0e04049372ba Parents: 55c1dc5 Author: Yusaku SakoAuthored: Thu Oct 6 15:30:43 2016 -0700 Committer: Yusaku Sako Committed: Thu Oct 6 15:32:28 2016 -0700 -- .../src/main/resources/ui/hueambarimigration-view/package.json | 2 +- contrib/views/wfmanager/src/main/resources/ui/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/b81deb0e/contrib/views/hueambarimigration/src/main/resources/ui/hueambarimigration-view/package.json -- diff --git a/contrib/views/hueambarimigration/src/main/resources/ui/hueambarimigration-view/package.json b/contrib/views/hueambarimigration/src/main/resources/ui/hueambarimigration-view/package.json index b9f832e..64b3270 100644 --- a/contrib/views/hueambarimigration/src/main/resources/ui/hueambarimigration-view/package.json +++ b/contrib/views/hueambarimigration/src/main/resources/ui/hueambarimigration-view/package.json @@ -40,7 +40,7 @@ "ember-cli-selectize": "0.5.3", "ember-cli-sri": "^2.1.0", "ember-cli-uglify": "^1.2.0", -"ember-data": "^2.4.2", +"ember-data": "2.7.0", "ember-export-application-global": "^1.0.5", "ember-load-initializers": "^0.5.1", "ember-power-select": "0.10.4", http://git-wip-us.apache.org/repos/asf/ambari/blob/b81deb0e/contrib/views/wfmanager/src/main/resources/ui/package.json -- diff --git a/contrib/views/wfmanager/src/main/resources/ui/package.json b/contrib/views/wfmanager/src/main/resources/ui/package.json index 92f698f..d04d57c 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/package.json +++ b/contrib/views/wfmanager/src/main/resources/ui/package.json @@ -33,7 +33,7 @@ "ember-cli-release": "0.2.8", "ember-cli-sri": "^2.0.0", "ember-cli-uglify": "^1.2.0", -"ember-data": "^2.3.0", +"ember-data": "2.7.0", "ember-disable-proxy-controllers": "^1.0.1", "ember-export-application-global": "^1.0.4", "ember-load-initializers": "^0.5.0",
[3/7] ambari git commit: AMBARI-18547. No validation errors recieved for empty or removed hadoop.proxyuser.* properties (dlysnichenko)
AMBARI-18547. No validation errors recieved for empty or removed hadoop.proxyuser.* properties (dlysnichenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/55c1dc5c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/55c1dc5c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/55c1dc5c Branch: refs/heads/branch-feature-AMBARI-18456 Commit: 55c1dc5cb8015e3d114c186792dacd883b7aa820 Parents: cceb7d2 Author: Lisnichenko DmitroAuthored: Thu Oct 6 20:01:13 2016 +0300 Committer: Lisnichenko Dmitro Committed: Thu Oct 6 20:01:13 2016 +0300 -- .../TestDataStructureUtils.py | 47 .../libraries/functions/data_structure_utils.py | 57 .../stacks/HDP/2.0.6/services/stack_advisor.py | 269 --- .../stacks/HDP/2.3/services/stack_advisor.py| 13 +- .../stacks/2.0.6/common/test_stack_advisor.py | 215 +++ 5 files changed, 495 insertions(+), 106 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/55c1dc5c/ambari-agent/src/test/python/resource_management/TestDataStructureUtils.py -- diff --git a/ambari-agent/src/test/python/resource_management/TestDataStructureUtils.py b/ambari-agent/src/test/python/resource_management/TestDataStructureUtils.py new file mode 100644 index 000..a4bdc1c --- /dev/null +++ b/ambari-agent/src/test/python/resource_management/TestDataStructureUtils.py @@ -0,0 +1,47 @@ +''' +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. +''' + +from unittest import TestCase + +from resource_management.libraries.functions.data_structure_utils import get_from_dict +from resource_management.libraries.functions.data_structure_utils import KeyNotFound + + +class TestDictUtils(TestCase): + + def test_get_nested(self): +dict_ = {1: {2: {3: 'data'}}} +empty_dict = {} + +self.assertEquals('data', get_from_dict(dict_, (1, 2, 3))) +self.assertEquals('data', get_from_dict(dict_, [1, 2, 3])) + +self.assertEquals({3: 'data'}, get_from_dict(dict_, (1, 2))) + +self.assertEquals({2: {3: 'data'}}, get_from_dict(dict_, 1)) + +self.assertEquals(KeyNotFound, get_from_dict(dict_, (1, 2, 0))) +self.assertEquals(KeyNotFound, get_from_dict(dict_, [1, 2, 0])) +self.assertEquals(KeyNotFound, get_from_dict(dict_, (1, 0, 3))) +self.assertEquals(KeyNotFound, get_from_dict(dict_, (1, 2, 3, 4))) +self.assertEquals(KeyNotFound, get_from_dict(dict_, (0, 2))) + +self.assertEquals('default', get_from_dict(dict_, (0, 2, 3), default_value='default')) +self.assertEquals('default', get_from_dict(empty_dict, (0, 2, 3), default_value='default')) + +self.assertEquals(KeyNotFound, get_from_dict(empty_dict, [1])) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/55c1dc5c/ambari-common/src/main/python/resource_management/libraries/functions/data_structure_utils.py -- diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/data_structure_utils.py b/ambari-common/src/main/python/resource_management/libraries/functions/data_structure_utils.py new file mode 100644 index 000..59e01aa --- /dev/null +++ b/ambari-common/src/main/python/resource_management/libraries/functions/data_structure_utils.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python +""" +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,
ambari git commit: AMBARI-18355: Introduce conditional dependencies in stack defition to handle blueprint validation gracefully (Amruta Borkar via dili)
Repository: ambari Updated Branches: refs/heads/trunk c153cfb63 -> f6124a056 AMBARI-18355: Introduce conditional dependencies in stack defition to handle blueprint validation gracefully (Amruta Borkar via dili) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f6124a05 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f6124a05 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f6124a05 Branch: refs/heads/trunk Commit: f6124a056d2a8ed16bec917775b9d3554ab5d74d Parents: c153cfb Author: Di LiAuthored: Fri Oct 7 13:34:54 2016 -0400 Committer: Di Li Committed: Fri Oct 7 13:34:54 2016 -0400 -- .../server/state/DependencyConditionInfo.java | 102 +++ .../ambari/server/state/DependencyInfo.java | 36 ++- .../server/topology/BlueprintValidatorImpl.java | 13 +++ .../common-services/HDFS/2.1.0.2.0/metainfo.xml | 44 .../topology/BlueprintValidatorImplTest.java| 75 +- 5 files changed, 268 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/f6124a05/ambari-server/src/main/java/org/apache/ambari/server/state/DependencyConditionInfo.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/DependencyConditionInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/state/DependencyConditionInfo.java new file mode 100644 index 000..84e186f --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/DependencyConditionInfo.java @@ -0,0 +1,102 @@ +/** + * 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.state; + +import java.util.Map; +import java.util.Objects; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.adapters.XmlAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + +import org.apache.commons.lang.NotImplementedException; + +/** + * Represents stack component dependency condition information. + */ +@XmlJavaTypeAdapter(DependencyConditionAdapter.class) +public abstract class DependencyConditionInfo { +public abstract boolean isResolved(Map > properties); +} + +class PropertyExistsDependencyCondition extends DependencyConditionInfo{ + +protected final String configType; +protected final String property; +public PropertyExistsDependencyCondition( String configType, String property) { +this.configType = Objects.requireNonNull(configType, "Config Type must not be null."); +this.property = Objects.requireNonNull(property, "Property Name must not be null."); +} + +@Override +public boolean isResolved(Map > properties) { +return (properties.get(configType).containsKey(property)); +} +} + +class PropertyValueEqualsDependencyCondition extends PropertyExistsDependencyCondition { + +protected final String propertyValue; +public PropertyValueEqualsDependencyCondition(String configType, String property, String propertyValue) { +super(configType, property); +this.propertyValue = Objects.requireNonNull(propertyValue, "Property value must not be null."); +} + +@Override +public boolean isResolved(Map > properties) { +return (super.isResolved(properties) && propertyValue.equals(properties.get(configType).get(property))); +} +} + +class DependencyConditionAdapter extends XmlAdapter { + +static class AdaptedDependencyCondition{ +@XmlElement +private String configType; +@XmlElement +private String property; +@XmlElement +private String propertyValue; +@XmlElement(name="condition-type") +private String conditionType; +} + +@Override +public
[2/3] ambari git commit: AMBARI-18298. Add ability to add custom grok filters and custom grok patterns with Ambari (Miklos Gergely via oleewere)
AMBARI-18298. Add ability to add custom grok filters and custom grok patterns with Ambari (Miklos Gergely via oleewere) Change-Id: I03852666f85185be80787824422c74eb0e437757 Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/6db504ba Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6db504ba Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6db504ba Branch: refs/heads/branch-dev-logsearch Commit: 6db504ba10382b9cc39778f98ba5214e3a5d4b7d Parents: 2da803c Author: Miklos GergelyAuthored: Fri Oct 7 01:15:29 2016 +0200 Committer: oleewere Committed: Fri Oct 7 11:56:47 2016 +0200 -- .../0.5.0/configuration/logfeeder-grok.xml | 49 ++ .../0.5.0/configuration/logfeeder-log4j.xml | 1 - .../LOGSEARCH/0.5.0/metainfo.xml| 1 + .../LOGSEARCH/0.5.0/package/scripts/params.py | 11 ++ .../0.5.0/package/scripts/setup_logfeeder.py| 3 +- .../0.5.0/package/templates/grok-patterns.j2| 148 --- .../logfeeder-default_grok_patterns.j2 | 148 +++ .../stacks/2.4/LOGSEARCH/test_logfeeder.py | 2 +- .../test/python/stacks/2.4/configs/default.json | 4 + ambari-web/app/data/HDP2/site_properties.js | 15 ++ 10 files changed, 231 insertions(+), 151 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/6db504ba/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logfeeder-grok.xml -- diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logfeeder-grok.xml b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logfeeder-grok.xml new file mode 100644 index 000..e280bb9 --- /dev/null +++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logfeeder-grok.xml @@ -0,0 +1,49 @@ + + + + + + + +default_grok_patterns +Default Grok Patterns +This is the jinja template for default grok patterns ++ VALUE_FROM_PROPERTY_FILE ++ +true +logfeeder-default_grok_patterns.j2 +text ++ + +custom_grok_patterns +Custom Grok Patterns +This is the jinja template for custom grok patterns ++ TEXT ++ +multiLine +true ++
[1/3] ambari git commit: AMBARI-18310. Fix regression issues for logsearch refactor (escaping) (oleewere)
Repository: ambari Updated Branches: refs/heads/branch-dev-logsearch 4aa6595b7 -> 80094e91b AMBARI-18310. Fix regression issues for logsearch refactor (escaping) (oleewere) Change-Id: I3bc878f2e4ccb2068cb12b8e479c5936edb49d11 Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2da803c4 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2da803c4 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2da803c4 Branch: refs/heads/branch-dev-logsearch Commit: 2da803c4b78f369268404537409bce0897e75a55 Parents: 4aa6595 Author: oleewereAuthored: Wed Oct 5 16:09:17 2016 +0200 Committer: oleewere Committed: Fri Oct 7 11:56:37 2016 +0200 -- .../AbstractAuditLogRequestQueryConverter.java | 4 ++-- .../converter/BaseServiceLogRequestQueryConverter.java | 9 ++--- .../org/apache/ambari/logsearch/dao/SolrDaoBase.java | 2 ++ .../ambari/logsearch/manager/ServiceLogsManager.java | 10 ++ .../ambari/logsearch/rest/ServiceLogsResource.java | 4 .../org/apache/ambari/logsearch/util/SolrUtil.java | 13 + .../webapp/scripts/views/audit/AuditTabLayoutView.js | 4 ++-- .../scripts/views/tabs/HierarchyTabLayoutView.js | 4 ++-- .../src/main/webapp/scripts/views/tabs/LogFileView.js | 4 ++-- .../BaseServiceLogRequestQueryConverterTest.java | 7 --- .../controller/logging/LogLevelQueryResponse.java | 2 ++ .../server/controller/logging/LogQueryResponse.java| 2 ++ 12 files changed, 39 insertions(+), 26 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/2da803c4/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/AbstractAuditLogRequestQueryConverter.java -- diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/AbstractAuditLogRequestQueryConverter.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/AbstractAuditLogRequestQueryConverter.java index e4bce01..5656c88 100644 --- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/AbstractAuditLogRequestQueryConverter.java +++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/AbstractAuditLogRequestQueryConverter.java @@ -44,8 +44,8 @@ public abstract class AbstractAuditLogRequestQueryConverterhttp://git-wip-us.apache.org/repos/asf/ambari/blob/2da803c4/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/BaseServiceLogRequestQueryConverter.java -- diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/BaseServiceLogRequestQueryConverter.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/BaseServiceLogRequestQueryConverter.java index 4894bfb..8270f2d 100644 --- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/BaseServiceLogRequestQueryConverter.java +++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/BaseServiceLogRequestQueryConverter.java @@ -22,6 +22,7 @@ import org.apache.ambari.logsearch.common.LogSearchConstants; import org.apache.ambari.logsearch.common.LogType; import org.apache.ambari.logsearch.model.request.impl.BaseServiceLogRequest; import org.apache.ambari.logsearch.util.SolrUtil; +import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.data.domain.Sort; import org.springframework.data.solr.core.query.SimpleQuery; @@ -49,7 +50,9 @@ public class BaseServiceLogRequestQueryConverter extends AbstractServiceLogReque addEqualsFilterQuery(query, PATH, SolrUtil.escapeQueryChars(request.getFileName())); addEqualsFilterQuery(query, COMPONENT, SolrUtil.escapeQueryChars(request.getComponentName())); addEqualsFilterQuery(query, BUNDLE_ID, request.getBundleId()); -addInFilterQuery(query, LEVEL, levels); +if (CollectionUtils.isNotEmpty(levels)){ + addInFilterQuery(query, LEVEL, levels); +} addRangeFilter(query, LOGTIME, request.getFrom(), request.getTo()); return query; } @@ -65,8 +68,8 @@ public class BaseServiceLogRequestQueryConverter extends AbstractServiceLogReque } else { defaultSortOrder = new Sort.Order(Sort.Direction.DESC, LOGTIME); } -Sort.Order secuqnceIdOrder = new Sort.Order(Sort.Direction.DESC, SEQUENCE_ID); -return new Sort(defaultSortOrder, secuqnceIdOrder); +
[3/3] ambari git commit: AMBARI-18529. Custom properties are now overriding default proplerties (Miklos Gergely via oleewere)
AMBARI-18529. Custom properties are now overriding default proplerties (Miklos Gergely via oleewere) Change-Id: I28b8d74836df85dc2e7538686563df5de9b0eada Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/80094e91 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/80094e91 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/80094e91 Branch: refs/heads/branch-dev-logsearch Commit: 80094e91b15870cd278671c30aa8b65b2be4c835 Parents: 6db504b Author: Miklos GergelyAuthored: Fri Oct 7 01:49:44 2016 +0200 Committer: oleewere Committed: Fri Oct 7 11:56:58 2016 +0200 -- .../apache/ambari/logsearch/dao/UserDao.java| 17 ...LogsearchAbstractAuthenticationProvider.java | 14 --- .../LogsearchSimpleAuthenticationProvider.java | 11 -- .../LOGSEARCH/0.5.0/package/scripts/params.py | 41 +++- 4 files changed, 40 insertions(+), 43 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/80094e91/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/UserDao.java -- diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/UserDao.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/UserDao.java index 0810571..912442d 100644 --- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/UserDao.java +++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/UserDao.java @@ -88,17 +88,18 @@ public class UserDao { } } - public User loadUserByUsername(final String username) { + public User loadUserByUsername(String username) { logger.debug(" loadUserByUsername username" + username); HashMap userInfo = findByusername(username); -User user = new User(); - -if (userInfo != null) { - user.setFirstName(userInfo.get(NAME) != null ? userInfo.get(NAME) : "Unknown"); - user.setLastName(userInfo.get(NAME) != null ? userInfo.get(NAME) : "Unknown"); - user.setUsername(userInfo.get(USER_NAME) != null ? userInfo.get(USER_NAME) : ""); - user.setPassword(userInfo.get(ENC_PASSWORD) != null ? userInfo.get(ENC_PASSWORD) : ""); +if (userInfo == null) { + return null; } + +User user = new User(); +user.setFirstName(StringUtils.defaultString(userInfo.get(NAME), "Unknown")); +user.setLastName(StringUtils.defaultString(userInfo.get(NAME), "Unknown")); +user.setUsername(StringUtils.defaultString(userInfo.get(USER_NAME), "")); +user.setPassword(StringUtils.defaultString(userInfo.get(ENC_PASSWORD), "")); Role r = new Role(); r.setName("ROLE_USER"); http://git-wip-us.apache.org/repos/asf/ambari/blob/80094e91/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchAbstractAuthenticationProvider.java -- diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchAbstractAuthenticationProvider.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchAbstractAuthenticationProvider.java index eb6c9f1..1c7bf3b 100644 --- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchAbstractAuthenticationProvider.java +++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchAbstractAuthenticationProvider.java @@ -21,7 +21,6 @@ package org.apache.ambari.logsearch.web.security; import java.util.ArrayList; import java.util.List; -import org.apache.ambari.logsearch.common.PropertiesHelper; import org.springframework.security.authentication.AuthenticationProvider; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.GrantedAuthority; @@ -29,8 +28,6 @@ import org.springframework.security.core.authority.SimpleGrantedAuthority; abstract class LogsearchAbstractAuthenticationProvider implements AuthenticationProvider { - private static final String AUTH_METHOD_PROPERTY_PREFIX = "logsearch.auth."; - protected enum AuthMethod { LDAP, FILE, EXTERNAL_AUTH, SIMPLE }; @@ -48,15 +45,4 @@ abstract class LogsearchAbstractAuthenticationProvider implements Authentication grantedAuths.add(new SimpleGrantedAuthority("ROLE_USER")); return grantedAuths; } - - /** - * Check authentication provider is enable or disable for specified method - */ -
ambari git commit: AMBARI-18537. Update Mirosoft R version in mpack (Balázs Bence Sári via magyari_sandor)
Repository: ambari Updated Branches: refs/heads/branch-2.4 960d60ff4 -> 243cafa89 AMBARI-18537. Update Mirosoft R version in mpack (Balázs Bence Sári via magyari_sandor) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/243cafa8 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/243cafa8 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/243cafa8 Branch: refs/heads/branch-2.4 Commit: 243cafa89d8e097c29be23ab105ba7b0d5b95cc5 Parents: 960d60f Author: Balázs Bence SáriAuthored: Fri Oct 7 11:28:51 2016 +0200 Committer: Sandor Magyari Committed: Fri Oct 7 11:31:45 2016 +0200 -- .../MICROSOFT_R/8.0.0/kerberos.json | 15 .../MICROSOFT_R/8.0.0/metainfo.xml | 53 .../package/files/microsoft_r_serviceCheck.r| 28 -- .../8.0.0/package/scripts/microsoft_r.py| 47 --- .../MICROSOFT_R/8.0.0/package/scripts/params.py | 31 --- .../8.0.0/package/scripts/params_linux.py | 79 - .../8.0.0/package/scripts/params_windows.py | 26 -- .../8.0.0/package/scripts/service_check.py | 89 .../MICROSOFT_R/8.0.0/role_command_order.json | 6 -- .../MICROSOFT_R/8.0.0/service_advisor.py| 73 .../MICROSOFT_R/8.0.5/kerberos.json | 15 .../MICROSOFT_R/8.0.5/metainfo.xml | 53 .../package/files/microsoft_r_serviceCheck.r| 28 ++ .../8.0.5/package/scripts/microsoft_r.py| 47 +++ .../MICROSOFT_R/8.0.5/package/scripts/params.py | 31 +++ .../8.0.5/package/scripts/params_linux.py | 79 + .../8.0.5/package/scripts/params_windows.py | 26 ++ .../8.0.5/package/scripts/service_check.py | 89 .../MICROSOFT_R/8.0.5/role_command_order.json | 6 ++ .../MICROSOFT_R/8.0.5/service_advisor.py| 73 .../MICROSOFT_R/8.0.0/metainfo.xml | 28 -- .../MICROSOFT_R/8.0.0/repos/repoinfo.xml| 33 .../MICROSOFT_R/8.0.5/metainfo.xml | 28 ++ .../MICROSOFT_R/8.0.5/repos/repoinfo.xml| 33 .../src/main/resources/mpack.json | 2 +- 25 files changed, 509 insertions(+), 509 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/243cafa8/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/kerberos.json -- diff --git a/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/kerberos.json b/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/kerberos.json deleted file mode 100644 index 86fab2d..000 --- a/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/kerberos.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "services": [ -{ - "name": "MICROSOFT_R", - "identities": [ -{ - "name": "/HDFS/NAMENODE/hdfs" -}, -{ - "name": "/smokeuser" -} - ] -} - ] -} http://git-wip-us.apache.org/repos/asf/ambari/blob/243cafa8/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/metainfo.xml -- diff --git a/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/metainfo.xml b/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/metainfo.xml deleted file mode 100644 index 709929e..000 --- a/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/metainfo.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - 2.0 - - - MICROSOFT_R - Microsoft R - Microsoft R Server - 8.0.0 - - - - MICROSOFT_R_SERVER_CLIENT - Microsoft R Server Client - CLIENT - 1+ - -scripts/microsoft_r.py -PYTHON -1200 - - - - - -scripts/service_check.py -PYTHON -300 - - - -YARN - - - - http://git-wip-us.apache.org/repos/asf/ambari/blob/243cafa8/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/package/files/microsoft_r_serviceCheck.r -- diff --git a/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/package/files/microsoft_r_serviceCheck.r
ambari git commit: AMBARI-18537. Update Mirosoft R version in mpack (Balázs Bence Sári via magyari_sandor)
Repository: ambari Updated Branches: refs/heads/branch-2.5 77019f781 -> 5ef89d5b6 AMBARI-18537. Update Mirosoft R version in mpack (Balázs Bence Sári via magyari_sandor) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/5ef89d5b Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/5ef89d5b Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/5ef89d5b Branch: refs/heads/branch-2.5 Commit: 5ef89d5b6964c4ce6770e962e3eba02e418dfb14 Parents: 77019f7 Author: Balázs Bence SáriAuthored: Fri Oct 7 11:28:51 2016 +0200 Committer: Sandor Magyari Committed: Fri Oct 7 11:30:13 2016 +0200 -- .../MICROSOFT_R/8.0.0/kerberos.json | 15 .../MICROSOFT_R/8.0.0/metainfo.xml | 53 .../package/files/microsoft_r_serviceCheck.r| 28 -- .../8.0.0/package/scripts/microsoft_r.py| 47 --- .../MICROSOFT_R/8.0.0/package/scripts/params.py | 31 --- .../8.0.0/package/scripts/params_linux.py | 79 - .../8.0.0/package/scripts/params_windows.py | 26 -- .../8.0.0/package/scripts/service_check.py | 89 .../MICROSOFT_R/8.0.0/role_command_order.json | 6 -- .../MICROSOFT_R/8.0.0/service_advisor.py| 73 .../MICROSOFT_R/8.0.5/kerberos.json | 15 .../MICROSOFT_R/8.0.5/metainfo.xml | 53 .../package/files/microsoft_r_serviceCheck.r| 28 ++ .../8.0.5/package/scripts/microsoft_r.py| 47 +++ .../MICROSOFT_R/8.0.5/package/scripts/params.py | 31 +++ .../8.0.5/package/scripts/params_linux.py | 79 + .../8.0.5/package/scripts/params_windows.py | 26 ++ .../8.0.5/package/scripts/service_check.py | 89 .../MICROSOFT_R/8.0.5/role_command_order.json | 6 ++ .../MICROSOFT_R/8.0.5/service_advisor.py| 73 .../MICROSOFT_R/8.0.0/metainfo.xml | 28 -- .../MICROSOFT_R/8.0.0/repos/repoinfo.xml| 33 .../MICROSOFT_R/8.0.5/metainfo.xml | 28 ++ .../MICROSOFT_R/8.0.5/repos/repoinfo.xml| 33 .../src/main/resources/mpack.json | 2 +- 25 files changed, 509 insertions(+), 509 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/5ef89d5b/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/kerberos.json -- diff --git a/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/kerberos.json b/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/kerberos.json deleted file mode 100644 index 86fab2d..000 --- a/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/kerberos.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "services": [ -{ - "name": "MICROSOFT_R", - "identities": [ -{ - "name": "/HDFS/NAMENODE/hdfs" -}, -{ - "name": "/smokeuser" -} - ] -} - ] -} http://git-wip-us.apache.org/repos/asf/ambari/blob/5ef89d5b/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/metainfo.xml -- diff --git a/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/metainfo.xml b/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/metainfo.xml deleted file mode 100644 index 709929e..000 --- a/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/metainfo.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - 2.0 - - - MICROSOFT_R - Microsoft R - Microsoft R Server - 8.0.0 - - - - MICROSOFT_R_SERVER_CLIENT - Microsoft R Server Client - CLIENT - 1+ - -scripts/microsoft_r.py -PYTHON -1200 - - - - - -scripts/service_check.py -PYTHON -300 - - - -YARN - - - - http://git-wip-us.apache.org/repos/asf/ambari/blob/5ef89d5b/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/package/files/microsoft_r_serviceCheck.r -- diff --git a/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/package/files/microsoft_r_serviceCheck.r
ambari git commit: AMBARI-18537. Update Mirosoft R version in mpack (Balázs Bence Sári via magyari_sandor)
Repository: ambari Updated Branches: refs/heads/trunk b81deb0e5 -> c153cfb63 AMBARI-18537. Update Mirosoft R version in mpack (Balázs Bence Sári via magyari_sandor) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c153cfb6 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c153cfb6 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c153cfb6 Branch: refs/heads/trunk Commit: c153cfb635fc51096c1d350ec6e23e5d5162bef7 Parents: b81deb0 Author: Balázs Bence SáriAuthored: Fri Oct 7 11:28:51 2016 +0200 Committer: Sandor Magyari Committed: Fri Oct 7 11:28:51 2016 +0200 -- .../MICROSOFT_R/8.0.0/kerberos.json | 15 .../MICROSOFT_R/8.0.0/metainfo.xml | 53 .../package/files/microsoft_r_serviceCheck.r| 28 -- .../8.0.0/package/scripts/microsoft_r.py| 47 --- .../MICROSOFT_R/8.0.0/package/scripts/params.py | 31 --- .../8.0.0/package/scripts/params_linux.py | 79 - .../8.0.0/package/scripts/params_windows.py | 26 -- .../8.0.0/package/scripts/service_check.py | 89 .../MICROSOFT_R/8.0.0/role_command_order.json | 6 -- .../MICROSOFT_R/8.0.0/service_advisor.py| 73 .../MICROSOFT_R/8.0.5/kerberos.json | 15 .../MICROSOFT_R/8.0.5/metainfo.xml | 53 .../package/files/microsoft_r_serviceCheck.r| 28 ++ .../8.0.5/package/scripts/microsoft_r.py| 47 +++ .../MICROSOFT_R/8.0.5/package/scripts/params.py | 31 +++ .../8.0.5/package/scripts/params_linux.py | 79 + .../8.0.5/package/scripts/params_windows.py | 26 ++ .../8.0.5/package/scripts/service_check.py | 89 .../MICROSOFT_R/8.0.5/role_command_order.json | 6 ++ .../MICROSOFT_R/8.0.5/service_advisor.py| 73 .../MICROSOFT_R/8.0.0/metainfo.xml | 28 -- .../MICROSOFT_R/8.0.0/repos/repoinfo.xml| 33 .../MICROSOFT_R/8.0.5/metainfo.xml | 28 ++ .../MICROSOFT_R/8.0.5/repos/repoinfo.xml| 33 .../src/main/resources/mpack.json | 2 +- 25 files changed, 509 insertions(+), 509 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/c153cfb6/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/kerberos.json -- diff --git a/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/kerberos.json b/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/kerberos.json deleted file mode 100644 index 86fab2d..000 --- a/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/kerberos.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "services": [ -{ - "name": "MICROSOFT_R", - "identities": [ -{ - "name": "/HDFS/NAMENODE/hdfs" -}, -{ - "name": "/smokeuser" -} - ] -} - ] -} http://git-wip-us.apache.org/repos/asf/ambari/blob/c153cfb6/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/metainfo.xml -- diff --git a/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/metainfo.xml b/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/metainfo.xml deleted file mode 100644 index 709929e..000 --- a/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/metainfo.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - 2.0 - - - MICROSOFT_R - Microsoft R - Microsoft R Server - 8.0.0 - - - - MICROSOFT_R_SERVER_CLIENT - Microsoft R Server Client - CLIENT - 1+ - -scripts/microsoft_r.py -PYTHON -1200 - - - - - -scripts/service_check.py -PYTHON -300 - - - -YARN - - - - http://git-wip-us.apache.org/repos/asf/ambari/blob/c153cfb6/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/package/files/microsoft_r_serviceCheck.r -- diff --git a/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/package/files/microsoft_r_serviceCheck.r