You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jl...@apache.org on 2018/07/07 07:59:35 UTC
[ambari] 01/04: Merge remote-tracking branch 'origin/trunk' into
branch-feature-AMBARI-14714
This is an automated email from the ASF dual-hosted git repository.
jluniya pushed a commit to branch branch-feature-AMBARI-14714
in repository https://gitbox.apache.org/repos/asf/ambari.git
commit 220450bf2d6573b48d483d01ceb4fc9158e182ed
Merge: 4988a2f 60e54750
Author: Jayush Luniya <jl...@HW11039.local>
AuthorDate: Sat Jul 7 00:33:44 2018 -0700
Merge remote-tracking branch 'origin/trunk' into branch-feature-AMBARI-14714
.reviewboardrc | 19 -
.../controllers/ambariViews/ViewsEditCtrl.js | 7 +-
.../controllers/ambariViews/ViewsListCtrl.js | 7 +-
.../controllers/clusters/ClusterInformationCtrl.js | 4 +-
.../remoteClusters/RemoteClustersEditCtrl.js | 2 +-
.../stackVersions/StackVersionsCreateCtrl.js | 28 +-
.../stackVersions/StackVersionsEditCtrl.js | 22 +-
.../controllers/userManagement/GroupCreateCtrl.js | 19 +-
.../controllers/userManagement/GroupEditCtrl.js | 46 -
.../controllers/userManagement/GroupsListCtrl.js | 5 +-
.../controllers/userManagement/UserEditCtrl.js | 45 -
.../controllers/userManagement/UsersListCtrl.js | 5 +-
.../app/scripts/directives/comboSearch.js | 2 +-
.../app/scripts/directives/editableList.js | 82 +-
.../ui/admin-web/app/scripts/i18n.config.js | 18 +-
.../app/scripts/services/ConfirmationModal.js | 6 +-
.../ui/admin-web/app/scripts/services/Filters.js | 6 +-
.../ui/admin-web/app/scripts/services/Stack.js | 1 +
.../admin-web/app/styles/bootstrap-overrides.css | 21 +
.../resources/ui/admin-web/app/styles/main.css | 49 +-
.../ui/admin-web/app/styles/stack-versions.css | 74 +
.../ui/admin-web/app/styles/user-management.css | 12 +-
.../resources/ui/admin-web/app/styles/views.css | 4 +
.../ui/admin-web/app/views/ambariViews/edit.html | 2 +-
.../app/views/ambariViews/modals/create.html | 8 -
.../app/views/clusters/clusterInformation.html | 3 +-
.../app/views/directives/editableList.html | 11 +-
.../app/views/modals/ConfirmationModal.html | 2 +-
.../ui/admin-web/app/views/stackVersions/list.html | 2 +-
.../app/views/stackVersions/stackVersionPage.html | 32 +-
.../app/views/userManagement/groupEdit.html | 23 +-
.../views/userManagement/modals/userCreate.html | 12 +-
.../app/views/userManagement/userEdit.html | 12 +-
ambari-agent/conf/unix/ambari-agent.ini | 4 +-
ambari-agent/conf/windows/ambari-agent.ini | 2 +-
ambari-agent/pom.xml | 41 +-
.../src/main/python/ambari_agent/ActionQueue.py | 49 +-
.../python/ambari_agent/AlertStatusReporter.py | 22 +-
.../src/main/python/ambari_agent/AmbariAgent.py | 3 +-
.../src/main/python/ambari_agent/AmbariConfig.py | 73 +-
.../python/ambari_agent/ClusterMetadataCache.py | 18 +
.../python/ambari_agent/ClusterTopologyCache.py | 31 +-
.../main/python/ambari_agent/CommandStatusDict.py | 80 +-
.../python/ambari_agent/ComponentStatusExecutor.py | 83 +-
.../python/ambari_agent/ConfigurationBuilder.py | 6 +-
.../src/main/python/ambari_agent/Constants.py | 7 +-
.../ambari_agent/CustomServiceOrchestrator.py | 99 +-
.../src/main/python/ambari_agent/ExitHelper.py | 7 +-
ambari-agent/src/main/python/ambari_agent/Grep.py | 14 +
.../src/main/python/ambari_agent/Hardware.py | 4 +-
.../main/python/ambari_agent/HeartbeatThread.py | 50 +-
.../src/main/python/ambari_agent/HostCleanup.py | 9 +-
.../src/main/python/ambari_agent/HostInfo.py | 4 +-
.../main/python/ambari_agent/HostStatusReporter.py | 16 +-
.../main/python/ambari_agent/InitializerModule.py | 47 +-
.../src/main/python/ambari_agent/NetUtil.py | 6 +-
.../src/main/python/ambari_agent/PythonExecutor.py | 7 +-
.../main/python/ambari_agent/RecoveryManager.py | 421 +-
ambari-agent/src/main/python/ambari_agent/Utils.py | 8 +-
.../main/python/ambari_agent/alerts/base_alert.py | 51 +-
.../ambari_agent/listeners/AgentActionsListener.py | 66 +
.../listeners/AlertDefinitionsEventListener.py | 7 +-
.../listeners/CommandsEventListener.py | 5 +-
.../listeners/ConfigurationEventListener.py | 15 +-
.../listeners/HostLevelParamsEventListener.py | 11 +-
.../listeners/MetadataEventListener.py | 22 +-
.../listeners/ServerResponsesListener.py | 26 +-
.../listeners/TopologyEventListener.py | 5 +-
.../main/python/ambari_agent/listeners/__init__.py | 42 +-
ambari-agent/src/main/python/ambari_agent/main.py | 40 +-
.../src/main/python/ambari_agent/security.py | 21 +-
.../test/python/ambari_agent/TestActionQueue.py | 218 +-
.../test/python/ambari_agent/TestAmbariConfig.py | 29 +
.../python/ambari_agent/TestCommandStatusDict.py | 78 +
.../ambari_agent/TestConfigurationBuilder.py | 34 +
.../ambari_agent/TestCustomServiceOrchestrator.py | 182 +-
.../src/test/python/ambari_agent/TestFileCache.py | 4 +-
.../src/test/python/ambari_agent/TestGrep.py | 31 +
.../test/python/ambari_agent/TestPythonExecutor.py | 14 +-
.../python/ambari_agent/TestRecoveryManager.py | 175 +-
.../test/python/ambari_agent/TestRegistration.py | 17 +-
.../stomp/metadata_after_registration.json | 6 +-
.../python/resource_management/TestTarArchive.py | 66 +
.../resource_management/TestXmlConfigResource.py | 36 +-
.../src/main/python/ambari_commons/constants.py | 3 +
.../ambari_commons/credential_store_helper.py | 49 +-
.../src/main/python/ambari_commons/firewall.py | 2 +-
.../src/main/python/ambari_commons/inet_utils.py | 20 +-
.../main/python/ambari_commons/libs/__init__.py | 19 +
.../python/ambari_commons/libs/ppc64le/__init__.py | 19 +
.../libs/ppc64le/_posixsubprocess.so | Bin 0 -> 115672 bytes
.../python/ambari_commons/libs/x86_64/__init__.py | 19 +
.../{ => libs/x86_64}/_posixsubprocess.so | Bin
.../src/main/python/ambari_commons/os_check.py | 4 +-
.../python/ambari_commons/repo_manager/__init__.py | 18 +-
.../ambari_commons/repo_manager/apt_manager.py | 39 +-
.../ambari_commons/repo_manager/generic_manager.py | 6 +
.../repo_manager/repo_manager_helper.py | 54 +
.../ambari_commons/repo_manager/yum_manager.py | 17 +-
.../ambari_commons/repo_manager/zypper_manager.py | 23 +-
.../python/ambari_commons/resources/os_family.json | 16 +-
.../src/main/python/ambari_commons/shell.py | 12 +-
.../src/main/python/ambari_commons/subprocess32.py | 7 +-
.../src/main/python/ambari_stomp/transport.py | 4 +-
.../src/main/python/ambari_ws4py/websocket.py | 54 +-
.../resource_management/core/providers/accounts.py | 14 +-
.../resource_management/core/providers/system.py | 3 +-
.../main/python/resource_management/core/shell.py | 22 +-
.../execution_command/execution_command.py | 2 +-
.../libraries/functions/copy_tarball.py | 37 +-
.../functions/generate_logfeeder_input_config.py | 44 +
.../libraries/functions/install_windows_msi.py | 3 +-
.../libraries/functions/namenode_ha_utils.py | 185 +-
.../libraries/functions/package_conditions.py | 9 +
.../libraries/functions/ranger_functions_v2.py | 87 +-
.../libraries/functions/reload_windows_env.py | 2 +-
.../libraries/functions/repository_util.py | 2 +-
.../libraries/functions/setup_atlas_hook.py | 2 +-
.../libraries/functions/setup_ranger_plugin_xml.py | 76 +-
.../libraries/functions/solr_cloud_util.py | 67 +-
.../libraries/functions/stack_select.py | 3 +-
.../libraries/functions/tar_archive.py | 53 +-
.../libraries/functions/upgrade_summary.py | 8 +-
.../libraries/providers/hdfs_resource.py | 96 +-
.../libraries/providers/xml_config.py | 10 +-
.../libraries/resources/hdfs_resource.py | 3 +
.../libraries/resources/xml_config.py | 1 +
.../resource_management/libraries/script/script.py | 84 +-
.../2.0.7/services/HIVE/package/scripts/hive.py | 2 +-
ambari-infra/ambari-infra-assembly/pom.xml | 8 +
ambari-infra/ambari-infra-manager-it/pom.xml | 57 +
.../test/java/org/apache/ambari/infra/Solr.java | 107 +
.../java/org/apache/ambari/infra/TestUtil.java | 82 +
.../ambari/infra/solr/metrics/MetricsIT.java | 142 +
.../infra/solr/metrics/MockMetricsServer.java | 75 +
.../ambari/infra/steps/AbstractInfraSteps.java | 133 +-
.../apache/ambari/infra/steps/ExportJobsSteps.java | 65 +-
.../ambari-infra-manager/docker/docker-compose.yml | 3 +-
.../docker/infra-manager-docker-compose.sh | 4 +-
ambari-infra/ambari-infra-manager/pom.xml | 21 +-
.../src/main/resources/swagger/swagger.html | 75 +-
ambari-infra/ambari-infra-solr-client/README.md | 1056 +
ambari-infra/ambari-infra-solr-client/build.xml | 8 +
.../ambari/infra/solr/AmbariSolrCloudCLI.java | 65 +-
.../ambari/infra/solr/AmbariSolrCloudClient.java | 28 +
.../infra/solr/AmbariSolrCloudClientBuilder.java | 12 +
.../infra/solr/commands/DeleteZnodeZkCommand.java | 37 +
.../solr/commands/DumpCollectionsCommand.java | 157 +
.../infra/solr/domain/json/SolrCollection.java | 89 +
.../infra/solr/domain/json/SolrCoreData.java | 57 +
.../ambari/infra/solr/domain/json/SolrShard.java | 55 +
.../src/main/python/migrationConfigGenerator.py | 513 +
.../src/main/python/migrationHelper.py | 1900 +-
.../src/main/python/solrDataManager.py | 398 +-
.../src/main/resources/ambariSolrMigration.sh | 322 +
.../resources/data/security-without-authr.json | 6 +
.../src/main/resources/managed-schema | 93 +
.../src/main/resources/solrIndexHelper.sh | 16 +-
ambari-infra/ambari-infra-solr-plugin/.gitignore | 3 +
.../ambari-infra-solr-plugin/docker/Dockerfile | 46 +
.../docker/docker-compose.yml | 54 +
.../docker/infra-solr-docker-compose.sh | 122 +
.../ambari-infra-solr-plugin/docker/infra-solr.sh | 69 +
.../ambari-infra-solr-plugin/docker/solr.xml | 108 +
ambari-infra/ambari-infra-solr-plugin/pom.xml | 27 +
.../solr/metrics/reporters/AMSCacheReporter.java | 51 +
.../infra/solr/metrics/reporters/AMSProtocol.java | 24 +
.../infra/solr/metrics/reporters/AMSReporter.java | 104 +
.../solr/metrics/reporters/GaugeConverter.java | 29 +
.../infra/solr/metrics/reporters/MetricsUtils.java | 79 +
.../metrics/reporters/ScheduledAMSReporter.java | 117 +
.../reporters/ScheduledAMSReporterBuilder.java | 101 +
.../solr/metrics/reporters/SimpleAMSReporter.java | 38 +
.../reporters/SolrMetricsSecurityConfig.java | 44 +
.../solr/metrics/reporters/SolrMetricsSink.java | 103 +
ambari-infra/pom.xml | 52 +-
ambari-logsearch/README.md | 2 +-
.../config/api/LogSearchConfigFactory.java | 2 +-
.../model/inputconfig/FilterGrokDescriptor.java | 4 +
.../api/model/inputconfig/InputDescriptor.java | 2 +
.../api/model/inputconfig/InputFileDescriptor.java | 7 +
.../ambari-logsearch-config-zookeeper/pom.xml | 1 -
.../config/zookeeper/LogSearchConfigZK.java | 54 +-
.../inputconfig/impl/FilterGrokDescriptorImpl.java | 38 +
.../inputconfig/impl/InputDescriptorImpl.java | 21 +
.../inputconfig/impl/InputFileDescriptorImpl.java | 83 +
ambari-logsearch/ambari-logsearch-it/log4j.dtd | 230 +
ambari-logsearch/ambari-logsearch-it/pom.xml | 81 +-
.../ambari/logsearch/domain/StoryDataRegistry.java | 9 +
.../patterns/AmbariInfraSolrLogPatternIT.java | 39 +
.../logsearch/patterns/AmbariLogPatternIT.java | 255 +
.../logsearch/patterns/AtlasLogPatternIT.java | 42 +
.../logsearch/patterns/HBaseLogPatternIT.java | 45 +
.../logsearch/patterns/HDFSLogPatternIT.java | 42 +
.../logsearch/patterns/HdfsAuditLogPatternIT.java | 80 +
.../logsearch/patterns/HiveLogPatterntIT.java | 116 +
.../ambari/logsearch/patterns/JinjaFunctions.java | 27 +
.../logsearch/patterns/KafkaLogPatternIT.java | 90 +
.../logsearch/patterns/KnoxLogPatternIT.java | 59 +
.../ambari/logsearch/patterns/LayoutQuery.java | 23 +
.../ambari/logsearch/patterns/ListAppender.java | 59 +
.../ambari/logsearch/patterns/Log4jContent.java | 25 +
.../ambari/logsearch/patterns/Log4jProperties.java | 65 +
.../apache/ambari/logsearch/patterns/Log4jXml.java | 74 +
.../logsearch/patterns/Log4jXmlProperties.java | 45 +
.../logsearch/patterns/MetricsLogPatternIT.java | 67 +
.../ambari/logsearch/patterns/PatternITBase.java | 153 +
.../logsearch/patterns/RangerLogPatternIT.java | 77 +
.../logsearch/patterns/SmartSenseLogPatternIT.java | 145 +
.../logsearch/patterns/Spark2LogPatternIT.java | 62 +
.../ambari/logsearch/patterns/StackDefContent.java | 61 +
.../logsearch/patterns/StormLogPatternIT.java | 90 +
.../logsearch/patterns/YarnLogPatternIT.java | 159 +
.../logsearch/patterns/ZeppelinLogPatternIT.java | 45 +
.../logsearch/patterns/ZookeeperLogPatternIT.java | 43 +
.../logsearch/steps/AbstractLogSearchSteps.java | 34 +-
.../logsearch/steps/LogSearchDockerSteps.java | 2 +-
.../stories/backend/logfeeder_parsing_tests.story | 2 +-
.../input.config-smartsense.json.j2 | 85 +
.../service-log-level-counts-values.json | 8 +-
.../ambari/logfeeder/plugin/common/ConfigItem.java | 3 +-
.../plugin/common/LogFeederProperties.java | 3 +-
.../ambari/logfeeder/plugin/common/MetricData.java | 4 +-
.../ambari/logfeeder/plugin/filter/Filter.java | 4 +
.../ambari/logfeeder/plugin/input/Input.java | 15 +-
.../logfeeder/plugin/input/cache/LRUCache.java | 31 +-
.../ambari-logsearch-logfeeder/build.xml | 4 +-
.../ambari-logsearch-logfeeder/pom.xml | 11 +-
.../ambari/logfeeder/common/ConfigHandler.java | 16 +-
.../logfeeder/common/LogEntryParseTester.java | 12 +-
.../logfeeder/common/LogFeederConstants.java | 1 +
.../ambari/logfeeder/conf/InputSimulateConfig.java | 2 +
.../ambari/logfeeder/conf/LogEntryCacheConfig.java | 2 +
.../ambari/logfeeder/conf/LogFeederProps.java | 20 +-
.../logfeeder/conf/LogFeederSecurityConfig.java | 2 -
.../logfeeder/conf/MetricsCollectorConfig.java | 2 +
.../apache/ambari/logfeeder/filter/FilterGrok.java | 25 +-
.../apache/ambari/logfeeder/input/InputFile.java | 220 +-
.../ambari/logfeeder/input/InputFileMarker.java | 2 +-
.../ambari/logfeeder/input/InputManagerImpl.java | 12 +
.../logfeeder/input/file/FileCheckInHelper.java | 4 +-
.../input/monitor/AbstractLogFileMonitor.java | 64 +
.../input/monitor/CheckpointCleanupMonitor.java | 48 +
.../input/monitor/LogFileDetachMonitor.java | 79 +
.../input/monitor/LogFilePathUpdateMonitor.java | 74 +
.../loglevelfilter/LogLevelFilterHandler.java | 4 +
.../logfeeder/metrics/LogFeederAMSClient.java | 5 +
.../ambari/logfeeder/output/OutputManagerImpl.java | 22 +-
.../apache/ambari/logfeeder/output/OutputSolr.java | 27 +-
.../org/apache/ambari/logfeeder/util/FileUtil.java | 137 +-
.../ambari/logfeeder/util/LogFeederUtil.java | 24 +
.../src/main/scripts/logfeeder-env.sh~HEAD | 40 -
.../src/main/scripts/logfeeder-env.sh~trunk | 40 -
.../src/main/scripts/logfeeder.sh | 9 +-
ambari-logsearch/ambari-logsearch-server/build.xml | 4 +-
ambari-logsearch/ambari-logsearch-server/pom.xml | 25 +-
.../main/configsets/audit_logs/conf/managed-schema | 60 +-
.../main/configsets/audit_logs/conf/solrconfig.xml | 2 +-
.../configsets/hadoop_logs/conf/managed-schema | 116 +-
.../configsets/hadoop_logs/conf/solrconfig.xml | 2 +-
.../main/configsets/history/conf/managed-schema | 47 +-
.../main/configsets/history/conf/solrconfig.xml | 2 +-
.../logsearch/auth/filter/AbstractJWTFilter.java | 9 +-
.../logsearch/common/LogSearchConstants.java | 4 +-
.../ambari/logsearch/conf/SecurityConfig.java | 7 +-
.../logsearch/conf/SolrAuditLogPropsConfig.java | 20 +
.../logsearch/conf/SolrConnectionPropsConfig.java | 20 +
.../ambari/logsearch/conf/SolrPropsConfig.java | 4 +
.../configurer/SolrCollectionConfigurer.java | 8 +-
.../AbstractOperationHolderConverter.java | 57 +-
.../AuditBarGraphRequestQueryConverter.java | 2 +
.../BaseServiceLogRequestQueryConverter.java | 4 +-
...viceLogLevelDateRangeRequestQueryConverter.java | 6 +
.../apache/ambari/logsearch/doc/DocConstants.java | 4 +
.../handler/AbstractSolrConfigHandler.java | 60 +-
.../logsearch/handler/CreateCollectionHandler.java | 6 +-
.../handler/UploadConfigurationHandler.java | 37 +-
.../logsearch/manager/ServiceLogsManager.java | 2 +-
.../logsearch/manager/ShipperConfigManager.java | 7 +-
.../logsearch/model/common/LSServerFilterGrok.java | 25 +-
.../logsearch/model/common/LSServerInput.java | 8 +
.../logsearch/model/common/LSServerInputFile.java | 52 +
.../model/request/LogParamDefinition.java | 8 +-
.../model/request/ShipperConfigTestParams.java | 16 +-
.../model/request/impl/AuditBarGraphRequest.java | 33 +-
.../model/request/impl/AuditComponentRequest.java | 16 +-
.../model/request/impl/AuditLogRequest.java | 33 +-
.../request/impl/AuditServiceLoadRequest.java | 18 +-
.../model/request/impl/BaseLogRequest.java | 111 +-
.../model/request/impl/BaseServiceLogRequest.java | 85 +-
.../model/request/impl/CommonSearchRequest.java | 121 +-
.../model/request/impl/EventHistoryRequest.java | 33 +-
.../request/impl/FieldAuditBarGraphRequest.java | 33 +-
.../model/request/impl/FieldAuditLogRequest.java | 33 +-
.../model/request/impl/HostLogFilesRequest.java | 50 +-
.../model/request/impl/ServiceAnyGraphRequest.java | 60 +-
.../model/request/impl/ServiceGraphRequest.java | 20 +-
.../impl/ServiceLogAggregatedInfoRequest.java | 2 +-
.../impl/ServiceLogComponentHostRequest.java | 2 +-
.../impl/ServiceLogComponentLevelRequest.java | 2 +-
.../request/impl/ServiceLogExportRequest.java | 31 +-
.../impl/ServiceLogHostComponentRequest.java | 20 +-
.../request/impl/ServiceLogLevelCountRequest.java | 2 +-
.../model/request/impl/ServiceLogRequest.java | 72 +-
.../request/impl/ServiceLogTruncatedRequest.java | 46 +-
.../request/impl/ShipperConfigTestRequest.java | 18 +-
.../request/impl/TopFieldAuditLogRequest.java | 34 +-
.../model/request/impl/UserExportRequest.java | 33 +-
.../impl/body/AuditBarGraphBodyRequest.java | 51 +
.../impl/body/AuditComponentBodyRequest.java | 37 +
.../request/impl/body/AuditLogBodyRequest.java | 52 +
.../impl/body/AuditServiceLoadBodyRequest.java | 38 +
.../request/impl/body/BaseLogBodyRequest.java | 129 +
.../impl/body/BaseServiceLogBodyRequest.java | 103 +
.../request/impl/body/ClusterBodyRequest.java | 42 +
.../request/impl/body/CommonSearchBodyRequest.java | 143 +
.../impl/body/FieldAuditBarGraphBodyRequest.java | 51 +
.../impl/body/FieldAuditLogBodyRequest.java | 51 +
.../request/impl/body/HostLogFilesBodyRequest.java | 69 +
.../impl/body/ServiceAnyGraphBodyRequest.java | 77 +
.../request/impl/body/ServiceGraphBodyRequest.java | 38 +
.../body/ServiceLogAggregatedInfoBodyRequest.java | 26 +
.../request/impl/body/ServiceLogBodyRequest.java | 90 +
.../body/ServiceLogComponentHostBodyRequest.java | 26 +
.../body/ServiceLogComponentLevelBodyRequest.java | 26 +
.../impl/body/ServiceLogExportBodyRequest.java | 51 +
.../body/ServiceLogHostComponentBodyRequest.java | 39 +
.../impl/body/ServiceLogLevelCountBodyRequest.java | 26 +
.../impl/body/ServiceLogTruncatedBodyRequest.java | 64 +
.../impl/body/TopFieldAuditLogBodyRequest.java | 37 +
.../request/impl/body/UserExportBodyRequest.java | 51 +
.../impl/query/AuditBarGraphQueryRequest.java | 52 +
.../impl/query/AuditComponentQueryRequest.java | 38 +
.../request/impl/query/AuditLogQueryRequest.java | 53 +
.../impl/query/AuditServiceLoadQueryRequest.java | 40 +
.../request/impl/query/BaseLogQueryRequest.java | 130 +
.../impl/query/BaseServiceLogQueryRequest.java | 104 +
.../impl/query/CommonSearchQueryRequest.java | 143 +
.../impl/query/EventHistoryQueryRequest.java | 53 +
.../impl/query/FieldAuditBarGraphQueryRequest.java | 52 +
.../impl/query/FieldAuditLogQueryRequest.java | 52 +
.../impl/query/HostLogFilesQueryRequest.java | 69 +
.../impl/query/ServiceAnyGraphQueryRequest.java | 79 +
.../impl/query/ServiceGraphQueryRequest.java | 39 +
.../ServiceLogAggregatedInfoQueryRequest.java | 26 +
.../query/ServiceLogComponentHostQueryRequest.java | 26 +
.../ServiceLogComponentLevelQueryRequest.java | 26 +
.../impl/query/ServiceLogExportQueryRequest.java | 52 +
.../query/ServiceLogHostComponentQueryRequest.java | 40 +
.../query/ServiceLogLevelCountQueryRequest.java | 26 +
.../request/impl/query/ServiceLogQueryRequest.java | 92 +
.../query/ServiceLogTruncatedQueryRequest.java | 65 +
.../impl/query/TopFieldAuditLogQueryRequest.java | 53 +
.../request/impl/query/UserExportQueryRequest.java | 52 +
.../ambari/logsearch/rest/AuditLogsResource.java | 129 +-
.../logsearch/rest/EventHistoryResource.java | 4 +-
.../ambari/logsearch/rest/ServiceLogsResource.java | 276 +-
.../logsearch/rest/ShipperConfigResource.java | 4 +-
.../apache/ambari/logsearch/util/DownloadUtil.java | 8 +-
.../org/apache/ambari/logsearch/util/SolrUtil.java | 22 +-
.../filters/LogsearchKRBAuthenticationFilter.java | 67 +-
.../src/main/resources/default.properties | 12 +-
.../src/main/resources/swagger/swagger.html | 77 +-
.../src/main/scripts/logsearch-env.sh~HEAD | 40 -
.../src/main/scripts/logsearch-env.sh~trunk | 40 -
.../src/main/scripts/logsearch.sh | 7 +-
.../AuditBarGraphRequestQueryConverterTest.java | 12 +-
.../AuditComponentRequestQueryConverterTest.java | 5 +-
.../converter/AuditLogRequestConverterTest.java | 9 +-
.../AuditServiceLoadRequestQueryConverterTest.java | 9 +-
.../BaseServiceLogRequestQueryConverterTest.java | 15 +-
.../EventHistoryRequestQueryConverterTest.java | 3 +-
.../FieldAuditLogRequestQueryConverterTest.java | 11 +-
.../HostLogFilesRequestQueryConverterTest.java | 5 +-
.../ServiceLogAnyGraphRequestConverterTest.java | 9 +-
...LogComponentLevelRequestQueryConverterTest.java | 13 +-
...LogComponentRequestFacetQueryConverterTest.java | 15 +-
...viceLogLevelCountRequestQueryConverterTest.java | 11 +-
...LogLevelDateRangeRequestQueryConverterTest.java | 12 +-
...rviceLogTreeRequestFacetQueryConverterTest.java | 16 +-
...rviceLogTruncatedRequestQueryConverterTest.java | 10 +-
.../TopFieldAuditLogRequestQueryConverterTest.java | 11 +-
.../UserExportRequestQueryConverterTest.java | 11 +-
ambari-logsearch/ambari-logsearch-web/package.json | 1 -
.../src/app/app-routing.module.ts | 27 +-
.../ambari-logsearch-web/src/app/app.module.ts | 20 +-
.../classes/components/graph/graph.component.ts | 125 +-
.../components/graph/time-graph.component.less | 2 +-
.../components/graph/time-graph.component.ts | 57 +-
.../src/app/classes/list-item.ts | 1 +
.../src/app/classes/models/app-state.ts | 4 +-
.../src/app/classes/models/log-type-tab.ts | 51 +
.../src/app/classes/models/logs-state.ts | 25 +
.../src/app/classes/models/store.ts | 18 +-
.../src/app/classes/models/tab.ts | 48 -
.../ambari-logsearch-web/src/app/classes/string.ts | 8 +
.../action-menu/action-menu.component.html | 12 +-
.../action-menu/action-menu.component.less | 70 +
.../action-menu/action-menu.component.spec.ts | 14 +-
.../action-menu/action-menu.component.ts | 20 +-
.../src/app/components/app.component.html | 12 +-
.../src/app/components/app.component.less | 18 +-
.../src/app/components/app.component.ts | 25 +-
.../audit-logs-entries.component.spec.ts | 14 +-
.../audit-logs-entries.component.ts | 6 +-
.../audit-logs-table.component.spec.ts | 14 +-
.../breadrumbs/breadcrumbs.component.less | 7 +
.../components/breadrumbs/breadcrumbs.component.ts | 32 +-
.../cluster-filter.component.spec.ts | 14 +-
.../cluster-filter/cluster-filter.component.ts | 34 +-
.../context-menu/context-menu.component.spec.ts | 16 +-
.../filter-button/filter-button.component.ts | 56 +-
.../filters-panel/filters-panel.component.html | 21 +-
.../filters-panel/filters-panel.component.less | 6 +
.../filters-panel/filters-panel.component.spec.ts | 16 +-
.../filters-panel/filters-panel.component.ts | 101 +-
.../log-context/log-context.component.html | 19 +-
.../log-context/log-context.component.less | 17 +-
.../log-context/log-context.component.spec.ts | 14 +-
.../log-context/log-context.component.ts | 40 +-
.../log-index-filter.component.html | 6 +-
.../log-index-filter.component.less | 5 +
.../log-index-filter.component.spec.ts | 14 +-
.../log-index-filter/log-index-filter.component.ts | 37 +-
.../components/log-level/log-level.component.ts | 18 +-
.../login-form/login-form.component.html | 4 +-
.../login-form/login-form.component.spec.ts | 27 +-
.../components/login-form/login-form.component.ts | 78 +-
.../logs-container/logs-container.component.html | 8 +-
.../logs-container/logs-container.component.less | 1 -
.../logs-container.component.spec.ts | 14 +-
.../logs-container/logs-container.component.ts | 296 +-
.../main-container/main-container.component.less | 21 -
.../main-container/main-container.component.ts | 23 +-
.../menu-button/menu-button.component.html | 3 +-
.../menu-button/menu-button.component.less | 10 +
.../menu-button/menu-button.component.ts | 81 +-
.../search-box/search-box.component.html | 14 +-
.../search-box/search-box.component.less | 16 +-
.../components/search-box/search-box.component.ts | 74 +-
.../service-logs-table.component.spec.ts | 14 +-
.../service-logs-table.component.ts | 22 +-
.../src/app/components/tabs/tabs.component.html | 24 +-
.../src/app/components/tabs/tabs.component.spec.ts | 22 +-
.../src/app/components/tabs/tabs.component.ts | 71 +-
.../time-histogram/time-histogram.component.ts | 11 +-
.../time-range-picker.component.spec.ts | 14 +-
.../time-range-picker.component.ts | 19 +-
.../timezone-picker.component.spec.ts | 14 +-
.../components/top-menu/top-menu.component.spec.ts | 12 +-
.../src/app/modules/app-load/app-load.module.ts | 14 +-
.../src/app/modules/app-load/app-load.service.ts | 73 -
.../models/data-availability-state.model.ts | 32 +
.../modules/app-load/services/app-load.service.ts | 256 +
.../app-load/stores/data-avaibility-state.store.ts | 34 +
.../src/app/modules/shared/animations.less | 33 +
.../data-loading-indicator.component.html | 50 +
.../data-loading-indicator.component.less | 157 +
.../data-loading-indicator.component.spec.ts | 56 +
.../data-loading-indicator.component.ts | 84 +
.../dropdown-button.component.spec.ts | 8 +-
.../dropdown-button/dropdown-button.component.ts | 36 +-
.../dropdown-list/dropdown-list.component.html | 69 +-
.../dropdown-list/dropdown-list.component.less | 42 +-
.../dropdown-list/dropdown-list.component.spec.ts | 16 +-
.../dropdown-list/dropdown-list.component.ts | 142 +-
.../filter-dropdown.component.spec.ts | 16 +-
.../filter-dropdown/filter-dropdown.component.ts | 2 +-
.../shared/components/modal/modal.component.html | 3 +-
.../shared/components/modal/modal.component.less | 13 +
.../shared/components/modal/modal.component.ts | 3 +
.../src/app/modules/shared/main.less | 1 +
.../src/app/modules/shared/mixins.less | 2 +-
.../src/app/modules/shared/notifications.less | 66 +
.../shared/services/notification.service.ts | 41 +-
.../src/app/modules/shared/shared.module.ts | 12 +-
.../src/app/modules/shared/variables.less | 9 +-
.../shipper-configuration.component.less | 4 +
.../shipper-configuration.component.ts | 50 +-
...ipper-service-configuration-form.component.html | 16 +-
...shipper-service-configuration-form.component.ts | 56 +-
.../shipper/directives/validator.directive.ts | 14 +
.../services/shipper-configuration.service.ts | 13 +-
.../app/modules/shipper/services/shipper.guard.ts | 83 +
.../app/modules/shipper/shipper-routing.module.ts | 10 +-
.../src/app/modules/shipper/shipper.module.ts | 4 +-
.../src/app/pipes/component-label.ts | 2 +-
.../src/app/services/auth-guard.service.ts | 2 +-
.../src/app/services/auth.service.spec.ts | 11 +-
.../src/app/services/auth.service.ts | 80 +-
.../services/component-generator.service.spec.ts | 14 +-
.../app/services/history-manager.service.spec.ts | 16 +-
.../src/app/services/history-manager.service.ts | 296 +-
.../src/app/services/http-client.service.ts | 62 +-
.../src/app/services/login-screen-guard.service.ts | 42 +
.../logs-breadcrumbs-resolver.service.spec.ts | 72 +
.../services/logs-breadcrumbs-resolver.service.ts | 42 +
.../app/services/logs-container.service.spec.ts | 14 +-
.../src/app/services/logs-container.service.ts | 961 +-
.../services/logs-filtering-utils.service.spec.ts | 71 +
.../app/services/logs-filtering-utils.service.ts | 553 +
.../src/app/services/mock-api-data.service.spec.ts | 14 +-
.../src/app/services/mock-api-data.service.ts | 62 +-
.../src/app/services/storage/logs-state.service.ts | 33 +
.../src/app/services/storage/reducers.service.ts | 8 +-
.../src/app/services/storage/tabs.service.ts | 2 +-
.../src/app/services/tab.guard.spec.ts | 78 +
.../src/app/services/tab.guard.ts | 51 +
.../src/app/services/user-settings.service.spec.ts | 14 +-
.../src/app/services/user-settings.service.ts | 60 +-
.../src/app/services/utils.service.ts | 4 +-
.../src/app/test-config.spec.ts | 4 +-
.../ambari-logsearch-web/src/assets/i18n/en.json | 44 +-
.../src/assets/images/ambari-logo.png | Bin 0 -> 2779 bytes
.../ambari-logsearch-web/src/index.html | 18 +-
.../src/mockdata/mock-data-common.ts | 118 +-
.../src/mockdata/mock-data-get.ts | 88 +-
.../src/mockdata/mock-data-post.ts | 1649 +-
.../ambari-logsearch-web/src/styles.less | 5 +-
.../src/vendor/css/bootstrap-logsearch.min.css | 2 +-
.../src/vendor/css/fonts/Roboto-Bold-webfont.eot | Bin 0 -> 36098 bytes
.../src/vendor/css/fonts/Roboto-Bold-webfont.svg | 607 +
.../src/vendor/css/fonts/Roboto-Bold-webfont.ttf | Bin 0 -> 35912 bytes
.../src/vendor/css/fonts/Roboto-Bold-webfont.woff | Bin 0 -> 21320 bytes
.../src/vendor/js/bootstrap-logsearch.min.js | 4 +-
ambari-logsearch/ambari-logsearch-web/yarn.lock | 4 -
ambari-logsearch/docker/Dockerfile | 6 +-
ambari-logsearch/docker/all.yml | 2 +-
ambari-logsearch/docker/docker-compose.yml | 4 +-
.../docker/knox/logsearch/1.0.0/service.xml | 12 +-
ambari-logsearch/docker/logsearch-docker.sh | 16 +-
ambari-logsearch/docker/solr.yml | 4 +-
ambari-logsearch/docker/sso.yml | 6 +-
.../test-config/logfeeder/logfeeder.properties | 2 +-
.../shipper-conf/input.config-ambari.json | 641 +-
.../logfeeder/shipper-conf/input.config-storm.json | 75 +
.../streamline-1-TestAgg-2-3/6700/worker.log | 5 +
.../streamline-1-TestAgg-2-3/6701/worker.log | 5 +
ambari-logsearch/pom.xml | 31 +-
ambari-metrics/ambari-metrics-assembly/pom.xml | 8 +-
.../src/main/assembly/collector.xml | 1 +
ambari-metrics/ambari-metrics-common/pom.xml | 41 +-
.../sink/timeline/AbstractTimelineMetricsSink.java | 108 +-
.../hadoop/metrics2/sink/timeline/Precision.java | 1 -
.../sink/timeline/SingleValuedTimelineMetric.java | 22 +-
.../metrics2/sink/timeline/TimelineMetric.java | 28 +-
.../sink/timeline/TimelineMetricMetadata.java | 41 +-
.../sink/timeline/TimelineMetricUtils.java | 65 +
.../metrics2/sink/timeline/TimelineMetrics.java | 11 +-
.../availability/MetricCollectorHAHelper.java | 8 +-
.../timeline/AbstractTimelineMetricSinkTest.java | 240 +
.../AbstractTimelineMetricSinkTest.java | 108 -
.../availability/MetricCollectorHATest.java | 5 +
.../timeline/cache/HandleConnectExceptionTest.java | 10 +
.../src/main/conf/flume-metrics2.properties.j2 | 8 +-
.../sink/flume/FlumeTimelineMetricsSink.java | 13 +-
.../ambari-metrics/datasource.js | 111 +
ambari-metrics/ambari-metrics-hadoop-sink/pom.xml | 5 +-
.../sink/timeline/HadoopTimelineMetricsSink.java | 15 +-
.../timeline/HadoopTimelineMetricsSinkTest.java | 8 +-
.../ambari-metrics-host-aggregator/pom.xml | 12 +-
.../host/aggregator/AggregatorApplication.java | 328 +-
.../host/aggregator/TimelineMetricsHolder.java | 137 +-
.../sink/timeline/AbstractMetricPublisher.java | 12 +-
.../sink/timeline/AggregatedMetricsPublisher.java | 5 +
.../sink/timeline/RawMetricsPublisher.java | 5 +
.../host/aggregator/TimelineMetricsHolderTest.java | 5 +-
.../timeline/AggregatedMetricsPublisherTest.java | 3 +-
.../sink/timeline/RawMetricsPublisherTest.java | 4 +-
.../src/main/python/amhm_service.py | 6 +-
.../src/main/python/core/aggregator.py | 6 +-
.../src/main/python/core/application_metric_map.py | 52 +-
.../src/main/python/core/config_reader.py | 25 +-
.../src/main/python/core/emitter.py | 42 +-
.../src/main/python/core/host_info.py | 1 -
.../src/main/python/core/stop_handler.py | 4 +-
.../src/main/python/main.py | 19 +-
.../test/python/core/TestApplicationMetricMap.py | 38 +-
ambari-metrics/ambari-metrics-kafka-sink/pom.xml | 2 +-
.../sink/kafka/KafkaTimelineMetricsReporter.java | 10 +-
.../sink/storm/StormTimelineMetricsReporter.java | 16 +-
.../sink/storm/StormTimelineMetricsSink.java | 13 +-
.../sink/storm/StormTimelineMetricsReporter.java | 13 +-
.../sink/storm/StormTimelineMetricsSink.java | 13 +-
.../conf/unix/ambari-metrics-collector | 78 +-
.../conf/unix/ams-env.sh | 17 +
.../conf/unix/ams-site.xml | 360 +
.../conf/unix/hbase-site.xml | 280 +
.../conf/unix/sqlline/phoenix_utils.py | 7 +-
.../conf/unix/sqlline/sqlline.py | 4 +-
.../ambari-metrics-timelineservice/pom.xml | 287 +-
.../ambari/metrics/AMSApplicationServer.java | 143 +
.../metrics/core/loadsimulator/LoadRunner.java | 154 +
.../core/loadsimulator/MetricsLoadSimulator.java | 138 +
.../core/loadsimulator/MetricsSenderWorker.java | 60 +
.../metrics/core/loadsimulator/data/AppID.java | 45 +
.../core/loadsimulator/data/AppMetrics.java | 47 +
.../loadsimulator/data/ApplicationInstance.java | 58 +
.../loadsimulator/data/HostMetricsGenerator.java | 61 +
.../metrics/core/loadsimulator/data/Metric.java | 71 +
.../data/MetricsGeneratorConfigurer.java | 93 +
.../core/loadsimulator/net/MetricsSender.java | 31 +
.../core/loadsimulator/net/RestMetricsSender.java | 92 +
.../loadsimulator/net/StdOutMetricsSender.java | 56 +
.../metrics/core/loadsimulator/net/UrlService.java | 100 +
.../metrics/core/loadsimulator/util/Json.java | 62 +
.../loadsimulator/util/RandomMetricsProvider.java | 39 +
.../core/loadsimulator/util/TimeStampProvider.java | 51 +
.../metrics/core/timeline/FunctionUtils.java | 47 +
.../core/timeline/HBaseTimelineMetricsService.java | 567 +
.../core/timeline/MetricsCacheCommitterThread.java | 38 +
.../MetricsSystemInitializationException.java | 41 +
.../core/timeline/PhoenixHBaseAccessor.java | 2046 +
.../core/timeline/TimelineMetricConfiguration.java | 741 +
.../timeline/TimelineMetricDistributedCache.java | 32 +
.../timeline/TimelineMetricServiceSummary.java | 74 +
.../timeline/TimelineMetricSplitPointComputer.java | 240 +
.../metrics/core/timeline/TimelineMetricStore.java | 125 +
.../core/timeline/TimelineMetricStoreWatcher.java | 126 +
.../timeline/TimelineMetricsAggregatorSink.java | 60 +
.../core/timeline/TimelineMetricsFilter.java | 198 +
.../core/timeline/TimelineMetricsIgniteCache.java | 326 +
.../core/timeline/TransientMetricReadHelper.java | 139 +
.../aggregators/AbstractTimelineAggregator.java | 474 +
.../core/timeline/aggregators/AggregatorUtils.java | 255 +
.../timeline/aggregators/CustomDownSampler.java | 44 +
.../timeline/aggregators/DownSamplerUtils.java | 122 +
.../aggregators/EventMetricDownSampler.java | 84 +
.../core/timeline/aggregators/Function.java | 213 +
.../aggregators/TimelineClusterMetric.java | 97 +
.../aggregators/TimelineMetricAggregator.java | 59 +
.../TimelineMetricAggregatorFactory.java | 529 +
.../aggregators/TimelineMetricAppAggregator.java | 192 +
.../TimelineMetricClusterAggregator.java | 152 +
.../TimelineMetricClusterAggregatorSecond.java | 287 +
...tricClusterAggregatorSecondWithCacheSource.java | 104 +
.../TimelineMetricFilteringHostAggregator.java | 94 +
.../aggregators/TimelineMetricHostAggregator.java | 125 +
.../aggregators/TimelineMetricReadHelper.java | 184 +
.../core/timeline/aggregators/TopNDownSampler.java | 112 +
.../v2/TimelineMetricClusterAggregator.java | 93 +
.../v2/TimelineMetricFilteringHostAggregator.java | 119 +
.../v2/TimelineMetricHostAggregator.java | 77 +
.../availability/AggregationTaskRunner.java | 141 +
.../timeline/availability/CheckpointManager.java | 95 +
.../availability/MetricCollectorHAController.java | 330 +
.../OnlineOfflineStateModelFactory.java | 69 +
.../discovery/TimelineMetricHostMetadata.java | 60 +
.../discovery/TimelineMetricMetadataKey.java | 80 +
.../discovery/TimelineMetricMetadataManager.java | 852 +
.../discovery/TimelineMetricMetadataSync.java | 227 +
...ractTimelineMetricsSeriesAggregateFunction.java | 98 +
.../timeline/function/SeriesAggregateFunction.java | 42 +
.../TimelineMetricsSeriesAggregateFunction.java | 25 +
...elineMetricsSeriesAggregateFunctionFactory.java | 41 +
.../TimelineMetricsSeriesAvgAggregateFunction.java | 39 +
.../TimelineMetricsSeriesMaxAggregateFunction.java | 41 +
.../TimelineMetricsSeriesMinAggregateFunction.java | 41 +
.../TimelineMetricsSeriesSumAggregateFunction.java | 39 +
.../metrics/core/timeline/query/Condition.java | 52 +
.../core/timeline/query/ConditionBuilder.java | 156 +
.../core/timeline/query/ConnectionProvider.java | 29 +
.../core/timeline/query/DefaultCondition.java | 322 +
.../timeline/query/DefaultPhoenixDataSource.java | 90 +
.../core/timeline/query/EmptyCondition.java | 174 +
.../timeline/query/PhoenixConnectionProvider.java | 31 +
.../core/timeline/query/PhoenixTransactSQL.java | 1106 +
.../query/SplitByMetricNamesCondition.java | 194 +
.../metrics/core/timeline/query/TopNCondition.java | 162 +
.../timeline/query/TransientMetricCondition.java | 206 +
.../core/timeline/sink/DefaultFSSinkProvider.java | 153 +
.../core/timeline/sink/ExternalMetricsSink.java | 48 +
.../core/timeline/sink/ExternalSinkProvider.java | 35 +
.../core/timeline/sink/HttpSinkProvider.java | 231 +
.../core/timeline/sink/KafkaSinkProvider.java | 118 +
.../DefaultInternalMetricsSourceProvider.java | 42 +
.../timeline/source/InternalMetricsSource.java | 30 +
.../timeline/source/InternalSourceProvider.java | 39 +
.../core/timeline/source/RawMetricsSource.java | 85 +
.../source/cache/InternalMetricCacheKey.java | 109 +
.../source/cache/InternalMetricCacheValue.java | 37 +
.../source/cache/InternalMetricsCache.java | 229 +
.../source/cache/InternalMetricsCacheProvider.java | 48 +
.../cache/InternalMetricsCacheSizeOfEngine.java | 148 +
.../upgrade/core/AbstractPhoenixMetricsCopier.java | 164 +
.../upgrade/core/MetricsDataMigrationLauncher.java | 331 +
.../upgrade/core/PhoenixClusterMetricsCopier.java | 74 +
.../upgrade/core/PhoenixHostMetricsCopier.java | 77 +
.../timeline/uuid/HashBasedUuidGenStrategy.java | 225 +
.../core/timeline/uuid/MD5UuidGenStrategy.java | 60 +
.../core/timeline/uuid/MetricUuidGenStrategy.java | 40 +
.../timeline/uuid/Murmur3HashUuidGenStrategy.java | 54 +
.../core/timeline/uuid/TimelineMetricUuid.java | 55 +
.../records/ApplicationAttemptFinishData.java | 95 +
.../records/ApplicationAttemptHistoryData.java | 171 +
.../records/ApplicationAttemptStartData.java | 82 +
.../metrics/records/ApplicationFinishData.java | 94 +
.../metrics/records/ApplicationHistoryData.java | 213 +
.../metrics/records/ApplicationStartData.java | 106 +
.../metrics/records/ContainerFinishData.java | 90 +
.../metrics/records/ContainerHistoryData.java | 182 +
.../ambari/metrics/records/ContainerStartData.java | 92 +
.../pb/ApplicationAttemptFinishDataPBImpl.java | 239 +
.../impl/pb/ApplicationAttemptStartDataPBImpl.java | 208 +
.../impl/pb/ApplicationFinishDataPBImpl.java | 226 +
.../impl/pb/ApplicationStartDataPBImpl.java | 229 +
.../records/impl/pb/ContainerFinishDataPBImpl.java | 204 +
.../records/impl/pb/ContainerStartDataPBImpl.java | 258 +
.../metrics/timeline/GenericObjectMapper.java | 135 +
.../ambari/metrics/timeline/NameValuePair.java | 59 +
.../ambari/metrics/timeline/TimelineReader.java | 155 +
.../ambari/metrics/timeline/TimelineStore.java | 29 +
.../ambari/metrics/timeline/TimelineWriter.java | 46 +
.../ambari/metrics/webapp/AMSController.java | 37 +
.../apache/ambari/metrics/webapp/AMSWebApp.java | 42 +
.../ambari/metrics/webapp/JAXBContextResolver.java | 64 +
.../ambari/metrics/webapp/TimelineWebServices.java | 539 +
.../ApplicationHistoryClientService.java | 215 -
.../ApplicationHistoryManager.java | 146 -
.../ApplicationHistoryManagerImpl.java | 250 -
.../ApplicationHistoryReader.java | 117 -
.../ApplicationHistoryServer.java | 203 -
.../ApplicationHistoryStore.java | 37 -
.../ApplicationHistoryWriter.java | 112 -
.../FileSystemApplicationHistoryStore.java | 784 -
.../MemoryApplicationHistoryStore.java | 274 -
.../NullApplicationHistoryStore.java | 127 -
.../metrics/loadsimulator/LoadRunner.java | 159 -
.../loadsimulator/MetricsLoadSimulator.java | 139 -
.../metrics/loadsimulator/MetricsSenderWorker.java | 65 -
.../metrics/loadsimulator/data/AppID.java | 46 -
.../metrics/loadsimulator/data/AppMetrics.java | 48 -
.../loadsimulator/data/ApplicationInstance.java | 59 -
.../loadsimulator/data/HostMetricsGenerator.java | 63 -
.../metrics/loadsimulator/data/Metric.java | 71 -
.../data/MetricsGeneratorConfigurer.java | 95 -
.../metrics/loadsimulator/net/MetricsSender.java | 31 -
.../loadsimulator/net/RestMetricsSender.java | 93 -
.../loadsimulator/net/StdOutMetricsSender.java | 56 -
.../metrics/loadsimulator/net/UrlService.java | 101 -
.../metrics/loadsimulator/util/Json.java | 63 -
.../loadsimulator/util/RandomMetricsProvider.java | 40 -
.../loadsimulator/util/TimeStampProvider.java | 52 -
.../metrics/timeline/HBaseTimelineMetricStore.java | 516 -
.../timeline/MetricsCacheCommitterThread.java | 38 -
.../MetricsSystemInitializationException.java | 42 -
.../metrics/timeline/PhoenixHBaseAccessor.java | 1829 -
.../timeline/TimelineMetricConfiguration.java | 537 -
.../metrics/timeline/TimelineMetricStore.java | 106 -
.../timeline/TimelineMetricStoreWatcher.java | 127 -
.../timeline/TimelineMetricsAggregatorSink.java | 60 -
.../metrics/timeline/TimelineMetricsFilter.java | 177 -
.../aggregators/AbstractTimelineAggregator.java | 496 -
.../timeline/aggregators/AggregatorUtils.java | 62 -
.../timeline/aggregators/CustomDownSampler.java | 44 -
.../timeline/aggregators/DownSamplerUtils.java | 122 -
.../aggregators/EventMetricDownSampler.java | 83 -
.../metrics/timeline/aggregators/Function.java | 212 -
.../aggregators/TimelineClusterMetric.java | 101 -
.../aggregators/TimelineMetricAggregator.java | 59 -
.../TimelineMetricAggregatorFactory.java | 446 -
.../aggregators/TimelineMetricAppAggregator.java | 188 -
.../TimelineMetricClusterAggregator.java | 144 -
.../TimelineMetricClusterAggregatorSecond.java | 472 -
.../aggregators/TimelineMetricHostAggregator.java | 122 -
.../aggregators/TimelineMetricReadHelper.java | 167 -
.../timeline/aggregators/TopNDownSampler.java | 112 -
.../v2/TimelineMetricClusterAggregator.java | 93 -
.../v2/TimelineMetricHostAggregator.java | 76 -
.../availability/AggregationTaskRunner.java | 145 -
.../timeline/availability/CheckpointManager.java | 98 -
.../availability/MetricCollectorHAController.java | 320 -
.../OnlineOfflineStateModelFactory.java | 69 -
.../discovery/TimelineMetricMetadataKey.java | 60 -
.../discovery/TimelineMetricMetadataManager.java | 278 -
.../discovery/TimelineMetricMetadataSync.java | 226 -
...ractTimelineMetricsSeriesAggregateFunction.java | 97 -
.../timeline/function/SeriesAggregateFunction.java | 42 -
.../TimelineMetricsSeriesAggregateFunction.java | 25 -
...elineMetricsSeriesAggregateFunctionFactory.java | 41 -
.../TimelineMetricsSeriesAvgAggregateFunction.java | 39 -
.../TimelineMetricsSeriesMaxAggregateFunction.java | 41 -
.../TimelineMetricsSeriesMinAggregateFunction.java | 41 -
.../TimelineMetricsSeriesSumAggregateFunction.java | 39 -
.../metrics/timeline/query/Condition.java | 48 -
.../metrics/timeline/query/ConditionBuilder.java | 137 -
.../metrics/timeline/query/ConnectionProvider.java | 29 -
.../metrics/timeline/query/DefaultCondition.java | 384 -
.../timeline/query/DefaultPhoenixDataSource.java | 90 -
.../metrics/timeline/query/EmptyCondition.java | 153 -
.../timeline/query/PhoenixConnectionProvider.java | 31 -
.../metrics/timeline/query/PhoenixTransactSQL.java | 928 -
.../query/SplitByMetricNamesCondition.java | 189 -
.../metrics/timeline/query/TopNCondition.java | 196 -
.../records/ApplicationAttemptFinishData.java | 95 -
.../records/ApplicationAttemptHistoryData.java | 171 -
.../records/ApplicationAttemptStartData.java | 82 -
.../records/ApplicationFinishData.java | 94 -
.../records/ApplicationHistoryData.java | 213 -
.../records/ApplicationStartData.java | 106 -
.../records/ContainerFinishData.java | 90 -
.../records/ContainerHistoryData.java | 182 -
.../records/ContainerStartData.java | 92 -
.../pb/ApplicationAttemptFinishDataPBImpl.java | 239 -
.../impl/pb/ApplicationAttemptStartDataPBImpl.java | 208 -
.../impl/pb/ApplicationFinishDataPBImpl.java | 226 -
.../impl/pb/ApplicationStartDataPBImpl.java | 229 -
.../records/impl/pb/ContainerFinishDataPBImpl.java | 204 -
.../records/impl/pb/ContainerStartDataPBImpl.java | 258 -
.../timeline/EntityIdentifier.java | 100 -
.../timeline/GenericObjectMapper.java | 135 -
.../timeline/LeveldbTimelineStore.java | 1473 -
.../timeline/MemoryTimelineStore.java | 360 -
.../timeline/NameValuePair.java | 59 -
.../timeline/TimelineReader.java | 155 -
.../timeline/TimelineStore.java | 29 -
.../timeline/TimelineWriter.java | 46 -
.../timeline/package-info.java | 20 -
.../webapp/AHSController.java | 55 -
.../webapp/AHSLogsPage.java | 55 -
.../applicationhistoryservice/webapp/AHSView.java | 90 -
.../webapp/AHSWebApp.java | 66 -
.../webapp/AHSWebServices.java | 162 -
.../webapp/AppAttemptPage.java | 69 -
.../applicationhistoryservice/webapp/AppPage.java | 71 -
.../webapp/ContainerPage.java | 41 -
.../webapp/JAXBContextResolver.java | 64 -
.../applicationhistoryservice/webapp/NavBlock.java | 51 -
.../webapp/TimelineWebServices.java | 648 -
.../src/main/python/main.py | 4 +-
.../main/resources/metrics_def/AMBARI_SERVER.dat | 40 +
.../resources/metrics_def/AMSSMOKETESTFAKE.DAT | 1 +
.../resources/metrics_def/AMSSMOKETESTFAKE.dat | 1 +
.../main/resources/metrics_def/HBASE_MASTER.dat | 253 +
.../resources/metrics_def/HBASE_REGIONSERVER.dat | 600 +
.../src/main/resources/metrics_def/HOST.dat | 6 +
.../resources/metrics_def/JOBHISTORYSERVER.dat | 58 +
.../main/resources/metrics_def/KAFKA_BROKER.dat | 1 -
.../main/resources/metrics_def/MASTER_HBASE.dat | 69 -
.../src/main/resources/metrics_def/NAMENODE.dat | 2 +
.../src/main/resources/metrics_def/SLAVE_HBASE.dat | 178 -
.../metrics_def/TIMELINE_METRIC_STORE_WATCHER.DAT | 1 +
.../metrics_def/TIMELINE_METRIC_STORE_WATCHER.dat | 1 +
.../core/loadsimulator/data/TestAppMetrics.java | 134 +
.../core/loadsimulator/data/TestMetric.java | 80 +
.../jmetertest/jmetertest/AMSJMeterLoadTest.java | 198 +
.../jmetertest/jmetertest/AppGetMetric.java | 57 +
.../jmetertest/GetMetricRequestInfo.java | 61 +
.../jmetertest/jmetertest/JmeterTestPlanTask.java | 276 +
.../loadsimulator/net/TestRestMetricsSender.java | 75 +
.../loadsimulator/net/TestStdOutMetricsSender.java | 37 +
.../util/TestRandomMetricsProvider.java | 36 +
.../loadsimulator/util/TestTimeStampProvider.java | 51 +
.../timeline/AbstractMiniHBaseClusterTest.java | 313 +
.../AbstractPhoenixConnectionlessTest.java | 111 +
.../ambari/metrics/core/timeline/FunctionTest.java | 62 +
.../timeline/HBaseTimelineMetricsServiceTest.java | 136 +
.../core/timeline/ITPhoenixHBaseAccessor.java | 556 +
.../metrics/core/timeline/MetricTestHelper.java | 119 +
.../core/timeline/PhoenixHBaseAccessorTest.java | 292 +
.../metrics/core/timeline/TestClusterSuite.java | 34 +
.../core/timeline/TestMetricHostAggregate.java | 65 +
.../core/timeline/TestPhoenixTransactSQL.java | 659 +
.../core/timeline/TestTimelineMetricStore.java | 133 +
.../TimelineMetricSplitPointComputerTest.java | 141 +
.../timeline/TimelineMetricStoreWatcherTest.java | 108 +
.../TimelineMetricsAggregatorMemorySink.java | 141 +
.../core/timeline/TimelineMetricsFilterTest.java | 259 +
.../timeline/TimelineMetricsIgniteCacheTest.java | 237 +
.../metrics/core/timeline/TopNConditionTest.java | 105 +
.../AbstractTimelineAggregatorTest.java | 181 +
.../core/timeline/aggregators/DownSamplerTest.java | 117 +
.../timeline/aggregators/ITClusterAggregator.java | 711 +
.../timeline/aggregators/ITMetricAggregator.java | 355 +
.../TimelineMetricClusterAggregatorSecondTest.java | 405 +
...ClusterAggregatorSecondWithCacheSourceTest.java | 115 +
.../MetricCollectorHAControllerTest.java | 106 +
.../timeline/discovery/TestMetadataManager.java | 280 +
.../core/timeline/discovery/TestMetadataSync.java | 126 +
...TimelineMetricsSeriesAggregateFunctionTest.java | 188 +
.../core/timeline/query/DefaultConditionTest.java | 172 +
.../core/timeline/source/RawMetricsSourceTest.java | 142 +
.../timeline/uuid/MetricUuidGenStrategyTest.java | 216 +
.../metrics/timeline/TestGenericObjectMapper.java | 102 +
.../metrics/webapp/TestTimelineWebServices.java | 118 +
.../ApplicationHistoryStoreTestUtils.java | 84 -
.../TestApplicationHistoryClientService.java | 209 -
.../TestApplicationHistoryManagerImpl.java | 76 -
.../TestApplicationHistoryServer.java | 266 -
.../TestFileSystemApplicationHistoryStore.java | 233 -
.../TestMemoryApplicationHistoryStore.java | 206 -
.../metrics/loadsimulator/data/TestAppMetrics.java | 134 -
.../metrics/loadsimulator/data/TestMetric.java | 80 -
.../jmetertest/jmetertest/AMSJMeterLoadTest.java | 198 -
.../jmetertest/jmetertest/AppGetMetric.java | 57 -
.../jmetertest/GetMetricRequestInfo.java | 61 -
.../jmetertest/jmetertest/JmeterTestPlanTask.java | 276 -
.../loadsimulator/net/TestRestMetricsSender.java | 76 -
.../loadsimulator/net/TestStdOutMetricsSender.java | 37 -
.../util/TestRandomMetricsProvider.java | 36 -
.../loadsimulator/util/TestTimeStampProvider.java | 51 -
.../timeline/AbstractMiniHBaseClusterTest.java | 297 -
.../AbstractPhoenixConnectionlessTest.java | 111 -
.../metrics/timeline/FunctionTest.java | 62 -
.../timeline/HBaseTimelineMetricStoreTest.java | 136 -
.../metrics/timeline/ITPhoenixHBaseAccessor.java | 442 -
.../metrics/timeline/MetricTestHelper.java | 121 -
.../metrics/timeline/PhoenixHBaseAccessorTest.java | 321 -
.../metrics/timeline/TestClusterSuite.java | 34 -
.../metrics/timeline/TestMetricHostAggregate.java | 66 -
.../metrics/timeline/TestPhoenixTransactSQL.java | 661 -
.../metrics/timeline/TestTimelineMetricStore.java | 115 -
.../timeline/TimelineMetricStoreWatcherTest.java | 109 -
.../TimelineMetricsAggregatorMemorySink.java | 141 -
.../timeline/TimelineMetricsFilterTest.java | 223 -
.../metrics/timeline/TopNConditionTest.java | 105 -
.../AbstractTimelineAggregatorTest.java | 179 -
.../timeline/aggregators/DownSamplerTest.java | 115 -
.../timeline/aggregators/ITClusterAggregator.java | 683 -
.../timeline/aggregators/ITMetricAggregator.java | 363 -
.../TimelineMetricClusterAggregatorSecondTest.java | 407 -
.../MetricCollectorHAControllerTest.java | 105 -
.../timeline/discovery/TestMetadataManager.java | 156 -
.../timeline/discovery/TestMetadataSync.java | 128 -
...TimelineMetricsSeriesAggregateFunctionTest.java | 188 -
.../timeline/query/DefaultConditionTest.java | 116 -
.../timeline/TestGenericObjectMapper.java | 102 -
.../timeline/TestLeveldbTimelineStore.java | 253 -
.../timeline/TestMemoryTimelineStore.java | 83 -
.../timeline/TimelineStoreTestUtils.java | 789 -
.../webapp/TestAHSWebApp.java | 199 -
.../webapp/TestAHSWebServices.java | 302 -
.../webapp/TestTimelineWebServices.java | 391 -
.../src/test/resources/loadsimulator/README | 2 +-
.../test/resources/test_data/full_whitelist.dat | 1615 +
.../test/resources/test_data/metric_blacklist.dat | 2 +
ambari-metrics/pom.xml | 45 +-
ambari-project/pom.xml | 39 +-
ambari-server/checkstyle.xml | 2 +-
ambari-server/conf/unix/ambari-env.sh | 4 +-
ambari-server/conf/unix/ambari.properties | 9 +-
ambari-server/conf/unix/log4j.properties | 3 +-
ambari-server/docs/api/generated/index.html | 57194 ++++++++++++-------
ambari-server/docs/api/generated/swagger.json | 4257 +-
ambari-server/docs/configuration/index.md | 6 -
.../docs/security/kerberos/enabling_kerberos.md | 94 +-
.../docs/security/kerberos/kerberos_service.md | 100 +-
ambari-server/docs/security/sso/index.md | 541 +
ambari-server/findbugs.exclude.xml | 25 +
ambari-server/pom.xml | 47 +-
ambari-server/src/main/assemblies/server.xml | 5 -
.../ambari/annotations/ExperimentalFeature.java | 13 +-
.../MessageDestinationIsNotDefinedException.java | 6 +-
.../server/actionmanager/ActionDBAccessorImpl.java | 11 +-
.../actionmanager/ExecutionCommandWrapper.java | 27 +-
.../ambari/server/agent/AgentReportsProcessor.java | 61 +-
.../ambari/server/agent/CommandRepository.java | 56 +
.../ambari/server/agent/ExecutionCommand.java | 41 +-
.../ambari/server/agent/HeartBeatHandler.java | 45 +-
.../ambari/server/agent/HeartBeatResponse.java | 4 +-
.../ambari/server/agent/HeartbeatMonitor.java | 83 +-
.../apache/ambari/server/agent/RecoveryConfig.java | 90 +-
.../server/agent/RecoveryConfigComponent.java | 118 +
.../ambari/server/agent/RecoveryConfigHelper.java | 59 +-
.../ambari/server/agent/RegistrationResponse.java | 3 +-
.../apache/ambari/server/agent/StatusCommand.java | 4 +-
.../server/agent/stomp/AgentClusterDataHolder.java | 62 +-
.../server/agent/stomp/AgentConfigsHolder.java | 6 +-
.../ambari/server/agent/stomp/AgentDataHolder.java | 21 +-
.../server/agent/stomp/AgentHostDataHolder.java | 64 +-
.../server/agent/stomp/AgentReportsController.java | 32 +-
.../server/agent/stomp/AlertDefinitionsHolder.java | 21 +-
.../server/agent/stomp/HostLevelParamsHolder.java | 93 +-
.../ambari/server/agent/stomp/MetadataHolder.java | 58 +-
.../ambari/server/agent/stomp/ReportsResponse.java | 24 +
.../ambari/server/agent/stomp/StompResponse.java | 42 +
.../ambari/server/agent/stomp/TopologyHolder.java | 40 +-
.../ambari/server/agent/stomp/dto/AckReport.java | 64 +
.../server/agent/stomp/dto/AlertCluster.java | 11 +-
.../agent/stomp/dto/ComponentStatusReport.java | 3 +-
.../stomp/dto/HashAndTimestampIgnoreMixIn.java | 32 +
.../server/agent/stomp/dto/HashIgnoreMixIn.java | 29 +
.../server/agent/stomp/dto/HostRepositories.java | 16 +-
.../server/agent/stomp/dto/MetadataCluster.java | 96 +-
.../agent/stomp/dto/MetadataServiceInfo.java | 24 +-
.../server/agent/stomp/dto/TopologyCluster.java | 31 +-
.../server/agent/stomp/dto/TopologyComponent.java | 16 +-
.../ambari/server/api/AmbariErrorHandler.java | 30 +-
.../api/query/render/ClusterBlueprintRenderer.java | 18 +-
.../ambari/server/api/services/AmbariMetaInfo.java | 46 +-
.../ambari/server/api/services/ClusterService.java | 5 +-
.../server/api/services/ConfigGroupService.java | 96 +-
.../server/api/services/ConfigurationService.java | 56 +-
.../server/api/services/HostComponentService.java | 182 +-
.../ambari/server/api/services/HostService.java | 7 +-
.../api/services/RequestScheduleService.java | 84 +-
.../server/api/services/RootServiceService.java | 6 +-
.../api/services/ServiceConfigVersionService.java | 48 +-
.../ambari/server/api/services/ServiceService.java | 4 +-
.../ambari/server/api/services/SettingService.java | 2 +-
.../server/api/services/ViewUrlsService.java | 140 -
.../mpackadvisor/commands/MpackAdvisorCommand.java | 11 +-
.../services/parsers/JsonRequestBodyParser.java | 6 +-
.../services/stackadvisor/StackAdvisorHelper.java | 9 +-
.../services/stackadvisor/StackAdvisorRequest.java | 1 +
.../ConfigurationRecommendationCommand.java | 23 +-
...leSignOnConfigurationRecommendationCommand.java | 121 -
.../stackadvisor/commands/StackAdvisorCommand.java | 22 +-
.../commands/StackAdvisorCommandType.java | 2 +
.../services/views/ViewDataMigrationService.java | 17 +-
.../api/services/views/ViewInstanceService.java | 161 +-
.../api/services/views/ViewPermissionService.java | 54 +-
.../api/services/views/ViewPrivilegeService.java | 143 +-
.../server/api/services/views/ViewService.java | 53 +-
.../server/api/services/views/ViewUrlsService.java | 214 +
.../api/services/views/ViewVersionService.java | 56 +-
.../eventcreator/ComponentEventCreator.java | 18 +-
.../request/eventcreator/HostEventCreator.java | 2 +-
.../eventcreator/PrivilegeEventCreator.java | 6 +-
.../eventcreator/ViewInstanceEventCreator.java | 20 +-
.../eventcreator/ViewPrivilegeEventCreator.java | 12 +-
.../ambari/server/checks/CheckDescription.java | 62 +-
.../server/checks/ComponentsExistInRepoCheck.java | 14 +-
.../KerberosAdminPersistedCredentialCheck.java | 132 +
.../server/checks/MissingOsInRepoVersionCheck.java | 107 +
.../ambari/server/cleanup/CleanupDriver.java | 3 +-
.../AmbariServerConfigurationKey.java | 14 +-
.../ambari/server/configuration/Configuration.java | 203 +-
.../server/configuration/SingleFileWatch.java | 95 +
.../configuration/spring/AgentStompConfig.java | 13 +-
.../configuration/spring/ApiSecurityConfig.java | 1 +
.../configuration/spring/ApiStompConfig.java | 7 +-
.../configuration/spring/GuiceBeansConfig.java | 6 +
.../configuration/spring/RootStompConfig.java | 17 +-
.../server/controller/ActionExecutionContext.java | 67 +
.../AmbariCustomCommandExecutionHelper.java | 104 +-
.../server/controller/AmbariHandlerList.java | 1 +
.../controller/AmbariManagementController.java | 53 +-
.../controller/AmbariManagementControllerImpl.java | 154 +-
.../ambari/server/controller/AmbariServer.java | 20 +-
.../server/controller/ConfigGroupRequest.java | 13 +
.../server/controller/ConfigGroupResponse.java | 18 +
.../server/controller/ConfigurationRequest.java | 12 +
.../server/controller/ConfigurationResponse.java | 12 +
.../server/controller/DeleteIdentityHandler.java | 1 -
.../controller/HostComponentProcessResponse.java | 7 +
.../server/controller/HostComponentSwagger.java | 88 +
.../ambari/server/controller/HostResponse.java | 2 +-
.../ambari/server/controller/KerberosDetails.java | 89 +
.../ambari/server/controller/KerberosHelper.java | 21 +
.../server/controller/KerberosHelperImpl.java | 250 +-
.../controller/OrderedRequestStageContainer.java | 4 -
.../server/controller/PrivilegeResponse.java | 25 +-
.../controller/RequestScheduleRequestSwagger.java | 113 +
.../controller/RequestScheduleResponseSwagger.java | 140 +
.../controller/ServiceComponentHostResponse.java | 20 +-
.../controller/ServiceConfigVersionRequest.java | 13 +-
.../controller/ServiceConfigVersionResponse.java | 21 +-
.../server/controller/ViewInstanceRequest.java | 23 +-
.../server/controller/ViewInstanceResponse.java | 21 +-
.../server/controller/ViewPermissionResponse.java | 14 +-
.../server/controller/ViewPrivilegeRequest.java | 12 +-
.../server/controller/ViewPrivilegeResponse.java | 12 +-
.../ambari/server/controller/ViewResponse.java | 6 +-
.../server/controller/ViewUrlResponseSwagger.java | 50 +
.../server/controller/ViewVersionResponse.java | 23 +-
.../ambari/server/controller/WidgetResponse.java | 10 +
.../internal/AbstractProviderModule.java | 12 +-
.../ActiveWidgetLayoutResourceProvider.java | 13 +-
.../internal/AlertGroupResourceProvider.java | 6 +-
.../internal/AmbariPrivilegeResourceProvider.java | 43 +-
.../internal/AmbariServerConfigurationHandler.java | 123 +-
.../AmbariServerLDAPConfigurationHandler.java | 48 +-
.../AmbariServerSSOConfigurationHandler.java | 249 +
.../internal/BlueprintConfigurationProcessor.java | 696 +-
.../internal/BlueprintResourceProvider.java | 34 +-
.../internal/ClientConfigResourceProvider.java | 104 +-
.../internal/ClusterPrivilegeResourceProvider.java | 31 +-
.../internal/ClusterResourceProvider.java | 14 +-
.../internal/ComponentResourceProvider.java | 259 +-
.../internal/ConfigGroupResourceProvider.java | 160 +-
.../internal/ConfigurationResourceProvider.java | 130 +-
.../DeleteHostComponentStatusMetaData.java | 17 +-
.../internal/ExportBlueprintRequest.java | 6 +-
.../internal/GroupPrivilegeResourceProvider.java | 77 +-
.../HostComponentProcessResourceProvider.java | 57 +-
.../internal/HostComponentResourceProvider.java | 372 +-
.../controller/internal/HostResourceProvider.java | 44 +-
.../internal/PrivilegeResourceProvider.java | 48 +-
.../internal/RequestResourceProvider.java | 93 +-
.../internal/RequestScheduleResourceProvider.java | 259 +-
.../RootServiceComponentConfigurationHandler.java | 11 +-
...erviceComponentConfigurationHandlerFactory.java | 16 +-
...viceComponentConfigurationResourceProvider.java | 10 +-
.../ServiceConfigVersionResourceProvider.java | 120 +-
.../internal/ServiceResourceProvider.java | 47 +-
.../internal/StackAdvisorResourceProvider.java | 2 +-
.../internal/UpgradeResourceProvider.java | 132 +-
.../UserAuthenticationSourceResourceProvider.java | 5 +-
.../UserAuthorizationResourceProvider.java | 30 +-
.../internal/UserPrivilegeResourceProvider.java | 77 +-
.../controller/internal/UserResourceProvider.java | 3 +-
.../internal/ViewInstanceResourceProvider.java | 184 +-
.../internal/ViewPermissionResourceProvider.java | 51 +-
.../internal/ViewPrivilegeResourceProvider.java | 56 +-
.../controller/internal/ViewResourceProvider.java | 20 +-
.../internal/ViewURLResourceProvider.java | 60 +-
.../internal/ViewVersionResourceProvider.java | 114 +-
.../internal/WidgetResourceProvider.java | 11 +
.../metrics/timeline/MetricsRequestHelper.java | 6 +-
.../cache/TimelineMetricsCacheSizeOfEngine.java | 3 +-
.../utilities/KerberosIdentityCleaner.java | 24 +-
.../controller/utilities/RemovableIdentities.java | 3 +
.../ambari/server/events/AgentActionEvent.java | 55 +
.../server/events/AgentConfigsUpdateEvent.java | 2 +-
.../events/AlertDefinitionsAgentUpdateEvent.java | 2 +-
.../events/AlertDefinitionsUIUpdateEvent.java | 2 +-
.../server/events/AlertGroupsUpdateEvent.java | 2 +-
.../ambari/server/events/AlertUpdateEvent.java | 2 +-
.../apache/ambari/server/events/AmbariEvent.java | 28 +-
.../server/events/AmbariHostUpdateEvent.java | 37 -
.../events/AmbariPropertiesChangedEvent.java | 31 +
.../ambari/server/events/AmbariUpdateEvent.java | 78 -
.../server/events/ClusterProvisionedEvent.java | 35 +
.../ambari/server/events/ConfigsUpdateEvent.java | 2 +-
.../server/events/DefaultMessageEmitter.java | 93 +-
.../server/events/ExecutionCommandEvent.java | 2 +-
.../server/events/HostComponentsUpdateEvent.java | 2 +-
.../server/events/HostLevelParamsUpdateEvent.java | 6 +-
.../ambari/server/events/HostRegisteredEvent.java | 9 +-
.../ambari/server/events/HostUpdateEvent.java | 2 +-
.../ambari/server/events/HostsRemovedEvent.java | 56 +-
.../ambari/server/events/MessageEmitter.java | 281 +-
.../ambari/server/events/MessageNotDelivered.java | 32 +
.../ambari/server/events/MetadataUpdateEvent.java | 18 +-
.../ambari/server/events/RequestUpdateEvent.java | 6 +-
.../apache/ambari/server/events/STOMPEvent.java | 79 +
.../ambari/server/events/STOMPHostEvent.java | 37 +
.../ServiceComponentRecoveryChangedEvent.java | 19 +-
.../events/ServiceCredentialStoreUpdateEvent.java | 52 +
.../ambari/server/events/ServiceUpdateEvent.java | 2 +-
.../server/events/TopologyAgentUpdateEvent.java | 2 +-
.../ambari/server/events/TopologyUpdateEvent.java | 16 +-
.../ambari/server/events/UpdateEventType.java | 1 -
.../ambari/server/events/UpgradeUpdateEvent.java | 2 +-
.../alerts/AlertDefinitionsUIUpdateListener.java | 23 +-
.../alerts/AlertGroupsUpdateListener.java | 20 +-
.../alerts/AlertMaintenanceModeListener.java | 35 +-
.../listeners/alerts/AlertReceivedListener.java | 6 +-
.../HostComponentsUpdateListener.java | 14 +-
.../events/listeners/hosts/HostUpdateListener.java | 16 +-
.../listeners/requests/STOMPUpdateListener.java | 55 +
.../listeners/requests/StateUpdateListener.java | 50 -
.../listeners/services/ServiceUpdateListener.java | 14 +-
.../events/listeners/tasks/TaskStatusListener.java | 10 +-
.../upgrade/StackUpgradeFinishListener.java | 7 +
.../listeners/upgrade/UpgradeUpdateListener.java | 12 +-
.../events/publishers/AgentCommandsPublisher.java | 4 +-
.../events/publishers/STOMPUpdatePublisher.java | 66 +
.../publishers/StateUpdateEventPublisher.java | 66 -
.../ambari/server/hooks/users/UserHookService.java | 1 -
.../server/metadata/ClusterMetadataGenerator.java | 30 +-
.../metrics/system/impl/AmbariMetricSinkImpl.java | 15 +-
.../metrics/system/impl/MetricsServiceImpl.java | 6 +-
.../system/impl/StompEventsMetricsSource.java | 12 +-
.../apache/ambari/server/orm/DBAccessorImpl.java | 71 +-
.../ambari/server/orm/dao/AlertDefinitionDAO.java | 6 +-
.../ambari/server/orm/dao/AlertDispatchDAO.java | 16 +-
.../server/orm/dao/HostConfigMappingDAO.java | 12 +-
.../ambari/server/orm/dao/HostRoleCommandDAO.java | 19 +-
.../apache/ambari/server/orm/dao/RequestDAO.java | 98 +-
.../ambari/server/orm/dao/TopologyRequestDAO.java | 6 +
.../server/orm/entities/HostRoleCommandEntity.java | 5 +-
.../server/orm/entities/RepoDefinitionEntity.java | 30 +-
.../server/orm/entities/TopologyRequestEntity.java | 3 +-
.../ambari/server/orm/entities/UpgradeEntity.java | 9 +
.../orm/entities/UserAuthenticationEntity.java | 21 +-
.../ambari/server/orm/entities/UserEntity.java | 19 +-
.../ambari/server/orm/entities/WidgetEntity.java | 17 +
.../server/orm/helpers/dbms/GenericDbmsHelper.java | 14 +-
.../ambari/server/security/CertificateManager.java | 44 +-
.../AmbariBasicAuthenticationFilter.java | 2 +
.../AmbariLocalAuthenticationProvider.java | 7 +-
.../authentication/AmbariUserAuthentication.java | 37 +-
.../security/authentication/AmbariUserDetails.java | 86 +
.../jwt/AmbariJwtAuthenticationFilter.java | 123 +-
.../jwt/AmbariJwtAuthenticationProvider.java | 10 +-
.../jwt/JwtAuthenticationProperties.java | 9 +
.../jwt/JwtAuthenticationPropertiesProvider.java | 179 +
.../AmbariAuthToLocalUserDetailsService.java | 11 +-
.../AmbariKerberosAuthenticationFilter.java | 2 +
.../pam/AmbariPamAuthenticationProvider.java | 6 +-
.../authorization/AmbariAuthorizationFilter.java | 2 +
.../AmbariLdapAuthenticationProvider.java | 6 +-
.../AmbariUserAuthorizationFilter.java | 11 +-
.../authorization/AuthorizationHelper.java | 12 +-
.../ambari/server/security/authorization/User.java | 2 +-
.../authorization/UserIdAuthentication.java | 24 -
.../unsecured/rest/CertificateDownload.java | 4 +-
.../server/serveraction/AbstractServerAction.java | 15 +-
.../ConfigureAmbariIdentitiesServerAction.java | 14 +-
.../kerberos/DestroyPrincipalsServerAction.java | 1 +
.../kerberos/FinalizeKerberosServerAction.java | 27 +-
.../server/serveraction/kerberos/KDCType.java | 8 +
.../upgrades/AbstractUpgradeServerAction.java | 10 +
.../serveraction/upgrades/AddComponentAction.java | 154 +
.../upgrades/ComponentVersionCheckAction.java | 1 +
.../serveraction/upgrades/ConfigureAction.java | 112 +-
.../upgrades/CreateZeppelinSiteConfig.java | 90 +
.../DeleteUnsupportedServicesAndComponents.java | 117 +
.../upgrades/OozieConfigCalculation.java | 105 +-
.../org/apache/ambari/server/stack/HostsType.java | 20 +-
.../ambari/server/stack/MasterHostResolver.java | 45 +-
.../org/apache/ambari/server/stack/RepoUtil.java | 11 +-
.../apache/ambari/server/stack/ServiceModule.java | 3 +
.../apache/ambari/server/stack/StackManager.java | 10 +-
.../apache/ambari/server/stack/StackModule.java | 120 +
.../ambari/server/stack/StackServiceDirectory.java | 8 +
.../org/apache/ambari/server/state/Clusters.java | 10 +-
.../apache/ambari/server/state/ConfigHelper.java | 156 +-
.../ambari/server/state/ConfigMergeHelper.java | 15 +-
.../apache/ambari/server/state/RepositoryInfo.java | 23 +
.../ambari/server/state/ServiceComponent.java | 2 +
.../ambari/server/state/ServiceComponentImpl.java | 5 +-
.../server/state/ServiceComponentSupport.java | 112 +
.../apache/ambari/server/state/ServiceImpl.java | 20 +-
.../org/apache/ambari/server/state/StackInfo.java | 8 +
.../apache/ambari/server/state/UpgradeContext.java | 65 +
.../apache/ambari/server/state/UpgradeHelper.java | 119 +-
.../ambari/server/state/alert/MetricSource.java | 6 +-
.../ambari/server/state/cluster/ClusterImpl.java | 44 +-
.../ambari/server/state/cluster/ClustersImpl.java | 76 +-
.../server/state/configgroup/ConfigGroupImpl.java | 6 +-
.../apache/ambari/server/state/host/HostImpl.java | 30 +-
.../ambari/server/state/stack/UpgradePack.java | 62 +-
.../state/stack/upgrade/AddComponentTask.java | 138 +
.../state/stack/upgrade/ClusterGrouping.java | 35 +-
.../upgrade/ConfigUpgradeChangeDefinition.java | 125 +-
.../server/state/stack/upgrade/ConfigureTask.java | 4 +-
.../state/stack/upgrade/RegenerateKeytabsTask.java | 81 +
.../state/stack/upgrade/SecurityCondition.java | 53 +-
.../state/stack/upgrade/ServerSideActionTask.java | 4 +
.../server/state/stack/upgrade/StageWrapper.java | 3 +-
.../ambari/server/state/stack/upgrade/Task.java | 53 +-
.../svccomphost/ServiceComponentHostImpl.java | 46 +-
.../ambari/server/topology/AmbariContext.java | 15 +-
.../topology/ClusterConfigurationRequest.java | 11 +-
.../server/topology/ClusterTopologyImpl.java | 4 +-
.../ambari/server/topology/Configuration.java | 37 +
.../topology/STOMPComponentsDeleteHandler.java | 147 +
.../server/topology/TopologyDeleteFormer.java | 102 -
.../ambari/server/topology/TopologyManager.java | 3 +
.../topology/validators/HiveServiceValidator.java | 2 +-
.../ambari/server/update/HostUpdateHelper.java | 3 +-
.../server/upgrade/AbstractUpgradeCatalog.java | 11 +-
.../ambari/server/upgrade/UpgradeCatalog270.java | 527 +-
.../utils/ScheduledExecutorCompletionService.java | 58 +
.../org/apache/ambari/server/utils/StageUtils.java | 110 +-
.../apache/ambari/server/view/ViewRegistry.java | 6 +
ambari-server/src/main/python/ambari-server.py | 13 +-
.../src/main/python/ambari_server/serverSetup.py | 46 +-
.../src/main/python/ambari_server/serverUpgrade.py | 22 +-
.../src/main/python/ambari_server/serverUtils.py | 188 +-
.../src/main/python/ambari_server/setupMpacks.py | 13 +-
.../src/main/python/ambari_server/setupSecurity.py | 77 +-
.../src/main/python/ambari_server/setupSso.py | 323 +-
.../src/main/python/ambari_server/utils.py | 74 +-
.../src/main/python/azuredb_create_generator.py | 3 +-
.../src/main/resources/Ambari-DDL-Derby-CREATE.sql | 20 +-
.../src/main/resources/Ambari-DDL-MySQL-CREATE.sql | 24 +-
.../main/resources/Ambari-DDL-Oracle-CREATE.sql | 20 +-
.../main/resources/Ambari-DDL-Postgres-CREATE.sql | 20 +-
.../resources/Ambari-DDL-SQLAnywhere-CREATE.sql | 20 +-
.../main/resources/Ambari-DDL-SQLServer-CREATE.sql | 20 +-
.../package/scripts/accumulo_configuration.py | 12 +-
.../ACCUMULO/1.6.1.2.2.0/package/scripts/params.py | 8 +-
.../hadoop-metrics2-accumulo.properties.j2 | 3 +
.../0.1.0/configuration/infra-solr-env.xml | 55 +-
.../configuration/infra-solr-security-json.xml | 12 +-
.../0.1.0/configuration/infra-solr-xml.xml | 2 +-
.../AMBARI_INFRA_SOLR/0.1.0/metainfo.xml | 27 +-
.../0.1.0/package/scripts/collection.py | 303 +-
.../0.1.0/package/scripts/command_commons.py | 283 +-
.../0.1.0/package/scripts/infra_solr.py | 46 +-
.../0.1.0/package/scripts/infra_solr_client.py | 9 +-
.../0.1.0/package/scripts/migrate.py | 12 +-
.../0.1.0/package/scripts/params.py | 22 +
.../0.1.0/package/scripts/setup_infra_solr.py | 35 +-
.../package/templates/infra-solr-security.json.j2 | 12 +
.../0.1.0/package/templates/infra-solr.conf.j2 | 17 +
.../0.1.0/properties/infra-solr-env.sh.j2 | 28 +-
.../AMBARI_INFRA_SOLR/0.1.0/properties/solr.xml.j2 | 96 +
.../AMBARI_INFRA_SOLR/0.1.0/service_advisor.py | 6 +-
.../AMBARI_METRICS/0.1.0/configuration/ams-env.xml | 8 +
.../0.1.0/configuration/ams-hbase-env.xml | 2 +-
.../0.1.0/configuration/ams-hbase-site.xml | 19 +-
.../0.1.0/configuration/ams-site.xml | 90 +-
.../AMBARI_METRICS/0.1.0/metainfo.xml | 27 +-
.../HDP/grafana-infra-solr-collections.json | 2088 +
.../HDP/grafana-infra-solr-cores.json | 2113 +
.../HDP/grafana-infra-solr-hosts.json | 1184 +
.../AMBARI_METRICS/0.1.0/package/scripts/ams.py | 74 +-
.../0.1.0/package/scripts/hbase_service.py | 4 +
.../0.1.0/package/scripts/metrics_monitor.py | 6 +
.../AMBARI_METRICS/0.1.0/package/scripts/params.py | 35 +-
.../0.1.0/package/scripts/params_linux.py | 2 +-
.../templates/hadoop-metrics2-hbase.properties.j2 | 100 +-
.../0.1.0/package/templates/metric_monitor.ini.j2 | 5 +-
.../package/templates/smoketest_metrics.json.j2 | 1 -
.../AMBARI_METRICS/0.1.0/service_advisor.py | 25 +-
.../ATLAS/0.1.0.2.3/package/scripts/params.py | 2 +-
.../common-services/DRUID/0.10.1/metainfo.xml | 2 +-
.../DRUID/0.10.1/package/scripts/druid.py | 2 +-
.../DRUID/0.10.1/package/scripts/params.py | 2 +-
.../0.5.0.2.1/package/scripts/params_linux.py | 2 +-
.../FLUME/1.4.0.2.0/package/scripts/params.py | 6 +
.../package/templates/flume-metrics2.properties.j2 | 3 +
.../common-services/GANGLIA/3.5.0/metainfo.xml | 4 +-
.../HAWQ/2.0.0/package/scripts/params.py | 4 +-
.../0.96.0.2.0/package/scripts/hbase_service.py | 4 +
.../0.96.0.2.0/package/scripts/params_linux.py | 8 +-
.../package/scripts/phoenix_queryserver.py | 5 +
.../0.96.0.2.0/package/scripts/phoenix_service.py | 2 +-
...oop-metrics2-hbase.properties-GANGLIA-MASTER.j2 | 3 +
.../hadoop-metrics2-hbase.properties-GANGLIA-RS.j2 | 3 +
.../HDFS/2.1.0.2.0/configuration/core-site.xml | 10 +
.../HDFS/2.1.0.2.0/configuration/hdfs-log4j.xml | 3 +
.../common-services/HDFS/2.1.0.2.0/metainfo.xml | 3 +-
.../alerts/alert_datanode_unmounted_data_dir.py | 1 +
.../package/alerts/alert_metrics_deviation.py | 24 +-
.../2.1.0.2.0/package/scripts/hdfs_namenode.py | 18 +-
.../HDFS/2.1.0.2.0/package/scripts/journalnode.py | 2 +-
.../HDFS/2.1.0.2.0/package/scripts/namenode.py | 32 +-
.../2.1.0.2.0/package/scripts/namenode_ha_state.py | 140 +-
.../HDFS/2.1.0.2.0/package/scripts/params_linux.py | 80 +-
.../HDFS/2.1.0.2.0/package/scripts/utils.py | 4 +
.../HDFS/2.1.0.2.0/package/scripts/zkfc_slave.py | 26 +-
.../common-services/HIVE/0.12.0.2.0/metainfo.xml | 6 +-
.../HIVE/0.12.0.2.0/package/scripts/hive.py | 5 +-
.../0.12.0.2.0/package/scripts/hive_interactive.py | 2 +-
.../0.12.0.2.0/package/scripts/hive_service.py | 4 +
.../0.12.0.2.0/package/scripts/params_linux.py | 9 +-
.../HIVE/0.12.0.2.0/package/scripts/pre_upgrade.py | 107 +
.../hadoop-metrics2-hivemetastore.properties.j2 | 4 +-
.../hadoop-metrics2-hiveserver2.properties.j2 | 3 +
.../templates/hadoop-metrics2-llapdaemon.j2 | 3 +
.../templates/hadoop-metrics2-llaptaskscheduler.j2 | 3 +
.../KAFKA/0.8.1/configuration/kafka-broker.xml | 5 +
.../common-services/KAFKA/0.8.1/metainfo.xml | 2 +-
.../KAFKA/0.8.1/package/scripts/kafka.py | 19 +-
.../KAFKA/0.8.1/package/scripts/params.py | 14 +-
.../KAFKA/0.8.1/package/scripts/service_check.py | 31 +-
.../0.8.1/package/scripts/setup_ranger_kafka.py | 10 +-
.../package/templates/input.config-kafka.json.j2 | 2 +-
.../KERBEROS/1.10.3-10/metainfo.xml | 2 +-
.../1.10.3-10/package/scripts/service_check.py | 5 +-
.../KERBEROS/1.10.3-30/metainfo.xml | 2 +-
.../1.10.3-30/package/scripts/service_check.py | 5 +-
.../KNOX/0.5.0.2.2/package/scripts/params_linux.py | 6 +-
.../0.5.0.2.2/package/scripts/service_check.py | 4 +-
.../0.5.0.2.2/package/scripts/setup_ranger_knox.py | 10 +-
.../common-services/LOGSEARCH/0.5.0/alerts.json | 46 +-
.../0.5.0/configuration/logfeeder-env.xml | 22 +
.../0.5.0/configuration/logfeeder-properties.xml | 12 +
.../0.5.0/configuration/logsearch-properties.xml | 20 +-
.../common-services/LOGSEARCH/0.5.0/metainfo.xml | 27 +-
.../0.5.0/package/alerts/alert_logfeeder.py | 85 +
.../LOGSEARCH/0.5.0/package/scripts/logfeeder.py | 9 +-
.../LOGSEARCH/0.5.0/package/scripts/logsearch.py | 9 +
.../LOGSEARCH/0.5.0/package/scripts/params.py | 12 +-
.../0.5.0/package/scripts/setup_logfeeder.py | 2 +
.../0.5.0/package/scripts/setup_logsearch.py | 6 +-
.../templates/input.config-logsearch.json.j2 | 2 +-
.../0.5.0/properties/audit_logs-solrconfig.xml.j2 | 2 +-
.../0.5.0/properties/input.config-ambari.json.j2 | 286 +-
.../LOGSEARCH/0.5.0/properties/logfeeder-env.sh.j2 | 3 +-
.../0.5.0/properties/logfeeder-log4j.xml.j2 | 13 +-
.../LOGSEARCH/0.5.0/properties/logsearch-env.sh.j2 | 3 +-
.../properties/service_logs-solrconfig.xml.j2 | 2 +-
.../LOGSEARCH/0.5.0/service_advisor.py | 40 +-
.../MAHOUT/1.0.0.2.3/package/scripts/params.py | 2 +-
.../common-services/OOZIE/4.0.0.2.0/metainfo.xml | 2 +-
.../OOZIE/4.0.0.2.0/package/scripts/oozie.py | 2 +-
.../4.0.0.2.0/package/scripts/oozie_service.py | 2 +-
.../4.0.0.2.0/package/scripts/params_linux.py | 2 +-
.../common-services/OOZIE/4.2.0.2.3/metainfo.xml | 2 +-
.../PIG/0.12.0.2.0/package/scripts/params_linux.py | 2 +-
.../PXF/3.0.0/package/scripts/params.py | 4 +-
.../RANGER/0.4.0/configuration/ranger-env.xml | 2 +-
.../common-services/RANGER/0.4.0/metainfo.xml | 2 +-
.../RANGER/0.4.0/package/scripts/ranger_tagsync.py | 21 +-
.../0.4.0/package/scripts/setup_ranger_xml.py | 86 +-
.../common-services/RANGER/0.6.0/metainfo.xml | 2 +-
.../RANGER_KMS/0.5.0.2.3/package/scripts/kms.py | 24 +-
.../RANGER_KMS/0.5.0.2.3/package/scripts/params.py | 4 +-
.../0.60.0.2.2/package/scripts/params_linux.py | 5 +-
.../common-services/SPARK/1.2.1/metainfo.xml | 2 +-
.../SPARK/1.2.1/package/scripts/livy_server.py | 7 +-
.../SPARK/1.2.1/package/scripts/params.py | 2 +-
.../common-services/SPARK2/2.0.0/metainfo.xml | 2 +-
.../SPARK2/2.0.0/package/scripts/livy2_server.py | 7 +-
.../SPARK2/2.0.0/package/scripts/params.py | 2 +-
.../STORM/0.9.1/package/scripts/params_linux.py | 44 +-
.../STORM/0.9.1/package/scripts/params_windows.py | 6 -
.../0.9.1/package/scripts/setup_ranger_storm.py | 21 +-
.../STORM/0.9.1/package/templates/config.yaml.j2 | 7 +-
.../package/templates/input.config-storm.json.j2 | 79 +-
.../package/templates/storm-metrics2.properties.j2 | 3 +
.../common-services/STORM/0.9.3/metainfo.xml | 2 +-
.../common-services/SUPERSET/0.15.0/metainfo.xml | 2 +-
.../TEZ/0.4.0.2.1/package/scripts/params_linux.py | 2 +-
.../YARN/2.1.0.2.0/package/scripts/params_linux.py | 11 +-
.../2.1.0.2.0/package/scripts/resourcemanager.py | 2 +-
.../YARN/2.1.0.2.0/package/scripts/service.py | 4 +
.../templates/input.config-mapreduce2.json.j2 | 18 +-
.../0.6.0/package/scripts/alert_check_zeppelin.py | 3 +-
.../ZEPPELIN/0.6.0/package/scripts/params.py | 4 +-
.../0.7.0/package/scripts/alert_check_zeppelin.py | 3 +-
.../ZEPPELIN/0.7.0/package/scripts/params.py | 4 +-
.../ZEPPELIN/0.7.0/service_advisor.py | 2 +-
.../common-services/ZOOKEEPER/3.4.6/metainfo.xml | 2 +-
.../common-services/ZOOKEEPER/3.4.9/metainfo.xml | 2 +-
.../ZOOKEEPER/3.4.9/service_advisor.py | 2 +-
.../resources/custom_actions/scripts/check_host.py | 35 +-
.../resources/custom_actions/scripts/ru_set_all.py | 151 -
.../custom_actions/scripts/stack_select_set_all.py | 116 +
.../src/main/resources/scripts/Ambaripreupload.py | 29 +-
.../src/main/resources/scripts/configs.py | 40 +-
.../src/main/resources/scripts/stack_advisor.py | 6 +
.../resources/scripts/takeover_files_mapping.json | 3 +-
.../src/main/resources/slider_resources/README.txt | 17 -
.../stack-hooks/after-INSTALL/scripts/params.py | 13 +-
.../after-INSTALL/scripts/shared_initialization.py | 11 +-
.../stack-hooks/before-ANY/scripts/params.py | 45 +-
.../stack-hooks/before-SET_KEYTAB/scripts/hook.py | 38 +
.../before-START/files/fast-hdfs-resource.jar | Bin 28296600 -> 19286899 bytes
.../stack-hooks/before-START/scripts/params.py | 6 +
.../before-START/scripts/shared_initialization.py | 11 +-
.../templates/hadoop-metrics2.properties.j2 | 3 +
.../0.8/services/HIVE/package/scripts/hive.py | 2 +-
.../0.8/services/OOZIE/package/scripts/oozie.py | 2 +-
.../HDP/2.0.6/properties/stack_packages.json | 6 -
.../STORM/package/templates/config.yaml.j2 | 48 +-
.../stacks/HDP/2.1/services/HIVE/metainfo.xml | 6 +-
.../stacks/HDP/2.1/services/OOZIE/metainfo.xml | 2 +-
.../stacks/HDP/2.2/services/FALCON/metainfo.xml | 2 +-
.../stacks/HDP/2.2/services/FLUME/metainfo.xml | 2 +-
.../stacks/HDP/2.2/services/HBASE/metainfo.xml | 2 +-
.../stacks/HDP/2.2/services/HDFS/metainfo.xml | 2 +-
.../stacks/HDP/2.2/services/HIVE/metainfo.xml | 8 +-
.../stacks/HDP/2.2/services/KNOX/metainfo.xml | 2 +-
.../stacks/HDP/2.2/services/OOZIE/metainfo.xml | 2 +-
.../stacks/HDP/2.2/services/PIG/metainfo.xml | 2 +-
.../stacks/HDP/2.2/services/SLIDER/metainfo.xml | 2 +-
.../stacks/HDP/2.2/services/SQOOP/metainfo.xml | 2 +-
.../stacks/HDP/2.2/services/TEZ/metainfo.xml | 2 +-
.../stacks/HDP/2.2/services/YARN/metainfo.xml | 4 +-
.../2.3.ECS/services/ECS/package/scripts/params.py | 2 +-
.../HDP/2.3.ECS/services/ZOOKEEPER/metainfo.xml | 2 +-
.../stacks/HDP/2.3/services/ACCUMULO/metainfo.xml | 2 +-
.../stacks/HDP/2.3/services/ATLAS/metainfo.xml | 2 +-
.../stacks/HDP/2.3/services/HDFS/metainfo.xml | 2 +-
.../stacks/HDP/2.3/services/HIVE/metainfo.xml | 8 +-
.../stacks/HDP/2.3/services/PIG/metainfo.xml | 2 +-
.../HDP/2.3/services/RANGER_KMS/metainfo.xml | 2 +-
.../stacks/HDP/2.5/role_command_order.json | 7 +-
.../stacks/HDP/2.5/services/ATLAS/metainfo.xml | 2 +-
.../stacks/HDP/2.5/services/FALCON/metainfo.xml | 2 +-
.../stacks/HDP/2.5/services/HIVE/kerberos.json | 4 +-
.../stacks/HDP/2.5/services/HIVE/metainfo.xml | 8 +-
.../RANGER_KMS/themes/theme_version_2.json | 1 +
.../stacks/HDP/2.5/services/SPARK/metainfo.xml | 2 +-
.../stacks/HDP/2.5/services/ZEPPELIN/metainfo.xml | 2 +-
.../2.6/services/ATLAS/configuration/atlas-env.xml | 2 +-
.../stacks/HDP/2.6/services/ATLAS/metainfo.xml | 6 +
.../stacks/HDP/2.6/services/FALCON/metainfo.xml | 2 +-
.../configuration/hadoop-metrics2.properties.xml | 3 +
.../stacks/HDP/2.6/services/OOZIE/metainfo.xml | 2 +-
.../stacks/HDP/2.6/services/RANGER/metainfo.xml | 6 +
.../services/SPARK2/configuration/livy2-env.xml | 10 +
.../stacks/HDP/2.6/services/SPARK2/metainfo.xml | 2 +-
.../stacks/HDP/2.6/services/YARN/kerberos.json | 2 +-
.../stacks/HDP/2.6/services/ZEPPELIN/metainfo.xml | 2 +-
.../stacks/HDP/2.6/services/stack_advisor.py | 124 +-
.../resources/stacks/PERF/1.0/hdp_urlinfo.json | 4 +-
.../resources/stacks/PERF/1.0/repos/repoinfo.xml | 86 +-
.../configuration/hadoop-metrics2.properties.xml | 5 +
.../src/main/resources/stacks/PERF/1.0/vdf.xml | 6 +-
.../resources/stacks/PERF/2.0/hdp_urlinfo.json | 4 +-
.../resources/stacks/PERF/2.0/repos/repoinfo.xml | 86 +-
.../src/main/resources/stacks/PERF/2.0/vdf.xml | 6 +-
.../resources/stacks/PERF/install_packages.sed | 17 +-
.../main/resources/stacks/ambari_configuration.py | 142 +-
.../src/main/resources/stacks/service_advisor.py | 157 +-
.../src/main/resources/stacks/stack_advisor.py | 141 +-
.../src/main/resources/upgrade-config.xsd | 24 +-
ambari-server/src/main/resources/upgrade-pack.xsd | 36 +-
.../src/main/resources/version_definition.xsd | 2 +
ambari-server/src/main/resources/widgets.json | 4 +-
.../actionmanager/ExecutionCommandWrapperTest.java | 9 +
.../ambari/server/agent/AgentResourceTest.java | 2 +
.../ambari/server/agent/TestHeartbeatHandler.java | 29 +-
.../server/agent/stomp/AgentDataHolderTest.java | 104 +
.../agent/stomp/dto/MetadataClusterTest.java | 144 +
.../ambari/server/api/AmbariErrorHandlerTest.java | 16 +-
.../api/resources/BaseResourceDefinitionTest.java | 6 +-
.../server/api/services/AmbariMetaInfoTest.java | 7 +-
.../stackadvisor/StackAdvisorHelperTest.java | 47 +-
.../stackadvisor/StackAdvisorRequestTypeTest.java | 25 +-
.../ConfigurationRecommendationCommandTest.java | 2 +-
.../commands/StackAdvisorCommandTest.java | 12 +-
.../request/creator/AuditEventCreatorTestBase.java | 5 +
.../request/creator/ComponentEventCreatorTest.java | 34 +-
.../request/creator/HostEventCreatorTest.java | 2 +-
.../request/creator/PrivilegeEventCreatorTest.java | 24 +-
.../creator/ViewInstanceEventCreatorTest.java | 20 +-
.../creator/ViewPrivilegeEventCreatorTest.java | 24 +-
.../KerberosAdminPersistedCredentialCheckTest.java | 255 +
.../checks/MissingOsInRepoVersionCheckTest.java | 138 +
.../configuration/RecoveryConfigHelperTest.java | 85 +-
.../server/configuration/SingleFileWatchTest.java | 81 +
.../AmbariCustomCommandExecutionHelperTest.java | 102 +
.../server/controller/AmbariHandlerListTest.java | 16 +-
.../AmbariManagementControllerImplTest.java | 1 -
.../controller/AmbariManagementControllerTest.java | 23 +-
.../server/controller/KerberosHelperTest.java | 125 +-
.../AbstractControllerResourceProviderTest.java | 6 +-
.../internal/AbstractResourceProviderTest.java | 6 +-
.../ActiveWidgetLayoutResourceProviderTest.java | 13 +-
.../AmbariPrivilegeResourceProviderTest.java | 98 +-
.../AmbariServerConfigurationHandlerTest.java | 197 +-
.../AmbariServerSSOConfigurationHandlerTest.java | 226 +
.../internal/BlueprintResourceProviderTest.java | 94 +-
.../internal/ClientConfigResourceProviderTest.java | 132 +-
.../ClusterPrivilegeResourceProviderTest.java | 32 +-
.../internal/ComponentResourceProviderTest.java | 116 +-
.../internal/ConfigGroupResourceProviderTest.java | 146 +-
.../ConfigurationResourceProviderTest.java | 36 +-
.../GroupPrivilegeResourceProviderTest.java | 28 +-
.../HostComponentProcessResourceProviderTest.java | 26 +-
.../HostComponentResourceProviderTest.java | 135 +-
.../internal/HostResourceProviderTest.java | 3 +-
.../controller/internal/JMXHostProviderTest.java | 6 +-
.../internal/RequestResourceProviderTest.java | 25 +-
.../RequestScheduleResourceProviderTest.java | 90 +-
...ComponentConfigurationResourceProviderTest.java | 47 +-
.../internal/ServiceResourceProviderTest.java | 42 +-
...erAuthenticationSourceResourceProviderTest.java | 13 +-
.../UserAuthorizationResourceProviderTest.java | 34 +-
.../UserPrivilegeResourceProviderTest.java | 34 +-
.../internal/UserResourceProviderTest.java | 3 +-
.../internal/ViewInstanceResourceProviderTest.java | 30 +-
.../ViewPrivilegeResourceProviderTest.java | 8 +-
.../internal/ViewURLResourceProviderTest.java | 46 +-
.../metrics/timeline/AMSPropertyProviderTest.java | 70 +-
.../metrics/timeline/MetricsPaddingMethodTest.java | 14 +-
.../cache/TimelineMetricCacheSizingTest.java | 1 -
.../utilities/KerberosIdentityCleanerTest.java | 22 +
.../apache/ambari/server/events/EventsTest.java | 1 +
.../listeners/tasks/TaskStatusListenerTest.java | 4 +-
.../upgrade/AlertMaintenanceModeListenerTest.java | 63 +-
.../metric/system/impl/MetricsSourceTest.java | 17 +
.../system/impl/TestAmbariMetricsSinkImpl.java | 5 +
.../ambari/server/orm/DBAccessorImplTest.java | 54 +
.../server/orm/InMemoryDefaultTestModule.java | 2 +-
.../server/security/CertificateManagerTest.java | 38 +
.../server/security/SecurityHelperImplTest.java | 3 +-
.../server/security/TestAuthenticationFactory.java | 78 +-
.../AmbariLocalAuthenticationProviderTest.java | 3 +-
.../jwt/AmbariJwtAuthenticationFilterTest.java | 138 +-
.../AmbariAuthToLocalUserDetailsServiceTest.java | 27 +-
.../AmbariAuthorizationFilterTest.java | 5 +-
.../authorization/AuthorizationHelperTest.java | 3 +-
.../security/ldap/AmbariLdapDataPopulatorTest.java | 3 +-
.../kerberos/FinalizeKerberosServerActionTest.java | 13 +-
.../upgrades/AddComponentActionTest.java | 199 +
.../upgrades/KerberosKeytabsActionTest.java | 4 +-
.../upgrades/OozieConfigCalculationTest.java | 152 +
.../ambari/server/stack/StackManagerMock.java | 22 +-
.../ambari/server/state/ConfigHelperTest.java | 77 +-
.../server/state/ServiceComponentSupportTest.java | 122 +
.../ambari/server/state/cluster/ClusterTest.java | 4 +
.../ambari/server/state/cluster/ClustersTest.java | 8 +-
.../apache/ambari/server/state/host/HostTest.java | 3 +
.../KerberosDescriptorUpdateHelperTest.java | 2 +
.../ambari/server/state/stack/UpgradePackTest.java | 1 +
.../server/testutils/PartialNiceMockBinder.java | 2 +
.../ambari/server/topology/ConfigurationTest.java | 47 +
.../server/topology/TopologyManagerTest.java | 3 +
.../ambari/server/update/HostUpdateHelperTest.java | 2 +
.../server/upgrade/UpgradeCatalog252Test.java | 10 +
.../server/upgrade/UpgradeCatalog260Test.java | 26 +-
.../server/upgrade/UpgradeCatalog270Test.java | 419 +-
.../utils/ManagedThreadPoolExecutorTest.java | 64 +-
.../ambari/server/utils/PasswordUtilsTest.java | 2 +
.../apache/ambari/server/utils/StageUtilsTest.java | 28 +-
.../ambari/server/view/ViewRegistryTest.java | 35 +-
ambari-server/src/test/python/TestAmbariServer.py | 33 +-
ambari-server/src/test/python/TestMpacks.py | 8 +-
.../src/test/python/TestResourceFilesKeeper.py | 2 +-
ambari-server/src/test/python/TestServerUpgrade.py | 4 +-
ambari-server/src/test/python/TestServerUtils.py | 71 +-
.../src/test/python/TestServiceAdvisor.py | 72 +
ambari-server/src/test/python/TestSetupSso.py | 431 +-
ambari-server/src/test/python/TestStackFeature.py | 24 +-
ambari-server/src/test/python/TestStackSelect.py | 12 +-
.../src/test/python/TestUpgradeSummary.py | 12 +-
.../AMBARI_METRICS/test_service_advisor.py | 12 +-
.../python/common-services/HAWQ/test_hawqmaster.py | 6 +-
.../LOGSEARCH/test_service_advisor.py | 123 +-
.../common-services/configs/hawq_default.json | 6 +-
.../common-services/configs/hive_default.json | 6 +-
.../configs/hive_unsupported_jdbc_type.json | 6 +-
.../common-services/configs/pxf_default.json | 6 +-
.../configs/ranger_admin_default.json | 6 +-
.../ranger_admin_unsupported_db_flavor.json | 2 +-
.../configs/ranger_kms_default.json | 6 +-
.../configs/ranger_kms_unsupported_db_flavor.json | 6 +-
.../common-services/configs/sqoop_default.json | 6 +-
.../configs/sqoop_unsupported_jdbc_driver.json | 2 +-
.../test/python/custom_actions/TestCheckHost.py | 9 +
.../configs/install_packages_config.json | 6 +-
.../configs/install_packages_repository_file.json | 6 +-
.../configs/remove_previous_stacks.json | 6 +-
.../test/python/custom_actions/test_ru_set_all.py | 272 -
.../custom_actions/test_stack_select_set_all.py | 343 +
ambari-server/src/test/python/hdfs.json | 2689 +
.../2.0.6/AMBARI_METRICS/test_metrics_collector.py | 3 +-
.../2.0.6/AMBARI_METRICS/test_metrics_monitor.py | 142 +
.../HDFS/test_alert_datanode_unmounted_data_dir.py | 23 +-
.../2.0.6/HDFS/test_alert_metrics_deviation.py | 112 +-
.../test/python/stacks/2.0.6/HDFS/test_namenode.py | 47 +-
.../stacks/2.0.6/HIVE/test_hive_metastore.py | 22 +-
.../python/stacks/2.0.6/HIVE/test_hive_server.py | 12 +-
.../python/stacks/2.0.6/OOZIE/test_oozie_server.py | 6 +-
.../test/python/stacks/2.0.6/SQOOP/test_sqoop.py | 4 +-
.../stacks/2.0.6/configs/altfs_plus_hdfs.json | 6 +-
.../stacks/2.0.6/configs/client-upgrade.json | 6 +-
.../stacks/2.0.6/configs/default.hbasedecom.json | 6 +-
.../test/python/stacks/2.0.6/configs/default.json | 11 +-
.../2.0.6/configs/default.non_gmetad_host.json | 6 +-
.../stacks/2.0.6/configs/default_ams_embedded.json | 11 +-
.../stacks/2.0.6/configs/default_client.json | 6 +-
.../stacks/2.0.6/configs/default_hive_nn_ha.json | 6 +-
.../stacks/2.0.6/configs/default_hive_nn_ha_2.json | 6 +-
.../2.0.6/configs/default_hive_non_hdfs.json | 6 +-
.../stacks/2.0.6/configs/default_no_install.json | 6 +-
.../stacks/2.0.6/configs/default_oozie_mysql.json | 6 +-
.../configs/default_update_exclude_file_only.json | 6 +-
.../stacks/2.0.6/configs/default_with_bucket.json | 6 +-
.../default_yarn_include_file_dont_manage.json | 6 +-
.../configs/default_yarn_include_file_manage.json | 6 +-
.../test/python/stacks/2.0.6/configs/flume_22.json | 6 +-
.../python/stacks/2.0.6/configs/flume_only.json | 6 +-
.../python/stacks/2.0.6/configs/flume_target.json | 6 +-
.../2.0.6/configs/ha_bootstrap_active_node.json | 12 +-
.../2.0.6/configs/ha_bootstrap_standby_node.json | 12 +-
.../ha_bootstrap_standby_node_initial_start.json | 12 +-
...tandby_node_initial_start_dfs_nameservices.json | 12 +-
.../python/stacks/2.0.6/configs/ha_default.json | 6 +-
.../python/stacks/2.0.6/configs/ha_secured.json | 6 +-
.../python/stacks/2.0.6/configs/hbase-2.2.json | 6 +-
.../stacks/2.0.6/configs/hbase-check-2.2.json | 6 +-
.../stacks/2.0.6/configs/hbase-preupgrade.json | 6 +-
.../stacks/2.0.6/configs/hbase-rs-2.2-phoenix.json | 6 +-
.../python/stacks/2.0.6/configs/hbase-rs-2.2.json | 6 +-
.../python/stacks/2.0.6/configs/hbase_no_phx.json | 6 +-
.../stacks/2.0.6/configs/hbase_with_phx.json | 6 +-
.../test/python/stacks/2.0.6/configs/nn_eu.json | 6 +-
.../python/stacks/2.0.6/configs/nn_eu_standby.json | 6 +-
.../python/stacks/2.0.6/configs/nn_ru_lzo.json | 6 +-
.../stacks/2.0.6/configs/oozie_existing_sqla.json | 6 +-
.../2.0.6/configs/ranger-namenode-start.json | 6 +-
.../2.0.6/configs/rebalancehdfs_default.json | 8 +-
.../2.0.6/configs/rebalancehdfs_secured.json | 8 +-
.../stacks/2.0.6/configs/repository_file.json | 6 +-
.../test/python/stacks/2.0.6/configs/secured.json | 6 +-
.../stacks/2.0.6/configs/secured_client.json | 6 +-
.../stacks/2.0.6/configs/secured_no_jce_name.json | 6 +-
.../secured_yarn_include_file_dont_manage.json | 6 +-
.../configs/secured_yarn_include_file_manage.json | 6 +-
.../stacks/2.0.6/configs/zk-service_check_2.2.json | 6 +-
.../hooks/after-INSTALL/test_after_install.py | 12 +-
.../2.0.6/hooks/before-ANY/test_before_any.py | 2 +-
.../before-SET_KEYTAB/test_before_set_keytab.py | 41 +
.../2.0.6/hooks/before-START/test_before_start.py | 36 +-
.../python/stacks/2.1/FALCON/test_falcon_server.py | 2 +-
.../python/stacks/2.1/HIVE/test_hive_metastore.py | 32 +-
.../python/stacks/2.1/configs/client-upgrade.json | 6 +-
.../stacks/2.1/configs/default-storm-start.json | 16 +-
.../test/python/stacks/2.1/configs/default.json | 6 +-
.../stacks/2.1/configs/hive-metastore-upgrade.json | 6 +-
.../stacks/2.1/configs/secured-storm-start.json | 12 +-
.../test/python/stacks/2.1/configs/secured.json | 10 +-
.../stacks/2.2/KERBEROS/test_kerberos_client.py | 2 +-
.../python/stacks/2.2/RANGER/test_ranger_admin.py | 4 +-
.../test/python/stacks/2.2/configs/default.json | 6 +-
.../2.2/configs/default_custom_path_config.json | 6 +-
.../python/stacks/2.2/configs/falcon-upgrade.json | 6 +-
.../python/stacks/2.2/configs/hive-upgrade.json | 6 +-
.../configs/journalnode-upgrade-hdfs-secure.json | 6 +-
.../stacks/2.2/configs/journalnode-upgrade.json | 6 +-
.../python/stacks/2.2/configs/knox_upgrade.json | 6 +-
.../python/stacks/2.2/configs/oozie-downgrade.json | 6 +-
.../python/stacks/2.2/configs/oozie-upgrade.json | 8 +-
.../2.2/configs/pig-service-check-secure.json | 6 +-
.../stacks/2.2/configs/ranger-admin-default.json | 6 +-
.../stacks/2.2/configs/ranger-admin-secured.json | 6 +-
.../stacks/2.2/configs/ranger-admin-upgrade.json | 6 +-
.../2.2/configs/ranger-usersync-upgrade.json | 6 +-
.../test/python/stacks/2.2/configs/secured.json | 6 +-
.../2.2/configs/spark-job-history-server.json | 2 +-
.../stacks/2.3/ATLAS/test_metadata_server.py | 20 +-
.../test/python/stacks/2.3/configs/ats_1_5.json | 6 +-
.../stacks/2.3/configs/default.hbasedecom.json | 2 +-
.../test/python/stacks/2.3/configs/default.json | 6 +-
.../python/stacks/2.3/configs/hbase_default.json | 6 +-
.../python/stacks/2.3/configs/hbase_secure.json | 6 +-
.../src/test/python/stacks/2.3/configs/secure.json | 6 +-
.../python/stacks/2.3/configs/spark_default.json | 6 +-
.../python/stacks/2.3/configs/storm_default.json | 6 +-
.../stacks/2.3/configs/storm_default_secure.json | 6 +-
.../stacks/2.4/AMBARI_INFRA/test_infra_solr.py | 24 +-
.../python/stacks/2.4/LOGSEARCH/test_logfeeder.py | 10 +
.../python/stacks/2.4/LOGSEARCH/test_logsearch.py | 15 +-
.../test/python/stacks/2.4/configs/default.json | 9 +-
.../python/stacks/2.5/HIVE/test_hive_server_int.py | 6 +-
.../python/stacks/2.5/RANGER/test_ranger_admin.py | 30 +-
.../stacks/2.5/RANGER/test_ranger_usersync.py | 8 +
.../stacks/2.5/RANGER_KMS/test_kms_server.py | 77 +-
.../stacks/2.5/ZEPPELIN/test_zeppelin_060.py | 5 +
.../test/python/stacks/2.5/configs/default.json | 6 +-
.../python/stacks/2.5/configs/hsi_default.json | 6 +-
.../2.5/configs/hsi_default_for_restart.json | 6 +-
.../src/test/python/stacks/2.5/configs/hsi_ha.json | 6 +-
.../stacks/2.5/configs/ranger-admin-default.json | 6 +-
.../stacks/2.5/configs/ranger-admin-secured.json | 6 +-
.../stacks/2.5/configs/ranger-kms-default.json | 6 +-
.../stacks/2.5/configs/ranger-kms-secured.json | 6 +-
.../test/python/stacks/2.5/configs/secured.json | 6 +-
.../src/test/python/stacks/2.6/DRUID/test_druid.py | 2 +-
.../python/stacks/2.6/RANGER/test_ranger_admin.py | 46 +-
.../stacks/2.6/RANGER/test_ranger_tagsync.py | 15 +
.../stacks/2.6/ZEPPELIN/test_zeppelin_070.py | 20 +-
.../test/python/stacks/2.6/configs/default.json | 6 +-
.../2.6/configs/default_kafka_plaintext.json | 6 +-
.../2.6/configs/default_kafka_plaintextsasl.json | 6 +-
.../2.6/configs/default_kafka_sasl_plaintext.json | 6 +-
.../stacks/2.6/configs/default_kafka_sasl_ssl.json | 6 +-
.../stacks/2.6/configs/ranger-admin-default.json | 6 +-
.../stacks/2.6/configs/ranger-admin-secured.json | 6 +-
.../stacks/2.6/configs/secure_kafka_sasl_ssl.json | 2 +-
.../python/stacks/test_ambari_configuration.py | 218 +-
.../src/test/python/validation-hosts.json | 191 +
.../HIVE/0.11.0.2.0.5.0/package/scripts/hive.py | 2 +-
.../dummy_stack/HIVE/package/scripts/hive.py | 2 +-
.../custom_actions/check_host_ip_addresses.json | 6 +-
.../custom_actions/check_last_agent_env.json | 4 +-
.../resources/custom_actions/invalid_check.json | 6 +-
.../ru_execute_tasks_namenode_prepare.json | 6 +-
.../stacks/HDP/2.0.6/services/YARN/metainfo.xml | 14 +
.../2.0.7/services/HIVE/package/scripts/hive.py | 2 +-
.../stacks/HDP/2.0.8/services/HBASE/metainfo.xml | 4 +
.../serviceadvisor/ServiceAdvisorCommandType.java | 2 +
ambari-utility/pom.xml | 25 +-
.../annotations/SwaggerOverwriteNestedAPI.java | 63 +
.../ambari/annotations/SwaggerPreferredParent.java | 40 +
.../apache/ambari/swagger/AmbariSwaggerReader.java | 106 +-
.../ambari/swagger/AmbariSwaggerReaderTest.java | 159 +-
ambari-views/examples/README.md | 1 -
.../auto-cluster-view/src/main/resources/view.xml | 2 +-
ambari-views/examples/pom.xml | 1 -
ambari-views/examples/weather-view/docs/index.md | 566 -
.../examples/weather-view/docs/paloalto.png | Bin 39530 -> 0 bytes
.../examples/weather-view/docs/weather.png | Bin 29121 -> 0 bytes
ambari-views/examples/weather-view/pom.xml | 114 -
.../apache/ambari/view/weather/CityResource.java | 99 -
.../ambari/view/weather/CityResourceProvider.java | 183 -
.../apache/ambari/view/weather/CityService.java | 75 -
.../apache/ambari/view/weather/WeatherServlet.java | 131 -
.../src/main/resources/WEB-INF/web.xml | 37 -
.../weather-view/src/main/resources/view.xml | 94 -
ambari-web/api-docs/css/api-explorer.css | 44 -
ambari-web/api-docs/lib/marked.js | 464 +-
ambari-web/api-docs/swagger-ui.js | 7 +-
ambari-web/api-docs/swagger-ui.min.js | 21 +-
ambari-web/app/app.js | 13 +-
.../data/configurations/config_versions.json | 3 +-
ambari-web/app/assets/data/services/ambari.json | 2 +-
.../app/assets/data/services/ambari_server.json | 2 +-
.../app/assets/data/stack_versions/upgrade.json | 62 +-
.../assets/data/wizard/deploy/5_hosts/poll_3.json | 8 +-
.../assets/data/wizard/deploy/5_hosts/poll_4.json | 8 +-
.../assets/data/wizard/deploy/5_hosts/poll_5.json | 8 +-
.../data/wizard/deploy/master_failure/poll_3.json | 8 +-
.../data/wizard/deploy/master_failure/poll_4.json | 8 +-
.../data/wizard/deploy/slave_failure/poll_3.json | 8 +-
.../data/wizard/deploy/slave_failure/poll_4.json | 8 +-
.../data/wizard/deploy/slave_warning/poll_3.json | 8 +-
.../data/wizard/deploy/slave_warning/poll_4.json | 8 +-
.../data/wizard/deploy/slave_warning/poll_5.json | 8 +-
.../data/wizard/kerberos/kerberize_cluster.json | 6 +-
ambari-web/app/assets/index.html | 2 +-
ambari-web/app/assets/test/tests.js | 2 +-
ambari-web/app/config.js | 3 +-
ambari-web/app/controllers.js | 1 -
ambari-web/app/controllers/application.js | 45 +
.../global/background_operations_controller.js | 19 +-
.../app/controllers/global/cluster_controller.js | 75 +-
.../controllers/global/configuration_controller.js | 61 +
.../app/controllers/global/update_controller.js | 124 +-
ambari-web/app/controllers/installer.js | 324 +-
ambari-web/app/controllers/main.js | 8 +-
.../main/admin/federation/step1_controller.js | 17 +-
.../main/admin/federation/step3_controller.js | 112 +-
.../main/admin/federation/step4_controller.js | 88 +-
.../journalNode/step1_controller.js | 12 +
.../journalNode/step3_controller.js | 58 +-
.../journalNode/step4_controller.js | 7 +-
.../journalNode/step5_controller.js | 11 +-
.../journalNode/step6_controller.js | 13 +-
.../journalNode/step7_controller.js | 13 +-
.../journalNode/step8_controller.js | 35 -
.../journalNode/wizard_controller.js | 4 +-
.../highAvailability/nameNode/step4_controller.js | 29 +-
.../highAvailability/nameNode/step7_controller.js | 18 +-
.../main/admin/highAvailability_controller.js | 21 +-
ambari-web/app/controllers/main/admin/kerberos.js | 27 +-
.../main/admin/kerberos/step5_controller.js | 39 +-
.../main/admin/kerberos/step7_controller.js | 37 +-
.../main/admin/kerberos/wizard_controller.js | 17 +-
.../main/admin/serviceAccounts_controller.js | 64 +-
.../controllers/main/admin/service_auto_start.js | 1 +
.../main/admin/stack_upgrade_history_controller.js | 35 +-
.../main/charts/heatmap_metrics/heatmap_metric.js | 44 +-
.../main/dashboard/config_history_controller.js | 15 +-
ambari-web/app/controllers/main/host.js | 52 +-
.../main/host/bulk_operations_controller.js | 8 +-
ambari-web/app/controllers/main/host/details.js | 119 +-
.../app/controllers/main/service/add_controller.js | 6 +-
.../app/controllers/main/service/info/configs.js | 25 +-
.../app/controllers/main/service/info/metric.js | 126 +-
.../app/controllers/main/service/info/summary.js | 29 +-
ambari-web/app/controllers/main/service/item.js | 63 +-
.../service/manage_config_groups_controller.js | 66 +-
.../main/service/reassign/step2_controller.js | 9 -
.../main/service/reassign/step3_controller.js | 24 +-
.../service/widgets/create/step2_controller.js | 12 +-
.../service/widgets/create/step3_controller.js | 18 +-
.../service/widgets/create/wizard_controller.js | 55 +-
ambari-web/app/controllers/wizard.js | 19 +-
.../app/controllers/wizard/step2_controller.js | 2 +
.../wizard/step7/assign_master_controller.js | 104 +-
.../app/controllers/wizard/step7_controller.js | 139 +-
.../app/controllers/wizard/step8_controller.js | 80 +-
.../app/data/configs/services/yarn_properties.js | 126 +
.../data/configs/wizards/federation_properties.js | 133 +-
ambari-web/app/data/controller_route.js | 8 +
ambari-web/app/data/dashboard_widgets.js | 30 +-
ambari-web/app/mappers/components_state_mapper.js | 5 +-
.../configs/stack_config_properties_mapper.js | 4 +
ambari-web/app/mappers/configs/themes_mapper.js | 33 +-
.../app/mappers/repository_version_mapper.js | 4 +-
ambari-web/app/mappers/service_metrics_mapper.js | 154 +-
.../mappers/socket/alert_groups_mapper_adapter.js | 13 +
.../app/mappers/socket/alert_summary_mapper.js | 5 +-
ambari-web/app/mappers/socket/topology_mapper.js | 12 +-
ambari-web/app/mappers/stack_mapper.js | 4 +-
ambari-web/app/mappers/widget_mapper.js | 3 +-
ambari-web/app/messages.js | 235 +-
ambari-web/app/mixins.js | 2 +
.../mixins/common/configs/configs_comparator.js | 11 +-
.../app/mixins/common/configs/configs_loader.js | 6 +-
.../app/mixins/common/configs/configs_saver.js | 8 +-
.../app/mixins/common/configs/enhanced_configs.js | 272 +-
ambari-web/app/mixins/common/serverValidator.js | 19 +-
.../app/mixins/common/widgets/widget_mixin.js | 46 +-
.../app/mixins/common/widgets/widget_section.js | 224 +-
.../main/dashboard/widgets/namenode_widget.js | 15 +-
.../details/host_components/decommissionable.js | 61 +-
.../configs/component_actions_by_configs.js | 120 +-
.../main/service/configs/config_overridable.js | 1 +
.../main/service/summary/hdfs_summary_widgets.js | 29 +
.../app/mixins/main/service/themes_mapping.js | 24 +-
ambari-web/app/mixins/wizard/addSecurityConfigs.js | 61 +-
.../app/mixins/wizard/assign_master_components.js | 43 +-
ambari-web/app/mixins/wizard/selectHost.js | 4 +-
.../wizard/wizardDeployProgressController.js | 7 +-
.../mixins/wizard/wizard_misc_property_checker.js | 91 +
ambari-web/app/models.js | 1 -
ambari-web/app/models/alerts/alert_definition.js | 2 +-
ambari-web/app/models/client_component.js | 13 +-
ambari-web/app/models/configs/config_group.js | 4 +-
.../app/models/configs/objects/service_config.js | 2 +-
.../app/models/configs/service_config_version.js | 4 +-
ambari-web/app/models/configs/theme/sub_section.js | 5 +
.../app/models/configs/theme/sub_section_tab.js | 5 +
.../app/models/configs/theme/theme_condition.js | 5 +
ambari-web/app/models/host_component.js | 12 +-
ambari-web/app/models/repository.js | 2 +
ambari-web/app/models/service.js | 2 +-
ambari-web/app/models/service/hdfs.js | 29 +-
ambari-web/app/models/stack_service.js | 10 +-
ambari-web/app/models/stack_service_component.js | 27 +-
ambari-web/app/models/stack_version/repository.js | 38 -
ambari-web/app/models/upgrade_entity.js | 5 +
ambari-web/app/models/widget.js | 1 +
ambari-web/app/models/widget_layout.js | 6 +-
ambari-web/app/routes/add_host_routes.js | 10 +-
ambari-web/app/routes/add_kerberos_routes.js | 6 +-
ambari-web/app/routes/add_service_routes.js | 57 +-
ambari-web/app/routes/installer.js | 7 +-
ambari-web/app/routes/main.js | 29 +-
ambari-web/app/routes/manage_journalnode_routes.js | 24 +-
.../app/routes/namenode_federation_routes.js | 12 +-
ambari-web/app/routes/reassign_master_routes.js | 3 +-
ambari-web/app/styles/alerts.less | 75 +-
ambari-web/app/styles/application.less | 457 +-
ambari-web/app/styles/bootstrap_overrides.less | 19 +-
ambari-web/app/styles/common.less | 26 +-
ambari-web/app/styles/config_versions_control.less | 21 +-
ambari-web/app/styles/dashboard.less | 327 +-
.../app/styles/enhanced_service_dashboard.less | 17 +-
ambari-web/app/styles/hosts.less | 39 +-
ambari-web/app/styles/modal_popups.less | 11 +
ambari-web/app/styles/service_configurations.less | 33 +-
ambari-web/app/styles/stack_versions.less | 108 +-
ambari-web/app/styles/theme/bootstrap-ambari.css | 4 +-
ambari-web/app/styles/top-nav.less | 3 +
ambari-web/app/styles/visualsearch.less | 53 +-
ambari-web/app/styles/widgets.less | 4 +
ambari-web/app/styles/wizard.less | 480 +-
ambari-web/app/templates.js | 1 +
ambari-web/app/templates/application.hbs | 41 +-
.../templates/common/assign_master_components.hbs | 2 +
.../app/templates/common/button_progress.hbs | 4 +-
.../common/configs/config_versions_control.hbs | 8 +-
.../common/configs/config_versions_dropdown.hbs | 11 +-
.../app/templates/common/configs/controls.hbs | 6 +-
.../common/configs/overriddenProperty.hbs | 2 +-
.../templates/common/configs/service_config.hbs | 27 +-
.../common/configs/service_config_wizard.hbs | 10 +-
.../templates/common/configs/services_config.hbs | 54 +-
.../templates/common/configs/widgets/controls.hbs | 2 +-
.../configs/widgets/controls/create_override.hbs | 2 +-
.../common/configs/widgets/controls/edit.hbs | 2 +-
.../configs/widgets/controls/remove_override.hbs | 2 +-
.../configs/widgets/controls/set_recommended.hbs | 2 +-
.../templates/common/form/check_db_connection.hbs | 14 +-
ambari-web/app/templates/common/form/dropdown.hbs | 4 +-
.../app/templates/common/host_progress_popup.hbs | 12 +-
.../common/modal_popups/widget_browser_popup.hbs | 7 +-
ambari-web/app/templates/common/progress.hbs | 17 +-
.../app/templates/common/widget/gauge_widget.hbs | 9 +-
.../app/templates/common/widget/graph_widget.hbs | 9 +-
.../app/templates/common/widget/number_widget.hbs | 9 +-
.../templates/common/widget/template_widget.hbs | 9 +-
.../app/templates/main/admin/federation/step1.hbs | 10 +-
.../admin/highAvailability/journalNode/step3.hbs | 20 +-
.../admin/highAvailability/journalNode/step5.hbs | 13 +-
.../admin/highAvailability/journalNode/step7.hbs | 12 +-
.../admin/highAvailability/journalNode/step8.hbs | 18 -
.../admin/highAvailability/journalNode/wizard.hbs | 5 +-
.../main/admin/highAvailability/nameNode/step1.hbs | 4 +-
.../main/admin/highAvailability/nameNode/step3.hbs | 2 +-
.../main/admin/highAvailability/nameNode/step4.hbs | 8 +-
.../main/admin/highAvailability/nameNode/step6.hbs | 8 +-
.../main/admin/highAvailability/nameNode/step8.hbs | 11 +-
ambari-web/app/templates/main/admin/kerberos.hbs | 60 +-
.../app/templates/main/admin/kerberos/step1.hbs | 3 +-
.../app/templates/main/admin/kerberos/step2.hbs | 4 +-
.../app/templates/main/admin/kerberos/step3.hbs | 12 +-
.../app/templates/main/admin/kerberos/step4.hbs | 4 +-
.../app/templates/main/admin/kerberos/step5.hbs | 6 +-
.../templates/main/admin/service_auto_start.hbs | 2 +-
.../main/admin/stack_upgrade/upgrade_group.hbs | 2 +-
.../main/admin/stack_upgrade/upgrade_history.hbs | 8 +-
.../main/admin/stack_upgrade/upgrade_task.hbs | 6 +-
ambari-web/app/templates/main/alerts.hbs | 2 +-
.../alert_definition/alert_definition_summary.hbs | 2 +-
.../templates/main/alerts/definition_details.hbs | 161 +-
.../main/alerts/manage_alert_groups_popup.hbs | 1 +
ambari-web/app/templates/main/charts/heatmap.hbs | 38 +-
.../main/charts/heatmap/heatmap_host_detail.hbs | 12 +-
.../templates/main/dashboard/config_history.hbs | 6 +-
.../app/templates/main/dashboard/widgets.hbs | 68 +-
.../templates/main/dashboard/widgets/pie_chart.hbs | 28 +-
.../main/dashboard/widgets/simple_text.hbs | 32 +-
.../templates/main/dashboard/widgets/uptime.hbs | 20 +-
ambari-web/app/templates/main/host.hbs | 11 +-
.../templates/main/host/details/host_component.hbs | 9 +-
ambari-web/app/templates/main/host/host_alerts.hbs | 2 +-
ambari-web/app/templates/main/host/summary.hbs | 20 +-
.../app/templates/main/service/info/metrics.hbs | 29 +
.../app/templates/main/service/info/summary.hbs | 55 +-
.../templates/main/service/info/summary/base.hbs | 3 +-
.../service/info/summary/hdfs/common_widgets.hbs | 53 +
.../main/service/info/summary/hdfs/slaves.hbs | 139 +
.../main/service/info/summary/hdfs/widgets.hbs | 48 +-
.../service/info/summary/master_components.hbs | 10 +-
.../app/templates/main/service/menu_item.hbs | 16 +-
.../app/templates/main/service/services/hdfs.hbs | 137 +-
.../app/templates/main/service/services/onefs.hbs | 187 +
.../app/templates/main/service/services/yarn.hbs | 21 +-
.../service/widgets/create/step2_add_metric.hbs | 37 +-
.../widgets/create/step2_component_dropdown.hbs | 38 +
.../config_launch_switch_config_group_of_host.hbs | 12 +-
.../templates/wizard/installer_cancel_button.hbs | 26 +
ambari-web/app/templates/wizard/step0.hbs | 1 +
.../app/templates/wizard/step1/editable_repo.hbs | 29 +
ambari-web/app/templates/wizard/step10.hbs | 2 +-
ambari-web/app/templates/wizard/step2.hbs | 1 +
ambari-web/app/templates/wizard/step3.hbs | 23 +-
.../step4/step4_service_validation_popup.hbs | 19 +
ambari-web/app/templates/wizard/step6.hbs | 15 +-
.../app/templates/wizard/step7/accounts_tab.hbs | 4 +-
.../app/templates/wizard/step7/directories_tab.hbs | 2 +-
.../templates/wizard/step7_with_category_tabs.hbs | 3 +-
ambari-web/app/templates/wizard/step8.hbs | 1 +
ambari-web/app/utils/ajax/ajax.js | 85 +-
ambari-web/app/utils/config.js | 63 +-
.../utils/configs/modification_handlers/misc.js | 20 +-
.../configs/move_namenode_config_initializer.js | 3 +-
ambari-web/app/utils/db.js | 9 +
ambari-web/app/utils/file_utils.js | 18 +
ambari-web/app/utils/helper.js | 23 +
ambari-web/app/utils/stomp_client.js | 89 +-
ambari-web/app/utils/string_utils.js | 11 +
ambari-web/app/utils/validator.js | 2 +-
ambari-web/app/views.js | 5 +-
.../views/common/assign_master_components_view.js | 2 +
.../configs/config_versions_dropdown_view.js | 7 +-
.../configs/service_config_layout_tab_view.js | 111 -
.../views/common/configs/service_config_view.js | 56 +-
.../configs/service_configs_by_category_view.js | 74 +-
.../app/views/common/configs/services_config.js | 30 +
.../configs/widgets/combo_config_widget_view.js | 26 +-
.../common/configs/widgets/config_widget_view.js | 101 +-
.../widgets/test_db_connection_widget_view.js | 48 +
ambari-web/app/views/common/controls_view.js | 17 +-
ambari-web/app/views/common/editable_list.js | 8 +-
ambari-web/app/views/common/filter_view.js | 20 +-
ambari-web/app/views/common/form/dropdown.js | 10 +-
.../views/common/host_progress_popup_body_view.js | 8 +-
.../views/common/modal_popups/log_tail_popup.js | 9 +-
.../app/views/common/quick_view_link_view.js | 108 +-
.../app/views/common/widget/heatmap_widget_view.js | 4 +-
ambari-web/app/views/loading.js | 5 +-
.../app/views/main/admin/federation/step1_view.js | 4 +-
.../app/views/main/admin/federation/step2_view.js | 2 +
.../highAvailability/journalNode/step3_view.js | 72 +-
.../highAvailability/journalNode/step5_view.js | 33 +-
.../highAvailability/journalNode/step7_view.js | 9 +-
.../highAvailability/journalNode/step8_view.js | 29 -
.../main/admin/stack_upgrade/upgrade_group_view.js | 9 +-
.../admin/stack_upgrade/upgrade_history_view.js | 6 +-
.../main/admin/stack_upgrade/upgrade_task_view.js | 49 +-
.../alert_definition/alert_definition_summary.js | 2 +
.../main/alerts/alert_instances_popup_view.js | 4 +-
.../views/main/alerts/definition_details_view.js | 2 +-
.../app/views/main/charts/heatmap/heatmap_host.js | 47 +-
.../views/main/dashboard/config_history_view.js | 7 +-
ambari-web/app/views/main/dashboard/widget.js | 25 +-
ambari-web/app/views/main/dashboard/widgets.js | 409 +-
.../views/main/dashboard/widgets/hdfs_capacity.js | 12 +-
.../app/views/main/dashboard/widgets/hdfs_links.js | 6 +-
.../views/main/dashboard/widgets/namenode_cpu.js | 7 +-
.../views/main/dashboard/widgets/namenode_heap.js | 4 +-
.../views/main/dashboard/widgets/namenode_rpc.js | 9 +-
.../main/dashboard/widgets/namenode_uptime.js | 2 +-
.../views/main/dashboard/widgets/text_widget.js | 2 +
.../main/dashboard/widgets/yarn_containers.js | 85 +
ambari-web/app/views/main/host.js | 10 +-
ambari-web/app/views/main/host/combo_search_box.js | 19 +-
ambari-web/app/views/main/host/details.js | 2 +-
.../views/main/host/details/host_component_view.js | 2 +-
.../details/host_component_views/datanode_view.js | 74 +-
ambari-web/app/views/main/host/logs_view.js | 10 +-
ambari-web/app/views/main/host/summary.js | 62 +-
ambari-web/app/views/main/menu.js | 14 +-
.../main/service/info/components_list_view.js | 3 +
.../app/views/main/service/info/metrics_view.js | 31 +-
ambari-web/app/views/main/service/info/summary.js | 43 +-
.../service/info/summary/hdfs/common_widgets.js | 77 +
.../views/main/service/info/summary/hdfs/slaves.js | 63 +
.../main/service/info/summary/hdfs/widgets.js | 96 +-
ambari-web/app/views/main/service/item.js | 30 +
.../main/service/manage_config_groups_view.js | 2 +-
ambari-web/app/views/main/service/services/hdfs.js | 44 +-
ambari-web/app/views/main/service/services/hive.js | 7 +-
.../app/views/main/service/services/onefs.js | 189 +
.../main/service/widgets/create/expression_view.js | 104 +-
.../main/service/widgets/create/step2_view.js | 10 +
.../wizard/step3/hostWarningPopupBody_view.js | 3 +
ambari-web/app/views/wizard/step3_view.js | 3 +
ambari-web/app/views/wizard/step6_view.js | 10 +
.../app/views/wizard/step7/accounts_tab_view.js | 14 +-
.../app/views/wizard/step7/databases_tab_view.js | 41 +-
.../app/views/wizard/step7/directories_tab_view.js | 9 +-
ambari-web/app/views/wizard/step7_view.js | 1 +
ambari-web/brunch-config.js | 6 +-
ambari-web/package.json | 13 +-
.../global/background_operations_test.js | 11 +-
.../controllers/global/cluster_controller_test.js | 29 +-
.../global/configuration_controller_test.js | 109 +
.../controllers/global/update_controller_test.js | 22 +-
ambari-web/test/controllers/installer_test.js | 121 +
.../journalNode/step4_controller_test.js | 22 -
.../journalNode/step6_controller_test.js | 55 +-
.../journalNode/step7_controller_test.js | 14 +-
.../journalNode/step8_controller_test.js | 61 -
.../nameNode/step7_controller_test.js | 26 +-
.../main/admin/highAvailability_controller_test.js | 10 +-
.../kerberos/kerberos_wizard_controler_test.js | 4 -
.../main/admin/kerberos/step5_controller_test.js | 38 -
.../main/admin/kerberos/step7_controller_test.js | 38 -
.../main/admin/service_auto_start_test.js | 1 -
.../admin/stack_upgrade_history_controller_test.js | 53 +
.../charts/heatmap_metrics/heatmap_metric_test.js | 20 +-
.../dashboard/config_history_controller_test.js | 4 +-
.../test/controllers/main/host/details_test.js | 94 +
ambari-web/test/controllers/main/host_test.js | 45 -
.../test/controllers/main/service/item_test.js | 69 +-
.../widgets/create/step2_controller_test.js | 4 +-
ambari-web/test/controllers/main_test.js | 21 +-
.../wizard/step7/assign_master_controller_test.js | 120 +-
ambari-web/test/controllers/wizard/step7_test.js | 37 +-
ambari-web/test/controllers/wizard/step8_test.js | 8 +
.../test/mappers/components_state_mapper_test.js | 2 +
.../test/mappers/configs/themes_mapper_test.js | 37 +-
.../test/mappers/service_metrics_mapper_test.js | 100 +
.../socket/alert_groups_mapper_adapter_test.js | 10 +-
.../mappers/socket/alert_summary_mapper_test.js | 6 +-
.../test/mappers/socket/topology_mapper_test.js | 2 +-
.../mixins/common/configs/enhanced_configs_test.js | 9 +-
.../test/mixins/common/serverValidator_test.js | 6 +
ambari-web/test/mixins/common/widget_mixin_test.js | 45 +
.../configs/component_actions_by_configs_test.js | 52 +-
.../test/mixins/wizard/addSeccurityConfigs_test.js | 105 +
.../test/models/configs/config_group_test.js | 2 +-
.../models/configs/objects/service_config_test.js | 9 +-
.../test/models/stack_service_component_test.js | 4 +-
ambari-web/test/utils/stomp_client_test.js | 49 +-
ambari-web/test/utils/string_utils_test.js | 13 +
.../configs/widgets/config_widget_view_test.js | 44 +-
.../test/views/common/quick_link_view_test.js | 109 +-
.../common/widget/heatmap_widget_view_test.js | 4 +-
.../admin/stack_upgrade/upgrade_task_view_test.js | 42 +-
.../views/main/charts/heatmap/heatmap_host_test.js | 62 +-
.../test/views/main/dashboard/widget_test.js | 21 +-
.../main/dashboard/widgets/namenode_rpc_test.js | 13 +-
.../test/views/main/dashboard/widgets_test.js | 30 +-
.../test/views/main/host/combo_search_box_test.js | 44 -
.../main/host/details/host_component_view_test.js | 9 +-
.../host_component_views/datanode_view_test.js | 153 +-
.../host_component_views/decommissionable_test.js | 19 -
ambari-web/test/views/main/host/logs_view_test.js | 4 +-
ambari-web/test/views/main/host/summary_test.js | 16 +-
ambari-web/test/views/main/host_test.js | 19 -
.../views/main/service/info/metrics_view_test.js | 16 +-
.../main/service/info/summary/hdfs/slaves_test.js | 79 +
.../test/views/main/service/info/summary_test.js | 4 +
ambari-web/test/views/main/service/item_test.js | 2 +-
.../test/views/main/service/services/hdfs_test.js | 40 -
ambari-web/vendor/scripts/jszip.min.js | 15 +
.../vendor/scripts/theme/bootstrap-ambari.js | 6 +-
ambari-web/yarn.lock | 447 +-
contrib/ambari-log4j/pom.xml | 1 -
.../apache/ambari/fast_hdfs_resource/Resource.java | 9 +
.../apache/ambari/fast_hdfs_resource/Runner.java | 110 +-
.../HDF/2.0/hooks/before-START/scripts/params.py | 6 +
.../templates/hadoop-metrics2.properties.j2 | 10 +-
.../stacks/HDF/2.0/services/stack_advisor.py | 1 +
.../management-packs/isilon-onefs-mpack/pom.xml | 2 +-
.../ONEFS/1.0.0/package/scripts/params_linux.py | 4 -
.../addon-services/ONEFS/1.0.0/service_advisor.py | 22 +-
.../src/main/resources/mpack.json | 5 +-
.../ODPi/2.0/hooks/before-START/scripts/params.py | 19 +
.../ODPi/2.0/services/HIVE/package/scripts/hive.py | 2 +-
.../HIVE/package/scripts/hive_interactive.py | 2 +-
.../services/HIVE/package/scripts/params_linux.py | 9 +
.../hadoop-metrics2-hivemetastore.properties.j2 | 10 +-
.../hadoop-metrics2-hiveserver2.properties.j2 | 10 +-
.../templates/hadoop-metrics2-llapdaemon.j2 | 11 +-
.../templates/hadoop-metrics2-llaptaskscheduler.j2 | 9 +-
.../src/main/python/preinstall_checker.py | 6 +-
contrib/version-builder/version_builder.py | 2 +-
.../src/main/resources/ui/.bowerrc | 5 +
.../capacity-scheduler/src/main/resources/view.xml | 2 +-
.../resources/ui/hdfs-directory-viewer/.bowerrc | 3 +-
contrib/views/files/src/main/resources/ui/.bowerrc | 3 +-
.../main/resources/ui/app/adapters/application.js | 23 +-
.../main/resources/ui/app/services/file-preview.js | 5 +-
.../src/main/resources/ui/app/styles/app.less | 3 +
contrib/views/files/src/main/resources/view.xml | 2 +-
contrib/views/hawq/.gitignore | 19 -
contrib/views/hawq/README.md | 64 -
contrib/views/hawq/pom.xml | 271 -
.../apache/ambari/view/hawq/HAWQDataSource.java | 94 -
.../apache/ambari/view/hawq/JsonApiResource.java | 98 -
.../org/apache/ambari/view/hawq/QueryResource.java | 36 -
.../ambari/view/hawq/QueryResourceProvider.java | 225 -
.../org/apache/ambari/view/hawq/QueryService.java | 70 -
contrib/views/hawq/src/main/resources/ui/.bowerrc | 4 -
.../views/hawq/src/main/resources/ui/.editorconfig | 34 -
.../views/hawq/src/main/resources/ui/.ember-cli | 27 -
.../views/hawq/src/main/resources/ui/.gitignore | 19 -
contrib/views/hawq/src/main/resources/ui/.jshintrc | 32 -
.../src/main/resources/ui/app/adapters/query.js | 31 -
.../views/hawq/src/main/resources/ui/app/app.js | 36 -
.../resources/ui/app/components/query-table.js | 30 -
.../src/main/resources/ui/app/controllers/.gitkeep | 0
.../src/main/resources/ui/app/helpers/.gitkeep | 0
.../hawq/src/main/resources/ui/app/index.html | 42 -
.../hawq/src/main/resources/ui/app/models/query.js | 47 -
.../hawq/src/main/resources/ui/app/resolver.js | 21 -
.../views/hawq/src/main/resources/ui/app/router.js | 30 -
.../main/resources/ui/app/routes/application.js | 24 -
.../hawq/src/main/resources/ui/app/routes/main.js | 40 -
.../src/main/resources/ui/app/serializers/query.js | 70 -
.../hawq/src/main/resources/ui/app/styles/app.scss | 61 -
.../resources/ui/app/templates/application.hbs | 22 -
.../ui/app/templates/components/query-table.hbs | 59 -
.../src/main/resources/ui/app/templates/main.hbs | 20 -
.../hawq/src/main/resources/ui/app/utils/utils.js | 76 -
.../views/hawq/src/main/resources/ui/bower.json | 13 -
.../src/main/resources/ui/config/environment.js | 69 -
.../hawq/src/main/resources/ui/ember-cli-build.js | 51 -
.../views/hawq/src/main/resources/ui/package.json | 49 -
.../main/resources/ui/public/assets/logo-hawq.png | Bin 1897 -> 0 bytes
contrib/views/hawq/src/main/resources/ui/testem.js | 33 -
.../hawq/src/main/resources/ui/tests/.jshintrc | 52 -
.../ui/tests/acceptance/application-test.js | 54 -
.../main/resources/ui/tests/helpers/destroy-app.js | 23 -
.../ui/tests/helpers/module-for-acceptance.js | 52 -
.../main/resources/ui/tests/helpers/resolver.js | 29 -
.../main/resources/ui/tests/helpers/start-app.js | 36 -
.../main/resources/ui/tests/helpers/test-helper.js | 139 -
.../hawq/src/main/resources/ui/tests/index.html | 51 -
.../integration/components/query-table-test.js | 115 -
.../src/main/resources/ui/tests/test-helper.js | 22 -
.../resources/ui/tests/unit/adapters/query-test.js | 35 -
.../resources/ui/tests/unit/models/query-test.js | 55 -
.../resources/ui/tests/unit/routes/main-test.js | 26 -
.../ui/tests/unit/serializers/query-test.js | 99 -
.../resources/ui/tests/unit/utils/utils-test.js | 93 -
.../hawq/src/main/resources/ui/vendor/.gitkeep | 0
contrib/views/hawq/src/main/resources/ui/yarn.lock | 6665 ---
.../hawq/src/main/resources/view.log4j.properties | 27 -
contrib/views/hawq/src/main/resources/view.xml | 70 -
.../ambari/view/hawq/HAWQDataSourceTest.java | 170 -
.../view/hawq/QueryResourceProviderTest.java | 200 -
contrib/views/hive-next/pom.xml | 391 -
.../org/apache/ambari/view/hive2/AuthParams.java | 102 -
.../org/apache/ambari/view/hive2/BaseService.java | 54 -
.../ambari/view/hive2/ConnectionDelegate.java | 37 -
.../ambari/view/hive2/ConnectionFactory.java | 167 -
.../apache/ambari/view/hive2/ConnectionSystem.java | 135 -
.../org/apache/ambari/view/hive2/DataMigrator.java | 101 -
.../org/apache/ambari/view/hive2/HelpService.java | 150 -
.../view/hive2/HiveJdbcConnectionDelegate.java | 106 -
.../org/apache/ambari/view/hive2/HiveViewImpl.java | 52 -
.../ambari/view/hive2/PropertyValidator.java | 107 -
.../org/apache/ambari/view/hive2/TestBean.java | 36 -
.../apache/ambari/view/hive2/actor/DeathWatch.java | 55 -
.../apache/ambari/view/hive2/actor/HiveActor.java | 46 -
.../ambari/view/hive2/actor/JdbcConnector.java | 645 -
.../ambari/view/hive2/actor/LogAggregator.java | 125 -
.../view/hive2/actor/OperationController.java | 408 -
.../ambari/view/hive2/actor/ResultSetIterator.java | 167 -
.../ambari/view/hive2/actor/StatementExecutor.java | 153 -
.../view/hive2/actor/YarnAtsGUIDFetcher.java | 71 -
.../ambari/view/hive2/actor/message/Connect.java | 77 -
.../view/hive2/actor/message/CursorReset.java | 22 -
.../view/hive2/actor/message/ExecuteJob.java | 38 -
.../view/hive2/actor/message/ExecuteQuery.java | 23 -
.../view/hive2/actor/message/FetchError.java | 42 -
.../view/hive2/actor/message/FetchResult.java | 42 -
.../hive2/actor/message/GetColumnMetadataJob.java | 59 -
.../view/hive2/actor/message/GetMoreLogs.java | 22 -
.../ambari/view/hive2/actor/message/HiveJob.java | 48 -
.../view/hive2/actor/message/HiveMessage.java | 53 -
.../view/hive2/actor/message/JobRejected.java | 44 -
.../view/hive2/actor/message/JobSubmitted.java | 38 -
.../actor/message/LogAggregationFinished.java | 21 -
.../view/hive2/actor/message/RegisterActor.java | 34 -
.../view/hive2/actor/message/ResetCursor.java | 22 -
.../hive2/actor/message/ResultInformation.java | 83 -
.../view/hive2/actor/message/ResultNotReady.java | 40 -
.../view/hive2/actor/message/ResultReady.java | 44 -
.../view/hive2/actor/message/RunStatement.java | 73 -
.../view/hive2/actor/message/SQLStatementJob.java | 65 -
.../hive2/actor/message/StartLogAggregation.java | 42 -
.../actor/message/job/AsyncExecutionFailed.java | 46 -
.../view/hive2/actor/message/job/CancelJob.java | 40 -
.../actor/message/job/ExecuteNextStatement.java | 22 -
.../hive2/actor/message/job/ExecutionFailed.java | 31 -
.../view/hive2/actor/message/job/Failure.java | 37 -
.../view/hive2/actor/message/job/FetchFailed.java | 31 -
.../ambari/view/hive2/actor/message/job/Next.java | 22 -
.../view/hive2/actor/message/job/NoMoreItems.java | 35 -
.../view/hive2/actor/message/job/NoResult.java | 21 -
.../view/hive2/actor/message/job/Result.java | 43 -
.../hive2/actor/message/job/ResultSetHolder.java | 33 -
.../actor/message/job/SaveDagInformation.java | 52 -
.../view/hive2/actor/message/job/SaveGuidToDB.java | 46 -
.../hive2/actor/message/job/UpdateYarnAtsGuid.java | 44 -
.../hive2/actor/message/lifecycle/CleanUp.java | 21 -
.../actor/message/lifecycle/DestroyConnector.java | 52 -
.../actor/message/lifecycle/FreeConnector.java | 53 -
.../actor/message/lifecycle/InactivityCheck.java | 21 -
.../hive2/actor/message/lifecycle/KeepAlive.java | 21 -
.../lifecycle/TerminateInactivityCheck.java | 21 -
.../backgroundjobs/BackgroundJobController.java | 113 -
.../backgroundjobs/BackgroundJobException.java | 30 -
.../ambari/view/hive2/client/AsyncJobRunner.java | 38 -
.../view/hive2/client/AsyncJobRunnerImpl.java | 143 -
.../view/hive2/client/ColumnDescription.java | 45 -
.../hive2/client/ColumnDescriptionExtended.java | 74 -
.../view/hive2/client/ColumnDescriptionShort.java | 53 -
.../ambari/view/hive2/client/ConnectionConfig.java | 59 -
.../apache/ambari/view/hive2/client/Cursor.java | 30 -
.../ambari/view/hive2/client/DDLDelegator.java | 38 -
.../ambari/view/hive2/client/DDLDelegatorImpl.java | 255 -
.../ambari/view/hive2/client/EmptyCursor.java | 110 -
.../view/hive2/client/HiveAuthCredentials.java | 31 -
.../hive2/client/HiveAuthRequiredException.java | 27 -
.../client/HiveClientAuthRequiredException.java | 25 -
.../view/hive2/client/HiveClientException.java | 25 -
.../hive2/client/HiveClientRuntimeException.java | 25 -
.../view/hive2/client/NonPersistentCursor.java | 156 -
.../ambari/view/hive2/client/PersistentCursor.java | 87 -
.../org/apache/ambari/view/hive2/client/Row.java | 74 -
.../hive2/exceptions/NotConnectedException.java | 28 -
.../view/hive2/internal/AsyncExecutionFailure.java | 23 -
.../view/hive2/internal/AsyncExecutionSuccess.java | 25 -
.../ambari/view/hive2/internal/Connectable.java | 65 -
.../view/hive2/internal/ConnectionException.java | 25 -
.../view/hive2/internal/ConnectionProperties.java | 94 -
.../view/hive2/internal/ConnectionSupplier.java | 37 -
.../view/hive2/internal/ContextSupplier.java | 37 -
.../view/hive2/internal/DataStorageSupplier.java | 42 -
.../view/hive2/internal/DefaultSupplier.java | 62 -
.../apache/ambari/view/hive2/internal/Either.java | 79 -
.../view/hive2/internal/HdfsApiSupplier.java | 71 -
.../view/hive2/internal/HiveConnectionWrapper.java | 152 -
.../ambari/view/hive2/internal/HiveQuery.java | 71 -
.../ambari/view/hive2/internal/HiveResult.java | 160 -
.../ambari/view/hive2/internal/HiveTask.java | 53 -
.../view/hive2/internal/HiveTaskMessage.java | 118 -
.../view/hive2/internal/SafeViewContext.java | 181 -
.../view/hive2/persistence/DataStoreStorage.java | 140 -
.../view/hive2/persistence/IStorageFactory.java | 23 -
.../hive2/persistence/InstanceKeyValueStorage.java | 132 -
.../view/hive2/persistence/KeyValueStorage.java | 163 -
.../hive2/persistence/LocalKeyValueStorage.java | 69 -
.../hive2/persistence/PersistentConfiguration.java | 52 -
.../ambari/view/hive2/persistence/Storage.java | 77 -
.../utils/ContextConfigurationAdapter.java | 260 -
.../hive2/persistence/utils/FilteringStrategy.java | 32 -
.../view/hive2/persistence/utils/Indexed.java | 36 -
.../view/hive2/persistence/utils/ItemNotFound.java | 43 -
.../utils/OnlyOwnersFilteringStrategy.java | 38 -
.../ambari/view/hive2/persistence/utils/Owned.java | 36 -
.../hive2/persistence/utils/PersonalResource.java | 22 -
.../hive2/persistence/utils/StorageFactory.java | 69 -
.../view/hive2/resources/CRUDResourceManager.java | 131 -
.../view/hive2/resources/IResourceManager.java | 37 -
.../resources/PersonalCRUDResourceManager.java | 99 -
.../hive2/resources/SharedCRUDResourceManager.java | 44 -
.../hive2/resources/browser/ConnectionService.java | 155 -
.../resources/browser/HiveBrowserService.java | 263 -
.../view/hive2/resources/files/FileResource.java | 70 -
.../view/hive2/resources/files/FileService.java | 283 -
.../view/hive2/resources/jobs/Aggregator.java | 391 -
.../hive2/resources/jobs/JobResourceProvider.java | 117 -
.../view/hive2/resources/jobs/JobService.java | 624 -
.../resources/jobs/ModifyNotificationDelegate.java | 23 -
.../jobs/ModifyNotificationInvocationHandler.java | 40 -
.../jobs/NoOperationStatusSetException.java | 23 -
.../hive2/resources/jobs/ProgressRetriever.java | 66 -
.../jobs/ResultsPaginationController.java | 287 -
.../hive2/resources/jobs/atsJobs/ATSParser.java | 248 -
.../resources/jobs/atsJobs/ATSParserFactory.java | 43 -
.../jobs/atsJobs/ATSRequestsDelegate.java | 47 -
.../jobs/atsJobs/ATSRequestsDelegateImpl.java | 175 -
.../hive2/resources/jobs/atsJobs/HiveQueryId.java | 42 -
.../hive2/resources/jobs/atsJobs/IATSParser.java | 39 -
.../hive2/resources/jobs/atsJobs/TezDagId.java | 26 -
.../hive2/resources/jobs/atsJobs/TezVertexId.java | 24 -
.../view/hive2/resources/jobs/rm/RMParser.java | 129 -
.../hive2/resources/jobs/rm/RMParserFactory.java | 48 -
.../resources/jobs/rm/RMRequestsDelegate.java | 31 -
.../resources/jobs/rm/RMRequestsDelegateImpl.java | 99 -
.../jobs/viewJobs/IJobControllerFactory.java | 23 -
.../view/hive2/resources/jobs/viewJobs/Job.java | 131 -
.../resources/jobs/viewJobs/JobController.java | 44 -
.../jobs/viewJobs/JobControllerFactory.java | 40 -
.../resources/jobs/viewJobs/JobControllerImpl.java | 327 -
.../hive2/resources/jobs/viewJobs/JobImpl.java | 335 -
.../hive2/resources/jobs/viewJobs/JobInfo.java | 78 -
.../jobs/viewJobs/JobResourceManager.java | 93 -
.../resources/resources/FileResourceItem.java | 78 -
.../resources/FileResourceResourceManager.java | 65 -
.../resources/FileResourceResourceProvider.java | 110 -
.../resources/resources/FileResourceService.java | 180 -
.../hive2/resources/savedQueries/SavedQuery.java | 96 -
.../savedQueries/SavedQueryResourceManager.java | 162 -
.../savedQueries/SavedQueryResourceProvider.java | 113 -
.../resources/savedQueries/SavedQueryService.java | 267 -
.../ambari/view/hive2/resources/udfs/UDF.java | 87 -
.../hive2/resources/udfs/UDFResourceManager.java | 65 -
.../hive2/resources/udfs/UDFResourceProvider.java | 111 -
.../view/hive2/resources/udfs/UDFService.java | 193 -
.../view/hive2/resources/uploads/CSVParams.java | 74 -
.../resources/uploads/ColumnDescriptionImpl.java | 119 -
.../view/hive2/resources/uploads/HiveFileType.java | 30 -
.../hive2/resources/uploads/TableDataReader.java | 111 -
.../view/hive2/resources/uploads/TableInput.java | 51 -
.../resources/uploads/UploadFromHdfsInput.java | 130 -
.../hive2/resources/uploads/UploadService.java | 582 -
.../resources/uploads/parsers/DataParser.java | 66 -
.../uploads/parsers/EndOfDocumentException.java | 41 -
.../hive2/resources/uploads/parsers/IParser.java | 34 -
.../resources/uploads/parsers/ParseOptions.java | 61 -
.../resources/uploads/parsers/ParseUtils.java | 213 -
.../hive2/resources/uploads/parsers/Parser.java | 162 -
.../resources/uploads/parsers/PreviewData.java | 56 -
.../resources/uploads/parsers/RowIterator.java | 98 -
.../resources/uploads/parsers/RowMapIterator.java | 29 -
.../parsers/csv/commonscsv/CSVIterator.java | 57 -
.../uploads/parsers/csv/commonscsv/CSVParser.java | 88 -
.../parsers/csv/opencsv/OpenCSVIterator.java | 56 -
.../uploads/parsers/csv/opencsv/OpenCSVParser.java | 92 -
.../uploads/parsers/json/JSONIterator.java | 160 -
.../resources/uploads/parsers/json/JSONParser.java | 85 -
.../resources/uploads/parsers/xml/XMLIterator.java | 195 -
.../resources/uploads/parsers/xml/XMLParser.java | 102 -
.../resources/uploads/query/DeleteQueryInput.java | 48 -
.../uploads/query/InsertFromQueryInput.java | 92 -
.../resources/uploads/query/LoadQueryInput.java | 67 -
.../resources/uploads/query/QueryGenerator.java | 142 -
.../hive2/resources/uploads/query/RowFormat.java | 57 -
.../hive2/resources/uploads/query/TableInfo.java | 97 -
.../hive2/utils/BadRequestFormattedException.java | 27 -
.../apache/ambari/view/hive2/utils/Constants.java | 25 -
.../ambari/view/hive2/utils/FilePaginator.java | 127 -
.../view/hive2/utils/HiveActorConfiguration.java | 71 -
.../hive2/utils/HiveClientFormattedException.java | 26 -
.../view/hive2/utils/LoggingOutputStream.java | 85 -
.../utils/MisconfigurationFormattedException.java | 47 -
.../hive2/utils/NotFoundFormattedException.java | 27 -
.../hive2/utils/ResultFetchFormattedException.java | 27 -
.../utils/ResultNotReadyFormattedException.java | 27 -
.../ambari/view/hive2/utils/ServiceCheck.java | 132 -
.../hive2/utils/ServiceFormattedException.java | 105 -
.../view/hive2/utils/SharedObjectsFactory.java | 197 -
.../hive-next/src/main/resources/application.conf | 57 -
.../src/main/resources/ui/hive-web/.bowerrc | 4 -
.../src/main/resources/ui/hive-web/.editorconfig | 34 -
.../src/main/resources/ui/hive-web/.ember-cli | 27 -
.../src/main/resources/ui/hive-web/.gitignore | 37 -
.../src/main/resources/ui/hive-web/.jshintrc | 33 -
.../src/main/resources/ui/hive-web/.travis.yml | 38 -
.../src/main/resources/ui/hive-web/Brocfile.js | 55 -
.../src/main/resources/ui/hive-web/README.md | 14 -
.../ui/hive-web/app/adapters/application.js | 72 -
.../resources/ui/hive-web/app/adapters/database.js | 25 -
.../ui/hive-web/app/adapters/file-upload.js | 30 -
.../resources/ui/hive-web/app/adapters/file.js | 26 -
.../ui/hive-web/app/adapters/service-check.js | 47 -
.../ui/hive-web/app/adapters/upload-table.js | 89 -
.../src/main/resources/ui/hive-web/app/app.js | 34 -
.../resources/ui/hive-web/app/components/.gitkeep | 0
.../app/components/alert-message-widget.js | 35 -
.../hive-web/app/components/collapsible-widget.js | 38 -
.../app/components/column-filter-widget.js | 56 -
.../hive-web/app/components/date-range-widget.js | 98 -
.../ui/hive-web/app/components/expander-widget.js | 36 -
.../ui/hive-web/app/components/extended-input.js | 50 -
.../ui/hive-web/app/components/file-upload.js | 34 -
.../ui/hive-web/app/components/input-header.js | 61 -
.../ui/hive-web/app/components/job-tr-view.js | 41 -
.../ui/hive-web/app/components/modal-widget.js | 58 -
.../ui/hive-web/app/components/navbar-widget.js | 42 -
.../ui/hive-web/app/components/no-bubbling.js | 31 -
.../ui/hive-web/app/components/notify-widget.js | 31 -
.../hive-web/app/components/number-range-widget.js | 79 -
.../ui/hive-web/app/components/panel-widget.js | 30 -
.../ui/hive-web/app/components/popover-widget.js | 34 -
.../ui/hive-web/app/components/progress-widget.js | 30 -
.../ui/hive-web/app/components/query-editor.js | 129 -
.../ui/hive-web/app/components/query-settings.js | 55 -
.../ui/hive-web/app/components/radio-button.js | 39 -
.../ui/hive-web/app/components/select-widget.js | 66 -
.../ui/hive-web/app/components/tabs-widget.js | 68 -
.../ui/hive-web/app/components/tree-view.js | 23 -
.../ui/hive-web/app/components/typeahead-widget.js | 129 -
.../ui/hive-web/app/components/udf-tr-view.js | 81 -
.../ui/hive-web/app/components/upload-query.js | 31 -
.../app/components/validated-text-field.js | 62 -
.../app/components/visualization-tabs-widget.js | 56 -
.../resources/ui/hive-web/app/controllers/.gitkeep | 0
.../ui/hive-web/app/controllers/application.js | 33 -
.../ui/hive-web/app/controllers/databases.js | 476 -
.../ui/hive-web/app/controllers/history.js | 257 -
.../resources/ui/hive-web/app/controllers/index.js | 790 -
.../app/controllers/index/history-query/explain.js | 164 -
.../app/controllers/index/history-query/logs.js | 127 -
.../app/controllers/index/history-query/results.js | 238 -
.../ui/hive-web/app/controllers/insert-udfs.js | 58 -
.../ui/hive-web/app/controllers/messages.js | 41 -
.../ui/hive-web/app/controllers/modal-delete.js | 33 -
.../hive-web/app/controllers/modal-save-query.js | 42 -
.../ui/hive-web/app/controllers/modal-save.js | 34 -
.../ui/hive-web/app/controllers/open-queries.js | 412 -
.../ui/hive-web/app/controllers/queries.js | 145 -
.../ui/hive-web/app/controllers/query-tabs.js | 189 -
.../ui/hive-web/app/controllers/splash.js | 193 -
.../ui/hive-web/app/controllers/tez-ui.js | 106 -
.../resources/ui/hive-web/app/controllers/udfs.js | 143 -
.../ui/hive-web/app/controllers/upload-table.js | 964 -
.../ui/hive-web/app/controllers/visual-explain.js | 64 -
.../hive-web/app/controllers/visualization-ui.js | 136 -
.../resources/ui/hive-web/app/helpers/.gitkeep | 0
.../ui/hive-web/app/helpers/all-uppercase.js | 25 -
.../ui/hive-web/app/helpers/code-helper.js | 28 -
.../ui/hive-web/app/helpers/date-binding.js | 27 -
.../ui/hive-web/app/helpers/format-column-type.js | 39 -
.../ui/hive-web/app/helpers/log-helper.js | 28 -
.../ui/hive-web/app/helpers/path-binding.js | 29 -
.../ui/hive-web/app/helpers/preformatted-string.js | 28 -
.../resources/ui/hive-web/app/helpers/tb-helper.js | 33 -
.../src/main/resources/ui/hive-web/app/index.html | 42 -
.../resources/ui/hive-web/app/initializers/i18n.js | 351 -
.../resources/ui/hive-web/app/mixins/filterable.js | 106 -
.../resources/ui/hive-web/app/mixins/sortable.js | 31 -
.../main/resources/ui/hive-web/app/models/.gitkeep | 0
.../resources/ui/hive-web/app/models/database.js | 25 -
.../ui/hive-web/app/models/file-resource.js | 25 -
.../main/resources/ui/hive-web/app/models/file.js | 26 -
.../main/resources/ui/hive-web/app/models/job.js | 55 -
.../ui/hive-web/app/models/saved-query.js | 29 -
.../main/resources/ui/hive-web/app/models/udf.js | 27 -
.../src/main/resources/ui/hive-web/app/router.js | 53 -
.../main/resources/ui/hive-web/app/routes/.gitkeep | 0
.../ui/hive-web/app/routes/application.js | 77 -
.../resources/ui/hive-web/app/routes/history.js | 29 -
.../app/routes/index/history-query/explain.js | 28 -
.../app/routes/index/history-query/index.js | 44 -
.../app/routes/index/history-query/logs.js | 28 -
.../app/routes/index/history-query/results.js | 28 -
.../ui/hive-web/app/routes/index/index.js | 36 -
.../ui/hive-web/app/routes/index/saved-query.js | 43 -
.../resources/ui/hive-web/app/routes/loading.js | 22 -
.../resources/ui/hive-web/app/routes/messages.js | 22 -
.../resources/ui/hive-web/app/routes/queries.js | 40 -
.../resources/ui/hive-web/app/routes/splash.js | 133 -
.../resources/ui/hive-web/app/routes/tez-ui.js | 22 -
.../main/resources/ui/hive-web/app/routes/udfs.js | 36 -
.../ui/hive-web/app/routes/visual-explain.js | 22 -
.../ui/hive-web/app/routes/visualization-ui.js | 22 -
.../ui/hive-web/app/serializers/database.js | 41 -
.../resources/ui/hive-web/app/serializers/file.js | 23 -
.../resources/ui/hive-web/app/services/database.js | 243 -
.../resources/ui/hive-web/app/services/file.js | 59 -
.../resources/ui/hive-web/app/services/history.js | 204 -
.../ui/hive-web/app/services/job-progress.js | 111 -
.../main/resources/ui/hive-web/app/services/job.js | 56 -
.../resources/ui/hive-web/app/services/ldap.js | 59 -
.../resources/ui/hive-web/app/services/notify.js | 113 -
.../resources/ui/hive-web/app/services/session.js | 48 -
.../resources/ui/hive-web/app/services/settings.js | 199 -
.../main/resources/ui/hive-web/app/styles/.gitkeep | 0
.../main/resources/ui/hive-web/app/styles/app.scss | 722 -
.../ui/hive-web/app/styles/dropdown-submenu.scss | 65 -
.../resources/ui/hive-web/app/styles/mixins.scss | 28 -
.../ui/hive-web/app/styles/notifications.scss | 37 -
.../ui/hive-web/app/styles/query-tabs.scss | 73 -
.../resources/ui/hive-web/app/styles/vars.scss | 21 -
.../resources/ui/hive-web/app/templates/.gitkeep | 0
.../ui/hive-web/app/templates/application.hbs | 45 -
.../ui/hive-web/app/templates/components/.gitkeep | 0
.../templates/components/alert-message-widget.hbs | 28 -
.../templates/components/collapsible-widget.hbs | 33 -
.../templates/components/column-filter-widget.hbs | 42 -
.../app/templates/components/date-range-widget.hbs | 22 -
.../app/templates/components/expander-widget.hbs | 31 -
.../app/templates/components/input-header.hbs | 20 -
.../app/templates/components/job-tr-view.hbs | 49 -
.../app/templates/components/modal-widget.hbs | 35 -
.../app/templates/components/navbar-widget.hbs | 45 -
.../app/templates/components/no-bubbling.hbs | 19 -
.../app/templates/components/notify-widget.hbs | 21 -
.../templates/components/number-range-widget.hbs | 23 -
.../app/templates/components/panel-widget.hbs | 54 -
.../app/templates/components/popover-widget.hbs | 19 -
.../app/templates/components/progress-widget.hbs | 23 -
.../app/templates/components/query-editor.hbs | 19 -
.../app/templates/components/query-settings.hbs | 70 -
.../app/templates/components/select-widget.hbs | 39 -
.../app/templates/components/tabs-widget.hbs | 41 -
.../app/templates/components/tree-view.hbs | 28 -
.../app/templates/components/udf-tr-view.hbs | 77 -
.../templates/components/validated-text-field.hbs | 23 -
.../components/visualization-tabs-widget.hbs | 27 -
.../app/templates/databases-search-results.hbs | 54 -
.../ui/hive-web/app/templates/databases-tree.hbs | 50 -
.../ui/hive-web/app/templates/databases.hbs | 54 -
.../ui/hive-web/app/templates/history.hbs | 67 -
.../resources/ui/hive-web/app/templates/index.hbs | 124 -
.../app/templates/index/history-query/explain.hbs | 27 -
.../app/templates/index/history-query/logs.hbs | 19 -
.../app/templates/index/history-query/results.hbs | 56 -
.../ui/hive-web/app/templates/insert-udfs.hbs | 46 -
.../ui/hive-web/app/templates/loading.hbs | 19 -
.../resources/ui/hive-web/app/templates/logs.hbs | 19 -
.../ui/hive-web/app/templates/message.hbs | 36 -
.../ui/hive-web/app/templates/messages.hbs | 32 -
.../ui/hive-web/app/templates/modal-delete.hbs | 21 -
.../ui/hive-web/app/templates/modal-save-query.hbs | 24 -
.../ui/hive-web/app/templates/modal-save.hbs | 21 -
.../ui/hive-web/app/templates/notification.hbs | 23 -
.../ui/hive-web/app/templates/open-queries.hbs | 27 -
.../ui/hive-web/app/templates/queries.hbs | 96 -
.../ui/hive-web/app/templates/query-tabs.hbs | 28 -
.../ui/hive-web/app/templates/redirect.hbs | 19 -
.../resources/ui/hive-web/app/templates/splash.hbs | 127 -
.../resources/ui/hive-web/app/templates/tez-ui.hbs | 31 -
.../resources/ui/hive-web/app/templates/udfs.hbs | 53 -
.../ui/hive-web/app/templates/upload-table.hbs | 296 -
.../ui/hive-web/app/templates/visual-explain.hbs | 93 -
.../ui/hive-web/app/templates/visualization-ui.hbs | 37 -
.../resources/ui/hive-web/app/transforms/date.js | 49 -
.../resources/ui/hive-web/app/utils/constants.js | 231 -
.../resources/ui/hive-web/app/utils/dag-rules.js | 141 -
.../resources/ui/hive-web/app/utils/functions.js | 139 -
.../main/resources/ui/hive-web/app/views/.gitkeep | 0
.../main/resources/ui/hive-web/app/views/index.js | 28 -
.../resources/ui/hive-web/app/views/message.js | 36 -
.../resources/ui/hive-web/app/views/messages.js | 37 -
.../ui/hive-web/app/views/notification.js | 51 -
.../main/resources/ui/hive-web/app/views/tez-ui.js | 37 -
.../ui/hive-web/app/views/visual-explain.js | 461 -
.../ui/hive-web/app/views/visualization-ui.js | 37 -
.../src/main/resources/ui/hive-web/big_tables.js | 54 -
.../src/main/resources/ui/hive-web/bower.json | 29 -
.../resources/ui/hive-web/config/environment.js | 70 -
.../src/main/resources/ui/hive-web/package.json | 48 -
.../src/main/resources/ui/hive-web/testem.json | 10 -
.../src/main/resources/ui/hive-web/tests/.jshintrc | 74 -
.../resources/ui/hive-web/tests/blanket-options.js | 36 -
.../ui/hive-web/tests/helpers/api-mock.js | 304 -
.../resources/ui/hive-web/tests/helpers/dbclick.js | 26 -
.../ui/hive-web/tests/helpers/resolver.js | 29 -
.../ui/hive-web/tests/helpers/start-app.js | 43 -
.../resources/ui/hive-web/tests/img/spinner.gif | Bin 11435 -> 0 bytes
.../main/resources/ui/hive-web/tests/index.html | 71 -
.../ui/hive-web/tests/integration/database-test.js | 130 -
.../ui/hive-web/tests/integration/history-test.js | 95 -
.../tests/integration/query-editor-test.js | 126 -
.../tests/integration/saved-queries-test.js | 152 -
.../ui/hive-web/tests/integration/tez-ui-test.js | 49 -
.../ui/hive-web/tests/integration/udfs-test.js | 109 -
.../resources/ui/hive-web/tests/test-helper.js | 24 -
.../main/resources/ui/hive-web/tests/unit/.gitkeep | 0
.../ui/hive-web/tests/unit/adapters/application.js | 48 -
.../ui/hive-web/tests/unit/adapters/file.js | 39 -
.../unit/components/alert-message-widget-test.js | 91 -
.../unit/components/collapsible-widget-test.js | 46 -
.../unit/components/column-filter-widget-test.js | 138 -
.../unit/components/date-range-widget-test.js | 132 -
.../tests/unit/components/expander-widget-test.js | 59 -
.../tests/unit/components/extended-input-test.js | 81 -
.../tests/unit/components/job-tr-view-test.js | 62 -
.../tests/unit/components/modal-widget-test.js | 69 -
.../tests/unit/components/no-bubbling-test.js | 44 -
.../unit/components/number-range-widget-test.js | 70 -
.../tests/unit/components/popover-widget-test.js | 36 -
.../tests/unit/components/progress-widget-test.js | 40 -
.../tests/unit/components/query-editor-test.js | 52 -
.../tests/unit/components/query-settings-test.js | 136 -
.../tests/unit/components/select-widget-test.js | 158 -
.../tests/unit/components/tabs-wiget-test.js | 117 -
.../tests/unit/components/typeahead-widget-test.js | 46 -
.../tests/unit/components/udf-tr-view-test.js | 122 -
.../tests/unit/controllers/databases-test.js | 276 -
.../tests/unit/controllers/history-test.js | 117 -
.../hive-web/tests/unit/controllers/index-test.js | 328 -
.../tests/unit/controllers/insert-udfs-test.js | 68 -
.../tests/unit/controllers/open-queries-test.js | 102 -
.../tests/unit/controllers/queries-test.js | 35 -
.../hive-web/tests/unit/controllers/tez-ui-test.js | 98 -
.../hive-web/tests/unit/controllers/udfs-test.js | 82 -
.../tests/unit/helpers/path-binding-test.js | 35 -
.../ui/hive-web/tests/unit/routes/messages-test.js | 53 -
.../ui/hive-web/tests/unit/routes/tez-ui-test.js | 49 -
.../tests/unit/routes/visual-explain-test.js | 106 -
.../ui/hive-web/tests/unit/services/notify-test.js | 155 -
.../hive-web/tests/unit/services/settings-test.js | 155 -
.../src/main/resources/ui/hive-web/vendor/.gitkeep | 0
.../ui/hive-web/vendor/browser-pollyfills.js | 213 -
.../hive-web/vendor/codemirror/codemirror-min.js | 17 -
.../ui/hive-web/vendor/codemirror/codemirror.css | 309 -
.../ui/hive-web/vendor/codemirror/show-hint.css | 38 -
.../ui/hive-web/vendor/codemirror/show-hint.js | 389 -
.../ui/hive-web/vendor/codemirror/sql-hint.js | 192 -
.../main/resources/ui/hive-web/vendor/dagre.min.js | 27 -
.../src/main/resources/ui/hive-web/yarn.lock | 5066 --
.../src/main/resources/view.log4j.properties | 27 -
.../views/hive-next/src/main/resources/view.xml | 354 -
.../ambari/view/hive2/AsyncJobRunnerImplTest.java | 140 -
.../ambari/view/hive2/ConnectionFailuresTest.java | 157 -
.../view/hive2/HiveJdbcConnectionDelegateTest.java | 105 -
.../apache/ambari/view/hive2/JobExecutionTest.java | 116 -
.../ambari/view/hive2/PropertyValidatorTest.java | 113 -
.../ambari/view/hive2/ResultSetIteratorTest.java | 100 -
.../view/hive2/resources/upload/CSVParserTest.java | 275 -
.../hive2/resources/upload/DataParserCSVTest.java | 326 -
.../hive2/resources/upload/DataParserJSONTest.java | 263 -
.../hive2/resources/upload/DataParserXMLTest.java | 295 -
.../hive2/resources/upload/JsonParserTest.java | 146 -
.../hive2/resources/upload/OpenCSVParserTest.java | 313 -
.../view/hive2/resources/upload/OpenCSVTest.java | 245 -
.../hive2/resources/upload/ParseUtilsTest.java | 56 -
.../hive2/resources/upload/QueryGeneratorTest.java | 108 -
.../resources/upload/TableDataReaderTest.java | 127 -
.../view/hive2/resources/upload/XMLParserTest.java | 135 -
contrib/views/hive20/pom.xml | 428 -
.../org/apache/ambari/view/hive20/AuthParams.java | 104 -
.../org/apache/ambari/view/hive20/BaseService.java | 59 -
.../ambari/view/hive20/ConnectionDelegate.java | 41 -
.../ambari/view/hive20/ConnectionFactory.java | 167 -
.../ambari/view/hive20/ConnectionSystem.java | 135 -
.../org/apache/ambari/view/hive20/Constants.java | 25 -
.../apache/ambari/view/hive20/DataMigrator.java | 102 -
.../org/apache/ambari/view/hive20/HelpService.java | 132 -
.../view/hive20/HiveJdbcConnectionDelegate.java | 112 -
.../apache/ambari/view/hive20/HiveViewImpl.java | 57 -
.../ambari/view/hive20/PropertyValidator.java | 107 -
.../org/apache/ambari/view/hive20/TestBean.java | 36 -
.../ambari/view/hive20/actor/DeathWatch.java | 55 -
.../apache/ambari/view/hive20/actor/HiveActor.java | 46 -
.../ambari/view/hive20/actor/JdbcConnector.java | 696 -
.../ambari/view/hive20/actor/LogAggregator.java | 125 -
.../view/hive20/actor/OperationController.java | 408 -
.../view/hive20/actor/ResultSetIterator.java | 166 -
.../view/hive20/actor/StatementExecutor.java | 169 -
.../view/hive20/actor/YarnAtsGUIDFetcher.java | 71 -
.../ambari/view/hive20/actor/message/Connect.java | 77 -
.../view/hive20/actor/message/CursorReset.java | 22 -
.../view/hive20/actor/message/ExecuteJob.java | 38 -
.../view/hive20/actor/message/ExecuteQuery.java | 23 -
.../view/hive20/actor/message/FetchError.java | 42 -
.../view/hive20/actor/message/FetchResult.java | 42 -
.../hive20/actor/message/GetColumnMetadataJob.java | 59 -
.../actor/message/GetDatabaseMetadataJob.java | 24 -
.../view/hive20/actor/message/GetMoreLogs.java | 22 -
.../ambari/view/hive20/actor/message/HiveJob.java | 48 -
.../view/hive20/actor/message/HiveMessage.java | 53 -
.../view/hive20/actor/message/JobRejected.java | 44 -
.../view/hive20/actor/message/JobSubmitted.java | 38 -
.../actor/message/LogAggregationFinished.java | 21 -
.../view/hive20/actor/message/RegisterActor.java | 34 -
.../view/hive20/actor/message/ResetCursor.java | 22 -
.../hive20/actor/message/ResultInformation.java | 102 -
.../view/hive20/actor/message/ResultNotReady.java | 40 -
.../view/hive20/actor/message/ResultReady.java | 44 -
.../view/hive20/actor/message/RunStatement.java | 73 -
.../view/hive20/actor/message/SQLStatementJob.java | 64 -
.../hive20/actor/message/StartLogAggregation.java | 42 -
.../actor/message/job/AsyncExecutionFailed.java | 46 -
.../actor/message/job/AuthenticationFailed.java | 27 -
.../view/hive20/actor/message/job/CancelJob.java | 40 -
.../actor/message/job/ExecuteNextStatement.java | 22 -
.../hive20/actor/message/job/ExecutionFailed.java | 31 -
.../view/hive20/actor/message/job/Failure.java | 37 -
.../view/hive20/actor/message/job/FetchFailed.java | 31 -
.../ambari/view/hive20/actor/message/job/Next.java | 22 -
.../view/hive20/actor/message/job/NoMoreItems.java | 35 -
.../view/hive20/actor/message/job/NoResult.java | 21 -
.../view/hive20/actor/message/job/Result.java | 58 -
.../hive20/actor/message/job/ResultSetHolder.java | 33 -
.../actor/message/job/SaveDagInformation.java | 52 -
.../hive20/actor/message/job/SaveGuidToDB.java | 46 -
.../actor/message/job/UpdateYarnAtsGuid.java | 44 -
.../hive20/actor/message/lifecycle/CleanUp.java | 21 -
.../actor/message/lifecycle/DestroyConnector.java | 52 -
.../actor/message/lifecycle/FreeConnector.java | 53 -
.../actor/message/lifecycle/InactivityCheck.java | 21 -
.../hive20/actor/message/lifecycle/KeepAlive.java | 21 -
.../lifecycle/TerminateInactivityCheck.java | 21 -
.../backgroundjobs/BackgroundJobController.java | 115 -
.../backgroundjobs/BackgroundJobException.java | 30 -
.../ambari/view/hive20/client/AsyncJobRunner.java | 38 -
.../view/hive20/client/AsyncJobRunnerImpl.java | 143 -
.../view/hive20/client/ColumnDescription.java | 45 -
.../hive20/client/ColumnDescriptionExtended.java | 74 -
.../view/hive20/client/ColumnDescriptionShort.java | 53 -
.../view/hive20/client/ConnectionConfig.java | 59 -
.../apache/ambari/view/hive20/client/Cursor.java | 30 -
.../ambari/view/hive20/client/DDLDelegator.java | 46 -
.../view/hive20/client/DDLDelegatorImpl.java | 313 -
.../hive20/client/DatabaseMetadataWrapper.java | 37 -
.../ambari/view/hive20/client/EmptyCursor.java | 110 -
.../view/hive20/client/HiveAuthCredentials.java | 31 -
.../hive20/client/HiveAuthRequiredException.java | 27 -
.../client/HiveClientAuthRequiredException.java | 25 -
.../view/hive20/client/HiveClientException.java | 25 -
.../hive20/client/HiveClientRuntimeException.java | 25 -
.../view/hive20/client/NonPersistentCursor.java | 156 -
.../view/hive20/client/PersistentCursor.java | 87 -
.../org/apache/ambari/view/hive20/client/Row.java | 74 -
.../hive20/exceptions/NotConnectedException.java | 28 -
.../view/hive20/exceptions/ServiceException.java | 40 -
.../hive20/internal/AsyncExecutionFailure.java | 23 -
.../hive20/internal/AsyncExecutionSuccess.java | 25 -
.../ambari/view/hive20/internal/Connectable.java | 65 -
.../view/hive20/internal/ConnectionException.java | 25 -
.../view/hive20/internal/ConnectionProperties.java | 94 -
.../view/hive20/internal/ConnectionSupplier.java | 37 -
.../view/hive20/internal/ContextSupplier.java | 37 -
.../view/hive20/internal/DataStorageSupplier.java | 42 -
.../view/hive20/internal/DefaultSupplier.java | 60 -
.../apache/ambari/view/hive20/internal/Either.java | 79 -
.../view/hive20/internal/HdfsApiSupplier.java | 71 -
.../hive20/internal/HiveConnectionWrapper.java | 152 -
.../ambari/view/hive20/internal/HiveQuery.java | 71 -
.../ambari/view/hive20/internal/HiveResult.java | 160 -
.../ambari/view/hive20/internal/HiveTask.java | 53 -
.../view/hive20/internal/HiveTaskMessage.java | 118 -
.../view/hive20/internal/SafeViewContext.java | 179 -
.../view/hive20/internal/dto/ColumnInfo.java | 123 -
.../view/hive20/internal/dto/ColumnOrder.java | 54 -
.../view/hive20/internal/dto/ColumnStats.java | 175 -
.../view/hive20/internal/dto/DatabaseInfo.java | 85 -
.../view/hive20/internal/dto/DatabaseResponse.java | 71 -
.../hive20/internal/dto/DetailedTableInfo.java | 124 -
.../ambari/view/hive20/internal/dto/Order.java | 37 -
.../view/hive20/internal/dto/PartitionInfo.java | 44 -
.../ambari/view/hive20/internal/dto/Section.java | 46 -
.../view/hive20/internal/dto/StorageInfo.java | 124 -
.../ambari/view/hive20/internal/dto/TableInfo.java | 69 -
.../ambari/view/hive20/internal/dto/TableMeta.java | 134 -
.../view/hive20/internal/dto/TableResponse.java | 53 -
.../view/hive20/internal/dto/TableStats.java | 111 -
.../ambari/view/hive20/internal/dto/ViewInfo.java | 52 -
.../internal/parsers/AbstractTableMetaParser.java | 177 -
.../hive20/internal/parsers/ColumnInfoParser.java | 97 -
.../parsers/CreateTableStatementParser.java | 38 -
.../parsers/DatabaseMetadataExtractor.java | 46 -
.../internal/parsers/DetailedTableInfoParser.java | 71 -
.../view/hive20/internal/parsers/ParserUtils.java | 52 -
.../internal/parsers/PartitionInfoParser.java | 76 -
.../hive20/internal/parsers/StorageInfoParser.java | 100 -
.../hive20/internal/parsers/TableMetaParser.java | 31 -
.../internal/parsers/TableMetaParserImpl.java | 129 -
.../internal/parsers/TableMetaSectionParser.java | 30 -
.../hive20/internal/parsers/ViewInfoParser.java | 47 -
.../query/generators/AlterTableQueryGenerator.java | 375 -
.../generators/AnalyzeTableQueryGenerator.java | 78 -
.../generators/CreateDatabaseQueryGenerator.java | 44 -
.../generators/CreateTableQueryGenerator.java | 168 -
.../generators/DeleteDatabaseQueryGenerator.java | 48 -
.../generators/DeleteTableQueryGenerator.java | 67 -
.../generators/FetchColumnStatsQueryGenerator.java | 40 -
.../query/generators/InsertFromQueryGenerator.java | 106 -
.../query/generators/QueryGenerationUtils.java | 154 -
.../internal/query/generators/QueryGenerator.java | 26 -
.../generators/RenameTableQueryGenerator.java | 85 -
.../view/hive20/persistence/DataStoreStorage.java | 140 -
.../view/hive20/persistence/IStorageFactory.java | 23 -
.../persistence/InstanceKeyValueStorage.java | 132 -
.../view/hive20/persistence/KeyValueStorage.java | 163 -
.../hive20/persistence/LocalKeyValueStorage.java | 69 -
.../persistence/PersistentConfiguration.java | 52 -
.../ambari/view/hive20/persistence/Storage.java | 77 -
.../utils/ContextConfigurationAdapter.java | 260 -
.../persistence/utils/FilteringStrategy.java | 32 -
.../view/hive20/persistence/utils/Indexed.java | 36 -
.../hive20/persistence/utils/ItemNotFound.java | 43 -
.../utils/OnlyOwnersFilteringStrategy.java | 38 -
.../view/hive20/persistence/utils/Owned.java | 36 -
.../hive20/persistence/utils/PersonalResource.java | 22 -
.../hive20/persistence/utils/StorageFactory.java | 69 -
.../view/hive20/resources/CRUDResourceManager.java | 131 -
.../view/hive20/resources/IResourceManager.java | 37 -
.../resources/PersonalCRUDResourceManager.java | 99 -
.../resources/SharedCRUDResourceManager.java | 44 -
.../resources/browser/ConnectionService.java | 166 -
.../view/hive20/resources/browser/DDLProxy.java | 500 -
.../view/hive20/resources/browser/DDLService.java | 359 -
.../view/hive20/resources/browser/FileService.java | 45 -
.../view/hive20/resources/files/FileResource.java | 70 -
.../view/hive20/resources/files/FileService.java | 282 -
.../view/hive20/resources/jobs/Aggregator.java | 382 -
.../hive20/resources/jobs/JobResourceProvider.java | 117 -
.../view/hive20/resources/jobs/JobService.java | 596 -
.../hive20/resources/jobs/JobServiceInternal.java | 35 -
.../resources/jobs/ModifyNotificationDelegate.java | 23 -
.../jobs/ModifyNotificationInvocationHandler.java | 40 -
.../jobs/NoOperationStatusSetException.java | 23 -
.../hive20/resources/jobs/ProgressRetriever.java | 66 -
.../jobs/ResultsPaginationController.java | 423 -
.../hive20/resources/jobs/atsJobs/ATSParser.java | 248 -
.../resources/jobs/atsJobs/ATSParserFactory.java | 42 -
.../jobs/atsJobs/ATSRequestsDelegate.java | 47 -
.../jobs/atsJobs/ATSRequestsDelegateImpl.java | 175 -
.../hive20/resources/jobs/atsJobs/HiveQueryId.java | 42 -
.../hive20/resources/jobs/atsJobs/IATSParser.java | 39 -
.../hive20/resources/jobs/atsJobs/TezDagId.java | 26 -
.../hive20/resources/jobs/atsJobs/TezVertexId.java | 24 -
.../view/hive20/resources/jobs/rm/RMParser.java | 129 -
.../hive20/resources/jobs/rm/RMParserFactory.java | 48 -
.../resources/jobs/rm/RMRequestsDelegate.java | 31 -
.../resources/jobs/rm/RMRequestsDelegateImpl.java | 99 -
.../jobs/viewJobs/IJobControllerFactory.java | 23 -
.../view/hive20/resources/jobs/viewJobs/Job.java | 131 -
.../resources/jobs/viewJobs/JobController.java | 44 -
.../jobs/viewJobs/JobControllerFactory.java | 40 -
.../resources/jobs/viewJobs/JobControllerImpl.java | 328 -
.../hive20/resources/jobs/viewJobs/JobImpl.java | 339 -
.../hive20/resources/jobs/viewJobs/JobInfo.java | 78 -
.../jobs/viewJobs/JobResourceManager.java | 93 -
.../resources/resources/FileResourceItem.java | 78 -
.../resources/FileResourceResourceManager.java | 65 -
.../resources/FileResourceResourceProvider.java | 110 -
.../resources/resources/FileResourceService.java | 180 -
.../hive20/resources/savedQueries/SavedQuery.java | 96 -
.../savedQueries/SavedQueryResourceManager.java | 141 -
.../savedQueries/SavedQueryResourceProvider.java | 113 -
.../resources/savedQueries/SavedQueryService.java | 267 -
.../view/hive20/resources/settings/Setting.java | 71 -
.../settings/SettingsResourceManager.java | 97 -
.../hive20/resources/settings/SettingsService.java | 145 -
.../view/hive20/resources/system/ServiceCheck.java | 133 -
.../hive20/resources/system/SystemService.java | 77 -
.../resources/system/ranger/RangerException.java | 56 -
.../resources/system/ranger/RangerService.java | 379 -
.../ambari/view/hive20/resources/udfs/UDF.java | 87 -
.../hive20/resources/udfs/UDFResourceManager.java | 65 -
.../hive20/resources/udfs/UDFResourceProvider.java | 111 -
.../view/hive20/resources/udfs/UDFService.java | 193 -
.../view/hive20/resources/uploads/CSVParams.java | 74 -
.../resources/uploads/ColumnDescriptionImpl.java | 119 -
.../hive20/resources/uploads/HiveFileType.java | 30 -
.../hive20/resources/uploads/TableDataReader.java | 112 -
.../resources/uploads/UploadFromHdfsInput.java | 132 -
.../hive20/resources/uploads/UploadService.java | 571 -
.../resources/uploads/parsers/DataParser.java | 66 -
.../uploads/parsers/EndOfDocumentException.java | 41 -
.../hive20/resources/uploads/parsers/IParser.java | 32 -
.../resources/uploads/parsers/ParseOptions.java | 61 -
.../resources/uploads/parsers/ParseUtils.java | 213 -
.../hive20/resources/uploads/parsers/Parser.java | 162 -
.../resources/uploads/parsers/PreviewData.java | 65 -
.../resources/uploads/parsers/RowIterator.java | 98 -
.../resources/uploads/parsers/RowMapIterator.java | 29 -
.../parsers/csv/commonscsv/CSVIterator.java | 57 -
.../uploads/parsers/csv/commonscsv/CSVParser.java | 88 -
.../parsers/csv/opencsv/OpenCSVIterator.java | 56 -
.../uploads/parsers/csv/opencsv/OpenCSVParser.java | 92 -
.../uploads/parsers/json/JSONIterator.java | 160 -
.../resources/uploads/parsers/json/JSONParser.java | 85 -
.../resources/uploads/parsers/xml/XMLIterator.java | 195 -
.../resources/uploads/parsers/xml/XMLParser.java | 102 -
.../resources/uploads/query/DeleteQueryInput.java | 48 -
.../uploads/query/InsertFromQueryInput.java | 115 -
.../resources/uploads/query/LoadQueryInput.java | 67 -
.../view/hive20/utils/AuthorizationChecker.java | 74 -
.../hive20/utils/BadRequestFormattedException.java | 27 -
.../ambari/view/hive20/utils/FilePaginator.java | 127 -
.../view/hive20/utils/HiveActorConfiguration.java | 71 -
.../hive20/utils/HiveClientFormattedException.java | 26 -
.../view/hive20/utils/LoggingOutputStream.java | 85 -
.../utils/MisconfigurationFormattedException.java | 47 -
.../hive20/utils/NotFoundFormattedException.java | 27 -
.../utils/ResultFetchFormattedException.java | 27 -
.../utils/ResultNotReadyFormattedException.java | 27 -
.../hive20/utils/ServiceFormattedException.java | 105 -
.../view/hive20/utils/SharedObjectsFactory.java | 197 -
.../utils/UniqueConstraintViolationException.java | 31 -
.../hive20/src/main/resources/application.conf | 57 -
.../views/hive20/src/main/resources/ui/.bowerrc | 4 -
.../hive20/src/main/resources/ui/.editorconfig | 20 -
.../views/hive20/src/main/resources/ui/.ember-cli | 27 -
.../views/hive20/src/main/resources/ui/.gitignore | 18 -
.../views/hive20/src/main/resources/ui/.jshintrc | 34 -
.../views/hive20/src/main/resources/ui/.travis.yml | 40 -
.../hive20/src/main/resources/ui/.watchmanconfig | 21 -
.../views/hive20/src/main/resources/ui/README.md | 28 -
.../main/resources/ui/app/adapters/application.js | 92 -
.../src/main/resources/ui/app/adapters/auth.js | 27 -
.../src/main/resources/ui/app/adapters/database.js | 34 -
.../src/main/resources/ui/app/adapters/ddl.js | 26 -
.../resources/ui/app/adapters/file-resource.js | 25 -
.../resources/ui/app/adapters/file-uploader.js | 28 -
.../main/resources/ui/app/adapters/hdfs-viewer.js | 27 -
.../src/main/resources/ui/app/adapters/job.js | 80 -
.../src/main/resources/ui/app/adapters/query.js | 54 -
.../src/main/resources/ui/app/adapters/ranger.js | 27 -
.../main/resources/ui/app/adapters/saved-query.js | 25 -
.../resources/ui/app/adapters/service-check.js | 47 -
.../main/resources/ui/app/adapters/table-info.js | 37 -
.../src/main/resources/ui/app/adapters/table.js | 83 -
.../src/main/resources/ui/app/adapters/udf.js | 31 -
.../main/resources/ui/app/adapters/upload-table.js | 93 -
.../views/hive20/src/main/resources/ui/app/app.js | 36 -
.../src/main/resources/ui/app/breakpoints.js | 23 -
.../src/main/resources/ui/app/components/.gitkeep | 0
.../ui/app/components/alert-message-display.js | 45 -
.../resources/ui/app/components/alert-message.js | 32 -
.../resources/ui/app/components/column-item.js | 72 -
.../resources/ui/app/components/confirm-dialog.js | 46 -
.../ui/app/components/create-database-form.js | 59 -
.../resources/ui/app/components/create-table.js | 180 -
.../ui/app/components/csv-format-params.js | 76 -
.../ui/app/components/database-search-bar.js | 78 -
.../ui/app/components/edit-setting-item.js | 111 -
.../main/resources/ui/app/components/edit-table.js | 220 -
.../resources/ui/app/components/export-result.js | 54 -
.../ui/app/components/fileresource-item.js | 70 -
.../ui/app/components/hdfs-viewer-modal.js | 51 -
.../resources/ui/app/components/info-dialog.js | 38 -
.../main/resources/ui/app/components/job-item.js | 91 -
.../resources/ui/app/components/jobs-browser.js | 101 -
.../resources/ui/app/components/list-filter.js | 48 -
.../main/resources/ui/app/components/list-group.js | 23 -
.../main/resources/ui/app/components/list-item.js | 29 -
.../app/components/multiple-database-search-bar.js | 117 -
.../ui/app/components/notification-message.js | 30 -
.../resources/ui/app/components/property-item.js | 44 -
.../resources/ui/app/components/query-editor.js | 112 -
.../ui/app/components/query-result-log.js | 28 -
.../ui/app/components/query-result-table.js | 150 -
.../resources/ui/app/components/radio-button.js | 39 -
.../ui/app/components/service-check-entry.js | 50 -
.../resources/ui/app/components/setting-item.js | 32 -
.../resources/ui/app/components/setting-list.js | 37 -
.../resources/ui/app/components/simple-table.js | 22 -
.../ui/app/components/table-advanced-settings.js | 177 -
.../resources/ui/app/components/table-columns.js | 53 -
.../ui/app/components/table-properties.js | 40 -
.../ui/app/components/table-rename-form.js | 63 -
.../ui/app/components/table-statistics.js | 172 -
.../main/resources/ui/app/components/tabs-item.js | 43 -
.../main/resources/ui/app/components/tabs-pane.js | 27 -
.../ui/app/components/top-application-bar.js | 24 -
.../main/resources/ui/app/components/udf-edit.js | 40 -
.../main/resources/ui/app/components/udf-item.js | 212 -
.../main/resources/ui/app/components/udf-new.js | 41 -
.../ui/app/components/upload-table-source.js | 48 -
.../resources/ui/app/components/upload-table.js | 61 -
.../ui/app/components/validated-text-field.js | 62 -
.../ui/app/components/visual-explain-detail.js | 31 -
.../resources/ui/app/components/visual-explain.js | 85 -
.../resources/ui/app/configs/create-table-tabs.js | 48 -
.../src/main/resources/ui/app/configs/datatypes.js | 34 -
.../resources/ui/app/configs/edit-table-tabs.js | 48 -
.../main/resources/ui/app/configs/file-format.js | 28 -
.../src/main/resources/ui/app/configs/helpers.js | 163 -
.../resources/ui/app/configs/hive-parameters.js | 93 -
.../ui/app/configs/non-printable-escape-chars.js | 53 -
.../main/resources/ui/app/configs/result-tabs.js | 48 -
.../ui/app/configs/service-check-status.js | 19 -
.../resources/ui/app/configs/table-level-tabs.js | 72 -
.../resources/ui/app/configs/top-level-tabs.js | 67 -
.../src/main/resources/ui/app/controllers/.gitkeep | 0
.../resources/ui/app/controllers/application.js | 31 -
.../src/main/resources/ui/app/controllers/jobs.js | 38 -
.../main/resources/ui/app/controllers/messages.js | 30 -
.../main/resources/ui/app/controllers/password.js | 44 -
.../main/resources/ui/app/controllers/queries.js | 22 -
.../resources/ui/app/controllers/saved-query.js | 22 -
.../resources/ui/app/controllers/savedqueries.js | 24 -
.../resources/ui/app/controllers/service-check.js | 57 -
.../src/main/resources/ui/app/controllers/udfs.js | 24 -
.../main/resources/ui/app/controllers/udfs/new.js | 23 -
.../src/main/resources/ui/app/helpers/.gitkeep | 0
.../ui/app/helpers/alert-message-context-class.js | 27 -
.../ui/app/helpers/alert-message-icon-class.js | 37 -
.../main/resources/ui/app/helpers/extract-value.js | 27 -
.../resources/ui/app/helpers/format-column-size.js | 39 -
.../main/resources/ui/app/helpers/shorten-text.js | 32 -
.../src/main/resources/ui/app/helpers/to-json.js | 25 -
.../hive20/src/main/resources/ui/app/index.html | 43 -
.../main/resources/ui/app/initializers/.gitkeep | 0
.../resources/ui/app/initializers/responsive.js | 33 -
.../resources/ui/app/locales/en/translations.js | 105 -
.../src/main/resources/ui/app/mixins/ui-logger.js | 42 -
.../src/main/resources/ui/app/models/.gitkeep | 0
.../src/main/resources/ui/app/models/alert.js | 28 -
.../src/main/resources/ui/app/models/column.js | 131 -
.../src/main/resources/ui/app/models/database.js | 25 -
.../main/resources/ui/app/models/file-resource.js | 25 -
.../src/main/resources/ui/app/models/file.js | 26 -
.../hive20/src/main/resources/ui/app/models/job.js | 56 -
.../main/resources/ui/app/models/saved-query.js | 29 -
.../src/main/resources/ui/app/models/setting.js | 25 -
.../src/main/resources/ui/app/models/table-info.js | 31 -
.../main/resources/ui/app/models/table-property.js | 54 -
.../src/main/resources/ui/app/models/table.js | 26 -
.../hive20/src/main/resources/ui/app/models/udf.js | 26 -
.../src/main/resources/ui/app/models/worksheet.js | 47 -
.../hive20/src/main/resources/ui/app/resolver.js | 21 -
.../hive20/src/main/resources/ui/app/router.js | 79 -
.../src/main/resources/ui/app/routes/.gitkeep | 0
.../main/resources/ui/app/routes/application.js | 54 -
.../resources/ui/app/routes/databases-error.js | 27 -
.../src/main/resources/ui/app/routes/databases.js | 162 -
.../ui/app/routes/databases/database-error.js | 27 -
.../resources/ui/app/routes/databases/database.js | 25 -
.../ui/app/routes/databases/database/index.js | 27 -
.../app/routes/databases/database/tables-error.js | 27 -
.../ui/app/routes/databases/database/tables.js | 109 -
.../app/routes/databases/database/tables/index.js | 28 -
.../databases/database/tables/new-database.js | 65 -
.../ui/app/routes/databases/database/tables/new.js | 116 -
.../databases/database/tables/table-error.js | 27 -
.../app/routes/databases/database/tables/table.js | 121 -
.../routes/databases/database/tables/table/auth.js | 27 -
.../databases/database/tables/table/columns.js | 33 -
.../routes/databases/database/tables/table/ddl.js | 22 -
.../databases/database/tables/table/details.js | 22 -
.../routes/databases/database/tables/table/edit.js | 83 -
.../databases/database/tables/table/index.js | 25 -
.../databases/database/tables/table/partitions.js | 22 -
.../databases/database/tables/table/rename.js | 80 -
.../databases/database/tables/table/stats.js | 22 -
.../databases/database/tables/table/storage.js | 22 -
.../database/tables/table/table-meta-router.js | 27 -
.../routes/databases/database/tables/table/view.js | 22 -
.../databases/database/tables/upload-table.js | 782 -
.../resources/ui/app/routes/databases/index.js | 27 -
.../resources/ui/app/routes/databases/newtable.js | 30 -
.../src/main/resources/ui/app/routes/index.js | 26 -
.../src/main/resources/ui/app/routes/jobs.js | 82 -
.../src/main/resources/ui/app/routes/messages.js | 32 -
.../resources/ui/app/routes/messages/message.js | 31 -
.../src/main/resources/ui/app/routes/password.js | 41 -
.../src/main/resources/ui/app/routes/queries.js | 31 -
.../main/resources/ui/app/routes/queries/index.js | 32 -
.../main/resources/ui/app/routes/queries/new.js | 49 -
.../main/resources/ui/app/routes/queries/query.js | 747 -
.../ui/app/routes/queries/query/loading.js | 24 -
.../resources/ui/app/routes/queries/query/log.js | 104 -
.../ui/app/routes/queries/query/results.js | 112 -
.../ui/app/routes/queries/query/tez-ui.js | 45 -
.../ui/app/routes/queries/query/visual-explain.js | 57 -
.../main/resources/ui/app/routes/savedqueries.js | 140 -
.../main/resources/ui/app/routes/service-check.js | 62 -
.../src/main/resources/ui/app/routes/settings.js | 98 -
.../src/main/resources/ui/app/routes/udfs.js | 78 -
.../src/main/resources/ui/app/routes/udfs/new.js | 201 -
.../main/resources/ui/app/serializers/database.js | 25 -
.../src/main/resources/ui/app/serializers/file.js | 23 -
.../src/main/resources/ui/app/serializers/table.js | 22 -
.../resources/ui/app/services/alert-messages.js | 156 -
.../main/resources/ui/app/services/auto-refresh.js | 149 -
.../resources/ui/app/services/file-resource.js | 33 -
.../src/main/resources/ui/app/services/jobs.js | 103 -
.../main/resources/ui/app/services/ldap-auth.js | 35 -
.../src/main/resources/ui/app/services/query.js | 72 -
.../resources/ui/app/services/saved-queries.js | 84 -
.../resources/ui/app/services/service-check.js | 169 -
.../resources/ui/app/services/stats-service.js | 63 -
.../resources/ui/app/services/table-operations.js | 250 -
.../resources/ui/app/services/tez-view-info.js | 92 -
.../src/main/resources/ui/app/services/udf.js | 65 -
.../src/main/resources/ui/app/styles/app.scss | 1024 -
.../ui/app/styles/bootstrap-overrides.scss | 81 -
.../src/main/resources/ui/app/styles/fonts.scss | 31 -
.../ui/app/styles/power-select-overrides.scss | 24 -
.../resources/ui/app/templates/application.hbs | 52 -
.../resources/ui/app/templates/components/.gitkeep | 0
.../templates/components/alert-message-display.hbs | 34 -
.../ui/app/templates/components/alert-message.hbs | 34 -
.../ui/app/templates/components/column-item.hbs | 127 -
.../ui/app/templates/components/confirm-dialog.hbs | 39 -
.../templates/components/create-database-form.hbs | 31 -
.../ui/app/templates/components/create-table.hbs | 63 -
.../app/templates/components/csv-format-params.hbs | 138 -
.../templates/components/database-search-bar.hbs | 57 -
.../app/templates/components/edit-setting-item.hbs | 42 -
.../ui/app/templates/components/edit-table.hbs | 60 -
.../ui/app/templates/components/export-result.hbs | 46 -
.../app/templates/components/fileresource-item.hbs | 32 -
.../app/templates/components/hdfs-viewer-modal.hbs | 50 -
.../ui/app/templates/components/info-dialog.hbs | 38 -
.../ui/app/templates/components/job-item.hbs | 33 -
.../ui/app/templates/components/jobs-browser.hbs | 102 -
.../ui/app/templates/components/list-filter.hbs | 33 -
.../ui/app/templates/components/list-group.hbs | 22 -
.../ui/app/templates/components/list-item.hbs | 22 -
.../components/multiple-database-search-bar.hbs | 43 -
.../templates/components/notification-message.hbs | 48 -
.../ui/app/templates/components/property-item.hbs | 47 -
.../ui/app/templates/components/query-editor.hbs | 21 -
.../app/templates/components/query-result-log.hbs | 23 -
.../templates/components/query-result-table.hbs | 109 -
.../ui/app/templates/components/radio-button.hbs | 19 -
.../templates/components/service-check-entry.hbs | 47 -
.../ui/app/templates/components/setting-item.hbs | 28 -
.../ui/app/templates/components/setting-list.hbs | 41 -
.../ui/app/templates/components/simple-table.hbs | 42 -
.../components/table-advanced-settings.hbs | 221 -
.../ui/app/templates/components/table-columns.hbs | 44 -
.../app/templates/components/table-properties.hbs | 41 -
.../app/templates/components/table-rename-form.hbs | 31 -
.../app/templates/components/table-statistics.hbs | 174 -
.../ui/app/templates/components/tabs-item.hbs | 24 -
.../ui/app/templates/components/tabs-pane.hbs | 21 -
.../templates/components/top-application-bar.hbs | 33 -
.../ui/app/templates/components/udf-edit.hbs | 85 -
.../ui/app/templates/components/udf-item.hbs | 74 -
.../ui/app/templates/components/udf-new.hbs | 78 -
.../templates/components/upload-table-source.hbs | 112 -
.../ui/app/templates/components/upload-table.hbs | 61 -
.../templates/components/validated-text-field.hbs | 23 -
.../templates/components/visual-explain-detail.hbs | 32 -
.../ui/app/templates/components/visual-explain.hbs | 42 -
.../resources/ui/app/templates/databases-error.hbs | 19 -
.../ui/app/templates/databases-loading.hbs | 21 -
.../main/resources/ui/app/templates/databases.hbs | 72 -
.../ui/app/templates/databases/database-error.hbs | 19 -
.../ui/app/templates/databases/database.hbs | 19 -
.../templates/databases/database/tables-error.hbs | 19 -
.../databases/database/tables-loading.hbs | 24 -
.../ui/app/templates/databases/database/tables.hbs | 46 -
.../databases/database/tables/new-database.hbs | 47 -
.../templates/databases/database/tables/new.hbs | 46 -
.../databases/database/tables/table-error.hbs | 19 -
.../databases/database/tables/table-loading.hbs | 21 -
.../templates/databases/database/tables/table.hbs | 76 -
.../databases/database/tables/table/auth-error.hbs | 35 -
.../database/tables/table/auth-loading.hbs | 23 -
.../databases/database/tables/table/auth.hbs | 66 -
.../databases/database/tables/table/columns.hbs | 44 -
.../databases/database/tables/table/ddl.hbs | 21 -
.../databases/database/tables/table/details.hbs | 65 -
.../databases/database/tables/table/edit.hbs | 45 -
.../databases/database/tables/table/partitions.hbs | 38 -
.../databases/database/tables/table/rename.hbs | 46 -
.../databases/database/tables/table/stats.hbs | 19 -
.../databases/database/tables/table/storage.hbs | 64 -
.../databases/database/tables/table/view.hbs | 40 -
.../databases/database/tables/upload-table.hbs | 45 -
.../resources/ui/app/templates/jobs-loading.hbs | 20 -
.../src/main/resources/ui/app/templates/jobs.hbs | 24 -
.../main/resources/ui/app/templates/messages.hbs | 50 -
.../ui/app/templates/messages/message.hbs | 19 -
.../main/resources/ui/app/templates/password.hbs | 48 -
.../main/resources/ui/app/templates/queries.hbs | 37 -
.../resources/ui/app/templates/queries/query.hbs | 172 -
.../ui/app/templates/queries/query/loading.hbs | 21 -
.../ui/app/templates/queries/query/log.hbs | 35 -
.../ui/app/templates/queries/query/results.hbs | 55 -
.../ui/app/templates/queries/query/tez-ui.hbs | 32 -
.../app/templates/queries/query/visual-explain.hbs | 40 -
.../ui/app/templates/savedqueries-loading.hbs | 21 -
.../resources/ui/app/templates/savedqueries.hbs | 100 -
.../resources/ui/app/templates/service-check.hbs | 52 -
.../ui/app/templates/settings-loading.hbs | 21 -
.../main/resources/ui/app/templates/settings.hbs | 32 -
.../src/main/resources/ui/app/templates/tables.hbs | 19 -
.../resources/ui/app/templates/udfs-loading.hbs | 21 -
.../src/main/resources/ui/app/templates/udfs.hbs | 78 -
.../main/resources/ui/app/templates/udfs/new.hbs | 30 -
.../src/main/resources/ui/app/transforms/date.js | 50 -
.../src/main/resources/ui/app/utils/constants.js | 64 -
.../resources/ui/app/utils/hdfs-picker-config.js | 32 -
.../ui/app/utils/hive-explainer/enhancer.js | 37 -
.../ui/app/utils/hive-explainer/fallback.js | 33 -
.../resources/ui/app/utils/hive-explainer/index.js | 32 -
.../ui/app/utils/hive-explainer/processor.js | 425 -
.../ui/app/utils/hive-explainer/renderer-force.js | 326 -
.../ui/app/utils/hive-explainer/renderer.js | 589 -
.../ui/app/utils/hive-explainer/transformer.js | 569 -
.../views/hive20/src/main/resources/ui/bower.json | 15 -
.../src/main/resources/ui/config/environment.js | 78 -
.../src/main/resources/ui/ember-cli-build.js | 74 -
.../hive20/src/main/resources/ui/package.json | 67 -
.../public/fonts/roboto/roboto-v15-latin-300.eot | Bin 16205 -> 0 bytes
.../public/fonts/roboto/roboto-v15-latin-300.svg | 314 -
.../public/fonts/roboto/roboto-v15-latin-300.ttf | Bin 32664 -> 0 bytes
.../public/fonts/roboto/roboto-v15-latin-300.woff | Bin 18520 -> 0 bytes
.../public/fonts/roboto/roboto-v15-latin-300.woff2 | Bin 14524 -> 0 bytes
.../fonts/roboto/roboto-v15-latin-regular.eot | Bin 16227 -> 0 bytes
.../fonts/roboto/roboto-v15-latin-regular.svg | 308 -
.../fonts/roboto/roboto-v15-latin-regular.ttf | Bin 32652 -> 0 bytes
.../fonts/roboto/roboto-v15-latin-regular.woff | Bin 18520 -> 0 bytes
.../fonts/roboto/roboto-v15-latin-regular.woff2 | Bin 14584 -> 0 bytes
.../views/hive20/src/main/resources/ui/testem.js | 31 -
.../hive20/src/main/resources/ui/tests/.jshintrc | 53 -
.../main/resources/ui/tests/helpers/destroy-app.js | 23 -
.../resources/ui/tests/helpers/flash-message.js | 24 -
.../ui/tests/helpers/module-for-acceptance.js | 41 -
.../main/resources/ui/tests/helpers/resolver.js | 29 -
.../main/resources/ui/tests/helpers/responsive.js | 76 -
.../main/resources/ui/tests/helpers/start-app.js | 36 -
.../hive20/src/main/resources/ui/tests/index.html | 51 -
.../main/resources/ui/tests/integration/.gitkeep | 0
.../src/main/resources/ui/tests/test-helper.js | 28 -
.../src/main/resources/ui/tests/unit/.gitkeep | 0
.../hive20/src/main/resources/ui/vendor/.gitkeep | 0
.../main/resources/ui/vendor/browser-pollyfills.js | 213 -
.../views/hive20/src/main/resources/ui/yarn.lock | 6032 --
.../src/main/resources/view.log4j.properties | 27 -
contrib/views/hive20/src/main/resources/view.xml | 406 -
.../ambari/view/hive20/AsyncJobRunnerImplTest.java | 138 -
.../ambari/view/hive20/ConnectionFailuresTest.java | 157 -
.../hive20/HiveJdbcConnectionDelegateTest.java | 105 -
.../ambari/view/hive20/JobExecutionTest.java | 116 -
.../ambari/view/hive20/PropertyValidatorTest.java | 113 -
.../ambari/view/hive20/ResultSetIteratorTest.java | 100 -
.../hive20/internal/parsers/ParserUtilsTest.java | 66 -
.../generators/AlterTableQueryGeneratorTest.java | 235 -
.../AnalyzeTableQueryGeneratorSpecTest.groovy | 196 -
.../generators/CreateTableQueryGeneratorTest.java | 110 -
.../DeleteDatabaseQueryGeneratorSpecTest.groovy | 65 -
.../InsertFromQueryGeneratorSpecTest.groovy | 69 -
.../RenameTableQueryGeneratorSpecTest.groovy | 104 -
.../hive20/resources/upload/CSVParserTest.java | 275 -
.../hive20/resources/upload/DataParserCSVTest.java | 327 -
.../resources/upload/DataParserJSONTest.java | 264 -
.../hive20/resources/upload/DataParserXMLTest.java | 295 -
.../hive20/resources/upload/JsonParserTest.java | 146 -
.../hive20/resources/upload/OpenCSVParserTest.java | 313 -
.../view/hive20/resources/upload/OpenCSVTest.java | 245 -
.../hive20/resources/upload/ParseUtilsTest.java | 56 -
.../resources/upload/TableDataReaderTest.java | 128 -
.../hive20/resources/upload/XMLParserTest.java | 135 -
.../resources/uploads/UploadServiceTest.java | 60 -
.../HIVE20_ENVIRONMENT.postman_environment.json | 16 -
.../rest/postman/hive20.postman_collection.json | 566 -
contrib/views/hueambarimigration/pom.xml | 286 -
.../datasource/DataSourceAmbariDatabase.java | 63 -
.../datasource/DataSourceHueDatabase.java | 62 -
.../historyqueryset/MysqlQuerySetAmbariDB.java | 58 -
.../historyqueryset/OracleQuerySetAmbariDB.java | 64 -
.../historyqueryset/PostgressQuerySetAmbariDB.java | 22 -
.../hive/historyqueryset/QuerySetAmbariDB.java | 133 -
.../hive/instancedetail/MysqlQuerySetAmbariDB.java | 23 -
.../instancedetail/OracleQuerySetAmbariDB.java | 31 -
.../instancedetail/PostgressQuerySetAmbariDB.java | 22 -
.../hive/instancedetail/QuerySetAmbariDB.java | 48 -
.../hive/savedqueryset/MysqlQuerySetAmbariDB.java | 91 -
.../hive/savedqueryset/OracleQuerySetAmbariDB.java | 83 -
.../savedqueryset/PostgressQuerySetAmbariDB.java | 22 -
.../hive/savedqueryset/QuerySetAmbariDB.java | 206 -
.../pig/instancedetail/MysqlQuerySetAmbariDB.java | 23 -
.../pig/instancedetail/OracleQuerySetAmbariDB.java | 30 -
.../instancedetail/PostgressQuerySetAmbariDB.java | 22 -
.../pig/instancedetail/QuerySetAmbariDB.java | 39 -
.../pig/jobqueryset/MysqlQuerySetAmbariDB.java | 51 -
.../pig/jobqueryset/OracleQuerySetAmbariDB.java | 49 -
.../pig/jobqueryset/PostgressQuerySetAmbariDB.java | 22 -
.../pig/jobqueryset/QuerySetAmbariDB.java | 103 -
.../savedscriptqueryset/MysqlQuerySetAmbariDB.java | 51 -
.../OracleQuerySetAmbariDB.java | 49 -
.../PostgressQuerySetAmbariDB.java | 22 -
.../pig/savedscriptqueryset/QuerySetAmbariDB.java | 93 -
.../pig/udfqueryset/MysqlQuerySetAmbariDB.java | 48 -
.../pig/udfqueryset/OracleQuerySetAmbariDB.java | 46 -
.../pig/udfqueryset/PostgressQuerySetAmbariDB.java | 22 -
.../pig/udfqueryset/QuerySetAmbariDB.java | 82 -
.../hive/historyqueryset/MysqlQuerySetHueDB.java | 23 -
.../hive/historyqueryset/OracleQuerySetHueDB.java | 66 -
.../historyqueryset/PostgressQuerySetHueDB.java | 22 -
.../hive/historyqueryset/QuerySetHueDB.java | 139 -
.../hive/historyqueryset/SqliteQuerySetHueDB.java | 22 -
.../hive/savedqueryset/MysqlQuerySetHueDb.java | 23 -
.../hive/savedqueryset/OracleQuerySetHueDb.java | 71 -
.../hive/savedqueryset/PostgressQuerySetHueDb.java | 22 -
.../hive/savedqueryset/QuerySetHueDb.java | 144 -
.../hive/savedqueryset/SqliteQuerySetHueDb.java | 22 -
.../pig/jobqueryset/MysqlQuerySetHueDb.java | 22 -
.../pig/jobqueryset/OracleQuerySetHueDb.java | 69 -
.../pig/jobqueryset/PostgressQuerySetHueDb.java | 22 -
.../huequeryset/pig/jobqueryset/QuerySetHueDb.java | 141 -
.../pig/jobqueryset/SqliteQuerySetHueDb.java | 22 -
.../savedscriptqueryset/MysqlQuerySetHueDb.java | 22 -
.../savedscriptqueryset/OracleQuerySetHueDb.java | 64 -
.../PostgressQuerySetHueDb.java | 71 -
.../pig/savedscriptqueryset/QuerySetHueDb.java | 142 -
.../savedscriptqueryset/SqliteQuerySetHueDb.java | 24 -
.../huequeryset/pig/udfqueryset/MysqlQuerySet.java | 22 -
.../pig/udfqueryset/OracleQuerySet.java | 41 -
.../pig/udfqueryset/PostgressQuerySet.java | 23 -
.../huequeryset/pig/udfqueryset/QuerySet.java | 75 -
.../pig/udfqueryset/SqliteQuerySet.java | 24 -
.../huequeryset/userdetails/MysqlQuerySet.java | 24 -
.../huequeryset/userdetails/OracleQuerySet.java | 28 -
.../huequeryset/userdetails/PostgressQuerySet.java | 22 -
.../queryset/huequeryset/userdetails/QuerySet.java | 42 -
.../huequeryset/userdetails/SqliteQuerySet.java | 22 -
.../migration/CreateJobId.java | 85 -
.../migration/CreateJobIdRevertChange.java | 84 -
.../migration/InitiateJobMigration.java | 107 -
.../InitiateJobMigrationforRevertchange.java | 85 -
.../configuration/AllInstanceDetailsAmbari.java | 59 -
.../configuration/AmbariDatabaseCheck.java | 62 -
.../configuration/AmbariWebHdfsCheck.java | 60 -
.../configuration/CheckProgresStatus.java | 70 -
.../ConfigurationCheckImplementation.java | 134 -
.../configuration/HiveInstanceDetailsAmbari.java | 53 -
.../configuration/HiveInstanceDetailsUtility.java | 153 -
.../migration/configuration/HueDatabaseCheck.java | 60 -
.../migration/configuration/HueHttpUrlCheck.java | 60 -
.../migration/configuration/HueWebHdfsCheck.java | 60 -
.../configuration/PigInstanceDetailsAmbari.java | 61 -
.../configuration/PigInstanceDetailsUtility.java | 98 -
.../migration/configuration/UserDetailHue.java | 58 -
.../configuration/UserDetailsUtility.java | 80 -
.../historyquery/HiveHistoryMigrationUtility.java | 289 -
.../HiveHistoryQueryMigrationImplementation.java | 631 -
.../hive/historyquery/HiveHistoryStartJob.java | 75 -
.../HiveSavedQueryMigrationImplementation.java | 788 -
.../savedquery/HiveSavedQueryMigrationUtility.java | 320 -
.../hive/savedquery/HiveSavedQueryStartJob.java | 76 -
.../pig/pigjob/PigJobMigrationImplementation.java | 611 -
.../pig/pigjob/PigJobMigrationUtility.java | 239 -
.../migration/pig/pigjob/PigJobStartJob.java | 69 -
.../pig/pigscript/PigSavedScriptStartJob.java | 69 -
.../PigScriptMigrationImplementation.java | 629 -
.../pig/pigscript/PigScriptMigrationUtility.java | 262 -
.../pig/pigudf/PigUdfMigrationImplementation.java | 402 -
.../pig/pigudf/PigUdfMigrationUtility.java | 243 -
.../migration/pig/pigudf/PigUdfStartJob.java | 69 -
.../revertchange/RevertChangeStartJob.java | 70 -
.../revertchange/RevertChangeUtility.java | 225 -
.../persistence/DataStoreStorage.java | 151 -
.../persistence/InstanceKeyValueStorage.java | 132 -
.../persistence/KeyValueStorage.java | 162 -
.../persistence/LocalKeyValueStorage.java | 70 -
.../persistence/PersistentConfiguration.java | 52 -
.../persistence/SmokeTestEntity.java | 45 -
.../huetoambarimigration/persistence/Storage.java | 78 -
.../utils/ContextConfigurationAdapter.java | 260 -
.../persistence/utils/FilteringStrategy.java | 31 -
.../persistence/utils/Indexed.java | 36 -
.../persistence/utils/ItemNotFound.java | 25 -
.../utils/OnlyOwnersFilteringStrategy.java | 33 -
.../persistence/utils/Owned.java | 36 -
.../persistence/utils/PersonalResource.java | 22 -
.../persistence/utils/StorageUtil.java | 94 -
.../resources/CRUDResourceManager.java | 123 -
.../resources/PersonalCRUDResourceManager.java | 105 -
.../resources/SharedCRUDResourceManager.java | 50 -
.../scripts/MigrationResourceManager.java | 52 -
.../scripts/MigrationResourceProvider.java | 108 -
.../scripts/models/ConfigurationModel.java | 52 -
.../resources/scripts/models/HiveModel.java | 114 -
.../resources/scripts/models/InstanceModel.java | 41 -
.../resources/scripts/models/JobReturnIdModel.java | 43 -
.../resources/scripts/models/MigrationModel.java | 130 -
.../scripts/models/MigrationResponse.java | 153 -
.../resources/scripts/models/PigModel.java | 92 -
.../scripts/models/ProgressCheckModel.java | 60 -
.../resources/scripts/models/UserModel.java | 48 -
.../utils/BadRequestFormattedException.java | 27 -
.../huetoambarimigration/utils/FilePaginator.java | 72 -
.../utils/MisconfigurationFormattedException.java | 47 -
.../utils/NotFoundFormattedException.java | 27 -
.../utils/ServiceFormattedException.java | 101 -
.../src/main/resources/image/updateimg.gif | Bin 56233 -> 0 bytes
.../resources/ui/hueambarimigration-view/.bowerrc | 4 -
.../ui/hueambarimigration-view/.editorconfig | 34 -
.../ui/hueambarimigration-view/.ember-cli | 27 -
.../ui/hueambarimigration-view/.gitignore | 44 -
.../resources/ui/hueambarimigration-view/.jshintrc | 32 -
.../ui/hueambarimigration-view/.travis.yml | 38 -
.../ui/hueambarimigration-view/.watchmanconfig | 21 -
.../resources/ui/hueambarimigration-view/README.md | 67 -
.../app/adapters/application.js | 47 -
.../ui/hueambarimigration-view/app/app.js | 38 -
.../app/components/.gitkeep | 0
.../app/controllers/.gitkeep | 0
.../hueambarimigration-view/app/helpers/.gitkeep | 0
.../ui/hueambarimigration-view/app/index.html | 40 -
.../ui/hueambarimigration-view/app/models/.gitkeep | 0
.../app/models/allinstancedetail.js | 23 -
.../app/models/ambaridatabase.js | 24 -
.../app/models/ambariwebhdfsurl.js | 24 -
.../app/models/checkprogress.js | 32 -
.../app/models/getmigrationresultid.js | 23 -
.../app/models/hiveinstancedetail.js | 23 -
.../app/models/huedatabase.js | 24 -
.../app/models/huehttpurl.js | 24 -
.../app/models/huewebhdfsurl.js | 24 -
.../app/models/piginstancedetail.js | 23 -
.../app/models/returnjobid.js | 23 -
.../app/models/returnjobidforrevertchange.js | 23 -
.../app/models/startmigration.js | 23 -
.../app/models/startrevertchange.js | 23 -
.../app/models/usersdetail.js | 23 -
.../ui/hueambarimigration-view/app/resolver.js | 20 -
.../ui/hueambarimigration-view/app/router.js | 38 -
.../ui/hueambarimigration-view/app/routes/.gitkeep | 0
.../app/routes/check-configuration.js | 213 -
.../app/routes/home-page.js | 21 -
.../app/routes/home-page/hive-history.js | 146 -
.../app/routes/home-page/hive-saved-query.js | 142 -
.../app/routes/home-page/pig-job.js | 143 -
.../app/routes/home-page/pig-script.js | 144 -
.../app/routes/home-page/pig-udf.js | 140 -
.../app/routes/home-page/revert-change.js | 103 -
.../ui/hueambarimigration-view/app/routes/index.js | 24 -
.../app/serializers/application.js | 19 -
.../ui/hueambarimigration-view/app/styles/app.css | 25 -
.../ui/hueambarimigration-view/app/styles/app.scss | 18 -
.../app/templates/application.hbs | 24 -
.../app/templates/check-configuration.hbs | 153 -
.../app/templates/home-page.hbs | 43 -
.../app/templates/home-page/hive-history.hbs | 133 -
.../app/templates/home-page/hive-saved-query.hbs | 134 -
.../app/templates/home-page/pig-job.hbs | 135 -
.../app/templates/home-page/pig-script.hbs | 135 -
.../app/templates/home-page/pig-udf.hbs | 118 -
.../app/templates/home-page/revert-change.hbs | 99 -
.../ui/hueambarimigration-view/bower.json | 14 -
.../hueambarimigration-view/config/environment.js | 63 -
.../ui/hueambarimigration-view/ember-cli-build.js | 61 -
.../ui/hueambarimigration-view/package.json | 51 -
.../hueambarimigration-view/public/crossdomain.xml | 15 -
.../ui/hueambarimigration-view/public/robots.txt | 3 -
.../resources/ui/hueambarimigration-view/testem.js | 29 -
.../ui/hueambarimigration-view/tests/.jshintrc | 53 -
.../tests/helpers/destroy-app.js | 22 -
.../tests/helpers/module-for-acceptance.js | 40 -
.../tests/helpers/resolver.js | 28 -
.../tests/helpers/start-app.js | 35 -
.../ui/hueambarimigration-view/tests/index.html | 48 -
.../hueambarimigration-view/tests/test-helper.js | 25 -
.../ui/hueambarimigration-view/vendor/.gitkeep | 0
.../resources/ui/hueambarimigration-view/yarn.lock | 5553 --
.../src/main/resources/view.log4j.properties | 29 -
.../hueambarimigration/src/main/resources/view.xml | 236 -
contrib/views/jobs/pom.xml | 244 -
.../org/apache/ambari/view/jobs/ProxyServlet.java | 68 -
.../apache/ambari/view/jobs/ViewController.java | 36 -
.../ambari/view/jobs/ViewControllerImpl.java | 66 -
.../org/apache/ambari/view/jobs/ViewStatus.java | 44 -
.../ambari/view/jobs/rest/ViewStatusResource.java | 46 -
.../views/jobs/src/main/resources/WEB-INF/web.xml | 37 -
contrib/views/jobs/src/main/resources/ui/.bowerrc | 3 -
.../views/jobs/src/main/resources/ui/.editorconfig | 22 -
.../jobs/src/main/resources/ui/.gitattributes | 1 -
.../views/jobs/src/main/resources/ui/.gitignore | 9 -
contrib/views/jobs/src/main/resources/ui/.jshintrc | 24 -
.../views/jobs/src/main/resources/ui/Gruntfile.js | 396 -
.../resources/ui/app/img/glyphicons-halflings.png | Bin 13826 -> 0 bytes
.../jobs/src/main/resources/ui/app/index.html | 56 -
.../jobs/src/main/resources/ui/app/scripts/app.js | 76 -
.../resources/ui/app/scripts/assets/clusters.json | 10 -
.../ui/app/scripts/assets/components.json | 94 -
.../ui/app/scripts/assets/components_hosts.json | 16 -
.../ui/app/scripts/assets/configurations.json | 14 -
.../ui/app/scripts/assets/desired_configs.json | 20 -
.../ui/app/scripts/assets/hive-queries.json | 388 -
.../ui/app/scripts/assets/hive-query-2.json | 8 -
.../resources/ui/app/scripts/assets/services.json | 39 -
.../ui/app/scripts/assets/tezDag-name-to-id.json | 552 -
.../resources/ui/app/scripts/assets/tezDag.json | 21 -
.../ui/app/scripts/assets/tezDagVertex.json | 221 -
.../ui/app/scripts/controllers/job_controller.js | 120 -
.../ui/app/scripts/controllers/jobs_controller.js | 704 -
.../main/resources/ui/app/scripts/helpers/ajax.js | 245 -
.../main/resources/ui/app/scripts/helpers/date.js | 196 -
.../main/resources/ui/app/scripts/helpers/jobs.js | 262 -
.../main/resources/ui/app/scripts/helpers/misc.js | 67 -
.../resources/ui/app/scripts/helpers/number.js | 90 -
.../resources/ui/app/scripts/helpers/string.js | 114 -
.../resources/ui/app/scripts/helpers/validator.js | 26 -
.../scripts/mappers/application_status_mapper.js | 349 -
.../ui/app/scripts/mappers/jobs/hive_job_mapper.js | 219 -
.../app/scripts/mappers/jobs/hive_jobs_mapper.js | 111 -
.../ui/app/scripts/mappers/server_data_mapper.js | 133 -
.../ui/app/scripts/mixins/run_periodically.js | 78 -
.../resources/ui/app/scripts/models/component.js | 40 -
.../ui/app/scripts/models/jobs/abstract_job.js | 72 -
.../ui/app/scripts/models/jobs/hive_job.js | 32 -
.../ui/app/scripts/models/jobs/tez_dag.js | 213 -
.../resources/ui/app/scripts/models/service.js | 40 -
.../src/main/resources/ui/app/scripts/router.js | 22 -
.../ui/app/scripts/routes/application_route.js | 68 -
.../src/main/resources/ui/app/scripts/store.js | 19 -
.../main/resources/ui/app/scripts/translations.js | 112 -
.../resources/ui/app/scripts/views/filter_view.js | 491 -
.../views/job/hive_job_details_tez_dag_view.js | 979 -
.../app/scripts/views/job/hive_job_details_view.js | 430 -
.../scripts/views/jobs/select_custom_date_view.js | 36 -
.../resources/ui/app/scripts/views/jobs_view.js | 350 -
.../resources/ui/app/scripts/views/sort_view.js | 253 -
.../resources/ui/app/scripts/views/table_view.js | 362 -
.../src/main/resources/ui/app/styles/main.less | 638 -
.../resources/ui/app/templates/application.hbs | 21 -
.../src/main/resources/ui/app/templates/index.hbs | 19 -
.../resources/ui/app/templates/job/error_popup.hbs | 19 -
.../app/templates/job/hive_job_details_tez_dag.hbs | 44 -
.../ui/app/templates/job/hover_op_table.hbs | 35 -
.../main/resources/ui/app/templates/job/job.hbs | 216 -
.../src/main/resources/ui/app/templates/jobs.hbs | 91 -
.../ui/app/templates/jobs/custom_date_popup.hbs | 39 -
.../resources/ui/app/templates/jobs/jobs_name.hbs | 19 -
.../ui/app/templates/sort_field_template.hbs | 19 -
.../table/navigation/pagination_first.hbs | 19 -
.../templates/table/navigation/pagination_last.hbs | 19 -
.../templates/table/navigation/pagination_left.hbs | 19 -
.../table/navigation/pagination_right.hbs | 19 -
.../resources/ui/app/templates/wrapper_layout.hbs | 19 -
.../ui/app/templates/wrapper_template.hbs | 25 -
.../views/jobs/src/main/resources/ui/bower.json | 20 -
.../views/jobs/src/main/resources/ui/package.json | 36 -
.../views/jobs/src/main/resources/ui/test/.bowerrc | 3 -
.../jobs/src/main/resources/ui/test/bower.json | 9 -
.../jobs/src/main/resources/ui/test/index.html | 44 -
.../jobs/src/main/resources/ui/test/spec/test.js | 29 -
contrib/views/jobs/src/main/resources/ui/yarn.lock | 2537 -
.../jobs/src/main/resources/view.log4j.properties | 28 -
contrib/views/jobs/src/main/resources/view.xml | 37 -
.../pig/src/main/resources/ui/pig-web/.bowerrc | 5 +
contrib/views/pig/src/main/resources/view.xml | 1 +
contrib/views/pom.xml | 7 -
contrib/views/storm/pom.xml | 225 -
.../java/org/apache/ambari/storm/ProxyServlet.java | 108 -
.../apache/ambari/storm/StormDetailsServlet.java | 81 -
.../views/storm/src/main/resources/WEB-INF/web.xml | 45 -
contrib/views/storm/src/main/resources/ui/.babelrc | 25 -
.../storm/src/main/resources/ui/.eslintignore.js | 3 -
.../views/storm/src/main/resources/ui/.eslintrc.js | 58 -
.../storm/src/main/resources/ui/app/scripts/app.js | 40 -
.../ui/app/scripts/components/BarChart.jsx | 429 -
.../ui/app/scripts/components/Breadcrumbs.jsx | 45 -
.../ui/app/scripts/components/CommonExpanded.jsx | 30 -
.../app/scripts/components/CommonNotification.jsx | 69 -
.../ui/app/scripts/components/CommonPagination.jsx | 56 -
.../scripts/components/CommonSwitchComponent.jsx | 41 -
.../app/scripts/components/CommonWindowPanel.jsx | 99 -
.../scripts/components/CustomToastContainer.jsx | 41 -
.../ui/app/scripts/components/Editable.jsx | 127 -
.../ui/app/scripts/components/FSModel.jsx | 149 -
.../ui/app/scripts/components/FSReactToastr.jsx | 37 -
.../resources/ui/app/scripts/components/Footer.jsx | 28 -
.../app/scripts/components/LogLevelComponent.jsx | 236 -
.../ui/app/scripts/components/ProfilingView.jsx | 168 -
.../ui/app/scripts/components/RadialChart.jsx | 134 -
.../app/scripts/components/RebalanceTopology.jsx | 152 -
.../ui/app/scripts/components/SearchLogs.jsx | 84 -
.../ui/app/scripts/components/TopologyGraph.jsx | 208 -
.../ui/app/scripts/containers/BaseContainer.jsx | 50 -
.../ui/app/scripts/containers/ClusterSummary.jsx | 125 -
.../app/scripts/containers/ComponentDetailView.jsx | 714 -
.../ui/app/scripts/containers/Dashboard.jsx | 52 -
.../app/scripts/containers/NimbusConfigSummary.jsx | 126 -
.../ui/app/scripts/containers/NimbusSummary.jsx | 150 -
.../app/scripts/containers/SupervisorSummary.jsx | 165 -
.../app/scripts/containers/TopologyDetailView.jsx | 862 -
.../ui/app/scripts/containers/TopologyListing.jsx | 222 -
.../src/main/resources/ui/app/scripts/main.js | 46 -
.../resources/ui/app/scripts/rest/TopologyREST.js | 118 -
.../resources/ui/app/scripts/routers/routes.jsx | 68 -
.../resources/ui/app/scripts/utils/Constants.js | 45 -
.../main/resources/ui/app/scripts/utils/Utils.js | 51 -
.../main/resources/ui/app/styles/css/bootstrap.css | 6757 ---
.../ui/app/styles/css/font-awesome.min.css | 4 -
.../src/main/resources/ui/app/styles/css/style.css | 836 -
.../resources/ui/app/styles/css/toastr.min.css | 1 -
.../ui/app/styles/fonts/fontawesome-webfont.eot | Bin 76518 -> 0 bytes
.../ui/app/styles/fonts/fontawesome-webfont.svg | 685 -
.../ui/app/styles/fonts/fontawesome-webfont.ttf | Bin 152796 -> 0 bytes
.../ui/app/styles/fonts/fontawesome-webfont.woff | Bin 90412 -> 0 bytes
.../ui/app/styles/fonts/fontawesome-webfont.woff2 | Bin 71896 -> 0 bytes
.../styles/fonts/glyphicons-halflings-regular.eot | Bin 20127 -> 0 bytes
.../styles/fonts/glyphicons-halflings-regular.svg | 288 -
.../styles/fonts/glyphicons-halflings-regular.ttf | Bin 45404 -> 0 bytes
.../styles/fonts/glyphicons-halflings-regular.woff | Bin 23424 -> 0 bytes
.../fonts/glyphicons-halflings-regular.woff2 | Bin 18028 -> 0 bytes
.../main/resources/ui/app/styles/img/icon-bolt.png | Bin 2157 -> 0 bytes
.../resources/ui/app/styles/img/icon-spout.png | Bin 2620 -> 0 bytes
.../main/resources/ui/app/styles/img/loader.gif | Bin 15017 -> 0 bytes
.../resources/ui/config/webpack.config.base.js | 101 -
.../ui/config/webpack.config.development.js | 64 -
.../ui/config/webpack.config.production.js | 131 -
.../storm/src/main/resources/ui/dev-server.js | 101 -
.../views/storm/src/main/resources/ui/index.html | 47 -
.../views/storm/src/main/resources/ui/package.json | 110 -
.../storm/src/main/resources/view.log4j.properties | 27 -
contrib/views/storm/src/main/resources/view.xml | 44 -
contrib/views/tez/pom.xml | 282 -
contrib/views/tez/readme.md | 90 -
.../ambari/view/tez/ConfigurationService.java | 50 -
.../apache/ambari/view/tez/PropertyService.java | 83 -
.../org/apache/ambari/view/tez/ProxyServlet.java | 130 -
.../org/apache/ambari/view/tez/SettingService.java | 47 -
.../org/apache/ambari/view/tez/ViewController.java | 64 -
.../apache/ambari/view/tez/ViewControllerImpl.java | 110 -
.../org/apache/ambari/view/tez/ViewStatus.java | 44 -
.../view/tez/exceptions/TezWebAppException.java | 104 -
.../ambari/view/tez/rest/AtsProxyResource.java | 52 -
.../ambari/view/tez/rest/BaseProxyResource.java | 89 -
.../view/tez/rest/BaseRedirectionResource.java | 59 -
.../ambari/view/tez/rest/RMProxyResource.java | 52 -
.../ambari/view/tez/rest/RMRedirectResource.java | 51 -
.../ambari/view/tez/rest/ViewStatusResource.java | 46 -
.../apache/ambari/view/tez/utils/ProxyHelper.java | 106 -
.../views/tez/src/main/resources/WEB-INF/web.xml | 37 -
.../main/resources/ui/ambari-scripts/init-view.js | 302 -
.../tez/src/main/resources/view.log4j.properties | 27 -
contrib/views/tez/src/main/resources/view.xml | 102 -
.../ambari/view/tez/utils/ProxyHelperTest.java | 71 -
.../views/wfmanager/src/main/resources/ui/.bowerrc | 5 +
docs/pom.xml | 39 +-
docs/src/site/apt/index.apt | 2 +-
docs/src/site/apt/whats-new.apt | 30 +-
docs/src/site/site.xml | 2 +
pom.xml | 34 +-
3717 files changed, 135495 insertions(+), 236137 deletions(-)
diff --cc ambari-common/src/main/python/resource_management/libraries/execution_command/execution_command.py
index 506deef,0000000..98bd62f
mode 100644,000000..100644
--- a/ambari-common/src/main/python/resource_management/libraries/execution_command/execution_command.py
+++ b/ambari-common/src/main/python/resource_management/libraries/execution_command/execution_command.py
@@@ -1,434 -1,0 +1,434 @@@
+#!/usr/bin/env python
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+"""
+
+__all__ = ["ExecutionCommand"]
+
+from resource_management.libraries.execution_command import module_configs
+
+
+class ExecutionCommand(object):
+ """
+ The class has two private objects: _execution_command maps to a command.json and
+ _module_config maps to configurations block and configuratonAttributes within this
+ command.json. This class provides a set of APIs to retrieve all command related info.
+ The caller should not access to command.json to get the configuration info directly.
+ """
+
+ def __init__(self, command):
+ """
+ _execution_command is a wrapper object of a dict object maps to command.json
+ _module_config is an wrapper object of configuration and configurationAttributes dict
+ objects maps to configuration and configurationAttributes blocks within command.json
+ :param command: json string or a python dict object
+ """
+ self.__execution_command = command
+ self.__module_configs = module_configs.ModuleConfigs(self.__get_value("configurations"), self.__get_value("configurationAttributes"))
+
+ def __get_value(self, key, default_value=None):
+ """
+ A private method to query value with the full path of key, if key does not exist, return default_value
+ :param key: query key string
+ :param default_value: if key does not exist, return this value
+ :return: the value maps to query key
+ """
+ sub_keys = filter(None, key.split('/'))
+ value = self.__execution_command
+ try:
+ for sub_key in sub_keys:
+ if not sub_key in value:
+ return default_value
+ value = value[sub_key]
+ if value == None:
+ value = default_value
+ return value
+ except:
+ return default_value
+
+ def get_value(self, query_string, default_value=None):
+ """
+ Generic query API to retrieve config attribute from execution_command directly
+ :param query_string: full query key string
+ :param default_value: if key does not exist, return default value
+ :return: config attribute
+ """
+ return self.__get_value(query_string, default_value)
+
+ """
+ Global variables section
+ """
+
+ def get_module_configs(self):
+ return self.__module_configs
+
+ def get_module_name(self):
+ """
+ Retrieve service name from command.json, i.e 'zookeeper', 'hdfs'
+ :return: service name
+ """
+ return self.__get_value("serviceName")
+
+ def get_component_type(self):
+ """
+ Retrieve host role from command.json, i.e "role": "ZOOKEEPER_SERVER"
+ :return:
+ """
+ return self.__get_value("role")
+
+ def get_component_instance_name(self):
+ """
+ At this time it returns hardcoded 'default' name
+ :return: 'default' string
+ """
+ return "default"
+
+ def get_servicegroup_name(self):
+ """
+ Retrieve servicegroup name from command.json, servicegroup has 1:1 map to mpack at this time
+ :return: servicegroup name
+ """
+ return self.__get_value("serviceGroupName")
+
+ def get_cluster_name(self):
+ """
+ Retrieve cluster name from command.json
+ :return: cluster name
+ """
+ return self.__get_value("clusterName")
+
+ def get_repository_file(self):
+ """
+ Retrieve respository dict about mpack info from command.json
+ :return: repository file name
+ """
+ return self.__get_value("repositoryFile")
+
+ def get_local_components(self):
+ """
+ Retrieve a list of service components from command.json. i.e localComponents": ["ZOOKEEPER_CLIENT"]
+ :return: list of components
+ """
+ return self.__get_value("localComponents", [])
+
+ """
+ Ambari variables section
+ """
+
+ def get_jdk_location(self):
+ """
+ Retrieve URL of jdk from command.json. i.e "jdk_location": "http://c7302.ambari.apache.org:8080/resources/"
+ :return: jdk url string
+ """
+ return self.__get_value("ambariLevelParams/jdk_location")
+
+ def get_jdk_name(self):
+ """
+ Retrieve jdk name from command.json. i.e "jdk_name": "jdk-8u112-linux-x64.tar.gz"
+ :return: jdk name string
+ """
+ return self.__get_value("ambariLevelParams/jdk_name")
+
+ def get_java_home(self):
+ """
+ Retrieve java home from command.json. i.e "java_home": "/usr/jdk64/jdk1.8.0_112"
+ :return: java home string
+ """
+ return self.__get_value("ambariLevelParams/java_home")
+
+ def get_java_version(self):
+ """
+ Retrieve java version from command.json, i.e "java_version": "8", note "8" will convert to 8
+ :return: an integer represents java version
+ """
+ from resource_management.libraries.functions.expect import expect_v2
+ return expect_v2("ambariLevelParams/java_version", int)
+
+ def get_jce_name(self):
+ """
+ Retrieve jce name from command.json, i.e "jce_name": "jce_policy-8.zip"
+ :return: jce name string
+ """
+ return self.__get_value("ambariLevelParams/jce_name")
+
+ def get_db_driver_file_name(self):
+ """
+ Retrieve database driver file name, i.e "db_driver_filename": "mysql-connector-java.jar"
+ :return: DB driver name string
+ """
+ return self.__get_value('ambariLevelParams/db_driver_filename')
+
+ def get_db_name(self):
+ """
+ Retrieve database name, i.e Ambari server's db name is "db_name": "ambari"
+ :return: DB name
+ """
+ return self.__get_value('ambariLevelParams/db_name')
+
+ def get_oracle_jdbc_url(self):
+ """
+ Retrieve oracle database jdbc driver url,
+ i.e "oracle_jdbc_url": "http://c7302.ambari.apache.org:8080/resources//ojdbc6.jar"
+ :return: oracle jdbc url
+ """
+ return self.__get_value('ambariLevelParams/oracle_jdbc_url')
+
+ def get_mysql_jdbc_url(self):
+ """
+ Retrieve mysql database jdbc driver url,
+ i.e "mysql_jdbc_url": "http://c7302.ambari.apache.org:8080/resources//mysql-connector-java.jar"
+ :return: mysql jdbc url
+ """
+ return self.__get_value('ambariLevelParams/mysql_jdbc_url')
+
+ def get_agent_stack_retry_count(self):
+ """
+ Retrieve retry count for stack deployment on agent,
+ i.e "agent_stack_retry_count": "5"
+ :return: retry count for stack deployment on agent
+ """
+ from resource_management.libraries.functions.expect import expect_v2
+ return expect_v2('ambariLevelParams/agent_stack_retry_count', int, 5)
+
+ def check_agent_stack_want_retry_on_unavailability(self):
+ """
+ Check if retry is needed when agent is not reachable
+ :return: True or False
+ """
+ return self.__get_value('ambariLevelParams/agent_stack_retry_on_unavailability')
+
+ def get_ambari_server_host(self):
+ """
+ Retrieve ambari server host url from command.json, i.e "ambari_server_host": "c7302.ambari.apache.org"
+ :return: ambari server url
+ """
+ return self.__get_value("ambariLevelParams/ambari_server_host")
+
+ def get_ambari_server_port(self):
+ """
+ Retrieve ambar server port number from command.json, i.e "ambari_server_port": "8080"
+ :return: amabari server port number
+ """
+ return self.__get_value("ambariLevelParams/ambari_server_port")
+
+ def is_ambari_server_use_ssl(self):
+ """
+ Check if ssl is needed to connect to ambari server
+ :return: True or False
+ """
+ return self.__get_value("ambariLevelParams/ambari_server_use_ssl", False)
+
+ def is_host_system_prepared(self):
+ """
+ Check a global flag enabling or disabling the sysprep feature
+ :return: True or False
+ """
+ return self.__get_value("ambariLevelParams/host_sys_prepped", False)
+
+ def is_gpl_license_accepted(self):
+ """
+ Check ambari server accepts gpl license or not
+ :return: True or False
+ """
+ return self.__get_value("ambariLevelParams/gpl_license_accepted", False)
+
+ """
+ Cluster related variables section
+ """
+
+ def get_mpack_name(self):
+ """
+ Retrieve mpack name from command.json, i.e "stack_name": "HDPCORE"
+ :return: mpack name string
+ """
+ return self.__get_value("stackSettings/stack_name")
+
+ def get_mpack_version(self):
+ """
+ Retrieve mpack version from command.json, i.e "stack_version": "1.0.0-b224"
+ :return: mpack version string
+ """
+ return self.__get_value("stackSettings/stack_version")
+
+ def get_user_groups(self):
+ """
+ Retrieve ambari server user groups, i.e "user_groups": "{\"zookeeper\":[\"hadoop\"],\"ambari-qa\":[\"hadoop\"]}"
+ :return: a user group dict object
+ """
+ return self.__get_value("stackSettings/user_groups")
+
+ def get_group_list(self):
+ """
+ Retrieve a list of user groups from command.json, i.e "group_list": "[\"hadoop\"]"
+ :return: a list of groups
+ """
+ return self.__get_value("stackSettings/group_list")
+
+ def get_user_list(self):
+ """
+ Retrieve a list of users from command.json, i.e "user_list": "[\"zookeeper\",\"ambari-qa\"]"
+ :return: a list of users
+ """
+ return self.__get_value("stackSettings/user_list")
+
+ """
+ Agent related variable section
+ """
+
+ def get_host_name(self):
+ """
+ Retrieve host name on which ambari agent is running
+ :return: host name
+ """
+ return self.__get_value("agentLevelParams/hostname")
+
+ def check_agent_config_execute_in_parallel(self):
+ """
+ Check if config commands can be executed in parallel in ambari agent
+ :return: True or False
+ """
+ return int(self.__get_value("agentConfigParams/agent/parallel_execution", 0))
+
+ def get_agent_cache_dir(self):
+ """
+ The root directory in which ambari agent stores cache or log etc,
+ i.e "agentCacheDir": "/var/lib/ambari-agent/cache"
+ :return: the cache directory path
+ """
+ return self.__get_value('agentLevelParams/agentCacheDir')
+
+ """
+ Host related variables section
+ """
+
+ def get_repo_info(self):
+ return self.__get_value('hostLevelParams/repoInfo')
+
+ def get_service_repo_info(self):
+ return self.__get_value('hostLevelParams/service_repo_info')
+
+ """
+ Component related variables section
+ """
+
+ def check_unlimited_key_jce_required(self):
+ """
+ Check unlimited jce key is required or not
+ :return: True or False
+ """
+ return self.__get_value('componentLevelParams/unlimited_key_jce_required', False)
+
+ """
+ Command related variables section
+ """
+
+ def get_new_mpack_version_for_upgrade(self):
+ """
+ New Cluster Stack Version that is defined during the RESTART of a Rolling Upgrade
+ :return:
+ """
+ return self.__get_value("commandParams/version")
+
+ def check_command_retry_enabled(self):
+ """
+ Check need to retry command or not
+ :return: True or False
+ """
+ return self.__get_value('commandParams/command_retry_enabled', False)
+
+ def check_upgrade_direction(self):
+ return self.__get_value('commandParams/upgrade_direction')
+
+ def get_upgrade_type(self):
+ return self.__get_value('commandParams/upgrade_type', '')
+
+ def is_rolling_restart_in_upgrade(self):
+ return self.__get_value('commandParams/rolling_restart', False)
+
+ def is_update_files_only(self):
+ return self.__get_value('commandParams/update_files_only', False)
+
+ def get_deploy_phase(self):
+ return self.__get_value('commandParams/phase')
+
+ def get_dfs_type(self):
- return self.__get_value('commandParams/dfs_type')
++ return self.__get_value('clusterLevelParams/dfs_type')
+
+ def get_module_package_folder(self):
+ return self.__get_value('commandParams/service_package_folder')
+
+ def get_ambari_java_home(self):
+ return self.__get_value('commandParams/ambari_java_home')
+
+ def get_ambari_java_name(self):
+ return self.__get_value('commandParams/ambari_java_name')
+
+ def get_ambari_jce_name(self):
+ return self.__get_value('commandParams/ambari_jce_name')
+
+ def get_ambari_jdk_name(self):
+ return self.__get_value('commandParams/ambari_jdk_name')
+
+ def need_refresh_topology(self):
+ return self.__get_value('commandParams/refresh_topology', False)
+
+ def check_only_update_files(self):
+ return self.__get_value('commandParams/update_files_only', False)
+
+ def get_desired_namenode_role(self):
+ """
+ The desired role is only available during a Non-Rolling Upgrade in HA.
+ The server calculates which of the two NameNodes will be the active,
+ and the other the standby since they are started using different commands.
+ :return: the node's role (active or standby)
+ """
+ return self.__get_value('commandParams/desired_namenode_role')
+
+ def get_node(self, type):
+ key = "commandParams/" + type + "node"
+ return self.__get_value(key)
+
+ """
+ Role related variables section
+ """
+
+ def is_upgrade_suspended(self):
+ return self.__get_value('roleParams/upgrade_suspended', False)
+
+ """
+ Cluster Host Info
+ """
+
+ def get_component_hosts(self, component_name):
+ key = "clusterHostInfo/" + component_name + "_hosts"
+ if component_name == "oozie_server":
+ key = "clusterHostInfo/" + component_name
+ return self.__get_value(key, [])
+
+ def get_component_host(self, component_name):
+ key = "clusterHostInfo/" + component_name + "_host"
+ return self.__get_value(key, [])
+
+ def get_all_hosts(self):
+ return self.__get_value('clusterHostInfo/all_hosts', [])
+
+ def get_all_racks(self):
+ return self.__get_value('clusterHostInfo/all_racks', [])
+
+ def get_all_ipv4_ips(self):
+ return self.__get_value('clusterHostInfo/all_ipv4_ips', [])
diff --cc ambari-common/src/main/python/resource_management/libraries/script/script.py
index 234d94a,556412a..93fe672
--- a/ambari-common/src/main/python/resource_management/libraries/script/script.py
+++ b/ambari-common/src/main/python/resource_management/libraries/script/script.py
@@@ -775,23 -793,9 +799,23 @@@ class Script(object)
except Exception as err:
Logger.exception("Unable to load available packages")
self.available_packages_in_repos = []
-
- def create_component_instance(self):
- # should be used only when mpack-instance-manager is available
- from resource_management.libraries.functions.mpack_manager_helper import create_component_instance
- config = self.get_config()
- execution_command = self.get_execution_command()
- mpack_name = execution_command.get_mpack_name()
- mpack_version = execution_command.get_mpack_version()
- mpack_instance_name = execution_command.get_servicegroup_name()
- module_name = execution_command.get_module_name()
- component_type = execution_command.get_component_type()
- component_instance_name = execution_command.get_component_instance_name()
-
- create_component_instance(mpack_name=mpack_name, mpack_version=mpack_version, instance_name=mpack_instance_name,
- module_name=module_name, components_instance_type=component_type,
- component_instance_name=component_instance_name)
--
+ return self.available_packages_in_repos
+
++def create_component_instance(self):
++ # should be used only when mpack-instance-manager is available
++ from resource_management.libraries.functions.mpack_manager_helper import create_component_instance
++ config = self.get_config()
++ execution_command = self.get_execution_command()
++ mpack_name = execution_command.get_mpack_name()
++ mpack_version = execution_command.get_mpack_version()
++ mpack_instance_name = execution_command.get_servicegroup_name()
++ module_name = execution_command.get_module_name()
++ component_type = execution_command.get_component_type()
++ component_instance_name = execution_command.get_component_instance_name()
++
++ create_component_instance(mpack_name=mpack_name, mpack_version=mpack_version, instance_name=mpack_instance_name,
++ module_name=module_name, components_instance_type=component_type,
++ component_instance_name=component_instance_name)
def install_packages(self, env):
"""
diff --cc ambari-server/src/main/java/org/apache/ambari/annotations/ExperimentalFeature.java
index d85d51c,bc399ff..0e5dc3a
--- a/ambari-server/src/main/java/org/apache/ambari/annotations/ExperimentalFeature.java
+++ b/ambari-server/src/main/java/org/apache/ambari/annotations/ExperimentalFeature.java
@@@ -40,24 -40,13 +40,35 @@@ public enum ExperimentalFeature
MULTI_SERVICE,
/**
+ * Component version reporting, storage, and comparison.
+ */
+ VERSION_REPORTING,
+
+ /**
+ * For code that is for upgrading Mpacks. Use this to mark code that may ultimately
+ * be removed.
+ */
+ MPACK_UPGRADES,
+
+ /**
+ * Use this annotation when a test needs to be written.
+ */
+ UNIT_TEST_REQUIRED,
+
+ /**
+ * Loading and dealing with upgrade checks dynamically and injecting
+ * configurations into them.
+ */
- UPGRADE_PACK_PRE_CHECKS;
++ UPGRADE_PACK_PRE_CHECKS,
++
++ /*
+ * Support for service-specific repos for custom services
+ */
+ CUSTOM_SERVICE_REPOS,
+
+ /**
+ * Automatically removing Kerberos identities when a service or component is
+ * removed.
+ */
+ ORPHAN_KERBEROS_IDENTITY_REMOVAL;
}
diff --cc ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapper.java
index 4898db8,29156ce..dc341b0
--- a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapper.java
@@@ -33,13 -32,10 +33,14 @@@ import org.apache.ambari.server.agent.C
import org.apache.ambari.server.agent.ExecutionCommand;
import org.apache.ambari.server.api.services.AmbariMetaInfo;
import org.apache.ambari.server.configuration.Configuration;
+ import org.apache.ambari.server.controller.spi.SystemException;
import org.apache.ambari.server.orm.dao.HostRoleCommandDAO;
+import org.apache.ambari.server.orm.dao.MpackDAO;
+import org.apache.ambari.server.orm.dao.ServiceGroupDAO;
+import org.apache.ambari.server.orm.entities.MpackEntity;
import org.apache.ambari.server.orm.entities.RepoOsEntity;
-import org.apache.ambari.server.orm.entities.RepositoryVersionEntity;
+import org.apache.ambari.server.orm.entities.ServiceGroupEntity;
+import org.apache.ambari.server.orm.entities.StackEntity;
import org.apache.ambari.server.orm.entities.UpgradeEntity;
import org.apache.ambari.server.state.Cluster;
import org.apache.ambari.server.state.Clusters;
@@@ -208,24 -187,30 +209,40 @@@ public class ExecutionCommandWrapper
executionCommand.setUpgradeSummary(upgradeSummary);
}
+ ServiceGroupEntity serviceGroupEntity = serviceGroupDAO.find(clusterId,
+ executionCommand.getServiceGroupName());
+
+ StackEntity stack = serviceGroupEntity.getStack();
+ Long mpackId = stack.getMpackId();
+ Mpack mpack = ambariMetaInfo.getMpack(mpackId);
+
+ if (null == executionCommand.getMpackId()) {
+ executionCommand.setMpackId(mpackId);
+ }
+
// setting repositoryFile
final Host host = cluster.getHost(executionCommand.getHostname()); // can be null on internal commands
- if (null == executionCommand.getRepositoryFile() && null != host && mpackId != null) {
- MpackEntity mpackEntity = mpackDAO.findById(mpackId);
- RepoOsEntity osEntity = repoVersionHelper.getOSEntityForHost(mpackEntity, host);
- final CommandRepository commandRepository = repoVersionHelper.getCommandRepository(mpack, osEntity);
- executionCommand.setRepositoryFile(commandRepository);
+ final String serviceName = executionCommand.getServiceName(); // can be null on executing special RU tasks
-
- if (null == executionCommand.getRepositoryFile() && null != host && null != serviceName) {
++ if (null == executionCommand.getRepositoryFile() && null != host && null != serviceName && mpackId != null) {
+ final CommandRepository commandRepository;
+ final Service service = cluster.getService(serviceName);
+ final String componentName = executionCommand.getComponentName();
+
+ try {
+ if (null != componentName) {
+ ServiceComponent serviceComponent = service.getServiceComponent(componentName);
+ commandRepository = repoVersionHelper.getCommandRepository(cluster, serviceComponent, host);
+ } else {
- RepositoryVersionEntity repoVersion = service.getDesiredRepositoryVersion();
- RepoOsEntity osEntity = repoVersionHelper.getOSEntityForHost(host, repoVersion);
- commandRepository = repoVersionHelper.getCommandRepository(repoVersion, osEntity);
++ MpackEntity mpackEntity = mpackDAO.findById(mpackId);
++ RepoOsEntity osEntity = repoVersionHelper.getOSEntityForHost(mpackEntity, host);
++ commandRepository = repoVersionHelper.getCommandRepository(mpack, osEntity);
+ }
+ executionCommand.setRepositoryFile(commandRepository);
+
+ } catch (SystemException e) {
+ LOG.debug("Unable to find command repository with a correct operating system for host {}",
+ host, e);
+ }
}
} catch (ClusterNotFoundException cnfe) {
diff --cc ambari-server/src/main/java/org/apache/ambari/server/agent/CommandRepository.java
index cc972b6,00c837a..48177e8
--- a/ambari-server/src/main/java/org/apache/ambari/server/agent/CommandRepository.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/agent/CommandRepository.java
@@@ -40,18 -43,18 +43,22 @@@ public class CommandRepository
@JsonProperty("repositories")
private List<Repository> m_repositories = new ArrayList<>();
- @SerializedName("repoVersion")
- @JsonProperty("repoVersion")
- private String m_repoVersion;
+ @SerializedName("mpackId")
+ @JsonProperty("mpackId")
+ private long m_mpackId;
+
+ @SerializedName("mpackName")
+ @JsonProperty("mpackName")
+ private String m_mpackName;
+
+ @SerializedName("mpackVersion")
+ @JsonProperty("mpackVersion")
+ private String m_mpackVersion;
+ @SerializedName("repoVersionId")
+ @JsonProperty("repoVersionId")
+ private long m_repoVersionId;
+
- @SerializedName("stackName")
- @JsonProperty("stackName")
- private String m_stackName;
-
@SerializedName("repoFileName")
@JsonProperty("repoFileName")
private String m_repoFileName;
@@@ -94,6 -88,20 +101,17 @@@
}
/**
+ * @param id the repository id
+ */
+ public void setRepositoryVersionId(long id) {
+ m_repoVersionId = id;
+ }
+
- /**
- * @param name the stack name
- */
- public void setStackName(String name) {
- m_stackName = name;
++ public long getRepoVersionId() {
++ return m_repoVersionId;
+ }
+
+ /**
* @param repositories the repositories if sourced from the stack instead of the repo_version.
*/
public void setRepositories(Collection<RepositoryInfo> repositories) {
@@@ -279,9 -349,23 +320,24 @@@
.append("components", m_components)
.append("id", m_repoId)
.append("baseUrl", m_baseUrl)
+ .append("applicableServices", (m_applicableServices != null? StringUtils.join(m_applicableServices, ",") : ""))
.toString();
}
+
}
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ CommandRepository that = (CommandRepository) o;
+
+ return m_repoVersionId == that.m_repoVersionId;
+ }
+
+ @Override
+ public int hashCode() {
+ return (int) (m_repoVersionId ^ (m_repoVersionId >>> 32));
+ }
}
diff --cc ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java
index 0bde1a9,7d70390..52add8c
--- a/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java
@@@ -176,29 -182,16 +196,16 @@@ public class HeartBeatHandler
hostname,
currentResponseId);
- return createRestartCommand(currentResponseId);
+ return createRestartCommand(currentResponseId, hostname);
}
-
- response = new HeartBeatResponse();
response.setResponseId(++currentResponseId);
- Host hostObject;
- try {
- hostObject = clusterFsm.getHost(hostname);
- } catch (HostNotFoundException e) {
- LOG.error("Host: {} not found. Agent is still heartbeating.", hostname);
- if (LOG.isDebugEnabled()) {
- LOG.debug("Host associated with the agent heratbeat might have been " +
- "deleted", e);
- }
- // For now return empty response with only response id.
- return response;
- }
-
if (hostObject.getState().equals(HostState.HEARTBEAT_LOST)) {
// After loosing heartbeat agent should reregister
LOG.warn("Host {} is in HEARTBEAT_LOST state - sending register command", hostname);
+ STOMPUpdatePublisher.publish(new AgentActionEvent(AgentActionEvent.AgentAction.RESTART_AGENT,
+ hostObject.getHostId()));
- return createRegisterCommand();
+ return createRegisterCommand(hostname);
}
hostResponseIds.put(hostname, currentResponseId);
diff --cc ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/HostLevelParamsHolder.java
index b6a20ad,3c44f57..783ad4f
--- a/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/HostLevelParamsHolder.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/HostLevelParamsHolder.java
@@@ -24,8 -24,10 +24,10 @@@ import org.apache.ambari.server.AmbariE
import org.apache.ambari.server.agent.RecoveryConfigHelper;
import org.apache.ambari.server.agent.stomp.dto.HostLevelParamsCluster;
import org.apache.ambari.server.controller.AmbariManagementController;
-import org.apache.ambari.server.events.ClusterComponentsRepoChangedEvent;
import org.apache.ambari.server.events.HostLevelParamsUpdateEvent;
+ import org.apache.ambari.server.events.MaintenanceModeEvent;
+ import org.apache.ambari.server.events.ServiceComponentRecoveryChangedEvent;
+import org.apache.ambari.server.events.ServiceGroupMpackChangedEvent;
import org.apache.ambari.server.events.publishers.AmbariEventPublisher;
import org.apache.ambari.server.state.Cluster;
import org.apache.ambari.server.state.Clusters;
@@@ -70,11 -81,37 +81,38 @@@ public class HostLevelParamsHolder exte
return hostLevelParamsUpdateEvent;
}
- @Override
- protected boolean handleUpdate(HostLevelParamsUpdateEvent update) throws AmbariException {
- //TODO implement update host level params process
- setData(update, update.getHostId());
- return true;
++
+ protected boolean handleUpdate(HostLevelParamsUpdateEvent update) {
+ boolean changed = false;
+ if (MapUtils.isNotEmpty(update.getHostLevelParamsClusters())) {
+ Long hostId = update.getHostId();
+ for (Map.Entry<String, HostLevelParamsCluster> hostLevelParamsClusterEntry : update.getHostLevelParamsClusters().entrySet()) {
+ HostLevelParamsCluster updatedCluster = hostLevelParamsClusterEntry.getValue();
+ String clusterId = hostLevelParamsClusterEntry.getKey();
+ Map<String, HostLevelParamsCluster> clusters = getData().get(hostId).getHostLevelParamsClusters();
+ if (clusters.containsKey(clusterId)) {
+ HostLevelParamsCluster cluster = clusters.get(clusterId);
+ if (!cluster.getRecoveryConfig().equals(updatedCluster.getRecoveryConfig())) {
+ cluster.setRecoveryConfig(updatedCluster.getRecoveryConfig());
+ changed = true;
+ }
+ if (!cluster.getHostRepositories().getRepositories()
+ .equals(updatedCluster.getHostRepositories().getRepositories())) {
+ cluster.getHostRepositories().setRepositories(updatedCluster.getHostRepositories().getRepositories());
+ changed = true;
+ }
+ if (!cluster.getHostRepositories().getComponentRepos()
+ .equals(updatedCluster.getHostRepositories().getComponentRepos())) {
+ cluster.getHostRepositories().setComponentRepos(updatedCluster.getHostRepositories().getComponentRepos());
+ changed = true;
+ }
+ } else {
+ clusters.put(clusterId, updatedCluster);
+ changed = true;
+ }
+ }
+ }
+ return changed;
}
@Override
@@@ -83,18 -120,43 +121,45 @@@
}
@Subscribe
- public void onClusterComponentsRepoUpdate(ClusterComponentsRepoChangedEvent clusterComponentsRepoChangedEvent) throws AmbariException {
+ public void onUpgradeDesiredMpackChange(ServiceGroupMpackChangedEvent clusterComponentsRepoChangedEvent) throws AmbariException {
+ Long clusterId = clusterComponentsRepoChangedEvent.getClusterId();
+
+ Cluster cluster = clusters.getCluster(clusterComponentsRepoChangedEvent.getClusterId());
+ for (Host host : cluster.getHosts()) {
+ updateDataOfHost(clusterComponentsRepoChangedEvent.getClusterId(), cluster, host);
+ }
+ }
+
+ @Subscribe
+ public void onServiceComponentRecoveryChanged(ServiceComponentRecoveryChangedEvent event) throws AmbariException {
+ long clusterId = event.getClusterId();
Cluster cluster = clusters.getCluster(clusterId);
- Collection<Host> hosts = clusters.getCluster(clusterId).getHosts();
- for (Host host : hosts) {
- HostLevelParamsUpdateEvent hostLevelParamsUpdateEvent = new HostLevelParamsUpdateEvent(Long.toString(clusterId),
- new HostLevelParamsCluster(
- m_ambariManagementController.get().retrieveHostRepositories(cluster, host),
- recoveryConfigHelper.getRecoveryConfig(cluster.getClusterName(), host.getHostName())));
- hostLevelParamsUpdateEvent.setHostId(host.getHostId());
- updateData(hostLevelParamsUpdateEvent);
+ for (ServiceComponentHost host : cluster.getServiceComponentHosts(event.getServiceName(), event.getComponentName())) {
+ updateDataOfHost(clusterId, cluster, host.getHost());
+ }
+ }
+
+ private void updateDataOfHost(long clusterId, Cluster cluster, Host host) throws AmbariException {
+ HostLevelParamsUpdateEvent hostLevelParamsUpdateEvent = new HostLevelParamsUpdateEvent(Long.toString(clusterId),
+ new HostLevelParamsCluster(
+ m_ambariManagementController.get().retrieveHostRepositories(cluster, host),
+ recoveryConfigHelper.getRecoveryConfig(cluster.getClusterName(), host.getHostName())));
+ hostLevelParamsUpdateEvent.setHostId(host.getHostId());
+ updateData(hostLevelParamsUpdateEvent);
+ }
+
+ @Subscribe
+ public void onMaintenanceModeChanged(MaintenanceModeEvent event) throws AmbariException {
+ long clusterId = event.getClusterId();
+ Cluster cluster = clusters.getCluster(clusterId);
+ if (event.getHost() != null || event.getServiceComponentHost() != null) {
+ Host host = event.getHost() != null ? event.getHost() : event.getServiceComponentHost().getHost();
+ updateDataOfHost(clusterId, cluster, host);
+ }
+ else if (event.getService() != null) {
+ for (String hostName : event.getService().getServiceHosts()) {
+ updateDataOfHost(clusterId, cluster, cluster.getHost(hostName));
+ }
}
}
}
diff --cc ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/MetadataHolder.java
index 437ee9f,8fd8951..47ba8e6
--- a/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/MetadataHolder.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/MetadataHolder.java
@@@ -18,17 -18,22 +18,23 @@@
package org.apache.ambari.server.agent.stomp;
import java.util.Map;
+ import java.util.TreeMap;
import org.apache.ambari.server.AmbariException;
+ import org.apache.ambari.server.ClusterNotFoundException;
import org.apache.ambari.server.agent.stomp.dto.MetadataCluster;
-import org.apache.ambari.server.controller.AmbariManagementControllerImpl;
+ import org.apache.ambari.server.events.AmbariPropertiesChangedEvent;
-import org.apache.ambari.server.events.ClusterComponentsRepoChangedEvent;
+import org.apache.ambari.server.events.ClusterConfigChangedEvent;
import org.apache.ambari.server.events.MetadataUpdateEvent;
+ import org.apache.ambari.server.events.ServiceCredentialStoreUpdateEvent;
+import org.apache.ambari.server.events.ServiceGroupMpackChangedEvent;
import org.apache.ambari.server.events.ServiceInstalledEvent;
+ import org.apache.ambari.server.events.UpdateEventType;
import org.apache.ambari.server.events.publishers.AmbariEventPublisher;
+import org.apache.ambari.server.metadata.ClusterMetadataGenerator;
import org.apache.ambari.server.state.Cluster;
import org.apache.ambari.server.state.Clusters;
+ import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import com.google.common.eventbus.Subscribe;
@@@ -52,9 -57,19 +58,19 @@@ public class MetadataHolder extends Age
@Override
public MetadataUpdateEvent getCurrentData() throws AmbariException {
- return ambariManagementController.getClustersMetadata();
+ return metadataGenerator.getClustersMetadata(m_clusters.get());
}
+ public MetadataUpdateEvent getDeleteMetadata(Long clusterId) throws AmbariException {
+ TreeMap<String, MetadataCluster> clusterToRemove = new TreeMap<>();
+ if (clusterId != null) {
+ clusterToRemove.put(Long.toString(clusterId), MetadataCluster.emptyMetadataCluster());
+ }
+ MetadataUpdateEvent deleteEvent = new MetadataUpdateEvent(clusterToRemove, null , null,
+ UpdateEventType.DELETE);
+ return deleteEvent;
+ }
+
@Override
protected boolean handleUpdate(MetadataUpdateEvent update) throws AmbariException {
boolean changed = false;
@@@ -96,8 -122,19 +130,20 @@@
}
@Subscribe
- public void onClusterComponentsRepoUpdate(ClusterComponentsRepoChangedEvent clusterComponentsRepoChangedEvent) throws AmbariException {
+ public void onUpgradeDesiredMpackChange(ServiceGroupMpackChangedEvent clusterComponentsRepoChangedEvent) throws AmbariException {
Cluster cluster = m_clusters.get().getCluster(clusterComponentsRepoChangedEvent.getClusterId());
- updateData(ambariManagementController.getClusterMetadataOnRepoUpdate(cluster));
+ updateData(metadataGenerator.getClusterMetadataOnRepoUpdate(cluster));
}
+
+ @Subscribe
+ public void onServiceCredentialStoreUpdate(ServiceCredentialStoreUpdateEvent serviceCredentialStoreUpdateEvent) throws AmbariException {
+ Cluster cluster = m_clusters.get().getCluster(serviceCredentialStoreUpdateEvent.getClusterId());
- updateData(ambariManagementController.getClusterMetadataOnServiceCredentialStoreUpdate(cluster, serviceCredentialStoreUpdateEvent.getServiceName()));
++ //TODO : [AMP] Fix it
++ // updateData(ambariManagementController.getClusterMetadataOnServiceCredentialStoreUpdate(cluster, serviceCredentialStoreUpdateEvent.getServiceName()));
+ }
+
+ @Subscribe
+ public void onAmbariPropertiesChange(AmbariPropertiesChangedEvent event) throws AmbariException {
- updateData(ambariManagementController.getClustersMetadata());
++ updateData(metadataGenerator.getClustersMetadata(m_clusters.get()));
+ }
}
diff --cc ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/TopologyHolder.java
index 1d0ec44,7224afc..1939d92
--- a/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/TopologyHolder.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/TopologyHolder.java
@@@ -30,9 -30,10 +30,10 @@@ import org.apache.ambari.server.agent.s
import org.apache.ambari.server.agent.stomp.dto.TopologyComponent;
import org.apache.ambari.server.agent.stomp.dto.TopologyHost;
import org.apache.ambari.server.controller.AmbariManagementControllerImpl;
-import org.apache.ambari.server.events.ClusterComponentsRepoChangedEvent;
+import org.apache.ambari.server.events.ServiceGroupMpackChangedEvent;
import org.apache.ambari.server.events.TopologyAgentUpdateEvent;
import org.apache.ambari.server.events.TopologyUpdateEvent;
+ import org.apache.ambari.server.events.UpdateEventType;
import org.apache.ambari.server.events.publishers.AmbariEventPublisher;
import org.apache.ambari.server.state.Cluster;
import org.apache.ambari.server.state.Clusters;
diff --cc ambari-server/src/main/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRenderer.java
index ae31086,acdf9ed..16ade9a
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRenderer.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRenderer.java
@@@ -111,46 -100,48 +111,46 @@@ public class ClusterBlueprintRenderer e
copyPropertiesToResult(queryProperties, resultTree);
- String configType = Resource.Type.Configuration.name();
- if (resultTree.getChild(configType) == null) {
- resultTree.addChild(new HashSet<>(), configType);
- }
+ ensureChild(resultTree, Resource.Type.Configuration, "properties");
+
+ ensureChild(resultTree, Resource.Type.ClusterSetting);
+
+ TreeNode<Set<String>> serviceGroupNode = ensureChild(resultTree, Resource.Type.ServiceGroup,
+ ServiceGroupResourceProvider.SERVICE_GROUP_MPACK_NAME,
+ ServiceGroupResourceProvider.SERVICE_GROUP_MPACK_VERSION
+ );
+ TreeNode<Set<String>> serviceNode = ensureChild(serviceGroupNode, Resource.Type.Service);
+ ensureChild(serviceNode, Resource.Type.Component,
- ComponentResourceProvider.COMPONENT_CLUSTER_NAME_PROPERTY_ID,
- ComponentResourceProvider.COMPONENT_SERVICE_NAME_PROPERTY_ID,
- ComponentResourceProvider.COMPONENT_SERVICE_TYPE_PROPERTY_ID,
- ComponentResourceProvider.COMPONENT_COMPONENT_NAME_PROPERTY_ID,
- ComponentResourceProvider.COMPONENT_RECOVERY_ENABLED_ID);
++ ComponentResourceProvider.CLUSTER_NAME,
++ ComponentResourceProvider.SERVICE_NAME,
++ ComponentResourceProvider.SERVICE_TYPE,
++ ComponentResourceProvider.COMPONENT_NAME,
++ ComponentResourceProvider.RECOVERY_ENABLED);
+
+ TreeNode<Set<String>> hostNode = ensureChild(resultTree, Resource.Type.Host);
+ ensureChild(hostNode, Resource.Type.HostComponent,
- HostComponentResourceProvider.HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID,
- HostComponentResourceProvider.HOST_COMPONENT_SERVICE_NAME_PROPERTY_ID,
- HostComponentResourceProvider.HOST_COMPONENT_SERVICE_TYPE_PROPERTY_ID,
- HostComponentResourceProvider.HOST_COMPONENT_SERVICE_GROUP_NAME_PROPERTY_ID);
++ HostComponentResourceProvider.COMPONENT_NAME,
++ HostComponentResourceProvider.SERVICE_NAME,
++ HostComponentResourceProvider.SERVICE_TYPE,
++ HostComponentResourceProvider.SERVICE_GROUP_NAME);
- String serviceType = Resource.Type.Service.name();
- if (resultTree.getChild(serviceType) == null) {
- resultTree.addChild(new HashSet<>(), serviceType);
- }
- TreeNode<Set<String>> serviceNode = resultTree.getChild(serviceType);
- if (serviceNode == null) {
- serviceNode = resultTree.addChild(new HashSet<>(), serviceType);
- }
- String serviceComponentType = Resource.Type.Component.name();
- TreeNode<Set<String>> serviceComponentNode = resultTree.getChild(
- serviceType + "/" + serviceComponentType);
- if (serviceComponentNode == null) {
- serviceComponentNode = serviceNode.addChild(new HashSet<>(), serviceComponentType);
+ return resultTree;
+ }
+
+ private TreeNode<Set<String>> ensureChild(TreeNode<Set<String>> parent,
+ Resource.Type resourceType,
+ String... properties) {
+ TreeNode<Set<String>> child = parent.getChild(resourceType.name());
+ if (null == child) {
+ child = parent.addChild(new HashSet<>(), resourceType.name());
}
- serviceComponentNode.getObject().add("ServiceComponentInfo/cluster_name");
- serviceComponentNode.getObject().add("ServiceComponentInfo/service_name");
- serviceComponentNode.getObject().add("ServiceComponentInfo/component_name");
- serviceComponentNode.getObject().add("ServiceComponentInfo/recovery_enabled");
-
- String hostType = Resource.Type.Host.name();
- String hostComponentType = Resource.Type.HostComponent.name();
- TreeNode<Set<String>> hostComponentNode = resultTree.getChild(
- hostType + "/" + hostComponentType);
-
- if (hostComponentNode == null) {
- TreeNode<Set<String>> hostNode = resultTree.getChild(hostType);
- if (hostNode == null) {
- hostNode = resultTree.addChild(new HashSet<>(), hostType);
- }
- hostComponentNode = hostNode.addChild(new HashSet<>(), hostComponentType);
+ for (String property: properties) {
+ child.getObject().add(property);
}
- resultTree.getChild(configType).getObject().add("properties");
- hostComponentNode.getObject().add("HostRoles/component_name");
-
- return resultTree;
+ return child;
}
+
@Override
public Result finalizeResult(Result queryResult) {
TreeNode<Resource> resultTree = queryResult.getResultTree();
diff --cc ambari-server/src/main/java/org/apache/ambari/server/api/services/ConfigurationService.java
index c89a506,81ce705..47cbeff
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ConfigurationService.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ConfigurationService.java
@@@ -90,10 -79,28 +104,28 @@@ public class ConfigurationService exten
* @param ui uri info
* @return service collection resource representation
*/
- @GET @ApiIgnore // until documented
- @Produces("text/plain")
+ @GET
+ @Path("") // This is needed if class level path is not present otherwise no Swagger docs will be generated for this method
+ @Produces(MediaType.TEXT_PLAIN)
+ @ApiOperation(value = "Get all configurations", response = ConfigurationResponse.class, responseContainer =
+ RESPONSE_CONTAINER_LIST)
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = QUERY_FIELDS, value = QUERY_FILTER_DESCRIPTION, dataType = DATA_TYPE_STRING, paramType = PARAM_TYPE_QUERY),
+ @ApiImplicitParam(name = QUERY_SORT, value = QUERY_SORT_DESCRIPTION, dataType = DATA_TYPE_STRING, paramType = PARAM_TYPE_QUERY),
+ @ApiImplicitParam(name = QUERY_PAGE_SIZE, value = QUERY_PAGE_SIZE_DESCRIPTION, defaultValue = DEFAULT_PAGE_SIZE, dataType = DATA_TYPE_INT, paramType = PARAM_TYPE_QUERY),
+ @ApiImplicitParam(name = QUERY_FROM, value = QUERY_FROM_DESCRIPTION, allowableValues = QUERY_FROM_VALUES, defaultValue = DEFAULT_FROM, dataType = DATA_TYPE_INT, paramType = PARAM_TYPE_QUERY),
+ @ApiImplicitParam(name = QUERY_TO, value = QUERY_TO_DESCRIPTION, allowableValues = QUERY_TO_VALUES, dataType = DATA_TYPE_INT, paramType = PARAM_TYPE_QUERY),
+ })
+ @ApiResponses({
+ @ApiResponse(code = HttpStatus.SC_OK, message = MSG_SUCCESSFUL_OPERATION),
+ @ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = MSG_CLUSTER_OR_HOST_NOT_FOUND),
+ @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = MSG_NOT_AUTHENTICATED),
+ @ApiResponse(code = HttpStatus.SC_FORBIDDEN, message = MSG_PERMISSION_DENIED),
+ @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = MSG_SERVER_ERROR),
+ @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = MSG_INVALID_ARGUMENTS),
+ })
public Response getConfigurations(String body, @Context HttpHeaders headers, @Context UriInfo ui) {
- return handleRequest(headers, body, ui, Request.Type.GET, createConfigurationResource(m_clusterName));
+ return handleRequest(headers, body, ui, Request.Type.GET, createConfigurationResource(m_clusterName, m_serviceGroupName, m_serviceName));
}
/**
@@@ -118,11 -125,25 +150,25 @@@
* @param ui uri info
* @return status code only, 201 if successful
*/
- @POST @ApiIgnore // until documented
- @Produces("text/plain")
+ @POST
+ @Path("") // This is needed if class level path is not present otherwise no Swagger docs will be generated for this method
+ @Produces(MediaType.TEXT_PLAIN)
+ @ApiOperation(value = "Create new configurations")
+ @ApiImplicitParams({
+ @ApiImplicitParam(dataType = CONFIGURATION_REQUEST_TYPE, paramType = PARAM_TYPE_BODY, allowMultiple = true)
+ })
+ @ApiResponses(value = {
+ @ApiResponse(code = HttpStatus.SC_CREATED, message = MSG_SUCCESSFUL_OPERATION),
+ @ApiResponse(code = HttpStatus.SC_ACCEPTED, message = MSG_REQUEST_ACCEPTED),
+ @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = MSG_INVALID_ARGUMENTS),
+ @ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = MSG_CLUSTER_NOT_FOUND),
+ @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = MSG_NOT_AUTHENTICATED),
+ @ApiResponse(code = HttpStatus.SC_FORBIDDEN, message = MSG_PERMISSION_DENIED),
+ @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = MSG_SERVER_ERROR),
+ })
public Response createConfigurations(String body,@Context HttpHeaders headers, @Context UriInfo ui) {
- return handleRequest(headers, body, ui, Request.Type.POST, createConfigurationResource(m_clusterName));
+ return handleRequest(headers, body, ui, Request.Type.POST, createConfigurationResource(m_clusterName, m_serviceGroupName, m_serviceName));
}
/**
diff --cc ambari-server/src/main/java/org/apache/ambari/server/api/services/HostComponentService.java
index 503c301,2f2051a..4bbccda
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/HostComponentService.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/HostComponentService.java
@@@ -39,10 -39,12 +39,11 @@@ import javax.ws.rs.core.MediaType
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
--import org.apache.ambari.annotations.ApiIgnore;
+ import org.apache.ambari.annotations.SwaggerPreferredParent;
import org.apache.ambari.server.api.resources.ResourceInstance;
import org.apache.ambari.server.configuration.Configuration;
- import org.apache.ambari.server.controller.ServiceComponentHostResponse;
+ import org.apache.ambari.server.controller.HostComponentProcessResponse;
+ import org.apache.ambari.server.controller.HostComponentSwagger;
import org.apache.ambari.server.controller.spi.Resource;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.Validate;
@@@ -90,28 -94,26 +92,26 @@@ public class HostComponentService exten
*
* @param headers http headers
* @param ui uri info
- * @param hostComponentName host_component id
- * @return host_component resource representation
+ * @param hostComponentId host_component id
+ * @return host_component resource representation
*/
@GET
- @Path("{hostComponentName}")
+ @Path("{hostComponentId}")
- @Produces("text/plain")
- @ApiOperation(value = "Get the details of a given Host Component",
- nickname = "HostComponentService#getHostComponent",
- notes = "Returns the details of a hostComponent",
- response = ServiceComponentHostResponse.ServiceComponentHostResponseSwagger.class,
- responseContainer = RESPONSE_CONTAINER_LIST)
+ @Produces(MediaType.TEXT_PLAIN)
+ @ApiOperation(value = "Get single host component for a host", response = HostComponentSwagger.class)
@ApiImplicitParams({
- @ApiImplicitParam(name = QUERY_FIELDS, value = QUERY_FILTER_DESCRIPTION, defaultValue = "HostRoles/*",
- dataType = DATA_TYPE_STRING, paramType = PARAM_TYPE_QUERY)
+ @ApiImplicitParam(name = QUERY_FIELDS, value = QUERY_FILTER_DESCRIPTION, dataType = DATA_TYPE_STRING, paramType = PARAM_TYPE_QUERY),
})
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.SC_OK, message = MSG_SUCCESSFUL_OPERATION),
- @ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = MSG_RESOURCE_NOT_FOUND),
- @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = MSG_SERVER_ERROR)
+ @ApiResponses({
+ @ApiResponse(code = HttpStatus.SC_OK, message = MSG_SUCCESSFUL_OPERATION),
+ @ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = MSG_CLUSTER_OR_HOST_NOT_FOUND),
+ @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = MSG_NOT_AUTHENTICATED),
+ @ApiResponse(code = HttpStatus.SC_FORBIDDEN, message = MSG_PERMISSION_DENIED),
+ @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = MSG_SERVER_ERROR),
+ @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = MSG_INVALID_ARGUMENTS),
})
public Response getHostComponent(String body, @Context HttpHeaders headers, @Context UriInfo ui,
- @PathParam("hostComponentName") String hostComponentName, @QueryParam("format") String format) {
+ @PathParam("hostComponentId") String hostComponentId, @QueryParam("format") String format) {
//todo: needs to be refactored when properly handling exceptions
if (m_hostName == null) {
@@@ -179,23 -172,20 +170,20 @@@
*
* @return status code only, 201 if successful
*/
- @POST @ApiIgnore // ignored as doesnt work as intended, not able to accept multiple HostRoles
+ @POST
@Produces(MediaType.TEXT_PLAIN)
- @ApiOperation(value = "Creates a Host Component",
- nickname = "HostComponentService#createHostComponents"
- )
+ @ApiOperation(value = "Create new host components")
@ApiImplicitParams({
- @ApiImplicitParam(dataType = HOST_COMPONENT_REQUEST_TYPE, paramType = PARAM_TYPE_BODY)
+ @ApiImplicitParam(dataType = HOST_ROLE_REQUEST_TYPE, paramType = PARAM_TYPE_BODY, allowMultiple = true)
})
- @ApiResponses({
- @ApiResponse(code = HttpStatus.SC_CREATED, message = MSG_SUCCESSFUL_OPERATION),
- @ApiResponse(code = HttpStatus.SC_ACCEPTED, message = MSG_REQUEST_ACCEPTED),
- @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = MSG_INVALID_ARGUMENTS),
- @ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = MSG_RESOURCE_NOT_FOUND),
- @ApiResponse(code = HttpStatus.SC_CONFLICT, message = MSG_RESOURCE_ALREADY_EXISTS),
- @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = MSG_NOT_AUTHENTICATED),
- @ApiResponse(code = HttpStatus.SC_FORBIDDEN, message = MSG_PERMISSION_DENIED),
- @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = MSG_SERVER_ERROR),
+ @ApiResponses(value = {
+ @ApiResponse(code = HttpStatus.SC_CREATED, message = MSG_SUCCESSFUL_OPERATION),
+ @ApiResponse(code = HttpStatus.SC_ACCEPTED, message = MSG_REQUEST_ACCEPTED),
+ @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = MSG_INVALID_ARGUMENTS),
+ @ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = MSG_CLUSTER_NOT_FOUND),
+ @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = MSG_NOT_AUTHENTICATED),
+ @ApiResponse(code = HttpStatus.SC_FORBIDDEN, message = MSG_PERMISSION_DENIED),
+ @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = MSG_SERVER_ERROR),
})
public Response createHostComponents(String body, @Context HttpHeaders headers, @Context UriInfo ui) {
@@@ -215,28 -239,26 +203,26 @@@
* @return information regarding updated host_component
*/
@PUT
- @Path("{hostComponentName}")
+ @Path("{hostComponentId}")
@Produces(MediaType.TEXT_PLAIN)
- @ApiOperation(value = "Updates a given Host Component",
- nickname = "HostComponentService#updateHostComponent"
- )
+ @ApiOperation(value = "Update host component detail")
@ApiImplicitParams({
- @ApiImplicitParam(dataType = HOST_COMPONENT_REQUEST_TYPE, paramType = PARAM_TYPE_BODY)
+ @ApiImplicitParam(dataType = HOST_ROLE_REQUEST_TYPE, paramType = PARAM_TYPE_BODY)
})
@ApiResponses({
- @ApiResponse(code = HttpStatus.SC_OK, message = MSG_SUCCESSFUL_OPERATION),
- @ApiResponse(code = HttpStatus.SC_ACCEPTED, message = MSG_REQUEST_ACCEPTED),
- @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = MSG_INVALID_ARGUMENTS),
- @ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = MSG_RESOURCE_NOT_FOUND),
- @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = MSG_NOT_AUTHENTICATED),
- @ApiResponse(code = HttpStatus.SC_FORBIDDEN, message = MSG_PERMISSION_DENIED),
- @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = MSG_SERVER_ERROR),
+ @ApiResponse(code = HttpStatus.SC_OK, message = MSG_SUCCESSFUL_OPERATION),
+ @ApiResponse(code = HttpStatus.SC_ACCEPTED, message = MSG_REQUEST_ACCEPTED),
+ @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = MSG_INVALID_ARGUMENTS),
+ @ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = MSG_CLUSTER_OR_HOST_NOT_FOUND),
+ @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = MSG_NOT_AUTHENTICATED),
+ @ApiResponse(code = HttpStatus.SC_FORBIDDEN, message = MSG_PERMISSION_DENIED),
+ @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = MSG_SERVER_ERROR),
})
public Response updateHostComponent(String body, @Context HttpHeaders headers, @Context UriInfo ui,
- @PathParam("hostComponentName") String hostComponentName) {
+ @PathParam("hostComponentId") String hostComponentId) {
return handleRequest(headers, body, ui, Request.Type.PUT,
- createHostComponentResource(m_clusterName, m_hostName, hostComponentName));
+ createHostComponentResource(m_clusterName, m_hostName, hostComponentId));
}
/**
@@@ -249,22 -271,20 +235,20 @@@
*
* @return information regarding updated host_component resources
*/
- @PUT @ApiIgnore // ignored as doesnt work as intended, not able to accept multiple HostRoles
+ @PUT
@Produces(MediaType.TEXT_PLAIN)
- @ApiOperation(value = "Updates multiple Host Components",
- nickname = "HostComponentService#updateHostComponents"
- )
+ @ApiOperation(value = "Update multiple host component details")
@ApiImplicitParams({
- @ApiImplicitParam(dataType = HOST_COMPONENT_REQUEST_TYPE, paramType = PARAM_TYPE_BODY)
+ @ApiImplicitParam(dataType = HOST_ROLE_REQUEST_TYPE, paramType = PARAM_TYPE_BODY, allowMultiple = true)
})
@ApiResponses({
- @ApiResponse(code = HttpStatus.SC_OK, message = MSG_SUCCESSFUL_OPERATION),
- @ApiResponse(code = HttpStatus.SC_ACCEPTED, message = MSG_REQUEST_ACCEPTED),
- @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = MSG_INVALID_ARGUMENTS),
- @ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = MSG_RESOURCE_NOT_FOUND),
- @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = MSG_NOT_AUTHENTICATED),
- @ApiResponse(code = HttpStatus.SC_FORBIDDEN, message = MSG_PERMISSION_DENIED),
- @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = MSG_SERVER_ERROR),
+ @ApiResponse(code = HttpStatus.SC_OK, message = MSG_SUCCESSFUL_OPERATION),
+ @ApiResponse(code = HttpStatus.SC_ACCEPTED, message = MSG_REQUEST_ACCEPTED),
+ @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = MSG_INVALID_ARGUMENTS),
+ @ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = MSG_CLUSTER_OR_HOST_NOT_FOUND),
+ @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = MSG_NOT_AUTHENTICATED),
+ @ApiResponse(code = HttpStatus.SC_FORBIDDEN, message = MSG_PERMISSION_DENIED),
+ @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = MSG_SERVER_ERROR),
})
public Response updateHostComponents(String body, @Context HttpHeaders headers, @Context UriInfo ui) {
@@@ -282,24 -302,24 +266,24 @@@
*
* @return host_component resource representation
*/
- @DELETE @ApiIgnore // until documented
+ @DELETE
- @Path("{hostComponentName}")
+ @Path("{hostComponentId}")
@Produces(MediaType.TEXT_PLAIN)
- @ApiOperation(value = "Deletes a hostComponent",
- nickname = "HostComponentService#deleteHostComponent"
- )
+ @ApiOperation(value = "Delete host component")
+ @ApiImplicitParams({
+ })
@ApiResponses({
- @ApiResponse(code = HttpStatus.SC_OK, message = MSG_SUCCESSFUL_OPERATION),
- @ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = MSG_RESOURCE_NOT_FOUND),
- @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = MSG_NOT_AUTHENTICATED),
- @ApiResponse(code = HttpStatus.SC_FORBIDDEN, message = MSG_PERMISSION_DENIED),
- @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = MSG_SERVER_ERROR),
+ @ApiResponse(code = HttpStatus.SC_OK, message = MSG_SUCCESSFUL_OPERATION),
+ @ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = MSG_CLUSTER_OR_HOST_NOT_FOUND),
+ @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = MSG_NOT_AUTHENTICATED),
+ @ApiResponse(code = HttpStatus.SC_FORBIDDEN, message = MSG_PERMISSION_DENIED),
+ @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = MSG_SERVER_ERROR),
})
public Response deleteHostComponent(@Context HttpHeaders headers, @Context UriInfo ui,
- @PathParam("hostComponentName") String hostComponentName) {
+ @PathParam("hostComponentId") String hostComponentId) {
return handleRequest(headers, null, ui, Request.Type.DELETE,
- createHostComponentResource(m_clusterName, m_hostName, hostComponentName));
+ createHostComponentResource(m_clusterName, m_hostName, hostComponentId));
}
/**
@@@ -329,24 -350,24 +314,23 @@@
createHostComponentResource(m_clusterName, m_hostName, null));
}
-
@GET
- @Produces(MediaType.TEXT_PLAIN)
- @Path("{hostComponentName}/processes")
+ @Path("{hostComponentId}/processes")
- @ApiOperation(value = "Get details of processes.",
- nickname = "HostComponentService#getProcesses",
- notes = "Returns the details of a host component processes.",
- responseContainer = RESPONSE_CONTAINER_LIST)
+ @Produces(MediaType.TEXT_PLAIN)
+ @ApiOperation(value = "Get processes of a specific host component", response = HostComponentProcessResponse.class)
@ApiImplicitParams({
- @ApiImplicitParam(name = QUERY_FIELDS, value = QUERY_FILTER_DESCRIPTION, defaultValue = "HostRoles/*",
- dataType = DATA_TYPE_STRING, paramType = PARAM_TYPE_QUERY)
+ @ApiImplicitParam(name = QUERY_FIELDS, value = QUERY_FILTER_DESCRIPTION, dataType = DATA_TYPE_STRING, paramType = PARAM_TYPE_QUERY),
})
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.SC_OK, message = MSG_SUCCESSFUL_OPERATION),
- @ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = MSG_RESOURCE_NOT_FOUND),
- @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = MSG_SERVER_ERROR)
+ @ApiResponses({
+ @ApiResponse(code = HttpStatus.SC_OK, message = MSG_SUCCESSFUL_OPERATION),
+ @ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = MSG_CLUSTER_OR_HOST_NOT_FOUND),
+ @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = MSG_NOT_AUTHENTICATED),
+ @ApiResponse(code = HttpStatus.SC_FORBIDDEN, message = MSG_PERMISSION_DENIED),
+ @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = MSG_SERVER_ERROR),
+ @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = MSG_INVALID_ARGUMENTS),
})
public Response getProcesses(@Context HttpHeaders headers, @Context UriInfo ui,
- @PathParam("hostComponentName") String hostComponentName) {
+ @PathParam("hostComponentId") String hostComponentId) {
Map<Resource.Type,String> mapIds = new HashMap<>();
mapIds.put(Resource.Type.Cluster, m_clusterName);
mapIds.put(Resource.Type.Host, m_hostName);
diff --cc ambari-server/src/main/java/org/apache/ambari/server/api/services/ServiceConfigVersionService.java
index 3150d9a,bc859c5..0719324
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ServiceConfigVersionService.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ServiceConfigVersionService.java
@@@ -22,7 -22,7 +22,8 @@@ import java.util.HashMap
import java.util.Map;
import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+ import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.HttpHeaders;
@@@ -29,10 -30,24 +31,25 @@@ import javax.ws.rs.core.MediaType
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
+import org.apache.ambari.annotations.ApiIgnore;
+ import org.apache.ambari.annotations.SwaggerOverwriteNestedAPI;
import org.apache.ambari.server.api.resources.ResourceInstance;
+ import org.apache.ambari.server.controller.ServiceConfigVersionResponse;
import org.apache.ambari.server.controller.spi.Resource;
+ import org.apache.http.HttpStatus;
+
+ import io.swagger.annotations.Api;
+ import io.swagger.annotations.ApiImplicitParam;
+ import io.swagger.annotations.ApiImplicitParams;
+ import io.swagger.annotations.ApiOperation;
+ import io.swagger.annotations.ApiResponse;
+ import io.swagger.annotations.ApiResponses;
+
+ @Api(value = "Configurations", description = "Endpoint for configuration-specific operations")
+ @SwaggerOverwriteNestedAPI(parentApi = ConfigurationService.class, parentApiPath =
+ "/clusters", parentMethodPath = "{clusterName}/configurations/service_config_versions", pathParameters =
+ {"clusterName"})
public class ServiceConfigVersionService extends BaseService {
/**
* Parent cluster name.
@@@ -54,32 -59,39 +71,59 @@@
}
/**
+ * Constructor.
+ *
+ * @param clusterName cluster name
+ * @param serviceGroupName service group name
+ * @param serviceName service name
+ */
+ public ServiceConfigVersionService(String clusterName, String serviceGroupName, String serviceName) {
+ m_clusterName = clusterName;
+ m_serviceGroupName = serviceGroupName;
+ m_serviceName = serviceName;
+ }
+
+ @POST @ApiIgnore // until documented
+ @Produces("text/plain")
+ public Response createConfigurations(String body,@Context HttpHeaders headers, @Context UriInfo ui) {
+
+ return handleRequest(headers, body, ui, Request.Type.POST, createServiceConfigResource(m_clusterName, m_serviceGroupName, m_serviceName));
+ }
+
- @GET @ApiIgnore // until documented
- @Produces("text/plain")
++ /**
+ * Handles URL: /clusters/{clusterId}/configurations/service_config_versions
+ * Get all service configuration versions for a cluster and service.
+ *
+ * @param headers http headers
+ * @param ui uri info
+ * @return service config version collection resource representation
+ */
+ @GET
+ @Path("") // This is needed if class level path is not present otherwise no Swagger docs will be generated for this method
+ @Produces(MediaType.TEXT_PLAIN)
+ @ApiOperation(value = "Get all service config versions", response = ServiceConfigVersionResponse.class,
+ responseContainer = RESPONSE_CONTAINER_LIST)
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = QUERY_FIELDS, value = QUERY_FILTER_DESCRIPTION, dataType = DATA_TYPE_STRING, paramType =
+ PARAM_TYPE_QUERY),
+ @ApiImplicitParam(name = QUERY_SORT, value = QUERY_SORT_DESCRIPTION, dataType = DATA_TYPE_STRING, paramType = PARAM_TYPE_QUERY),
+ @ApiImplicitParam(name = QUERY_PAGE_SIZE, value = QUERY_PAGE_SIZE_DESCRIPTION, defaultValue = DEFAULT_PAGE_SIZE, dataType = DATA_TYPE_INT, paramType = PARAM_TYPE_QUERY),
+ @ApiImplicitParam(name = QUERY_FROM, value = QUERY_FROM_DESCRIPTION, allowableValues = QUERY_FROM_VALUES, defaultValue = DEFAULT_FROM, dataType = DATA_TYPE_INT, paramType = PARAM_TYPE_QUERY),
+ @ApiImplicitParam(name = QUERY_TO, value = QUERY_TO_DESCRIPTION, allowableValues = QUERY_TO_VALUES, dataType = DATA_TYPE_INT, paramType = PARAM_TYPE_QUERY),
+ })
+ @ApiResponses({
+ @ApiResponse(code = HttpStatus.SC_OK, message = MSG_SUCCESSFUL_OPERATION),
+ @ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = MSG_CLUSTER_OR_HOST_NOT_FOUND),
+ @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = MSG_NOT_AUTHENTICATED),
+ @ApiResponse(code = HttpStatus.SC_FORBIDDEN, message = MSG_PERMISSION_DENIED),
+ @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = MSG_SERVER_ERROR),
+ @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = MSG_INVALID_ARGUMENTS),
+ })
public Response getServiceConfigVersions(String body, @Context HttpHeaders headers, @Context UriInfo ui) {
- return handleRequest(headers, body, ui, Request.Type.GET, createServiceConfigResource(m_clusterName));
+ return handleRequest(headers, body, ui, Request.Type.GET, createServiceConfigResource(m_clusterName, m_serviceGroupName, m_serviceName));
}
- ResourceInstance createServiceConfigResource(String clusterName) {
+ ResourceInstance createServiceConfigResource(String clusterName, String serviceGroupName, String serviceName) {
Map<Resource.Type,String> mapIds = new HashMap<>();
mapIds.put(Resource.Type.Cluster, clusterName);
mapIds.put(Resource.Type.ServiceConfigVersion, null);
diff --cc ambari-server/src/main/java/org/apache/ambari/server/api/services/mpackadvisor/commands/MpackAdvisorCommand.java
index c3a288f,0000000..86438ee
mode 100644,000000..100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/mpackadvisor/commands/MpackAdvisorCommand.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/mpackadvisor/commands/MpackAdvisorCommand.java
@@@ -1,547 -1,0 +1,540 @@@
+/*
+ * 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.api.services.mpackadvisor.commands;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.lang.reflect.ParameterizedType;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status;
+
+import org.apache.ambari.server.api.resources.ResourceInstance;
+import org.apache.ambari.server.api.services.AmbariMetaInfo;
+import org.apache.ambari.server.api.services.BaseService;
+import org.apache.ambari.server.api.services.LocalUriInfo;
+import org.apache.ambari.server.api.services.Request;
- import org.apache.ambari.server.api.services.RootServiceComponentConfiguration;
+import org.apache.ambari.server.api.services.mpackadvisor.MpackAdvisorException;
+import org.apache.ambari.server.api.services.mpackadvisor.MpackAdvisorRequest;
+import org.apache.ambari.server.api.services.mpackadvisor.MpackAdvisorResponse;
+import org.apache.ambari.server.api.services.mpackadvisor.MpackAdvisorRunner;
+import org.apache.ambari.server.controller.RootComponent;
+import org.apache.ambari.server.controller.RootService;
+import org.apache.ambari.server.controller.internal.AmbariServerConfigurationHandler;
- import org.apache.ambari.server.controller.spi.NoSuchResourceException;
+import org.apache.ambari.server.controller.spi.Resource;
+import org.apache.ambari.server.state.ServiceInfo;
+import org.apache.ambari.server.topology.Configuration;
+import org.apache.ambari.server.topology.MpackInstance;
+import org.apache.ambari.server.topology.ServiceInstance;
+import org.apache.ambari.server.utils.DateUtils;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang.StringUtils;
+import org.codehaus.jackson.JsonNode;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.codehaus.jackson.map.SerializationConfig;
+import org.codehaus.jackson.node.ArrayNode;
+import org.codehaus.jackson.node.ObjectNode;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Parent for all commands.
+ */
+public abstract class MpackAdvisorCommand<T extends MpackAdvisorResponse> extends BaseService {
+
+ /**
+ * Type of response object provided by extending classes when
+ * is called.
+ */
+ private Class<T> type;
+
+ private static final Logger LOG = LoggerFactory.getLogger(MpackAdvisorCommand.class);
+
+ private static final String GET_HOSTS_INFO_URI = "/api/v1/hosts"
+ + "?fields=Hosts/*&Hosts/host_name.in(%s)";
+
+ private static final String GET_SERVICES_INFO_URI = "/api/v1/stacks/%s/versions/%s/"
+ + "?fields=services/StackServices/service_name,services/StackServices/service_version"
+ + ",services/components/StackServiceComponents,services/components/dependencies/Dependencies/scope"
+ + ",services/components/dependencies/Dependencies/conditions,services/components/auto_deploy"
+ + ",services/configurations/StackConfigurations/property_depends_on"
+ + ",services/configurations/dependencies/StackConfigurationDependency/dependency_name"
+ + ",services/configurations/dependencies/StackConfigurationDependency/dependency_type,services/configurations/StackConfigurations/type"
+ + "&services/StackServices/service_name.in(%s)";
+
+ private static final String SERVICES_PROPERTY = "services";
+ private static final String SERVICES_COMPONENTS_PROPERTY = "components";
+ private static final String STACK_SERVICES_PROPERTY = "StackServices";
+ private static final String COMPONENT_INFO_PROPERTY = "StackServiceComponents";
+ private static final String COMPONENT_MPACK_NAME_PROPERTY = "stack_name";
+ private static final String COMPONENT_NAME_PROPERTY = "component_name";
+ private static final String COMPONENT_HOSTNAMES_PROPERTY = "hostnames";
+ private static final String CONFIGURATIONS_PROPERTY = "configurations";
+ private static final String CHANGED_CONFIGURATIONS_PROPERTY = "changed-configurations";
+ private static final String USER_CONTEXT_PROPERTY = "user-context";
+ private static final String GPL_LICENSE_ACCEPTED = "gpl-license-accepted";
+ private static final String AMBARI_SERVER_PROPERTIES_PROPERTY = "ambari-server-properties";
+ private static final String AMBARI_SERVER_CONFIGURATIONS_PROPERTY = "ambari-server-configuration";
+
+ private File mpackRecommendationsDir;
+ private String recommendationsArtifactsLifetime;
+ private ServiceInfo.ServiceAdvisorType serviceAdvisorType;
+
+ private int requestId;
+ private File mpackRequestDirectory;
+ private MpackAdvisorRunner maRunner;
+
+ protected ObjectMapper mapper;
+
+ private final AmbariMetaInfo metaInfo;
+
+ private final AmbariServerConfigurationHandler ambariServerConfigurationHandler;
+
+ @SuppressWarnings("unchecked")
+ public MpackAdvisorCommand(File mpackmpackRecommendationsDir, String recommendationsArtifactsLifetime, ServiceInfo.ServiceAdvisorType serviceAdvisorType, int requestId,
+ MpackAdvisorRunner maRunner, AmbariMetaInfo metaInfo, AmbariServerConfigurationHandler ambariServerConfigurationHandler) {
+ this.type = (Class<T>) ((ParameterizedType) getClass().getGenericSuperclass())
+ .getActualTypeArguments()[0];
+
+ this.mapper = new ObjectMapper();
+ this.mapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
+
+ this.mpackRecommendationsDir = mpackmpackRecommendationsDir;
+ this.recommendationsArtifactsLifetime = recommendationsArtifactsLifetime;
+ this.serviceAdvisorType = serviceAdvisorType;
+ this.requestId = requestId;
+ this.maRunner = maRunner;
+ this.metaInfo = metaInfo;
+ this.ambariServerConfigurationHandler = ambariServerConfigurationHandler;
+ }
+
+ public ServiceInfo.ServiceAdvisorType getServiceAdvisorType() {
+ return this.serviceAdvisorType;
+ }
+
+ protected abstract MpackAdvisorCommandType getCommandType();
+
+ /**
+ * Simple holder for 'hosts.json' and 'services.json' data.
+ */
+ public static class MpackAdvisorData {
+ protected String hostsJSON;
+ protected String servicesJSON;
+
+ public MpackAdvisorData(String hostsJSON, String servicesJSON) {
+ this.hostsJSON = hostsJSON;
+ this.servicesJSON = servicesJSON;
+ }
+ }
+
+ /**
+ * Name with the result JSON, e.g. "component-layout.json" or "validations.json" .
+ *
+ * @return the file name
+ */
+ protected abstract String getResultFileName();
+
+ protected abstract void validate(MpackAdvisorRequest request) throws MpackAdvisorException;
+
+ protected ObjectNode adjust(String servicesJSON, MpackAdvisorRequest request) {
+ try {
+ ObjectNode root = (ObjectNode) this.mapper.readTree(servicesJSON);
+
+ populateComponentHostsMap(root, request.getComponentHostsMap());
+ populateServiceAdvisors(root);
+ populateServicesConfigurations(root, request);
+ populateClusterLevelConfigurations(root, request);
+ populateAmbariServerInfo(root);
+ populateAmbariConfiguration(root);
+ // Get previous data, if any from data.servicesJSON and append to it.
+ return root;
+ } catch (Exception e) {
+ // should not happen
+ String message = "Error parsing services.json file content: " + e.getMessage();
+ LOG.warn(message, e);
+ throw new WebApplicationException(Response.status(Status.BAD_REQUEST).entity(message).build());
+ }
+ }
+
+ /**
+ * Retrieves the Ambari configuration if exists and adds it to services.json
+ *
+ * @param root The JSON document that will become service.json when passed to the stack advisor engine
+ */
- void populateAmbariConfiguration(ObjectNode root) throws NoSuchResourceException {
- Map<String, RootServiceComponentConfiguration> config = ambariServerConfigurationHandler.getConfigurations(null);
- Map<String, Map<String,String>> result = new HashMap<>();
- for (String category : config.keySet()) {
- result.put(category, config.get(category).getProperties());
- }
- root.put(AMBARI_SERVER_CONFIGURATIONS_PROPERTY, mapper.valueToTree(result));
++ void populateAmbariConfiguration(ObjectNode root) {
++ root.put(AMBARI_SERVER_CONFIGURATIONS_PROPERTY, mapper.valueToTree(ambariServerConfigurationHandler.getConfigurations()));
+ }
+
+ /* Reads cluster level configurations (eg: cluster-settings).
+ */
+ private void populateClusterLevelConfigurations(ObjectNode root, MpackAdvisorRequest request) {
+ Map<String, Map<String, Map<String, String>>> configurations =
+ request.getConfigurations();
+ // Check if 'configurations' node exists. If not, create.
+ ObjectNode configurationsNode = null;
+ if (root.get(CONFIGURATIONS_PROPERTY) != null) {
+ configurationsNode = (ObjectNode) root.get(CONFIGURATIONS_PROPERTY);
+ } else {
+ configurationsNode = root.putObject(CONFIGURATIONS_PROPERTY);
+ }
+ for (String siteName : configurations.keySet()) {
+ ObjectNode siteNode = configurationsNode.putObject(siteName);
+
+ Map<String, Map<String, String>> siteMap = configurations.get(siteName);
+ for (String properties : siteMap.keySet()) {
+ ObjectNode propertiesNode = siteNode.putObject(properties);
+
+ Map<String, String> propertiesMap = siteMap.get(properties);
+ for (String propertyName : propertiesMap.keySet()) {
+ String propertyValue = propertiesMap.get(propertyName);
+ propertiesNode.put(propertyName, propertyValue);
+ }
+ }
+ }
+ }
+
+ private void populateServicesConfigurations(ObjectNode root, MpackAdvisorRequest request) {
+ Collection<MpackInstance> mpackInstances = request.getMpackInstances();
+ Iterator<MpackInstance> mpackInstanceItr = mpackInstances.iterator();
+ ObjectNode configurationsNode = root.putObject(CONFIGURATIONS_PROPERTY);
+ while (mpackInstanceItr.hasNext()) {
+ MpackInstance mpackInstance = mpackInstanceItr.next();
+ Collection<ServiceInstance> serviceInstances = mpackInstance.getServiceInstances();
+ Iterator<ServiceInstance> serviceInstanceItr = serviceInstances.iterator();
+ while (serviceInstanceItr.hasNext()) {
+ ServiceInstance serviceInstance = serviceInstanceItr.next();
+ Configuration configurations = serviceInstance.getConfiguration();
+ // We have read configuration properties in attributes as it allows the following format:
+ // eg: {configType -> {attributeName -> {propName, attributeValue}}}
+ Map<String, Map<String, Map<String, String>>> configProperties = configurations.getAttributes();
+ for (String siteName : configProperties.keySet()) {
+ ObjectNode siteNode = configurationsNode.putObject(siteName);
+
+ Map<String, Map<String, String>> siteMap = configProperties.get(siteName);
+ for (String properties : siteMap.keySet()) {
+ ObjectNode propertiesNode = siteNode.putObject(properties);
+
+ Map<String, String> propertiesMap = siteMap.get(properties);
+ for (String propertyName : propertiesMap.keySet()) {
+ String propertyValue = propertiesMap.get(propertyName);
+ propertiesNode.put(propertyName, propertyValue);
+ }
+ }
+ }
+ }
+ }
+
+ JsonNode changedConfigs = mapper.valueToTree(request.getChangedConfigurations());
+ root.put(CHANGED_CONFIGURATIONS_PROPERTY, changedConfigs);
+ JsonNode userContext = mapper.valueToTree(request.getUserContext());
+ root.put(USER_CONTEXT_PROPERTY, userContext);
+ root.put(GPL_LICENSE_ACCEPTED, request.getGplLicenseAccepted());
+ }
+
+ protected void populateAmbariServerInfo(ObjectNode root) {
+ Map<String, String> serverProperties = metaInfo.getAmbariServerProperties();
+
+ if (serverProperties != null && !serverProperties.isEmpty()) {
+ JsonNode serverPropertiesNode = mapper.convertValue(serverProperties, JsonNode.class);
+ root.put(AMBARI_SERVER_PROPERTIES_PROPERTY, serverPropertiesNode);
+ }
+ }
+
+ private void populateComponentHostsMap(ObjectNode root, Map<String, Map<String, Set<String>>> mpacksToComponentsHostsMap) {
+ ArrayNode services = (ArrayNode) root.get(SERVICES_PROPERTY);
+ Iterator<JsonNode> servicesIter = services.getElements();
+
+ while (servicesIter.hasNext()) {
+ JsonNode service = servicesIter.next();
+ ArrayNode components = (ArrayNode) service.get(SERVICES_COMPONENTS_PROPERTY);
+ Iterator<JsonNode> componentsIter = components.getElements();
+
+ while (componentsIter.hasNext()) {
+ JsonNode component = componentsIter.next();
+ ObjectNode componentInfo = (ObjectNode) component.get(COMPONENT_INFO_PROPERTY);
+ String componentMpackName = componentInfo.get(COMPONENT_MPACK_NAME_PROPERTY).getTextValue();
+ String componentName = componentInfo.get(COMPONENT_NAME_PROPERTY).getTextValue();
+
+ Map<String, Set<String>> mpackComponentsHostMap = mpacksToComponentsHostsMap.get(componentMpackName);
+ ArrayNode hostnames = componentInfo.putArray(COMPONENT_HOSTNAMES_PROPERTY);
+ if (mpackComponentsHostMap != null) {
+ Set<String> componentHosts = mpackComponentsHostMap.get(componentName);
+ if (null != componentHosts) {
+ for (String hostName : componentHosts) {
+ hostnames.add(hostName);
+ }
+ }
+ } else {
+ LOG.info("Mpack Instance : "+componentMpackName+"'s componentsHost Map is empty.");
+ }
+ }
+ }
+ }
+
+ private void populateServiceAdvisors(ObjectNode root) {
+ ArrayNode services = (ArrayNode) root.get(SERVICES_PROPERTY);
+ Iterator<JsonNode> servicesIter = services.getElements();
+
+ ObjectNode version = (ObjectNode) root.get("Versions");
+ String stackName = version.get("stack_name").asText();
+ String stackVersion = version.get("stack_version").asText();
+
+ while (servicesIter.hasNext()) {
+ JsonNode service = servicesIter.next();
+ ObjectNode serviceVersion = (ObjectNode) service.get(STACK_SERVICES_PROPERTY);
+ String serviceName = serviceVersion.get("service_name").getTextValue();
+ try {
+ ServiceInfo serviceInfo = metaInfo.getService(stackName, stackVersion, serviceName);
+ if (serviceInfo.getAdvisorFile() != null) {
+ serviceVersion.put("advisor_name", serviceInfo.getAdvisorName());
+ serviceVersion.put("advisor_path", serviceInfo.getAdvisorFile().getAbsolutePath());
+ }
+ }
+ catch (Exception e) {
+ LOG.error("Error adding service advisor information to services.json", e);
+ }
+ }
+ }
+
+ public synchronized T invoke(MpackAdvisorRequest request) throws MpackAdvisorException {
+ validate(request);
+ String hostsJSON = getHostsInformation(request);
+ MpackAdvisorData updatedMpackServicesData = getServicesInformation(request, hostsJSON);
+
+ try {
+ createRequestDirectory();
+
+ FileUtils.writeStringToFile(new File(mpackRequestDirectory, "hosts.json"), updatedMpackServicesData.hostsJSON);
+ FileUtils.writeStringToFile(new File(mpackRequestDirectory, "services.json"), updatedMpackServicesData.servicesJSON);
+
+ maRunner.runScript(serviceAdvisorType, getCommandType(), mpackRequestDirectory);
+ String result = FileUtils.readFileToString(new File(mpackRequestDirectory, getResultFileName()));
+
+ T response = this.mapper.readValue(result, this.type);
+ return updateResponse(request, setRequestId(response));
+ } catch (MpackAdvisorException ex) {
+ throw ex;
+ } catch (Exception e) {
+ String message = "Error occured during mpack advisor command invocation: ";
+ LOG.warn(message, e);
+ throw new MpackAdvisorException(message + e.getMessage());
+ }
+ }
+
+ protected abstract T updateResponse(MpackAdvisorRequest request, T response);
+
+ private T setRequestId(T response) {
+ response.setId(requestId);
+ return response;
+ }
+
+ /**
+ * Create request id directory for each call
+ */
+ private void createRequestDirectory() throws IOException {
+ if (!mpackRecommendationsDir.exists()) {
+ if (!mpackRecommendationsDir.mkdirs()) {
+ throw new IOException("Cannot create " + mpackRecommendationsDir);
+ }
+ }
+
+ cleanupRequestDirectory();
+
+ mpackRequestDirectory = new File(mpackRecommendationsDir, Integer.toString(requestId));
+
+ if (mpackRequestDirectory.exists()) {
+ FileUtils.deleteDirectory(mpackRequestDirectory);
+ }
+ if (!mpackRequestDirectory.mkdirs()) {
+ throw new IOException("Cannot create " + mpackRequestDirectory);
+ }
+ }
+
+ /**
+ * Deletes folders older than (now - recommendationsArtifactsLifetime)
+ */
+ private void cleanupRequestDirectory() throws IOException {
+ final Date cutoffDate = DateUtils.getDateSpecifiedTimeAgo(recommendationsArtifactsLifetime); // subdirectories older than this date will be deleted
+
+ String[] oldDirectories = mpackRecommendationsDir.list(new FilenameFilter() {
+ @Override
+ public boolean accept(File current, String name) {
+ File file = new File(current, name);
+ return file.isDirectory() && !FileUtils.isFileNewer(file, cutoffDate);
+ }
+ });
+
+ if(oldDirectories.length > 0) {
+ LOG.info(String.format("Deleting old directories %s from %s", StringUtils.join(oldDirectories, ", "), mpackRecommendationsDir));
+ }
+
+ for(String oldDirectory:oldDirectories) {
+ FileUtils.deleteQuietly(new File(mpackRecommendationsDir, oldDirectory));
+ }
+ }
+
+ String getHostsInformation(MpackAdvisorRequest request) throws MpackAdvisorException {
+ String hostsURI = String.format(GET_HOSTS_INFO_URI, request.getHostsCommaSeparated());
+
+ Response response = handleRequest(null, null, new LocalUriInfo(hostsURI), Request.Type.GET,
+ createHostResource());
+
+ if (response.getStatus() != Status.OK.getStatusCode()) {
+ String message = String.format(
+ "Error occured during hosts information retrieving, status=%s, response=%s",
+ response.getStatus(), (String) response.getEntity());
+ LOG.warn(message);
+ throw new MpackAdvisorException(message);
+ }
+
+ String hostsJSON = (String) response.getEntity();
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Hosts information: {}", hostsJSON);
+ }
+
+ Collection<String> unregistered = getUnregisteredHosts(hostsJSON, request.getHosts());
+ if (unregistered.size() > 0) {
+ String message = String.format("There are unregistered hosts in the request, %s",
+ Arrays.toString(unregistered.toArray()));
+ LOG.warn(message);
+ throw new MpackAdvisorException(message);
+ }
+
+ return hostsJSON;
+ }
+
+ @SuppressWarnings("unchecked")
+ private Collection<String> getUnregisteredHosts(String hostsJSON, List<String> hosts)
+ throws MpackAdvisorException {
+ ObjectMapper mapper = new ObjectMapper();
+ List<String> registeredHosts = new ArrayList<>();
+
+ try {
+ JsonNode root = mapper.readTree(hostsJSON);
+ Iterator<JsonNode> iterator = root.get("items").getElements();
+ while (iterator.hasNext()) {
+ JsonNode next = iterator.next();
+ String hostName = next.get("Hosts").get("host_name").getTextValue();
+ registeredHosts.add(hostName);
+ }
+
+ return CollectionUtils.subtract(hosts, registeredHosts);
+ } catch (Exception e) {
+ throw new MpackAdvisorException("Error occured during calculating unregistered hosts", e);
+ }
+ }
+
+ /*
+ Gets the updated Services information across Mpacks passed-in.
+ It does the following:
+ - Iterates through all the passed-in Mpacks instances (eg: HDPCORE-MKG), fetches their Stack Information.
+ - For each Mpack instance Type (eg: HDPCORE), makes call to its Stack API, and gathers the stack's static information (dependencies etc.)
+ - Calls adjust() function, which updates the services related information.
+ - Maintains a global ArrayNode across Mpack Instances 'updatedServicesAcrossMpacks' to keep the updated Service Array Nodes across Mpacks.
+ (Reason : We want to write services.json with 'services' element, having array of service instances across Mpacks together, to maintain
+ Python Stack Advisor compatibility.)
+ */
+ MpackAdvisorData getServicesInformation(MpackAdvisorRequest request, String hostsJSON) throws MpackAdvisorException {
+
+ Collection<MpackInstance> mpackInstances = request.getMpackInstances();
+ String servicesInfoFromMpack = null;
+ MpackAdvisorData updatedMpackAdvisorData = new MpackAdvisorData(hostsJSON, null);
+
+ // Maintains the updated Services Across mpacks as we iterate.
+ ArrayNode updatedServicesAcrossMpacks = mapper.createArrayNode();
+
+ // Maintains the updated Services in a given mpack, as we iterate which we add to 'updatedServicesAcrossMpacks'.
+ ObjectNode updatedServicesInfoForMpack = mapper.createObjectNode();
+
+ for (MpackInstance mpackInstance : mpackInstances) {
+ String stackType = mpackInstance.getMpackType();
+ String stackVersion = mpackInstance.getMpackVersion();
+ String servicesURI = String.format(GET_SERVICES_INFO_URI, stackType, stackVersion,
+ request.getMpackServiceInstanceTypeCommaSeparated(mpackInstance));
+
+ Response response = handleRequest(null, null, new LocalUriInfo(servicesURI),
+ Request.Type.GET, createStackVersionResource(stackType, stackVersion));
+
+ servicesInfoFromMpack = (String) response.getEntity();
+ if (response.getStatus() != Status.OK.getStatusCode()) {
+ String message = String.format(
+ "Error occured during services information retrieving, status=%s, response=%s",
+ response.getStatus(), (String) response.getEntity());
+ LOG.warn(message);
+ throw new MpackAdvisorException(message);
+ }
+
+ updatedServicesInfoForMpack = adjust(servicesInfoFromMpack, request);
+
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Services information: {}", servicesInfoFromMpack);
+ }
+
+ for (Iterator<JsonNode> svcInstanceItr = updatedServicesInfoForMpack.get("services").getElements(); svcInstanceItr.hasNext(); ) {
+ updatedServicesAcrossMpacks.add(svcInstanceItr.next());
+ }
+ }
+
+ // Preparing the return object as follows:
+ updatedServicesInfoForMpack.put("services", updatedServicesAcrossMpacks);
+ updatedServicesInfoForMpack.remove("Versions");
+ updatedServicesInfoForMpack.remove("href");
+
+ try {
+ updatedMpackAdvisorData.servicesJSON = mapper.writeValueAsString(updatedServicesInfoForMpack);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return updatedMpackAdvisorData;
+ }
+
+ private ResourceInstance createHostResource() {
+ Map<Resource.Type, String> mapIds = new HashMap<>();
+ return createResource(Resource.Type.Host, mapIds);
+ }
+
+ private ResourceInstance createConfigResource() {
+ Map<Resource.Type, String> mapIds = new HashMap<>();
+ mapIds.put(Resource.Type.RootService, RootService.AMBARI.name());
+ mapIds.put(Resource.Type.RootServiceComponent, RootComponent.AMBARI_SERVER.name());
+
+ return createResource(Resource.Type.RootServiceComponentConfiguration, mapIds);
+ }
+
+ private ResourceInstance createStackVersionResource(String stackName, String stackVersion) {
+ Map<Resource.Type, String> mapIds = new HashMap<>();
+ mapIds.put(Resource.Type.Stack, stackName);
+ mapIds.put(Resource.Type.StackVersion, stackVersion);
+
+ return createResource(Resource.Type.StackVersion, mapIds);
+ }
+
+}
diff --cc ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
index 0e07945,5163dab..07a52cd
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
@@@ -100,9 -165,67 +100,16 @@@ public class CheckDescription
PrereqCheckType.CLUSTER,
"A previous upgrade did not complete.",
new ImmutableMap.Builder<String, String>()
- .put(AbstractCheckDescriptor.DEFAULT,
+ .put(ClusterCheck.DEFAULT,
"The last upgrade attempt did not complete. {{fails}}").build());
+ public static CheckDescription INSTALL_PACKAGES_CHECK = new CheckDescription("INSTALL_PACKAGES_CHECK",
+ PrereqCheckType.CLUSTER,
+ "Install packages must be re-run",
+ new ImmutableMap.Builder<String, String>()
- .put(AbstractCheckDescriptor.DEFAULT,
++ .put(ClusterCheck.DEFAULT,
+ "Re-run Install Packages before starting upgrade").build());
+
- public static CheckDescription SERVICES_YARN_WP = new CheckDescription("SERVICES_YARN_WP",
- PrereqCheckType.SERVICE,
- "YARN work preserving restart should be enabled",
- new ImmutableMap.Builder<String, String>()
- .put(AbstractCheckDescriptor.DEFAULT,
- "YARN should have work preserving restart enabled. The yarn-site.xml property yarn.resourcemanager.work-preserving-recovery.enabled property should be set to true.").build());
-
- public static CheckDescription SERVICES_YARN_RM_HA = new CheckDescription("SERVICES_YARN_RM_HA",
- PrereqCheckType.SERVICE,
- "YARN ResourceManager High Availability is not enabled.",
- new ImmutableMap.Builder<String, String>()
- .put(AbstractCheckDescriptor.DEFAULT,
- "YARN ResourceManager HA should be enabled to prevent a disruption in service during the upgrade").build());
-
- public static CheckDescription SERVICES_YARN_TIMELINE_ST = new CheckDescription("SERVICES_YARN_TIMELINE_ST",
- PrereqCheckType.SERVICE,
- "YARN Timeline state preserving restart should be enabled",
- new ImmutableMap.Builder<String, String>()
- .put(AbstractCheckDescriptor.DEFAULT,
- "YARN should have state preserving restart enabled for the Timeline server. The yarn-site.xml property yarn.timeline-service.recovery.enabled should be set to true.").build());
-
- public static CheckDescription SERVICES_MR2_JOBHISTORY_ST = new CheckDescription("SERVICES_MR2_JOBHISTORY_ST",
- PrereqCheckType.SERVICE,
- "MapReduce2 JobHistory recovery should be enabled",
- new ImmutableMap.Builder<String, String>()
- .put(MapReduce2JobHistoryStatePreservingCheck.MAPREDUCE2_JOBHISTORY_RECOVERY_ENABLE_KEY,
- "MapReduce2 should have recovery enabled for the JobHistory server. The mapred-site.xml property mapreduce.jobhistory.recovery.enable should be set to true.")
- .put(MapReduce2JobHistoryStatePreservingCheck.MAPREDUCE2_JOBHISTORY_RECOVERY_STORE_KEY,
- "MapReduce2 should have recovery enabled for the JobHistory server. The mapred-site.xml property mapreduce.jobhistory.recovery.store.class should be set to org.apache.hadoop.mapreduce.v2.hs.HistoryServerLeveldbStateStoreService.")
- .put(MapReduce2JobHistoryStatePreservingCheck.MAPREDUCE2_JOBHISTORY_RECOVERY_STORE_LEVELDB_PATH_KEY,
- "MapReduce2 should have recovery enabled for the JobHistory server. The mapred-site.xml property mapreduce.jobhistory.recovery.store.leveldb.path should be set. Please note that \"mapreduce.jobhistory.recovery.store.leveldb.path\" should be on a mount with ~3 GB of free space.").build());
-
- public static CheckDescription SERVICES_HIVE_DYNAMIC_SERVICE_DISCOVERY = new CheckDescription("SERVICES_HIVE_DYNAMIC_SERVICE_DISCOVERY",
- PrereqCheckType.SERVICE,
- "Hive Dynamic Service Discovery",
- new ImmutableMap.Builder<String, String>()
- .put(HiveDynamicServiceDiscoveryCheck.HIVE_DYNAMIC_SERVICE_DISCOVERY_ENABLED_KEY,
- "The hive-site.xml property hive.server2.support.dynamic.service.discovery should be set to true.")
- .put(HiveDynamicServiceDiscoveryCheck.HIVE_DYNAMIC_SERVICE_ZK_QUORUM_KEY,
- "The hive-site.xml property hive.zookeeper.quorum should be set to a comma-separate list of ZooKeeper hosts:port pairs.")
- .put(HiveDynamicServiceDiscoveryCheck.HIVE_DYNAMIC_SERVICE_ZK_NAMESPACE_KEY,
- "The hive-site.xml property hive.server2.zookeeper.namespace should be set to the value for the root namespace on ZooKeeper.").build());
-
- public static CheckDescription AMS_HADOOP_SINK_VERSION_COMPATIBILITY = new CheckDescription("AMS_HADOOP_SINK_VERSION_COMPATIBILITY",
- PrereqCheckType.HOST,
- "Ambari Metrics Hadoop Sinks need to be compatible with the stack version. This check ensures that compatibility.",
- new ImmutableMap.Builder<String, String>().put(AbstractCheckDescriptor.DEFAULT,"Hadoop Sink version check failed. " +
- "To fix this, please upgrade 'ambari-metrics-hadoop-sink' package to %s on all the failed hosts")
- .put(AmbariMetricsHadoopSinkVersionCompatibilityCheck.HADOOP_SINK_VERSION_NOT_SPECIFIED, "Hadoop Sink version for pre-check not specified. " +
- "Please use 'min-hadoop-sink-version' property in upgrade pack to specify min hadoop sink version").build());
-
public static CheckDescription CONFIG_MERGE = new CheckDescription("CONFIG_MERGE",
PrereqCheckType.CLUSTER,
"Configuration Merge Check",
@@@ -135,9 -286,37 +142,8 @@@
"After upgrading, %s can be reinstalled")
.put(ServicePresenceCheck.KEY_SERVICE_REMOVED,
"The %s service is currently installed on the cluster. " +
- "This service is removed from the new release and must be removed before the upgrade can continue. " +
- "After upgrading, %s can be installed").build());
+ "This service is removed from the new release and must be removed before the upgrade can continue.").build());
- public static CheckDescription RANGER_SERVICE_AUDIT_DB_CHECK = new CheckDescription("RANGER_SERVICE_AUDIT_DB_CHECK",
- PrereqCheckType.SERVICE,
- "Remove the Ranger Audit to Database Capability",
- new ImmutableMap.Builder<String, String>()
- .put(AbstractCheckDescriptor.DEFAULT,
- "After upgrading, Ranger will no longer support the Audit to Database feature. Instead, Ranger will audit to Solr. " +
- "To migrate the existing audit logs to Solr, follow the steps in Apache Ranger documention for 0.6 release.").build());
-
- public static CheckDescription KAFKA_KERBEROS_CHECK = new CheckDescription("KAFKA_KERBEROS_CHECK",
- PrereqCheckType.SERVICE,
- "Kafka upgrade on Kerberized cluster",
- new ImmutableMap.Builder<String, String>()
- .put(AbstractCheckDescriptor.DEFAULT,
- "Kafka is currently not Kerberized, but your cluster is. After upgrading, Kafka will automatically be Kerberized for you.").build());
-
- public static CheckDescription SERVICES_HIVE_ROLLING_WARNING = new CheckDescription("SERVICES_HIVE_ROLLING_WARNING",
- PrereqCheckType.SERVICE,
- "HiveServer2 Downtime",
- new ImmutableMap.Builder<String, String>()
- .put(AbstractCheckDescriptor.DEFAULT,
- "HiveServer2 does not currently support rolling upgrades. HiveServer2 will be upgraded, however existing queries which have not completed will fail and need to be resubmitted after HiveServer2 has been upgraded.").build());
-
- public static CheckDescription SERVICES_STORM_ROLLING_WARNING = new CheckDescription("SERVICES_STORM_ROLLING_WARNING",
- PrereqCheckType.SERVICE,
- "Storm Downtime During Upgrade",
- new ImmutableMap.Builder<String, String>()
- .put(AbstractCheckDescriptor.DEFAULT,
- "Storm does not support rolling upgrades on this version of the stack. If you proceed, you will be required to stop all running topologies before Storm is restarted.").build());
-
public static CheckDescription AUTO_START_DISABLED = new CheckDescription("AUTO_START_DISABLED",
PrereqCheckType.CLUSTER,
"Auto-Start Disabled Check",
@@@ -164,35 -350,69 +170,79 @@@
.build());
public static CheckDescription COMPONENTS_EXIST_IN_TARGET_REPO = new CheckDescription("COMPONENTS_EXIST_IN_TARGET_REPO",
- PrereqCheckType.CLUSTER,
- "Verify Cluster Components Exist In Target Repository",
+ PrereqCheckType.CLUSTER,
+ "Check installed services which are not supported in the installed stack",
+ new ImmutableMap.Builder<String, String>()
+ .put(ComponentsExistInRepoCheck.AUTO_REMOVE, "The following services and/or components do not exist in the target stack and will be automatically removed during the upgrade.")
+ .put(ComponentsExistInRepoCheck.MANUAL_REMOVE, "The following components do not exist in the target repository's stack. They must be removed from the cluster before upgrading.")
+ .build()
+ );
+
+ public static CheckDescription DRUID_HA_WARNING = new CheckDescription(
+ "DRUID_HA",
+ PrereqCheckType.SERVICE,
+ "Druid Downtime During Upgrade",
new ImmutableMap.Builder<String, String>()
- .put(ClusterCheck.DEFAULT, "The following components do not exist in the target repository's stack. They must be removed from the cluster before upgrading.")
- .build());
+ .put(
- AbstractCheckDescriptor.DEFAULT,
++ ClusterCheck.DEFAULT,
+ "High Availability is not enabled for Druid. Druid Service may have some downtime during upgrade. Deploy multiple instances of %s in the Cluster to avoid any downtime."
+ )
+ .build()
+ );
public static CheckDescription VALID_SERVICES_INCLUDED_IN_REPOSITORY = new CheckDescription("VALID_SERVICES_INCLUDED_IN_REPOSITORY",
PrereqCheckType.CLUSTER,
"The repository is missing services which are required",
new ImmutableMap.Builder<String, String>()
- .put(AbstractCheckDescriptor.DEFAULT,
+ .put(ClusterCheck.DEFAULT,
"The following services are included in the upgrade but the repository is missing their dependencies:\n%s").build());
-
+ public static CheckDescription ATLAS_MIGRATION_PROPERTY_CHECK = new CheckDescription("ATLAS_MIGRATION_PROPERTY_CHECK",
+ PrereqCheckType.SERVICE, "Check for Atlas Migration Property before upgrade.",
- new ImmutableMap.Builder<String,String>().put(AbstractCheckDescriptor.DEFAULT,
++ new ImmutableMap.Builder<String,String>().put(ClusterCheck.DEFAULT,
+ "The property atlas.migration.data.filename is missing from application-properties. Do not use atlas conf path ie /etc/atlas/conf as the value." +
+ "After upgrading Atlas will no longer support TitanDB, instead it will support JanusGraph." +
+ "Hence need to migrate existing data to newer formats post upgrade. " +
+ "To migrate existing data, Kindly refer and follow Apache Atlas documentation for 1.0 release.").build());
+
+ public static CheckDescription KERBEROS_ADMIN_CREDENTIAL_CHECK = new CheckDescription("KERBEROS_ADMIN_CREDENTIAL_CHECK",
+ PrereqCheckType.CLUSTER,
+ "The KDC administrator credentials need to be stored in Ambari persisted credential store.",
+ new ImmutableMap.Builder<String, String>()
+ .put(KerberosAdminPersistedCredentialCheck.KEY_PERSISTED_STORE_NOT_CONFIGURED,
+ "Ambari's credential store has not been configured. " +
+ "This is needed so the KDC administrator credential may be stored long enough to ensure it will be around if needed during the upgrade process.")
+ .put(KerberosAdminPersistedCredentialCheck.KEY_CREDENTIAL_NOT_STORED,
+ "The KDC administrator credential has not been stored in the persisted credential store. " +
+ "Visit the Kerberos administrator page to set the credential. " +
+ "This is needed so the KDC administrator credential may be stored long enough to ensure it will be around if needed during the upgrade process.")
+ .build());
+
+
+ public static final CheckDescription MISSING_OS_IN_REPO_VERSION = new CheckDescription("MISSING_OS_IN_REPO_VERSION",
+ PrereqCheckType.CLUSTER,
+ "Missing OS in repository version.",
+ new ImmutableMap.Builder<String, String>()
+ .put(MissingOsInRepoVersionCheck.SOURCE_OS, "The source version must have an entry for each OS type in the cluster")
+ .put(MissingOsInRepoVersionCheck.TARGET_OS, "The target version must have an entry for each OS type in the cluster")
+ .build());
+
-
- private String m_name;
- private PrereqCheckType m_type;
- private String m_description;
+ /**
+ * A unique identifier.
+ */
+ private final String m_name;
+ private final PrereqCheckType m_type;
+ private final String m_description;
private Map<String, String> m_fails;
+
+ /**
+ * Constructor.
+ *
+ * @param name
+ * @param type
+ * @param description
+ * @param fails
+ */
public CheckDescription(String name, PrereqCheckType type, String description, Map<String, String> fails) {
m_name = name;
m_type = type;
diff --cc ambari-server/src/main/java/org/apache/ambari/server/checks/ComponentsExistInRepoCheck.java
index d8fad10,fca4131..336779f
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/ComponentsExistInRepoCheck.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/ComponentsExistInRepoCheck.java
@@@ -17,30 -17,25 +17,33 @@@
*/
package org.apache.ambari.server.checks;
-import java.util.Collection;
+import java.text.MessageFormat;
import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.stream.Collectors;
import org.apache.ambari.server.AmbariException;
+import org.apache.ambari.server.StackAccessException;
import org.apache.ambari.server.controller.PrereqCheckRequest;
-import org.apache.ambari.server.serveraction.upgrades.DeleteUnsupportedServicesAndComponents;
+import org.apache.ambari.server.orm.entities.UpgradePlanDetailEntity;
import org.apache.ambari.server.state.Cluster;
+import org.apache.ambari.server.state.ComponentInfo;
+import org.apache.ambari.server.state.Mpack;
+import org.apache.ambari.server.state.Service;
+import org.apache.ambari.server.state.ServiceComponent;
+ import org.apache.ambari.server.state.ServiceComponentSupport;
+import org.apache.ambari.server.state.ServiceGroup;
+import org.apache.ambari.server.state.ServiceInfo;
+import org.apache.ambari.server.state.StackId;
+ import org.apache.ambari.server.state.UpgradeHelper;
import org.apache.ambari.server.state.stack.PrereqCheckStatus;
-import org.apache.ambari.server.state.stack.PrerequisiteCheck;
-import org.apache.ambari.server.state.stack.UpgradePack;
-import org.apache.ambari.server.state.stack.upgrade.ClusterGrouping;
-import org.apache.ambari.server.state.stack.upgrade.Direction;
-import org.apache.ambari.server.state.stack.upgrade.ServerActionTask;
-import org.apache.ambari.server.state.stack.upgrade.Task;
+import org.apache.ambari.server.state.stack.UpgradeCheckResult;
import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
+import org.apache.commons.lang.StringUtils;
+ import com.google.inject.Inject;
import com.google.inject.Singleton;
/**
@@@ -50,13 -45,16 +53,16 @@@
*/
@Singleton
@UpgradeCheck(
- group = UpgradeCheckGroup.TOPOLOGY,
- group = UpgradeCheckGroup.INFORMATIONAL_WARNING,
- required = { UpgradeType.ROLLING, UpgradeType.NON_ROLLING })
-public class ComponentsExistInRepoCheck extends AbstractCheckDescriptor {
++ group = UpgradeCheckGroup.INFORMATIONAL_WARNING,
+ required = { UpgradeType.ROLLING, UpgradeType.EXPRESS, UpgradeType.HOST_ORDERED })
+public class ComponentsExistInRepoCheck extends ClusterCheck {
+ public static final String AUTO_REMOVE = "auto_remove";
+ public static final String MANUAL_REMOVE = "manual_remove";
+ @Inject
+ ServiceComponentSupport serviceComponentSupport;
+ @Inject
+ UpgradeHelper upgradeHelper;
- /**
- * Constructor.
- */
public ComponentsExistInRepoCheck() {
super(CheckDescription.COMPONENTS_EXIST_IN_TARGET_REPO);
}
diff --cc ambari-server/src/main/java/org/apache/ambari/server/checks/KerberosAdminPersistedCredentialCheck.java
index 0000000,7735e4b..7d23041
mode 000000,100644..100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/KerberosAdminPersistedCredentialCheck.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/KerberosAdminPersistedCredentialCheck.java
@@@ -1,0 -1,130 +1,132 @@@
+ /*
+ * 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.checks;
+
+ import static org.apache.ambari.server.state.stack.upgrade.Task.Type.REGENERATE_KEYTABS;
+
+ import java.util.Collections;
+ import java.util.Set;
+
+ import org.apache.ambari.server.AmbariException;
+ import org.apache.ambari.server.controller.KerberosHelper;
+ import org.apache.ambari.server.controller.PrereqCheckRequest;
+ import org.apache.ambari.server.security.encryption.CredentialStoreService;
+ import org.apache.ambari.server.security.encryption.CredentialStoreType;
+ import org.apache.ambari.server.state.Cluster;
+ import org.apache.ambari.server.state.SecurityType;
+ import org.apache.ambari.server.state.UpgradeHelper;
+ import org.apache.ambari.server.state.stack.PrereqCheckStatus;
-import org.apache.ambari.server.state.stack.PrerequisiteCheck;
++import org.apache.ambari.server.state.stack.UpgradeCheckResult;
+ import org.apache.ambari.server.state.stack.UpgradePack;
-import org.apache.ambari.server.state.stack.upgrade.Direction;
+ import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
+ import org.slf4j.Logger;
+ import org.slf4j.LoggerFactory;
+
+ import com.google.inject.Inject;
+
+ /**
+ * The {@link KerberosAdminPersistedCredentialCheck} class is used to check that the Kerberos
+ * administrator credentials are stored in the persisted credential store when Kerberos is enabled.
+ * <p>
+ * This is needed so that if Kerberos principals and/or keytab files need to be created during a stack
+ * upgrade, the KDC administrator credentials are guaranteed to be available. If the temporary store
+ * is used, the credential may have expired before needed.
+ */
+ @UpgradeCheck(
+ group = UpgradeCheckGroup.KERBEROS,
- required = {UpgradeType.ROLLING, UpgradeType.NON_ROLLING, UpgradeType.HOST_ORDERED})
-public class KerberosAdminPersistedCredentialCheck extends AbstractCheckDescriptor {
++ required = {UpgradeType.ROLLING, UpgradeType.EXPRESS, UpgradeType.HOST_ORDERED})
++public class KerberosAdminPersistedCredentialCheck extends ClusterCheck {
+ private static final Logger LOG = LoggerFactory.getLogger(KerberosAdminPersistedCredentialCheck.class);
+ public static final String KEY_PERSISTED_STORE_NOT_CONFIGURED = "persisted_store_no_configured";
+
+ public static final String KEY_CREDENTIAL_NOT_STORED = "admin_credential_not_stored";
+
+ @Inject
+ private CredentialStoreService credentialStoreService;
+
+ @Inject
+ private UpgradeHelper upgradeHelper;
+
+ /**
+ * Constructor.
+ */
+ @Inject
+ public KerberosAdminPersistedCredentialCheck() {
+ super(CheckDescription.KERBEROS_ADMIN_CREDENTIAL_CHECK);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Set<String> getApplicableServices() {
+ return Collections.emptySet();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
- public void perform(PrerequisiteCheck prerequisiteCheck, PrereqCheckRequest request) throws AmbariException {
++ public UpgradeCheckResult perform(PrereqCheckRequest request) throws AmbariException {
+
+ final String clusterName = request.getClusterName();
+ final Cluster cluster = clustersProvider.get().getCluster(clusterName);
++ UpgradeCheckResult result = new UpgradeCheckResult(this);
+
+ // Perform the check only if Kerberos is enabled
+ if (cluster.getSecurityType() != SecurityType.KERBEROS) {
- return;
++ return result;
+ }
+
+ if (!upgradePack(request).anyGroupTaskMatch(task -> task.getType() == REGENERATE_KEYTABS)) {
+ LOG.info("Skipping upgrade check {} because there is no {} in the upgrade pack.", this.getClass().getSimpleName(), REGENERATE_KEYTABS);
- return;
++ return result;
+ }
+
+ // Perform the check only if Ambari is managing the Kerberos identities
+ if (!"true".equalsIgnoreCase(getProperty(request, "kerberos-env", "manage_identities"))) {
- return;
++ return result;
+ }
+
+ if (!credentialStoreService.isInitialized(CredentialStoreType.PERSISTED)) {
+ // The persisted store is not available
- prerequisiteCheck.setFailReason(getFailReason(KEY_PERSISTED_STORE_NOT_CONFIGURED, prerequisiteCheck, request));
- prerequisiteCheck.setStatus(PrereqCheckStatus.FAIL);
- prerequisiteCheck.getFailedOn().add(request.getClusterName());
++ result.setFailReason(getFailReason(KEY_PERSISTED_STORE_NOT_CONFIGURED, result, request));
++ result.setStatus(PrereqCheckStatus.FAIL);
++ result.getFailedOn().add(request.getClusterName());
+ } else if (credentialStoreService.getCredential(clusterName, KerberosHelper.KDC_ADMINISTRATOR_CREDENTIAL_ALIAS, CredentialStoreType.PERSISTED) == null) {
+ // The KDC administrator credential has not been stored in the persisted credential store
- prerequisiteCheck.setFailReason(getFailReason(KEY_CREDENTIAL_NOT_STORED, prerequisiteCheck, request));
- prerequisiteCheck.setStatus(PrereqCheckStatus.FAIL);
- prerequisiteCheck.getFailedOn().add(request.getClusterName());
++ result.setFailReason(getFailReason(KEY_CREDENTIAL_NOT_STORED, result, request));
++ result.setStatus(PrereqCheckStatus.FAIL);
++ result.getFailedOn().add(request.getClusterName());
+ }
-
++ return result;
+ }
+
+ private UpgradePack upgradePack(PrereqCheckRequest request) throws AmbariException {
- return upgradeHelper.suggestUpgradePack(
- request.getClusterName(),
- request.getSourceStackId(),
- request.getTargetRepositoryVersion().getStackId(),
- Direction.UPGRADE,
- request.getUpgradeType(),
- null);
++ // TODO : [AMP] Fix helper function
++ return null;
++// return upgradeHelper.suggestUpgradePack(
++// request.getClusterName(),
++// request.getSourceStackId(),
++// request.getTargetRepositoryVersion().getStackId(),
++// Direction.UPGRADE,
++// request.getUpgradeType(),
++// null);
+ }
+
+ }
diff --cc ambari-server/src/main/java/org/apache/ambari/server/checks/MissingOsInRepoVersionCheck.java
index 0000000,14f27b9..0213d33
mode 000000,100644..100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/MissingOsInRepoVersionCheck.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/MissingOsInRepoVersionCheck.java
@@@ -1,0 -1,101 +1,107 @@@
+ /*
+ *
+ * * 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.checks;
+
+ import static java.util.stream.Collectors.toSet;
+ import static org.apache.ambari.server.state.MaintenanceState.OFF;
+
+ import java.util.LinkedHashSet;
+ import java.util.Set;
+
+ import org.apache.ambari.server.AmbariException;
+ import org.apache.ambari.server.controller.PrereqCheckRequest;
-import org.apache.ambari.server.orm.entities.RepoOsEntity;
+ import org.apache.ambari.server.state.Cluster;
+ import org.apache.ambari.server.state.Host;
+ import org.apache.ambari.server.state.stack.PrereqCheckStatus;
-import org.apache.ambari.server.state.stack.PrerequisiteCheck;
++import org.apache.ambari.server.state.stack.UpgradeCheckResult;
+ import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
+
+ import com.google.inject.Singleton;
+
++
+ /**
+ * This checks if the source and target version has an entry for each OS type in the cluster.
+ */
+ @Singleton
+ @UpgradeCheck(
+ group = UpgradeCheckGroup.REPOSITORY_VERSION,
- required = { UpgradeType.NON_ROLLING, UpgradeType.ROLLING })
-public class MissingOsInRepoVersionCheck extends AbstractCheckDescriptor {
++ required = { UpgradeType.EXPRESS, UpgradeType.ROLLING })
++public class MissingOsInRepoVersionCheck extends ClusterCheck {
+ public static final String SOURCE_OS = "source_os";
+ public static final String TARGET_OS = "target_os";
+
+ public MissingOsInRepoVersionCheck() {
+ super(CheckDescription.MISSING_OS_IN_REPO_VERSION);
+ }
+
+ @Override
- public void perform(PrerequisiteCheck prerequisiteCheck, PrereqCheckRequest request) throws AmbariException {
- Set<String> osFamiliesInCluster = osFamiliesInCluster(cluster(prerequisiteCheck));
++ public UpgradeCheckResult perform(PrereqCheckRequest request) throws AmbariException {
++ UpgradeCheckResult result = new UpgradeCheckResult(this);
++ Set<String> osFamiliesInCluster = osFamiliesInCluster(cluster(request));
+ if (!targetOsFamilies(request).containsAll(osFamiliesInCluster)) {
- prerequisiteCheck.setFailReason(getFailReason(TARGET_OS, prerequisiteCheck, request));
- prerequisiteCheck.setStatus(PrereqCheckStatus.FAIL);
- prerequisiteCheck.setFailedOn(new LinkedHashSet<>(osFamiliesInCluster));
++ result.setFailReason(getFailReason(TARGET_OS, result, request));
++ result.setStatus(PrereqCheckStatus.FAIL);
++ result.setFailedOn(new LinkedHashSet<>(osFamiliesInCluster));
+ } else if (!sourceOsFamilies(request).containsAll(osFamiliesInCluster)) {
- prerequisiteCheck.setFailReason(getFailReason(SOURCE_OS, prerequisiteCheck, request));
- prerequisiteCheck.setStatus(PrereqCheckStatus.FAIL);
- prerequisiteCheck.setFailedOn(new LinkedHashSet<>(osFamiliesInCluster));
++ result.setFailReason(getFailReason(SOURCE_OS, result, request));
++ result.setStatus(PrereqCheckStatus.FAIL);
++ result.setFailedOn(new LinkedHashSet<>(osFamiliesInCluster));
+ }
++ return result;
+ }
+
- private Cluster cluster(PrerequisiteCheck prerequisiteCheck) throws AmbariException {
- return clustersProvider.get().getCluster(prerequisiteCheck.getClusterName());
++ private Cluster cluster(PrereqCheckRequest request) throws AmbariException {
++ return clustersProvider.get().getCluster(request.getClusterName());
+ }
+
+ /**
+ * @return set of each os family in the cluster, excluding hosts which are in maintenance state
+ */
+ private Set<String> osFamiliesInCluster(Cluster cluster) {
+ return cluster.getHosts().stream()
+ .filter(host -> host.getMaintenanceState(cluster.getClusterId()) == OFF)
+ .map(Host::getOsFamily)
+ .collect(toSet());
+ }
+
+ /**
+ * @return set of each os family in the source stack
+ */
+ private Set<String> sourceOsFamilies(PrereqCheckRequest request) throws AmbariException {
- return ambariMetaInfo.get().getStack(request.getSourceStackId()).getRepositoriesByOs().keySet();
++ // TODO: [AMP] Fix it
++ return null;
++ // return ambariMetaInfo.get().getStack(request.getSourceStackId()).getRepositoriesByOs().keySet();
+ }
+
+ /**
+ * @return set of each os family in the target repository
+ */
+ private Set<String> targetOsFamilies(PrereqCheckRequest request) {
- return request
- .getTargetRepositoryVersion()
- .getRepoOsEntities()
- .stream()
- .map(RepoOsEntity::getFamily)
- .collect(toSet());
++ return null;
++ // TODO: [AMP] Fix it
++// return request
++// .getTargetRepositoryVersion()
++// .getRepoOsEntities()
++// .stream()
++// .map(RepoOsEntity::getFamily)
++// .collect(toSet());
+ }
+ }
diff --cc ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
index 4a99793,30db434..cb1d8ef
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
@@@ -211,8 -200,12 +206,13 @@@ public class AmbariCustomCommandExecuti
private Boolean isValidCustomCommand(ActionExecutionContext
actionExecutionContext, RequestResourceFilter resourceFilter)
throws AmbariException {
+
+ if (actionExecutionContext.isFutureCommand()) {
+ return true;
+ }
+
String clusterName = actionExecutionContext.getClusterName();
+ String serviceGroupName = resourceFilter.getServiceGroupName();
String serviceName = resourceFilter.getServiceName();
String componentName = resourceFilter.getComponentName();
String commandName = actionExecutionContext.getActionName();
@@@ -285,15 -276,19 +285,19 @@@
// Filter hosts that are in MS
Set<String> ignoredHosts = maintenanceStateHelper.filterHostsInMaintenanceState(
- candidateHosts, new MaintenanceStateHelper.HostPredicate() {
- @Override
- public boolean shouldHostBeRemoved(final String hostname)
- throws AmbariException {
- return !maintenanceStateHelper.isOperationAllowed(
- cluster, actionExecutionContext.getOperationLevel(),
- resourceFilter, serviceGroupName, serviceName, componentName, hostname);
+ candidateHosts, new MaintenanceStateHelper.HostPredicate() {
+ @Override
+ public boolean shouldHostBeRemoved(final String hostname)
+ throws AmbariException {
+ if (actionExecutionContext.isFutureCommand()) {
+ return false;
}
+
+ return !maintenanceStateHelper.isOperationAllowed(
+ cluster, actionExecutionContext.getOperationLevel(),
- resourceFilter, serviceName, componentName, hostname);
++ resourceFilter, serviceGroupName, serviceName, componentName, hostname);
}
+ }
);
// Filter unhealthy hosts
@@@ -322,10 -317,14 +326,14 @@@
throw new AmbariException(message);
}
- Service service = cluster.getService(serviceName);
+ ServiceGroup serviceGroup = cluster.getServiceGroup(serviceGroupName);
+ Service service = cluster.getService(serviceGroupName, serviceName);
+ StackId stackId = service.getStackId();
- // grab the stack ID from the service first, and use the context's if it's set
- StackId stackId = service.getDesiredStackId();
+ if (null != actionExecutionContext.getStackId()) {
+ stackId = actionExecutionContext.getStackId();
+ }
+
AmbariMetaInfo ambariMetaInfo = managementController.getAmbariMetaInfo();
ServiceInfo serviceInfo = ambariMetaInfo.getService(service);
@@@ -569,58 -549,63 +569,58 @@@
String clusterName = actionExecutionContext.getClusterName();
final Cluster cluster = clusters.getCluster(clusterName);
- final String componentName = actionMetadata.getClient(resourceFilter.getServiceName());
+ final String serviceGroupName = resourceFilter.getServiceGroupName();
final String serviceName = resourceFilter.getServiceName();
- String smokeTestRole = actionMetadata.getServiceCheckAction(serviceName);
- if (null == smokeTestRole) {
- smokeTestRole = actionExecutionContext.getActionName();
- }
+ Service service = cluster.getService(serviceGroupName, serviceName);
- Set<String> candidateHosts;
- final Map<String, ServiceComponentHost> serviceHostComponents;
+ // If specified a specific host, run on it as long as it contains the component.
+ // Otherwise, throw the exception.
+ List<String> candidateHostsList = resourceFilter.getHostNames();
- if (componentName != null) {
- serviceHostComponents = cluster.getService(serviceName).getServiceComponent(componentName).getServiceComponentHosts();
+ ServiceComponentHost selectedServiceComponentHost = calculateServiceComponentHostForServiceCheck(cluster, service,
+ candidateHostsList, actionExecutionContext.isMaintenanceModeHostExcluded());
- if (serviceHostComponents.isEmpty()) {
- throw new AmbariException(MessageFormat.format("No hosts found for service: {0}, component: {1} in cluster: {2}",
- serviceName, componentName, clusterName));
- }
+ long nowTimestamp = System.currentTimeMillis();
+ Map<String, String> actionParameters = actionExecutionContext.getParameters();
- // If specified a specific host, run on it as long as it contains the component.
- // Otherwise, use candidates that contain the component.
- List<String> candidateHostsList = resourceFilter.getHostNames();
- if (candidateHostsList != null && !candidateHostsList.isEmpty()) {
- candidateHosts = new HashSet<>(candidateHostsList);
+ String smokeTestRole = actionMetadata.getServiceCheckAction(service.getServiceType());
+ if (null == smokeTestRole) {
+ smokeTestRole = actionExecutionContext.getActionName();
+ }
- // Get the intersection.
- candidateHosts.retainAll(serviceHostComponents.keySet());
+ addServiceCheckAction(stage, selectedServiceComponentHost.getHostName(), smokeTestRole, nowTimestamp,
+ selectedServiceComponentHost.getServiceGroupName(),
+ selectedServiceComponentHost.getServiceName(),
+ selectedServiceComponentHost.getServiceComponentName(),
+ actionParameters, actionExecutionContext.isRetryAllowed(),
+ actionExecutionContext.isFailureAutoSkipped(),
- serviceName);
++ serviceName, false);
+ }
- if (candidateHosts.isEmpty()) {
- throw new AmbariException(MessageFormat.format("The resource filter for hosts does not contain components for " +
- "service: {0}, component: {1} in cluster: {2}", serviceName, componentName, clusterName));
- }
- } else {
- candidateHosts = serviceHostComponents.keySet();
- }
- } else {
- // TODO: This code branch looks unreliable (taking random component, should prefer the clients)
- Map<String, ServiceComponent> serviceComponents = cluster.getService(serviceName).getServiceComponents();
+ ServiceComponentHost calculateServiceComponentHostForServiceCheck(Cluster cluster, Service service) throws AmbariException {
+ return calculateServiceComponentHostForServiceCheck(cluster, service, null, true);
+ }
- // Filter components without any HOST
- Iterator<String> serviceComponentNameIterator = serviceComponents.keySet().iterator();
- while (serviceComponentNameIterator.hasNext()){
- String componentToCheck = serviceComponentNameIterator.next();
- if (serviceComponents.get(componentToCheck).getServiceComponentHosts().isEmpty()){
- serviceComponentNameIterator.remove();
- }
- }
+ /**
+ * Calculates the ServiceComponentHost for cluster service where the service check will be executed.
+ * Takes into account all the possible clients.
+ * Those include the given service clients and clients of dependent services if the client component name is specified in the metainfo.xml of the given service
+ *
+ * Filters out hosts that are : not listed in candidateHostsList (if non null or not empty)
+ * in maintenance mode (based on isMaintenanceModeHostExcluded)
+ * are unhealthy
+ *
+ * Based on the ServiceComponentHosts that left selects a ServiceComponentHost using following logic:
+ * If possible select a host that's not loaded with tasks. Random otherwise
+ * If possible select a component of the service that the service check runs for. Random otherwise
+ */
+ ServiceComponentHost calculateServiceComponentHostForServiceCheck(Cluster cluster, Service service,
+ List<String> candidateHostsList, boolean isMaintenanceModeHostExcluded) throws AmbariException {
- if (serviceComponents.isEmpty()) {
- throw new AmbariException(MessageFormat.format("Did not find any hosts with components for service: {0} in cluster: {1}",
- serviceName, clusterName));
- }
+ //calculate the possible host-component map where the service check could be executed
+ Multimap<String, ServiceComponentHost> hostComponentMultiMap = calculateHostsClientsMultimap(service, cluster, candidateHostsList);
- // Pick a random service (should prefer clients).
- ServiceComponent serviceComponent = serviceComponents.values().iterator().next();
- serviceHostComponents = serviceComponent.getServiceComponentHosts();
- candidateHosts = serviceHostComponents.keySet();
- }
+ Set<String> candidateHosts = hostComponentMultiMap.keySet();
// check if all hostnames are valid.
for(String candidateHostName: candidateHosts) {
@@@ -835,8 -699,8 +835,9 @@@
* by service check.
*/
public void addServiceCheckAction(Stage stage, String hostname, String smokeTestRole,
- long nowTimestamp, String serviceName, String componentName,
- Map<String, String> actionParameters, boolean retryAllowed, boolean autoSkipFailure, boolean useLatestConfigs)
+ long nowTimestamp, String serviceGroupName, String serviceName, String componentName,
- Map<String, String> actionParameters, boolean retryAllowed, boolean autoSkipFailure, String initiatingServiceName)
++ Map<String, String> actionParameters, boolean retryAllowed, boolean autoSkipFailure,
++ String initiatingServiceName, boolean useLatestConfigs)
throws AmbariException {
String clusterName = stage.getClusterName();
diff --cc ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
index 4069e38,bf639bd..33c15aa
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
@@@ -37,8 -36,9 +37,9 @@@ import org.apache.ambari.server.control
import org.apache.ambari.server.controller.metrics.MetricPropertyProviderFactory;
import org.apache.ambari.server.controller.metrics.MetricsCollectorHAManager;
import org.apache.ambari.server.controller.metrics.timeline.cache.TimelineMetricCacheProvider;
+import org.apache.ambari.server.controller.spi.ResourceAlreadyExistsException;
import org.apache.ambari.server.events.AmbariEvent;
-import org.apache.ambari.server.events.MetadataUpdateEvent;
+ import org.apache.ambari.server.events.TopologyUpdateEvent;
import org.apache.ambari.server.events.publishers.AmbariEventPublisher;
import org.apache.ambari.server.metadata.RoleCommandOrder;
import org.apache.ambari.server.orm.entities.ExtensionLinkEntity;
@@@ -943,72 -931,11 +992,74 @@@ public interface AmbariManagementContro
void saveConfigGroupUpdate(ConfigGroupRequest configGroupRequest, ConfigGroupResponse configGroupResponse);
- HostRepositories retrieveHostRepositories(Cluster cluster, Host host) throws AmbariException;
+ /**
+ * Fetch the module info for a given mpack.
+ *
+ * @param mpackId
+ * @return List of modules
+ */
+ List<Module> getModules(Long mpackId);
- MetadataUpdateEvent getClusterMetadataOnConfigsUpdate(Cluster cluster) throws AmbariException;
+ /**
+ * Get the software registries identified by the given request objects.
+ *
+ * @param requests the request objects which identify the software registries to be returned
+ *
+ * @return a set of software registry responses
+ *
+ * @throws AmbariException thrown if the resource cannot be read
+ */
+ Set<RegistryResponse> getRegistries(Set<RegistryRequest> requests)
+ throws AmbariException;
+
+ /**
+ * Get information about specific software registry
+ * @param registryId registry id
+ *
+ * @return {@link Registry}
+ *
+ * @throws AmbariException thrown if the resource cannot be read
+ */
+ Registry getRegistry(Long registryId) throws AmbariException;
+
+ /***
+ * Remove Mpack from the mpackMap and stackMap which is used to power the Mpack and Stack APIs.
+ * @param mpackEntity
+ * @param stackEntity
+ * @throws IOException
+ */
+ void removeMpack(MpackEntity mpackEntity, StackEntity stackEntity) throws IOException;
+
+ /**
+ * Creates serviceconfigversions and corresponding new configurations if it is an initial request
+ * OR
+ * Rollbacks to an existing serviceconfigversion if request specifies.
+ * @param requests
+ *
+ * @return
+ *
+ * @throws AmbariException
+ *
+ * @throws AuthorizationException
+ */
+ Set<ServiceConfigVersionResponse> createServiceConfigVersion(Set<ServiceConfigVersionRequest> requests) throws AmbariException, AuthorizationException;
+
+ /***
+ * Fetch all mpacks
+ * @return
+ */
+ Set<MpackResponse> getMpacks();
+
+ /***
+ * Fetch an mpack based on id
+ * @param mpackId
+ * @return
+ */
+ MpackResponse getMpack(Long mpackId);
+
+ HostRepositories retrieveHostRepositories(Cluster cluster, Host host) throws AmbariException;
+ TopologyUpdateEvent getAddedComponentsTopologyEvent(Set<ServiceComponentHostRequest> requests)
+ throws AmbariException;
}
diff --cc ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
index 31dea50,2f4ae73..6aed720
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
@@@ -28,7 -49,12 +28,6 @@@ import static org.apache.ambari.server.
import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.SCRIPT;
import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.SCRIPT_TYPE;
import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.SERVICE_PACKAGE_FOLDER;
- import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.UNLIMITED_KEY_JCE_REQUIRED;
-import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.SERVICE_REPO_INFO;
-import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.STACK_NAME;
-import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.STACK_VERSION;
-import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.USER_GROUPS;
-import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.USER_LIST;
-import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.VERSION;
import static org.apache.ambari.server.controller.AmbariCustomCommandExecutionHelper.masterToSlaveMappingForDecom;
import java.io.File;
@@@ -106,13 -133,13 +106,14 @@@ import org.apache.ambari.server.control
import org.apache.ambari.server.controller.metrics.MetricsCollectorHAManager;
import org.apache.ambari.server.controller.metrics.timeline.cache.TimelineMetricCacheProvider;
import org.apache.ambari.server.controller.spi.Resource;
+import org.apache.ambari.server.controller.spi.ResourceAlreadyExistsException;
import org.apache.ambari.server.controller.spi.SystemException;
import org.apache.ambari.server.customactions.ActionDefinition;
-import org.apache.ambari.server.events.MetadataUpdateEvent;
import org.apache.ambari.server.events.TopologyUpdateEvent;
+ import org.apache.ambari.server.events.UpdateEventType;
import org.apache.ambari.server.events.publishers.AmbariEventPublisher;
import org.apache.ambari.server.metadata.ActionMetadata;
+import org.apache.ambari.server.metadata.ClusterMetadataGenerator;
import org.apache.ambari.server.metadata.RoleCommandOrder;
import org.apache.ambari.server.metadata.RoleCommandOrderProvider;
import org.apache.ambari.server.orm.dao.ClusterDAO;
@@@ -208,9 -230,8 +209,9 @@@ import org.apache.ambari.server.state.s
import org.apache.ambari.server.state.svccomphost.ServiceComponentHostStartEvent;
import org.apache.ambari.server.state.svccomphost.ServiceComponentHostStopEvent;
import org.apache.ambari.server.state.svccomphost.ServiceComponentHostUpgradeEvent;
+import org.apache.ambari.server.topology.AmbariContext;
+ import org.apache.ambari.server.topology.STOMPComponentsDeleteHandler;
import org.apache.ambari.server.topology.Setting;
- import org.apache.ambari.server.topology.TopologyDeleteFormer;
import org.apache.ambari.server.utils.SecretReference;
import org.apache.ambari.server.utils.StageUtils;
import org.apache.commons.collections.CollectionUtils;
@@@ -396,14 -419,38 +395,12 @@@ public class AmbariManagementController
injector.injectMembers(this);
gson = injector.getInstance(Gson.class);
LOG.info("Initializing the AmbariManagementControllerImpl");
- masterHostname = InetAddress.getLocalHost().getCanonicalHostName();
maintenanceStateHelper = injector.getInstance(MaintenanceStateHelper.class);
kerberosHelper = injector.getInstance(KerberosHelper.class);
- m_metadataHolder = injector.getProvider(MetadataHolder.class);
- m_agentConfigsHolder = injector.getProvider(AgentConfigsHolder.class);
- if(configs != null)
- {
- if (configs.getApiSSLAuthentication()) {
- masterProtocol = "https";
- masterPort = configs.getClientSSLApiPort();
- } else {
- masterProtocol = "http";
- masterPort = configs.getClientApiPort();
- }
- jdkResourceUrl = getAmbariServerURI(JDK_RESOURCE_LOCATION);
- javaHome = configs.getJavaHome();
- jdkName = configs.getJDKName();
- jceName = configs.getJCEName();
- ojdbcUrl = getAmbariServerURI(JDK_RESOURCE_LOCATION + "/" + configs.getOjdbcJarName());
- mysqljdbcUrl = getAmbariServerURI(JDK_RESOURCE_LOCATION + "/" + configs.getMySQLJarName());
-
- serverDB = configs.getServerDBName();
- } else {
- masterProtocol = null;
- masterPort = null;
-
- jdkResourceUrl = null;
- javaHome = null;
- jdkName = null;
- jceName = null;
- ojdbcUrl = null;
- mysqljdbcUrl = null;
- serverDB = null;
- }
+ hostComponentStateDAO = injector.getInstance(HostComponentStateDAO.class);
+ serviceComponentDesiredStateDAO = injector.getInstance(ServiceComponentDesiredStateDAO.class);
+ this.metadataGenerator = metadataGenerator;
+ ambariConfig = metadataGenerator != null ? metadataGenerator.getAmbariConfig() : new AmbariConfig(configs);
helper = new AmbariManagementHelper(stackDAO, extensionDAO, linkDAO);
}
@@@ -794,14 -744,16 +791,17 @@@
schMap.put(cluster, sch);
}
-
+ Set<ServiceComponentHostResponse> createdSvcHostCmpnt = null;
for (Cluster cluster : schMap.keySet()) {
- cluster.addServiceComponentHosts(schMap.get(cluster));
+ createdSvcHostCmpnt = cluster.addServiceComponentHosts(schMap.get(cluster));
}
+ return createdSvcHostCmpnt;
}
- private TopologyUpdateEvent getAddedComponentsTopologyEvent(Set<ServiceComponentHostRequest> requests)
+ /**
+ * {@inheritDoc}
+ */
+ public TopologyUpdateEvent getAddedComponentsTopologyEvent(Set<ServiceComponentHostRequest> requests)
throws AmbariException {
TreeMap<String, TopologyCluster> topologyUpdates = new TreeMap<>();
Set<String> hostsToUpdate = new HashSet<>();
@@@ -2491,22 -2376,17 +2508,22 @@@
Map<String, String> commandParamsInp,
ServiceComponentHostEvent event,
boolean skipFailure,
- RepositoryVersionEntity repoVersion,
boolean isUpgradeSuspended,
DatabaseType databaseType,
- Map<String, DesiredConfig> clusterDesiredConfigs
- )
+ Map<String, DesiredConfig> clusterDesiredConfigs,
+ boolean useLatestConfigs)
throws AmbariException {
+ String serviceGroupName = scHost.getServiceGroupName();
String serviceName = scHost.getServiceName();
+ ServiceGroup serviceGroup = cluster.getServiceGroup(serviceGroupName);
+ Long mpackId = serviceGroup.getMpackId();
+ StackId stackId = serviceGroup.getStackId();
+
stage.addHostRoleExecutionCommand(scHost.getHost(),
- Role.valueOf(scHost.getServiceComponentName()), roleCommand, event, cluster, serviceName, false, skipFailure);
+ Role.valueOf(scHost.getServiceComponentName()), roleCommand, event, cluster, mpackId,
+ serviceGroupName, serviceName, false, skipFailure);
String componentName = scHost.getServiceComponentName();
String hostname = scHost.getHostName();
@@@ -2864,28 -2748,8 +2874,30 @@@
addClientSchForReinstall(cluster, changedServices, changedScHosts);
}
+ for (Map<String, Map<State, List<ServiceComponentHost>>> clientsForSingleStage : StageHelper.deduplicateClients(changedScHosts)) {
- requestStages = doStageCreation(requestStages, cluster, clientsForSingleStage, requestParameters, requestProperties, Collections.emptySet());
++ requestStages = doStageCreation(requestStages, cluster, clientsForSingleStage, requestParameters, requestProperties, Collections.emptySet(), useLatestConfigs, useClusterHostInfo);
+ }
+
- return doStageCreation(requestStages, cluster, changedScHosts, requestParameters, requestProperties, smokeTestServices);
++ return doStageCreation(requestStages, cluster, changedScHosts, requestParameters, requestProperties, smokeTestServices, useLatestConfigs, useClusterHostInfo);
+ }
+
+ private RequestStageContainer doStageCreation(RequestStageContainer requestStages,
+ Cluster cluster,
+ Map<String, ? extends Map<State, ? extends List<ServiceComponentHost>>> changedScHosts,
+ Map<String, String> requestParameters,
+ Map<String, String> requestProperties,
- Set<Service> smokeTestServices
++ Set<Service> smokeTestServices,
++ boolean useLatestConfigs,
++ boolean useClusterHostInfo
+ ) throws AmbariException {
if (!changedScHosts.isEmpty()
|| !smokeTestServices.isEmpty()) {
+ // caching upgrade suspended
+ boolean isUpgradeSuspended = cluster.isUpgradeSuspended();
+
+ // caching database type
+ DatabaseType databaseType = configs.getDatabaseType();
+
long nowTimestamp = System.currentTimeMillis();
// FIXME cannot work with a single stage
@@@ -3228,44 -3093,43 +3240,44 @@@
}
} else {
// !!! can never be null
- RepositoryVersionEntity repoVersion = serviceComponent.getDesiredRepositoryVersion();
-
createHostAction(cluster, stage, scHost, configurations, configurationAttributes, configTags,
- roleCommand, requestParameters, event, skipFailure, repoVersion, isUpgradeSuspended,
+ roleCommand, requestParameters, event, skipFailure, isUpgradeSuspended,
- databaseType, clusterDesiredConfigs);
+ databaseType, clusterDesiredConfigs, useLatestConfigs);
}
}
}
}
- for (String serviceName : smokeTestServices) { // Creates smoke test commands
- Service s = cluster.getService(serviceName);
- // find service component host
- ServiceComponent component = getClientComponentForRunningAction(cluster, s);
- String componentName = component != null ? component.getName() : null;
- String clientHost = getClientHostForRunningAction(cluster, s, component);
- String smokeTestRole = actionMetadata.getServiceCheckAction(serviceName);
-
- if (clientHost == null || smokeTestRole == null) {
- LOG.info("Nothing to do for service check as could not find role or"
- + " or host to run check on"
- + ", clusterName=" + cluster.getClusterName()
- + ", serviceName=" + serviceName
- + ", clientHost=" + clientHost
- + ", serviceCheckRole=" + smokeTestRole);
- continue;
- }
+ for (Service service : smokeTestServices) { // Creates smoke test commands
+ String smokeTestRole = actionMetadata.getServiceCheckAction(service.getServiceType());
+ try {
+ // find service component host
+ ServiceComponentHost componentForServiceCheck = customCommandExecutionHelper.
+ calculateServiceComponentHostForServiceCheck(cluster, service);
- if (StringUtils.isBlank(stage.getHostParamsStage())) {
- RepositoryVersionEntity repositoryVersion = component.getDesiredRepositoryVersion();
- stage.setHostParamsStage(StageUtils.getGson().toJson(
- customCommandExecutionHelper.createDefaultHostParams(cluster, repositoryVersion.getStackId())));
- }
+ if (StringUtils.isBlank(stage.getHostParamsStage())) {
+ long serviceGroupId = componentForServiceCheck.getServiceGroupId();
+ ServiceGroup serviceGroup = cluster.getServiceGroup(serviceGroupId);
+ StackId stackId = serviceGroup.getStackId();
+
+ stage.setHostParamsStage(StageUtils.getGson().toJson(
+ customCommandExecutionHelper.createDefaultHostParams(cluster, stackId)));
+ }
- customCommandExecutionHelper.addServiceCheckAction(stage, clientHost, smokeTestRole,
- nowTimestamp, serviceName, componentName, null, false, false, useLatestConfigs);
+ customCommandExecutionHelper.addServiceCheckAction(stage, componentForServiceCheck.getHostName(), smokeTestRole,
+ nowTimestamp, componentForServiceCheck.getServiceGroupName(), componentForServiceCheck.getServiceName(),
- componentForServiceCheck.getServiceComponentName(), null, false, false, service.getName());
++ componentForServiceCheck.getServiceComponentName(), null, false, false, service.getName(), useLatestConfigs);
+
+ } catch (AmbariException e) {
+ LOG.warn("Nothing to do for service check as could not find role or"
+ + " or host to run check on"
+ + ", clusterName=" + cluster.getClusterName()
+ + ", serviceGroupName=" + service.getServiceGroupName()
+ + ", serviceName=" + service.getName()
+ + ", serviceCheckRole=" + smokeTestRole
+ + "Actual reason : " + e.getMessage());
+ }
}
RoleCommandOrder rco = getRoleCommandOrder(cluster);
@@@ -3366,9 -3233,9 +3381,9 @@@
Map<String, String> hostParamsCmd = customCommandExecutionHelper.createDefaultHostParams(
- cluster, scHost.getServiceComponent().getDesiredStackId());
+ cluster, scHost.getServiceComponent().getStackId());
- Stage stage = createNewStage(0, cluster, 1, "", clusterHostInfoJson, "{}", "");
+ Stage stage = createNewStage(0, cluster, 1, "", "{}", "");
Map<String, Map<String, String>> configTags = configHelper.getEffectiveDesiredTags(cluster, scHost.getHostName());
Map<String, Map<String, String>> configurations = configHelper.getEffectiveConfigProperties(cluster, configTags);
@@@ -3381,8 -3256,8 +3396,8 @@@
DatabaseType databaseType = configs.getDatabaseType();
Map<String, DesiredConfig> clusterDesiredConfigs = cluster.getDesiredConfigs();
createHostAction(cluster, stage, scHost, configurations, configurationAttributes, configTags,
- roleCommand, null, null, false, repoVersion, isUpgradeSuspended, databaseType,
+ roleCommand, null, null, false, isUpgradeSuspended, databaseType,
- clusterDesiredConfigs);
+ clusterDesiredConfigs, false);
ExecutionCommand ec = stage.getExecutionCommands().get(scHost.getHostName()).get(0).getExecutionCommand();
// createHostAction does not take a hostLevelParams but creates one
@@@ -5599,67 -5651,234 +5622,86 @@@
SecurityType clusterSecurityType) throws AmbariException {
TreeMap<String, String> statusCommandParams = new TreeMap<>();
- RepositoryVersionEntity repositoryVersion = getComponentRepositoryVersion(clusterId, serviceName, componentName);
- if (null != repositoryVersion) {
- StackId stackId = repositoryVersion.getStackId();
- ComponentInfo componentInfo = ambariMetaInfo.getComponent(
- stackId.getStackName(), stackId.getStackVersion(),
- serviceName, componentName);
-
- statusCommandParams.put(ExecutionCommand.KeyNames.CLIENTS_TO_UPDATE_CONFIGS,
- getClientsToUpdateConfigs(componentInfo));
-
- // If we are starting a component, calculate whether the unlimited key JCE policy is
- // required for the relevant host. One of the following indicates that the unlimited
- // key JCE policy is required:
- //
- // * The component explicitly requires it whether Kerberos is enabled or not (example, SMARTSENSE/HST_SERVER)
- // * The component explicitly requires it only when Kerberos is enabled AND Kerberos is enabled (example, most components)
- //
- // Set/update the unlimited_key_jce_required value as needed
- statusCommandParams.put(ExecutionCommand.KeyNames.UNLIMITED_KEY_JCE_REQUIRED,
- Boolean.toString(getUnlimitedKeyJCERequirement(componentInfo, clusterSecurityType)));
- }
+ Cluster cluster = clusters.getCluster(clusterId);
+ Service service = cluster.getService(serviceName);
+
+ StackId stackId = service.getStackId();
+ ComponentInfo componentInfo = ambariMetaInfo.getComponent(stackId.getStackName(),
+ stackId.getStackVersion(), serviceName, componentName);
+
+ statusCommandParams.put(ExecutionCommand.KeyNames.CLIENTS_TO_UPDATE_CONFIGS,
+ getClientsToUpdateConfigs(componentInfo));
++
++ // If we are starting a component, calculate whether the unlimited key JCE policy is
++ // required for the relevant host. One of the following indicates that the unlimited
++ // key JCE policy is required:
++ //
++ // * The component explicitly requires it whether Kerberos is enabled or not (example, SMARTSENSE/HST_SERVER)
++ // * The component explicitly requires it only when Kerberos is enabled AND Kerberos is enabled (example, most components)
++ //
++ // Set/update the unlimited_key_jce_required value as needed
+ statusCommandParams.put(ExecutionCommand.KeyNames.UNLIMITED_KEY_JCE_REQUIRED,
+ Boolean.toString(getUnlimitedKeyJCERequirement(componentInfo, clusterSecurityType)));
+
return statusCommandParams;
}
//TODO will be a need to change to multi-instance usage
- public TreeMap<String, String> getTopologyCommandParams(Long clusterId, String serviceName, String componentName) throws AmbariException {
+ public TreeMap<String, String> getTopologyCommandParams(Long clusterId, String serviceName, String componentName, ServiceComponentHost sch) throws AmbariException {
TreeMap<String, String> commandParams = new TreeMap<>();
- RepositoryVersionEntity repositoryVersion = getComponentRepositoryVersion(clusterId, serviceName, componentName);
- if (null != repositoryVersion) {
- StackId stackId = repositoryVersion.getStackId();
- ServiceInfo serviceInfo = ambariMetaInfo.getService(stackId.getStackName(),
- stackId.getStackVersion(), serviceName);
- ComponentInfo componentInfo = ambariMetaInfo.getComponent(
- stackId.getStackName(), stackId.getStackVersion(),
- serviceName, componentName);
-
- commandParams.put(SERVICE_PACKAGE_FOLDER, serviceInfo.getServicePackageFolder());
- String scriptName = null;
- String scriptCommandTimeout = "";
- CommandScriptDefinition script = componentInfo.getCommandScript();
- if (serviceInfo.getSchemaVersion().equals(AmbariMetaInfo.SCHEMA_VERSION_2)) {
- if (script != null) {
- scriptName = script.getScript();
- if (script.getTimeout() > 0) {
- scriptCommandTimeout = String.valueOf(script.getTimeout());
- }
- } else {
- String message = String.format("Component %s of service %s has not " +
- "command script defined", componentName, serviceName);
- throw new AmbariException(message);
- }
- }
- String agentDefaultCommandTimeout = configs.getDefaultAgentTaskTimeout(false);
- String actualTimeout = (!scriptCommandTimeout.equals("") ? scriptCommandTimeout : agentDefaultCommandTimeout);
-
- commandParams.put(COMMAND_TIMEOUT, actualTimeout);
- commandParams.put(SCRIPT, scriptName);
- commandParams.put(SCRIPT_TYPE, script.getScriptType().toString());
- }
- String schVersion = sch.getVersion();
- if (!schVersion.equals("UNKNOWN")) {
- commandParams.put(VERSION, schVersion);
- }
- return commandParams;
- }
+ Cluster cluster = clusters.getCluster(clusterId);
+ Service service = cluster.getService(serviceName);
- private RepositoryVersionEntity getComponentRepositoryVersion(Long clusterId, String serviceName, String componentName) throws AmbariException {
- RepositoryVersionEntity repositoryVersion = null;
- if (!StringUtils.isEmpty(serviceName)) {
- Service service = clusters.getCluster(clusterId).getService(serviceName);
- if (null != service) {
- repositoryVersion = service.getDesiredRepositoryVersion();
+ StackId stackId = service.getStackId();
+ ServiceInfo serviceInfo = ambariMetaInfo.getService(stackId.getStackName(),
+ stackId.getStackVersion(), serviceName);
+ ComponentInfo componentInfo = ambariMetaInfo.getComponent(stackId.getStackName(),
+ stackId.getStackVersion(), serviceName, componentName);
- if (!StringUtils.isEmpty(componentName) && service.getServiceComponents().containsKey(componentName)) {
- ServiceComponent serviceComponent = service.getServiceComponent(componentName);
- if (null != serviceComponent) {
- repositoryVersion = serviceComponent.getDesiredRepositoryVersion();
- }
+ commandParams.put(SERVICE_PACKAGE_FOLDER, serviceInfo.getServicePackageFolder());
+ String scriptName = null;
+ String scriptCommandTimeout = "";
+ CommandScriptDefinition script = componentInfo.getCommandScript();
+ if (serviceInfo.getSchemaVersion().equals(AmbariMetaInfo.SCHEMA_VERSION_2)) {
+ if (script != null) {
+ scriptName = script.getScript();
+ if (script.getTimeout() > 0) {
+ scriptCommandTimeout = String.valueOf(script.getTimeout());
}
+ } else {
+ String message = String.format(
+ "Component %s of service %s has not " + "command script defined", componentName,
+ serviceName);
+ throw new AmbariException(message);
}
}
- return repositoryVersion;
- }
-
- public TreeMap<String, String> getMetadataClusterLevelParams(Cluster cluster, StackId stackId) throws AmbariException {
- TreeMap<String, String> clusterLevelParams = new TreeMap<>();
- clusterLevelParams.put(STACK_NAME, stackId.getStackName());
- clusterLevelParams.put(STACK_VERSION, stackId.getStackVersion());
-
- clusterLevelParams.putAll(getMetadataClusterLevelConfigsParams(cluster, stackId));
- clusterLevelParams.put(CLUSTER_NAME, cluster.getClusterName());
- clusterLevelParams.put(HOOKS_FOLDER, configs.getProperty(Configuration.HOOKS_FOLDER));
-
- return clusterLevelParams;
- }
-
- private TreeMap<String, String> getMetadataClusterLevelConfigsParams(Cluster cluster, StackId stackId) throws AmbariException {
- TreeMap<String, String> clusterLevelParams = new TreeMap<>();
-
- Map<String, DesiredConfig> desiredConfigs = cluster.getDesiredConfigs(false);
- if (MapUtils.isNotEmpty(desiredConfigs)) {
-
- Set<String> userSet = configHelper.getPropertyValuesWithPropertyType(stackId, PropertyType.USER, cluster, desiredConfigs);
- String userList = gson.toJson(userSet);
- clusterLevelParams.put(USER_LIST, userList);
-
- //Create a user_group mapping and send it as part of the hostLevelParams
- Map<String, Set<String>> userGroupsMap = configHelper.createUserGroupsMap(
- stackId, cluster, desiredConfigs);
- String userGroups = gson.toJson(userGroupsMap);
- clusterLevelParams.put(USER_GROUPS, userGroups);
-
- Set<String> groupSet = configHelper.getPropertyValuesWithPropertyType(stackId, PropertyType.GROUP, cluster, desiredConfigs);
- String groupList = gson.toJson(groupSet);
- clusterLevelParams.put(GROUP_LIST, groupList);
- }
- Set<String> notManagedHdfsPathSet = configHelper.getPropertyValuesWithPropertyType(stackId,
- PropertyType.NOT_MANAGED_HDFS_PATH, cluster, desiredConfigs);
- String notManagedHdfsPathList = gson.toJson(notManagedHdfsPathSet);
- clusterLevelParams.put(NOT_MANAGED_HDFS_PATH_LIST, notManagedHdfsPathList);
-
- Map<String, ServiceInfo> serviceInfos = ambariMetaInfo.getServices(stackId.getStackName(), stackId.getStackVersion());
- for (ServiceInfo serviceInfoInstance : serviceInfos.values()) {
- if (serviceInfoInstance.getServiceType() != null) {
- LOG.debug("Adding {} to command parameters for {}", serviceInfoInstance.getServiceType(),
- serviceInfoInstance.getName());
-
- clusterLevelParams.put(DFS_TYPE, serviceInfoInstance.getServiceType());
- break;
- }
- }
-
- return clusterLevelParams;
- }
-
- public TreeMap<String, MetadataServiceInfo> getMetadataServiceLevelParams(Cluster cluster) throws AmbariException {
- TreeMap<String, MetadataServiceInfo> serviceLevelParams = new TreeMap<>();
- for (Map.Entry<String, Service> serviceEntry : cluster.getServices().entrySet()) {
- Service service = serviceEntry.getValue();
- serviceLevelParams.putAll(getMetadataServiceLevelParams(service));
- }
- return serviceLevelParams;
- }
-
- public TreeMap<String, MetadataServiceInfo> getMetadataServiceLevelParams(Service service) throws AmbariException {
- TreeMap<String, MetadataServiceInfo> serviceLevelParams = new TreeMap<>();
-
- RepositoryVersionEntity repositoryVersion = service.getDesiredRepositoryVersion();
-
- if (null != repositoryVersion) {
- StackId serviceStackId = repositoryVersion.getStackId();
-
- ServiceInfo serviceInfo = ambariMetaInfo.getService(serviceStackId.getStackName(),
- serviceStackId.getStackVersion(), service.getName());
- Long statusCommandTimeout = null;
- if (serviceInfo.getCommandScript() != null) {
- statusCommandTimeout = new Long(customCommandExecutionHelper.getStatusCommandTimeout(serviceInfo));
- }
-
- String servicePackageFolder = serviceInfo.getServicePackageFolder();
-
- // Get the map of service config type to password properties for the service
- Map<String, Map<String, String>> configCredentials;
- configCredentials = configCredentialsForService.get(service.getName());
- if (configCredentials == null) {
- configCredentials = configHelper.getCredentialStoreEnabledProperties(serviceStackId, service);
- configCredentialsForService.put(service.getName(), configCredentials);
- }
-
- serviceLevelParams.put(serviceInfo.getName(),
- new MetadataServiceInfo(serviceInfo.getVersion(),
- service.isCredentialStoreEnabled(),
- configCredentials,
- statusCommandTimeout,
- servicePackageFolder));
- }
- return serviceLevelParams;
- }
-
- public TreeMap<String, String> getMetadataAmbariLevelParams() {
- TreeMap<String, String> clusterLevelParams = new TreeMap<>();
- clusterLevelParams.put(JDK_LOCATION, getJdkResourceUrl());
- clusterLevelParams.put(JAVA_HOME, getJavaHome());
- clusterLevelParams.put(JAVA_VERSION, String.valueOf(configs.getJavaVersion()));
- clusterLevelParams.put(JDK_NAME, getJDKName());
- clusterLevelParams.put(JCE_NAME, getJCEName());
- clusterLevelParams.put(DB_NAME, getServerDB());
- clusterLevelParams.put(MYSQL_JDBC_URL, getMysqljdbcUrl());
- clusterLevelParams.put(ORACLE_JDBC_URL, getOjdbcUrl());
- clusterLevelParams.put(DB_DRIVER_FILENAME, configs.getMySQLJarName());
- clusterLevelParams.putAll(getRcaParameters());
- clusterLevelParams.put(HOST_SYS_PREPPED, configs.areHostsSysPrepped());
- clusterLevelParams.put(AGENT_STACK_RETRY_ON_UNAVAILABILITY, configs.isAgentStackRetryOnInstallEnabled());
- clusterLevelParams.put(AGENT_STACK_RETRY_COUNT, configs.getAgentStackRetryOnInstallCount());
+ String agentDefaultCommandTimeout = configs.getDefaultAgentTaskTimeout(false);
+ String actualTimeout = (!scriptCommandTimeout.equals("") ? scriptCommandTimeout
+ : agentDefaultCommandTimeout);
- boolean serverUseSsl = configs.getApiSSLAuthentication();
- int port = serverUseSsl ? configs.getClientSSLApiPort() : configs.getClientApiPort();
- clusterLevelParams.put(AMBARI_SERVER_HOST, StageUtils.getHostName());
- clusterLevelParams.put(AMBARI_SERVER_PORT, Integer.toString(port));
- clusterLevelParams.put(AMBARI_SERVER_USE_SSL, Boolean.toString(serverUseSsl));
-
- for (Map.Entry<String, String> dbConnectorName : configs.getDatabaseConnectorNames().entrySet()) {
- clusterLevelParams.put(dbConnectorName.getKey(), dbConnectorName.getValue());
- }
- for (Map.Entry<String, String> previousDBConnectorName : configs.getPreviousDatabaseConnectorNames().entrySet()) {
- clusterLevelParams.put(previousDBConnectorName.getKey(), previousDBConnectorName.getValue());
- }
- clusterLevelParams.put(GPL_LICENSE_ACCEPTED, configs.getGplLicenseAccepted().toString());
+ commandParams.put(COMMAND_TIMEOUT, actualTimeout);
+ commandParams.put(SCRIPT, scriptName);
+ commandParams.put(SCRIPT_TYPE, script.getScriptType().toString());
- return clusterLevelParams;
+ return commandParams;
}
+ public SortedMap<String, SortedMap<String,String>> getMetadataAgentConfigs() {
+ SortedMap<String, SortedMap<String,String>> agentConfigs = new TreeMap<>();
+ Map<String, Map<String,String>> agentConfigsMap = configs.getAgentConfigsMap();
+
+ for (String key : agentConfigsMap.keySet()) {
+ agentConfigs.put(key, new TreeMap<>(agentConfigsMap.get(key)));
+ }
+
+ return agentConfigs;
+ }
+
@Override
- //TODO : Revisit, trunk merge 03/20
public HostRepositories retrieveHostRepositories(Cluster cluster, Host host) throws AmbariException {
List<ServiceComponentHost> hostComponents = cluster.getServiceComponentHosts(host.getHostName());
- Map<String, CommandRepository> hostRepositories = new HashMap<>();
- Map<String, String> componentsRepos = new HashMap<>();
+ SortedMap<Long, CommandRepository> hostRepositories = new TreeMap<>();
+ SortedMap<String, Long> componentsRepos = new TreeMap<>();
for (ServiceComponentHost serviceComponentHost : hostComponents) {
CommandRepository commandRepository;
@@@ -5669,9 -5888,8 +5711,9 @@@
} catch (SystemException e) {
throw new RuntimeException(e);
}
+ ArrayList<CommandRepository.Repository> repositories = (ArrayList<CommandRepository.Repository>) commandRepository.getRepositories();
- hostRepositories.put(repositories.get(0).getRepoName(), commandRepository);
- componentsRepos.put(serviceComponentHost.getServiceComponentName(), repositories.get(0).getRepoName());
+ hostRepositories.put(commandRepository.getRepoVersionId(), commandRepository);
+ componentsRepos.put(serviceComponentHost.getServiceComponentName(), commandRepository.getRepoVersionId());
}
return new HostRepositories(hostRepositories, componentsRepos);
}
diff --cc ambari-server/src/main/java/org/apache/ambari/server/controller/ConfigGroupRequest.java
index fb8d2c9,1faaeed..e33aa4e
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/ConfigGroupRequest.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/ConfigGroupRequest.java
@@@ -119,12 -129,4 +131,13 @@@ public class ConfigGroupRequest
public void setServiceConfigVersionNote(String serviceConfigVersionNote) {
this.serviceConfigVersionNote = serviceConfigVersionNote;
}
+
++ @ApiModelProperty(name = ConfigGroupResourceProvider.SERVICE_GROUP_NAME_PROPERTY_ID)
+ public String getServiceGroupName() {
+ return serviceGroupName;
+ }
+
+ public void setServiceGroupName(String serviceGroupName) {
+ this.serviceGroupName = serviceGroupName;
+ }
}
diff --cc ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceComponentHostResponse.java
index 3eb1607,fe8734c..b381c78
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceComponentHostResponse.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceComponentHostResponse.java
@@@ -26,18 -27,11 +27,18 @@@ import org.apache.ambari.server.state.U
import io.swagger.annotations.ApiModelProperty;
- public class ServiceComponentHostResponse {
+ public class ServiceComponentHostResponse implements ApiModel {
+ private Long clusterId; // REF
private String clusterName; // REF
+ private Long serviceGroupId;
+ private String serviceGroupName;
+ private Long serviceId;
private String serviceName;
+ private String serviceType;
+ private Long hostComponentId;
private String componentName;
+ private String componentType;
private String displayName;
private String publicHostname;
private String hostname;
@@@ -81,48 -69,9 +82,49 @@@
}
/**
+ * @return the serviceGroupId
+ */
+ public Long getServiceGroupId() { return serviceGroupId; }
+
+ /**
+ * @param serviceGroupId the serviceGroupId to set
+ */
+ public void setServiceGroupId(Long serviceGroupId) { this.serviceGroupId = serviceGroupId; }
+
+ /**
+ * @return the serviceGroupName
+ */
+ public String getServiceGroupName() { return serviceGroupName; }
+
+ /**
+ * @param serviceGroupName the serviceGroupName to set
+ */
+ public void setServiceGroupName(String serviceGroupName) { this.serviceGroupName = serviceGroupName; }
+
+ /**
+ * @return the serviceId
+ */
+ public Long getServiceId() { return serviceId; }
+
+ /**
+ * @param serviceId the serviceId to set
+ */
+ public void setServiceId(Long serviceId) { this.serviceId = serviceId; }
+
+ /**
+ * @return the hostComponentId
+ */
+ public Long getHostComponentId() { return hostComponentId; }
+
+ /**
+ * @param hostComponentId the hostComponentId to set
+ */
+ public void sethostComponentId(Long hostComponentId) { this.hostComponentId = hostComponentId; }
+
+ /**
* @return the serviceName
*/
+ @ApiModelProperty(name = HostComponentResourceProvider.SERVICE_NAME_PROPERTY_ID)
public String getServiceName() {
return serviceName;
}
@@@ -135,18 -84,9 +137,19 @@@
}
/**
+ * @return the serviceName
+ */
+ public String getServiceType() { return serviceType; }
+
+ /**
+ * @param serviceType the serviceType to set
+ */
+ public void setServiceType(String serviceType) { this.serviceType = serviceType; }
+
+ /**
* @return the componentName
*/
+ @ApiModelProperty(name = HostComponentResourceProvider.COMPONENT_NAME_PROPERTY_ID)
public String getComponentName() {
return componentName;
}
@@@ -166,15 -99,9 +169,16 @@@
}
/**
+ * @param componentType the componentType to set
+ */
+ public void setComponentType(String componentType) {
+ this.componentType = componentType;
+ }
+
+ /**
* @return the displayName
*/
+ @ApiModelProperty(name = HostComponentResourceProvider.DISPLAY_NAME_PROPERTY_ID)
public String getDisplayName() {
return displayName;
}
diff --cc ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceConfigVersionRequest.java
index 518503f,9fed772..d9d93ee
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceConfigVersionRequest.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceConfigVersionRequest.java
@@@ -18,9 -18,10 +18,12 @@@
package org.apache.ambari.server.controller;
-
+import java.util.List;
+
+ import org.apache.ambari.server.controller.internal.ServiceConfigVersionResourceProvider;
+
+ import io.swagger.annotations.ApiModelProperty;
+
public class ServiceConfigVersionRequest {
private String clusterName;
private String serviceName;
@@@ -46,10 -43,9 +49,11 @@@
this.applyTime = applyTime;
this.userName = userName;
this.isCurrent = isCurrent;
+ this.note = note;
+ this.stackId = stackId;
}
+ @ApiModelProperty(name = ServiceConfigVersionResourceProvider.SERVICE_NAME_PROPERTY_ID)
public String getServiceName() {
return serviceName;
}
diff --cc ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariServerSSOConfigurationHandler.java
index 0000000,dece520..db54373
mode 000000,100644..100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariServerSSOConfigurationHandler.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariServerSSOConfigurationHandler.java
@@@ -1,0 -1,249 +1,249 @@@
+ /*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ package org.apache.ambari.server.controller.internal;
+
+ import static org.apache.ambari.server.api.services.stackadvisor.StackAdvisorRequest.StackAdvisorRequestType.SSO_CONFIGURATIONS;
+ import static org.apache.ambari.server.configuration.AmbariServerConfigurationCategory.SSO_CONFIGURATION;
+ import static org.apache.ambari.server.configuration.AmbariServerConfigurationKey.SSO_ENABLED_SERVICES;
+ import static org.apache.ambari.server.configuration.AmbariServerConfigurationKey.SSO_MANAGE_SERVICES;
+
+ import java.util.Arrays;
+ import java.util.Collection;
+ import java.util.Collections;
+ import java.util.HashMap;
+ import java.util.HashSet;
+ import java.util.List;
+ import java.util.Map;
+ import java.util.Set;
+ import java.util.stream.Collectors;
+
+ import org.apache.ambari.server.AmbariException;
+ import org.apache.ambari.server.api.services.stackadvisor.StackAdvisorException;
+ import org.apache.ambari.server.api.services.stackadvisor.StackAdvisorHelper;
+ import org.apache.ambari.server.api.services.stackadvisor.StackAdvisorRequest;
+ import org.apache.ambari.server.api.services.stackadvisor.recommendations.RecommendationResponse;
+ import org.apache.ambari.server.configuration.Configuration;
+ import org.apache.ambari.server.controller.AmbariManagementController;
+ import org.apache.ambari.server.events.publishers.AmbariEventPublisher;
+ import org.apache.ambari.server.orm.dao.AmbariConfigurationDAO;
+ import org.apache.ambari.server.state.Cluster;
+ import org.apache.ambari.server.state.Clusters;
+ import org.apache.ambari.server.state.ConfigHelper;
+ import org.apache.ambari.server.state.Host;
+ import org.apache.ambari.server.state.Service;
+ import org.apache.ambari.server.state.StackId;
+ import org.apache.ambari.server.state.ValueAttributesInfo;
+ import org.apache.commons.lang.StringUtils;
+ import org.slf4j.Logger;
+ import org.slf4j.LoggerFactory;
+
+ import com.google.inject.Inject;
+ import com.google.inject.Singleton;
+
+ /**
+ * AmbariServerSSOConfigurationHandler is an {@link AmbariServerConfigurationHandler} implementation
+ * handing changes to the SSO configuration
+ */
+ @Singleton
+ public class AmbariServerSSOConfigurationHandler extends AmbariServerConfigurationHandler {
+ private static final Logger LOGGER = LoggerFactory.getLogger(AmbariServerSSOConfigurationHandler.class);
+
+ private final Clusters clusters;
+
+ private final ConfigHelper configHelper;
+
+ private final AmbariManagementController managementController;
+
+ private final StackAdvisorHelper stackAdvisorHelper;
+
+ @Inject
+ public AmbariServerSSOConfigurationHandler(Clusters clusters, ConfigHelper configHelper,
+ AmbariManagementController managementController,
+ StackAdvisorHelper stackAdvisorHelper,
+ AmbariConfigurationDAO ambariConfigurationDAO,
+ AmbariEventPublisher publisher,
+ Configuration ambariConfiguration) {
+ super(ambariConfigurationDAO, publisher, ambariConfiguration);
+ this.clusters = clusters;
+ this.configHelper = configHelper;
+ this.managementController = managementController;
+ this.stackAdvisorHelper = stackAdvisorHelper;
+ }
+
+ @Override
+ public void updateComponentCategory(String categoryName, Map<String, String> properties, boolean removePropertiesIfNotSpecified) throws AmbariException {
+ // Use the default implementation of #updateComponentCategory; however if Ambari is managing the SSO implementations
+ // always process them, even the of sso-configuration properties have not been changed since we do not
+ // know of the Ambari SSO data has changed in the ambari.properties file. For example the authentication.jwt.providerUrl
+ // or authentication.jwt.publicKey values.
+ super.updateComponentCategory(categoryName, properties, removePropertiesIfNotSpecified);
+
+ // Determine if Ambari is managing SSO configurations...
+ boolean manageSSOConfigurations;
+
+ Map<String, String> ssoProperties = getConfigurationProperties(SSO_CONFIGURATION.getCategoryName());
+ manageSSOConfigurations = (ssoProperties != null) && "true".equalsIgnoreCase(ssoProperties.get(SSO_MANAGE_SERVICES.key()));
+
+ if (manageSSOConfigurations) {
+ Map<String, Cluster> clusterMap = clusters.getClusters();
+
+ if (clusterMap != null) {
+ for (Cluster cluster : clusterMap.values()) {
+ try {
+ LOGGER.info(String.format("Managing the SSO configuration for the cluster named '%s'", cluster.getClusterName()));
+ processCluster(cluster);
+ } catch (AmbariException | StackAdvisorException e) {
+ LOGGER.warn(String.format("Failed to update the the SSO configuration for the cluster named '%s': ", cluster.getClusterName()), e);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Gets the set of services for which the user declared Ambari to enable SSO integration.
+ * <p>
+ * If Ambari is not managing SSO integration configuration for services the set of names will be empry.
+ *
+ * @return a set of service names
+ */
+ public Set<String> getSSOEnabledServices() {
+ Map<String, String> ssoProperties = getConfigurationProperties(SSO_CONFIGURATION.getCategoryName());
+ boolean manageSSOConfigurations = (ssoProperties != null) && "true".equalsIgnoreCase(ssoProperties.get(SSO_MANAGE_SERVICES.key()));
+ String ssoEnabledServices = (manageSSOConfigurations) ? ssoProperties.get(SSO_ENABLED_SERVICES.key()) : null;
+
+ if (StringUtils.isEmpty(ssoEnabledServices)) {
+ return Collections.emptySet();
+ } else {
+ return Arrays.stream(ssoEnabledServices.split(","))
+ .map(String::trim)
+ .map(String::toUpperCase)
+ .collect(Collectors.toSet());
+ }
+ }
+
+ /**
+ * Build the stack advisor request, call the stack advisor, then automatically handle the recommendations.
+ * <p>
+ * Any recommendation coming back from the Stack/service advisor is expected to be only SSO-related
+ * configurations.
+ * <p>
+ * If there are no changes to the current configurations, no new configuration versions will be created.
+ *
+ * @param cluster the cluster to process
+ * @throws AmbariException
+ * @throws StackAdvisorException
+ */
+ private void processCluster(Cluster cluster) throws AmbariException, StackAdvisorException {
+ StackId stackVersion = cluster.getCurrentStackVersion();
+ List<String> hosts = cluster.getHosts().stream().map(Host::getHostName).collect(Collectors.toList());
- Set<String> serviceNames = cluster.getServices().values().stream().map(Service::getName).collect(Collectors.toSet());
++ Set<String> serviceNames = cluster.getServices().stream().map(Service::getName).collect(Collectors.toSet());
+
+ // Build the StackAdvisor request for SSO-related configurations. it is expected that the stack
+ // advisor will abide by the configurations set in the Ambari sso-configurations to enable and
+ // disable SSO integration for the relevant services.
+ StackAdvisorRequest request = StackAdvisorRequest.StackAdvisorRequestBuilder.
+ forStack(stackVersion.getStackName(), stackVersion.getStackVersion())
+ .ofType(SSO_CONFIGURATIONS)
+ .forHosts(hosts)
+ .forServices(serviceNames)
+ .withComponentHostsMap(cluster.getServiceComponentHostMap(null, null))
+ .withConfigurations(calculateExistingConfigurations(cluster))
+ .build();
+
+ // Execute the stack advisor
+ RecommendationResponse response = stackAdvisorHelper.recommend(request);
+
+ // Process the recommendations and automatically apply them. Ideally this is what the user wanted
+ RecommendationResponse.Recommendation recommendation = (response == null) ? null : response.getRecommendations();
+ RecommendationResponse.Blueprint blueprint = (recommendation == null) ? null : recommendation.getBlueprint();
+ Map<String, RecommendationResponse.BlueprintConfigurations> configurations = (blueprint == null) ? null : blueprint.getConfigurations();
+
+ if (configurations != null) {
+ for (Map.Entry<String, RecommendationResponse.BlueprintConfigurations> configuration : configurations.entrySet()) {
+ processConfigurationType(cluster, configuration.getKey(), configuration.getValue());
+ }
+ }
+ }
+
+ /**
+ * Process the configuration to add, update, and remove properties as needed.
+ *
+ * @param cluster the cluster
+ * @param configType the configuration type
+ * @param configurations the recommended configuration values
+ * @throws AmbariException
+ */
+ private void processConfigurationType(Cluster cluster, String configType,
+ RecommendationResponse.BlueprintConfigurations configurations)
+ throws AmbariException {
+
+ Map<String, String> updates = new HashMap<>();
+ Collection<String> removals = new HashSet<>();
+
+ // Gather the updates
+ Map<String, String> recommendedConfigProperties = configurations.getProperties();
+ if (recommendedConfigProperties != null) {
+ updates.putAll(recommendedConfigProperties);
+ }
+
+ // Determine if any properties need to be removed
+ Map<String, ValueAttributesInfo> recommendedConfigPropertyAttributes = configurations.getPropertyAttributes();
+ if (recommendedConfigPropertyAttributes != null) {
+ for (Map.Entry<String, ValueAttributesInfo> entry : recommendedConfigPropertyAttributes.entrySet()) {
+ ValueAttributesInfo info = entry.getValue();
+
+ if ((info != null) && "true".equalsIgnoreCase(info.getDelete())) {
+ updates.remove(entry.getKey());
+ removals.add(entry.getKey());
+ }
+ }
+ }
+
+ configHelper.updateConfigType(cluster, cluster.getCurrentStackVersion(), managementController,
+ configType, updates, removals,
+ "internal", "Ambari-managed single sign-on configurations");
+ }
+
+ /**
+ * Calculate the current configurations for all services
+ *
+ * @param cluster the cluster
+ * @return a map of services and their configurations
+ * @throws AmbariException
+ */
+ private Map<String, Map<String, Map<String, String>>> calculateExistingConfigurations(Cluster cluster) throws AmbariException {
+ Map<String, Map<String, String>> configurationTags = configHelper.getEffectiveDesiredTags(cluster, null);
+ Map<String, Map<String, String>> effectiveConfigs = configHelper.getEffectiveConfigProperties(cluster, configurationTags);
+
+ Map<String, Map<String, Map<String, String>>> requestConfigurations = new HashMap<>();
+ if (effectiveConfigs != null) {
+ for (Map.Entry<String, Map<String, String>> configuration : effectiveConfigs.entrySet()) {
+ Map<String, Map<String, String>> properties = new HashMap<>();
+ String configType = configuration.getKey();
+ Map<String, String> configurationProperties = configuration.getValue();
+
+ if (configurationProperties == null) {
+ configurationProperties = Collections.emptyMap();
+ }
+
+ properties.put("properties", configurationProperties);
+ requestConfigurations.put(configType, properties);
+ }
+ }
+
+ return requestConfigurations;
+ }
+ }
diff --cc ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
index 5c45712,7ae1e43..ba7a043
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
@@@ -64,7 -72,6 +70,8 @@@ import com.google.common.collect.Sets
* Updates configuration properties based on cluster topology. This is done when exporting
* a blueprint and when a cluster is provisioned via a blueprint.
*/
+// TODO move to topology package
++//TODO: [AMP] Fix merge
public class BlueprintConfigurationProcessor {
private static final Logger LOG = LoggerFactory.getLogger(BlueprintConfigurationProcessor.class);
@@@ -358,11 -439,196 +449,195 @@@
// set of properties (copy) doesn't include the removed properties. If an updater
// removes a property other than the property it is registered for then we will
// have an issue as it won't be removed from the clusterProps map as it is a copy.
- Map<String, Map<String, String>> configProperties = clusterConfig.getFullProperties();
- Map<String, Map<String, String>> clusterProps = configProperties;
- for (Map<String, Map<String, PropertyUpdater>> updaterMap : createCollectionOfUpdaters()) {
+ Map<String, Map<String, String>> clusterProps = clusterConfig.getFullProperties();
+ doGeneralPropertyUpdatesForClusterCreate(clusterConfig, clusterProps, configTypesUpdated);
+
+ //todo: lots of hard coded HA rules included here
- if (clusterTopology.isNameNodeHAEnabled()) {
++ if (isNameNodeHAEnabled(clusterProps)) {
+ doNameNodeHAUpdateOnClusterCreation(clusterConfig, clusterProps, configTypesUpdated);
+ }
+
+ // Explicitly set any properties that are required but not currently provided in the stack definition.
+ setStackToolsAndFeatures(clusterConfig, configTypesUpdated);
- setRetryConfiguration(clusterConfig, configTypesUpdated);
+ setupHDFSProxyUsers(clusterConfig, configTypesUpdated);
- addExcludedConfigProperties(clusterConfig, configTypesUpdated, clusterTopology.getBlueprint().getStack());
++ addExcludedConfigProperties(clusterConfig, configTypesUpdated, clusterTopology.getStack());
+
+ trimProperties(clusterConfig, clusterTopology);
+
+ return configTypesUpdated;
+ }
+
+ /**
+ * Update Namenode HA properties during cluster creation
+ * @throws ConfigurationTopologyException
+ */
+ private void doNameNodeHAUpdateOnClusterCreation(Configuration clusterConfig,
+ Map<String, Map<String, String>> clusterProps,
+ Set<String> configTypesUpdated) throws ConfigurationTopologyException {
+ // add "dfs.internal.nameservices" if it's not specified
+ Map<String, String> hdfsSiteConfig = clusterConfig.getFullProperties().get("hdfs-site");
+ String nameservices = hdfsSiteConfig.get("dfs.nameservices");
+ String int_nameservices = hdfsSiteConfig.get("dfs.internal.nameservices");
+ if(int_nameservices == null && nameservices != null) {
+ clusterConfig.setProperty("hdfs-site", "dfs.internal.nameservices", nameservices);
+ }
+
+ // parse out the nameservices value
+ String[] parsedNameServices = parseNameServices(hdfsSiteConfig);
+
+ // if a single nameservice is configured (default HDFS HA deployment)
+ if (parsedNameServices.length == 1) {
+ LOG.info("Processing a single HDFS NameService, which indicates a default HDFS NameNode HA deployment");
+ // if the active/standby namenodes are not specified, assign them automatically
+ if (! isNameNodeHAInitialActiveNodeSet(clusterProps) && ! isNameNodeHAInitialStandbyNodeSet(clusterProps)) {
+ Collection<String> nnHosts = clusterTopology.getHostAssignmentsForComponent("NAMENODE");
+ if (nnHosts.size() < 2) {
+ throw new ConfigurationTopologyException("NAMENODE HA requires at least 2 hosts running NAMENODE but there are: " +
+ nnHosts.size() + " Hosts: " + nnHosts);
+ }
+
+ // set the properties that configure which namenode is active,
+ // and which is a standby node in this HA deployment
+ Iterator<String> nnHostIterator = nnHosts.iterator();
+ clusterConfig.setProperty(HDFS_HA_INITIAL_CONFIG_TYPE, HDFS_ACTIVE_NAMENODE_PROPERTY_NAME, nnHostIterator.next());
+ clusterConfig.setProperty(HDFS_HA_INITIAL_CONFIG_TYPE, HDFS_STANDBY_NAMENODE_PROPERTY_NAME, nnHostIterator.next());
+
+ configTypesUpdated.add(HDFS_HA_INITIAL_CONFIG_TYPE);
+ }
+ } else {
+ if (!isPropertySet(clusterProps, HDFS_HA_INITIAL_CONFIG_TYPE, HDFS_ACTIVE_NAMENODE_SET_PROPERTY_NAME) && !isPropertySet(clusterProps, HDFS_HA_INITIAL_CONFIG_TYPE, HDFS_STANDBY_NAMENODE_SET_PROPERTY_NAME)) { // multiple nameservices indicates an HDFS NameNode Federation install
+ // process each nameservice to determine the active/standby nodes
+ LOG.info("Processing multiple HDFS NameService instances, which indicates a NameNode Federation deployment");
+ if (parsedNameServices.length > 1) {
+ Set<String> activeNameNodeHostnames = new HashSet<>();
+ Set<String> standbyNameNodeHostnames = new HashSet<>();
+
+ for (String nameService : parsedNameServices) {
+ List<String> hostNames = new ArrayList<>();
+ String[] nameNodes = parseNameNodes(nameService, hdfsSiteConfig);
+ for (String nameNode : nameNodes) {
+ // use the HA rpc-address property to obtain the NameNode hostnames
+ String propertyName = "dfs.namenode.rpc-address." + nameService + "." + nameNode;
+ String propertyValue = hdfsSiteConfig.get(propertyName);
+ if (propertyValue == null) {
+ throw new ConfigurationTopologyException("NameNode HA property = " + propertyName + " is not found in the cluster config. This indicates an error in configuration for HA/Federated clusters. " +
+ "Please recheck the HDFS configuration and try this deployment again");
+ }
+
+ String hostName = propertyValue.split(":")[0];
+ hostNames.add(hostName);
+ }
+
+ if (hostNames.size() < 2) {
+ throw new ConfigurationTopologyException("NAMENODE HA for nameservice = " + nameService + " requires at least 2 hosts running NAMENODE but there are: " +
+ hostNames.size() + " Hosts: " + hostNames);
+ } else {
+ // by default, select the active and standby namenodes for this nameservice
+ // using the first two hostnames found
+ // since HA is assumed, there should only be two NameNodes deployed per NameService
+ activeNameNodeHostnames.add(hostNames.get(0));
+ standbyNameNodeHostnames.add(hostNames.get(1));
+ }
+ }
+
+ // set the properties what configure the NameNode Active/Standby status for each nameservice
+ if (!activeNameNodeHostnames.isEmpty() && !standbyNameNodeHostnames.isEmpty()) {
+ clusterConfig.setProperty(HDFS_HA_INITIAL_CONFIG_TYPE, HDFS_ACTIVE_NAMENODE_SET_PROPERTY_NAME, String.join(",", activeNameNodeHostnames));
+ clusterConfig.setProperty(HDFS_HA_INITIAL_CONFIG_TYPE, HDFS_STANDBY_NAMENODE_SET_PROPERTY_NAME, String.join(",", standbyNameNodeHostnames));
+
+ // also set the clusterID property, required for Federation installs of HDFS
+ if (!isPropertySet(clusterProps, HDFS_HA_INITIAL_CONFIG_TYPE, HDFS_HA_INITIAL_CLUSTER_ID_PROPERTY_NAME)) {
+ clusterConfig.setProperty(HDFS_HA_INITIAL_CONFIG_TYPE, HDFS_HA_INITIAL_CLUSTER_ID_PROPERTY_NAME, getClusterName());
+ }
+
+ configTypesUpdated.add(HDFS_HA_INITIAL_CONFIG_TYPE);
+ } else {
+ LOG.warn("Error in processing the set of active/standby namenodes in this federated cluster, please check hdfs-site configuration");
+ }
+ // Need to configure ranger-tagsync-site properties, when Ranger-HDFS plugin is enabled
+ doTagSyncSiteUpdateForNamenodeNFederationEnabledOnClusterCreation(clusterConfig, clusterProps, configTypesUpdated);
+ }
+ }
+ }
+ }
+
+ /**
+ * Update ranger-tagsync-site properties when NN Federation is enabled and Ranger-HDFS plugin is enabled
+ * @throws ConfigurationTopologyException
+ */
+ private void doTagSyncSiteUpdateForNamenodeNFederationEnabledOnClusterCreation(Configuration clusterConfig,
+ Map<String, Map<String, String>> clusterProps,
+ Set<String> configTypesUpdated) throws ConfigurationTopologyException {
+ Map<String, String> hdfsSiteConfig = clusterConfig.getFullProperties().get("hdfs-site");
+ // parse out the nameservices value
+ String[] parsedNameServices = parseNameServices(hdfsSiteConfig);
+ String clusterName = getClusterName();
+
+ // Getting configuration and properties for adding configurations to ranger-tagsync-site
+ boolean isRangerHDFSPluginEnabled = false;
+ String rangerHDFSPluginServiceName = "";
+
+ String atlasServerComponentName = "ATLAS_SERVER";
+ String rangerAdminComponentName = "RANGER_ADMIN";
+ String rangerTagsyncComponentName = "RANGER_TAGSYNC";
+ boolean isRangerAdminToBeInstalled = (clusterTopology.getHostGroupsForComponent(rangerAdminComponentName).size() >= 1);
+ boolean isRangerTagsyncToBeInstalled = (clusterTopology.getHostGroupsForComponent(rangerTagsyncComponentName).size() >= 1);
+ boolean isAtlasServerToBeInstalled = (clusterTopology.getHostGroupsForComponent(atlasServerComponentName).size() >= 1);
+ if (isRangerAdminToBeInstalled) {
+ Map<String, String> rangerHDFSPluginProperties = clusterProps.get("ranger-hdfs-plugin-properties");
+ String rangerHDFSPluginEnabledValue = rangerHDFSPluginProperties.getOrDefault("ranger-hdfs-plugin-enabled","No");
+ isRangerHDFSPluginEnabled = ("yes".equalsIgnoreCase(rangerHDFSPluginEnabledValue));
+ Map<String, String> rangerHDFSSecurityConfig = clusterProps.get("ranger-hdfs-security");
+ rangerHDFSPluginServiceName = rangerHDFSSecurityConfig.get("ranger.plugin.hdfs.service.name");
+ }
+
+ boolean isTagsyncPropertyConfigurationRequired = ( isRangerAdminToBeInstalled && isRangerTagsyncToBeInstalled &&
+ isAtlasServerToBeInstalled && isRangerHDFSPluginEnabled );
+
+ Map<String, String> coreSiteConfig = clusterProps.get("core-site");
+ String fsDefaultFSValue = coreSiteConfig.get("fs.defaultFS");
+ String nameServiceInFsDefaultFSConfig="";
+
+ if (isTagsyncPropertyConfigurationRequired && "{{repo_name}}".equalsIgnoreCase(rangerHDFSPluginServiceName)) {
+ rangerHDFSPluginServiceName = clusterName + "_hadoop";
+ }
+ // If blueprint configuration has multiple nameservices, indicating NN-Federation is enabled
+ if (parsedNameServices.length > 1 && isTagsyncPropertyConfigurationRequired) {
+ for (String nameService : parsedNameServices) {
+ // Adding configurations for Ranger-Tagsync to map Ranger HDFS service for Atlas Tagsync
+ String tagsyncNameserviceMappingProperty = "ranger.tagsync.atlas.hdfs.instance." + clusterName + ".nameservice." + nameService + ".ranger.service";
+ String updatedRangerHDFSPluginServiceName = rangerHDFSPluginServiceName + "_" + nameService;
+ clusterConfig.setProperty(RANGER_TAGSYNC_SITE_CONFIG_TYPE_NAME, tagsyncNameserviceMappingProperty, updatedRangerHDFSPluginServiceName);
+ try {
+ URI fsDefaultFSURI = new URI(fsDefaultFSValue);
+ String fsDefaultFSNameService = fsDefaultFSURI.getHost();
+ if (fsDefaultFSNameService.contains(nameService)) {
+ nameServiceInFsDefaultFSConfig = nameService;
+ }
+ } catch (URISyntaxException e) {
+ LOG.error("Error occurred while parsing the defaultFS URI.", e);
+ }
+ }
+
+ String rangerTagsyncAtlasNNServiceMappingProperty = "ranger.tagsync.atlas.hdfs.instance." + clusterName + ".ranger.service";
+ String rangerTagsyncAtlasNNServiceName = rangerHDFSPluginServiceName + "_" + nameServiceInFsDefaultFSConfig;
+ clusterConfig.setProperty(RANGER_TAGSYNC_SITE_CONFIG_TYPE_NAME, rangerTagsyncAtlasNNServiceMappingProperty, rangerTagsyncAtlasNNServiceName);
+ configTypesUpdated.add(RANGER_TAGSYNC_SITE_CONFIG_TYPE_NAME);
+ }
+ }
+
+ /**
+ * Call registered updaters on cluster configuration + call default updater ({@link HostGroupUpdater#INSTANCE}) on
+ * properties that were submitted in the blueprint or the cluster template and don't have a registered updater.
+ */
+ private void doGeneralPropertyUpdatesForClusterCreate(Configuration clusterConfig,
+ Map<String, Map<String, String>> clusterProps,
+ Set<String> configTypesUpdated) {
+ // Iterate through the updaters and apply them in case applicable properties exist
+ Collection<Map<String, Map<String, PropertyUpdater>>> updaters = createCollectionOfUpdaters();
+ for (Map<String, Map<String, PropertyUpdater>> updaterMap : updaters) {
for (Map.Entry<String, Map<String, PropertyUpdater>> entry : updaterMap.entrySet()) {
- String type = entry.getKey();
+ final String configType = entry.getKey();
for (Map.Entry<String, PropertyUpdater> updaterEntry : entry.getValue().entrySet()) {
String propertyName = updaterEntry.getKey();
PropertyUpdater updater = updaterEntry.getValue();
@@@ -406,43 -657,111 +666,110 @@@
}
}
- //todo: lots of hard coded HA rules included here
- if (isNameNodeHAEnabled(configProperties)) {
-
- // add "dfs.internal.nameservices" if it's not specified
- Map<String, String> hdfsSiteConfig = configProperties.get("hdfs-site");
- String nameservices = hdfsSiteConfig.get("dfs.nameservices");
- String int_nameservices = hdfsSiteConfig.get("dfs.internal.nameservices");
- if(int_nameservices == null && nameservices != null) {
- clusterConfig.setProperty("hdfs-site", "dfs.internal.nameservices", nameservices);
+ // Iterate through all user defined properties (blueprint + cluster template) and call the default updater for those
+ // which don't have a configured updater. This is to make sure that %HOSTGROUP::name% tokens are replaced for each property
+ Set<Pair<String, String>> propertiesWithUpdaters = getAllPropertiesWithUpdaters(updaters);
+ // apply default updater on cluster config
+ applyDefaultUpdater(clusterConfig, clusterConfig.getFullProperties(1), configTypesUpdated, propertiesWithUpdaters);
+ // apply default updater on hostgroup configs
+ clusterTopology.getHostGroupInfo().values().stream().forEach(
+ hostGroup -> {
+ Configuration hostGroupConfig = hostGroup.getConfiguration();
+ Map<String, Map<String, String>> hostGroupConfigProps = hostGroupConfig.getFullProperties(1);
+ applyDefaultUpdater(hostGroupConfig, hostGroupConfigProps, configTypesUpdated, propertiesWithUpdaters);
+ });
+ }
+
+ /**
+ * Calculates all properties that have registered updaters based on the received collection
+ * @param updaters collection of all updaters
+ * @return a set of all properties with updaters as (configType, propertyName) pairs.
+ */
+ private Set<Pair<String, String>> getAllPropertiesWithUpdaters(Collection<Map<String, Map<String, PropertyUpdater>>> updaters) {
+ return updaters.stream().
+ flatMap(map -> map.entrySet().stream()).
+ flatMap(entry -> {
+ String configType = entry.getKey();
+ return entry.getValue().keySet().stream().map(propertyName -> Pair.of(configType, propertyName));
+ }).
+ collect(toSet());
+ }
+
+ /**
+ * Applies the default updater ({@link HostGroupUpdater#INSTANCE}) for properties that don't have a registered updater.
+ * This is to make sure that %HOSTGROUP::name% token replacements happen for all properties.
+ */
+ private void applyDefaultUpdater(Configuration configuration,
+ Map<String, Map<String, String>> properties,
+ Set<String> configTypesUpdated,
+ Set<Pair<String, String>> propertiesWithUpdaters) {
+ properties.entrySet().forEach(
+ configTypeEntry -> {
+ String configType = configTypeEntry.getKey();
+ configTypeEntry.getValue().entrySet().forEach(
+ propertyEntry -> {
+ String propertyName = propertyEntry.getKey();
+ if (!propertiesWithUpdaters.contains(Pair.of(configType, propertyName))) {
+ String oldValue = propertyEntry.getValue();
+ String newValue = updateValue(configType, propertyName, oldValue, PropertyUpdater.defaultUpdater(), properties,
+ configuration, configTypesUpdated, false);
+ if (!Objects.equals(oldValue, newValue)) {
+ LOG.info("Property {}/{} was updated by the default updater from [{}] to [{}]",
+ configType, propertyName, oldValue, newValue);
+ }
+ }
+ });
+ });
+ }
+
+ /**
+ * Encapsulates commonly repeated tasks around updating a configuration value during cluster creation.
+ * @param configType the configuration type (e.g. hdfs-site)
+ * @param propertyName the name of the property (e.g. dfs.namenode.name.dir)
+ * @param oldValue the old value of the property
+ * @param updater the property updater to use
+ * @param allProps other properties to be considered by the updater
+ * @param configuration configuration to update (cluster global config or hostgroup config)
+ * @param configTypesUpdated set of updated config types (configType param will be added if updater changes the
+ * value of the property)
+ * @param alwaysUpdateConfig boolean to indicate whether the {@link Configuration} received as parameter should always
+ * (except when new value is {@code null}) be updated or only in case the new value differs
+ * from the original. (TODO: what is the reason for always updating the configuration?)
+ * @return the updated value
+ */
+ private String updateValue(String configType,
+ String propertyName,
+ String oldValue,
+ PropertyUpdater updater,
+ Map<String, Map<String, String>> allProps,
+ Configuration configuration,
+ Set<String> configTypesUpdated,
+ boolean alwaysUpdateConfig) {
+ String newValue = updater.updateForClusterCreate(propertyName, oldValue, allProps, clusterTopology);
+ if (null != newValue) {
+ if (!newValue.equals(oldValue)) {
+ configTypesUpdated.add(configType);
}
-
- // if the active/stanbdy namenodes are not specified, assign them automatically
- if (! isNameNodeHAInitialActiveNodeSet(clusterProps) && ! isNameNodeHAInitialStandbyNodeSet(clusterProps)) {
- Collection<String> nnHosts = clusterTopology.getHostAssignmentsForComponent("NAMENODE");
- if (nnHosts.size() != 2) {
- throw new ConfigurationTopologyException("NAMENODE HA requires exactly 2 hosts running NAMENODE but there are: " +
- nnHosts.size() + " Hosts: " + nnHosts);
- }
-
- // set the properties that configure which namenode is active,
- // and which is a standby node in this HA deployment
- Iterator<String> nnHostIterator = nnHosts.iterator();
- clusterConfig.setProperty("hadoop-env", "dfs_ha_initial_namenode_active", nnHostIterator.next());
- clusterConfig.setProperty("hadoop-env", "dfs_ha_initial_namenode_standby", nnHostIterator.next());
-
- configTypesUpdated.add("hadoop-env");
+ if (!newValue.equals(oldValue) || alwaysUpdateConfig) {
+ configuration.setProperty(configType, propertyName, newValue);
}
}
+ return newValue;
+ }
- // Explicitly set any properties that are required but not currently provided in the stack definition.
- setStackToolsAndFeatures(clusterConfig, configTypesUpdated);
- setupHDFSProxyUsers(clusterConfig, configTypesUpdated);
- addExcludedConfigProperties(clusterConfig, configTypesUpdated, clusterTopology.getStack());
-
+ private String getClusterName() throws ConfigurationTopologyException {
+ String clusterNameToReturn = null;
+ try {
+ clusterNameToReturn = clusterTopology.getAmbariContext().getClusterName(clusterTopology.getClusterId());
+ } catch (AmbariException e) {
+ throw new ConfigurationTopologyException("Cluster name could not obtained, this may indicate a deployment or configuration error.", e);
+ }
- trimProperties(clusterConfig, clusterTopology);
+ if (clusterNameToReturn == null) {
+ throw new ConfigurationTopologyException("Cluster name could not obtained, this may indicate a deployment or configuration error.");
+ }
- return configTypesUpdated;
+ return clusterNameToReturn;
}
private void trimProperties(Configuration clusterConfig, ClusterTopology clusterTopology) {
@@@ -557,14 -876,14 +884,14 @@@
for (Map.Entry<String, Map<String, String>> configEntry : properties.entrySet()) {
String type = configEntry.getKey();
try {
- clusterTopology.getStack().getServiceForConfigType(type);
- } catch (IllegalArgumentException illegalArgumentException) {
- LOG.error(new StringBuilder(String.format("Error encountered while trying to obtain the service name for config type [%s]. ", type))
- .append("Further processing on this config type will be skipped. ")
- .append("This usually means that a service's definitions have been manually removed from the Ambari stack definitions. ")
- .append("If the stack definitions have not been changed manually, this may indicate a stack definition error in Ambari. ").toString(), illegalArgumentException);
- continue;
- }
- clusterTopology.getBlueprint().getStack().getServiceForConfigType(type);
++ clusterTopology.getStack().getServiceForConfigType(type);
+ } catch (IllegalArgumentException illegalArgumentException) {
+ LOG.error(new StringBuilder(String.format("Error encountered while trying to obtain the service name for config type [%s]. ", type))
+ .append("Further processing on this config type will be skipped. ")
+ .append("This usually means that a service's definitions have been manually removed from the Ambari stack definitions. ")
+ .append("If the stack definitions have not been changed manually, this may indicate a stack definition error in Ambari. ").toString(), illegalArgumentException);
+ continue;
+ }
Map<String, String> typeProperties = configEntry.getValue();
for (Map.Entry<String, String> propertyEntry : typeProperties.entrySet()) {
@@@ -706,11 -1026,10 +1033,11 @@@
*
* @return Collection of PropertyUpdater maps used to handle cluster config update
*/
- private Collection<Map<String, Map<String, PropertyUpdater>>> createCollectionOfUpdaters() {
+ Collection<Map<String, Map<String, PropertyUpdater>>> createCollectionOfUpdaters() {
Collection<Map<String, Map<String, PropertyUpdater>>> updaters = allUpdaters;
- if (clusterTopology.isNameNodeHAEnabled()) {
+ Map<String, Map<String, String>> configProperties = clusterTopology.getConfiguration().getFullProperties();
+ if (isNameNodeHAEnabled(configProperties)) {
updaters = addNameNodeHAUpdaters(updaters);
}
@@@ -1384,42 -1730,82 +1738,81 @@@
@Override
public String updateForClusterCreate(String propertyName,
- String origValue,
- Map<String, Map<String, String>> properties,
- ClusterTopology topology) {
-
- //todo: getHostStrings
- Matcher m = HOST_GROUP_PLACEHOLDER_PATTERN.matcher(origValue);
- if (m.find()) {
- String hostGroupName = m.group(1);
-
- HostGroupInfo groupInfo = topology.getHostGroupInfo().get(hostGroupName);
- if (groupInfo == null) {
- //todo: this should be validated in configuration validation
- throw new RuntimeException(
- "Encountered a host group token in configuration which couldn't be matched to a host group: "
- + hostGroupName);
- }
-
- //todo: warn if > hosts
- return origValue.replace(m.group(0), groupInfo.getHostNames().iterator().next());
- }
-
- return origValue;
+ String origValue,
+ Map<String, Map<String, String>> properties,
+ ClusterTopology topology) {
-
+ HostGroups hostGroups = new HostGroups(topology, propertyName);
+
+ //todo: getHostStrings (?)
+
+ // replaces all %HOSTGROUP::name% references to host names in the value string one by one. The value string can contain
+ // only one (typical) or multiple %HOSTGROUP references. If the same host group is referenced multiple times,
+ // another host will be picked each time.
+ // Assuming you have the following hostgroups and hosts:
+ // - hostgroup1: [group1_host]
+ // - hostgroup2: [group2_host]
+ // - hostgroup3: [group3_host1, group3_host2, group3_host3]
+ // the following replacements will be made:
+ // - %HOSTGROUP::group1%:8080 --> grop1_host:8080
+ // - %HOSTGROUP::group1%:8080,%HOSTGROUP::group2%:8080 --> group1_host:8080,group2_host:8080
+ // - %HOSTGROUP::group3%:8080,%HOSTGROUP::group3%:8080,%HOSTGROUP::group3%:8080 -->
+ // group3_host1:8080,group3_host2:8080,group3_host3:8080 (maybe in different order)
+ LinkedList<Pair<Pair<Integer, Integer>, String>> replacements = new LinkedList<>();
- for (Matcher m = HostGroup.HOSTGROUP_REGEX.matcher(origValue); m.find(); ) {
++ for (Matcher m = HOST_GROUP_PLACEHOLDER_PATTERN.matcher(origValue); m.find(); ) {
+ String replacement = hostGroups.getHost(m.group(1));
+ int from = m.start();
+ int to = m.end();
+ replacements.add(Pair.of(Pair.of(from, to), replacement));
+ }
+ StringBuilder newValue = new StringBuilder(origValue);
+ // replace in descending order so indices remain valid
+ for (Iterator<Pair<Pair<Integer, Integer>, String>> it = replacements.descendingIterator(); it.hasNext(); ) {
+ Pair<Pair<Integer, Integer>, String> replacement = it.next();
+ int from = replacement.getLeft().getLeft();
+ int to = replacement.getLeft().getRight();
+ String replacementValue = replacement.getRight();
+ newValue.replace(from, to, replacementValue);
+ }
+ return newValue.toString();
}
@Override
public Collection<String> getRequiredHostGroups(String propertyName,
- String origValue,
- Map<String, Map<String, String>> properties,
- ClusterTopology topology) {
+ String origValue,
+ Map<String, Map<String, String>> properties,
+ ClusterTopology topology) {
//todo: getHostStrings
- Matcher m = HostGroup.HOSTGROUP_REGEX.matcher(origValue);
+ Matcher m = HOST_GROUP_PLACEHOLDER_PATTERN.matcher(origValue);
- if (m.find()) {
- String hostGroupName = m.group(1);
- return Collections.singleton(hostGroupName);
+ Set<String> hostGroups = new HashSet<>();
+ while (m.find()) {
+ hostGroups.add(m.group(1));
+ }
+ return hostGroups;
+ }
+
+ static class HostGroups {
+ private ClusterTopology topology;
+ private String propertyName; // for logging purpose only
+ private Set<String> hostGroupsUsed = new HashSet<>();
+
+ HostGroups(ClusterTopology topology, String propertyName) {
+ this.topology = topology;
+ this.propertyName = propertyName;
+ }
+
+ String getHost(String hostGroup) {
+ Preconditions.checkState(!hostGroupsUsed.contains(hostGroup),
+ "Multiple occurrence of host group [%s] in property value of: [%s].", hostGroup, propertyName);
+ HostGroupInfo hostGroupInfo = topology.getHostGroupInfo().get(hostGroup);
+ Preconditions.checkArgument(null != hostGroupInfo,
+ "Encountered a host group token in configuration which couldn't be matched to a host group: %s", hostGroup);
+ if (hostGroupInfo.getHostNames().size() > 1) {
+ LOG.warn("Host group {} contains multiple hosts. Using {} with such host groups may result in unintended configuration.",
+ hostGroup, HostGroupUpdater.class.getSimpleName());
+ }
+ hostGroupsUsed.add(hostGroup);
+ return hostGroupInfo.getHostNames().iterator().next();
}
- return Collections.emptySet();
}
}
@@@ -2077,9 -2462,9 +2470,9 @@@
while (m.find()) {
String groupName = m.group(1);
- if (!topology.getBlueprint().getHostGroups().containsKey(groupName)) {
+ if (!topology.getHostGroupInfo().containsKey(groupName)) {
throw new IllegalArgumentException(
- "Unable to match blueprint host group token to a host group: " + groupName);
+ "Unable to match blueprint host group token to a host group: " + groupName);
}
requiredHostGroups.add(groupName);
}
@@@ -2951,41 -3370,38 +3343,41 @@@
* @param configTypesUpdated
* the list of configuration types updated (cluster-env will be added
* to this).
- * @throws ConfigurationTopologyException
*/
private void setStackToolsAndFeatures(Configuration configuration, Set<String> configTypesUpdated)
- throws ConfigurationTopologyException {
+ throws ConfigurationTopologyException {
ConfigHelper configHelper = clusterTopology.getAmbariContext().getConfigHelper();
- Stack stack = clusterTopology.getBlueprint().getStack();
- String stackName = stack.getName();
- String stackVersion = stack.getVersion();
-
- StackId stackId = new StackId(stackName, stackVersion);
- Set<String> properties = Sets.newHashSet(ConfigHelper.CLUSTER_ENV_STACK_NAME_PROPERTY,
- ConfigHelper.CLUSTER_ENV_STACK_ROOT_PROPERTY, ConfigHelper.CLUSTER_ENV_STACK_TOOLS_PROPERTY,
+ Set<String> properties = ImmutableSet.of(
+ ConfigHelper.CLUSTER_ENV_STACK_NAME_PROPERTY,
+ ConfigHelper.CLUSTER_ENV_STACK_ROOT_PROPERTY,
+ ConfigHelper.CLUSTER_ENV_STACK_TOOLS_PROPERTY,
ConfigHelper.CLUSTER_ENV_STACK_FEATURES_PROPERTY,
- ConfigHelper.CLUSTER_ENV_STACK_PACKAGES_PROPERTY);
+ ConfigHelper.CLUSTER_ENV_STACK_PACKAGES_PROPERTY
+ );
try {
- Map<String, Map<String, String>> defaultStackProperties = configHelper.getDefaultStackProperties(stackId);
- Map<String,String> clusterEnvDefaultProperties = defaultStackProperties.get(CLUSTER_ENV_CONFIG_TYPE_NAME);
-
- for( String property : properties ){
- if (clusterEnvDefaultProperties.containsKey(property)) {
- configuration.setProperty(CLUSTER_ENV_CONFIG_TYPE_NAME, property,
- clusterEnvDefaultProperties.get(property));
+ for (StackId stackId : clusterTopology.getStackIds()) {
+ Map<String, Map<String, String>> defaultStackProperties = configHelper.getDefaultStackProperties(stackId);
+ if (defaultStackProperties.containsKey(CLUSTER_ENV_CONFIG_TYPE_NAME)) {
+ Map<String, String> clusterEnvDefaultProperties = defaultStackProperties.get(CLUSTER_ENV_CONFIG_TYPE_NAME);
+
+ for (String property : properties) {
+ if (clusterEnvDefaultProperties.containsKey(property)) {
+ configuration.setProperty(CLUSTER_ENV_CONFIG_TYPE_NAME, property,
+ clusterEnvDefaultProperties.get(property)
+ );
+
+ // make sure to include the configuration type as being updated
+ configTypesUpdated.add(CLUSTER_ENV_CONFIG_TYPE_NAME);
+ }
+ }
- // make sure to include the configuration type as being updated
- configTypesUpdated.add(CLUSTER_ENV_CONFIG_TYPE_NAME);
+ break;
}
}
- } catch( AmbariException ambariException ){
- throw new ConfigurationTopologyException("Unable to retrieve the stack tools and features",
- ambariException);
+ } catch (AmbariException e) {
+ throw new ConfigurationTopologyException("Unable to retrieve the stack tools and features", e);
}
}
diff --cc ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintResourceProvider.java
index 22f367c,020dbb9..10f382a
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintResourceProvider.java
@@@ -18,7 -18,7 +18,8 @@@
package org.apache.ambari.server.controller.internal;
+import static java.util.stream.Collectors.toList;
+ import static java.util.stream.Collectors.toSet;
import java.util.ArrayList;
import java.util.Collection;
@@@ -54,6 -52,8 +56,7 @@@ import org.apache.ambari.server.orm.ent
import org.apache.ambari.server.orm.entities.BlueprintSettingEntity;
import org.apache.ambari.server.orm.entities.HostGroupComponentEntity;
import org.apache.ambari.server.orm.entities.HostGroupEntity;
-import org.apache.ambari.server.orm.entities.StackEntity;
+ import org.apache.ambari.server.orm.entities.TopologyRequestEntity;
import org.apache.ambari.server.stack.NoSuchStackException;
import org.apache.ambari.server.state.SecurityType;
import org.apache.ambari.server.state.StackInfo;
@@@ -166,15 -157,17 +169,20 @@@ public class BlueprintResourceProvider
/**
* Blueprint Data Access Object
*/
- private static BlueprintDAO blueprintDAO;
+ private final BlueprintDAO blueprintDAO;
+
+ private final BlueprintValidator validator;
/**
- * Used to get stack metainfo.
+ * Topology request dao
+ */
+ private static TopologyRequestDAO topologyRequestDAO;
+
+ /**
+ * Used to serialize to/from json.
*/
- private static Gson jsonSerializer;
+ private final AmbariMetaInfo ambariMetaInfo;
+
// ----- Constructors ----------------------------------------------------
@@@ -183,20 -176,24 +191,22 @@@
*
* @param controller management controller
*/
- BlueprintResourceProvider(AmbariManagementController controller) {
- super(Resource.Type.Blueprint, propertyIds, keyPropertyIds, controller);
- }
-
- /**
- * Static initialization.
- *
- * @param factory blueprint factory
- * @param bpDao blueprint data access object
- * @param gson json serializer
- */
- public static void init(BlueprintFactory factory, BlueprintDAO bpDao, TopologyRequestDAO trDao,
- SecurityConfigurationFactory securityFactory, Gson gson, AmbariMetaInfo metaInfo) {
+ @Inject
+ BlueprintResourceProvider(
+ BlueprintValidator validator,
+ BlueprintFactory factory,
- BlueprintDAO dao,
++ BlueprintDAO bpDao,
++ TopologyRequestDAO trDao,
+ SecurityConfigurationFactory securityFactory,
+ AmbariMetaInfo metaInfo,
+ @Assisted AmbariManagementController controller
+ ) {
+ super(Resource.Type.Blueprint, PROPERTY_IDS, KEY_PROPERTY_IDS, controller);
+ this.validator = validator;
blueprintFactory = factory;
- blueprintDAO = dao;
+ blueprintDAO = bpDao;
+ topologyRequestDAO = trDao;
securityConfigurationFactory = securityFactory;
- jsonSerializer = gson;
ambariMetaInfo = metaInfo;
}
diff --cc ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
index 64147d7,cc927e5..1583661
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
@@@ -377,43 -353,27 +365,27 @@@ public class ClientConfigResourceProvid
// translated to a SystemException.
throw new SystemException(e.getMessage(), e);
}
- osFamily = clusters.getHost(hostName).getOsFamily();
+ String osFamily = clusters.getHost(hostName).getOsFamily();
- TreeMap<String, String> hostLevelParams = new TreeMap<>();
- StageUtils.useStackJdkIfExists(hostLevelParams, configs);
- hostLevelParams.put(JDK_LOCATION, managementController.getJdkResourceUrl());
- hostLevelParams.put(STACK_NAME, stackId.getStackName());
- hostLevelParams.put(STACK_VERSION, stackId.getStackVersion());
- hostLevelParams.put(DB_NAME, managementController.getServerDB());
- hostLevelParams.put(MYSQL_JDBC_URL, managementController.getMysqljdbcUrl());
- hostLevelParams.put(ORACLE_JDBC_URL, managementController.getOjdbcUrl());
- hostLevelParams.put(HOST_SYS_PREPPED, configs.areHostsSysPrepped());
- hostLevelParams.put(AGENT_STACK_RETRY_ON_UNAVAILABILITY, configs.isAgentStackRetryOnInstallEnabled());
- hostLevelParams.put(AGENT_STACK_RETRY_COUNT, configs.getAgentStackRetryOnInstallCount());
- hostLevelParams.put(GPL_LICENSE_ACCEPTED, configs.getGplLicenseAccepted().toString());
-
- //may set SERVICE_REPO_INFO in hostLevelParams inside the method
- List<OsSpecific.Package> packages = managementController.getPackagesForStackServiceHost(stackInfo, serviceInfo, hostLevelParams, osFamily);
- String packageList = gson.toJson(packages);
-
- Set<String> userSet = configHelper.getPropertyValuesWithPropertyType(stackId, PropertyType.USER, cluster, desiredClusterConfigs);
- String userList = gson.toJson(userSet);
- hostLevelParams.put(USER_LIST, userList);
+ // Write down os specific info for the service
- ServiceOsSpecific anyOs = null;
++ OsSpecific anyOs = null;
+ if (serviceInfo.getOsSpecifics().containsKey(AmbariMetaInfo.ANY_OS)) {
+ anyOs = serviceInfo.getOsSpecifics().get(AmbariMetaInfo.ANY_OS);
+ }
- //Create a user_group mapping and send it as part of the hostLevelParams
- Map<String, Set<String>> userGroupsMap = configHelper.createUserGroupsMap(
- stackId, cluster, desiredClusterConfigs);
- String userGroups = gson.toJson(userGroupsMap);
- hostLevelParams.put(USER_GROUPS,userGroups);
- ServiceOsSpecific hostOs = populateServicePackagesInfo(serviceInfo, osFamily);
++ OsSpecific hostOs = populateServicePackagesInfo(serviceInfo, osFamily);
- Set<String> groupSet = configHelper.getPropertyValuesWithPropertyType(stackId, PropertyType.GROUP, cluster, desiredClusterConfigs);
- String groupList = gson.toJson(groupSet);
- hostLevelParams.put(GROUP_LIST, groupList);
+ // Build package list that is relevant for host
- List<ServiceOsSpecific.Package> packages =
++ List<OsSpecific.Package> packages =
+ new ArrayList<>();
+ if (anyOs != null) {
+ packages.addAll(anyOs.getPackages());
+ }
- Map<org.apache.ambari.server.state.PropertyInfo, String> notManagedHdfsPathMap = configHelper.getPropertiesWithPropertyType(stackId, PropertyType.NOT_MANAGED_HDFS_PATH, cluster, desiredClusterConfigs);
- Set<String> notManagedHdfsPathSet = configHelper.filterInvalidPropertyValues(notManagedHdfsPathMap, NOT_MANAGED_HDFS_PATH_LIST);
- String notManagedHdfsPathList = gson.toJson(notManagedHdfsPathSet);
- hostLevelParams.put(NOT_MANAGED_HDFS_PATH_LIST, notManagedHdfsPathList);
+ if (hostOs != null) {
+ packages.addAll(hostOs.getPackages());
+ }
+ String packageList = gson.toJson(packages);
String jsonConfigurations = null;
Map<String, Object> commandParams = new HashMap<>();
@@@ -434,6 -394,17 +406,18 @@@
}
}
+ TreeMap<String, String> clusterLevelParams = null;
+ TreeMap<String, String> ambariLevelParams = null;
+ if (getManagementController() instanceof AmbariManagementControllerImpl){
+ AmbariManagementControllerImpl controller = ((AmbariManagementControllerImpl)getManagementController());
- clusterLevelParams = controller.getMetadataClusterLevelParams(cluster, stackId);
- ambariLevelParams = controller.getMetadataAmbariLevelParams();
++ // TODO: [AMP] Fix clusterLevelParams, ambariLevelParams
++ // clusterLevelParams = controller.getMetadataClusterLevelParams(cluster, stackId);
++ // ambariLevelParams = controller.getMetadataAmbariLevelParams();
+ }
+ TreeMap<String, String> agentLevelParams = new TreeMap<>();
+ agentLevelParams.put("hostname", hostName);
+ agentLevelParams.put("public_hostname", publicHostName);
+
commandParams.put(PACKAGE_LIST, packageList);
commandParams.put("xml_configs_list", xmlConfigs);
commandParams.put("env_configs_list", envConfigs);
@@@ -442,12 -413,12 +426,14 @@@
Map<String, Object> jsonContent = new TreeMap<>();
jsonContent.put("configurations", configurations);
+ jsonContent.put("clusterSettings", clusterSettingsMap);
+ jsonContent.put("stackSettings", stackSettingsMap);
- jsonContent.put("configuration_attributes", configurationAttributes);
+ jsonContent.put("configurationAttributes", configurationAttributes);
jsonContent.put("commandParams", commandParams);
jsonContent.put("clusterHostInfo", clusterHostInfo);
- jsonContent.put("hostLevelParams", hostLevelParams);
+ jsonContent.put("ambariLevelParams", ambariLevelParams);
+ jsonContent.put("clusterLevelParams", clusterLevelParams);
+ jsonContent.put("agentLevelParams", agentLevelParams);
jsonContent.put("hostname", hostName);
jsonContent.put("public_hostname", publicHostName);
jsonContent.put("clusterName", cluster.getClusterName());
@@@ -922,4 -890,28 +908,26 @@@
(String) properties.get(HOST_COMPONENT_HOST_NAME_PROPERTY_ID),
null);
}
+
-
- protected ServiceOsSpecific populateServicePackagesInfo(ServiceInfo serviceInfo, String osFamily) {
- ServiceOsSpecific hostOs = new ServiceOsSpecific(osFamily);
- List<ServiceOsSpecific> foundedOSSpecifics = getOSSpecificsByFamily(serviceInfo.getOsSpecifics(), osFamily);
++ protected OsSpecific populateServicePackagesInfo(ServiceInfo serviceInfo, String osFamily) {
++ OsSpecific hostOs = new OsSpecific(osFamily);
++ List<OsSpecific> foundedOSSpecifics = getOSSpecificsByFamily(serviceInfo.getOsSpecifics(), osFamily);
+ if (!foundedOSSpecifics.isEmpty()) {
- for (ServiceOsSpecific osSpecific : foundedOSSpecifics) {
++ for (OsSpecific osSpecific : foundedOSSpecifics) {
+ hostOs.addPackages(osSpecific.getPackages());
+ }
+ }
+
+ return hostOs;
+ }
+
- private List<ServiceOsSpecific> getOSSpecificsByFamily(Map<String, ServiceOsSpecific> osSpecifics, String osFamily) {
- List<ServiceOsSpecific> foundedOSSpecifics = new ArrayList<>();
- for (Map.Entry<String, ServiceOsSpecific> osSpecific : osSpecifics.entrySet()) {
++ private List<OsSpecific> getOSSpecificsByFamily(Map<String, OsSpecific> osSpecifics, String osFamily) {
++ List<OsSpecific> foundedOSSpecifics = new ArrayList<>();
++ for (Map.Entry<String, OsSpecific> osSpecific : osSpecifics.entrySet()) {
+ if (osSpecific.getKey().indexOf(osFamily) != -1) {
+ foundedOSSpecifics.add(osSpecific.getValue());
+ }
+ }
+ return foundedOSSpecifics;
+ }
-
}
diff --cc ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterResourceProvider.java
index 80ec6b6,96823c2..13d946a
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterResourceProvider.java
@@@ -328,14 -327,8 +328,14 @@@ public class ClusterResourceProvider ex
for (Collection<ServiceConfigVersionResponse> scvCollection : serviceConfigVersions.values()) {
for (ServiceConfigVersionResponse serviceConfigVersionResponse : scvCollection) {
Resource resource = new ResourceImpl(Resource.Type.ServiceConfigVersion);
- resource.setProperty(ServiceConfigVersionResourceProvider.SERVICE_CONFIG_VERSION_SERVICE_GROUP_NAME_PROPERTY_ID,
++ resource.setProperty(ServiceConfigVersionResourceProvider.SERVICE_GROUP_NAME_PROPERTY_ID,
+ serviceConfigVersionResponse.getServiceGroupName());
- resource.setProperty(ServiceConfigVersionResourceProvider.SERVICE_CONFIG_VERSION_SERVICE_GROUP_ID_PROPERTY_ID,
++ resource.setProperty(ServiceConfigVersionResourceProvider.SERVICE_GROUP_ID_PROPERTY_ID,
+ serviceConfigVersionResponse.getServiceGroupId());
- resource.setProperty(ServiceConfigVersionResourceProvider.SERVICE_CONFIG_VERSION_SERVICE_NAME_PROPERTY_ID,
+ resource.setProperty(ServiceConfigVersionResourceProvider.SERVICE_NAME_PROPERTY_ID,
serviceConfigVersionResponse.getServiceName());
- resource.setProperty(ServiceConfigVersionResourceProvider.SERVICE_CONFIG_VERSION_SERVICE_ID_PROPERTY_ID,
++ resource.setProperty(ServiceConfigVersionResourceProvider.SERVICE_ID_PROPERTY_ID,
+ serviceConfigVersionResponse.getServiceId());
resource.setProperty(ServiceConfigVersionResourceProvider.SERVICE_CONFIG_VERSION_PROPERTY_ID,
serviceConfigVersionResponse.getVersion());
resource.setProperty(ServiceConfigVersionResourceProvider.SERVICE_CONFIG_VERSION_NOTE_PROPERTY_ID,
diff --cc ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java
index 7581b96,b3abbf8..a4bbb9a
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java
@@@ -79,52 -77,59 +79,73 @@@ import com.google.inject.persist.Transa
* Resource provider for component resources.
*/
public class ComponentResourceProvider extends AbstractControllerResourceProvider {
- public static final String RESPONSE_KEY = "ServiceComponentInfo";
- public static final String ALL_PROPERTIES = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "*";
--
private static final Logger LOG = LoggerFactory.getLogger(ComponentResourceProvider.class);
- // ----- Property ID constants ---------------------------------------------
-
- // Components
-
- protected static final String COMPONENT_CLUSTER_ID_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "cluster_id";
- public static final String COMPONENT_CLUSTER_NAME_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "cluster_name";
- protected static final String COMPONENT_SERVICE_GROUP_ID_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "service_group_id";
- protected static final String COMPONENT_SERVICE_GROUP_NAME_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "service_group_name";
- protected static final String COMPONENT_SERVICE_ID_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "service_id";
- public static final String COMPONENT_SERVICE_NAME_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "service_name";
- public static final String COMPONENT_SERVICE_TYPE_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "service_type";
- protected static final String COMPONENT_COMPONENT_ID_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "id";
- public static final String COMPONENT_COMPONENT_NAME_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "component_name";
- protected static final String COMPONENT_COMPONENT_TYPE_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "component_type";
- protected static final String COMPONENT_DISPLAY_NAME_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "display_name";
- protected static final String COMPONENT_STATE_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "state";
- protected static final String COMPONENT_CATEGORY_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "category";
- protected static final String COMPONENT_TOTAL_COUNT_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "total_count";
- protected static final String COMPONENT_STARTED_COUNT_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "started_count";
- protected static final String COMPONENT_INSTALLED_COUNT_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "installed_count";
- protected static final String COMPONENT_INSTALLED_AND_MAINTENANCE_OFF_COUNT_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "installed_and_maintenance_off_count";
-
- protected static final String COMPONENT_INIT_COUNT_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "init_count";
- protected static final String COMPONENT_UNKNOWN_COUNT_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "unknown_count";
- protected static final String COMPONENT_INSTALL_FAILED_COUNT_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "install_failed_count";
- public static final String COMPONENT_RECOVERY_ENABLED_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "recovery_enabled";
- protected static final String COMPONENT_DESIRED_STACK = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "desired_stack";
- protected static final String COMPONENT_DESIRED_VERSION = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "desired_version";
+ public static final String SERVICE_COMPONENT_INFO = "ServiceComponentInfo";
++ public static final String ALL_PROPERTIES = SERVICE_COMPONENT_INFO + PropertyHelper.EXTERNAL_PATH_SEP + "*";
+
++ protected static final String CLUSTER_ID_PROPERTY_ID = "cluster_id";
+ public static final String CLUSTER_NAME_PROPERTY_ID = "cluster_name";
++ protected static final String SERVICE_GROUP_ID_PROPERTY_ID = "service_group_id";
++ protected static final String SERVICE_GROUP_NAME_PROPERTY_ID = "service_group_name";
++ protected static final String SERVICE_ID_PROPERTY_ID = "service_id";
+ public static final String SERVICE_NAME_PROPERTY_ID = "service_name";
- public static final String COMPONENT_NAME_PROPERTY_ID = "component_name";
- public static final String DISPLAY_NAME_PROPERTY_ID = "display_name";
- public static final String STATE_PROPERTY_ID = "state";
- public static final String CATEGORY_PROPERTY_ID = "category";
- public static final String TOTAL_COUNT_PROPERTY_ID = "total_count";
- public static final String STARTED_COUNT_PROPERTY_ID = "started_count";
- public static final String INSTALLED_COUNT_PROPERTY_ID = "installed_count";
- public static final String INSTALLED_AND_MAINTENANCE_OFF_COUNT_PROPERTY_ID = "installed_and_maintenance_off_count";
- public static final String INIT_COUNT_PROPERTY_ID = "init_count";
- public static final String UNKNOWN_COUNT_PROPERTY_ID = "unknown_count";
- public static final String INSTALL_FAILED_COUNT_PROPERTY_ID = "install_failed_count";
++ public static final String SERVICE_TYPE_PROPERTY_ID = "service_type";
++ protected static final String COMPONENT_ID_PROPERTY_ID = "id";
++ public static final String COMPONENT_NAME_PROPERTY_ID = "component_name";
++ protected static final String COMPONENT_TYPE_PROPERTY_ID = "component_type";
++ protected static final String DISPLAY_NAME_PROPERTY_ID = "display_name";
++ protected static final String STATE_PROPERTY_ID = "state";
++ protected static final String CATEGORY_PROPERTY_ID = "category";
++ protected static final String TOTAL_COUNT_PROPERTY_ID = "total_count";
++ protected static final String STARTED_COUNT_PROPERTY_ID = "started_count";
++ protected static final String INSTALLED_COUNT_PROPERTY_ID = "installed_count";
++ protected static final String INSTALLED_AND_MAINTENANCE_OFF_COUNT_PROPERTY_ID = "installed_and_maintenance_off_count";
++
++ protected static final String INIT_COUNT_PROPERTY_ID = "init_count";
++ protected static final String UNKNOWN_COUNT_PROPERTY_ID = "unknown_count";
++ protected static final String INSTALL_FAILED_COUNT_PROPERTY_ID = "install_failed_count";
+ public static final String RECOVERY_ENABLED_PROPERTY_ID = "recovery_enabled";
- public static final String DESIRED_STACK_PROPERTY_ID = "desired_stack";
- public static final String DESIRED_VERSION_PROPERTY_ID = "desired_version";
- public static final String REPOSITORY_STATE_PROPERTY_ID = "repository_state";
++ protected static final String DESIRED_STACK_PROPERTY_ID = "desired_stack";
++ protected static final String DESIRED_VERSION_PROPERTY_ID = "desired_version";
+
- // Components
++ public static final String CLUSTER_ID = SERVICE_COMPONENT_INFO + PropertyHelper.EXTERNAL_PATH_SEP + CLUSTER_ID_PROPERTY_ID;
+ public static final String CLUSTER_NAME = SERVICE_COMPONENT_INFO + PropertyHelper.EXTERNAL_PATH_SEP + CLUSTER_NAME_PROPERTY_ID;
++ public static final String SERVICE_GROUP_ID = SERVICE_COMPONENT_INFO + PropertyHelper.EXTERNAL_PATH_SEP + SERVICE_GROUP_ID_PROPERTY_ID;
++ public static final String SERVICE_GROUP_NAME = SERVICE_COMPONENT_INFO + PropertyHelper.EXTERNAL_PATH_SEP + SERVICE_GROUP_NAME_PROPERTY_ID;
++ public static final String SERVICE_ID = SERVICE_COMPONENT_INFO + PropertyHelper.EXTERNAL_PATH_SEP + SERVICE_ID_PROPERTY_ID;
+ public static final String SERVICE_NAME = SERVICE_COMPONENT_INFO + PropertyHelper.EXTERNAL_PATH_SEP + SERVICE_NAME_PROPERTY_ID;
++ public static final String SERVICE_TYPE = SERVICE_COMPONENT_INFO + PropertyHelper.EXTERNAL_PATH_SEP + SERVICE_TYPE_PROPERTY_ID;
++ public static final String COMPONENT_ID = SERVICE_COMPONENT_INFO + PropertyHelper.EXTERNAL_PATH_SEP + COMPONENT_ID_PROPERTY_ID;
+ public static final String COMPONENT_NAME = SERVICE_COMPONENT_INFO + PropertyHelper.EXTERNAL_PATH_SEP + COMPONENT_NAME_PROPERTY_ID;
++ public static final String COMPONENT_TYPE = SERVICE_COMPONENT_INFO + PropertyHelper.EXTERNAL_PATH_SEP + COMPONENT_TYPE_PROPERTY_ID;
+ public static final String DISPLAY_NAME = SERVICE_COMPONENT_INFO + PropertyHelper.EXTERNAL_PATH_SEP + DISPLAY_NAME_PROPERTY_ID;
+ public static final String STATE = SERVICE_COMPONENT_INFO + PropertyHelper.EXTERNAL_PATH_SEP + STATE_PROPERTY_ID;
+ public static final String CATEGORY = SERVICE_COMPONENT_INFO + PropertyHelper.EXTERNAL_PATH_SEP + CATEGORY_PROPERTY_ID;
+ public static final String TOTAL_COUNT = SERVICE_COMPONENT_INFO + PropertyHelper.EXTERNAL_PATH_SEP + TOTAL_COUNT_PROPERTY_ID;
+ public static final String STARTED_COUNT = SERVICE_COMPONENT_INFO + PropertyHelper.EXTERNAL_PATH_SEP + STARTED_COUNT_PROPERTY_ID;
+ public static final String INSTALLED_COUNT = SERVICE_COMPONENT_INFO + PropertyHelper.EXTERNAL_PATH_SEP + INSTALLED_COUNT_PROPERTY_ID;
+ public static final String INSTALLED_AND_MAINTENANCE_OFF_COUNT =
+ SERVICE_COMPONENT_INFO + PropertyHelper.EXTERNAL_PATH_SEP + INSTALLED_AND_MAINTENANCE_OFF_COUNT_PROPERTY_ID;
+ public static final String INIT_COUNT = SERVICE_COMPONENT_INFO + PropertyHelper.EXTERNAL_PATH_SEP + INIT_COUNT_PROPERTY_ID;
+ public static final String UNKNOWN_COUNT = SERVICE_COMPONENT_INFO + PropertyHelper.EXTERNAL_PATH_SEP + UNKNOWN_COUNT_PROPERTY_ID;
+ public static final String INSTALL_FAILED_COUNT = SERVICE_COMPONENT_INFO + PropertyHelper.EXTERNAL_PATH_SEP + INSTALL_FAILED_COUNT_PROPERTY_ID;
+ public static final String RECOVERY_ENABLED = SERVICE_COMPONENT_INFO + PropertyHelper.EXTERNAL_PATH_SEP + RECOVERY_ENABLED_PROPERTY_ID;
+ public static final String DESIRED_STACK = SERVICE_COMPONENT_INFO + PropertyHelper.EXTERNAL_PATH_SEP + DESIRED_STACK_PROPERTY_ID;
+ public static final String DESIRED_VERSION = SERVICE_COMPONENT_INFO + PropertyHelper.EXTERNAL_PATH_SEP + DESIRED_VERSION_PROPERTY_ID;
- public static final String REPOSITORY_STATE = SERVICE_COMPONENT_INFO + PropertyHelper.EXTERNAL_PATH_SEP + REPOSITORY_STATE_PROPERTY_ID;
-
private static final String TRUE = "true";
//Parameters from the predicate
private static final String QUERY_PARAMETERS_RUN_SMOKE_TEST_ID = "params/run_smoke_test";
private static Set<String> pkPropertyIds = Sets.newHashSet(
- COMPONENT_CLUSTER_NAME_PROPERTY_ID,
- COMPONENT_SERVICE_GROUP_NAME_PROPERTY_ID,
- COMPONENT_SERVICE_NAME_PROPERTY_ID,
- COMPONENT_COMPONENT_ID_PROPERTY_ID,
- COMPONENT_COMPONENT_NAME_PROPERTY_ID,
- COMPONENT_COMPONENT_TYPE_PROPERTY_ID);
+ CLUSTER_NAME,
++ SERVICE_GROUP_NAME_PROPERTY_ID,
+ SERVICE_NAME,
- COMPONENT_NAME);
++ COMPONENT_ID,
++ COMPONENT_NAME,
++ COMPONENT_TYPE);
/**
* The property ids for an servce resource.
@@@ -138,38 -143,29 +159,37 @@@
static {
// properties
- PROPERTY_IDS.add(COMPONENT_CLUSTER_ID_PROPERTY_ID);
- PROPERTY_IDS.add(COMPONENT_CLUSTER_NAME_PROPERTY_ID);
- PROPERTY_IDS.add(COMPONENT_SERVICE_GROUP_ID_PROPERTY_ID);
- PROPERTY_IDS.add(COMPONENT_SERVICE_GROUP_NAME_PROPERTY_ID);
- PROPERTY_IDS.add(COMPONENT_SERVICE_ID_PROPERTY_ID);
- PROPERTY_IDS.add(COMPONENT_SERVICE_NAME_PROPERTY_ID);
- PROPERTY_IDS.add(COMPONENT_SERVICE_TYPE_PROPERTY_ID);
- PROPERTY_IDS.add(COMPONENT_COMPONENT_ID_PROPERTY_ID);
- PROPERTY_IDS.add(COMPONENT_COMPONENT_NAME_PROPERTY_ID);
- PROPERTY_IDS.add(COMPONENT_COMPONENT_TYPE_PROPERTY_ID);
- PROPERTY_IDS.add(COMPONENT_DISPLAY_NAME_PROPERTY_ID);
- PROPERTY_IDS.add(COMPONENT_STATE_PROPERTY_ID);
- PROPERTY_IDS.add(COMPONENT_CATEGORY_PROPERTY_ID);
- PROPERTY_IDS.add(COMPONENT_TOTAL_COUNT_PROPERTY_ID);
- PROPERTY_IDS.add(COMPONENT_STARTED_COUNT_PROPERTY_ID);
- PROPERTY_IDS.add(COMPONENT_INSTALLED_COUNT_PROPERTY_ID);
- PROPERTY_IDS.add(COMPONENT_INSTALLED_AND_MAINTENANCE_OFF_COUNT_PROPERTY_ID);
-
- PROPERTY_IDS.add(COMPONENT_INIT_COUNT_PROPERTY_ID);
- PROPERTY_IDS.add(COMPONENT_UNKNOWN_COUNT_PROPERTY_ID);
- PROPERTY_IDS.add(COMPONENT_INSTALL_FAILED_COUNT_PROPERTY_ID);
- PROPERTY_IDS.add(COMPONENT_RECOVERY_ENABLED_ID);
- PROPERTY_IDS.add(COMPONENT_DESIRED_STACK);
- PROPERTY_IDS.add(COMPONENT_DESIRED_VERSION);
-
++ PROPERTY_IDS.add(CLUSTER_ID);
+ PROPERTY_IDS.add(CLUSTER_NAME);
++ PROPERTY_IDS.add(SERVICE_GROUP_ID);
++ PROPERTY_IDS.add(SERVICE_GROUP_NAME);
++ PROPERTY_IDS.add(SERVICE_ID);
+ PROPERTY_IDS.add(SERVICE_NAME);
++ PROPERTY_IDS.add(SERVICE_TYPE);
++ PROPERTY_IDS.add(COMPONENT_ID);
+ PROPERTY_IDS.add(COMPONENT_NAME);
++ PROPERTY_IDS.add(COMPONENT_TYPE);
+ PROPERTY_IDS.add(DISPLAY_NAME);
+ PROPERTY_IDS.add(STATE);
+ PROPERTY_IDS.add(CATEGORY);
+ PROPERTY_IDS.add(TOTAL_COUNT);
+ PROPERTY_IDS.add(STARTED_COUNT);
+ PROPERTY_IDS.add(INSTALLED_COUNT);
+ PROPERTY_IDS.add(INSTALLED_AND_MAINTENANCE_OFF_COUNT);
++
+ PROPERTY_IDS.add(INIT_COUNT);
+ PROPERTY_IDS.add(UNKNOWN_COUNT);
+ PROPERTY_IDS.add(INSTALL_FAILED_COUNT);
+ PROPERTY_IDS.add(RECOVERY_ENABLED);
+ PROPERTY_IDS.add(DESIRED_STACK);
+ PROPERTY_IDS.add(DESIRED_VERSION);
- PROPERTY_IDS.add(REPOSITORY_STATE);
PROPERTY_IDS.add(QUERY_PARAMETERS_RUN_SMOKE_TEST_ID);
// keys
- KEY_PROPERTY_IDS.put(Resource.Type.Component, COMPONENT_COMPONENT_NAME_PROPERTY_ID);
- KEY_PROPERTY_IDS.put(Resource.Type.ServiceGroup, COMPONENT_SERVICE_GROUP_NAME_PROPERTY_ID);
- KEY_PROPERTY_IDS.put(Resource.Type.Service, COMPONENT_SERVICE_NAME_PROPERTY_ID);
- KEY_PROPERTY_IDS.put(Resource.Type.Cluster, COMPONENT_CLUSTER_NAME_PROPERTY_ID);
+ KEY_PROPERTY_IDS.put(Resource.Type.Component, COMPONENT_NAME);
+ KEY_PROPERTY_IDS.put(Resource.Type.Service, SERVICE_NAME);
++ KEY_PROPERTY_IDS.put(Resource.Type.ServiceGroup, SERVICE_GROUP_NAME);
+ KEY_PROPERTY_IDS.put(Resource.Type.Cluster, CLUSTER_NAME);
}
private MaintenanceStateHelper maintenanceStateHelper;
@@@ -217,35 -213,8 +237,35 @@@
}
});
- notifyCreate(Resource.Type.Component, request);
-
+ Set<Resource> associatedResources = new HashSet<>();
+ if (createSvcCmpnt != null) {
+ Iterator<ServiceComponentResponse> itr = createSvcCmpnt.iterator();
+ while (itr.hasNext()) {
+ ServiceComponentResponse response = itr.next();
+ notifyCreate(Resource.Type.Component, request);
+ Resource resource = new ResourceImpl(Resource.Type.Component);
- resource.setProperty(COMPONENT_CLUSTER_ID_PROPERTY_ID, response.getClusterId());
- resource.setProperty(COMPONENT_CLUSTER_NAME_PROPERTY_ID, response.getClusterName());
- resource.setProperty(COMPONENT_SERVICE_GROUP_ID_PROPERTY_ID, response.getServiceGroupId());
- resource.setProperty(COMPONENT_SERVICE_GROUP_NAME_PROPERTY_ID, response.getServiceGroupName());
- resource.setProperty(COMPONENT_SERVICE_ID_PROPERTY_ID, response.getServiceId());
- resource.setProperty(COMPONENT_SERVICE_NAME_PROPERTY_ID, response.getServiceName());
- resource.setProperty(COMPONENT_SERVICE_TYPE_PROPERTY_ID, response.getServiceType());
- resource.setProperty(COMPONENT_COMPONENT_ID_PROPERTY_ID, response.getComponentId());
- resource.setProperty(COMPONENT_COMPONENT_NAME_PROPERTY_ID, response.getComponentName());
- resource.setProperty(COMPONENT_COMPONENT_TYPE_PROPERTY_ID, response.getComponentType());
- resource.setProperty(COMPONENT_DISPLAY_NAME_PROPERTY_ID, response.getDisplayName());
- resource.setProperty(COMPONENT_STATE_PROPERTY_ID, response.getDesiredState());
- resource.setProperty(COMPONENT_CATEGORY_PROPERTY_ID, response.getCategory());
- resource.setProperty(COMPONENT_TOTAL_COUNT_PROPERTY_ID, response.getServiceComponentStateCount());
- resource.setProperty(COMPONENT_RECOVERY_ENABLED_ID, response.isRecoveryEnabled());
- resource.setProperty(COMPONENT_DESIRED_STACK, response.getDesiredStackId());
- resource.setProperty(COMPONENT_DESIRED_VERSION, response.getDesiredVersion());
++ resource.setProperty(CLUSTER_ID, response.getClusterId());
++ resource.setProperty(CLUSTER_NAME, response.getClusterName());
++ resource.setProperty(SERVICE_GROUP_ID, response.getServiceGroupId());
++ resource.setProperty(SERVICE_GROUP_NAME, response.getServiceGroupName());
++ resource.setProperty(SERVICE_ID, response.getServiceId());
++ resource.setProperty(SERVICE_NAME, response.getServiceName());
++ resource.setProperty(SERVICE_TYPE, response.getServiceType());
++ resource.setProperty(COMPONENT_ID, response.getComponentId());
++ resource.setProperty(COMPONENT_NAME, response.getComponentName());
++ resource.setProperty(COMPONENT_TYPE, response.getComponentType());
++ resource.setProperty(DISPLAY_NAME, response.getDisplayName());
++ resource.setProperty(STATE, response.getDesiredState());
++ resource.setProperty(CATEGORY, response.getCategory());
++ resource.setProperty(TOTAL_COUNT, response.getServiceComponentStateCount());
++ resource.setProperty(RECOVERY_ENABLED, response.isRecoveryEnabled());
++ resource.setProperty(DESIRED_STACK, response.getDesiredStackId());
++ resource.setProperty(DESIRED_VERSION, response.getDesiredVersion());
+
+ associatedResources.add(resource);
+ }
+ return getRequestStatus(null, associatedResources);
+ }
return getRequestStatus(null);
}
@@@ -272,29 -241,23 +292,30 @@@
for (ServiceComponentResponse response : responses) {
Resource resource = new ResourceImpl(Resource.Type.Component);
- setResourceProperty(resource, COMPONENT_CLUSTER_ID_PROPERTY_ID, response.getClusterId(), requestedIds);
- setResourceProperty(resource, COMPONENT_CLUSTER_NAME_PROPERTY_ID, response.getClusterName(), requestedIds);
- setResourceProperty(resource, COMPONENT_SERVICE_GROUP_ID_PROPERTY_ID, response.getServiceGroupId(), requestedIds);
- setResourceProperty(resource, COMPONENT_SERVICE_GROUP_NAME_PROPERTY_ID, response.getServiceGroupName(), requestedIds);
- setResourceProperty(resource, COMPONENT_SERVICE_ID_PROPERTY_ID, response.getServiceId(), requestedIds);
- setResourceProperty(resource, COMPONENT_SERVICE_NAME_PROPERTY_ID, response.getServiceName(), requestedIds);
- setResourceProperty(resource, COMPONENT_SERVICE_TYPE_PROPERTY_ID, response.getServiceType(), requestedIds);
- setResourceProperty(resource, COMPONENT_COMPONENT_ID_PROPERTY_ID, response.getComponentId(), requestedIds);
- setResourceProperty(resource, COMPONENT_COMPONENT_NAME_PROPERTY_ID, response.getComponentName(), requestedIds);
- setResourceProperty(resource, COMPONENT_COMPONENT_TYPE_PROPERTY_ID, response.getComponentType(), requestedIds);
- setResourceProperty(resource, COMPONENT_DISPLAY_NAME_PROPERTY_ID, response.getDisplayName(), requestedIds);
- setResourceProperty(resource, COMPONENT_STATE_PROPERTY_ID, response.getDesiredState(), requestedIds);
- setResourceProperty(resource, COMPONENT_CATEGORY_PROPERTY_ID, response.getCategory(), requestedIds);
- setResourceProperty(resource, COMPONENT_TOTAL_COUNT_PROPERTY_ID, response.getServiceComponentStateCount().get("totalCount"), requestedIds);
- setResourceProperty(resource, COMPONENT_STARTED_COUNT_PROPERTY_ID, response.getServiceComponentStateCount().get("startedCount"), requestedIds);
- setResourceProperty(resource, COMPONENT_INSTALLED_COUNT_PROPERTY_ID, response.getServiceComponentStateCount().get("installedCount"), requestedIds);
- setResourceProperty(resource, COMPONENT_INSTALLED_AND_MAINTENANCE_OFF_COUNT_PROPERTY_ID, response.getServiceComponentStateCount().get("installedAndMaintenanceOffCount"), requestedIds);
- setResourceProperty(resource, COMPONENT_INSTALL_FAILED_COUNT_PROPERTY_ID, response.getServiceComponentStateCount().get("installFailedCount"), requestedIds);
- setResourceProperty(resource, COMPONENT_INIT_COUNT_PROPERTY_ID, response.getServiceComponentStateCount().get("initCount"), requestedIds);
- setResourceProperty(resource, COMPONENT_UNKNOWN_COUNT_PROPERTY_ID, response.getServiceComponentStateCount().get("unknownCount"), requestedIds);
- setResourceProperty(resource, COMPONENT_RECOVERY_ENABLED_ID, String.valueOf(response.isRecoveryEnabled()), requestedIds);
- setResourceProperty(resource, COMPONENT_DESIRED_STACK, response.getDesiredStackId(), requestedIds);
- setResourceProperty(resource, COMPONENT_DESIRED_VERSION, response.getDesiredVersion(), requestedIds);
++ setResourceProperty(resource, CLUSTER_ID, response.getClusterId(), requestedIds);
+ setResourceProperty(resource, CLUSTER_NAME, response.getClusterName(), requestedIds);
++ setResourceProperty(resource, SERVICE_GROUP_ID, response.getServiceGroupId(), requestedIds);
++ setResourceProperty(resource, SERVICE_GROUP_NAME, response.getServiceGroupName(), requestedIds);
++ setResourceProperty(resource, SERVICE_ID, response.getServiceId(), requestedIds);
+ setResourceProperty(resource, SERVICE_NAME, response.getServiceName(), requestedIds);
++ setResourceProperty(resource, SERVICE_TYPE, response.getServiceType(), requestedIds);
++ setResourceProperty(resource, COMPONENT_ID, response.getComponentId(), requestedIds);
+ setResourceProperty(resource, COMPONENT_NAME, response.getComponentName(), requestedIds);
++ setResourceProperty(resource, COMPONENT_TYPE, response.getComponentType(), requestedIds);
+ setResourceProperty(resource, DISPLAY_NAME, response.getDisplayName(), requestedIds);
+ setResourceProperty(resource, STATE, response.getDesiredState(), requestedIds);
+ setResourceProperty(resource, CATEGORY, response.getCategory(), requestedIds);
+ setResourceProperty(resource, TOTAL_COUNT, response.getServiceComponentStateCount().get("totalCount"), requestedIds);
+ setResourceProperty(resource, STARTED_COUNT, response.getServiceComponentStateCount().get("startedCount"), requestedIds);
+ setResourceProperty(resource, INSTALLED_COUNT, response.getServiceComponentStateCount().get("installedCount"), requestedIds);
+ setResourceProperty(resource, INSTALLED_AND_MAINTENANCE_OFF_COUNT, response.getServiceComponentStateCount().get("installedAndMaintenanceOffCount"), requestedIds);
+ setResourceProperty(resource, INSTALL_FAILED_COUNT, response.getServiceComponentStateCount().get("installFailedCount"), requestedIds);
+ setResourceProperty(resource, INIT_COUNT, response.getServiceComponentStateCount().get("initCount"), requestedIds);
+ setResourceProperty(resource, UNKNOWN_COUNT, response.getServiceComponentStateCount().get("unknownCount"), requestedIds);
+ setResourceProperty(resource, RECOVERY_ENABLED, String.valueOf(response.isRecoveryEnabled()), requestedIds);
+ setResourceProperty(resource, DESIRED_STACK, response.getDesiredStackId(), requestedIds);
+ setResourceProperty(resource, DESIRED_VERSION, response.getDesiredVersion(), requestedIds);
- setResourceProperty(resource, REPOSITORY_STATE, response.getRepositoryState(), requestedIds);
++
resources.add(resource);
}
@@@ -369,14 -327,12 +390,14 @@@
*/
private ServiceComponentRequest getRequest(Map<String, Object> properties) {
return new ServiceComponentRequest(
- (String) properties.get(COMPONENT_CLUSTER_NAME_PROPERTY_ID),
- (String) properties.get(COMPONENT_SERVICE_GROUP_NAME_PROPERTY_ID),
- (String) properties.get(COMPONENT_SERVICE_NAME_PROPERTY_ID),
- (String) properties.get(COMPONENT_COMPONENT_NAME_PROPERTY_ID),
- (String) properties.get(COMPONENT_COMPONENT_TYPE_PROPERTY_ID),
- (String) properties.get(COMPONENT_STATE_PROPERTY_ID),
- (String) properties.get(COMPONENT_RECOVERY_ENABLED_ID),
- (String) properties.get(COMPONENT_CATEGORY_PROPERTY_ID));
+ (String) properties.get(CLUSTER_NAME),
++ (String) properties.get(SERVICE_GROUP_NAME),
+ (String) properties.get(SERVICE_NAME),
+ (String) properties.get(COMPONENT_NAME),
++ (String) properties.get(COMPONENT_TYPE),
+ (String) properties.get(STATE),
+ (String) properties.get(RECOVERY_ENABLED),
+ (String) properties.get(CATEGORY));
}
// Create the components for the given requests.
diff --cc ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
index 59d1a20,755a03a..3fcb5e8
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
@@@ -58,8 -58,8 +58,9 @@@ import org.apache.ambari.server.state.C
import org.apache.ambari.server.state.Clusters;
import org.apache.ambari.server.state.Config;
import org.apache.ambari.server.state.ConfigFactory;
+ import org.apache.ambari.server.state.ConfigHelper;
import org.apache.ambari.server.state.Host;
+import org.apache.ambari.server.state.Service;
import org.apache.ambari.server.state.configgroup.ConfigGroup;
import org.apache.ambari.server.state.configgroup.ConfigGroupFactory;
import org.apache.commons.collections.MapUtils;
@@@ -79,32 -80,34 +81,36 @@@ public class ConfigGroupResourceProvide
private static final Logger LOG = LoggerFactory.getLogger
(ConfigGroupResourceProvider.class);
- protected static final String CONFIGGROUP_CLUSTER_NAME_PROPERTY_ID =
- PropertyHelper.getPropertyId("ConfigGroup", "cluster_name");
- protected static final String CONFIGGROUP_ID_PROPERTY_ID = PropertyHelper
- .getPropertyId("ConfigGroup", "id");
- protected static final String CONFIGGROUP_NAME_PROPERTY_ID = PropertyHelper
- .getPropertyId("ConfigGroup", "group_name");
- protected static final String CONFIGGROUP_TAG_PROPERTY_ID = PropertyHelper
- .getPropertyId("ConfigGroup", "tag");
- protected static final String CONFIGGROUP_SERVICEGROUPNAME_PROPERTY_ID = PropertyHelper
- .getPropertyId("ConfigGroup", "service_group_name");
- protected static final String CONFIGGROUP_SERVICENAME_PROPERTY_ID = PropertyHelper
- .getPropertyId("ConfigGroup", "service_name");
- protected static final String CONFIGGROUP_DESC_PROPERTY_ID = PropertyHelper
- .getPropertyId("ConfigGroup", "description");
- protected static final String CONFIGGROUP_SCV_NOTE_ID = PropertyHelper
- .getPropertyId("ConfigGroup", "service_config_version_note");
- protected static final String CONFIGGROUP_HOSTNAME_PROPERTY_ID =
- PropertyHelper.getPropertyId(null, "host_name");
- protected static final String CONFIGGROUP_HOSTS_HOSTNAME_PROPERTY_ID =
- PropertyHelper.getPropertyId("ConfigGroup", "hosts/host_name");
- public static final String CONFIGGROUP_HOSTS_PROPERTY_ID = PropertyHelper
- .getPropertyId("ConfigGroup", "hosts");
- public static final String CONFIGGROUP_CONFIGS_PROPERTY_ID =
- PropertyHelper.getPropertyId("ConfigGroup", "desired_configs");
- public static final String CONFIGGROUP_VERSION_TAGS_PROPERTY_ID =
- PropertyHelper.getPropertyId("ConfigGroup", "version_tags");
+ public static final String CONFIG_GROUP = "ConfigGroup";
+
+ public static final String CLUSTER_NAME_PROPERTY_ID = "cluster_name";
+ public static final String ID_PROPERTY_ID = "id";
+ public static final String GROUP_NAME_PROPERTY_ID = "group_name";
+ public static final String TAG_PROPERTY_ID = "tag";
++ public static final String SERVICE_GROUP_NAME_PROPERTY_ID = "service_group_name";
+ public static final String SERVICE_NAME_PROPERTY_ID = "service_name";
+ public static final String DESCRIPTION_PROPERTY_ID = "description";
+ public static final String SERVICE_CONFIG_VERSION_NOTE_PROPERTY_ID = "service_config_version_note";
+ public static final String HOST_NAME_PROPERTY_ID = "host_name";
+ public static final String HOSTS_HOSTNAME_PROPERTY_ID = "hosts/host_name";
+ public static final String HOSTS_PROPERTY_ID = "hosts";
+ public static final String DESIRED_CONFIGS_PROPERTY_ID = "desired_configs";
+ public static final String VERSION_TAGS_PROPERTY_ID = "version_tags";
+
+ public static final String CLUSTER_NAME = PropertyHelper.getPropertyId(CONFIG_GROUP, CLUSTER_NAME_PROPERTY_ID);
+ public static final String ID = PropertyHelper.getPropertyId(CONFIG_GROUP, ID_PROPERTY_ID);
+ public static final String GROUP_NAME = PropertyHelper.getPropertyId(CONFIG_GROUP, GROUP_NAME_PROPERTY_ID);
+ public static final String TAG = PropertyHelper.getPropertyId(CONFIG_GROUP, TAG_PROPERTY_ID);
++ public static final String SERVICE_GROUP_NAME = PropertyHelper.getPropertyId(CONFIG_GROUP, SERVICE_GROUP_NAME_PROPERTY_ID);
+ public static final String SERVICE_NAME = PropertyHelper.getPropertyId(CONFIG_GROUP, SERVICE_NAME_PROPERTY_ID);
+ public static final String DESCRIPTION = PropertyHelper.getPropertyId(CONFIG_GROUP, DESCRIPTION_PROPERTY_ID);
+ public static final String SERVICE_CONFIG_VERSION_NOTE = PropertyHelper
+ .getPropertyId(CONFIG_GROUP, SERVICE_CONFIG_VERSION_NOTE_PROPERTY_ID);
+ public static final String HOST_NAME = PropertyHelper.getPropertyId(null, HOST_NAME_PROPERTY_ID);
+ public static final String HOSTS_HOST_NAME = PropertyHelper.getPropertyId(CONFIG_GROUP, HOSTS_HOSTNAME_PROPERTY_ID);
+ public static final String HOSTS = PropertyHelper.getPropertyId(CONFIG_GROUP, HOSTS_PROPERTY_ID);
+ public static final String DESIRED_CONFIGS = PropertyHelper.getPropertyId(CONFIG_GROUP, DESIRED_CONFIGS_PROPERTY_ID);
+ public static final String VERSION_TAGS = PropertyHelper.getPropertyId(CONFIG_GROUP, VERSION_TAGS_PROPERTY_ID);
/**
* The key property ids for a ConfigGroup resource.
@@@ -775,12 -788,11 +793,12 @@@
ConfigGroupRequest request = new ConfigGroupRequest(
groupId,
- (String) properties.get(CONFIGGROUP_CLUSTER_NAME_PROPERTY_ID),
- (String) properties.get(CONFIGGROUP_NAME_PROPERTY_ID),
- (String) properties.get(CONFIGGROUP_TAG_PROPERTY_ID),
- (String) properties.get(CONFIGGROUP_SERVICEGROUPNAME_PROPERTY_ID),
- (String) properties.get(CONFIGGROUP_SERVICENAME_PROPERTY_ID),
- (String) properties.get(CONFIGGROUP_DESC_PROPERTY_ID),
+ (String) properties.get(CLUSTER_NAME),
+ (String) properties.get(GROUP_NAME),
+ (String) properties.get(TAG),
++ (String) properties.get(SERVICE_GROUP_NAME),
+ (String) properties.get(SERVICE_NAME),
+ (String) properties.get(DESCRIPTION),
null,
null);
diff --cc ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigurationResourceProvider.java
index 3ff6c17,c924a62..47bc5bd
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigurationResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigurationResourceProvider.java
@@@ -59,20 -52,25 +59,34 @@@ public class ConfigurationResourceProvi
private static final Pattern PROPERTIES_ATTRIBUTES_PATTERN = Pattern.compile("^"
+ PROPERTIES_ATTRIBUTES_REGEX);
+ public static final String CONFIG = "Config";
+
+ public static final String CLUSTER_NAME_PROPERTY_ID = "cluster_name";
++ public static final String SERVICE_GROUP_NAME_PROPERTY_ID = "service_group_name";
++ public static final String SERVICE_GROUP_ID_PROPERTY_ID = "service_group_id";
++ public static final String SERVICE_NAME_PROPERTY_ID = "service_name";
++ public static final String SERVICE_ID_PROPERTY_ID = "service_id";
+ public static final String STACK_ID_PROPERTY_ID = "stack_id";
+ public static final String TYPE_PROPERTY_ID = "type";
+ public static final String TAG_PROPERTY_ID = "tag";
+ public static final String VERSION_PROPERTY_ID = "version";
+ public static final String PROPERTIES_PROPERTY_ID = "properties";
+ public static final String PROPERTIES_ATTRIBUTES_PROPERTY_ID = "properties_attributes";
+
// ----- Property ID constants ---------------------------------------------
- protected static final String CONFIGURATION_CLUSTER_NAME_PROPERTY_ID = PropertyHelper.getPropertyId("Config", "cluster_name");
- protected static final String CONFIGURATION_STACK_ID_PROPERTY_ID = PropertyHelper.getPropertyId("Config", "stack_id");
+ public static final String CLUSTER_NAME = CONFIG + PropertyHelper.EXTERNAL_PATH_SEP + CLUSTER_NAME_PROPERTY_ID;
+ public static final String STACK_ID = CONFIG + PropertyHelper.EXTERNAL_PATH_SEP + STACK_ID_PROPERTY_ID;
+
++ public static final String SERVICE_GROUP_NAME = CONFIG + PropertyHelper.EXTERNAL_PATH_SEP + SERVICE_GROUP_NAME_PROPERTY_ID;
++ public static final String SERVICE_GROUP_ID = CONFIG + PropertyHelper.EXTERNAL_PATH_SEP + SERVICE_GROUP_ID_PROPERTY_ID;
++ public static final String SERVICE_NAME = CONFIG + PropertyHelper.EXTERNAL_PATH_SEP + SERVICE_NAME_PROPERTY_ID;
++ public static final String SERVICE_ID = CONFIG + PropertyHelper.EXTERNAL_PATH_SEP + SERVICE_ID_PROPERTY_ID;
+
// !!! values are part of query strings and body post, so they
// don't have defined categories (like Config)
- public static final String CONFIGURATION_CONFIG_TYPE_PROPERTY_ID = PropertyHelper.getPropertyId(null, "type");
- public static final String CONFIGURATION_CONFIG_TAG_PROPERTY_ID = PropertyHelper.getPropertyId(null, "tag");
- public static final String CONFIGURATION_CONFIG_VERSION_PROPERTY_ID = PropertyHelper.getPropertyId(null, "version");
- public static final String CONFIGURATION_SERVICE_NAME_PROPERTY_ID = PropertyHelper.getPropertyId(null, "service_name");
- public static final String CONFIGURATION_SERVICE_GROUP_NAME_PROPERTY_ID = PropertyHelper.getPropertyId(null, "service_group_name");
- public static final String CONFIGURATION_SERVICE_ID_PROPERTY_ID = PropertyHelper.getPropertyId("Config", "service_id");
- public static final String CONFIGURATION_SERVICE_GROUP_ID_PROPERTY_ID = PropertyHelper.getPropertyId("Config", "service_group_id");
-
+ public static final String TYPE = PropertyHelper.getPropertyId(null, TYPE_PROPERTY_ID);
+ public static final String TAG = PropertyHelper.getPropertyId(null, TAG_PROPERTY_ID);
+ public static final String VERSION = PropertyHelper.getPropertyId(null, VERSION_PROPERTY_ID);
/**
* The property ids for a configuration resource.
@@@ -90,30 -84,24 +104,28 @@@
static {
// properties
- PROPERTY_IDS.add(CONFIGURATION_CLUSTER_NAME_PROPERTY_ID);
- PROPERTY_IDS.add(CONFIGURATION_STACK_ID_PROPERTY_ID);
- PROPERTY_IDS.add(CONFIGURATION_CONFIG_TYPE_PROPERTY_ID);
- PROPERTY_IDS.add(CONFIGURATION_CONFIG_TAG_PROPERTY_ID);
- PROPERTY_IDS.add(CONFIGURATION_CONFIG_VERSION_PROPERTY_ID);
- PROPERTY_IDS.add(CONFIGURATION_SERVICE_NAME_PROPERTY_ID);
- PROPERTY_IDS.add(CONFIGURATION_SERVICE_GROUP_NAME_PROPERTY_ID);
- PROPERTY_IDS.add(CONFIGURATION_SERVICE_ID_PROPERTY_ID);
- PROPERTY_IDS.add(CONFIGURATION_SERVICE_GROUP_ID_PROPERTY_ID);
+ PROPERTY_IDS.add(CLUSTER_NAME);
+ PROPERTY_IDS.add(STACK_ID);
+ PROPERTY_IDS.add(TYPE);
+ PROPERTY_IDS.add(TAG);
+ PROPERTY_IDS.add(VERSION);
++ PROPERTY_IDS.add(SERVICE_NAME);
++ PROPERTY_IDS.add(SERVICE_GROUP_NAME);
++ PROPERTY_IDS.add(SERVICE_ID);
++ PROPERTY_IDS.add(SERVICE_GROUP_ID);
// keys
- KEY_PROPERTY_IDS.put(Resource.Type.Configuration,CONFIGURATION_CONFIG_TYPE_PROPERTY_ID);
- KEY_PROPERTY_IDS.put(Resource.Type.Cluster,CONFIGURATION_CLUSTER_NAME_PROPERTY_ID);
- KEY_PROPERTY_IDS.put(Resource.Type.Service,CONFIGURATION_SERVICE_NAME_PROPERTY_ID);
- KEY_PROPERTY_IDS.put(Resource.Type.ServiceGroup,CONFIGURATION_SERVICE_GROUP_NAME_PROPERTY_ID);
- KEY_PROPERTY_IDS.put(Resource.Type.Configuration, TYPE);
- KEY_PROPERTY_IDS.put(Resource.Type.Cluster, CLUSTER_NAME);
++ KEY_PROPERTY_IDS.put(Resource.Type.Configuration,TYPE);
++ KEY_PROPERTY_IDS.put(Resource.Type.Cluster,CLUSTER_NAME);
++ KEY_PROPERTY_IDS.put(Resource.Type.Service,SERVICE_NAME);
++ KEY_PROPERTY_IDS.put(Resource.Type.ServiceGroup,SERVICE_GROUP_NAME);
}
/**
* The primary key property ids for the configuration resource type.
*/
private static Set<String> pkPropertyIds =
-- new HashSet<>(Arrays.asList(new String[]{
- CONFIGURATION_CLUSTER_NAME_PROPERTY_ID,
- CONFIGURATION_CONFIG_TYPE_PROPERTY_ID, CONFIGURATION_SERVICE_GROUP_NAME_PROPERTY_ID, CONFIGURATION_SERVICE_NAME_PROPERTY_ID}));
- CLUSTER_NAME,
- TYPE}));
++ new HashSet<>(Arrays.asList(new String[]{ CLUSTER_NAME, SERVICE_GROUP_NAME, SERVICE_NAME, TYPE}));
// ----- Constructors ------------------------------------------------------
@@@ -143,23 -131,10 +155,23 @@@
ResourceAlreadyExistsException,
NoSuchParentResourceException {
+ Set<Resource> associatedResources = new HashSet<>();
+
for (Map<String, Object> map : request.getProperties()) {
- String cluster = (String) map.get(CONFIGURATION_CLUSTER_NAME_PROPERTY_ID);
- String type = (String) map.get(CONFIGURATION_CONFIG_TYPE_PROPERTY_ID);
- String tag = (String) map.get(CONFIGURATION_CONFIG_TAG_PROPERTY_ID);
+ String cluster = (String) map.get(CLUSTER_NAME);
+ String type = (String) map.get(TYPE);
- String tag = (String) map.get(TAG);
++ String tag = (String) map.get(TAG);
+ String serviceName = null;
+ String serviceGroupName = null;
+ Long serviceId = null;
+ Long serviceGroupId = null;
- if (map.containsKey(CONFIGURATION_SERVICE_NAME_PROPERTY_ID) && map.containsKey(CONFIGURATION_SERVICE_GROUP_NAME_PROPERTY_ID)) {
- serviceName = (String) map.get(CONFIGURATION_SERVICE_NAME_PROPERTY_ID);
- serviceGroupName = (String) map.get(CONFIGURATION_SERVICE_GROUP_NAME_PROPERTY_ID);
++ if (map.containsKey(SERVICE_NAME) && map.containsKey(SERVICE_GROUP_NAME)) {
++ serviceName = (String) map.get(SERVICE_NAME);
++ serviceGroupName = (String) map.get(SERVICE_GROUP_NAME);
+ ClusterServiceEntity clusterServiceEntity = clusterServiceDAO.findByName(cluster, serviceGroupName, serviceName);
+ serviceId = clusterServiceEntity.getServiceId();
+ serviceGroupId = clusterServiceEntity.getServiceGroupId();
+ }
Map<String, String> configMap = new HashMap<>();
Map<String, Map<String, String>> configAttributesMap = null;
@@@ -195,25 -170,8 +207,25 @@@
}
});
+ if (configurationResponse != null) {
+ Resource resource = new ResourceImpl(Resource.Type.Configuration);
- resource.setProperty(CONFIGURATION_CLUSTER_NAME_PROPERTY_ID, configurationResponse.getClusterName());
- resource.setProperty(CONFIGURATION_STACK_ID_PROPERTY_ID, configurationResponse.getStackId().getStackId());
- resource.setProperty(CONFIGURATION_CONFIG_TYPE_PROPERTY_ID, configurationResponse.getType());
- resource.setProperty(CONFIGURATION_CONFIG_TAG_PROPERTY_ID, configurationResponse.getVersionTag());
- resource.setProperty(CONFIGURATION_CONFIG_VERSION_PROPERTY_ID, configurationResponse.getVersion());
++ resource.setProperty(CLUSTER_NAME, configurationResponse.getClusterName());
++ resource.setProperty(STACK_ID, configurationResponse.getStackId().getStackId());
++ resource.setProperty(TYPE, configurationResponse.getType());
++ resource.setProperty(TAG, configurationResponse.getVersionTag());
++ resource.setProperty(VERSION, configurationResponse.getVersion());
+ if (configurationResponse.getServiceId() != null) {
- resource.setProperty(CONFIGURATION_SERVICE_GROUP_NAME_PROPERTY_ID, serviceGroupName);
- resource.setProperty(CONFIGURATION_SERVICE_NAME_PROPERTY_ID, serviceName);
- resource.setProperty(CONFIGURATION_SERVICE_ID_PROPERTY_ID, serviceId);
- resource.setProperty(CONFIGURATION_SERVICE_GROUP_ID_PROPERTY_ID, serviceGroupId);
++ resource.setProperty(SERVICE_GROUP_NAME, serviceGroupName);
++ resource.setProperty(SERVICE_NAME, serviceName);
++ resource.setProperty(SERVICE_ID, serviceId);
++ resource.setProperty(SERVICE_GROUP_ID, serviceGroupId);
+ }
+ associatedResources.add(resource);
+ }
}
- return getRequestStatus(null);
+ return getRequestStatus(null, associatedResources);
+
+
}
@Override
@@@ -221,16 -179,9 +233,16 @@@
throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
final Set<ConfigurationRequest> requests = new HashSet<>();
+ String serviceName = null;
+ String serviceGroupName = null;
for (Map<String, Object> propertyMap : getPropertyMaps(predicate)) {
- requests.add(getRequest(request, propertyMap));
+ ConfigurationRequest configurationRequest = getRequest(request, propertyMap);
+ if (configurationRequest.getServiceId() != null) {
- serviceGroupName = (String) propertyMap.get(CONFIGURATION_SERVICE_GROUP_NAME_PROPERTY_ID);
- serviceName = (String) propertyMap.get(CONFIGURATION_SERVICE_NAME_PROPERTY_ID);
++ serviceGroupName = (String) propertyMap.get(SERVICE_GROUP_NAME);
++ serviceName = (String) propertyMap.get(SERVICE_NAME);
+ }
+ requests.add(configurationRequest);
}
Set<ConfigurationResponse> responses = getResources(new Command<Set<ConfigurationResponse>>() {
@@@ -246,17 -197,11 +258,17 @@@
String stackId = response.getStackId().getStackId();
Resource resource = new ResourceImpl(Resource.Type.Configuration);
- resource.setProperty(CONFIGURATION_CLUSTER_NAME_PROPERTY_ID, response.getClusterName());
- resource.setProperty(CONFIGURATION_STACK_ID_PROPERTY_ID, stackId);
- resource.setProperty(CONFIGURATION_CONFIG_TYPE_PROPERTY_ID, response.getType());
- resource.setProperty(CONFIGURATION_CONFIG_TAG_PROPERTY_ID, response.getVersionTag());
- resource.setProperty(CONFIGURATION_CONFIG_VERSION_PROPERTY_ID, response.getVersion());
+ resource.setProperty(CLUSTER_NAME, response.getClusterName());
+ resource.setProperty(STACK_ID, stackId);
+ resource.setProperty(TYPE, response.getType());
+ resource.setProperty(TAG, response.getVersionTag());
+ resource.setProperty(VERSION, response.getVersion());
+ if (response.getServiceId() != null) {
- resource.setProperty(CONFIGURATION_SERVICE_GROUP_NAME_PROPERTY_ID, serviceGroupName );
- resource.setProperty(CONFIGURATION_SERVICE_NAME_PROPERTY_ID, serviceName );
- resource.setProperty(CONFIGURATION_SERVICE_ID_PROPERTY_ID, response.getServiceId());
- resource.setProperty(CONFIGURATION_SERVICE_GROUP_ID_PROPERTY_ID, response.getServiceGroupId());
++ resource.setProperty(SERVICE_GROUP_NAME, serviceGroupName );
++ resource.setProperty(SERVICE_NAME, serviceName );
++ resource.setProperty(SERVICE_ID, response.getServiceId());
++ resource.setProperty(SERVICE_GROUP_ID, response.getServiceGroupId());
+ }
if (null != response.getConfigs() && response.getConfigs().size() > 0) {
Map<String, String> configs = response.getConfigs();
@@@ -343,24 -288,12 +355,24 @@@
* @return a configuration request
*/
private ConfigurationRequest getRequest(Request request, Map<String, Object> properties) {
- String type = (String) properties.get(CONFIGURATION_CONFIG_TYPE_PROPERTY_ID);
- String tag = (String) properties.get(CONFIGURATION_CONFIG_TAG_PROPERTY_ID);
- String cluster = (String) properties.get(CONFIGURATION_CLUSTER_NAME_PROPERTY_ID);
+ String type = (String) properties.get(TYPE);
+ String tag = (String) properties.get(TAG);
++ String cluster = (String) properties.get(CLUSTER_NAME);
+ String serviceName = null;
+ String serviceGroupName = null;
+ Long serviceId = null;
+ Long serviceGroupId = null;
- if (properties.containsKey(CONFIGURATION_SERVICE_NAME_PROPERTY_ID) && properties.containsKey(CONFIGURATION_SERVICE_GROUP_NAME_PROPERTY_ID)) {
- serviceName = (String) properties.get(CONFIGURATION_SERVICE_NAME_PROPERTY_ID);
- serviceGroupName = (String) properties.get(CONFIGURATION_SERVICE_GROUP_NAME_PROPERTY_ID);
++ if (properties.containsKey(SERVICE_NAME) && properties.containsKey(SERVICE_GROUP_NAME)) {
++ serviceName = (String) properties.get(SERVICE_NAME);
++ serviceGroupName = (String) properties.get(SERVICE_GROUP_NAME);
+ ClusterServiceEntity clusterServiceEntity = clusterServiceDAO.findByName(cluster, serviceGroupName, serviceName);
+ serviceId = clusterServiceEntity.getServiceId();
+ serviceGroupId = clusterServiceEntity.getServiceGroupId();
+ }
ConfigurationRequest configRequest = new ConfigurationRequest(
- (String) properties.get(CONFIGURATION_CLUSTER_NAME_PROPERTY_ID),
+ (String) properties.get(CLUSTER_NAME),
- type, tag, new HashMap<>(), new HashMap<>());
+ type, tag, new HashMap<>(), new HashMap<>(), serviceId, serviceGroupId);
Set<String> requestedIds = request.getPropertyIds();
if (requestedIds.contains("properties") || requestedIds.contains("*")) {
diff --cc ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ExportBlueprintRequest.java
index 48e4767,16d3114..5bda663
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ExportBlueprintRequest.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ExportBlueprintRequest.java
@@@ -259,14 -280,8 +259,14 @@@ public class ExportBlueprintRequest imp
public ExportedHostGroup(TreeNode<Resource> host) {
TreeNode<Resource> components = host.getChild("host_components");
for (TreeNode<Resource> component : components.getChildren()) {
- getComponents().add((String) component.getObject().getPropertyValue(
- "HostRoles/component_name"));
+ Resource resource = component.getObject();
+ String componentName =
- String.valueOf(resource.getPropertyValue(HostComponentResourceProvider.HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID));
++ String.valueOf(resource.getPropertyValue(HostComponentResourceProvider.COMPONENT_NAME));
+ String serviceName =
- String.valueOf(resource.getPropertyValue(HostComponentResourceProvider.HOST_COMPONENT_SERVICE_NAME_PROPERTY_ID));
++ String.valueOf(resource.getPropertyValue(HostComponentResourceProvider.SERVICE_NAME));
+ String serviceGroupName =
- String.valueOf(resource.getPropertyValue(HostComponentResourceProvider.HOST_COMPONENT_SERVICE_GROUP_NAME_PROPERTY_ID));
++ String.valueOf(resource.getPropertyValue(HostComponentResourceProvider.SERVICE_GROUP_NAME));
+ getComponents().add(new Component(componentName, serviceGroupName, serviceName, null));
}
addAmbariComponentIfLocalhost((String) host.getObject().getPropertyValue(
PropertyHelper.getPropertyId("Hosts", "host_name")));
diff --cc ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
index fa1e11a,96197c0..3dab4c8
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
@@@ -87,32 -84,52 +88,68 @@@ public class HostComponentResourceProvi
// ----- Property ID constants ---------------------------------------------
+ // Host Components
- public static final String HOST_COMPONENT_CLUSTER_ID_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "cluster_id";
- public static final String HOST_COMPONENT_CLUSTER_NAME_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "cluster_name";
- public static final String HOST_COMPONENT_SERVICE_GROUP_ID_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "service_group_id";
- public static final String HOST_COMPONENT_SERVICE_GROUP_NAME_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "service_group_name";
- public static final String HOST_COMPONENT_SERVICE_ID_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "service_id";
- public static final String HOST_COMPONENT_SERVICE_NAME_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "service_name";
- public static final String HOST_COMPONENT_SERVICE_TYPE_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "service_type";
- public static final String HOST_COMPONENT_HOST_COMPONENT_ID_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "id";
- public static final String HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "component_name";
- public static final String HOST_COMPONENT_COMPONENT_TYPE_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "component_type";
- public static final String HOST_COMPONENT_DISPLAY_NAME_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "display_name";
- public static final String HOST_COMPONENT_HOST_NAME_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "host_name";
- public static final String HOST_COMPONENT_PUBLIC_HOST_NAME_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "public_host_name";
- public static final String HOST_COMPONENT_STATE_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "state";
- public static final String HOST_COMPONENT_DESIRED_STATE_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "desired_state";
- public static final String HOST_COMPONENT_VERSION_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "version";
- public static final String HOST_COMPONENT_DESIRED_STACK_ID_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "desired_stack_id";
- public static final String HOST_COMPONENT_ACTUAL_CONFIGS_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "actual_configs";
- public static final String HOST_COMPONENT_STALE_CONFIGS_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "stale_configs";
- public static final String HOST_COMPONENT_RELOAD_CONFIGS_PROPERTY_ID = PropertyHelper.getPropertyId("HostRoles", "reload_configs");
- public static final String HOST_COMPONENT_DESIRED_ADMIN_STATE_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "desired_admin_state";
- public static final String HOST_COMPONENT_MAINTENANCE_STATE_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "maintenance_state";
- public static final String HOST_COMPONENT_UPGRADE_STATE_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + "upgrade_state";
- public static final String HOST_COMPONENT_ROLE_ID
- = PropertyHelper.getPropertyId("HostRoles", "role_id");
++
+ public static final String HOST_ROLES = "HostRoles";
+ public static final String HOST = "host";
+ public static final String SERVICE_COMPONENT_INFO = "ServiceComponentInfo";
+
++ public static final String ID_PROPERTY_ID = "id";
+ public static final String ROLE_ID_PROPERTY_ID = "role_id";
++ public static final String CLUSTER_ID_PROPERTY_ID = "cluster_id";
+ public static final String CLUSTER_NAME_PROPERTY_ID = "cluster_name";
++ public static final String SERVICE_GROUP_ID_PROPERTY_ID = "service_group_id";
++ public static final String SERVICE_GROUP_NAME_PROPERTY_ID = "service_group_name";
++ public static final String SERVICE_ID_PROPERTY_ID = "service_id";
+ public static final String SERVICE_NAME_PROPERTY_ID = "service_name";
++ public static final String SERVICE_TYPE_PROPERTY_ID = "service_type";
+ public static final String COMPONENT_NAME_PROPERTY_ID = "component_name";
++ public static final String COMPONENT_TYPE_PROPERTY_ID = "component_type";
+ public static final String DISPLAY_NAME_PROPERTY_ID = "display_name";
+ public static final String HOST_NAME_PROPERTY_ID = "host_name";
+ public static final String PUBLIC_HOST_NAME_PROPERTY_ID = "public_host_name";
+ public static final String STATE_PROPERTY_ID = "state";
+ public static final String DESIRED_STATE_PROPERTY_ID = "desired_state";
+ public static final String VERSION_PROPERTY_ID = "version";
+ public static final String DESIRED_STACK_ID_PROPERTY_ID = "desired_stack_id";
+ public static final String DESIRED_REPOSITORY_VERSION_PROPERTY_ID = "desired_repository_version";
+ public static final String ACTUAL_CONFIGS_PROPERTY_ID = "actual_configs";
+ public static final String STALE_CONFIGS_PROPERTY_ID = "stale_configs";
+ public static final String RELOAD_CONFIGS_PROPERTY_ID = "reload_configs";
+ public static final String DESIRED_ADMIN_STATE_PROPERTY_ID = "desired_admin_state";
+ public static final String MAINTENANCE_STATE_PROPERTY_ID = "maintenance_state";
+ public static final String UPGRADE_STATE_PROPERTY_ID = "upgrade_state";
+ public static final String HOST_PROPERTY_ID = "host";
+ public static final String HREF_PROPERTY_ID = "href";
+ public static final String COMPONENT_PROPERTY_ID = "component";
+ public static final String METRICS_PROPERTY_ID = "metrics";
+ public static final String PROCESSES_PROPERTY_ID = "processes";
+
++ public static final String ID = PropertyHelper.getPropertyId(HOST_ROLES, ID_PROPERTY_ID);
+ public static final String ROLE_ID = PropertyHelper.getPropertyId(HOST_ROLES, ROLE_ID_PROPERTY_ID);
++ public static final String CLUSTER_ID = PropertyHelper.getPropertyId(HOST_ROLES, CLUSTER_ID_PROPERTY_ID);
+ public static final String CLUSTER_NAME = PropertyHelper.getPropertyId(HOST_ROLES, CLUSTER_NAME_PROPERTY_ID);
++ public static final String SERVICE_GROUP_ID = PropertyHelper.getPropertyId(HOST_ROLES, SERVICE_GROUP_ID_PROPERTY_ID);
++ public static final String SERVICE_GROUP_NAME = PropertyHelper.getPropertyId(HOST_ROLES, SERVICE_GROUP_NAME_PROPERTY_ID);
++ public static final String SERVICE_ID = PropertyHelper.getPropertyId(HOST_ROLES, SERVICE_ID_PROPERTY_ID);
+ public static final String SERVICE_NAME = PropertyHelper.getPropertyId(HOST_ROLES, SERVICE_NAME_PROPERTY_ID);
++ public static final String SERVICE_TYPE = PropertyHelper.getPropertyId(HOST_ROLES, SERVICE_TYPE_PROPERTY_ID);
+ public static final String COMPONENT_NAME = PropertyHelper.getPropertyId(HOST_ROLES, COMPONENT_NAME_PROPERTY_ID);
++ public static final String COMPONENT_TYPE = PropertyHelper.getPropertyId(HOST_ROLES, COMPONENT_TYPE_PROPERTY_ID);
+ public static final String DISPLAY_NAME = PropertyHelper.getPropertyId(HOST_ROLES, DISPLAY_NAME_PROPERTY_ID);
+ public static final String HOST_NAME = PropertyHelper.getPropertyId(HOST_ROLES, HOST_NAME_PROPERTY_ID);
+ public static final String PUBLIC_HOST_NAME = PropertyHelper.getPropertyId(HOST_ROLES, PUBLIC_HOST_NAME_PROPERTY_ID);
+ public static final String STATE = PropertyHelper.getPropertyId(HOST_ROLES, STATE_PROPERTY_ID);
+ public static final String DESIRED_STATE = PropertyHelper.getPropertyId(HOST_ROLES, DESIRED_STATE_PROPERTY_ID);
+ public static final String VERSION = PropertyHelper.getPropertyId(HOST_ROLES, VERSION_PROPERTY_ID);
+ public static final String DESIRED_STACK_ID = PropertyHelper.getPropertyId(HOST_ROLES, DESIRED_STACK_ID_PROPERTY_ID);
+ public static final String DESIRED_REPOSITORY_VERSION = PropertyHelper.getPropertyId(HOST_ROLES, DESIRED_REPOSITORY_VERSION_PROPERTY_ID);
+ public static final String ACTUAL_CONFIGS = PropertyHelper.getPropertyId(HOST_ROLES, ACTUAL_CONFIGS_PROPERTY_ID);
+ public static final String STALE_CONFIGS = PropertyHelper.getPropertyId(HOST_ROLES, STALE_CONFIGS_PROPERTY_ID);
+ public static final String RELOAD_CONFIGS = PropertyHelper.getPropertyId(HOST_ROLES, RELOAD_CONFIGS_PROPERTY_ID);
+ public static final String DESIRED_ADMIN_STATE = PropertyHelper.getPropertyId(HOST_ROLES, DESIRED_ADMIN_STATE_PROPERTY_ID);
+ public static final String MAINTENANCE_STATE = PropertyHelper.getPropertyId(HOST_ROLES, MAINTENANCE_STATE_PROPERTY_ID);
+ public static final String UPGRADE_STATE = PropertyHelper.getPropertyId(HOST_ROLES, UPGRADE_STATE_PROPERTY_ID);
//Parameters from the predicate
private static final String QUERY_PARAMETERS_RUN_SMOKE_TEST_ID = "params/run_smoke_test";
@@@ -121,38 -138,34 +158,42 @@@
* The key property ids for a HostComponent resource.
*/
public static Map<Resource.Type, String> keyPropertyIds = ImmutableMap.<Resource.Type, String>builder()
- .put(Resource.Type.Cluster, HOST_COMPONENT_CLUSTER_NAME_PROPERTY_ID)
- .put(Resource.Type.Host, HOST_COMPONENT_HOST_NAME_PROPERTY_ID)
- .put(Resource.Type.HostComponent, HOST_COMPONENT_HOST_COMPONENT_ID_PROPERTY_ID)
- .put(Resource.Type.Component, HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID)
- .put(Resource.Type.Service, HOST_COMPONENT_SERVICE_NAME_PROPERTY_ID)
- .put(Resource.Type.ServiceGroup, HOST_COMPONENT_SERVICE_GROUP_NAME_PROPERTY_ID)
+ .put(Resource.Type.Cluster, CLUSTER_NAME)
+ .put(Resource.Type.Host, HOST_NAME)
- .put(Resource.Type.HostComponent, COMPONENT_NAME)
++ .put(Resource.Type.HostComponent, ID)
+ .put(Resource.Type.Component, COMPONENT_NAME)
++ .put(Resource.Type.Service, SERVICE_NAME)
++ .put(Resource.Type.ServiceGroup, SERVICE_GROUP_NAME)
.build();
/**
* The property ids for a HostComponent resource.
*/
protected static Set<String> propertyIds = Sets.newHashSet(
- HOST_COMPONENT_ROLE_ID,
- HOST_COMPONENT_CLUSTER_NAME_PROPERTY_ID,
- HOST_COMPONENT_SERVICE_GROUP_NAME_PROPERTY_ID,
- HOST_COMPONENT_SERVICE_NAME_PROPERTY_ID,
- HOST_COMPONENT_HOST_COMPONENT_ID_PROPERTY_ID,
- HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID,
- HOST_COMPONENT_COMPONENT_TYPE_PROPERTY_ID,
- HOST_COMPONENT_DISPLAY_NAME_PROPERTY_ID,
- HOST_COMPONENT_HOST_NAME_PROPERTY_ID,
- HOST_COMPONENT_PUBLIC_HOST_NAME_PROPERTY_ID,
- HOST_COMPONENT_STATE_PROPERTY_ID,
- HOST_COMPONENT_DESIRED_STATE_PROPERTY_ID,
- HOST_COMPONENT_VERSION_PROPERTY_ID,
- HOST_COMPONENT_DESIRED_STACK_ID_PROPERTY_ID,
- HOST_COMPONENT_ACTUAL_CONFIGS_PROPERTY_ID,
- HOST_COMPONENT_STALE_CONFIGS_PROPERTY_ID,
- HOST_COMPONENT_RELOAD_CONFIGS_PROPERTY_ID,
- HOST_COMPONENT_DESIRED_ADMIN_STATE_PROPERTY_ID,
- HOST_COMPONENT_MAINTENANCE_STATE_PROPERTY_ID,
- HOST_COMPONENT_UPGRADE_STATE_PROPERTY_ID,
++ ID,
+ ROLE_ID,
+ CLUSTER_NAME,
++ CLUSTER_ID,
++ SERVICE_GROUP_NAME,
++ SERVICE_GROUP_ID,
+ SERVICE_NAME,
++ SERVICE_TYPE,
++ SERVICE_ID,
+ COMPONENT_NAME,
++ COMPONENT_TYPE,
+ DISPLAY_NAME,
+ HOST_NAME,
+ PUBLIC_HOST_NAME,
+ STATE,
+ DESIRED_STATE,
+ VERSION,
+ DESIRED_STACK_ID,
- DESIRED_REPOSITORY_VERSION,
+ ACTUAL_CONFIGS,
+ STALE_CONFIGS,
+ RELOAD_CONFIGS,
+ DESIRED_ADMIN_STATE,
+ MAINTENANCE_STATE,
+ UPGRADE_STATE,
QUERY_PARAMETERS_RUN_SMOKE_TEST_ID);
/**
@@@ -199,39 -215,8 +240,39 @@@
}
});
- notifyCreate(Resource.Type.HostComponent, request);
-
+ Set<Resource> associatedResources = new HashSet<>();
+ if (createSvcHostCmpnt != null) {
+ Iterator<ServiceComponentHostResponse> itr = createSvcHostCmpnt.iterator();
+ while (itr.hasNext()) {
+ ServiceComponentHostResponse response = itr.next();
+ notifyCreate(Resource.Type.HostComponent, request);
+ Resource resource = new ResourceImpl(Resource.Type.HostComponent);
- resource.setProperty(HOST_COMPONENT_CLUSTER_ID_PROPERTY_ID, response.getClusterId());
- resource.setProperty(HOST_COMPONENT_CLUSTER_NAME_PROPERTY_ID, response.getClusterName());
- resource.setProperty(HOST_COMPONENT_SERVICE_GROUP_ID_PROPERTY_ID, response.getServiceGroupId());
- resource.setProperty(HOST_COMPONENT_SERVICE_GROUP_NAME_PROPERTY_ID, response.getServiceGroupName());
- resource.setProperty(HOST_COMPONENT_SERVICE_ID_PROPERTY_ID, response.getServiceId());
- resource.setProperty(HOST_COMPONENT_SERVICE_NAME_PROPERTY_ID, response.getServiceName());
- resource.setProperty(HOST_COMPONENT_SERVICE_TYPE_PROPERTY_ID, response.getServiceType());
- resource.setProperty(HOST_COMPONENT_HOST_COMPONENT_ID_PROPERTY_ID, response.getHostComponentId());
- resource.setProperty(HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID, response.getComponentName());
- resource.setProperty(HOST_COMPONENT_COMPONENT_TYPE_PROPERTY_ID, response.getComponentType());
- resource.setProperty(HOST_COMPONENT_DISPLAY_NAME_PROPERTY_ID, response.getDisplayName());
- resource.setProperty(HOST_COMPONENT_HOST_NAME_PROPERTY_ID, response.getHostname());
- resource.setProperty(HOST_COMPONENT_PUBLIC_HOST_NAME_PROPERTY_ID, response.getPublicHostname());
- resource.setProperty(HOST_COMPONENT_STATE_PROPERTY_ID, response.getLiveState());
- resource.setProperty(HOST_COMPONENT_VERSION_PROPERTY_ID, response.getVersion());
- resource.setProperty(HOST_COMPONENT_DESIRED_STACK_ID_PROPERTY_ID, response.getDesiredStackVersion());
- resource.setProperty(HOST_COMPONENT_ACTUAL_CONFIGS_PROPERTY_ID, response.getActualConfigs());
- resource.setProperty(HOST_COMPONENT_STALE_CONFIGS_PROPERTY_ID, response.isStaleConfig());
- resource.setProperty(HOST_COMPONENT_DESIRED_ADMIN_STATE_PROPERTY_ID, response.getAdminState());
- resource.setProperty(HOST_COMPONENT_MAINTENANCE_STATE_PROPERTY_ID, response.getMaintenanceState());
- resource.setProperty(HOST_COMPONENT_UPGRADE_STATE_PROPERTY_ID, response.getUpgradeState());
++ resource.setProperty(CLUSTER_ID, response.getClusterId());
++ resource.setProperty(CLUSTER_NAME, response.getClusterName());
++ resource.setProperty(SERVICE_GROUP_ID, response.getServiceGroupId());
++ resource.setProperty(SERVICE_GROUP_NAME, response.getServiceGroupName());
++ resource.setProperty(SERVICE_ID, response.getServiceId());
++ resource.setProperty(SERVICE_NAME, response.getServiceName());
++ resource.setProperty(SERVICE_TYPE, response.getServiceType());
++ resource.setProperty(ID, response.getHostComponentId());
++ resource.setProperty(COMPONENT_NAME, response.getComponentName());
++ resource.setProperty(COMPONENT_TYPE, response.getComponentType());
++ resource.setProperty(DISPLAY_NAME, response.getDisplayName());
++ resource.setProperty(HOST_NAME, response.getHostname());
++ resource.setProperty(PUBLIC_HOST_NAME, response.getPublicHostname());
++ resource.setProperty(STATE, response.getLiveState());
++ resource.setProperty(VERSION, response.getVersion());
++ resource.setProperty(DESIRED_STACK_ID, response.getDesiredStackVersion());
++ resource.setProperty(ACTUAL_CONFIGS, response.getActualConfigs());
++ resource.setProperty(STALE_CONFIGS, response.isStaleConfig());
++ resource.setProperty(DESIRED_ADMIN_STATE, response.getAdminState());
++ resource.setProperty(MAINTENANCE_STATE, response.getMaintenanceState());
++ resource.setProperty(UPGRADE_STATE, response.getUpgradeState());
+
+ associatedResources.add(resource);
+ }
+ return getRequestStatus(null, associatedResources);
+ }
return getRequestStatus(null);
}
@@@ -265,30 -263,39 +306,30 @@@
for (ServiceComponentHostResponse response : responses) {
Resource resource = new ResourceImpl(Resource.Type.HostComponent);
- setResourceProperty(resource, HOST_COMPONENT_CLUSTER_NAME_PROPERTY_ID, response.getClusterName(), requestedIds);
- setResourceProperty(resource, HOST_COMPONENT_CLUSTER_ID_PROPERTY_ID, response.getClusterId(), requestedIds);
- setResourceProperty(resource, HOST_COMPONENT_SERVICE_GROUP_ID_PROPERTY_ID, response.getServiceGroupId(), requestedIds);
- setResourceProperty(resource, HOST_COMPONENT_SERVICE_GROUP_NAME_PROPERTY_ID, response.getServiceGroupName(), requestedIds);
- setResourceProperty(resource, HOST_COMPONENT_SERVICE_ID_PROPERTY_ID, response.getServiceId(), requestedIds);
- setResourceProperty(resource, HOST_COMPONENT_SERVICE_NAME_PROPERTY_ID, response.getServiceName(), requestedIds);
- setResourceProperty(resource, HOST_COMPONENT_SERVICE_TYPE_PROPERTY_ID, response.getServiceType(), requestedIds);
- setResourceProperty(resource, HOST_COMPONENT_HOST_COMPONENT_ID_PROPERTY_ID, response.getHostComponentId(), requestedIds);
- setResourceProperty(resource, HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID, response.getComponentName(), requestedIds);
- setResourceProperty(resource, HOST_COMPONENT_COMPONENT_TYPE_PROPERTY_ID, response.getComponentType(), requestedIds);
- setResourceProperty(resource, HOST_COMPONENT_DISPLAY_NAME_PROPERTY_ID, response.getDisplayName(), requestedIds);
- setResourceProperty(resource, HOST_COMPONENT_HOST_NAME_PROPERTY_ID, response.getHostname(), requestedIds);
- setResourceProperty(resource, HOST_COMPONENT_PUBLIC_HOST_NAME_PROPERTY_ID, response.getPublicHostname(), requestedIds);
- setResourceProperty(resource, HOST_COMPONENT_STATE_PROPERTY_ID, response.getLiveState(), requestedIds);
- setResourceProperty(resource, HOST_COMPONENT_DESIRED_STATE_PROPERTY_ID, response.getDesiredState(), requestedIds);
- setResourceProperty(resource, HOST_COMPONENT_VERSION_PROPERTY_ID, response.getVersion(), requestedIds);
- setResourceProperty(resource, HOST_COMPONENT_DESIRED_STACK_ID_PROPERTY_ID, response.getDesiredStackVersion(), requestedIds);
- setResourceProperty(resource, HOST_COMPONENT_ACTUAL_CONFIGS_PROPERTY_ID, response.getActualConfigs(), requestedIds);
- setResourceProperty(resource, HOST_COMPONENT_STALE_CONFIGS_PROPERTY_ID, response.isStaleConfig(), requestedIds);
- setResourceProperty(resource, HOST_COMPONENT_RELOAD_CONFIGS_PROPERTY_ID, response.isReloadConfig(), requestedIds);
- setResourceProperty(resource, HOST_COMPONENT_UPGRADE_STATE_PROPERTY_ID, response.getUpgradeState(), requestedIds);
- setResourceProperty(resource, CLUSTER_NAME,
- response.getClusterName(), requestedIds);
- setResourceProperty(resource, SERVICE_NAME,
- response.getServiceName(), requestedIds);
- setResourceProperty(resource, COMPONENT_NAME,
- response.getComponentName(), requestedIds);
- setResourceProperty(resource, DISPLAY_NAME,
- response.getDisplayName(), requestedIds);
- setResourceProperty(resource, HOST_NAME,
- response.getHostname(), requestedIds);
- setResourceProperty(resource, PUBLIC_HOST_NAME,
- response.getPublicHostname(), requestedIds);
- setResourceProperty(resource, STATE,
- response.getLiveState(), requestedIds);
- setResourceProperty(resource, DESIRED_STATE,
- response.getDesiredState(), requestedIds);
- setResourceProperty(resource, VERSION, response.getVersion(),
- requestedIds);
- setResourceProperty(resource, DESIRED_STACK_ID,
- response.getDesiredStackVersion(), requestedIds);
- setResourceProperty(resource, ACTUAL_CONFIGS,
- response.getActualConfigs(), requestedIds);
- setResourceProperty(resource, STALE_CONFIGS,
- response.isStaleConfig(), requestedIds);
- setResourceProperty(resource, RELOAD_CONFIGS,
- response.isReloadConfig(), requestedIds);
- setResourceProperty(resource, UPGRADE_STATE,
- response.getUpgradeState(), requestedIds);
- setResourceProperty(resource, DESIRED_REPOSITORY_VERSION,
- response.getDesiredRepositoryVersion(), requestedIds);
++ setResourceProperty(resource, CLUSTER_NAME, response.getClusterName(), requestedIds);
++ setResourceProperty(resource, CLUSTER_ID, response.getClusterId(), requestedIds);
++ setResourceProperty(resource, SERVICE_GROUP_ID, response.getServiceGroupId(), requestedIds);
++ setResourceProperty(resource, SERVICE_GROUP_NAME, response.getServiceGroupName(), requestedIds);
++ setResourceProperty(resource, SERVICE_ID, response.getServiceId(), requestedIds);
++ setResourceProperty(resource, SERVICE_NAME, response.getServiceName(), requestedIds);
++ setResourceProperty(resource, SERVICE_TYPE, response.getServiceType(), requestedIds);
++ setResourceProperty(resource, ID, response.getHostComponentId(), requestedIds);
++ setResourceProperty(resource, COMPONENT_NAME, response.getComponentName(), requestedIds);
++ setResourceProperty(resource, COMPONENT_TYPE, response.getComponentType(), requestedIds);
++ setResourceProperty(resource, DISPLAY_NAME, response.getDisplayName(), requestedIds);
++ setResourceProperty(resource, HOST_NAME, response.getHostname(), requestedIds);
++ setResourceProperty(resource, PUBLIC_HOST_NAME, response.getPublicHostname(), requestedIds);
++ setResourceProperty(resource, STATE, response.getLiveState(), requestedIds);
++ setResourceProperty(resource, DESIRED_STATE, response.getDesiredState(), requestedIds);
++ setResourceProperty(resource, VERSION, response.getVersion(), requestedIds);
++ setResourceProperty(resource, DESIRED_STACK_ID, response.getDesiredStackVersion(), requestedIds);
++ setResourceProperty(resource, ACTUAL_CONFIGS, response.getActualConfigs(), requestedIds);
++ setResourceProperty(resource, STALE_CONFIGS, response.isStaleConfig(), requestedIds);
++ setResourceProperty(resource, RELOAD_CONFIGS, response.isReloadConfig(), requestedIds);
++ setResourceProperty(resource, UPGRADE_STATE, response.getUpgradeState(), requestedIds);
if (response.getAdminState() != null) {
- setResourceProperty(resource, HOST_COMPONENT_DESIRED_ADMIN_STATE_PROPERTY_ID,
+ setResourceProperty(resource, DESIRED_ADMIN_STATE,
response.getAdminState(), requestedIds);
}
@@@ -413,7 -421,17 +459,16 @@@
return requestStages.getRequestStatusResponse();
}
- public RequestStatusResponse start(String cluster, String hostName, Collection<String> installOnlyComponents, boolean skipFailure) throws SystemException,
-
+ // TODO, revisit this extra method, that appears to be used during Add Hosts
+ // TODO, How do we determine the component list for INSTALL_ONLY during an Add Hosts operation? rwn
+ public RequestStatusResponse start(String cluster, String hostName) throws SystemException,
+ UnsupportedPropertyException, NoSuchParentResourceException {
+
+ return this.start(cluster, hostName, Collections.emptySet(), false, false);
+ }
+
+ public RequestStatusResponse start(String cluster, String hostName, Collection<String> installOnlyComponents,
+ boolean skipFailure, boolean useClusterHostInfo) throws SystemException,
UnsupportedPropertyException, NoSuchParentResourceException {
Map<String, String> requestInfo = new HashMap<>();
@@@ -684,35 -720,25 +741,35 @@@
* @return the component request object
*/
private ServiceComponentHostRequest getRequest(Map<String, Object> properties) {
- ServiceComponentHostRequest serviceComponentHostRequest = new ServiceComponentHostRequest(
- (String) properties.get(CLUSTER_NAME),
- (String) properties.get(SERVICE_NAME),
- (String) properties.get(COMPONENT_NAME),
- (String) properties.get(HOST_NAME),
- (String) properties.get(DESIRED_STATE));
+ Long hostComponentId = null;
- if (properties.get(HOST_COMPONENT_HOST_COMPONENT_ID_PROPERTY_ID) != null) {
- hostComponentId = properties.get(HOST_COMPONENT_HOST_COMPONENT_ID_PROPERTY_ID) instanceof String ?
- Long.parseLong((String) properties.get(HOST_COMPONENT_HOST_COMPONENT_ID_PROPERTY_ID)) :
- (Long) properties.get(HOST_COMPONENT_HOST_COMPONENT_ID_PROPERTY_ID);
++ if (properties.get(ID) != null) {
++ hostComponentId = properties.get(ID) instanceof String ?
++ Long.parseLong((String) properties.get(ID)) :
++ (Long) properties.get(ID);
+ }
+ ServiceComponentHostRequest serviceComponentHostRequest = new ServiceComponentHostRequest(
- (String) properties.get(HOST_COMPONENT_CLUSTER_NAME_PROPERTY_ID),
- (String) properties.get(HOST_COMPONENT_SERVICE_GROUP_NAME_PROPERTY_ID),
- (String) properties.get(HOST_COMPONENT_SERVICE_NAME_PROPERTY_ID),
++ (String) properties.get(CLUSTER_NAME),
++ (String) properties.get(SERVICE_GROUP_NAME),
++ (String) properties.get(SERVICE_NAME),
+ hostComponentId,
- (String) properties.get(HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID),
- (String) properties.get(HOST_COMPONENT_COMPONENT_TYPE_PROPERTY_ID),
- (String) properties.get(HOST_COMPONENT_HOST_NAME_PROPERTY_ID),
- (String) properties.get(HOST_COMPONENT_DESIRED_STATE_PROPERTY_ID));
++ (String) properties.get(COMPONENT_NAME),
++ (String) properties.get(COMPONENT_TYPE),
++ (String) properties.get(HOST_NAME),
++ (String) properties.get(DESIRED_STATE));
+
- serviceComponentHostRequest.setState((String) properties.get(HOST_COMPONENT_STATE_PROPERTY_ID));
- if (properties.get(HOST_COMPONENT_STALE_CONFIGS_PROPERTY_ID) != null) {
+ serviceComponentHostRequest.setState((String) properties.get(STATE));
+ if (properties.get(STALE_CONFIGS) != null) {
serviceComponentHostRequest.setStaleConfig(
- properties.get(HOST_COMPONENT_STALE_CONFIGS_PROPERTY_ID).toString().toLowerCase());
+ properties.get(STALE_CONFIGS).toString().toLowerCase());
}
- if (properties.get(HOST_COMPONENT_DESIRED_ADMIN_STATE_PROPERTY_ID) != null) {
+ if (properties.get(DESIRED_ADMIN_STATE) != null) {
serviceComponentHostRequest.setAdminState(
- properties.get(HOST_COMPONENT_DESIRED_ADMIN_STATE_PROPERTY_ID).toString());
+ properties.get(DESIRED_ADMIN_STATE).toString());
}
- if (properties.get(HOST_COMPONENT_PUBLIC_HOST_NAME_PROPERTY_ID) != null) {
+ if (properties.get(PUBLIC_HOST_NAME) != null) {
serviceComponentHostRequest.setPublicHostname(
- properties.get(HOST_COMPONENT_PUBLIC_HOST_NAME_PROPERTY_ID).toString());
+ properties.get(PUBLIC_HOST_NAME).toString());
}
@@@ -731,37 -757,26 +788,37 @@@
* @return the component request object
*/
private ServiceComponentHostRequest changeRequest(Map<String, Object> properties) {
+ Long hostComponentId = null;
- if (properties.get(HOST_COMPONENT_HOST_COMPONENT_ID_PROPERTY_ID) != null) {
- hostComponentId = properties.get(HOST_COMPONENT_HOST_COMPONENT_ID_PROPERTY_ID) instanceof String ?
- Long.parseLong((String) properties.get(HOST_COMPONENT_HOST_COMPONENT_ID_PROPERTY_ID)) :
- (Long) properties.get(HOST_COMPONENT_HOST_COMPONENT_ID_PROPERTY_ID);
++ if (properties.get(ID) != null) {
++ hostComponentId = properties.get(ID) instanceof String ?
++ Long.parseLong((String) properties.get(ID)) :
++ (Long) properties.get(ID);
+
+ }
ServiceComponentHostRequest serviceComponentHostRequest = new ServiceComponentHostRequest(
- (String) properties.get(HOST_COMPONENT_CLUSTER_NAME_PROPERTY_ID),
- (String) properties.get(HOST_COMPONENT_SERVICE_GROUP_NAME_PROPERTY_ID),
- (String) properties.get(HOST_COMPONENT_SERVICE_NAME_PROPERTY_ID),
+ (String) properties.get(CLUSTER_NAME),
++ (String) properties.get(SERVICE_GROUP_NAME),
+ (String) properties.get(SERVICE_NAME),
+ hostComponentId,
- (String) properties.get(HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID),
- (String) properties.get(HOST_COMPONENT_COMPONENT_TYPE_PROPERTY_ID),
- (String) properties.get(HOST_COMPONENT_HOST_NAME_PROPERTY_ID),
- (String) properties.get(HOST_COMPONENT_STATE_PROPERTY_ID));
+ (String) properties.get(COMPONENT_NAME),
++ (String) properties.get(COMPONENT_TYPE),
+ (String) properties.get(HOST_NAME),
+ (String) properties.get(STATE));
+
- if (properties.get(HOST_COMPONENT_DESIRED_STATE_PROPERTY_ID) != null) {
- serviceComponentHostRequest.setDesiredState((String)properties.get(HOST_COMPONENT_DESIRED_STATE_PROPERTY_ID));
+ if (properties.get(DESIRED_STATE) != null) {
+ serviceComponentHostRequest.setDesiredState((String)properties.get(DESIRED_STATE));
}
- if (properties.get(HOST_COMPONENT_STALE_CONFIGS_PROPERTY_ID) != null) {
+ if (properties.get(STALE_CONFIGS) != null) {
serviceComponentHostRequest.setStaleConfig(
- properties.get(HOST_COMPONENT_STALE_CONFIGS_PROPERTY_ID).toString().toLowerCase());
+ properties.get(STALE_CONFIGS).toString().toLowerCase());
}
- if (properties.get(HOST_COMPONENT_DESIRED_ADMIN_STATE_PROPERTY_ID) != null) {
+ if (properties.get(DESIRED_ADMIN_STATE) != null) {
serviceComponentHostRequest.setAdminState(
- properties.get(HOST_COMPONENT_DESIRED_ADMIN_STATE_PROPERTY_ID).toString());
+ properties.get(DESIRED_ADMIN_STATE).toString());
}
- Object o = properties.get(HOST_COMPONENT_MAINTENANCE_STATE_PROPERTY_ID);
+ Object o = properties.get(MAINTENANCE_STATE);
if (null != o) {
serviceComponentHostRequest.setMaintenanceState (o.toString());
}
@@@ -1046,9 -1056,8 +1106,9 @@@
try {
if (componentName != null && !componentName.isEmpty()) {
AmbariManagementController managementController = getManagementController();
- String clusterName = (String) resource.getPropertyValue(HOST_COMPONENT_CLUSTER_NAME_PROPERTY_ID);
- String serviceName = (String) resource.getPropertyValue(HOST_COMPONENT_SERVICE_NAME_PROPERTY_ID);
- String serviceGroupName = (String) resource.getPropertyValue(HOST_COMPONENT_SERVICE_GROUP_NAME_PROPERTY_ID);
+ String clusterName = (String) resource.getPropertyValue(CLUSTER_NAME);
+ String serviceName = (String) resource.getPropertyValue(SERVICE_NAME);
++ String serviceGroupName = (String) resource.getPropertyValue(SERVICE_GROUP_NAME);
if (StringUtils.isEmpty(serviceName)) {
Cluster cluster = managementController.getClusters().getCluster(clusterName);
serviceName = managementController.findServiceName(cluster, componentName);
@@@ -1056,7 -1064,7 +1116,7 @@@
}
ServiceComponent sc = getServiceComponent((String) resource.getPropertyValue(
- HOST_COMPONENT_CLUSTER_NAME_PROPERTY_ID), serviceGroupName, serviceName, componentName);
- CLUSTER_NAME), serviceName, componentName);
++ CLUSTER_NAME), serviceGroupName, serviceName, componentName);
isClient = sc.isClientComponent();
}
} catch (AmbariException e) {
diff --cc ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestResourceProvider.java
index a8fcf13,0b9bce0..4971694
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestResourceProvider.java
@@@ -17,11 -17,10 +17,11 @@@
*/
package org.apache.ambari.server.controller.internal;
- import static org.apache.ambari.server.controller.internal.HostComponentResourceProvider.HOST_COMPONENT_CLUSTER_NAME_PROPERTY_ID;
- import static org.apache.ambari.server.controller.internal.HostComponentResourceProvider.HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID;
- import static org.apache.ambari.server.controller.internal.HostComponentResourceProvider.HOST_COMPONENT_HOST_NAME_PROPERTY_ID;
- import static org.apache.ambari.server.controller.internal.HostComponentResourceProvider.HOST_COMPONENT_SERVICE_GROUP_NAME_PROPERTY_ID;
- import static org.apache.ambari.server.controller.internal.HostComponentResourceProvider.HOST_COMPONENT_SERVICE_NAME_PROPERTY_ID;
+ import static org.apache.ambari.server.controller.internal.HostComponentResourceProvider.CLUSTER_NAME;
+ import static org.apache.ambari.server.controller.internal.HostComponentResourceProvider.COMPONENT_NAME;
+ import static org.apache.ambari.server.controller.internal.HostComponentResourceProvider.HOST_NAME;
++import static org.apache.ambari.server.controller.internal.HostComponentResourceProvider.SERVICE_GROUP_NAME;
+ import static org.apache.ambari.server.controller.internal.HostComponentResourceProvider.SERVICE_NAME;
import java.util.ArrayList;
import java.util.Collection;
@@@ -539,54 -538,46 +541,49 @@@ public class RequestResourceProvider ex
throw new SystemException(msg, e);
}
- ResourceProvider resourceProvider = getResourceProvider(Resource.Type.HostComponent);
-
Set<String> propertyIds = new HashSet<>();
- propertyIds.add(HOST_COMPONENT_CLUSTER_NAME_PROPERTY_ID);
- propertyIds.add(HOST_COMPONENT_SERVICE_NAME_PROPERTY_ID);
- propertyIds.add(HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID);
+ propertyIds.add(CLUSTER_NAME);
+ propertyIds.add(SERVICE_NAME);
+ propertyIds.add(COMPONENT_NAME);
Request request = PropertyHelper.getReadRequest(propertyIds);
-
+
- Predicate finalPredicate = new PredicateBuilder(filterPredicate)
- .property(HOST_COMPONENT_CLUSTER_NAME_PROPERTY_ID).equals(clusterName).and()
- .property(HOST_COMPONENT_SERVICE_NAME_PROPERTY_ID).equals(serviceName).and()
- .property(HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID).equals(componentName)
- .toPredicate();
-
try {
- Set<Resource> resources = resourceProvider.getResources(request, finalPredicate);
-
- if (resources != null && !resources.isEmpty()) {
- // Allow request to span services / components using just the predicate
- Map<ServiceComponentTuple, List<String>> dupleListMap = new HashMap<>();
- for (Resource resource : resources) {
- String hostnameStr = (String) resource.getPropertyValue(HOST_COMPONENT_HOST_NAME_PROPERTY_ID);
- if (hostnameStr != null) {
- String computedServiceGroupName = (String) resource.getPropertyValue(HOST_COMPONENT_SERVICE_GROUP_NAME_PROPERTY_ID);
- String computedServiceName = (String) resource.getPropertyValue(HOST_COMPONENT_SERVICE_NAME_PROPERTY_ID);
- String computedComponentName = (String) resource.getPropertyValue(HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID);
- ServiceComponentTuple duple =
- new ServiceComponentTuple(computedServiceGroupName, computedServiceName, computedComponentName);
-
- if (!dupleListMap.containsKey(duple)) {
- hostList = new ArrayList<>();
- hostList.add(hostnameStr);
- dupleListMap.put(duple, hostList);
- } else {
- dupleListMap.get(duple).add(hostnameStr);
- }
+ ClusterController clusterController = ClusterControllerHelper.getClusterController();
+ QueryResponse queryResponse = clusterController.getResources(
+ Resource.Type.HostComponent, request, filterPredicate);
+ Iterable<Resource> resourceIterable = clusterController.getIterable(
+ Resource.Type.HostComponent, queryResponse, request,
+ filterPredicate, null, null);
+
+ // Allow request to span services / components using just the predicate
+ Map<ServiceComponentTuple, List<String>> tupleListMap = new HashMap<>();
+ for (Resource resource : resourceIterable) {
+ String hostnameStr = (String) resource.getPropertyValue(HOST_NAME);
+ if (hostnameStr != null) {
+ String computedServiceName = (String) resource.getPropertyValue(SERVICE_NAME);
++ String computedServiceGroupName = (String) resource.getPropertyValue(SERVICE_GROUP_NAME);
+ String computedComponentName = (String) resource.getPropertyValue(COMPONENT_NAME);
- ServiceComponentTuple tuple = new ServiceComponentTuple(computedServiceName, computedComponentName);
++ ServiceComponentTuple tuple = new ServiceComponentTuple(computedServiceGroupName, computedServiceName, computedComponentName);
+
+ if (!tupleListMap.containsKey(tuple)) {
+ hostList = new ArrayList<>();
+ hostList.add(hostnameStr);
+ tupleListMap.put(tuple, hostList);
+ } else {
+ tupleListMap.get(tuple).add(hostnameStr);
}
}
- if (!dupleListMap.isEmpty()) {
- for (Map.Entry<ServiceComponentTuple, List<String>> entry : dupleListMap.entrySet()) {
- resourceFilterList.add(new RequestResourceFilter(
- entry.getKey().getServiceGroupName(),
- entry.getKey().getServiceName(),
- entry.getKey().getComponentName(),
- entry.getValue()
- ));
- }
+ }
+ if (!tupleListMap.isEmpty()) {
+ for (Map.Entry<ServiceComponentTuple, List<String>> entry : tupleListMap.entrySet()) {
+ resourceFilterList.add(new RequestResourceFilter(
++ entry.getKey().getServiceGroupName(),
+ entry.getKey().getServiceName(),
+ entry.getKey().getComponentName(),
+ entry.getValue()
+ ));
++
}
}
} catch (Exception e) {
diff --cc ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceConfigVersionResourceProvider.java
index 7e24df2,24febe8..25a1777
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceConfigVersionResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceConfigVersionResourceProvider.java
@@@ -53,22 -49,20 +53,23 @@@ import org.apache.ambari.server.securit
public class ServiceConfigVersionResourceProvider extends
AbstractControllerResourceProvider {
- public static final String SERVICE_CONFIG_VERSION_CLUSTER_NAME_PROPERTY_ID = PropertyHelper.getPropertyId(null, "cluster_name");
- public static final String SERVICE_CONFIG_VERSION_PROPERTY_ID = PropertyHelper.getPropertyId(null, "service_config_version");
- public static final String SERVICE_CONFIG_VERSION_SERVICE_GROUP_NAME_PROPERTY_ID = PropertyHelper.getPropertyId(null, "service_group_name");
- public static final String SERVICE_CONFIG_VERSION_SERVICE_GROUP_ID_PROPERTY_ID = PropertyHelper.getPropertyId(null, "service_group_id");
- public static final String SERVICE_CONFIG_VERSION_SERVICE_NAME_PROPERTY_ID = PropertyHelper.getPropertyId(null, "service_name");
- public static final String SERVICE_CONFIG_VERSION_SERVICE_ID_PROPERTY_ID = PropertyHelper.getPropertyId(null, "service_id");
- public static final String SERVICE_CONFIG_VERSION_CREATE_TIME_PROPERTY_ID = PropertyHelper.getPropertyId(null, "createtime");
- public static final String SERVICE_CONFIG_VERSION_USER_PROPERTY_ID = PropertyHelper.getPropertyId(null, "user");
- public static final String SERVICE_CONFIG_VERSION_NOTE_PROPERTY_ID = PropertyHelper.getPropertyId("ServiceConfigVersion", "service_config_version_note");
- public static final String SERVICE_CONFIG_VERSION_GROUP_ID_PROPERTY_ID = PropertyHelper.getPropertyId(null, "group_id");
- public static final String SERVICE_CONFIG_VERSION_GROUP_NAME_PROPERTY_ID = PropertyHelper.getPropertyId(null, "group_name");
- public static final String SERVICE_CONFIG_VERSION_STACK_ID_PROPERTY_ID = PropertyHelper.getPropertyId("ServiceConfigVersion", "stack_id");
- public static final String SERVICE_CONFIG_VERSION_IS_CURRENT_PROPERTY_ID = PropertyHelper.getPropertyId(null, "is_current");
- public static final String SERVICE_CONFIG_VERSION_IS_COMPATIBLE_PROPERTY_ID = PropertyHelper.getPropertyId(null, "is_cluster_compatible");
- public static final String SERVICE_CONFIG_VERSION_HOSTS_PROPERTY_ID = PropertyHelper.getPropertyId(null, "hosts");
- public static final String SERVICE_CONFIG_VERSION_CONFIGURATIONS_PROPERTY_ID = PropertyHelper.getPropertyId(null, "configurations");
+ public static final String CLUSTER_NAME_PROPERTY_ID = "cluster_name";
+ public static final String SERVICE_CONFIG_VERSION_PROPERTY_ID = "service_config_version";
++ public static final String SERVICE_GROUP_NAME_PROPERTY_ID = "service_group_name";
++ public static final String SERVICE_GROUP_ID_PROPERTY_ID = "service_group_id";
+ public static final String SERVICE_NAME_PROPERTY_ID = "service_name";
++ public static final String SERVICE_ID_PROPERTY_ID = "service_id";
+ public static final String CREATE_TIME_PROPERTY_ID = "createtime";
+ public static final String USER_PROPERTY_ID = "user";
+ public static final String SERVICE_CONFIG_VERSION_NOTE_PROPERTY_ID = "service_config_version_note";
+ public static final String GROUP_ID_PROPERTY_ID = "group_id";
+ public static final String GROUP_NAME_PROPERTY_ID = "group_name";
+ public static final String STACK_ID_PROPERTY_ID = "stack_id";
+ public static final String IS_CURRENT_PROPERTY_ID = "is_current";
+ public static final String IS_COMPATIBLE_PROPERTY_ID = "is_cluster_compatible";
+ public static final String HOSTS_PROPERTY_ID = "hosts";
+ public static final String CONFIGURATIONS_PROPERTY_ID = "configurations";
+ public static final String APPLIED_TIME_PROPERTY_ID = "appliedtime";
/**
* The property ids for a service configuration resource.
@@@ -82,26 -76,24 +83,25 @@@
static {
// properties
- PROPERTY_IDS.add(SERVICE_CONFIG_VERSION_CLUSTER_NAME_PROPERTY_ID);
+ PROPERTY_IDS.add(CLUSTER_NAME_PROPERTY_ID);
PROPERTY_IDS.add(SERVICE_CONFIG_VERSION_PROPERTY_ID);
- PROPERTY_IDS.add(SERVICE_CONFIG_VERSION_SERVICE_NAME_PROPERTY_ID);
- PROPERTY_IDS.add(SERVICE_CONFIG_VERSION_CREATE_TIME_PROPERTY_ID);
- PROPERTY_IDS.add(SERVICE_CONFIG_VERSION_USER_PROPERTY_ID);
++ PROPERTY_IDS.add(SERVICE_GROUP_NAME_PROPERTY_ID);
+ PROPERTY_IDS.add(SERVICE_NAME_PROPERTY_ID);
+ PROPERTY_IDS.add(CREATE_TIME_PROPERTY_ID);
+ PROPERTY_IDS.add(USER_PROPERTY_ID);
PROPERTY_IDS.add(SERVICE_CONFIG_VERSION_NOTE_PROPERTY_ID);
- PROPERTY_IDS.add(SERVICE_CONFIG_VERSION_GROUP_ID_PROPERTY_ID);
- PROPERTY_IDS.add(SERVICE_CONFIG_VERSION_GROUP_NAME_PROPERTY_ID);
- PROPERTY_IDS.add(SERVICE_CONFIG_VERSION_STACK_ID_PROPERTY_ID);
- PROPERTY_IDS.add(SERVICE_CONFIG_VERSION_IS_CURRENT_PROPERTY_ID);
- PROPERTY_IDS.add(SERVICE_CONFIG_VERSION_HOSTS_PROPERTY_ID);
- PROPERTY_IDS.add(SERVICE_CONFIG_VERSION_CONFIGURATIONS_PROPERTY_ID);
- PROPERTY_IDS.add(SERVICE_CONFIG_VERSION_IS_COMPATIBLE_PROPERTY_ID);
- PROPERTY_IDS.add(SERVICE_CONFIG_VERSION_SERVICE_GROUP_NAME_PROPERTY_ID);
+ PROPERTY_IDS.add(GROUP_ID_PROPERTY_ID);
+ PROPERTY_IDS.add(GROUP_NAME_PROPERTY_ID);
+ PROPERTY_IDS.add(STACK_ID_PROPERTY_ID);
+ PROPERTY_IDS.add(IS_CURRENT_PROPERTY_ID);
+ PROPERTY_IDS.add(HOSTS_PROPERTY_ID);
+ PROPERTY_IDS.add(CONFIGURATIONS_PROPERTY_ID);
+ PROPERTY_IDS.add(IS_COMPATIBLE_PROPERTY_ID);
-- // keys
- KEY_PROPERTY_IDS.put(Resource.Type.Service, SERVICE_CONFIG_VERSION_SERVICE_NAME_PROPERTY_ID);
- KEY_PROPERTY_IDS.put(Resource.Type.Cluster, SERVICE_CONFIG_VERSION_CLUSTER_NAME_PROPERTY_ID);
+ KEY_PROPERTY_IDS.put(Resource.Type.Service, SERVICE_NAME_PROPERTY_ID);
+ KEY_PROPERTY_IDS.put(Resource.Type.Cluster, CLUSTER_NAME_PROPERTY_ID);
- KEY_PROPERTY_IDS.put(Resource.Type.ServiceConfigVersion,SERVICE_CONFIG_VERSION_PROPERTY_ID);
+ KEY_PROPERTY_IDS.put(Resource.Type.ServiceConfigVersion, SERVICE_CONFIG_VERSION_PROPERTY_ID);
- KEY_PROPERTY_IDS.put(Resource.Type.ServiceGroup, SERVICE_CONFIG_VERSION_SERVICE_GROUP_NAME_PROPERTY_ID);
++ KEY_PROPERTY_IDS.put(Resource.Type.ServiceGroup, SERVICE_GROUP_NAME_PROPERTY_ID);
}
@@@ -110,9 -102,9 +110,7 @@@
*/
private static Set<String> pkPropertyIds =
new HashSet<>(Arrays.asList(new String[]{
- SERVICE_CONFIG_VERSION_CLUSTER_NAME_PROPERTY_ID,
- SERVICE_CONFIG_VERSION_SERVICE_NAME_PROPERTY_ID, SERVICE_CONFIG_VERSION_SERVICE_GROUP_NAME_PROPERTY_ID}));
- CLUSTER_NAME_PROPERTY_ID,
- SERVICE_NAME_PROPERTY_ID}));
--
++ CLUSTER_NAME_PROPERTY_ID, SERVICE_GROUP_NAME_PROPERTY_ID, SERVICE_NAME_PROPERTY_ID}));
// ----- Constructors ------------------------------------------------------
@@@ -138,63 -130,7 +136,63 @@@
@Override
public RequestStatus createResources(Request request) throws SystemException, UnsupportedPropertyException, ResourceAlreadyExistsException, NoSuchParentResourceException {
- throw new UnsupportedOperationException("Cannot explicitly create service config version");
+ final Set<ServiceConfigVersionRequest> requests = new HashSet<>();
+ Set<ServiceConfigVersionResponse> responses = new HashSet<>();
+
+ for (Map<String, Object> propertyMap : request.getProperties()) {
+ requests.add(createRequest(propertyMap));
+ }
+ responses = createResources(new Command<Set<ServiceConfigVersionResponse>>() {
+ @Override
+ public Set<ServiceConfigVersionResponse> invoke() throws AmbariException, AuthorizationException {
+ return getManagementController().createServiceConfigVersion(requests);
+ }
+ });
+
+ Set<Resource> associatedResources = new HashSet<>();
+ for (ServiceConfigVersionResponse serviceConfigVersionResponse : responses) {
+ Resource resource = new ResourceImpl(Resource.Type.ServiceConfigVersion);
- resource.setProperty(ServiceConfigVersionResourceProvider.SERVICE_CONFIG_VERSION_SERVICE_GROUP_NAME_PROPERTY_ID,
++ resource.setProperty(ServiceConfigVersionResourceProvider.SERVICE_GROUP_NAME_PROPERTY_ID,
+ serviceConfigVersionResponse.getServiceGroupName());
- resource.setProperty(ServiceConfigVersionResourceProvider.SERVICE_CONFIG_VERSION_SERVICE_GROUP_ID_PROPERTY_ID,
++ resource.setProperty(ServiceConfigVersionResourceProvider.SERVICE_GROUP_ID_PROPERTY_ID,
+ serviceConfigVersionResponse.getServiceGroupId());
- resource.setProperty(ServiceConfigVersionResourceProvider.SERVICE_CONFIG_VERSION_SERVICE_NAME_PROPERTY_ID,
++ resource.setProperty(ServiceConfigVersionResourceProvider.SERVICE_NAME_PROPERTY_ID,
+ serviceConfigVersionResponse.getServiceName());
- resource.setProperty(ServiceConfigVersionResourceProvider.SERVICE_CONFIG_VERSION_SERVICE_ID_PROPERTY_ID,
++ resource.setProperty(ServiceConfigVersionResourceProvider.SERVICE_ID_PROPERTY_ID,
+ serviceConfigVersionResponse.getServiceId());
+ resource.setProperty(ServiceConfigVersionResourceProvider.SERVICE_CONFIG_VERSION_PROPERTY_ID,
+ serviceConfigVersionResponse.getVersion());
+ resource.setProperty(ServiceConfigVersionResourceProvider.SERVICE_CONFIG_VERSION_NOTE_PROPERTY_ID,
+ serviceConfigVersionResponse.getNote());
- resource.setProperty(ServiceConfigVersionResourceProvider.SERVICE_CONFIG_VERSION_GROUP_ID_PROPERTY_ID,
++ resource.setProperty(ServiceConfigVersionResourceProvider.GROUP_ID_PROPERTY_ID,
+ serviceConfigVersionResponse.getGroupId());
- resource.setProperty(ServiceConfigVersionResourceProvider.SERVICE_CONFIG_VERSION_GROUP_NAME_PROPERTY_ID,
++ resource.setProperty(ServiceConfigVersionResourceProvider.GROUP_NAME_PROPERTY_ID,
+ serviceConfigVersionResponse.getGroupName());
+ if (serviceConfigVersionResponse.getConfigurations() != null) {
+ resource.setProperty(
- ServiceConfigVersionResourceProvider.SERVICE_CONFIG_VERSION_CONFIGURATIONS_PROPERTY_ID,
++ ServiceConfigVersionResourceProvider.CONFIGURATIONS_PROPERTY_ID,
+ serviceConfigVersionResponse.getConfigurations());
+ }
+ associatedResources.add(resource);
+ }
+
+ return getRequestStatus(null, associatedResources);
+ }
+
+ private List<ConfigurationRequest> getConfigurationRequests(Set<Map<String, Object>> configurations) {
+ List<ConfigurationRequest> configs = new LinkedList<>();
+ for (Map<String, Object> value: configurations) {
+ ConfigurationRequest newConfig = new ConfigurationRequest();
+ for (Map.Entry<String, Object> e : value.entrySet()) {
+ String propName =
+ PropertyHelper.getPropertyName("Config" + '/' + e.getKey());
+ String absCatategory =
+ PropertyHelper.getPropertyCategory("Config" + '/' + e.getKey());
+ parseProperties(newConfig, absCatategory, propName, e.getValue() == null ? null : e.getValue().toString());
+ }
+ configs.add(newConfig);
+ }
+ return configs;
}
@Override
@@@ -218,20 -154,19 +216,20 @@@
List<Map<String,Object>> configVersionConfigurations = convertToSubResources(clusterName, configurationResponses);
Resource resource = new ResourceImpl(Resource.Type.ServiceConfigVersion);
- resource.setProperty(SERVICE_CONFIG_VERSION_CLUSTER_NAME_PROPERTY_ID, clusterName);
- resource.setProperty(SERVICE_CONFIG_VERSION_SERVICE_NAME_PROPERTY_ID, response.getServiceName());
- resource.setProperty(SERVICE_CONFIG_VERSION_SERVICE_GROUP_NAME_PROPERTY_ID, response.getServiceGroupName());
- resource.setProperty(SERVICE_CONFIG_VERSION_USER_PROPERTY_ID, response.getUserName());
+ resource.setProperty(CLUSTER_NAME_PROPERTY_ID, clusterName);
++ resource.setProperty(SERVICE_GROUP_NAME_PROPERTY_ID, response.getServiceGroupName());
+ resource.setProperty(SERVICE_NAME_PROPERTY_ID, response.getServiceName());
+ resource.setProperty(USER_PROPERTY_ID, response.getUserName());
resource.setProperty(SERVICE_CONFIG_VERSION_PROPERTY_ID, response.getVersion());
- resource.setProperty(SERVICE_CONFIG_VERSION_CREATE_TIME_PROPERTY_ID, response.getCreateTime());
- resource.setProperty(SERVICE_CONFIG_VERSION_CONFIGURATIONS_PROPERTY_ID, configVersionConfigurations);
+ resource.setProperty(CREATE_TIME_PROPERTY_ID, response.getCreateTime());
+ resource.setProperty(CONFIGURATIONS_PROPERTY_ID, configVersionConfigurations);
resource.setProperty(SERVICE_CONFIG_VERSION_NOTE_PROPERTY_ID, response.getNote());
- resource.setProperty(SERVICE_CONFIG_VERSION_GROUP_ID_PROPERTY_ID, response.getGroupId());
- resource.setProperty(SERVICE_CONFIG_VERSION_GROUP_NAME_PROPERTY_ID, response.getGroupName());
- resource.setProperty(SERVICE_CONFIG_VERSION_HOSTS_PROPERTY_ID, response.getHosts());
- resource.setProperty(SERVICE_CONFIG_VERSION_STACK_ID_PROPERTY_ID, response.getStackId());
- resource.setProperty(SERVICE_CONFIG_VERSION_IS_CURRENT_PROPERTY_ID, response.getIsCurrent());
- resource.setProperty(SERVICE_CONFIG_VERSION_IS_COMPATIBLE_PROPERTY_ID, response.isCompatibleWithCurrentStack());
+ resource.setProperty(GROUP_ID_PROPERTY_ID, response.getGroupId());
+ resource.setProperty(GROUP_NAME_PROPERTY_ID, response.getGroupName());
+ resource.setProperty(HOSTS_PROPERTY_ID, response.getHosts());
+ resource.setProperty(STACK_ID_PROPERTY_ID, response.getStackId());
+ resource.setProperty(IS_CURRENT_PROPERTY_ID, response.getIsCurrent());
+ resource.setProperty(IS_COMPATIBLE_PROPERTY_ID, response.isCompatibleWithCurrentStack());
resources.add(resource);
}
@@@ -248,24 -183,44 +246,24 @@@
throw new UnsupportedOperationException("Cannot delete service config version");
}
- @Override
- public Set<String> checkPropertyIds(Set<String> propertyIds) {
- propertyIds = super.checkPropertyIds(propertyIds);
-
- if (propertyIds.isEmpty()) {
- return propertyIds;
- }
- Set<String> unsupportedProperties = new HashSet<>();
-
- for (String propertyId : propertyIds) {
- if (!propertyId.equals("cluster_name") && !propertyId.equals("service_config_version") &&
- !propertyId.equals("service_name") && !propertyId.equals("createtime") &&
- !propertyId.equals("appliedtime") && !propertyId.equals("user") &&
- !propertyId.equals("service_config_version_note") &&
- !propertyId.equals("group_id") &&
- !propertyId.equals("group_name") &&
- !propertyId.equals("stack_id") &&
- !propertyId.equals("is_current") &&
- !propertyId.equals("is_cluster_compatible") &&
- !propertyId.equals("hosts")) {
-
- unsupportedProperties.add(propertyId);
-
- }
- }
- return unsupportedProperties;
- }
-
-
private ServiceConfigVersionRequest createRequest(Map<String, Object> properties) {
- String clusterName = (String) properties.get(SERVICE_CONFIG_VERSION_CLUSTER_NAME_PROPERTY_ID);
- String serviceGroupName = (String) properties.get(SERVICE_CONFIG_VERSION_SERVICE_GROUP_NAME_PROPERTY_ID);
- String serviceName = (String) properties.get(SERVICE_CONFIG_VERSION_SERVICE_NAME_PROPERTY_ID);
- String user = (String) properties.get(SERVICE_CONFIG_VERSION_USER_PROPERTY_ID);
- Boolean isCurrent = Boolean.valueOf((String) properties.get(SERVICE_CONFIG_VERSION_IS_CURRENT_PROPERTY_ID));
+ String clusterName = (String) properties.get(CLUSTER_NAME_PROPERTY_ID);
++ String serviceGroupName = (String) properties.get(SERVICE_GROUP_NAME_PROPERTY_ID);
+ String serviceName = (String) properties.get(SERVICE_NAME_PROPERTY_ID);
+ String user = (String) properties.get(USER_PROPERTY_ID);
+ Boolean isCurrent = Boolean.valueOf((String) properties.get(IS_CURRENT_PROPERTY_ID));
Object versionObject = properties.get(SERVICE_CONFIG_VERSION_PROPERTY_ID);
Long version = versionObject == null ? null : Long.valueOf(versionObject.toString());
-
- return new ServiceConfigVersionRequest(clusterName, serviceName, version, null, null, user, isCurrent);
+ String note = (String) properties.get(SERVICE_CONFIG_VERSION_NOTE_PROPERTY_ID);
- String stackId = (String) properties.get(SERVICE_CONFIG_VERSION_STACK_ID_PROPERTY_ID);
++ String stackId = (String) properties.get(STACK_ID_PROPERTY_ID);
+ ServiceConfigVersionRequest scvr = new ServiceConfigVersionRequest(clusterName, serviceGroupName, serviceName, version, null, null, user, isCurrent, note, stackId);
+ if(version == null && properties.containsKey("configurations")) {
+ List<ConfigurationRequest> configRequests = getConfigurationRequests((Set<Map<String, Object>>) properties.get("configurations"));
+ if (!configRequests.isEmpty()) {
+ scvr.setConfigs(configRequests);
+ }
+ }
+ return scvr;
}
private List<Map<String, Object>> convertToSubResources(final String clusterName, List<ConfigurationResponse> configs) {
diff --cc ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
index ddd5d49,4946f33..6ea0b41
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
@@@ -73,10 -76,10 +74,10 @@@ import org.apache.ambari.server.state.S
import org.apache.ambari.server.state.ServiceInfo;
import org.apache.ambari.server.state.StackId;
import org.apache.ambari.server.state.State;
- import org.apache.ambari.server.topology.TopologyDeleteFormer;
+ import org.apache.ambari.server.topology.STOMPComponentsDeleteHandler;
-import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.Validate;
+import org.apache.commons.lang3.tuple.Pair;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@@ -169,7 -186,13 +170,11 @@@ public class ServiceResourceProvider ex
@Inject
private KerberosHelper kerberosHelper;
- private final TopologyDeleteFormer topologyDeleteFormer;
++
+ @Inject
+ private STOMPComponentsDeleteHandler STOMPComponentsDeleteHandler;
+
- /**
- * Used to lookup the repository when creating services.
- */
- private final RepositoryVersionDAO repositoryVersionDAO;
++
// ----- Constructors ----------------------------------------------------
@@@ -180,13 -203,11 +185,11 @@@
*/
@AssistedInject
public ServiceResourceProvider(
- @Assisted AmbariManagementController managementController,
- MaintenanceStateHelper maintenanceStateHelper, RepositoryVersionDAO repositoryVersionDAO) {
+ @Assisted AmbariManagementController managementController,
- MaintenanceStateHelper maintenanceStateHelper,
- TopologyDeleteFormer topologyDeleteFormer
++ MaintenanceStateHelper maintenanceStateHelper
+ ) {
super(Resource.Type.Service, PROPERTY_IDS, KEY_PROPERTY_IDS, managementController);
this.maintenanceStateHelper = maintenanceStateHelper;
- this.topologyDeleteFormer = topologyDeleteFormer;
- this.repositoryVersionDAO = repositoryVersionDAO;
setRequiredCreateAuthorizations(EnumSet.of(RoleAuthorization.SERVICE_ADD_DELETE_SERVICES));
setRequiredUpdateAuthorizations(RoleAuthorization.AUTHORIZATIONS_UPDATE_SERVICE);
diff --cc ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
index 1de76d1,322c0f9..16b4636
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
@@@ -48,6 -50,8 +48,7 @@@ import org.apache.ambari.server.control
import org.apache.ambari.server.controller.AmbariCustomCommandExecutionHelper;
import org.apache.ambari.server.controller.AmbariManagementController;
import org.apache.ambari.server.controller.ExecuteCommandJson;
+ import org.apache.ambari.server.controller.KerberosHelper;
-import org.apache.ambari.server.controller.KerberosHelperImpl.SupportedCustomOperation;
import org.apache.ambari.server.controller.spi.NoSuchParentResourceException;
import org.apache.ambari.server.controller.spi.NoSuchResourceException;
... 10376 lines suppressed ...