ambari git commit: AMBARI-20975: Add NIFI Admin Toolkit StackFeatures to HDP StackFeatures (mradhakrishnan)
Repository: ambari Updated Branches: refs/heads/trunk 4dd94e172 -> 9abfcf258 AMBARI-20975: Add NIFI Admin Toolkit StackFeatures to HDP StackFeatures (mradhakrishnan) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9abfcf25 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9abfcf25 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9abfcf25 Branch: refs/heads/trunk Commit: 9abfcf2586c50a69b1c80c8c91469c867e6e89ee Parents: 4dd94e1 Author: Madhuvanthi RadhakrishnanAuthored: Tue May 9 22:34:56 2017 -0700 Committer: Madhuvanthi Radhakrishnan Committed: Tue May 9 22:34:56 2017 -0700 -- .../stacks/HDP/2.0.6/properties/stack_features.json | 10 ++ 1 file changed, 10 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/9abfcf25/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json -- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json b/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json index bbd8bfc..78f7b9f 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json +++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json @@ -407,6 +407,16 @@ "name": "toolkit_config_update", "description": "Support separate input and output for toolkit configuration", "min_version": "2.6.0.0" +}, +{ + "name": "admin_toolkit_support", + "description": "Supports the nifi admin toolkit", + "min_version": "2.6.0.0" +}, +{ + "name": "tls_toolkit_san", + "description": "Support subject alternative name flag", + "min_version": "2.6.0.0" } ]
ambari git commit: AMBARI-20974: Ambari fails to start due to NPE after installation of HDF mpack (mradhakrishnan)
Repository: ambari Updated Branches: refs/heads/trunk 6e1367d0b -> 4dd94e172 AMBARI-20974: Ambari fails to start due to NPE after installation of HDF mpack (mradhakrishnan) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4dd94e17 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4dd94e17 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4dd94e17 Branch: refs/heads/trunk Commit: 4dd94e17203b5c4a52991a23724cebb45f98852a Parents: 6e1367d Author: Madhuvanthi RadhakrishnanAuthored: Tue May 9 22:29:18 2017 -0700 Committer: Madhuvanthi Radhakrishnan Committed: Tue May 9 22:29:18 2017 -0700 -- .../main/python/ambari_server/setupMpacks.py| 39 +++- ambari-server/src/test/python/TestMpacks.py | 17 ++--- 2 files changed, 49 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/4dd94e17/ambari-server/src/main/python/ambari_server/setupMpacks.py -- diff --git a/ambari-server/src/main/python/ambari_server/setupMpacks.py b/ambari-server/src/main/python/ambari_server/setupMpacks.py index 04b96f5..1bb7a70 100755 --- a/ambari-server/src/main/python/ambari_server/setupMpacks.py +++ b/ambari-server/src/main/python/ambari_server/setupMpacks.py @@ -29,7 +29,7 @@ from ambari_server.serverClassPath import ServerClassPath from ambari_commons.exceptions import FatalException from ambari_commons.inet_utils import download_file from ambari_commons.logging_utils import print_info_msg, print_error_msg, print_warning_msg -from ambari_commons.os_utils import copy_file, run_os_command +from ambari_commons.os_utils import copy_file, run_os_command, change_owner, set_file_permissions from ambari_server.serverConfiguration import get_ambari_properties, get_ambari_version, get_stack_location, \ get_common_services_location, get_mpacks_staging_location, get_server_temp_location, get_extension_location, \ get_java_exe_path, read_ambari_user, parse_properties_file, JDBC_DATABASE_PROPERTY, get_dashboard_location @@ -243,6 +243,7 @@ def create_symlink_using_path(src_path, dest_link, force=False): """ if force and os.path.islink(dest_link): sudo.unlink(dest_link) + sudo.symlink(src_path, dest_link) print_info_msg("Symlink: " + dest_link) @@ -718,24 +719,39 @@ def _install_mpack(options, replay_mode=False, is_upgrade=False): validate_purge(options, purge_resources, tmp_root_dir, mpack_metadata, replay_mode) purge_stacks_and_mpacks(purge_resources, replay_mode) + adjust_ownership_list = [] + change_ownership_list = [] + # Get ambari mpack properties stack_location, extension_location, service_definitions_location, mpacks_staging_location, dashboard_location = get_mpack_properties() mpacks_cache_location = os.path.join(mpacks_staging_location, MPACKS_CACHE_DIRNAME) # Create directories if not os.path.exists(stack_location): sudo.makedir(stack_location, 0755) + adjust_ownership_list.append((stack_location, "0755", "{0}", True)) + change_ownership_list.append((stack_location,"{0}",True)) if not os.path.exists(extension_location): sudo.makedir(extension_location, 0755) + adjust_ownership_list.append((extension_location, "0755", "{0}", True)) + change_ownership_list.append((extension_location,"{0}",True)) if not os.path.exists(service_definitions_location): sudo.makedir(service_definitions_location, 0755) + adjust_ownership_list.append((service_definitions_location, "0755", "{0}", True)) + change_ownership_list.append((service_definitions_location,"{0}",True)) if not os.path.exists(mpacks_staging_location): sudo.makedir(mpacks_staging_location, 0755) + adjust_ownership_list.append((mpacks_staging_location, "0755", "{0}", True)) + change_ownership_list.append((mpacks_staging_location,"{0}",True)) if not os.path.exists(mpacks_cache_location): sudo.makedir(mpacks_cache_location, 0755) + adjust_ownership_list.append((mpacks_cache_location, "0755", "{0}", True)) + change_ownership_list.append((mpacks_cache_location,"{0}",True)) if not os.path.exists(dashboard_location): sudo.makedir(dashboard_location, 0755) sudo.makedir(os.path.join(dashboard_location, GRAFANA_DASHBOARDS_DIRNAME), 0755) sudo.makedir(os.path.join(dashboard_location, SERVICE_METRICS_DIRNAME), 0755) + adjust_ownership_list.append((dashboard_location, "0755", "{0}", True)) + change_ownership_list.append((dashboard_location,"{0}",True)) # Stage management pack (Stage at /var/lib/ambari-server/resources/mpacks/mpack_name-mpack_version) mpack_name = mpack_metadata.name @@ -780,7 +796,26 @@ def _install_mpack(options,
ambari git commit: AMBARI-20975: Add NIFI Admin Toolkit StackFeatures to HDP StackFeatures (mradhakrishnan)
Repository: ambari Updated Branches: refs/heads/branch-2.5 fc17c82b8 -> 1bb30fc1f AMBARI-20975: Add NIFI Admin Toolkit StackFeatures to HDP StackFeatures (mradhakrishnan) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1bb30fc1 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1bb30fc1 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1bb30fc1 Branch: refs/heads/branch-2.5 Commit: 1bb30fc1f2c23a15c0baa2848073b5743c0c2824 Parents: fc17c82 Author: Madhuvanthi RadhakrishnanAuthored: Tue May 9 22:15:25 2017 -0700 Committer: Madhuvanthi Radhakrishnan Committed: Tue May 9 22:15:25 2017 -0700 -- .../stacks/HDP/2.0.6/properties/stack_features.json | 10 ++ 1 file changed, 10 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/1bb30fc1/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json -- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json b/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json index bbd8bfc..78f7b9f 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json +++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json @@ -407,6 +407,16 @@ "name": "toolkit_config_update", "description": "Support separate input and output for toolkit configuration", "min_version": "2.6.0.0" +}, +{ + "name": "admin_toolkit_support", + "description": "Supports the nifi admin toolkit", + "min_version": "2.6.0.0" +}, +{ + "name": "tls_toolkit_san", + "description": "Support subject alternative name flag", + "min_version": "2.6.0.0" } ]
ambari git commit: AMBARI-20974: Ambari fails to start due to NPE after installation of HDF mpack (mradhakrishnan)
Repository: ambari Updated Branches: refs/heads/branch-2.5 ea936070a -> fc17c82b8 AMBARI-20974: Ambari fails to start due to NPE after installation of HDF mpack (mradhakrishnan) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/fc17c82b Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/fc17c82b Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/fc17c82b Branch: refs/heads/branch-2.5 Commit: fc17c82b84030197c3e3c1e5c2ddcdb865d97365 Parents: ea93607 Author: Madhuvanthi RadhakrishnanAuthored: Tue May 9 22:04:35 2017 -0700 Committer: Madhuvanthi Radhakrishnan Committed: Tue May 9 22:04:35 2017 -0700 -- .../main/python/ambari_server/setupMpacks.py| 38 ++-- ambari-server/src/test/python/TestMpacks.py | 17 ++--- 2 files changed, 48 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/fc17c82b/ambari-server/src/main/python/ambari_server/setupMpacks.py -- diff --git a/ambari-server/src/main/python/ambari_server/setupMpacks.py b/ambari-server/src/main/python/ambari_server/setupMpacks.py index 167f264..09473dc 100755 --- a/ambari-server/src/main/python/ambari_server/setupMpacks.py +++ b/ambari-server/src/main/python/ambari_server/setupMpacks.py @@ -29,7 +29,7 @@ from ambari_server.serverClassPath import ServerClassPath from ambari_commons.exceptions import FatalException from ambari_commons.inet_utils import download_file from ambari_commons.logging_utils import print_info_msg, print_error_msg, print_warning_msg -from ambari_commons.os_utils import copy_file, run_os_command +from ambari_commons.os_utils import copy_file, run_os_command, change_owner, set_file_permissions from ambari_server.serverConfiguration import get_ambari_properties, get_ambari_version, get_stack_location, \ get_common_services_location, get_mpacks_staging_location, get_server_temp_location, get_extension_location, \ get_java_exe_path, read_ambari_user, parse_properties_file, JDBC_DATABASE_PROPERTY, get_dashboard_location @@ -243,6 +243,7 @@ def create_symlink_using_path(src_path, dest_link, force=False): """ if force and os.path.islink(dest_link): sudo.unlink(dest_link) + sudo.symlink(src_path, dest_link) print_info_msg("Symlink: " + dest_link) @@ -718,24 +719,38 @@ def _install_mpack(options, replay_mode=False, is_upgrade=False): validate_purge(options, purge_resources, tmp_root_dir, mpack_metadata, replay_mode) purge_stacks_and_mpacks(purge_resources, replay_mode) + adjust_ownership_list = [] + change_ownership_list = [] # Get ambari mpack properties stack_location, extension_location, service_definitions_location, mpacks_staging_location, dashboard_location = get_mpack_properties() mpacks_cache_location = os.path.join(mpacks_staging_location, MPACKS_CACHE_DIRNAME) # Create directories if not os.path.exists(stack_location): sudo.makedir(stack_location, 0755) + adjust_ownership_list.append((stack_location, "0755", "{0}", True)) + change_ownership_list.append((stack_location,"{0}",True)) if not os.path.exists(extension_location): sudo.makedir(extension_location, 0755) + adjust_ownership_list.append((extension_location, "0755", "{0}", True)) + change_ownership_list.append((extension_location,"{0}",True)) if not os.path.exists(service_definitions_location): sudo.makedir(service_definitions_location, 0755) + adjust_ownership_list.append((service_definitions_location, "0755", "{0}", True)) + change_ownership_list.append((service_definitions_location,"{0}",True)) if not os.path.exists(mpacks_staging_location): sudo.makedir(mpacks_staging_location, 0755) + adjust_ownership_list.append((mpacks_staging_location, "0755", "{0}", True)) + change_ownership_list.append((mpacks_staging_location,"{0}",True)) if not os.path.exists(mpacks_cache_location): sudo.makedir(mpacks_cache_location, 0755) + adjust_ownership_list.append((mpacks_cache_location, "0755", "{0}", True)) + change_ownership_list.append((mpacks_cache_location,"{0}",True)) if not os.path.exists(dashboard_location): sudo.makedir(dashboard_location, 0755) sudo.makedir(os.path.join(dashboard_location, GRAFANA_DASHBOARDS_DIRNAME), 0755) sudo.makedir(os.path.join(dashboard_location, SERVICE_METRICS_DIRNAME), 0755) + adjust_ownership_list.append((dashboard_location, "0755", "{0}", True)) + change_ownership_list.append((dashboard_location,"{0}",True)) # Stage management pack (Stage at /var/lib/ambari-server/resources/mpacks/mpack_name-mpack_version) mpack_name = mpack_metadata.name @@ -780,7 +795,26 @@ def _install_mpack(options,
svn commit: r19602 - in /release/ambari/ambari-2.4.3: ./ apache-ambari-2.4.3-src.tar.gz apache-ambari-2.4.3-src.tar.gz.asc apache-ambari-2.4.3-src.tar.gz.md5 apache-ambari-2.4.3-src.tar.gz.sha1
Author: yusaku Date: Tue May 9 22:22:00 2017 New Revision: 19602 Log: Committing 2.4.3 release artifacts. (yusaku) Added: release/ambari/ambari-2.4.3/ release/ambari/ambari-2.4.3/apache-ambari-2.4.3-src.tar.gz (with props) release/ambari/ambari-2.4.3/apache-ambari-2.4.3-src.tar.gz.asc release/ambari/ambari-2.4.3/apache-ambari-2.4.3-src.tar.gz.md5 release/ambari/ambari-2.4.3/apache-ambari-2.4.3-src.tar.gz.sha1 Added: release/ambari/ambari-2.4.3/apache-ambari-2.4.3-src.tar.gz == Binary file - no diff available. Propchange: release/ambari/ambari-2.4.3/apache-ambari-2.4.3-src.tar.gz -- svn:mime-type = application/octet-stream Added: release/ambari/ambari-2.4.3/apache-ambari-2.4.3-src.tar.gz.asc == --- release/ambari/ambari-2.4.3/apache-ambari-2.4.3-src.tar.gz.asc (added) +++ release/ambari/ambari-2.4.3/apache-ambari-2.4.3-src.tar.gz.asc Tue May 9 22:22:00 2017 @@ -0,0 +1,10 @@ +-BEGIN PGP SIGNATURE- + +iQEcBAABCgAGBQJZDPU2AAoJEC6XbzAIg3Kp0/YIAIrtluLEAnR1+yV1+2Tdn+dn +X3+d1z+yp6Iokfsm/FftT+IhV6L5garNZFzIu9LFAB74Mqq+bpcNPgFp5AOXA/Zb +BfXmQsFPO1sG/OY7lKSRubaZppnwxBQLa0XU+yCujn4R3m+41UsFfhPMDPPwCBx2 +BlmF4LSy3C8L8Z8fccw8vUwKQ8yBQXFgPl812TzwFsWssk3quWKiasdonglp8JZK +z2LXNUX0i7NAiXwAUTnPuocGnUgk1ogkedGPgWZfLo12md1K0afPEth+LcQrmb/3 +5gfqRTOU3blIZc+o93/uBxlfkzpT8aWOiDZUAaJ36b0QiwIvN7nJxvcvW0G4JqM= +=rn6I +-END PGP SIGNATURE- Added: release/ambari/ambari-2.4.3/apache-ambari-2.4.3-src.tar.gz.md5 == --- release/ambari/ambari-2.4.3/apache-ambari-2.4.3-src.tar.gz.md5 (added) +++ release/ambari/ambari-2.4.3/apache-ambari-2.4.3-src.tar.gz.md5 Tue May 9 22:22:00 2017 @@ -0,0 +1 @@ +MD5(apache-ambari-2.4.3-src.tar.gz)= 9ab7d77a5f9e6d160b720c5109c0f276 Added: release/ambari/ambari-2.4.3/apache-ambari-2.4.3-src.tar.gz.sha1 == --- release/ambari/ambari-2.4.3/apache-ambari-2.4.3-src.tar.gz.sha1 (added) +++ release/ambari/ambari-2.4.3/apache-ambari-2.4.3-src.tar.gz.sha1 Tue May 9 22:22:00 2017 @@ -0,0 +1 @@ +SHA1(apache-ambari-2.4.3-src.tar.gz)= 93346deb5538563fb5e1f10dee792d29f16c8b8f
svn commit: r19603 - /release/ambari/ambari-2.4.2/
Author: yusaku Date: Tue May 9 22:22:25 2017 New Revision: 19603 Log: Remove 2.4.2. (yusaku) Removed: release/ambari/ambari-2.4.2/
[ambari] Git Push Summary
Repository: ambari Updated Tags: refs/tags/release-2.4.3 [created] 29f2b2a3b
[1/2] ambari git commit: AMBARI-20958 - Host Version on Finalization Must Be Scoped Correctly Based on Upgrade Type (jonathanhurley)
Repository: ambari Updated Branches: refs/heads/branch-feature-AMBARI-12556 aaa821cc2 -> a2632675a http://git-wip-us.apache.org/repos/asf/ambari/blob/a2632675/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java index 576f308..e2d9cc6 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java @@ -973,7 +973,7 @@ public class UpgradeResourceProviderTest { requestProps.clear(); // Now perform a downgrade requestProps.put(UpgradeResourceProvider.UPGRADE_CLUSTER_NAME, "c1"); -requestProps.put(UpgradeResourceProvider.UPGRADE_VERSION, "2.2"); +requestProps.put(UpgradeResourceProvider.UPGRADE_VERSION, "2.1.1.0"); requestProps.put(UpgradeResourceProvider.UPGRADE_PACK, "upgrade_direction"); requestProps.put(UpgradeResourceProvider.UPGRADE_SKIP_PREREQUISITE_CHECKS, "true"); requestProps.put(UpgradeResourceProvider.UPGRADE_FROM_VERSION, "2.2.2.3"); @@ -992,8 +992,9 @@ public class UpgradeResourceProviderTest { } } assertNotNull(upgrade); -assertEquals("Downgrade groups reduced from 3 to 2", 2, upgrade.getUpgradeGroups().size()); -group = upgrade.getUpgradeGroups().get(1); +List groups = upgrade.getUpgradeGroups(); +assertEquals("Downgrade groups reduced from 3 to 2", 1, groups.size()); +group = upgrade.getUpgradeGroups().get(0); assertEquals("Execution items increased from 1 to 2", 2, group.getItems().size()); } @@ -1060,7 +1061,7 @@ public class UpgradeResourceProviderTest { assertEquals(oldStack, sc.getDesiredStackId()); for (ServiceComponentHost sch : sc.getServiceComponentHosts().values()) { - assertEquals(oldStack.getStackVersion(), sch.getVersion()); + assertEquals(repoVersionEntity2110.getVersion(), sch.getVersion()); } } } @@ -1100,14 +1101,10 @@ public class UpgradeResourceProviderTest { assertFalse(oldStack.equals(newStack)); for (Service s : cluster.getServices().values()) { - assertEquals(newStack, s.getDesiredStackId()); + assertEquals(repoVersionEntity2200, s.getDesiredRepositoryVersion()); for (ServiceComponent sc : s.getServiceComponents().values()) { -assertEquals(newStack, sc.getDesiredStackId()); - -for (ServiceComponentHost sch : sc.getServiceComponentHosts().values()) { - assertEquals(newStack.getStackVersion(), sch.getVersion()); -} +assertEquals(repoVersionEntity2200, sc.getDesiredRepositoryVersion()); } } } @@ -1568,7 +1565,7 @@ public class UpgradeResourceProviderTest { component = service.getServiceComponent("DRPC_SERVER"); assertNotNull(component); -assertEquals("UNKNOWN", component.getDesiredVersion()); +assertEquals(repoVersionEntity2110, component.getDesiredRepositoryVersion()); hostComponent = component.getServiceComponentHost("h1"); assertEquals(UpgradeState.NONE, hostComponent.getUpgradeState()); http://git-wip-us.apache.org/repos/asf/ambari/blob/a2632675/ambari-server/src/test/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListenerTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListenerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListenerTest.java index a74a1d2..e2e68fc 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListenerTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListenerTest.java @@ -17,7 +17,6 @@ */ package org.apache.ambari.server.events.listeners.upgrade; -import static org.easymock.EasyMock.anyString; import static org.easymock.EasyMock.expect; import static org.easymock.EasyMock.expectLastCall; @@ -28,6 +27,7 @@ import org.apache.ambari.server.api.services.AmbariMetaInfo; import org.apache.ambari.server.events.HostComponentVersionAdvertisedEvent; import org.apache.ambari.server.events.publishers.VersionEventPublisher; import org.apache.ambari.server.orm.dao.RepositoryVersionDAO; +import org.apache.ambari.server.orm.entities.HostVersionEntity; import org.apache.ambari.server.orm.entities.RepositoryVersionEntity; import org.apache.ambari.server.orm.entities.UpgradeEntity; import org.apache.ambari.server.state.Cluster; @@ -63,6 +63,7 @@ public
[2/2] ambari git commit: AMBARI-20958 - Host Version on Finalization Must Be Scoped Correctly Based on Upgrade Type (jonathanhurley)
AMBARI-20958 - Host Version on Finalization Must Be Scoped Correctly Based on Upgrade Type (jonathanhurley) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a2632675 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a2632675 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a2632675 Branch: refs/heads/branch-feature-AMBARI-12556 Commit: a2632675a37223d66dc2cb2edb3138467d74fb5b Parents: aaa821c Author: Jonathan HurleyAuthored: Mon May 8 14:46:53 2017 -0400 Committer: Jonathan Hurley Committed: Tue May 9 16:49:23 2017 -0400 -- .../ClusterStackVersionResourceProvider.java| 15 -- .../VersionDefinitionResourceProvider.java | 4 +- .../upgrade/HostVersionOutOfSyncListener.java | 6 +- .../listeners/upgrade/StackVersionListener.java | 154 +-- .../server/orm/dao/HostComponentStateDAO.java | 31 .../ambari/server/orm/dao/HostVersionDAO.java | 147 +++--- .../server/orm/dao/RepositoryVersionDAO.java| 9 +- .../server/orm/entities/HostVersionEntity.java | 35 +++-- .../orm/entities/RepositoryVersionEntity.java | 72 + .../serveraction/ServerActionExecutor.java | 3 +- .../upgrades/FinalizeUpgradeAction.java | 106 - .../upgrades/UpdateDesiredStackAction.java | 32 +++- .../org/apache/ambari/server/state/Cluster.java | 16 -- .../server/state/ServiceComponentHost.java | 18 ++- .../ambari/server/state/UpgradeContext.java | 37 - .../ambari/server/state/UpgradeHelper.java | 2 +- .../server/state/cluster/ClusterImpl.java | 63 .../svccomphost/ServiceComponentHostImpl.java | 82 +- .../ServiceComponentHostSummary.java| 104 ++--- .../main/resources/Ambari-DDL-Derby-CREATE.sql | 2 +- .../main/resources/Ambari-DDL-MySQL-CREATE.sql | 2 +- .../main/resources/Ambari-DDL-Oracle-CREATE.sql | 2 +- .../resources/Ambari-DDL-Postgres-CREATE.sql| 2 +- .../resources/Ambari-DDL-SQLAnywhere-CREATE.sql | 2 +- .../resources/Ambari-DDL-SQLServer-CREATE.sql | 2 +- .../internal/UpgradeResourceProviderTest.java | 19 +-- .../upgrade/StackVersionListenerTest.java | 37 +++-- .../server/state/cluster/ClusterTest.java | 112 +++--- 28 files changed, 436 insertions(+), 680 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/a2632675/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java index 774ba0c..1e49eb2 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java @@ -681,21 +681,6 @@ public class ClusterStackVersionResourceProvider extends AbstractControllerResou } /** - * Updates the version states. Transactional to ensure only one transaction for all updates - * @param clusterId the cluster - * @param current the repository that is current for the cluster - * @param targetthe target repository - */ - @Transactional - protected void updateVersionStates(Long clusterId, RepositoryVersionEntity current, - RepositoryVersionEntity target) { - -hostComponentStateDAO.updateVersions(target.getVersion()); -hostVersionDAO.updateVersions(target, current); -//clusterVersionDAO.updateVersions(clusterId, target, current); - } - - /** * Additional check over {@link VersionUtils#compareVersions(String, String)} that * compares build numbers */ http://git-wip-us.apache.org/repos/asf/ambari/blob/a2632675/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/VersionDefinitionResourceProvider.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/VersionDefinitionResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/VersionDefinitionResourceProvider.java index 5f12e52..e41e3da 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/VersionDefinitionResourceProvider.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/VersionDefinitionResourceProvider.java @@ -355,7 +355,7 @@ public class
svn commit: r1794636 - in /ambari/site: index.html install-0.9.html install.html irc.html issue-tracking.html license.html mail-lists.html privacy-policy.html project-info.html team-list.html whats-ne
Author: yusaku Date: Tue May 9 20:21:17 2017 New Revision: 1794636 URL: http://svn.apache.org/viewvc?rev=1794636=rev Log: Updated team page. (yusaku) Modified: ambari/site/index.html ambari/site/install-0.9.html ambari/site/install.html ambari/site/irc.html ambari/site/issue-tracking.html ambari/site/license.html ambari/site/mail-lists.html ambari/site/privacy-policy.html ambari/site/project-info.html ambari/site/team-list.html ambari/site/whats-new.html Modified: ambari/site/index.html URL: http://svn.apache.org/viewvc/ambari/site/index.html?rev=1794636=1794635=1794636=diff == --- ambari/site/index.html (original) +++ ambari/site/index.html Tue May 9 20:21:17 2017 @@ -1,13 +1,13 @@ http://www.w3.org/1999/xhtml; xml:lang="en" lang="en"> - + Ambari - @@ -341,7 +341,7 @@ - Last Published: 2017-04-11 | + Last Published: 2017-05-09 | Version: 2.5.0 Modified: ambari/site/install-0.9.html URL: http://svn.apache.org/viewvc/ambari/site/install-0.9.html?rev=1794636=1794635=1794636=diff == --- ambari/site/install-0.9.html (original) +++ ambari/site/install-0.9.html Tue May 9 20:21:17 2017 @@ -1,13 +1,13 @@ http://www.w3.org/1999/xhtml; xml:lang="en" lang="en"> - + Ambari - @@ -341,7 +341,7 @@ - Last Published: 2017-04-11 | + Last Published: 2017-05-09 | Version: 2.5.0 Modified: ambari/site/install.html URL: http://svn.apache.org/viewvc/ambari/site/install.html?rev=1794636=1794635=1794636=diff == --- ambari/site/install.html (original) +++ ambari/site/install.html Tue May 9 20:21:17 2017 @@ -1,13 +1,13 @@ http://www.w3.org/1999/xhtml; xml:lang="en" lang="en"> - + Ambari - @@ -341,7 +341,7 @@ - Last Published: 2017-04-11 | + Last Published: 2017-05-09 | Version: 2.5.0 Modified: ambari/site/irc.html URL: http://svn.apache.org/viewvc/ambari/site/irc.html?rev=1794636=1794635=1794636=diff == --- ambari/site/irc.html (original) +++ ambari/site/irc.html Tue May 9 20:21:17 2017 @@ -1,13 +1,13 @@ http://www.w3.org/1999/xhtml; xml:lang="en" lang="en"> - + Ambari - @@ -341,7 +341,7 @@ - Last Published: 2017-04-11 | + Last Published: 2017-05-09 | Version: 2.5.0 Modified: ambari/site/issue-tracking.html URL: http://svn.apache.org/viewvc/ambari/site/issue-tracking.html?rev=1794636=1794635=1794636=diff == --- ambari/site/issue-tracking.html (original) +++ ambari/site/issue-tracking.html Tue May 9 20:21:17 2017 @@ -1,13 +1,13 @@ http://www.w3.org/1999/xhtml; xml:lang="en" lang="en"> - + Ambari - Issue Tracking @@ -341,7 +341,7 @@ - Last Published: 2017-04-11 | + Last Published: 2017-05-09 | Version: 2.5.0 Modified: ambari/site/license.html URL: http://svn.apache.org/viewvc/ambari/site/license.html?rev=1794636=1794635=1794636=diff == --- ambari/site/license.html (original) +++ ambari/site/license.html Tue May 9 20:21:17 2017 @@ -1,13 +1,13 @@ http://www.w3.org/1999/xhtml; xml:lang="en" lang="en"> - + Ambari - Project License @@ -341,7 +341,7 @@ - Last Published: 2017-04-11 | + Last Published: 2017-05-09 | Version: 2.5.0 Modified: ambari/site/mail-lists.html URL: http://svn.apache.org/viewvc/ambari/site/mail-lists.html?rev=1794636=1794635=1794636=diff == --- ambari/site/mail-lists.html (original) +++ ambari/site/mail-lists.html Tue May 9 20:21:17 2017 @@ -1,13 +1,13 @@ http://www.w3.org/1999/xhtml; xml:lang="en"
ambari git commit: AMBARI-20961. RBAC: Service Operator/Administrator Role don't have HOST.ADD_DELETE_COMPONENTS permission so we 'd better hide relevant buttons on Web UI. (Yao Lei via yusaku)
Repository: ambari Updated Branches: refs/heads/trunk 436c91284 -> 6e1367d0b AMBARI-20961. RBAC: Service Operator/Administrator Role don't have HOST.ADD_DELETE_COMPONENTS permission so we 'd better hide relevant buttons on Web UI. (Yao Lei via yusaku) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/6e1367d0 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6e1367d0 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6e1367d0 Branch: refs/heads/trunk Commit: 6e1367d0b0fe44a26f772218de19e92154597e7b Parents: 436c912 Author: Yusaku SakoAuthored: Tue May 9 12:25:20 2017 -0700 Committer: Yusaku Sako Committed: Tue May 9 12:26:27 2017 -0700 -- ambari-web/app/views/main/service/item.js | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/6e1367d0/ambari-web/app/views/main/service/item.js -- diff --git a/ambari-web/app/views/main/service/item.js b/ambari-web/app/views/main/service/item.js index ac736a6..e25ade1 100644 --- a/ambari-web/app/views/main/service/item.js +++ b/ambari-web/app/views/main/service/item.js @@ -239,7 +239,8 @@ App.MainServiceItemView = Em.View.extend({ }); } - self.addActionMap().filterProperty('service', serviceName).forEach(function(item) { + if(App.isAuthorized('HOST.ADD_DELETE_COMPONENTS')){ +self.addActionMap().filterProperty('service', serviceName).forEach(function(item) { if (App.get('components.addableToHost').contains(item.component)) { var isEnabled = App.HostComponent.find().filterProperty('componentName', item.component).length < App.get('allHostNames.length'); @@ -255,7 +256,8 @@ App.MainServiceItemView = Em.View.extend({ options.push(item); } - }); + }); + } allMasters.forEach(function(master) { var component = App.StackServiceComponent.find(master);
ambari git commit: AMBARI-20961. RBAC: Service Operator/Administrator Role don't have HOST.ADD_DELETE_COMPONENTS permission so we 'd better hide relevant buttons on Web UI. (Yao Lei via yusaku)
Repository: ambari Updated Branches: refs/heads/branch-2.5 e12518654 -> ea936070a AMBARI-20961. RBAC: Service Operator/Administrator Role don't have HOST.ADD_DELETE_COMPONENTS permission so we 'd better hide relevant buttons on Web UI. (Yao Lei via yusaku) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ea936070 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ea936070 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ea936070 Branch: refs/heads/branch-2.5 Commit: ea936070a5914731ed0e414533df4d2016f64d19 Parents: e125186 Author: Yusaku SakoAuthored: Tue May 9 12:25:20 2017 -0700 Committer: Yusaku Sako Committed: Tue May 9 12:25:20 2017 -0700 -- ambari-web/app/views/main/service/item.js | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/ea936070/ambari-web/app/views/main/service/item.js -- diff --git a/ambari-web/app/views/main/service/item.js b/ambari-web/app/views/main/service/item.js index b5c665f..09457f2 100644 --- a/ambari-web/app/views/main/service/item.js +++ b/ambari-web/app/views/main/service/item.js @@ -238,7 +238,8 @@ App.MainServiceItemView = Em.View.extend({ }); } - self.addActionMap().filterProperty('service', serviceName).forEach(function(item) { + if(App.isAuthorized('HOST.ADD_DELETE_COMPONENTS')){ +self.addActionMap().filterProperty('service', serviceName).forEach(function(item) { if (App.get('components.addableToHost').contains(item.component)) { var isEnabled = App.HostComponent.find().filterProperty('componentName', item.component).length < App.get('allHostNames.length'); @@ -254,7 +255,8 @@ App.MainServiceItemView = Em.View.extend({ options.push(item); } - }); + }); + } allMasters.forEach(function(master) { var component = App.StackServiceComponent.find(master);
ambari git commit: AMBARI-20595. There is a syntax error in install script hence ambari doesn't pick the python 2.7 if system python path is not present (Aman Poonia via smohanty)
Repository: ambari Updated Branches: refs/heads/trunk aa78a1724 -> 436c91284 AMBARI-20595. There is a syntax error in install script hence ambari doesn't pick the python 2.7 if system python path is not present (Aman Poonia via smohanty) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/436c9128 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/436c9128 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/436c9128 Branch: refs/heads/trunk Commit: 436c912844657347b5a80f89dedd6d537db82867 Parents: aa78a17 Author: Sumit MohantyAuthored: Tue May 9 12:05:04 2017 -0700 Committer: Sumit Mohanty Committed: Tue May 9 12:06:46 2017 -0700 -- ambari-agent/conf/unix/install-helper.sh | 2 +- ambari-server/conf/unix/install-helper.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/436c9128/ambari-agent/conf/unix/install-helper.sh -- diff --git a/ambari-agent/conf/unix/install-helper.sh b/ambari-agent/conf/unix/install-helper.sh index fef634f..c30aab1 100644 --- a/ambari-agent/conf/unix/install-helper.sh +++ b/ambari-agent/conf/unix/install-helper.sh @@ -90,7 +90,7 @@ do_install(){ rm -f "$PYTHON_WRAPER_TARGET" AMBARI_PYTHON="" - python_binaries=( "/usr/bin/python" "/usr/bin/python2" "/usr/bin/python2.7", "/usr/bin/python2.6" ) + python_binaries=( "/usr/bin/python" "/usr/bin/python2" "/usr/bin/python2.7" "/usr/bin/python2.6" ) for python_binary in "${python_binaries[@]}" do $python_binary -c "import sys ; ver = sys.version_info ; sys.exit(not (ver >= (2,6) and ver<(3,0)))" 1>/dev/null 2>/dev/null http://git-wip-us.apache.org/repos/asf/ambari/blob/436c9128/ambari-server/conf/unix/install-helper.sh -- diff --git a/ambari-server/conf/unix/install-helper.sh b/ambari-server/conf/unix/install-helper.sh index 7b29d06..6d7b3c7 100644 --- a/ambari-server/conf/unix/install-helper.sh +++ b/ambari-server/conf/unix/install-helper.sh @@ -86,7 +86,7 @@ do_install(){ rm -f "$PYTHON_WRAPER_TARGET" AMBARI_PYTHON="" - python_binaries=( "/usr/bin/python" "/usr/bin/python2" "/usr/bin/python2.7", "/usr/bin/python2.6" ) + python_binaries=( "/usr/bin/python" "/usr/bin/python2" "/usr/bin/python2.7" "/usr/bin/python2.6" ) for python_binary in "${python_binaries[@]}" do $python_binary -c "import sys ; ver = sys.version_info ; sys.exit(not (ver >= (2,6) and ver<(3,0)))" 1>/dev/null 2>/dev/null
ambari git commit: AMBARI-20595. There is a syntax error in install script hence ambari doesn't pick the python 2.7 if system python path is not present (Aman Poonia via smohanty)
Repository: ambari Updated Branches: refs/heads/branch-2.5 e5bfb5a8d -> e12518654 AMBARI-20595. There is a syntax error in install script hence ambari doesn't pick the python 2.7 if system python path is not present (Aman Poonia via smohanty) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e1251865 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e1251865 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e1251865 Branch: refs/heads/branch-2.5 Commit: e12518654ef378232e5ae8e4d9b488df4703cc8d Parents: e5bfb5a Author: Sumit MohantyAuthored: Tue May 9 12:05:04 2017 -0700 Committer: Sumit Mohanty Committed: Tue May 9 12:05:04 2017 -0700 -- ambari-agent/conf/unix/install-helper.sh | 2 +- ambari-server/conf/unix/install-helper.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/e1251865/ambari-agent/conf/unix/install-helper.sh -- diff --git a/ambari-agent/conf/unix/install-helper.sh b/ambari-agent/conf/unix/install-helper.sh index 0e32d0a..ee5b62b 100644 --- a/ambari-agent/conf/unix/install-helper.sh +++ b/ambari-agent/conf/unix/install-helper.sh @@ -89,7 +89,7 @@ do_install(){ rm -f "$PYTHON_WRAPER_TARGET" AMBARI_PYTHON="" - python_binaries=( "/usr/bin/python" "/usr/bin/python2" "/usr/bin/python2.7", "/usr/bin/python2.6" ) + python_binaries=( "/usr/bin/python" "/usr/bin/python2" "/usr/bin/python2.7" "/usr/bin/python2.6" ) for python_binary in "${python_binaries[@]}" do $python_binary -c "import sys ; ver = sys.version_info ; sys.exit(not (ver >= (2,6) and ver<(3,0)))" 1>/dev/null 2>/dev/null http://git-wip-us.apache.org/repos/asf/ambari/blob/e1251865/ambari-server/conf/unix/install-helper.sh -- diff --git a/ambari-server/conf/unix/install-helper.sh b/ambari-server/conf/unix/install-helper.sh index 8def27a..e9ab202 100644 --- a/ambari-server/conf/unix/install-helper.sh +++ b/ambari-server/conf/unix/install-helper.sh @@ -83,7 +83,7 @@ do_install(){ rm -f "$PYTHON_WRAPER_TARGET" AMBARI_PYTHON="" - python_binaries=( "/usr/bin/python" "/usr/bin/python2" "/usr/bin/python2.7", "/usr/bin/python2.6" ) + python_binaries=( "/usr/bin/python" "/usr/bin/python2" "/usr/bin/python2.7" "/usr/bin/python2.6" ) for python_binary in "${python_binaries[@]}" do $python_binary -c "import sys ; ver = sys.version_info ; sys.exit(not (ver >= (2,6) and ver<(3,0)))" 1>/dev/null 2>/dev/null
[6/6] ambari git commit: AMBARI-20957. Remove cluster_version use (ncole)
AMBARI-20957. Remove cluster_version use (ncole) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/aaa821cc Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/aaa821cc Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/aaa821cc Branch: refs/heads/branch-feature-AMBARI-12556 Commit: aaa821cc2455a29b1e83caf5eab98272053d5aa5 Parents: 15c04ed Author: Nate ColeAuthored: Mon May 8 15:29:14 2017 -0400 Committer: Nate Cole Committed: Tue May 9 10:31:50 2017 -0400 -- .../apache/ambari/annotations/Experimental.java | 5 + .../ambari/server/StateRecoveryManager.java | 30 +- .../ambari/server/agent/ExecutionCommand.java | 5 + .../server/checks/AbstractCheckDescriptor.java | 4 - .../HardcodedStackVersionPropertiesCheck.java | 55 +- .../server/checks/InstallPackagesCheck.java | 16 +- .../YarnTimelineServerStatePreservingCheck.java | 6 +- .../controller/AmbariActionExecutionHelper.java | 54 +- .../AmbariCustomCommandExecutionHelper.java | 88 +-- .../AmbariManagementControllerImpl.java | 68 +- .../server/controller/KerberosHelperImpl.java | 4 +- .../ClusterStackVersionResourceProvider.java| 215 +++--- .../internal/HostResourceProvider.java | 19 +- .../HostStackVersionResourceProvider.java | 1 - .../RepositoryVersionResourceProvider.java | 54 +- .../internal/ServiceResourceProvider.java | 19 +- .../internal/UpgradeResourceProvider.java | 10 +- .../DistributeRepositoriesActionListener.java | 9 - .../upgrade/HostVersionOutOfSyncListener.java | 91 +-- .../listeners/upgrade/StackVersionListener.java | 9 +- .../server/orm/dao/ClusterVersionDAO.java | 233 --- .../ambari/server/orm/dao/HostVersionDAO.java | 22 + .../server/orm/entities/ClusterEntity.java | 17 - .../orm/entities/ClusterVersionEntity.java | 217 -- .../server/orm/entities/HostVersionEntity.java | 5 +- .../orm/entities/RepositoryVersionEntity.java | 11 - .../ServiceComponentDesiredStateEntity.java | 2 +- .../upgrades/FinalizeUpgradeAction.java | 3 - .../apache/ambari/server/stack/RepoUtil.java| 6 +- .../stack/UpdateActiveRepoVersionOnStartup.java | 49 +- .../org/apache/ambari/server/state/Cluster.java | 82 +-- .../server/state/cluster/ClusterImpl.java | 658 +-- .../server/state/cluster/ClustersImpl.java | 13 - .../services/RetryUpgradeActionService.java | 7 - .../server/upgrade/UpgradeCatalog220.java | 5 +- .../main/resources/Ambari-DDL-Derby-CREATE.sql | 13 - .../main/resources/Ambari-DDL-MySQL-CREATE.sql | 12 - .../main/resources/Ambari-DDL-Oracle-CREATE.sql | 12 - .../resources/Ambari-DDL-Postgres-CREATE.sql| 13 - .../resources/Ambari-DDL-SQLAnywhere-CREATE.sql | 13 - .../resources/Ambari-DDL-SQLServer-CREATE.sql | 13 - .../src/main/resources/META-INF/persistence.xml | 2 - .../ambari/server/StateRecoveryManagerTest.java | 66 +- .../server/agent/HeartbeatProcessorTest.java| 31 +- .../server/agent/HeartbeatTestHelper.java | 4 - .../server/agent/TestHeartbeatHandler.java | 31 +- .../server/agent/TestHeartbeatMonitor.java | 14 +- .../server/checks/InstallPackagesCheckTest.java | 26 +- ...duce2JobHistoryStatePreservingCheckTest.java | 7 - ...nTimelineServerStatePreservingCheckTest.java | 11 - .../configuration/RecoveryConfigHelperTest.java | 23 +- .../AmbariManagementControllerImplTest.java | 40 +- .../AmbariManagementControllerTest.java | 37 -- ...ClusterStackVersionResourceProviderTest.java | 136 ++-- ...leRepositoryVersionResourceProviderTest.java | 3 - .../internal/HostResourceProviderTest.java | 7 - .../RepositoryVersionResourceProviderTest.java | 74 +-- .../internal/ServiceResourceProviderTest.java | 43 +- .../StackDefinedPropertyProviderTest.java | 3 - .../UpgradeResourceProviderHDP22Test.java | 318 - .../internal/UpgradeResourceProviderTest.java | 8 +- .../UpgradeSummaryResourceProviderTest.java | 2 - .../apache/ambari/server/events/EventsTest.java | 3 - .../HostVersionOutOfSyncListenerTest.java | 95 ++- .../upgrade/StackVersionListenerTest.java | 6 - .../apache/ambari/server/orm/OrmTestHelper.java | 47 +- .../server/orm/dao/ClusterVersionDAOTest.java | 264 .../server/orm/dao/HostVersionDAOTest.java | 34 +- .../orm/dao/RepositoryVersionDAOTest.java | 35 - .../ComponentVersionCheckActionTest.java| 60 +- .../upgrades/ConfigureActionTest.java | 6 - .../upgrades/UpgradeActionTest.java | 45 +- .../UpdateActiveRepoVersionOnStartupTest.java | 60 +- .../ambari/server/state/CheckHelperTest.java| 2 -
[2/6] ambari git commit: AMBARI-20957. Remove cluster_version use (ncole)
http://git-wip-us.apache.org/repos/asf/ambari/blob/aaa821cc/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/ClusterVersionDAOTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/ClusterVersionDAOTest.java b/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/ClusterVersionDAOTest.java deleted file mode 100644 index 81fa8e1..000 --- a/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/ClusterVersionDAOTest.java +++ /dev/null @@ -1,264 +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.orm.dao; - -import java.sql.SQLException; - -import org.apache.ambari.server.AmbariException; -import org.apache.ambari.server.H2DatabaseCleaner; -import org.apache.ambari.server.orm.GuiceJpaInitializer; -import org.apache.ambari.server.orm.InMemoryDefaultTestModule; -import org.apache.ambari.server.orm.OrmTestHelper; -import org.apache.ambari.server.orm.entities.ClusterEntity; -import org.apache.ambari.server.orm.entities.ClusterVersionEntity; -import org.apache.ambari.server.state.RepositoryVersionState; -import org.apache.ambari.server.state.StackId; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - -import com.google.inject.Guice; -import com.google.inject.Injector; - -/** - * ClusterVersionDAO unit tests. - */ -public class ClusterVersionDAOTest { - - private static Injector injector; - private ClusterVersionDAO clusterVersionDAO; - private ClusterDAO clusterDAO; - private OrmTestHelper helper; - - private long clusterId; - ClusterEntity cluster; - private int lastStep = -1; - - ClusterVersionEntity cvA; - long cvAId = 0L; - - ClusterVersionEntity cvB; - long cvBId = 0L; - - ClusterVersionEntity cvC; - long cvCId = 0L; - - private final static StackId HDP_22_STACK = new StackId("HDP", "2.2.0"); - private final static StackId BAD_STACK = new StackId("BADSTACK", "1.0"); - - @Before - public void before() { -injector = Guice.createInjector(new InMemoryDefaultTestModule()); -injector.getInstance(GuiceJpaInitializer.class); - -clusterVersionDAO = injector.getInstance(ClusterVersionDAO.class); -clusterDAO = injector.getInstance(ClusterDAO.class); -helper = injector.getInstance(OrmTestHelper.class); - } - - /** - * Helper function to transition the cluster through several cluster versions. - * @param currStep Step to go to is a value from 1 - 7, inclusive. - */ - private void createRecordsUntilStep(int currStep) throws Exception { -// Fresh install on A -if (currStep >= 1 && lastStep <= 0) { - clusterId = helper.createCluster(); - cluster = clusterDAO.findById(clusterId); - - cvA = new ClusterVersionEntity(cluster, helper.getOrCreateRepositoryVersion(HDP_22_STACK, "2.2.0.0-995"), RepositoryVersionState.CURRENT, System.currentTimeMillis(), System.currentTimeMillis(), "admin"); - clusterVersionDAO.create(cvA); - cvAId = cvA.getId(); -} else { - cluster = clusterDAO.findById(clusterId); - cvA = clusterVersionDAO.findByPK(cvAId); -} - -// Install B -if (currStep >= 2) { - if (lastStep <= 1) { -cvB = new ClusterVersionEntity(cluster, helper.getOrCreateRepositoryVersion(HDP_22_STACK, "2.2.0.1-998"), RepositoryVersionState.INSTALLED, System.currentTimeMillis(), System.currentTimeMillis(), "admin"); -clusterVersionDAO.create(cvB); -cvBId = cvB.getId(); - } else { -cvB = clusterVersionDAO.findByPK(cvBId); - } -} - -// Switch from A to B -if (currStep >= 3 && lastStep <= 2) { - cvA.setState(RepositoryVersionState.INSTALLED); - cvB.setState(RepositoryVersionState.CURRENT); - clusterVersionDAO.merge(cvA); - clusterVersionDAO.merge(cvB); -} - -// Start upgrading C -if (currStep >= 4) { - if (lastStep <= 3) { -cvC = new ClusterVersionEntity(cluster, helper.getOrCreateRepositoryVersion(HDP_22_STACK, "2.2.0.0-100"), RepositoryVersionState.INSTALLING, System.currentTimeMillis(), "admin"); -clusterVersionDAO.create(cvC); -
[4/6] ambari git commit: AMBARI-20957. Remove cluster_version use (ncole)
http://git-wip-us.apache.org/repos/asf/ambari/blob/aaa821cc/ambari-server/src/main/java/org/apache/ambari/server/state/services/RetryUpgradeActionService.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/services/RetryUpgradeActionService.java b/ambari-server/src/main/java/org/apache/ambari/server/state/services/RetryUpgradeActionService.java index 584ce98..c43d3ba 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/services/RetryUpgradeActionService.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/services/RetryUpgradeActionService.java @@ -30,7 +30,6 @@ import org.apache.ambari.server.AmbariService; import org.apache.ambari.server.actionmanager.HostRoleStatus; import org.apache.ambari.server.configuration.Configuration; import org.apache.ambari.server.orm.dao.HostRoleCommandDAO; -import org.apache.ambari.server.orm.entities.ClusterVersionEntity; import org.apache.ambari.server.orm.entities.HostRoleCommandEntity; import org.apache.ambari.server.orm.entities.UpgradeEntity; import org.apache.ambari.server.state.Cluster; @@ -165,12 +164,6 @@ public class RetryUpgradeActionService extends AbstractScheduledService { * @return Request Id of active stack upgrade. */ private Long getActiveUpgradeRequestId(Cluster cluster) { -ClusterVersionEntity currentVersion = cluster.getCurrentClusterVersion(); - -if (currentVersion == null) { - LOG.debug("No Cluster Version exists as CURRENT. Skip retrying failed tasks."); - return null; -} // May be null, and either upgrade or downgrade UpgradeEntity currentUpgrade = cluster.getUpgradeInProgress(); http://git-wip-us.apache.org/repos/asf/ambari/blob/aaa821cc/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog220.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog220.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog220.java index 11e90ee..a11fd96 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog220.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog220.java @@ -51,7 +51,6 @@ import org.apache.ambari.server.orm.DBAccessor.DBColumnInfo; import org.apache.ambari.server.orm.dao.AlertDefinitionDAO; import org.apache.ambari.server.orm.dao.ArtifactDAO; import org.apache.ambari.server.orm.dao.ClusterDAO; -import org.apache.ambari.server.orm.dao.ClusterVersionDAO; import org.apache.ambari.server.orm.dao.DaoUtils; import org.apache.ambari.server.orm.dao.HostVersionDAO; import org.apache.ambari.server.orm.dao.RepositoryVersionDAO; @@ -60,7 +59,6 @@ import org.apache.ambari.server.orm.dao.UpgradeDAO; import org.apache.ambari.server.orm.entities.AlertDefinitionEntity; import org.apache.ambari.server.orm.entities.ArtifactEntity; import org.apache.ambari.server.orm.entities.ClusterEntity; -import org.apache.ambari.server.orm.entities.ClusterVersionEntity; import org.apache.ambari.server.orm.entities.HostEntity; import org.apache.ambari.server.orm.entities.HostVersionEntity; import org.apache.ambari.server.orm.entities.RepositoryVersionEntity; @@ -724,7 +722,6 @@ public class UpgradeCatalog220 extends AbstractUpgradeCatalog { StackDAO stackDAO = injector.getInstance(StackDAO.class); RepositoryVersionHelper repositoryVersionHelper = injector.getInstance(RepositoryVersionHelper.class); RepositoryVersionDAO repositoryVersionDAO = injector.getInstance(RepositoryVersionDAO.class); -ClusterVersionDAO clusterVersionDAO = injector.getInstance(ClusterVersionDAO.class); HostVersionDAO hostVersionDAO = injector.getInstance(HostVersionDAO.class); Clusters clusters = amc.getClusters(); @@ -766,6 +763,7 @@ public class UpgradeCatalog220 extends AbstractUpgradeCatalog { repoVersionEntity.getId(), displayName, operatingSystems)); } +/* // Create the Cluster Version if it doesn't already exist. ClusterVersionEntity clusterVersionEntity = clusterVersionDAO.findByClusterAndStackAndVersion(cluster.getClusterName(), stackId, hardcodedInitialVersion); @@ -791,6 +789,7 @@ public class UpgradeCatalog220 extends AbstractUpgradeCatalog { clusterVersionEntity.getId(), cluster.getClusterName(), clusterVersionEntity.getRepositoryVersion().getVersion(), clusterVersionEntity.getState())); } +*/ // Create the Host Versions if they don't already exist. Collection hosts = clusterEntity.getHostEntities(); http://git-wip-us.apache.org/repos/asf/ambari/blob/aaa821cc/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql -- diff --git
[5/6] ambari git commit: AMBARI-20957. Remove cluster_version use (ncole)
http://git-wip-us.apache.org/repos/asf/ambari/blob/aaa821cc/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListener.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListener.java b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListener.java index b4ddf09..c0a074f 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListener.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListener.java @@ -20,10 +20,8 @@ package org.apache.ambari.server.events.listeners.upgrade; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; -import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Set; import java.util.concurrent.locks.Lock; import org.apache.ambari.server.AmbariException; @@ -38,7 +36,7 @@ import org.apache.ambari.server.events.publishers.AmbariEventPublisher; import org.apache.ambari.server.logging.LockFactory; import org.apache.ambari.server.orm.dao.HostDAO; import org.apache.ambari.server.orm.dao.HostVersionDAO; -import org.apache.ambari.server.orm.entities.ClusterVersionEntity; +import org.apache.ambari.server.orm.dao.RepositoryVersionDAO; import org.apache.ambari.server.orm.entities.HostComponentDesiredStateEntity; import org.apache.ambari.server.orm.entities.HostEntity; import org.apache.ambari.server.orm.entities.HostVersionEntity; @@ -87,6 +85,9 @@ public class HostVersionOutOfSyncListener { @Inject private Provider ami; + @Inject + private Provider repositoryVersionDAO; + /** * The publisher may be an asynchronous, multi-threaded one, so to avoid the (rare, but possible) case * of both an Install and Uninstall event occurring at the same time, we use a Lock. @@ -140,7 +141,6 @@ public class HostVersionOutOfSyncListener { case NOT_REQUIRED: hostVersionEntity.setState(RepositoryVersionState.OUT_OF_SYNC); hostVersionDAO.get().merge(hostVersionEntity); - cluster.recalculateClusterVersionState(hostVersionEntity.getRepositoryVersion()); break; default: break; @@ -224,7 +224,7 @@ public class HostVersionOutOfSyncListener { try { Cluster cluster = clusters.get().getClusterById(event.getClusterId()); - Set changedRepositoryVersions = new HashSet<>(); + MapserviceComponents = cluster.getService(event.getServiceName()).getServiceComponents(); // Determine hosts that become OUT_OF_SYNC when adding components for new service Map affectedHosts = @@ -262,18 +262,20 @@ public class HostVersionOutOfSyncListener { if (hostVersionEntity.getState().equals(RepositoryVersionState.INSTALLED)) { hostVersionEntity.setState(RepositoryVersionState.OUT_OF_SYNC); hostVersionDAO.get().merge(hostVersionEntity); -changedRepositoryVersions.add(repositoryVersion); } } } - for (RepositoryVersionEntity repositoryVersion : changedRepositoryVersions) { -cluster.recalculateClusterVersionState(repositoryVersion); - } + } catch (AmbariException e) { LOG.error("Can not update hosts about out of sync", e); } } + /** + * When hosts are added, add a host_version record for every repo_version in the database. + * + * @param event the add event + */ @Subscribe @Transactional public void onHostEvent(HostsAddedEvent event) { @@ -281,37 +283,28 @@ public class HostVersionOutOfSyncListener { LOG.debug(event.toString()); } -try { - Cluster cluster = clusters.get().getClusterById(event.getClusterId()); +List repos = repositoryVersionDAO.get().findAllDefinitions(); - Collection allClusterVersions = cluster.getAllClusterVersions(); - for (ClusterVersionEntity clusterVersion : allClusterVersions) { -if (clusterVersion.getState() != RepositoryVersionState.CURRENT) { // Current version is taken care of automatically - RepositoryVersionEntity repositoryVersion = clusterVersion.getRepositoryVersion(); - for (String hostName : event.getHostNames()) { -HostEntity hostEntity = hostDAO.get().findByName(hostName); -HostVersionEntity missingHostVersion = new HostVersionEntity(hostEntity, - repositoryVersion, RepositoryVersionState.OUT_OF_SYNC); - -LOG.info("Creating host version for {}, state={}, repo={} (repo_id={})", - missingHostVersion.getHostName(), missingHostVersion.getState(), - missingHostVersion.getRepositoryVersion().getVersion(),
[3/6] ambari git commit: AMBARI-20957. Remove cluster_version use (ncole)
http://git-wip-us.apache.org/repos/asf/ambari/blob/aaa821cc/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProviderTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProviderTest.java index caf7210..1da5a90 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProviderTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProviderTest.java @@ -68,14 +68,10 @@ import org.apache.ambari.server.controller.spi.ResourceProvider; import org.apache.ambari.server.controller.utilities.PropertyHelper; import org.apache.ambari.server.orm.GuiceJpaInitializer; import org.apache.ambari.server.orm.InMemoryDefaultTestModule; -import org.apache.ambari.server.orm.dao.ClusterVersionDAO; import org.apache.ambari.server.orm.dao.HostComponentStateDAO; import org.apache.ambari.server.orm.dao.HostVersionDAO; import org.apache.ambari.server.orm.dao.RepositoryVersionDAO; -import org.apache.ambari.server.orm.dao.ResourceTypeDAO; -import org.apache.ambari.server.orm.dao.StackDAO; import org.apache.ambari.server.orm.entities.ClusterEntity; -import org.apache.ambari.server.orm.entities.ClusterVersionEntity; import org.apache.ambari.server.orm.entities.HostVersionEntity; import org.apache.ambari.server.orm.entities.RepositoryVersionEntity; import org.apache.ambari.server.orm.entities.StackEntity; @@ -130,9 +126,6 @@ public class ClusterStackVersionResourceProviderTest { private Injector injector; private AmbariMetaInfo ambariMetaInfo; private RepositoryVersionDAO repositoryVersionDAOMock; - private ResourceTypeDAO resourceTypeDAO; - private StackDAO stackDAO; - private ClusterVersionDAO clusterVersionDAO; private ConfigHelper configHelper; private Configuration configuration; private StageFactory stageFactory; @@ -172,14 +165,11 @@ public class ClusterStackVersionResourceProviderTest { String.valueOf(MAX_TASKS_PER_STAGE)); configuration = new Configuration(properties); stageFactory = createNiceMock(StageFactory.class); -clusterVersionDAO = createNiceMock(ClusterVersionDAO.class); // Initialize injector injector = Guice.createInjector(Modules.override(inMemoryModule).with(new MockModule())); injector.getInstance(GuiceJpaInitializer.class); ambariMetaInfo = injector.getInstance(AmbariMetaInfo.class); -resourceTypeDAO = injector.getInstance(ResourceTypeDAO.class); -stackDAO = injector.getInstance(StackDAO.class); } @After @@ -315,7 +305,7 @@ public class ClusterStackVersionResourceProviderTest { } }).anyTimes(); - expect(cluster.transitionHostsToInstalling(anyObject(ClusterVersionEntity.class), +expect(cluster.transitionHostsToInstalling( anyObject(RepositoryVersionEntity.class), anyObject(VersionDefinitionXml.class), eq(false))).andReturn(hostsNeedingInstallCommands).atLeastOnce(); @@ -350,20 +340,14 @@ public class ClusterStackVersionResourceProviderTest { ClusterEntity clusterEntity = new ClusterEntity(); clusterEntity.setClusterId(1l); clusterEntity.setClusterName(clusterName); -ClusterVersionEntity cve = new ClusterVersionEntity(clusterEntity, -repoVersion, RepositoryVersionState.INSTALL_FAILED, 0, ""); - expect(clusterVersionDAO.findByClusterAndStackAndVersion(anyObject(String.class), -anyObject(StackId.class), anyObject(String.class))).andReturn(cve); StageUtils.setTopologyManager(injector.getInstance(TopologyManager.class)); StageUtils.setConfiguration(injector.getInstance(Configuration.class)); - expect(clusterVersionDAO.findByCluster(anyObject(String.class))).andReturn(Collections.emptyList()).once(); - // replay replay(managementController, response, clusters, resourceProviderFactory, csvResourceProvider, cluster, repositoryVersionDAOMock, configHelper, schDatanode, schNamenode, schAMS, actionManager, -executionCommand, executionCommandWrapper,stage, stageFactory, clusterVersionDAO); +executionCommand, executionCommandWrapper,stage, stageFactory); ResourceProvider provider = AbstractControllerResourceProvider.getResourceProvider( type, @@ -443,23 +427,14 @@ public class ClusterStackVersionResourceProviderTest { Service hbaseService = createNiceMock(Service.class); expect(hdfsService.getName()).andReturn("HDFS").anyTimes(); expect(hbaseService.getName()).andReturn("HBASE").anyTimes(); -//Service metricsService = createNiceMock(Service.class); - -ServiceComponent scNameNode =
ambari git commit: AMBARI-20946: Archive zip not created if missing but hash file exists (Diego Santesteban via tthorpe)
Repository: ambari Updated Branches: refs/heads/branch-2.5 58abd8a0f -> e5bfb5a8d AMBARI-20946: Archive zip not created if missing but hash file exists (Diego Santesteban via tthorpe) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e5bfb5a8 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e5bfb5a8 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e5bfb5a8 Branch: refs/heads/branch-2.5 Commit: e5bfb5a8d692004f8ff38a61457a9213687dd3d9 Parents: 58abd8a Author: Tim ThorpeAuthored: Mon May 8 12:31:19 2017 -0700 Committer: Tim Thorpe Committed: Tue May 9 08:08:37 2017 -0700 -- .../python/ambari_server/resourceFilesKeeper.py | 11 ++-- .../src/test/python/TestResourceFilesKeeper.py | 29 +--- 2 files changed, 34 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/e5bfb5a8/ambari-server/src/main/python/ambari_server/resourceFilesKeeper.py -- diff --git a/ambari-server/src/main/python/ambari_server/resourceFilesKeeper.py b/ambari-server/src/main/python/ambari_server/resourceFilesKeeper.py index dba6833..b41c400 100644 --- a/ambari-server/src/main/python/ambari_server/resourceFilesKeeper.py +++ b/ambari-server/src/main/python/ambari_server/resourceFilesKeeper.py @@ -166,11 +166,17 @@ class ResourceFilesKeeper(): def update_directory_archive(self, directory): """ If hash sum for directory is not present or differs from saved value, -recalculates hash sum and creates directory archive +recalculates hash sum and creates directory archive. The archive is +also created if the existing archive does not exist, even if the +saved and current hash sums are matching. """ skip_empty_directory = True + cur_hash = self.count_hash_sum(directory) saved_hash = self.read_hash_sum(directory) + +directory_archive_name = os.path.join(directory, self.ARCHIVE_NAME) + if cur_hash != saved_hash: if not self.nozip: self.zip_directory(directory, skip_empty_directory) @@ -180,6 +186,8 @@ class ResourceFilesKeeper(): else: self.write_hash_sum(directory, cur_hash) pass +elif not os.path.isfile(directory_archive_name): + self.zip_directory(directory, skip_empty_directory) def count_hash_sum(self, directory): """ @@ -307,4 +315,3 @@ def main(argv=None): if __name__ == '__main__': main(sys.argv) - http://git-wip-us.apache.org/repos/asf/ambari/blob/e5bfb5a8/ambari-server/src/test/python/TestResourceFilesKeeper.py -- diff --git a/ambari-server/src/test/python/TestResourceFilesKeeper.py b/ambari-server/src/test/python/TestResourceFilesKeeper.py index 4f7dc52..4f8bdd5 100644 --- a/ambari-server/src/test/python/TestResourceFilesKeeper.py +++ b/ambari-server/src/test/python/TestResourceFilesKeeper.py @@ -179,6 +179,7 @@ class TestResourceFilesKeeper(TestCase): except Exception, e: self.fail('Unexpected exception thrown:' + str(e)) + @patch("os.path.isfile") @patch("os.path.exists") @patch("os.listdir") @patch.object(ResourceFilesKeeper, "count_hash_sum") @@ -188,8 +189,10 @@ class TestResourceFilesKeeper(TestCase): def test_update_directory_archive(self, write_hash_sum_mock, zip_directory_mock, read_hash_sum_mock, count_hash_sum_mock, -os_listdir_mock, os_path_exists_mock): +os_listdir_mock, os_path_exists_mock, +os_path_isfile_mock): os_listdir_mock.return_value = ['file1', 'dir1'] + # Test situation when there is no saved directory hash read_hash_sum_mock.return_value = None count_hash_sum_mock.return_value = self.YA_HASH @@ -206,10 +209,27 @@ class TestResourceFilesKeeper(TestCase): zip_directory_mock.reset_mock() write_hash_sum_mock.reset_mock() -# Test situation when saved directory hash == current hash +# Test situation where there is a .hash file, equal to the current hash, +# but no archive.zip file +count_hash_sum_mock.return_value = self.YA_HASH +read_hash_sum_mock.return_value = self.YA_HASH +os_path_isfile_mock.return_value = False +resource_files_keeper = ResourceFilesKeeper(self.TEST_RESOURCES_DIR, self.SOME_PATH) +resource_files_keeper.update_directory_archive(self.SOME_PATH) +self.assertTrue(read_hash_sum_mock.called) +self.assertTrue(count_hash_sum_mock.called) +self.assertTrue(zip_directory_mock.called) +self.assertFalse(write_hash_sum_mock.called) + +
[1/2] ambari git commit: AMBARI-20891 - Allow extensions to auto-link with supported stack versions
Repository: ambari Updated Branches: refs/heads/trunk a92fe1b1f -> aa78a1724 http://git-wip-us.apache.org/repos/asf/ambari/blob/aa78a172/ambari-server/src/test/resources/stacks_with_extensions/HDP/0.3/services/HDFS/configuration/hbase-site.xml -- diff --git a/ambari-server/src/test/resources/stacks_with_extensions/HDP/0.3/services/HDFS/configuration/hbase-site.xml b/ambari-server/src/test/resources/stacks_with_extensions/HDP/0.3/services/HDFS/configuration/hbase-site.xml new file mode 100644 index 000..5024e85 --- /dev/null +++ b/ambari-server/src/test/resources/stacks_with_extensions/HDP/0.3/services/HDFS/configuration/hbase-site.xml @@ -0,0 +1,137 @@ + + + + + +hbase.regionserver.msginterval +1000 +Interval between messages from the RegionServer to HMaster +in milliseconds. Default is 15. Set this value low if you want unit +tests to be responsive. + + + +hbase.client.pause +5000 +General client pause value. Used mostly as value to wait +before running a retry of a failed get, region lookup, etc. + + +hbase.master.meta.thread.rescanfrequency +1 +How long the HMaster sleeps (in milliseconds) between scans of +the root and meta tables. + + + +hbase.server.thread.wakefrequency +1000 +Time to sleep in between searches for work (in milliseconds). +Used as sleep interval by service threads such as META scanner and log roller. + + + +hbase.regionserver.handler.count +5 +Count of RPC Server instances spun up on RegionServers +Same property is used by the HMaster for count of master handlers. +Default is 10. + + + +hbase.master.lease.period +6000 +Length of time the master will wait before timing out a region +server lease. Since region servers report in every second (see above), this +value has been reduced so that the master will notice a dead region server +sooner. The default is 30 seconds. + + + +hbase.master.info.port +-1 +The port for the hbase master web UI +Set to -1 if you do not want the info server to run. + + + +hbase.regionserver.info.port +-1 +The port for the hbase regionserver web UI +Set to -1 if you do not want the info server to run. + + + +hbase.regionserver.info.port.auto +true +Info server auto port bind. Enables automatic port +search if hbase.regionserver.info.port is already in use. +Enabled for testing to run multiple tests on one machine. + + + +hbase.master.lease.thread.wakefrequency +3000 +The interval between checks for expired region server leases. +This value has been reduced due to the other reduced values above so that +the master will notice a dead region server sooner. The default is 15 seconds. + + + +hbase.regionserver.optionalcacheflushinterval +1 + +Amount of time to wait since the last time a region was flushed before +invoking an optional cache flush. Default 60,000. + + + +hbase.regionserver.safemode +false + +Turn on/off safe mode in region server. Always on for production, always off +for tests. + + + +hbase.hregion.max.filesize +67108864 + +Maximum desired file size for an HRegion. If filesize exceeds +value + (value / 2), the HRegion is split in two. Default: 256M. + +Keep the maximum filesize small so we split more often in tests. + + + +hadoop.log.dir +${user.dir}/../logs + + +hbase.zookeeper.property.clientPort +21818 +Property from ZooKeeper's config zoo.cfg. +The port at which the clients will connect. + + + http://git-wip-us.apache.org/repos/asf/ambari/blob/aa78a172/ambari-server/src/test/resources/stacks_with_extensions/HDP/0.3/services/HDFS/configuration/hdfs-log4j.xml -- diff --git a/ambari-server/src/test/resources/stacks_with_extensions/HDP/0.3/services/HDFS/configuration/hdfs-log4j.xml b/ambari-server/src/test/resources/stacks_with_extensions/HDP/0.3/services/HDFS/configuration/hdfs-log4j.xml new file mode 100644 index 000..649472d --- /dev/null +++ b/ambari-server/src/test/resources/stacks_with_extensions/HDP/0.3/services/HDFS/configuration/hdfs-log4j.xml @@ -0,0 +1,199 @@ + + + + + + + +content + +# +# 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
ambari git commit: AMBARI-20673.For sort/partition operator, if there is only 1 reducer, display just sort rather than 'sort/partition'(Venkata Sairam)
Repository: ambari Updated Branches: refs/heads/branch-2.5 397c3a77e -> 58abd8a0f AMBARI-20673.For sort/partition operator, if there is only 1 reducer, display just sort rather than 'sort/partition'(Venkata Sairam) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/58abd8a0 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/58abd8a0 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/58abd8a0 Branch: refs/heads/branch-2.5 Commit: 58abd8a0fa057c31b6df76f2dc189573fa2bcace Parents: 397c3a7 Author: Venkata SairamAuthored: Tue May 9 20:07:46 2017 +0530 Committer: Venkata Sairam Committed: Tue May 9 20:09:01 2017 +0530 -- .../src/main/resources/ui/app/utils/hive-explainer/renderer.js | 2 +- .../main/resources/ui/app/utils/hive-explainer/transformer.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/58abd8a0/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer.js b/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer.js index d0a3e0b..c09ad6b 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer.js +++ b/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer.js @@ -134,7 +134,7 @@ export default function doRender(data, selector, onRequestDetail, draggable) { } function isSingleReducerAvailable(data){ - let reducerCount = data.vertices.filter(function(item){ + let reducerCount = data.verticesData.filter(function(item){ return item['_vertex'].indexOf("Reducer") === 0; }); if(reducerCount && reducerCount.length === 1) { http://git-wip-us.apache.org/repos/asf/ambari/blob/58abd8a0/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/transformer.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/transformer.js b/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/transformer.js index 9dbbb00..d786d0f 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/transformer.js +++ b/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/transformer.js @@ -28,7 +28,7 @@ export default function doTransform(data) { getFetchVertex(fetch), ]; - let edges = []; + let edges = [], verticesData; if(tez) { edges = getEdges(tez, vertices); edges = getEdgesWithCorrectedUnion(edges); @@ -38,7 +38,7 @@ export default function doTransform(data) { vertices = doEnhance(vertices); vertices = getProcessedVertices(vertices, edges); - + verticesData = vertices; const {adjustedVertices, adjustedEdges} = getAdjustedVerticesAndEdges(vertices, edges); vertices = adjustedVertices; edges = adjustedEdges; @@ -60,6 +60,7 @@ export default function doTransform(data) { tree, nodes, connections, +verticesData }); }
ambari git commit: AMBARI-20673.For sort/partition operator, if there is only 1 reducer, display just sort rather than 'sort/partition'(Venkata Sairam)
Repository: ambari Updated Branches: refs/heads/trunk 3153b9bc2 -> a92fe1b1f AMBARI-20673.For sort/partition operator, if there is only 1 reducer, display just sort rather than 'sort/partition'(Venkata Sairam) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a92fe1b1 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a92fe1b1 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a92fe1b1 Branch: refs/heads/trunk Commit: a92fe1b1f2fa07e5c5f47dd5f484a45ae64a7bbd Parents: 3153b9b Author: Venkata SairamAuthored: Tue May 9 20:07:46 2017 +0530 Committer: Venkata Sairam Committed: Tue May 9 20:07:46 2017 +0530 -- .../src/main/resources/ui/app/utils/hive-explainer/renderer.js | 2 +- .../main/resources/ui/app/utils/hive-explainer/transformer.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/a92fe1b1/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer.js b/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer.js index d0a3e0b..c09ad6b 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer.js +++ b/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer.js @@ -134,7 +134,7 @@ export default function doRender(data, selector, onRequestDetail, draggable) { } function isSingleReducerAvailable(data){ - let reducerCount = data.vertices.filter(function(item){ + let reducerCount = data.verticesData.filter(function(item){ return item['_vertex'].indexOf("Reducer") === 0; }); if(reducerCount && reducerCount.length === 1) { http://git-wip-us.apache.org/repos/asf/ambari/blob/a92fe1b1/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/transformer.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/transformer.js b/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/transformer.js index 9dbbb00..d786d0f 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/transformer.js +++ b/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/transformer.js @@ -28,7 +28,7 @@ export default function doTransform(data) { getFetchVertex(fetch), ]; - let edges = []; + let edges = [], verticesData; if(tez) { edges = getEdges(tez, vertices); edges = getEdgesWithCorrectedUnion(edges); @@ -38,7 +38,7 @@ export default function doTransform(data) { vertices = doEnhance(vertices); vertices = getProcessedVertices(vertices, edges); - + verticesData = vertices; const {adjustedVertices, adjustedEdges} = getAdjustedVerticesAndEdges(vertices, edges); vertices = adjustedVertices; edges = adjustedEdges; @@ -60,6 +60,7 @@ export default function doTransform(data) { tree, nodes, connections, +verticesData }); }
ambari git commit: AMBARI-20955. Integrate Log Search integration test framework with Selenium (oleewere)
Repository: ambari Updated Branches: refs/heads/trunk 8dae74cc2 -> 3153b9bc2 AMBARI-20955. Integrate Log Search integration test framework with Selenium (oleewere) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/3153b9bc Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3153b9bc Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3153b9bc Branch: refs/heads/trunk Commit: 3153b9bc2f3ea9b3330e84aa34c34fc9457f01ad Parents: 8dae74c Author: oleewereAuthored: Mon May 8 16:31:22 2017 +0200 Committer: oleewere Committed: Tue May 9 14:05:50 2017 +0200 -- ambari-logsearch/README.md | 8 +- ambari-logsearch/ambari-logsearch-it/pom.xml| 173 --- .../logsearch/domain/StoryDataRegistry.java | 10 + .../logsearch/steps/AbstractLogSearchSteps.java | 162 ++ .../logsearch/steps/LogSearchDockerSteps.java | 116 +- .../logsearch/steps/LogSearchUISteps.java | 212 +++ .../logsearch/story/LogSearchApiQueryStory.java | 22 -- .../story/LogSearchBackendStories.java | 84 .../ambari/logsearch/story/LogSearchStory.java | 60 -- .../logsearch/story/LogSearchUIStories.java | 93 .../logsearch/story/LogfeederParsingStory.java | 22 -- .../ambari/logsearch/web/AbstractPage.java | 63 ++ .../org/apache/ambari/logsearch/web/Home.java | 39 .../story/log_search_api_query_story.story | 17 -- .../story/logfeeder_parsing_story.story | 20 -- .../backend/log_search_api_query_story.story| 17 ++ .../backend/logfeeder_parsing_story.story | 20 ++ .../resources/stories/selenium/login.ui.story | 20 ++ ambari-logsearch/docker/Dockerfile | 17 +- ambari-logsearch/docker/bin/start.sh| 8 + ambari-logsearch/docker/logsearch-docker.sh | 10 +- 21 files changed, 901 insertions(+), 292 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/3153b9bc/ambari-logsearch/README.md -- diff --git a/ambari-logsearch/README.md b/ambari-logsearch/README.md index 5c41fcd..4123a52 100644 --- a/ambari-logsearch/README.md +++ b/ambari-logsearch/README.md @@ -36,10 +36,14 @@ mvn -Dbuild-deb clean package ## Running Integration Tests -By default integration tests are not a part of the build process, you need to set ${it.skip} variable to true (docker needed here too) +By default integration tests are not a part of the build process, you need to set -Dbackend-tests or -Dselenium-tests (or you can use -Dall-tests to run both). To running the tests you will need docker here as well (right now docker-for-mac and unix are supported only). ```bash # from ambari-logsearch folder -mvn clean integration-test -Dit.skip=false +mvn clean integration-test -Dbackend-tests failsafe:verify +# or run selenium tests with docker for mac, but before that you nedd to start xquartz +xquartz +# then in an another window you can start ui tests +mvn clean integration-test -Dselenium-tests failsafe:verify ``` Also you can run from the IDE, but make sure all of the ambari logsearch modules are built. http://git-wip-us.apache.org/repos/asf/ambari/blob/3153b9bc/ambari-logsearch/ambari-logsearch-it/pom.xml -- diff --git a/ambari-logsearch/ambari-logsearch-it/pom.xml b/ambari-logsearch/ambari-logsearch-it/pom.xml index ee97e99..cdb76a5 100644 --- a/ambari-logsearch/ambari-logsearch-it/pom.xml +++ b/ambari-logsearch/ambari-logsearch-it/pom.xml @@ -33,8 +33,10 @@ true 4.0.5 +3.5.5 2.23.1 2.6.4 +2.20 1 @@ -45,6 +47,11 @@ ${jbehave.version} + org.jbehave.web + jbehave-web-selenium + ${jbehave-selenium} + + org.apache.solr solr-solrj ${solr.version} @@ -82,6 +89,12 @@ com.flipkart.zjsonpatch zjsonpatch 0.2.4 + + + com.google.guava + guava + + org.apache.ambari @@ -98,6 +111,11 @@ ambari-logsearch-logfeeder ${project.version} + + com.google.guava + guava + 11.0.1 + @@ -113,35 +131,132 @@ src/test/resources - - -org.apache.maven.plugins -maven-failsafe-plugin - - -run-integration-tests -integration-test - - integration-test - - - -**/*Stories.java -**/*Story.java - - ${it.skip} - - -
ambari git commit: AMBARI-20962 : hive view 1.5 and 2.0 made fileName as path param instead of query param. Now downloaded file preserves unicode characters (nitirajrathore)
Repository: ambari Updated Branches: refs/heads/branch-2.5 d8f815c26 -> 397c3a77e AMBARI-20962 : hive view 1.5 and 2.0 made fileName as path param instead of query param. Now downloaded file preserves unicode characters (nitirajrathore) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/397c3a77 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/397c3a77 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/397c3a77 Branch: refs/heads/branch-2.5 Commit: 397c3a77e14648bb1967c72769f7c736b36b1508 Parents: d8f815c Author: Nitiraj Singh RathoreAuthored: Tue May 9 17:30:47 2017 +0530 Committer: Nitiraj Singh Rathore Committed: Tue May 9 17:30:47 2017 +0530 -- .../view/hive2/resources/jobs/JobService.java | 9 ++--- .../resources/ui/hive-web/app/controllers/index.js | 2 +- .../view/hive20/resources/jobs/JobService.java | 16 +--- .../src/main/resources/ui/app/adapters/job.js | 2 +- 4 files changed, 9 insertions(+), 20 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/397c3a77/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/jobs/JobService.java -- diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/jobs/JobService.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/jobs/JobService.java index 5fa96bb..80f4e24 100644 --- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/jobs/JobService.java +++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/jobs/JobService.java @@ -176,11 +176,11 @@ public class JobService extends BaseService { * Get job results in csv format */ @GET - @Path("{jobId}/results/csv") + @Path("{jobId}/results/csv/{fileName}") @Produces("text/csv") public Response getResultsCSV(@PathParam("jobId") String jobId, @Context HttpServletResponse response, -@QueryParam("fileName") String fileName, +@PathParam("fileName") String fileName, @QueryParam("columns") final String requestedColumns) { try { @@ -223,12 +223,7 @@ public class JobService extends BaseService { } }; - if (fileName == null || fileName.isEmpty()) { -fileName = "results.csv"; - } - return Response.ok(stream). - header("Content-Disposition", String.format("attachment; filename=\"%s\"", fileName)). build(); http://git-wip-us.apache.org/repos/asf/ambari/blob/397c3a77/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/index.js -- diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/index.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/index.js index 8250dbb..5644feb 100644 --- a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/index.js +++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/index.js @@ -586,7 +586,7 @@ export default Ember.Controller.extend({ defer.promise.then(function (text) { // download file ... -var urlString = "%@/?fileName=%@.csv"; +var urlString = "%@/%@.csv"; var url = self.get('csvUrl'); url = urlString.fmt(url, text); window.open(url); http://git-wip-us.apache.org/repos/asf/ambari/blob/397c3a77/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/jobs/JobService.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/jobs/JobService.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/jobs/JobService.java index f2e4ee9..d99938f 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/jobs/JobService.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/jobs/JobService.java @@ -181,11 +181,11 @@ public class JobService extends BaseService { * Get job results in csv format */ @GET - @Path("{jobId}/results/csv") + @Path("{jobId}/results/csv/{fileName}") @Produces("text/csv") public Response getResultsCSV(@PathParam("jobId") String jobId, @Context HttpServletResponse response, -@QueryParam("fileName") String fileName, +@PathParam("fileName") String
ambari git commit: AMBARI-20962 : hive view 1.5 and 2.0 made fileName as path param instead of query param. Now downloaded file preserves unicode characters (nitirajrathore)
Repository: ambari Updated Branches: refs/heads/trunk aecc890ee -> 8dae74cc2 AMBARI-20962 : hive view 1.5 and 2.0 made fileName as path param instead of query param. Now downloaded file preserves unicode characters (nitirajrathore) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8dae74cc Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8dae74cc Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8dae74cc Branch: refs/heads/trunk Commit: 8dae74cc26c8b60d082076e9852f06a399e009c4 Parents: aecc890 Author: Nitiraj Singh RathoreAuthored: Tue May 9 17:30:47 2017 +0530 Committer: Nitiraj Singh Rathore Committed: Tue May 9 17:31:36 2017 +0530 -- .../view/hive2/resources/jobs/JobService.java | 9 ++--- .../resources/ui/hive-web/app/controllers/index.js | 2 +- .../view/hive20/resources/jobs/JobService.java | 16 +--- .../src/main/resources/ui/app/adapters/job.js | 2 +- 4 files changed, 9 insertions(+), 20 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/8dae74cc/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/jobs/JobService.java -- diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/jobs/JobService.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/jobs/JobService.java index 5fa96bb..80f4e24 100644 --- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/jobs/JobService.java +++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/jobs/JobService.java @@ -176,11 +176,11 @@ public class JobService extends BaseService { * Get job results in csv format */ @GET - @Path("{jobId}/results/csv") + @Path("{jobId}/results/csv/{fileName}") @Produces("text/csv") public Response getResultsCSV(@PathParam("jobId") String jobId, @Context HttpServletResponse response, -@QueryParam("fileName") String fileName, +@PathParam("fileName") String fileName, @QueryParam("columns") final String requestedColumns) { try { @@ -223,12 +223,7 @@ public class JobService extends BaseService { } }; - if (fileName == null || fileName.isEmpty()) { -fileName = "results.csv"; - } - return Response.ok(stream). - header("Content-Disposition", String.format("attachment; filename=\"%s\"", fileName)). build(); http://git-wip-us.apache.org/repos/asf/ambari/blob/8dae74cc/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/index.js -- diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/index.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/index.js index 8250dbb..5644feb 100644 --- a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/index.js +++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/index.js @@ -586,7 +586,7 @@ export default Ember.Controller.extend({ defer.promise.then(function (text) { // download file ... -var urlString = "%@/?fileName=%@.csv"; +var urlString = "%@/%@.csv"; var url = self.get('csvUrl'); url = urlString.fmt(url, text); window.open(url); http://git-wip-us.apache.org/repos/asf/ambari/blob/8dae74cc/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/jobs/JobService.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/jobs/JobService.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/jobs/JobService.java index f2e4ee9..d99938f 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/jobs/JobService.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/jobs/JobService.java @@ -181,11 +181,11 @@ public class JobService extends BaseService { * Get job results in csv format */ @GET - @Path("{jobId}/results/csv") + @Path("{jobId}/results/csv/{fileName}") @Produces("text/csv") public Response getResultsCSV(@PathParam("jobId") String jobId, @Context HttpServletResponse response, -@QueryParam("fileName") String fileName, +@PathParam("fileName") String fileName,
ambari git commit: AMBARI-20519. Runtime filtering is not rendering properly (pallavkul)
Repository: ambari Updated Branches: refs/heads/branch-2.5 9b5263bc5 -> d8f815c26 AMBARI-20519. Runtime filtering is not rendering properly (pallavkul) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d8f815c2 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d8f815c2 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d8f815c2 Branch: refs/heads/branch-2.5 Commit: d8f815c2637cf04f1816d274c7b15dad8eb06cbe Parents: 9b5263b Author: pallavkulAuthored: Tue May 9 16:27:49 2017 +0530 Committer: pallavkul Committed: Tue May 9 16:29:31 2017 +0530 -- .../ui/app/utils/hive-explainer/processor.js| 12 ++-- .../ui/app/utils/hive-explainer/renderer.js | 16 .../ui/app/utils/hive-explainer/transformer.js | 6 +++--- 3 files changed, 21 insertions(+), 13 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/d8f815c2/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/processor.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/processor.js b/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/processor.js index 1a6d4b3..79d110f 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/processor.js +++ b/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/processor.js @@ -264,10 +264,10 @@ export function getEdgesWithCorrectedUnion(edges) { function findAllOutputOperators(vertices, outputOperatorsList, edges, patterns) { vertices.forEach(cEdge => { edges.push(cEdge); - let outputOperator = cEdge["OutputOperators:"]; - if(outputOperator) { -patterns.push({outputOperator:outputOperator.substring(1, outputOperator.length-1), cEdge:[edges[edges.length-4], edges[edges.length-3], edges[edges.length-2], edges[edges.length-1]]}); -outputOperatorsList.push({outputOperator:outputOperator.substring(1, outputOperator.length-1), cEdge:edges}); + let outputOperator = cEdge["outputOperator:"]; + if(outputOperator && outputOperator.length) { +patterns.push({outputOperator:outputOperator[0], cEdge:[edges[edges.length-4], edges[edges.length-3], edges[edges.length-2], edges[edges.length-1]]}); +outputOperatorsList.push({outputOperator:outputOperator[0], cEdge:edges}); } findAllOutputOperators(cEdge._children, outputOperatorsList, edges, patterns); }); @@ -303,7 +303,7 @@ function findPatternParent(edges, patternArray) { if(cSubChild && cSubChild["OperatorId:"] === patternArray[0]["OperatorId:"]){ if(cChild._children.length>1){ cChild._children = [cChild._children[0]]; - cChild["OutputOperators:"] = patternArray[1]["OutputOperators:"]; + cChild["outputOperator:"] = patternArray[1]["outputOperator:"]; newVertex = Object.assign(patternArray[2], { "_operator":"Build Bloom Filter", "_children":[], @@ -314,7 +314,7 @@ function findPatternParent(edges, patternArray) { ...patternArray[3].groups||[doCloneAndOmit(patternArray[3], ['_groups'])]] }); } - } else if(cSubChild && cSubChild["OperatorId:"] === patternArray[3]["OperatorId:"]){ + } else if(cSubChild && patternArray[patternArray.length-1] && cSubChild["OperatorId:"] === patternArray[patternArray.length-1]["OperatorId:"]){ cChild._children = newVertex ? [newVertex]:[]; } else { findPatternParent(cChild, patternArray); http://git-wip-us.apache.org/repos/asf/ambari/blob/d8f815c2/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer.js b/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer.js index c880614..d0a3e0b 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer.js +++ b/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer.js @@ -500,10 +500,18 @@ function getConnectionPath(connector, svg, container, data){ } path.push(pSource); const offsetY = svg.node().getBoundingClientRect().top; + let isEdgeReversed = false, edgeReversalVal; return path.reduce((accumulator, cPoint, index) => { if(index === 0) { + if(cPoint.x > (cPoint.y - offsetY)) { +edgeReversalVal = cPoint.x; +isEdgeReversed = true; + } return accumulator + `M ${cPoint.x}, ${cPoint.y - offsetY}\n`; } else { + if(isEdgeReversed && path.length === 4 &&
ambari git commit: AMBARI-20519. Runtime filtering is not rendering properly (pallavkul)
Repository: ambari Updated Branches: refs/heads/trunk 11e2563f7 -> aecc890ee AMBARI-20519. Runtime filtering is not rendering properly (pallavkul) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/aecc890e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/aecc890e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/aecc890e Branch: refs/heads/trunk Commit: aecc890eec3e1e075f1a8b42aeda4efa0e250da5 Parents: 11e2563 Author: pallavkulAuthored: Tue May 9 16:27:49 2017 +0530 Committer: pallavkul Committed: Tue May 9 16:27:49 2017 +0530 -- .../ui/app/utils/hive-explainer/processor.js| 12 ++-- .../ui/app/utils/hive-explainer/renderer.js | 16 .../ui/app/utils/hive-explainer/transformer.js | 6 +++--- 3 files changed, 21 insertions(+), 13 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/aecc890e/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/processor.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/processor.js b/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/processor.js index 1a6d4b3..79d110f 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/processor.js +++ b/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/processor.js @@ -264,10 +264,10 @@ export function getEdgesWithCorrectedUnion(edges) { function findAllOutputOperators(vertices, outputOperatorsList, edges, patterns) { vertices.forEach(cEdge => { edges.push(cEdge); - let outputOperator = cEdge["OutputOperators:"]; - if(outputOperator) { -patterns.push({outputOperator:outputOperator.substring(1, outputOperator.length-1), cEdge:[edges[edges.length-4], edges[edges.length-3], edges[edges.length-2], edges[edges.length-1]]}); -outputOperatorsList.push({outputOperator:outputOperator.substring(1, outputOperator.length-1), cEdge:edges}); + let outputOperator = cEdge["outputOperator:"]; + if(outputOperator && outputOperator.length) { +patterns.push({outputOperator:outputOperator[0], cEdge:[edges[edges.length-4], edges[edges.length-3], edges[edges.length-2], edges[edges.length-1]]}); +outputOperatorsList.push({outputOperator:outputOperator[0], cEdge:edges}); } findAllOutputOperators(cEdge._children, outputOperatorsList, edges, patterns); }); @@ -303,7 +303,7 @@ function findPatternParent(edges, patternArray) { if(cSubChild && cSubChild["OperatorId:"] === patternArray[0]["OperatorId:"]){ if(cChild._children.length>1){ cChild._children = [cChild._children[0]]; - cChild["OutputOperators:"] = patternArray[1]["OutputOperators:"]; + cChild["outputOperator:"] = patternArray[1]["outputOperator:"]; newVertex = Object.assign(patternArray[2], { "_operator":"Build Bloom Filter", "_children":[], @@ -314,7 +314,7 @@ function findPatternParent(edges, patternArray) { ...patternArray[3].groups||[doCloneAndOmit(patternArray[3], ['_groups'])]] }); } - } else if(cSubChild && cSubChild["OperatorId:"] === patternArray[3]["OperatorId:"]){ + } else if(cSubChild && patternArray[patternArray.length-1] && cSubChild["OperatorId:"] === patternArray[patternArray.length-1]["OperatorId:"]){ cChild._children = newVertex ? [newVertex]:[]; } else { findPatternParent(cChild, patternArray); http://git-wip-us.apache.org/repos/asf/ambari/blob/aecc890e/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer.js b/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer.js index c880614..d0a3e0b 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer.js +++ b/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer.js @@ -500,10 +500,18 @@ function getConnectionPath(connector, svg, container, data){ } path.push(pSource); const offsetY = svg.node().getBoundingClientRect().top; + let isEdgeReversed = false, edgeReversalVal; return path.reduce((accumulator, cPoint, index) => { if(index === 0) { + if(cPoint.x > (cPoint.y - offsetY)) { +edgeReversalVal = cPoint.x; +isEdgeReversed = true; + } return accumulator + `M ${cPoint.x}, ${cPoint.y - offsetY}\n`; } else { + if(isEdgeReversed && path.length === 4 && index !==