You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by is...@apache.org on 2018/02/14 00:04:12 UTC
[ambari] branch branch-feature-AMBARI-14714-ui updated: Merge
branch-feature-AMBARI-14714 (#345)
This is an automated email from the ASF dual-hosted git repository.
ishanbha pushed a commit to branch branch-feature-AMBARI-14714-ui
in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/branch-feature-AMBARI-14714-ui by this push:
new 1fb2c62 Merge branch-feature-AMBARI-14714 (#345)
1fb2c62 is described below
commit 1fb2c62a02060cc158c92fb8a1eccef707a27c9e
Author: Ishan Bhatt <is...@gmail.com>
AuthorDate: Tue Feb 13 16:04:09 2018 -0800
Merge branch-feature-AMBARI-14714 (#345)
Merge branch-feature-AMBARI-14714
---
.github/PULL_REQUEST_TEMPLATE.md | 10 +
.../src/main/resources/ui/admin-web/app/index.html | 9 +-
.../app/scripts/controllers/SideNavCtrl.js | 6 +-
.../controllers/ambariViews/ViewsListCtrl.js | 220 +-
.../remoteClusters/RemoteClustersListCtrl.js | 110 +-
.../stackVersions/StackVersionsCreateCtrl.js | 28 +-
.../stackVersions/StackVersionsEditCtrl.js | 4 +-
.../stackVersions/StackVersionsListCtrl.js | 192 +-
.../controllers/userManagement/GroupsListCtrl.js | 92 +-
.../controllers/userManagement/UsersListCtrl.js | 132 +-
.../app/scripts/directives/comboSearch.js | 501 +
.../ui/admin-web/app/scripts/services/Cluster.js | 3 +-
.../ui/admin-web/app/scripts/services/Filters.js | 84 +
.../ui/admin-web/app/scripts/services/Group.js | 11 +-
.../admin-web/app/scripts/services/Pagination.js | 59 +
.../app/scripts/services/RemoteCluster.js | 10 +-
.../ui/admin-web/app/scripts/services/Stack.js | 34 +-
.../ui/admin-web/app/scripts/services/User.js | 22 +-
.../admin-web/app/styles/cluster-information.css | 29 +-
.../ui/admin-web/app/styles/combo-search.css | 164 +
.../resources/ui/admin-web/app/styles/main.css | 45 +
.../ui/admin-web/app/styles/user-management.css | 4 +
.../ui/admin-web/app/views/ambariViews/edit.html | 8 +-
.../admin-web/app/views/ambariViews/viewsList.html | 52 +-
.../app/views/clusters/clusterInformation.html | 8 +-
.../app/views/directives/comboSearch.html | 63 +
.../app/views/directives/editableList.html | 2 +-
.../app/views/modals/AddRepositoryModal.html | 2 +-
.../app/views/modals/RoleDetailsModal.html | 2 +-
.../admin-web/app/views/remoteClusters/list.html | 37 +-
.../ui/admin-web/app/views/stackVersions/list.html | 40 +-
.../app/views/stackVersions/stackVersionPage.html | 4 +-
.../app/views/userManagement/groupEdit.html | 14 +-
.../app/views/userManagement/groupsList.html | 55 +-
.../userManagement/modals/changePassword.html | 2 +-
.../views/userManagement/modals/groupCreate.html | 2 +-
.../views/userManagement/modals/userCreate.html | 3 +-
.../app/views/userManagement/userEdit.html | 18 +-
.../app/views/userManagement/usersList.html | 65 +-
.../src/main/resources/ui/admin-web/package.json | 2 +-
.../controllers/ambariViews/ViewsListCtrl_test.js | 111 +
.../userManagement/GroupsListCtrl_test.js | 100 +-
.../userManagement/UsersListCtrl_test.js | 306 -
.../test/unit/directives/comboSearch_test.js | 362 +
.../admin-web/test/unit/services/Filters_test.js | 161 +
.../test/unit/services/Pagination_test.js | 72 +
ambari-agent/conf/unix/ambari-agent | 8 +-
ambari-agent/conf/unix/ambari-env.sh | 2 +-
ambari-agent/conf/unix/install-helper.sh | 57 +-
ambari-agent/pom.xml | 13 +-
.../src/main/package/rpm/posttrans_agent.sh | 20 -
.../src/main/python/ambari_agent/ActionQueue.py | 30 +-
.../src/main/python/ambari_agent/AmbariAgent.py | 2 +-
.../main/python/ambari_agent/CommandStatusDict.py | 2 +-
.../src/main/python/ambari_agent/Controller.py | 25 +-
.../ambari_agent/CustomServiceOrchestrator.py | 4 +-
.../src/main/python/ambari_agent/DataCleaner.py | 4 +-
.../src/main/python/ambari_agent/Heartbeat.py | 17 +-
.../src/main/python/ambari_agent/HostCleanup.py | 2 +-
.../src/main/python/ambari_agent/LiveStatus.py | 3 +-
.../src/main/python/ambari_agent/PythonExecutor.py | 15 +-
.../ambari_agent/PythonReflectiveExecutor.py | 3 +-
.../main/python/ambari_agent/RecoveryManager.py | 17 +-
.../python/ambari_agent/StatusCommandsExecutor.py | 3 +-
.../main/python/ambari_agent/alerts/ams_alert.py | 12 +-
.../main/python/ambari_agent/alerts/base_alert.py | 47 +-
.../python/ambari_agent/alerts/metric_alert.py | 6 +-
.../main/python/ambari_agent/alerts/port_alert.py | 4 +-
.../main/python/ambari_agent/alerts/web_alert.py | 6 +-
.../src/main/python/ambari_agent/security.py | 8 +-
.../src/test/python/ambari_agent/TestController.py | 8 +-
.../test/python/ambari_agent/TestProcessUtils.py | 224 -
.../src/test/python/ambari_agent/TestShell.py | 177 +-
.../ambari_agent/examples/ControllerTester.py | 6 +-
.../src/main/python/ambari_commons/inet_utils.py | 46 +
.../python/ambari_commons/kerberos/__init__.py | 19 +
.../ambari_commons/kerberos/kerberos_common.py | 168 +
.../main/python/ambari_commons/kerberos/utils.py | 109 +
.../src/main/python/ambari_commons/os_check.py | 2 +
.../main/python/ambari_commons/process_utils.py | 100 -
.../src/main/python/ambari_commons/shell.py | 182 +-
.../core/providers/package/__init__.py | 15 +
.../core/providers/package/yumrpm.py | 121 +-
.../libraries/functions/conf_select.py | 7 +
.../libraries/functions/constants.py | 11 +-
.../libraries/functions/lzo_utils.py | 15 +-
.../libraries/functions/module_version.py | 158 +
.../libraries/functions/mpack_version.py | 207 +
.../libraries/functions/namenode_ha_utils.py | 14 +-
.../libraries/functions/repository_util.py | 99 +-
.../libraries/functions/setup_atlas_hook.py | 11 +-
.../libraries/functions/setup_ranger_plugin_xml.py | 14 +-
.../libraries/functions/solr_cloud_util.py | 46 +-
.../libraries/functions/tar_archive.py | 4 +-
.../libraries/providers/hdfs_resource.py | 2 +
.../resource_management/libraries/script/script.py | 10 +-
.../stacks/HDP/2.0.6.1/services/FLUME/metainfo.xml | 5 +-
.../stacks/HDP/2.0.6/services/FLUME/metainfo.xml | 5 +-
.../stacks/HDP/2.0.7/services/HBASE/metainfo.xml | 10 +-
.../HDP/2.1.1/services/AMBARI_METRICS/metainfo.xml | 5 +-
ambari-infra/ambari-infra-assembly/pom.xml | 43 +-
.../src/main/package/deb/manager/postinst | 9 +-
.../src/main/package/deb/manager/postrm | 8 +
.../src/main/package/rpm/manager/postinstall.sh | 11 +-
.../src/main/package/rpm/manager/postremove.sh | 23 +
ambari-infra/ambari-infra-manager-it/pom.xml | 167 +
.../java/org/apache/ambari/infra/HttpResponse.java | 37 +
.../java/org/apache/ambari/infra/InfraClient.java | 132 +
.../apache/ambari/infra/InfraManagerStories.java | 108 +
.../org/apache/ambari/infra/JobExecutionInfo.java | 45 +
.../ambari/infra/OffsetDateTimeConverter.java | 39 +
.../ambari/infra/steps/AbstractInfraSteps.java | 262 +
.../apache/ambari/infra/steps/ExportJobsSteps.java | 233 +
.../src/test/resources/log4j.properties | 16 +
.../test/resources/stories/infra_api_tests.story | 67 +
ambari-infra/ambari-infra-manager/.gitignore | 5 +-
ambari-infra/ambari-infra-manager/build.xml | 11 +-
.../ambari-infra-manager/docker/Dockerfile | 6 +-
.../ambari-infra-manager/docker/bin/start.sh | 2 +-
.../ambari-infra-manager/docker/docker-compose.yml | 102 +
.../docker/infra-manager-docker-compose.sh | 124 +
.../ambari-infra-manager/docs/api/swagger.yaml | 2 +-
ambari-infra/ambari-infra-manager/pom.xml | 45 +-
.../java/org/apache/ambari/infra/InfraManager.java | 2 +-
.../infra/conf/InfraManagerSchedulingConfig.java | 32 +
.../infra/conf/batch/InfraManagerBatchConfig.java | 25 +-
.../conf/security/CompositePasswordStore.java | 39 +
.../infra/conf/security/HadoopCredentialStore.java | 55 +
.../conf/security/InfraManagerSecurityConfig.java | 38 +
.../ambari/infra/conf/security/PasswordStore.java | 25 +
.../infra/conf/security/SecurityEnvironment.java | 28 +
.../infra/job/AbstractJobsConfiguration.java | 82 +
.../apache/ambari/infra/job/CloseableIterator.java | 24 +
.../infra/job/JobConfigurationException.java | 25 +
.../ambari/infra/job/JobContextRepository.java | 26 +
.../ambari/infra/job/JobContextRepositoryImpl.java | 52 +
.../org/apache/ambari/infra/job/JobProperties.java | 82 +
.../org/apache/ambari/infra/job/JobScheduler.java | 89 +
.../apache/ambari/infra/job/JobsPropertyMap.java | 59 +
.../org/apache/ambari/infra/job/ObjectSource.java | 23 +
.../ambari/infra/job/SchedulingProperties.java | 49 +
.../org/apache/ambari/infra/job/SolrDAOBase.java | 65 +
.../infra/job/archive/AbstractFileAction.java | 38 +
.../infra/job/archive/CompositeFileAction.java | 3 +-
.../apache/ambari/infra/job/archive/Document.java | 3 +-
.../archive/DocumentArchivingConfiguration.java | 169 +
.../job/archive/DocumentArchivingProperties.java | 227 +
.../job/archive/DocumentArchivingPropertyMap.java | 38 +
.../job/archive/DocumentExportConfiguration.java | 118 -
.../job/archive/DocumentExportJobListener.java | 35 -
.../job/archive/DocumentExportProperties.java | 112 -
.../job/archive/DocumentExportStepListener.java | 47 -
.../ambari/infra/job/archive/DocumentExporter.java | 22 +-
.../infra/job/archive/DocumentItemReader.java | 8 +-
.../ambari/infra/job/archive/DocumentIterator.java | 25 -
.../ambari/infra/job/archive/DocumentSource.java | 24 -
.../ambari/infra/job/archive/DocumentWiper.java | 23 +
.../infra/job/archive/ExportDestination.java | 25 +
.../infra/job/archive/FileNameSuffixFormatter.java | 63 +
.../ambari/infra/job/archive/HdfsUploader.java | 55 +
.../infra/job/archive/ItemWriterListener.java | 23 +
.../infra/job/archive/LocalDocumentItemWriter.java | 23 +-
.../infra/job/archive/LocalItemWriterListener.java | 36 +
.../ambari/infra/job/archive/S3AccessCsv.java | 94 +
.../job/archive/S3AccessCsvFormatException.java | 25 +
.../ambari/infra/job/archive/S3AccessKeyNames.java | 40 +
.../ambari/infra/job/archive/S3Properties.java | 56 +-
.../ambari/infra/job/archive/S3Uploader.java | 39 +-
.../apache/ambari/infra/job/archive/SolrDAO.java | 68 +
.../infra/job/archive/SolrDocumentIterator.java | 6 +-
.../infra/job/archive/SolrDocumentSource.java | 57 +-
.../infra/job/archive/SolrParametrizedString.java | 77 +
.../ambari/infra/job/archive/SolrProperties.java | 117 +
.../ambari/infra/job/archive/SolrQueryBuilder.java | 59 +-
.../infra/job/archive/SolrQueryProperties.java | 40 +-
.../ambari/infra/job/archive/TarGzCompressor.java | 4 +-
.../infra/job/archive/WriteCompletedEvent.java | 45 +
.../deleting/DocumentDeletingConfiguration.java | 78 +
.../job/deleting/DocumentDeletingProperties.java | 77 +
.../job/deleting/DocumentDeletingPropertyMap.java | 38 +
.../infra/job/deleting/DocumentWiperTasklet.java | 49 +
.../apache/ambari/infra/manager/JobManager.java | 64 +-
.../java/org/apache/ambari/infra/manager/Jobs.java | 42 +
.../infra/model/JobExecutionRestartRequest.java | 10 +
.../org/apache/ambari/infra/rest/JobResource.java | 28 +-
.../src/main/resources/infra-manager-env.sh | 24 +-
.../src/main/resources/infra-manager.properties | 66 +-
.../src/main/resources/infraManager.sh | 258 +-
.../src/main/resources/log4j2.xml | 3 +
.../conf/security/CompositePasswordStoreTest.java | 48 +
.../apache/ambari/infra/job/JobPropertiesTest.java | 56 +
.../apache/ambari/infra/job/JobSchedulerTest.java | 114 +
.../infra/job/archive/DocumentExporterTest.java | 110 +-
.../infra/job/archive/DocumentItemReaderTest.java | 8 +-
.../job/archive/FileNameSuffixFormatterTest.java | 58 +
.../job/archive/LocalDocumentItemWriterTest.java | 27 +-
.../ambari/infra/job/archive/S3AccessCsvTest.java | 70 +
.../job/archive/SolrParametrizedStringTest.java | 57 +
.../infra/job/archive/SolrPropertiesTest.java | 54 +
.../infra/job/archive/SolrQueryBuilderTest.java | 55 +-
.../infra/job/archive/SolrQueryPropertiesTest.java | 54 +
.../vagrant-infra-manager.properties.sample | 39 +
ambari-infra/ambari-infra-solr-client/pom.xml | 26 +-
.../src/main/resources/solrCloudCli.sh | 2 +-
ambari-infra/pom.xml | 106 +-
ambari-logsearch/ambari-logsearch-appender/pom.xml | 23 +
ambari-logsearch/ambari-logsearch-assembly/pom.xml | 117 +-
.../src/main/package/deb/logfeeder/postinst | 22 +
.../src/main/package/deb/logfeeder/postrm | 6 +
.../src/main/package/deb/logfeeder/posttrm | 15 -
.../src/main/package/deb/logfeeder/preinst | 13 +
.../src/main/package/deb/portal/postinst | 19 +
.../src/main/package/deb/portal/postrm | 6 +
.../src/main/package/deb/portal/preinst | 13 +
.../src/main/package/rpm/logfeeder/postinstall.sh | 40 +
.../src/main/package/rpm/logfeeder/postremove.sh | 23 +
.../main/package/rpm/logfeeder/postremove.sh~HEAD | 21 +
.../main/package/rpm/logfeeder/postremove.sh~trunk | 21 +
.../src/main/package/rpm/logfeeder/preinstall.sh | 28 +
.../src/main/package/rpm/portal/postinstall.sh | 37 +
.../src/main/package/rpm/portal/postremove.sh | 23 +
.../src/main/package/rpm/portal/postremove.sh~HEAD | 21 +
.../main/package/rpm/portal/postremove.sh~trunk | 21 +
.../src/main/package/rpm/portal/preinstall.sh | 28 +
.../config/api/LogSearchConfigFactory.java | 49 +-
.../config/api/LogSearchConfigLogFeeder.java | 3 +-
.../api/model/inputconfig/CustomDescriptor.java | 31 +
.../model/inputconfig/InputCustomDescriptor.java | 22 +
.../api/model/inputconfig/MapCustomDescriptor.java | 22 +
.../model/inputconfig/impl/InputAdapter.java | 4 +-
.../impl/InputCustomDescriptorImpl.java | 71 +
.../inputconfig/impl/InputDescriptorImpl.java | 2 +
.../inputconfig/impl/MapCustomDescriptorImpl.java | 81 +
.../inputconfig/impl/PostMapValuesAdapter.java | 12 +-
.../ambari-logsearch-logfeeder-plugin-api/pom.xml | 76 +
.../ambari/logfeeder/plugin/common/AliasUtil.java | 129 +
.../ambari/logfeeder/plugin/common/ConfigItem.java | 191 +
.../plugin/common/LogFeederProperties.java | 32 +
.../ambari/logfeeder/plugin/common/MetricData.java | 37 +
.../ambari/logfeeder/plugin/filter/Filter.java | 187 +
.../logfeeder/plugin/filter/mapper/Mapper.java | 74 +
.../ambari/logfeeder/plugin/input/Input.java | 340 +
.../ambari/logfeeder/plugin/input/InputMarker.java | 29 +
.../logfeeder/plugin/input/cache/LRUCache.java | 99 +
.../logfeeder/plugin/manager/BlockManager.java | 35 +
.../logfeeder/plugin/manager/InputManager.java | 46 +
.../logfeeder/plugin/manager/OutputManager.java | 43 +
.../ambari/logfeeder/plugin/output/Output.java | 132 +
.../ambari-logsearch-logfeeder/.gitignore | 1 +
.../ambari-logsearch-logfeeder/README.md | 4 +-
.../ambari-logsearch-logfeeder/build.properties | 18 -
.../ambari-logsearch-logfeeder/build.xml | 28 +-
.../ambari-logsearch-logfeeder/pom.xml | 80 +-
ambari-logsearch/ambari-logsearch-logfeeder/run.sh | 4 +-
.../org/apache/ambari/logfeeder/LogFeeder.java | 180 +-
.../ambari/logfeeder/LogFeederCommandLine.java | 81 +-
.../ambari/logfeeder/common/ConfigBlock.java | 153 -
.../ambari/logfeeder/common/ConfigHandler.java | 161 +-
.../apache/ambari/logfeeder/common/ConfigItem.java | 97 -
.../logfeeder/common/LogEntryParseTester.java | 54 +-
.../logfeeder/common/LogFeederConstants.java | 50 +
.../ambari/logfeeder/conf/ApplicationConfig.java | 110 +
.../ambari/logfeeder/conf/InputSimulateConfig.java | 154 +
.../ambari/logfeeder/conf/LogEntryCacheConfig.java | 118 +
.../ambari/logfeeder/conf/LogFeederProps.java | 227 +
.../logfeeder/conf/LogFeederSecurityConfig.java | 191 +
.../logfeeder/conf/MetricsCollectorConfig.java | 113 +
.../org/apache/ambari/logfeeder/filter/Filter.java | 188 -
.../apache/ambari/logfeeder/filter/FilterGrok.java | 53 +-
.../apache/ambari/logfeeder/filter/FilterJSON.java | 24 +-
.../ambari/logfeeder/filter/FilterKeyValue.java | 41 +-
.../ambari/logfeeder/input/AbstractInputFile.java | 326 -
.../org/apache/ambari/logfeeder/input/Input.java | 352 -
.../logfeeder/input/InputConfigUploader.java | 92 +-
.../apache/ambari/logfeeder/input/InputFile.java | 277 +-
.../ambari/logfeeder/input/InputFileMarker.java | 60 +
.../ambari/logfeeder/input/InputManager.java | 422 -
.../ambari/logfeeder/input/InputManagerImpl.java | 444 +
.../apache/ambari/logfeeder/input/InputMarker.java | 40 -
.../apache/ambari/logfeeder/input/InputS3File.java | 61 +-
.../ambari/logfeeder/input/InputSimulate.java | 121 +-
.../ambari/logfeeder/input/cache/LRUCache.java | 99 -
.../logfeeder/input/file/FileCheckInHelper.java | 93 +
.../logfeeder/input/file/ProcessFileHelper.java | 143 +
.../input/file/ResumeLineNumberHelper.java | 91 +
.../ambari/logfeeder/input/reader/GZIPReader.java | 4 +-
.../input/reader/LogsearchReaderFactory.java | 4 +-
.../logfeeder/loglevelfilter/FilterLogData.java | 73 -
.../loglevelfilter/LogLevelFilterHandler.java | 113 +-
.../org/apache/ambari/logfeeder/mapper/Mapper.java | 45 -
.../ambari/logfeeder/mapper/MapperAnonymize.java | 11 +-
.../apache/ambari/logfeeder/mapper/MapperDate.java | 32 +-
.../ambari/logfeeder/mapper/MapperFieldCopy.java | 8 +-
.../ambari/logfeeder/mapper/MapperFieldName.java | 10 +-
.../ambari/logfeeder/mapper/MapperFieldValue.java | 10 +-
.../logfeeder/metrics/LogFeederAMSClient.java | 22 +-
.../ambari/logfeeder/metrics/MetricData.java | 46 -
.../ambari/logfeeder/metrics/MetricsManager.java | 17 +-
.../ambari/logfeeder/metrics/StatsLogger.java | 84 +
.../org/apache/ambari/logfeeder/output/Output.java | 137 -
.../apache/ambari/logfeeder/output/OutputData.java | 4 +-
.../ambari/logfeeder/output/OutputDevNull.java | 48 +-
.../apache/ambari/logfeeder/output/OutputFile.java | 56 +-
.../ambari/logfeeder/output/OutputHDFSFile.java | 47 +-
.../ambari/logfeeder/output/OutputKafka.java | 55 +-
.../ambari/logfeeder/output/OutputLineFilter.java | 4 +-
.../ambari/logfeeder/output/OutputManager.java | 258 -
.../ambari/logfeeder/output/OutputManagerImpl.java | 294 +
.../ambari/logfeeder/output/OutputS3File.java | 38 +-
.../apache/ambari/logfeeder/output/OutputSolr.java | 62 +-
.../logfeeder/output/S3OutputConfiguration.java | 12 +-
.../apache/ambari/logfeeder/output/S3Uploader.java | 1 -
.../ambari/logfeeder/output/spool/LogSpooler.java | 13 +-
.../apache/ambari/logfeeder/util/AliasUtil.java | 114 -
.../logfeeder/util/LogFeederPropertiesUtil.java | 498 -
.../ambari/logfeeder/util/LogFeederUtil.java | 37 +-
.../apache/ambari/logfeeder/util/MurmurHash.java | 163 -
.../org/apache/ambari/logfeeder/util/SSLUtil.java | 134 -
.../src/main/package/deb/control/control | 22 -
.../src/main/package/deb/control/postinst | 15 -
.../src/main/package/deb/control/postrm | 15 -
.../src/main/package/deb/control/preinst | 15 -
.../src/main/package/deb/control/prerm | 15 -
.../shipper-conf/input.config-sample.json | 2 +-
.../src/main/resources/log4j.xml | 15 +-
.../src/main/resources/logfeeder.properties | 21 +-
.../src/main/scripts/logfeeder-env.sh | 40 +
.../src/main/scripts/logfeeder-env.sh~HEAD | 40 +
.../src/main/scripts/logfeeder-env.sh~trunk | 40 +
.../src/main/scripts/logfeeder.sh | 291 +
.../src/main/scripts/run.sh | 103 -
.../ambari/logfeeder/filter/FilterGrokTest.java | 29 +-
.../ambari/logfeeder/filter/FilterJSONTest.java | 21 +-
.../logfeeder/filter/FilterKeyValueTest.java | 23 +-
.../ambari/logfeeder/input/InputFileTest.java | 57 +-
.../ambari/logfeeder/input/InputManagerTest.java | 37 +-
.../ambari/logfeeder/input/cache/LRUCacheTest.java | 1 +
.../logfeeder/logconfig/LogConfigHandlerTest.java | 148 -
.../logfeeder/metrics/MetricsManagerTest.java | 9 +-
.../ambari/logfeeder/output/OutputKafkaTest.java | 13 +-
.../logfeeder/output/OutputLineFilterTest.java | 4 +-
.../ambari/logfeeder/output/OutputManagerTest.java | 67 +-
.../ambari/logfeeder/output/OutputS3FileTest.java | 110 +-
.../ambari/logfeeder/output/OutputSolrTest.java | 177 -
ambari-logsearch/ambari-logsearch-server/README.md | 2 +-
ambari-logsearch/ambari-logsearch-server/build.xml | 36 +-
ambari-logsearch/ambari-logsearch-server/pom.xml | 13 +-
ambari-logsearch/ambari-logsearch-server/run.sh | 2 +-
.../org/apache/ambari/logsearch/LogSearch.java | 2 +-
.../logsearch/auth/filter/AbstractJWTFilter.java | 37 +-
.../logsearch/common/LogSearchConstants.java | 16 +-
.../ambari/logsearch/common/MessageEnums.java | 2 +-
.../ambari/logsearch/conf/AuthPropsConfig.java | 20 +-
.../logsearch/conf/LogSearchConfigApiConfig.java | 47 +
.../ambari/logsearch/conf/LogSearchSslConfig.java | 2 +-
.../ambari/logsearch/conf/SecurityConfig.java | 24 +-
.../configurer/LogSearchConfigConfigurer.java | 12 +-
.../AbstractOperationHolderConverter.java | 13 +-
.../AuditBarGraphRequestQueryConverter.java | 8 +
.../AuditComponentsRequestQueryConverter.java | 11 +
.../converter/AuditLogRequestQueryConverter.java | 7 +
.../AuditServiceLoadRequestQueryConverter.java | 10 +
.../FieldAuditLogRequestQueryConverter.java | 9 +
.../TopFieldAuditLogRequestQueryConverter.java | 9 +
.../converter/UserExportRequestQueryConverter.java | 10 +
.../apache/ambari/logsearch/dao/SolrDaoBase.java | 16 +-
.../apache/ambari/logsearch/doc/DocConstants.java | 2 +
.../logsearch/handler/CreateCollectionHandler.java | 2 +-
.../ambari/logsearch/manager/InfoManager.java | 13 +-
.../logsearch/manager/ServiceLogsManager.java | 2 +-
.../logsearch/manager/ShipperConfigManager.java | 13 +-
.../model/request/ShipperConfigTestParams.java | 45 +
.../model/request/UserParamDefinition.java | 33 +
.../model/request/impl/AuditBarGraphRequest.java | 16 +-
.../model/request/impl/AuditComponentRequest.java | 17 +-
.../model/request/impl/AuditLogRequest.java | 16 +-
.../request/impl/AuditServiceLoadRequest.java | 19 +-
.../model/request/impl/CommonSearchRequest.java | 3 +
.../request/impl/FieldAuditBarGraphRequest.java | 16 +-
.../model/request/impl/FieldAuditLogRequest.java | 16 +-
.../request/impl/ShipperConfigTestRequest.java | 65 +
.../request/impl/TopFieldAuditLogRequest.java | 17 +-
.../model/request/impl/UserExportRequest.java | 16 +-
.../apache/ambari/logsearch/rest/InfoResource.java | 25 +-
.../logsearch/rest/ShipperConfigResource.java | 8 +-
.../web/filters/LogSearchConfigStateFilter.java | 13 +-
.../logsearch/web/filters/LogsearchJWTFilter.java | 5 +
.../src/main/scripts/logsearch-env.sh | 40 +
.../src/main/scripts/logsearch-env.sh~HEAD | 40 +
.../src/main/scripts/logsearch-env.sh~trunk | 40 +
.../src/main/scripts/logsearch.sh | 273 +
.../src/main/scripts/run.sh | 99 -
.../src/main/scripts/stop.sh | 44 -
.../AuditBarGraphRequestQueryConverterTest.java | 3 +-
.../converter/AuditLogRequestConverterTest.java | 3 +-
...chExternalServerAuthenticationProviderTest.java | 1 -
ambari-logsearch/ambari-logsearch-web/package.json | 6 +-
.../ambari-logsearch-web/src/app/app.module.ts | 49 +-
.../classes/components/graph/graph.component.less | 49 +
.../classes/components/graph/graph.component.ts | 443 +
.../components/graph/time-graph.component.less | 48 +
.../components/graph/time-graph.component.ts | 250 +
.../{ => logs-table}/logs-table-component.spec.ts | 0
.../{ => logs-table}/logs-table-component.ts | 0
.../src/app/classes/filtering.ts | 4 +-
.../ambari-logsearch-web/src/app/classes/graph.ts | 66 +
.../src/app/classes/histogram-options.ts | 36 -
.../src/app/classes/list-item.ts | 5 +-
.../src/app/classes/models/app-settings.ts | 8 +-
.../src/app/classes/models/app-state.ts | 13 +-
.../src/app/classes/models/filter.ts | 8 +-
.../src/app/classes/models/store.ts | 46 +-
.../src/app/classes/models/tab.ts | 7 +-
.../ambari-logsearch-web/src/app/classes/object.ts | 27 +
.../queries/audit-logs-graph-query-params.spec.ts | 203 +
.../queries/audit-logs-graph-query-params.ts | 69 +
.../app/classes/queries/audit-logs-query-params.ts | 30 +-
.../audit-logs-top-resources-query-params.ts | 23 +
.../src/app/classes/queries/logs-query-params.ts | 50 +
.../service-logs-histogram-query-params.spec.ts | 203 -
.../queries/service-logs-histogram-query-params.ts | 50 +-
.../classes/queries/service-logs-query-params.ts | 4 +-
.../queries/service-logs-truncated-query-params.ts | 2 +-
.../src/app/classes/service-injector.ts | 23 +
.../src/app/classes/settings.ts | 32 +
.../ambari-logsearch-web/src/app/classes/string.ts | 2 +
.../action-menu/action-menu.component.html | 31 +-
.../action-menu/action-menu.component.less | 5 +
.../action-menu/action-menu.component.spec.ts | 82 +-
.../action-menu/action-menu.component.ts | 149 +-
.../src/app/components/app.component.html | 11 +-
.../src/app/components/app.component.less | 4 +-
.../audit-logs-entries.component.html | 36 +
.../audit-logs-entries.component.spec.ts | 115 +
.../audit-logs-entries.component.ts | 133 +
.../audit-logs-table.component.html | 7 +-
.../audit-logs-table.component.spec.ts | 7 +-
.../audit-logs-table/audit-logs-table.component.ts | 10 +-
.../collapsible-panel.component.html | 8 +-
.../collapsible-panel.component.spec.ts | 4 +-
.../collapsible-panel.component.ts | 8 +-
.../context-menu/context-menu.component.html | 19 +
.../context-menu/context-menu.component.less | 21 +
.../context-menu/context-menu.component.spec.ts | 123 +
.../context-menu/context-menu.component.ts | 72 +
.../date-picker/date-picker.component.ts | 21 +-
.../dropdown-button/dropdown-button.component.html | 20 +-
.../dropdown-button/dropdown-button.component.less | 8 +-
.../dropdown-button.component.spec.ts | 9 +-
.../dropdown-button/dropdown-button.component.ts | 40 +-
.../dropdown-list/dropdown-list.component.html | 29 +-
.../dropdown-list/dropdown-list.component.less | 24 +-
.../dropdown-list/dropdown-list.component.spec.ts | 13 +-
.../dropdown-list/dropdown-list.component.ts | 39 +-
.../filter-button/filter-button.component.spec.ts | 9 +-
.../filter-button/filter-button.component.ts | 7 +-
.../filter-dropdown.component.spec.ts | 9 +-
.../filter-dropdown/filter-dropdown.component.ts | 6 -
.../filters-panel/filters-panel.component.html | 18 +-
.../filters-panel/filters-panel.component.less | 4 -
.../filters-panel/filters-panel.component.spec.ts | 11 +-
.../filters-panel/filters-panel.component.ts | 43 +-
.../graph-legend-item.component.html | 19 +
.../graph-legend-item.component.less | 27 +
.../graph-legend-item.component.spec.ts | 42 +
.../graph-legend-item.component.ts | 37 +
.../graph-legend/graph-legend.component.html | 19 +
.../graph-legend/graph-legend.component.spec.ts | 50 +
.../graph-legend/graph-legend.component.ts | 32 +
.../graph-tooltip/graph-tooltip.component.html | 22 +
.../graph-tooltip/graph-tooltip.component.less | 69 +
.../graph-tooltip/graph-tooltip.component.spec.ts | 50 +
.../graph-tooltip/graph-tooltip.component.ts | 36 +
.../history-item-controls.component.html | 20 +
.../history-item-controls.component.less | 21 +
.../history-item-controls.component.spec.ts | 43 +
.../history-item-controls.component.ts | 28 +
.../horizontal-histogram.component.html | 22 +
.../horizontal-histogram.component.less | 22 +
.../horizontal-histogram.component.spec.ts | 61 +
.../horizontal-histogram.component.ts | 114 +
.../log-context/log-context.component.spec.ts | 11 +-
.../log-index-filter.component.html | 86 +
.../log-index-filter.component.less | 53 +
.../log-index-filter.component.spec.ts | 124 +
.../log-index-filter/log-index-filter.component.ts | 177 +
.../log-message/log-message.component.html | 2 +-
.../log-message/log-message.component.less | 27 +-
.../log-message/log-message.component.spec.ts | 14 +
.../log-message/log-message.component.ts | 24 +-
.../logs-container/logs-container.component.html | 36 +-
.../logs-container/logs-container.component.less | 23 +-
.../logs-container.component.spec.ts | 7 +-
.../logs-container/logs-container.component.ts | 81 +-
.../main-container/main-container.component.html | 1 -
.../main-container/main-container.component.less | 1 -
.../main-container/main-container.component.ts | 5 +-
.../menu-button/menu-button.component.html | 8 +-
.../menu-button/menu-button.component.spec.ts | 9 +-
.../menu-button/menu-button.component.ts | 26 +-
.../src/app/components/mixins.less | 35 +-
.../src/app/components/modal/modal.component.html | 5 +-
.../src/app/components/modal/modal.component.less | 22 +
.../src/app/components/modal/modal.component.ts | 9 +-
.../pagination/pagination.component.html | 3 +-
.../search-box/search-box.component.html | 28 +-
.../search-box/search-box.component.less | 30 +-
.../search-box/search-box.component.spec.ts | 79 +
.../components/search-box/search-box.component.ts | 219 +-
.../service-logs-table.component.html | 189 +-
.../service-logs-table.component.less | 216 +-
.../service-logs-table.component.spec.ts | 26 +-
.../service-logs-table.component.ts | 249 +-
.../src/app/components/tabs/tabs.component.spec.ts | 4 -
.../src/app/components/tabs/tabs.component.ts | 1 +
.../time-histogram/time-histogram.component.html | 21 +-
.../time-histogram/time-histogram.component.less | 23 +-
.../time-histogram.component.spec.ts | 157 +-
.../time-histogram/time-histogram.component.ts | 230 +-
.../time-line-graph/time-line-graph.component.html | 27 +
.../time-line-graph/time-line-graph.component.less | 42 +
.../time-line-graph.component.spec.ts | 69 +
.../time-line-graph/time-line-graph.component.ts | 111 +
.../time-range-picker.component.spec.ts | 9 +-
.../time-range-picker.component.ts | 2 +-
.../timezone-picker.component.spec.ts | 15 +-
.../timezone-picker/timezone-picker.component.ts | 15 +-
.../components/top-menu/top-menu.component.html | 8 +-
.../components/top-menu/top-menu.component.spec.ts | 7 +
.../app/components/top-menu/top-menu.component.ts | 26 +-
.../src/app/components/variables.less | 13 +
.../ambari-logsearch-web/src/app/mock-data.ts | 1674 +-
.../app/services/component-actions.service.spec.ts | 96 -
.../src/app/services/component-actions.service.ts | 155 -
.../services/component-generator.service.spec.ts | 9 +-
.../app/services/component-generator.service.ts | 15 +-
.../app/services/history-manager.service.spec.ts | 170 +
.../src/app/services/history-manager.service.ts | 330 +
.../src/app/services/http-client.service.ts | 51 +-
.../app/services/logs-container.service.spec.ts | 37 +-
.../src/app/services/logs-container.service.ts | 394 +-
.../src/app/services/mock-api-data.service.ts | 55 +-
.../storage/audit-logs-graph-data.service.ts | 32 +
.../src/app/services/storage/filters.service.ts | 33 -
.../src/app/services/storage/reducers.service.ts | 4 +-
.../src/app/services/user-settings.service.spec.ts | 98 +
.../src/app/services/user-settings.service.ts | 162 +
.../src/app/services/utils.service.spec.ts | 266 +
.../src/app/services/utils.service.ts | 58 +
.../ambari-logsearch-web/src/assets/i18n/en.json | 43 +-
.../ambari-logsearch-web/src/styles.less | 4 +
.../src/vendor/css/bootstrap-logsearch.min.css | 2 +-
.../src/vendor/js/bootstrap-logsearch.min.js | 2 +-
ambari-logsearch/ambari-logsearch-web/yarn.lock | 20 +-
ambari-logsearch/docker/Dockerfile | 25 +-
ambari-logsearch/docker/all.yml | 6 +-
ambari-logsearch/docker/bin/start.sh | 93 +-
ambari-logsearch/docker/docker-compose.yml | 2 -
ambari-logsearch/docker/knox.yml | 50 +
ambari-logsearch/docker/knox/gateway.sh | 21 +
.../docker/knox/keystores/test-secrets.zip | Bin 0 -> 3841 bytes
ambari-logsearch/docker/knox/ldap.sh | 21 +
.../docker/knox/logsearch/1.0.0/rewrite.xml | 23 +
.../docker/knox/logsearch/1.0.0/service.xml | 12 +
ambari-logsearch/docker/knox/topologies/admin.xml | 67 +
.../docker/knox/topologies/knoxsso.xml | 118 +
.../docker/knox/topologies/sandbox.xml | 55 +
ambari-logsearch/docker/logsearch-docker.sh | 1 +
ambari-logsearch/docker/logsearch-logfeeder.yml | 1 -
ambari-logsearch/docker/logsearch-server.yml | 1 -
ambari-logsearch/docker/sso.yml | 119 +
.../docker/test-config/logfeeder/logfeeder-env.sh | 5 +-
.../test-config/logfeeder/logfeeder.properties | 2 +-
.../docker/test-config/logsearch/logsearch-env.sh | 5 +-
.../logsearch/logsearch-https.properties | 6 +-
.../test-config/logsearch/logsearch-sso.properties | 63 +
.../test-config/logsearch/logsearch.properties | 4 +-
ambari-logsearch/pom.xml | 93 +-
ambari-project/pom.xml | 8 +-
ambari-server/conf/ambari-env.sh | 1 +
ambari-server/conf/unix/ambari-env.sh | 2 +-
ambari-server/conf/unix/ambari.properties | 4 +-
ambari-server/conf/unix/install-helper.sh | 43 +-
ambari-server/docs/api/generated/index.html | 30360 +++++++++++--------
ambari-server/docs/api/generated/swagger.json | 4906 +--
.../docs/api/v1/authentication-source-create.md | 86 +
.../docs/api/v1/authentication-source-delete.md | 49 +
.../docs/api/v1/authentication-source-get.md | 93 +
.../docs/api/v1/authentication-source-list.md | 116 +
.../docs/api/v1/authentication-source-resources.md | 117 +
.../docs/api/v1/authentication-source-update.md | 104 +
ambari-server/docs/api/v1/index.md | 12 +
ambari-server/docs/api/v1/user-create.md | 107 +
ambari-server/docs/api/v1/user-delete.md | 48 +
ambari-server/docs/api/v1/user-get.md | 97 +
ambari-server/docs/api/v1/user-list.md | 98 +
ambari-server/docs/api/v1/user-resources.md | 175 +
ambari-server/docs/api/v1/user-update.md | 115 +
ambari-server/docs/configuration/index.md | 41 +-
ambari-server/pom.xml | 30 +-
ambari-server/sbin/ambari-server | 1 -
ambari-server/src/main/assemblies/server.xml | 8 +-
.../actionmanager/ExecutionCommandWrapper.java | 4 +-
.../ambari/server/agent/CommandRepository.java | 22 +-
.../ambari/server/agent/ExecutionCommand.java | 37 +-
.../ambari/server/agent/HeartBeatHandler.java | 122 +-
.../ambari/server/agent/HeartbeatProcessor.java | 33 +-
.../ambari/server/alerts/JmxServerSideAlert.java | 98 +
.../org/apache/ambari/server/alerts/Threshold.java | 73 +
.../ambari/server/api/AmbariErrorHandler.java | 2 +-
.../api/query/render/ClusterBlueprintRenderer.java | 18 +-
.../api/resources/ResourceInstanceFactoryImpl.java | 4 +
.../api/resources/UserResourceDefinition.java | 1 +
.../ambari/server/api/services/AmbariMetaInfo.java | 159 +-
.../ambari/server/api/services/BaseService.java | 1 -
.../RootServiceComponentConfiguration.java | 73 +
.../StackAdvisorBlueprintProcessor.java | 28 +-
.../services/stackadvisor/StackAdvisorHelper.java | 5 +-
.../services/stackadvisor/StackAdvisorRequest.java | 5 +
.../services/stackadvisor/StackAdvisorRunner.java | 2 +-
.../users/UserAuthenticationSourceService.java | 223 +
.../server/api/services/users/UserService.java | 132 +-
.../ambari/server/audit/event/LoginAuditEvent.java | 20 +
.../checks/RequiredServicesInRepositoryCheck.java | 18 +-
.../configuration/ComponentSSLConfiguration.java | 4 +-
.../ambari/server/configuration/Configuration.java | 615 +-
.../configuration/ConfigurationPropertyType.java | 22 +
.../LdapUsernameCollisionHandlingBehavior.java | 29 +
.../AmbariCustomCommandExecutionHelper.java | 239 +-
.../controller/AmbariManagementController.java | 60 +-
.../controller/AmbariManagementControllerImpl.java | 373 +-
.../ambari/server/controller/AmbariServer.java | 40 +-
.../ambari/server/controller/ControllerModule.java | 12 +
.../server/controller/DeleteIdentityHandler.java | 5 +-
.../ambari/server/controller/KerberosHelper.java | 13 +-
.../server/controller/KerberosHelperImpl.java | 1115 +-
.../ambari/server/controller/MpackResponse.java | 12 +
.../server/controller/ResourceProviderFactory.java | 30 +-
.../controller/StackServiceComponentResponse.java | 35 +
.../server/controller/StackServiceResponse.java | 19 +-
.../UserAuthenticationSourceRequest.java | 82 +
...erAuthenticationSourceRequestCreateSwagger.java | 40 +
...erAuthenticationSourceRequestUpdateSwagger.java | 40 +
.../UserAuthenticationSourceResponse.java | 127 +
.../ambari/server/controller/UserRequest.java | 50 +-
.../controller/UserRequestCreateUserSwagger.java | 49 +
.../controller/UserRequestCreateUsersSwagger.java | 52 +
.../controller/UserRequestUpdateUserSwagger.java | 52 +
.../ambari/server/controller/UserResponse.java | 87 +-
.../AbstractAuthorizedResourceProvider.java | 12 +-
.../AbstractControllerResourceProvider.java | 83 +-
.../internal/AbstractDRResourceProvider.java | 9 +-
.../internal/AbstractResourceProvider.java | 2 +-
.../internal/ActionResourceProvider.java | 34 +-
.../ActiveWidgetLayoutResourceProvider.java | 4 +-
.../internal/AlertDefinitionResourceProvider.java | 2 +-
.../internal/AlertGroupResourceProvider.java | 2 +-
.../internal/AlertHistoryResourceProvider.java | 2 +-
.../internal/AlertNoticeResourceProvider.java | 2 +-
.../controller/internal/AlertResourceProvider.java | 2 +-
.../internal/AlertTargetResourceProvider.java | 2 +-
.../internal/AmbariPrivilegeResourceProvider.java | 36 +-
.../internal/AmbariServerConfigurationHandler.java | 105 +-
.../internal/AmbariServerConfigurationUtils.java | 78 +
.../AmbariServerLDAPConfigurationHandler.java | 9 +-
.../internal/BlueprintConfigurationProcessor.java | 59 +-
.../internal/BlueprintResourceProvider.java | 174 +-
.../controller/internal/CalculatedStatus.java | 7 +-
.../internal/ClientConfigResourceProvider.java | 33 +-
.../ClusterKerberosDescriptorResourceProvider.java | 2 +-
.../internal/ClusterPrivilegeResourceProvider.java | 31 +-
.../internal/ClusterResourceProvider.java | 25 +-
.../ClusterStackVersionResourceProvider.java | 36 +-
.../server/controller/internal/CompositeStack.java | 306 +
.../internal/ConfigGroupResourceProvider.java | 39 +-
.../internal/ConfigurationResourceProvider.java | 2 +-
.../internal/CredentialResourceProvider.java | 2 +-
.../controller/internal/DefaultProviderModule.java | 17 +-
.../internal/ExportBlueprintRequest.java | 6 +-
.../internal/ExtensionLinkResourceProvider.java | 33 +-
.../internal/ExtensionResourceProvider.java | 27 +-
.../internal/ExtensionVersionResourceProvider.java | 32 +-
.../controller/internal/FeedResourceProvider.java | 41 +-
.../internal/GroupPrivilegeResourceProvider.java | 42 +-
.../controller/internal/GroupResourceProvider.java | 32 +-
.../HostComponentProcessResourceProvider.java | 38 +-
.../internal/HostComponentResourceProvider.java | 84 +-
.../HostKerberosIdentityResourceProvider.java | 17 +-
.../controller/internal/HostResourceProvider.java | 53 +-
.../internal/HostStackVersionResourceProvider.java | 12 +-
.../internal/InstanceResourceProvider.java | 35 +-
.../controller/internal/JobResourceProvider.java | 57 +-
.../KerberosDescriptorResourceProvider.java | 20 +-
.../internal/LdapSyncEventResourceProvider.java | 47 +-
.../internal/LoggingResourceProvider.java | 9 +-
.../internal/MemberResourceProvider.java | 29 +-
.../controller/internal/MpackResourceProvider.java | 70 +-
.../internal/OperatingSystemResourceProvider.java | 2 +-
.../internal/OverriddenMetricsHostProvider.java | 101 +
.../internal/PermissionResourceProvider.java | 25 +-
.../internal/PrivilegeResourceProvider.java | 2 +-
.../PropertyValueTrimmingStrategyDefiner.java | 2 +-
.../internal/ProvisionClusterRequest.java | 47 +
.../QuickLinkArtifactResourceProvider.java | 2 +-
.../internal/ReadOnlyResourceProvider.java | 7 -
.../internal/RecommendationResourceProvider.java | 65 +-
.../internal/RegistryAdvisorResourceProvider.java | 2 +-
.../internal/RegistryMpackResourceProvider.java | 2 +-
.../RegistryMpackVersionResourceProvider.java | 2 +-
.../internal/RegistryResourceProvider.java | 2 +-
.../internal/RegistryScenarioResourceProvider.java | 2 +-
.../internal/RemoteClusterResourceProvider.java | 28 +-
.../internal/RepositoryResourceProvider.java | 14 +-
.../RepositoryVersionResourceProvider.java | 23 +-
.../internal/RequestResourceProvider.java | 52 +-
.../internal/RequestScheduleResourceProvider.java | 55 +-
.../RoleAuthorizationResourceProvider.java | 2 +-
.../RootClusterSettingsResourceProvider.java | 2 +-
.../RootServiceComponentConfigurationHandler.java | 7 +-
...viceComponentConfigurationResourceProvider.java | 20 +-
.../RootServiceComponentResourceProvider.java | 31 +-
.../RootServiceHostComponentResourceProvider.java | 34 +-
.../internal/RootServiceResourceProvider.java | 26 +-
.../controller/internal/ScaleClusterRequest.java | 17 +-
.../ServiceConfigVersionResourceProvider.java | 2 +-
.../internal/ServiceResourceProvider.java | 21 +-
.../internal/SettingResourceProvider.java | 2 +-
.../ambari/server/controller/internal/Stack.java | 480 +-
.../internal/StackAdvisorResourceProvider.java | 7 +-
.../internal/StackArtifactResourceProvider.java | 2 +-
...ackConfigurationDependencyResourceProvider.java | 40 +-
.../StackConfigurationResourceProvider.java | 42 +-
.../internal/StackDefinedPropertyProvider.java | 9 +-
.../controller/internal/StackDefinition.java | 296 +
.../internal/StackDependencyResourceProvider.java | 41 +-
.../StackLevelConfigurationResourceProvider.java | 40 +-
.../controller/internal/StackResourceProvider.java | 28 +-
.../StackServiceComponentResourceProvider.java | 66 +-
.../internal/StackServiceResourceProvider.java | 60 +-
.../internal/StackVersionResourceProvider.java | 5 +-
.../controller/internal/StageResourceProvider.java | 2 +-
.../internal/TargetClusterResourceProvider.java | 31 +-
.../internal/TaskAttemptResourceProvider.java | 53 +-
.../controller/internal/TaskResourceProvider.java | 27 +-
.../internal/ThemeArtifactResourceProvider.java | 2 +-
.../server/controller/internal/UnitUpdater.java | 6 +-
.../internal/UpgradeGroupResourceProvider.java | 2 +-
.../internal/UpgradeItemResourceProvider.java | 2 +-
.../internal/UpgradeResourceProvider.java | 37 +-
.../internal/UpgradeSummaryResourceProvider.java | 2 +-
.../UserAuthenticationSourceResourceProvider.java | 417 +
.../UserAuthorizationResourceProvider.java | 2 +-
.../internal/UserPrivilegeResourceProvider.java | 59 +-
.../controller/internal/UserResourceProvider.java | 518 +-
.../internal/ValidationResourceProvider.java | 86 +-
.../VersionDefinitionResourceProvider.java | 22 +-
.../internal/ViewInstanceResourceProvider.java | 55 +-
.../internal/ViewPermissionResourceProvider.java | 29 +-
.../internal/ViewPrivilegeResourceProvider.java | 36 +-
.../controller/internal/ViewResourceProvider.java | 19 +-
.../internal/ViewURLResourceProvider.java | 25 +-
.../internal/ViewVersionResourceProvider.java | 45 +-
.../internal/WidgetLayoutResourceProvider.java | 2 +-
.../internal/WidgetResourceProvider.java | 2 +-
.../internal/WorkflowResourceProvider.java | 54 +-
.../server/controller/jmx/JMXMetricHolder.java | 64 +
.../controller/logging/HostLogFilesResponse.java | 42 +
.../logging/LogSearchDataRetrievalService.java | 21 +-
.../controller/logging/LoggingRequestHelper.java | 11 +-
.../logging/LoggingRequestHelperFactoryImpl.java | 72 +-
.../logging/LoggingRequestHelperImpl.java | 111 +-
.../controller/metrics/MetricHostProvider.java | 9 +
.../timeline/AMSComponentPropertyProvider.java | 4 +-
.../ambari/server/controller/spi/Resource.java | 2 +
.../controller/utilities/PropertyHelper.java | 6 +-
.../apache/ambari/server/events/AmbariEvent.java | 7 +-
.../ambari/server/events/JpaInitializedEvent.java | 34 +
.../upgrade/HostVersionOutOfSyncListener.java | 24 +
.../ldap/domain/AmbariLdapConfiguration.java | 176 +-
.../ldap/domain/AmbariLdapConfigurationKeys.java | 121 +-
.../service/AmbariLdapConfigurationProvider.java | 39 +-
.../ambari/server/metadata/RoleCommandOrder.java | 34 +
.../metrics/system/impl/AmbariMetricSinkImpl.java | 2 -
.../apache/ambari/server/mpack/MpackGenerator.java | 58 +-
.../apache/ambari/server/mpack/MpackManager.java | 189 +-
.../server/orm/AmbariLocalSessionInterceptor.java | 2 +-
.../org/apache/ambari/server/orm/DBAccessor.java | 29 +
.../apache/ambari/server/orm/DBAccessorImpl.java | 3 +
.../ambari/server/orm/GuiceJpaInitializer.java | 8 +-
.../apache/ambari/server/orm/dao/BlueprintDAO.java | 14 -
.../ambari/server/orm/dao/HostVersionDAO.java | 15 +
.../ambari/server/orm/dao/KerberosKeytabDAO.java | 154 +-
.../server/orm/dao/KerberosKeytabPrincipalDAO.java | 309 +
.../server/orm/dao/KerberosPrincipalDAO.java | 9 -
.../server/orm/dao/KerberosPrincipalHostDAO.java | 252 -
.../server/orm/dao/RepositoryVersionDAO.java | 17 +-
.../server/orm/dao/UserAuthenticationDAO.java | 116 +
.../org/apache/ambari/server/orm/dao/UserDAO.java | 95 +-
.../orm/entities/AmbariConfigurationEntity.java | 2 +-
.../server/orm/entities/BlueprintConfigEntity.java | 1 -
.../orm/entities/BlueprintConfiguration.java | 7 -
.../server/orm/entities/BlueprintEntity.java | 44 +-
.../orm/entities/BlueprintMpackConfigEntity.java | 141 +
.../orm/entities/BlueprintMpackConfigEntityPk.java | 51 +
.../orm/entities/BlueprintMpackInstanceEntity.java | 190 +
.../orm/entities/BlueprintServiceConfigEntity.java | 139 +
.../entities/BlueprintServiceConfigEntityPk.java | 52 +
.../orm/entities/BlueprintServiceEntity.java | 129 +
.../orm/entities/HostGroupComponentEntity.java | 87 +-
.../orm/entities/HostGroupComponentEntityPK.java | 114 -
.../server/orm/entities/HostGroupConfigEntity.java | 2 -
.../server/orm/entities/HostGroupEntity.java | 7 +-
.../server/orm/entities/HostVersionEntity.java | 5 +
.../server/orm/entities/KerberosKeytabEntity.java | 152 +-
.../entities/KerberosKeytabPrincipalEntity.java | 236 +
.../KerberosKeytabServiceMappingEntity.java | 88 +
.../orm/entities/KerberosPrincipalEntity.java | 25 -
.../orm/entities/KerberosPrincipalHostEntity.java | 213 -
.../entities/KerberosPrincipalHostEntityPK.java | 115 -
.../server/orm/entities/OperatingSystemEntity.java | 78 -
.../server/orm/entities/RepoDefinitionEntity.java | 212 +
.../ambari/server/orm/entities/RepoOsEntity.java | 164 +
.../server/orm/entities/RepositoryEntity.java | 135 -
.../orm/entities/RepositoryVersionEntity.java | 82 +-
.../orm/entities/TopologyHostRequestEntity.java | 27 +
.../orm/entities/UserAuthenticationEntity.java | 189 +
.../ambari/server/orm/entities/UserEntity.java | 253 +-
.../authentication/AccountDisabledException.java | 27 +
.../AmbariAuthenticationEventHandler.java | 64 +
.../AmbariAuthenticationEventHandlerImpl.java | 168 +
.../AmbariAuthenticationException.java | 56 +
.../authentication/AmbariAuthenticationFilter.java | 10 +
.../AmbariAuthenticationProvider.java | 117 +
.../AmbariBasicAuthenticationFilter.java | 97 +-
.../AmbariJWTAuthenticationFilter.java | 140 -
.../AmbariLocalAuthenticationProvider.java | 113 +
.../authentication/AmbariUserAuthentication.java | 79 +
.../AuthenticationMethodNotAllowedException.java | 65 +
...nvalidUsernamePasswordCombinationException.java | 40 +
.../TooManyLoginFailuresException.java | 27 +
.../authentication/UserNotFoundException.java | 43 +
.../jwt/AmbariJwtAuthenticationFilter.java | 419 +
.../jwt/AmbariJwtAuthenticationProvider.java | 136 +
.../jwt/JwtAuthenticationProperties.java | 87 +
.../authentication/jwt/JwtAuthenticationToken.java | 55 +
.../AmbariAuthToLocalUserDetailsService.java | 163 +-
.../AmbariKerberosAuthenticationFilter.java | 76 +-
.../AmbariKerberosAuthenticationProperties.java | 26 +-
.../pam/AmbariPamAuthenticationProvider.java | 302 +
.../pam/PamAuthenticationFactory.java | 21 +-
.../authorization/AmbariAuthentication.java | 229 -
.../authorization/AmbariAuthorizationFilter.java | 4 +-
.../AmbariLdapAuthenticationProvider.java | 183 +-
.../AmbariLdapAuthoritiesPopulator.java | 5 +-
.../authorization/AmbariLdapBindAuthenticator.java | 13 +-
.../authorization/AmbariLocalUserProvider.java | 107 -
.../AmbariPamAuthenticationProvider.java | 252 -
.../authorization/AmbariUserAuthentication.java | 76 -
.../AmbariUserAuthorizationFilter.java | 12 +-
.../authorization/AuthenticationMethod.java | 37 +
.../authorization/AuthorizationHelper.java | 4 +-
...nvalidUsernamePasswordCombinationException.java | 34 -
.../authorization/LdapServerProperties.java | 99 +-
.../authorization/PamAuthenticationException.java | 36 -
.../ambari/server/security/authorization/User.java | 61 +-
.../authorization/UserAuthenticationType.java | 26 +
.../server/security/authorization/UserType.java | 25 -
.../server/security/authorization/Users.java | 1259 +-
.../AmbariInternalAuthenticationProvider.java | 4 +-
.../AuthenticationJwtUserNotFoundException.java | 43 -
.../authorization/jwt/JwtAuthentication.java | 34 -
.../authorization/jwt/JwtAuthenticationFilter.java | 423 -
.../jwt/JwtAuthenticationProperties.java | 87 -
.../security/ldap/AmbariLdapDataPopulator.java | 107 +-
.../ambari/server/security/ldap/LdapBatchDto.java | 32 +-
.../AbstractPrepareKerberosServerAction.java | 33 +-
.../serveraction/kerberos/CleanupServerAction.java | 6 +-
.../ConfigureAmbariIdentitiesServerAction.java | 143 +-
.../kerberos/CreateKeytabFilesServerAction.java | 112 +-
.../kerberos/CreatePrincipalsServerAction.java | 47 +-
.../kerberos/DestroyPrincipalsServerAction.java | 62 +-
.../kerberos/FinalizeKerberosServerAction.java | 24 +-
.../kerberos/KerberosOperationHandler.java | 14 +-
.../kerberos/KerberosServerAction.java | 291 +-
.../PrepareEnableKerberosServerAction.java | 16 +-
.../PrepareKerberosIdentitiesServerAction.java | 9 -
.../stageutils/KerberosKeytabController.java | 213 +
.../stageutils/ResolvedKerberosKeytab.java | 117 +-
.../stageutils/ResolvedKerberosPrincipal.java | 169 +
.../serveraction/upgrades/ConfigureAction.java | 51 +-
.../upgrades/PreconfigureKerberosAction.java | 12 +-
.../server/stack/ClassifyNameNodeException.java | 26 +
.../org/apache/ambari/server/stack/HostsType.java | 152 +-
.../ambari/server/stack/MasterHostResolver.java | 209 +-
.../apache/ambari/server/stack/NameService.java | 157 +
.../ambari/server/stack/NoSuchStackException.java | 14 +-
.../org/apache/ambari/server/stack/RepoUtil.java | 33 +-
.../apache/ambari/server/stack/ServiceModule.java | 22 +-
.../apache/ambari/server/stack/StackDirectory.java | 12 +-
.../apache/ambari/server/stack/StackModule.java | 9 +
.../stack/UpdateActiveRepoVersionOnStartup.java | 7 +-
.../java/org/apache/ambari/server/state/Alert.java | 1 +
.../org/apache/ambari/server/state/Cluster.java | 9 +
.../server/state/CommandScriptDefinition.java | 12 +-
.../apache/ambari/server/state/ComponentInfo.java | 33 +-
.../apache/ambari/server/state/ConfigHelper.java | 7 +-
.../apache/ambari/server/state/DependencyInfo.java | 5 +
.../org/apache/ambari/server/state/Module.java | 163 +
.../ambari/server/state/ModuleComponent.java | 109 +
.../ambari/server/state/ModuleDependency.java | 88 +
.../java/org/apache/ambari/server/state/Mpack.java | 253 +-
.../org/apache/ambari/server/state/Packlet.java | 167 -
.../ambari/server/state/RequiredService.java | 63 +
.../ambari/server/state/ServiceCategory.java | 39 +
.../ambari/server/state/ServiceDependencyType.java | 36 +
.../apache/ambari/server/state/ServiceInfo.java | 23 +-
.../apache/ambari/server/state/UpgradeContext.java | 14 +
.../apache/ambari/server/state/UpgradeHelper.java | 51 +-
.../ambari/server/state/alert/AlertDefinition.java | 13 +
.../server/state/alert/AlertDefinitionFactory.java | 31 +-
.../apache/ambari/server/state/alert/AlertUri.java | 41 +
.../ambari/server/state/alert/MetricSource.java | 66 +-
.../ambari/server/state/alert/Reporting.java | 38 +
.../ambari/server/state/alert/ScriptSource.java | 4 +
.../ambari/server/state/alert/ServerSource.java | 15 +
.../ambari/server/state/cluster/ClusterImpl.java | 68 +-
.../ambari/server/state/cluster/ClustersImpl.java | 8 +-
.../ambari/server/state/quicklinks/Host.java | 75 +
.../ambari/server/state/quicklinks/Link.java | 13 +
.../state/repository/VersionDefinitionXml.java | 59 +-
.../state/services/AmbariServerAlertService.java | 7 +-
.../state/services/MetricsRetrievalService.java | 8 +-
.../server/state/stack/MetricDefinition.java | 9 +-
.../state/stack/upgrade/ClusterGrouping.java | 27 +-
.../state/stack/upgrade/ColocatedGrouping.java | 7 +-
.../server/state/stack/upgrade/Grouping.java | 2 +-
.../state/stack/upgrade/HostOrderGrouping.java | 2 +-
.../stack/upgrade/RepositoryVersionHelper.java | 155 +-
.../state/stack/upgrade/StageWrapperBuilder.java | 10 +-
.../ambari/server/state/stack/upgrade/Task.java | 7 +
.../state/stack/upgrade/TaskWrapperBuilder.java | 16 +-
.../svccomphost/ServiceComponentHostImpl.java | 2 +-
.../ambari/server/topology/AmbariContext.java | 177 +-
.../server/topology/AsyncCallableService.java | 28 +-
.../apache/ambari/server/topology/Blueprint.java | 63 +-
.../ambari/server/topology/BlueprintFactory.java | 191 +-
.../ambari/server/topology/BlueprintImpl.java | 350 +-
.../ambari/server/topology/BlueprintValidator.java | 10 +-
.../server/topology/BlueprintValidatorImpl.java | 135 +-
.../topology/ClusterConfigurationRequest.java | 10 +-
.../apache/ambari/server/topology/Component.java | 57 +-
.../ambari/server/topology/Configurable.java | 93 +
.../ambari/server/topology/Configuration.java | 24 +
.../server/topology/ConfigurationFactory.java | 14 +-
.../apache/ambari/server/topology/HostGroup.java | 35 +-
.../ambari/server/topology/HostGroupImpl.java | 131 +-
.../ambari/server/topology/HostGroupInfo.java | 10 +
.../ambari/server/topology/HostOfferResponse.java | 23 +-
.../apache/ambari/server/topology/HostRequest.java | 56 +-
.../ambari/server/topology/LogicalRequest.java | 44 +
.../server/topology/ManagementPackMapping.java | 67 +
.../ambari/server/topology/MpackInstance.java | 159 +
.../ambari/server/topology/PersistedState.java | 5 +
.../ambari/server/topology/PersistedStateImpl.java | 11 +
.../server/topology/SecurityConfiguration.java | 2 +
.../ambari/server/topology/ServiceInstance.java | 72 +
.../ambari/server/topology/TopologyManager.java | 70 +-
.../topology/tasks/ConfigureClusterTask.java | 5 +-
.../topology/tasks/PersistHostResourcesTask.java | 2 +-
.../server/topology/tasks/TopologyHostTask.java | 4 +
.../ambari/server/topology/tasks/TopologyTask.java | 20 +-
.../topology/validators/HiveServiceValidator.java | 2 +-
.../validators/RequiredPasswordValidator.java | 3 +-
.../server/topology/validators/UnitValidator.java | 12 +-
.../upgrade/AbstractFinalUpgradeCatalog.java | 58 +
.../server/upgrade/AbstractUpgradeCatalog.java | 24 +-
.../ambari/server/upgrade/FinalUpgradeCatalog.java | 28 +-
.../ambari/server/upgrade/SchemaUpgradeHelper.java | 2 +
.../server/upgrade/UpdateAlertScriptPaths.java | 48 +
.../ambari/server/upgrade/UpgradeCatalog252.java | 7 +-
.../ambari/server/upgrade/UpgradeCatalog260.java | 3 +
.../ambari/server/upgrade/UpgradeCatalog262.java | 70 +
.../ambari/server/upgrade/UpgradeCatalog300.java | 666 +-
.../org/apache/ambari/server/utils/JsonUtils.java | 31 +
.../apache/ambari/server/utils/ModuleVersion.java | 162 +
.../apache/ambari/server/utils/MpackVersion.java | 197 +
.../apache/ambari/server/utils/PasswordUtils.java | 183 +
.../src/main/package/rpm/posttrans_server.sh | 20 -
ambari-server/src/main/python/ambari-server.py | 23 +-
.../python/ambari_server/dbConfiguration_linux.py | 26 +-
.../main/python/ambari_server/kerberos_setup.py | 2 -
.../python/ambari_server/serverConfiguration.py | 7 +-
.../src/main/python/ambari_server/serverUpgrade.py | 8 +-
.../src/main/python/ambari_server/setupSecurity.py | 219 +-
ambari-server/src/main/python/bootstrap.py | 4 +-
.../src/main/resources/Ambari-DDL-Derby-CREATE.sql | 196 +-
.../src/main/resources/Ambari-DDL-MySQL-CREATE.sql | 202 +-
.../main/resources/Ambari-DDL-Oracle-CREATE.sql | 204 +-
.../main/resources/Ambari-DDL-Postgres-CREATE.sql | 160 +-
.../resources/Ambari-DDL-SQLAnywhere-CREATE.sql | 192 +-
.../main/resources/Ambari-DDL-SQLServer-CREATE.sql | 203 +-
.../src/main/resources/META-INF/persistence.xml | 10 +-
.../ACCUMULO/1.6.1.2.2.0/metainfo.xml | 10 +-
.../0.1.0/configuration/infra-solr-env.xml | 29 +-
.../AMBARI_INFRA/0.1.0/metainfo.xml | 5 +-
.../0.1.0/package/scripts/infra_solr.py | 2 +-
.../AMBARI_INFRA/0.1.0/package/scripts/params.py | 27 +-
.../0.1.0/package/scripts/setup_infra_solr.py | 37 +-
.../0.1.0/properties/infra-solr-env.sh.j2 | 1 +
.../AMBARI_METRICS/0.1.0/metainfo.xml | 5 +-
.../common-services/ATLAS/0.7.0.2.5/metainfo.xml | 5 +-
.../common-services/ATLAS/0.7.0.3.0/alerts.json | 39 -
.../configuration/application-properties.xml | 546 -
.../ATLAS/0.7.0.3.0/configuration/atlas-env.xml | 200 -
.../ATLAS/0.7.0.3.0/configuration/atlas-log4j.xml | 170 -
.../0.7.0.3.0/configuration/atlas-solrconfig.xml | 641 -
.../0.7.0.3.0/configuration/ranger-atlas-audit.xml | 141 -
.../ranger-atlas-plugin-properties.xml | 132 -
.../configuration/ranger-atlas-policymgr-ssl.xml | 73 -
.../configuration/ranger-atlas-security.xml | 77 -
.../common-services/ATLAS/0.7.0.3.0/kerberos.json | 103 -
.../common-services/ATLAS/0.7.0.3.0/metainfo.xml | 190 -
.../0.7.0.3.0/package/scripts/atlas_client.py | 53 -
.../ATLAS/0.7.0.3.0/package/scripts/metadata.py | 243 -
.../0.7.0.3.0/package/scripts/metadata_server.py | 183 -
.../ATLAS/0.7.0.3.0/package/scripts/params.py | 419 -
.../0.7.0.3.0/package/scripts/service_check.py | 55 -
.../package/scripts/setup_ranger_atlas.py | 70 -
.../0.7.0.3.0/package/scripts/status_params.py | 60 -
.../package/templates/atlas_hbase_setup.rb.j2 | 42 -
.../0.7.0.3.0/package/templates/atlas_jaas.conf.j2 | 26 -
.../package/templates/atlas_kafka_acl.sh.j2 | 41 -
.../package/templates/input.config-atlas.json.j2 | 48 -
.../0.7.0.3.0/package/templates/kafka_jaas.conf.j2 | 41 -
.../ATLAS/0.7.0.3.0/quicklinks/quicklinks.json | 36 -
.../ATLAS/0.7.0.3.0/role_command_order.json | 7 -
.../ATLAS/0.7.0.3.0/service_advisor.py | 444 -
.../ATLAS/0.7.0.3.0/themes/theme.json | 619 -
.../ATLAS/0.7.0.3.0/themes/theme_version_2.json | 845 -
.../common-services/DRUID/0.10.1/metainfo.xml | 5 +-
.../common-services/FALCON/0.5.0.2.1/metainfo.xml | 5 +-
.../common-services/HAWQ/2.0.0/metainfo.xml | 5 +-
.../common-services/HBASE/0.96.0.2.0/metainfo.xml | 10 +-
.../HBASE/0.96.0.2.0/package/scripts/hbase.py | 26 +-
.../common-services/HBASE/2.0.0.3.0/alerts.json | 127 -
.../HBASE/2.0.0.3.0/configuration/hbase-env.xml | 285 -
.../HBASE/2.0.0.3.0/configuration/hbase-log4j.xml | 188 -
.../HBASE/2.0.0.3.0/configuration/hbase-policy.xml | 53 -
.../HBASE/2.0.0.3.0/configuration/hbase-site.xml | 774 -
.../2.0.0.3.0/configuration/ranger-hbase-audit.xml | 132 -
.../ranger-hbase-plugin-properties.xml | 135 -
.../configuration/ranger-hbase-policymgr-ssl.xml | 66 -
.../configuration/ranger-hbase-security.xml | 74 -
.../common-services/HBASE/2.0.0.3.0/kerberos.json | 165 -
.../common-services/HBASE/2.0.0.3.0/metainfo.xml | 232 -
.../common-services/HBASE/2.0.0.3.0/metrics.json | 4733 ---
.../2.0.0.3.0/package/files/draining_servers.rb | 164 -
.../2.0.0.3.0/package/files/hbase-smoke-cleanup.sh | 23 -
.../2.0.0.3.0/package/files/hbaseSmokeVerify.sh | 34 -
.../HBASE/2.0.0.3.0/package/scripts/__init__.py | 19 -
.../HBASE/2.0.0.3.0/package/scripts/functions.py | 54 -
.../HBASE/2.0.0.3.0/package/scripts/hbase.py | 230 -
.../2.0.0.3.0/package/scripts/hbase_client.py | 69 -
.../package/scripts/hbase_decommission.py | 94 -
.../2.0.0.3.0/package/scripts/hbase_master.py | 160 -
.../package/scripts/hbase_regionserver.py | 171 -
.../2.0.0.3.0/package/scripts/hbase_service.py | 66 -
.../2.0.0.3.0/package/scripts/hbase_upgrade.py | 42 -
.../HBASE/2.0.0.3.0/package/scripts/params.py | 28 -
.../2.0.0.3.0/package/scripts/params_linux.py | 426 -
.../2.0.0.3.0/package/scripts/params_windows.py | 43 -
.../package/scripts/phoenix_queryserver.py | 86 -
.../2.0.0.3.0/package/scripts/phoenix_service.py | 56 -
.../2.0.0.3.0/package/scripts/service_check.py | 99 -
.../package/scripts/setup_ranger_hbase.py | 106 -
.../2.0.0.3.0/package/scripts/status_params.py | 68 -
.../HBASE/2.0.0.3.0/package/scripts/upgrade.py | 105 -
.../2.0.0.3.0/package/templates/hbase-smoke.sh.j2 | 44 -
.../2.0.0.3.0/package/templates/hbase.conf.j2 | 35 -
.../package/templates/hbase_client_jaas.conf.j2 | 23 -
.../package/templates/hbase_grant_permissions.j2 | 39 -
.../package/templates/hbase_master_jaas.conf.j2 | 36 -
.../templates/hbase_queryserver_jaas.conf.j2 | 26 -
.../templates/hbase_regionserver_jaas.conf.j2 | 36 -
.../package/templates/input.config-hbase.json.j2 | 79 -
.../2.0.0.3.0/package/templates/regionservers.j2 | 20 -
.../HBASE/2.0.0.3.0/quicklinks/quicklinks.json | 97 -
.../HBASE/2.0.0.3.0/role_command_order.json | 10 -
.../HBASE/2.0.0.3.0/service_advisor.py | 685 -
.../HBASE/2.0.0.3.0/themes/theme.json | 407 -
.../common-services/HBASE/2.0.0.3.0/widgets.json | 510 -
.../HDFS/2.1.0.2.0/configuration/hadoop-env.xml | 1 +
.../common-services/HDFS/2.1.0.2.0/metainfo.xml | 1 +
.../common-services/HDFS/3.0.0.3.0/alerts.json | 1786 --
.../HDFS/3.0.0.3.0/configuration/core-site.xml | 224 -
.../HDFS/3.0.0.3.0/configuration/hadoop-env.xml | 436 -
.../configuration/hadoop-metrics2.properties.xml | 127 -
.../HDFS/3.0.0.3.0/configuration/hadoop-policy.xml | 130 -
.../HDFS/3.0.0.3.0/configuration/hdfs-log4j.xml | 227 -
.../configuration/hdfs-logsearch-conf.xml | 248 -
.../HDFS/3.0.0.3.0/configuration/hdfs-site.xml | 647 -
.../3.0.0.3.0/configuration/ranger-hdfs-audit.xml | 132 -
.../ranger-hdfs-plugin-properties.xml | 96 -
.../configuration/ranger-hdfs-policymgr-ssl.xml | 67 -
.../configuration/ranger-hdfs-security.xml | 65 -
.../HDFS/3.0.0.3.0/configuration/ssl-client.xml | 70 -
.../HDFS/3.0.0.3.0/configuration/ssl-server.xml | 80 -
.../common-services/HDFS/3.0.0.3.0/kerberos.json | 254 -
.../common-services/HDFS/3.0.0.3.0/metainfo.xml | 375 -
.../common-services/HDFS/3.0.0.3.0/metrics.json | 7905 -----
.../package/alerts/alert_checkpoint_time.py | 255 -
.../alerts/alert_datanode_unmounted_data_dir.py | 177 -
.../package/alerts/alert_ha_namenode_health.py | 243 -
.../package/alerts/alert_metrics_deviation.py | 478 -
.../package/alerts/alert_upgrade_finalized.py | 179 -
.../HDFS/3.0.0.3.0/package/files/checkWebUI.py | 83 -
.../HDFS/3.0.0.3.0/package/scripts/__init__.py | 20 -
.../scripts/balancer-emulator/balancer-err.log | 1032 -
.../package/scripts/balancer-emulator/balancer.log | 29 -
.../scripts/balancer-emulator/hdfs-command.py | 45 -
.../HDFS/3.0.0.3.0/package/scripts/datanode.py | 126 -
.../3.0.0.3.0/package/scripts/datanode_upgrade.py | 156 -
.../HDFS/3.0.0.3.0/package/scripts/hdfs.py | 251 -
.../HDFS/3.0.0.3.0/package/scripts/hdfs_client.py | 78 -
.../3.0.0.3.0/package/scripts/hdfs_datanode.py | 85 -
.../3.0.0.3.0/package/scripts/hdfs_namenode.py | 613 -
.../3.0.0.3.0/package/scripts/hdfs_nfsgateway.py | 75 -
.../3.0.0.3.0/package/scripts/hdfs_rebalance.py | 156 -
.../3.0.0.3.0/package/scripts/hdfs_snamenode.py | 72 -
.../3.0.0.3.0/package/scripts/install_params.py | 29 -
.../HDFS/3.0.0.3.0/package/scripts/journalnode.py | 143 -
.../package/scripts/journalnode_upgrade.py | 152 -
.../HDFS/3.0.0.3.0/package/scripts/namenode.py | 381 -
.../3.0.0.3.0/package/scripts/namenode_ha_state.py | 219 -
.../3.0.0.3.0/package/scripts/namenode_upgrade.py | 322 -
.../HDFS/3.0.0.3.0/package/scripts/nfsgateway.py | 88 -
.../HDFS/3.0.0.3.0/package/scripts/params.py | 28 -
.../HDFS/3.0.0.3.0/package/scripts/params_linux.py | 551 -
.../3.0.0.3.0/package/scripts/params_windows.py | 86 -
.../3.0.0.3.0/package/scripts/service_check.py | 158 -
.../3.0.0.3.0/package/scripts/setup_ranger_hdfs.py | 120 -
.../HDFS/3.0.0.3.0/package/scripts/snamenode.py | 101 -
.../HDFS/3.0.0.3.0/package/scripts/utils.py | 428 -
.../HDFS/3.0.0.3.0/package/scripts/zkfc_slave.py | 184 -
.../package/templates/exclude_hosts_list.j2 | 21 -
.../HDFS/3.0.0.3.0/package/templates/hdfs.conf.j2 | 35 -
.../package/templates/hdfs_dn_jaas.conf.j2 | 27 -
.../3.0.0.3.0/package/templates/hdfs_jaas.conf.j2 | 27 -
.../package/templates/hdfs_jn_jaas.conf.j2 | 27 -
.../package/templates/hdfs_nn_jaas.conf.j2 | 27 -
.../package/templates/include_hosts_list.j2 | 21 -
.../HDFS/3.0.0.3.0/package/templates/slaves.j2 | 21 -
.../HDFS/3.0.0.3.0/quicklinks/quicklinks.json | 80 -
.../HDFS/3.0.0.3.0/service_advisor.py | 676 -
.../HDFS/3.0.0.3.0/themes/theme.json | 179 -
.../common-services/HDFS/3.0.0.3.0/widgets.json | 649 -
.../HIVE/0.12.0.2.0/configuration/hive-env.xml | 1 +
.../common-services/HIVE/0.12.0.2.0/metainfo.xml | 15 +-
.../HIVE/0.12.0.2.0/package/scripts/hive.py | 10 +-
.../package/scripts/hive_server_interactive.py | 3 +-
.../0.12.0.2.0/package/scripts/params_linux.py | 2 +
.../common-services/HIVE/2.1.0.3.0/alerts.json | 232 -
.../2.1.0.3.0/configuration/beeline-log4j2.xml | 80 -
.../HIVE/2.1.0.3.0/configuration/hcat-env.xml | 60 -
.../hive-atlas-application.properties.xml | 61 -
.../HIVE/2.1.0.3.0/configuration/hive-env.xml | 508 -
.../2.1.0.3.0/configuration/hive-exec-log4j.xml | 114 -
.../2.1.0.3.0/configuration/hive-exec-log4j2.xml | 101 -
.../configuration/hive-interactive-env.xml | 331 -
.../configuration/hive-interactive-site.xml | 762 -
.../HIVE/2.1.0.3.0/configuration/hive-log4j.xml | 147 -
.../HIVE/2.1.0.3.0/configuration/hive-log4j2.xml | 131 -
.../configuration/hive-logsearch-conf.xml | 117 -
.../HIVE/2.1.0.3.0/configuration/hive-site.xml | 2052 --
.../2.1.0.3.0/configuration/hivemetastore-site.xml | 46 -
.../configuration/hiveserver2-interactive-site.xml | 55 -
.../2.1.0.3.0/configuration/hiveserver2-site.xml | 110 -
.../2.1.0.3.0/configuration/llap-cli-log4j2.xml | 148 -
.../2.1.0.3.0/configuration/llap-daemon-log4j.xml | 210 -
.../2.1.0.3.0/configuration/parquet-logging.xml | 106 -
.../2.1.0.3.0/configuration/ranger-hive-audit.xml | 130 -
.../ranger-hive-plugin-properties.xml | 127 -
.../configuration/ranger-hive-policymgr-ssl.xml | 66 -
.../configuration/ranger-hive-security.xml | 83 -
.../configuration/tez-interactive-site.xml | 257 -
.../HIVE/2.1.0.3.0/configuration/webhcat-env.xml | 57 -
.../HIVE/2.1.0.3.0/configuration/webhcat-log4j.xml | 104 -
.../HIVE/2.1.0.3.0/configuration/webhcat-site.xml | 193 -
.../common-services/HIVE/2.1.0.3.0/kerberos.json | 161 -
.../common-services/HIVE/2.1.0.3.0/metainfo.xml | 521 -
.../alerts/alert_hive_interactive_thrift_port.py | 230 -
.../package/alerts/alert_hive_metastore.py | 273 -
.../package/alerts/alert_hive_thrift_port.py | 285 -
.../package/alerts/alert_llap_app_status.py | 299 -
.../package/alerts/alert_webhcat_server.py | 228 -
.../package/etc/hive-schema-0.12.0.mysql.sql | 777 -
.../package/etc/hive-schema-0.12.0.oracle.sql | 718 -
.../package/etc/hive-schema-0.12.0.postgres.sql | 1406 -
.../package/etc/hive-schema-0.13.0.mysql.sql | 889 -
.../package/etc/hive-schema-0.13.0.oracle.sql | 835 -
.../package/etc/hive-schema-0.13.0.postgres.sql | 1538 -
.../etc/upgrade-0.12.0-to-0.13.0.oracle.sql | 165 -
.../package/etc/upgrade-0.13.0.oracle.sql | 38 -
.../HIVE/2.1.0.3.0/package/files/addMysqlUser.sh | 39 -
.../HIVE/2.1.0.3.0/package/files/hcatSmoke.sh | 41 -
.../HIVE/2.1.0.3.0/package/files/hiveSmoke.sh | 24 -
.../HIVE/2.1.0.3.0/package/files/hiveTezSetup.cmd | 58 -
.../HIVE/2.1.0.3.0/package/files/hiveserver2.sql | 23 -
.../2.1.0.3.0/package/files/hiveserver2Smoke.sh | 32 -
.../HIVE/2.1.0.3.0/package/files/pigSmoke.sh | 18 -
.../2.1.0.3.0/package/files/removeMysqlUser.sh | 33 -
.../HIVE/2.1.0.3.0/package/files/startMetastore.sh | 25 -
.../HIVE/2.1.0.3.0/package/files/templetonSmoke.sh | 101 -
.../HIVE/2.1.0.3.0/package/scripts/__init__.py | 19 -
.../HIVE/2.1.0.3.0/package/scripts/hcat.py | 87 -
.../HIVE/2.1.0.3.0/package/scripts/hcat_client.py | 78 -
.../package/scripts/hcat_service_check.py | 89 -
.../HIVE/2.1.0.3.0/package/scripts/hive.py | 561 -
.../HIVE/2.1.0.3.0/package/scripts/hive_client.py | 63 -
.../2.1.0.3.0/package/scripts/hive_interactive.py | 359 -
.../2.1.0.3.0/package/scripts/hive_metastore.py | 211 -
.../HIVE/2.1.0.3.0/package/scripts/hive_server.py | 164 -
.../package/scripts/hive_server_interactive.py | 610 -
.../package/scripts/hive_server_upgrade.py | 140 -
.../HIVE/2.1.0.3.0/package/scripts/hive_service.py | 181 -
.../package/scripts/hive_service_interactive.py | 109 -
.../HIVE/2.1.0.3.0/package/scripts/mysql_server.py | 63 -
.../2.1.0.3.0/package/scripts/mysql_service.py | 51 -
.../HIVE/2.1.0.3.0/package/scripts/mysql_users.py | 72 -
.../HIVE/2.1.0.3.0/package/scripts/mysql_utils.py | 35 -
.../HIVE/2.1.0.3.0/package/scripts/params.py | 30 -
.../HIVE/2.1.0.3.0/package/scripts/params_linux.py | 852 -
.../2.1.0.3.0/package/scripts/params_windows.py | 75 -
.../2.1.0.3.0/package/scripts/service_check.py | 192 -
.../2.1.0.3.0/package/scripts/setup_ranger_hive.py | 156 -
.../scripts/setup_ranger_hive_interactive.py | 77 -
.../2.1.0.3.0/package/scripts/status_params.py | 118 -
.../HIVE/2.1.0.3.0/package/scripts/webhcat.py | 139 -
.../2.1.0.3.0/package/scripts/webhcat_server.py | 95 -
.../2.1.0.3.0/package/scripts/webhcat_service.py | 100 -
.../package/scripts/webhcat_service_check.py | 133 -
.../hadoop-metrics2-hivemetastore.properties.j2 | 58 -
.../hadoop-metrics2-hiveserver2.properties.j2 | 57 -
.../templates/hadoop-metrics2-llapdaemon.j2 | 56 -
.../templates/hadoop-metrics2-llaptaskscheduler.j2 | 56 -
.../HIVE/2.1.0.3.0/package/templates/hive.conf.j2 | 35 -
.../package/templates/startHiveserver2.sh.j2 | 24 -
.../templates/startHiveserver2Interactive.sh.j2 | 24 -
.../package/templates/templeton_smoke.pig.j2 | 24 -
.../package/templates/zkmigrator_jaas.conf.j2 | 26 -
.../HIVE/2.1.0.3.0/quicklinks/quicklinks.json | 62 -
.../HIVE/2.1.0.3.0/service_advisor.py | 1166 -
.../HIVE/2.1.0.3.0/themes/theme.json | 753 -
.../common-services/KAFKA/0.10.0.3.0/alerts.json | 32 -
.../0.10.0.3.0/configuration/kafka-broker.xml | 559 -
.../KAFKA/0.10.0.3.0/configuration/kafka-env.xml | 117 -
.../KAFKA/0.10.0.3.0/configuration/kafka-log4j.xml | 170 -
.../configuration/kafka_client_jaas_conf.xml | 41 -
.../0.10.0.3.0/configuration/kafka_jaas_conf.xml | 59 -
.../configuration/ranger-kafka-audit.xml | 130 -
.../ranger-kafka-plugin-properties.xml | 154 -
.../configuration/ranger-kafka-policymgr-ssl.xml | 66 -
.../configuration/ranger-kafka-security.xml | 64 -
.../common-services/KAFKA/0.10.0.3.0/kerberos.json | 82 -
.../common-services/KAFKA/0.10.0.3.0/metainfo.xml | 111 -
.../common-services/KAFKA/0.10.0.3.0/metrics.json | 239 -
.../KAFKA/0.10.0.3.0/package/scripts/kafka.py | 257 -
.../0.10.0.3.0/package/scripts/kafka_broker.py | 145 -
.../KAFKA/0.10.0.3.0/package/scripts/params.py | 341 -
.../0.10.0.3.0/package/scripts/service_check.py | 70 -
.../package/scripts/setup_ranger_kafka.py | 90 -
.../0.10.0.3.0/package/scripts/status_params.py | 26 -
.../KAFKA/0.10.0.3.0/package/scripts/upgrade.py | 75 -
.../KAFKA/0.10.0.3.0/package/scripts/utils.py | 38 -
.../package/templates/input.config-kafka.json.j2 | 92 -
.../0.10.0.3.0/package/templates/kafka.conf.j2 | 35 -
.../package/templates/kafka_client_jaas.conf.j2 | 29 -
.../package/templates/kafka_jaas.conf.j2 | 41 -
.../package/templates/tools-log4j.properties.j2 | 21 -
.../KAFKA/0.10.0.3.0/role_command_order.json | 7 -
.../KAFKA/0.10.0.3.0/service_advisor.py | 368 -
.../common-services/KAFKA/0.10.0.3.0/widgets.json | 182 -
.../KAFKA/0.10.0/configuration/kafka-broker.xml | 2 +-
.../common-services/KAFKA/0.8.1/metainfo.xml | 5 +-
.../KAFKA/0.8.1/package/scripts/kafka.py | 6 +-
.../KAFKA/0.8.1/package/scripts/params.py | 6 +-
.../0.8.1/package/scripts/setup_ranger_kafka.py | 15 +-
.../1.10.3-10/configuration/kerberos-env.xml | 6 +-
.../KERBEROS/1.10.3-10/configuration/krb5-conf.xml | 11 +
.../1.10.3-10/package/scripts/kerberos_client.py | 57 +-
.../1.10.3-10/package/scripts/kerberos_common.py | 493 -
.../KERBEROS/1.10.3-10/package/scripts/params.py | 6 +-
.../1.10.3-10/package/scripts/service_check.py | 32 +-
.../KERBEROS/1.10.3-10/package/scripts/utils.py | 105 -
.../KERBEROS/1.10.3-10/properties/krb5_conf.j2 | 3 +
.../1.10.3-30/configuration/kerberos-env.xml | 6 +-
.../KERBEROS/1.10.3-30/configuration/krb5-conf.xml | 11 +
.../1.10.3-30/package/scripts/kerberos_client.py | 57 +-
.../1.10.3-30/package/scripts/kerberos_common.py | 493 -
.../KERBEROS/1.10.3-30/package/scripts/params.py | 7 +-
.../1.10.3-30/package/scripts/service_check.py | 32 +-
.../KERBEROS/1.10.3-30/package/scripts/utils.py | 105 -
.../KERBEROS/1.10.3-30/properties/krb5_conf.j2 | 3 +
.../0.5.0.2.2/package/scripts/setup_ranger_knox.py | 16 +-
.../common-services/KNOX/0.5.0.3.0/alerts.json | 32 -
.../0.5.0.3.0/configuration/admin-topology.xml | 97 -
.../KNOX/0.5.0.3.0/configuration/gateway-log4j.xml | 110 -
.../KNOX/0.5.0.3.0/configuration/gateway-site.xml | 71 -
.../KNOX/0.5.0.3.0/configuration/knox-env.xml | 93 -
.../0.5.0.3.0/configuration/knoxsso-topology.xml | 126 -
.../KNOX/0.5.0.3.0/configuration/ldap-log4j.xml | 93 -
.../0.5.0.3.0/configuration/ranger-knox-audit.xml | 132 -
.../ranger-knox-plugin-properties.xml | 132 -
.../configuration/ranger-knox-policymgr-ssl.xml | 66 -
.../configuration/ranger-knox-security.xml | 64 -
.../KNOX/0.5.0.3.0/configuration/topology.xml | 174 -
.../KNOX/0.5.0.3.0/configuration/users-ldif.xml | 140 -
.../common-services/KNOX/0.5.0.3.0/kerberos.json | 82 -
.../common-services/KNOX/0.5.0.3.0/metainfo.xml | 109 -
.../0.5.0.3.0/package/files/validateKnoxStatus.py | 43 -
.../KNOX/0.5.0.3.0/package/scripts/knox.py | 192 -
.../KNOX/0.5.0.3.0/package/scripts/knox_gateway.py | 215 -
.../KNOX/0.5.0.3.0/package/scripts/knox_ldap.py | 59 -
.../KNOX/0.5.0.3.0/package/scripts/params.py | 29 -
.../KNOX/0.5.0.3.0/package/scripts/params_linux.py | 566 -
.../0.5.0.3.0/package/scripts/params_windows.py | 71 -
.../0.5.0.3.0/package/scripts/service_check.py | 96 -
.../0.5.0.3.0/package/scripts/setup_ranger_knox.py | 121 -
.../0.5.0.3.0/package/scripts/status_params.py | 59 -
.../KNOX/0.5.0.3.0/package/scripts/upgrade.py | 118 -
.../package/templates/input.config-knox.json.j2 | 60 -
.../package/templates/krb5JAASLogin.conf.j2 | 27 -
.../KNOX/0.5.0.3.0/role_command_order.json | 7 -
.../KNOX/0.5.0.3.0/service_advisor.py | 253 -
.../0.5.0/configuration/logfeeder-env.xml | 2 +-
.../0.5.0/configuration/logfeeder-properties.xml | 2 +-
.../0.5.0/configuration/logsearch-common-env.xml | 20 +
.../0.5.0/configuration/logsearch-env.xml | 6 +-
.../LOGSEARCH/0.5.0/package/scripts/logfeeder.py | 7 +-
.../LOGSEARCH/0.5.0/package/scripts/logsearch.py | 8 +-
.../0.5.0/package/scripts/logsearch_common.py | 54 -
.../LOGSEARCH/0.5.0/package/scripts/params.py | 15 +-
.../0.5.0/package/scripts/setup_logfeeder.py | 2 +-
.../0.5.0/package/scripts/setup_logsearch.py | 5 +-
.../LOGSEARCH/0.5.0/properties/logfeeder-env.sh.j2 | 9 +-
.../LOGSEARCH/0.5.0/properties/logsearch-env.sh.j2 | 9 +-
.../common-services/MAHOUT/1.0.0.2.3/metainfo.xml | 5 +-
.../MAHOUT/1.0.0.2.3/package/scripts/mahout.py | 12 +-
.../OOZIE/4.0.0.2.0/configuration/oozie-env.xml | 1 +
.../common-services/OOZIE/4.0.0.2.0/metainfo.xml | 5 +-
.../package/scripts/oozie_server_upgrade.py | 24 +-
.../common-services/OOZIE/4.2.0.2.3/metainfo.xml | 5 +-
.../common-services/OOZIE/4.2.0.3.0/alerts.json | 45 -
.../OOZIE/4.2.0.3.0/configuration/oozie-env.xml | 265 -
.../OOZIE/4.2.0.3.0/configuration/oozie-log4j.xml | 149 -
.../OOZIE/4.2.0.3.0/configuration/oozie-site.xml | 254 -
.../common-services/OOZIE/4.2.0.3.0/kerberos.json | 74 -
.../common-services/OOZIE/4.2.0.3.0/metainfo.xml | 193 -
.../package/alerts/alert_check_oozie_server.py | 244 -
.../OOZIE/4.2.0.3.0/package/files/oozieSmoke2.sh | 84 -
.../package/files/prepareOozieHdfsDirectories.sh | 42 -
.../OOZIE/4.2.0.3.0/package/files/wrap_ooziedb.sh | 31 -
.../package/scripts/check_oozie_server_status.py | 38 -
.../OOZIE/4.2.0.3.0/package/scripts/oozie.py | 509 -
.../4.2.0.3.0/package/scripts/oozie_client.py | 74 -
.../4.2.0.3.0/package/scripts/oozie_server.py | 155 -
.../package/scripts/oozie_server_upgrade.py | 237 -
.../4.2.0.3.0/package/scripts/oozie_service.py | 188 -
.../OOZIE/4.2.0.3.0/package/scripts/params.py | 39 -
.../4.2.0.3.0/package/scripts/params_linux.py | 370 -
.../4.2.0.3.0/package/scripts/params_windows.py | 34 -
.../4.2.0.3.0/package/scripts/service_check.py | 140 -
.../4.2.0.3.0/package/scripts/status_params.py | 65 -
.../4.2.0.3.0/package/templates/adminusers.txt.j2 | 28 -
.../package/templates/input.config-oozie.json.j2 | 48 -
.../package/templates/oozie-log4j.properties.j2 | 93 -
.../4.2.0.3.0/package/templates/oozie.conf.j2 | 35 -
.../package/templates/zkmigrator_jaas.conf.j2 | 26 -
.../OOZIE/4.2.0.3.0/quicklinks/quicklinks.json | 46 -
.../OOZIE/4.2.0.3.0/role_command_order.json | 9 -
.../OOZIE/4.2.0.3.0/service_advisor.py | 314 -
.../OOZIE/4.2.0.3.0/themes/theme.json | 116 -
.../common-services/PIG/0.12.0.2.0/metainfo.xml | 5 +-
.../PIG/0.12.0.2.0/package/scripts/pig.py | 16 +-
.../PIG/0.16.1.3.0/configuration/pig-env.xml | 41 -
.../PIG/0.16.1.3.0/configuration/pig-log4j.xml | 65 -
.../0.16.1.3.0/configuration/pig-properties.xml | 93 -
.../common-services/PIG/0.16.1.3.0/kerberos.json | 18 -
.../common-services/PIG/0.16.1.3.0/metainfo.xml | 101 -
.../PIG/0.16.1.3.0/package/files/pigSmoke.sh | 18 -
.../PIG/0.16.1.3.0/package/scripts/params.py | 31 -
.../PIG/0.16.1.3.0/package/scripts/params_linux.py | 104 -
.../0.16.1.3.0/package/scripts/params_windows.py | 45 -
.../PIG/0.16.1.3.0/package/scripts/pig.py | 80 -
.../PIG/0.16.1.3.0/package/scripts/pig_client.py | 66 -
.../0.16.1.3.0/package/scripts/service_check.py | 142 -
.../PIG/0.16.1.3.0/service_advisor.py | 171 -
.../common-services/PXF/3.0.0/metainfo.xml | 5 +-
.../RANGER/0.4.0/package/scripts/params.py | 4 +-
.../RANGER/0.4.0/package/scripts/ranger_admin.py | 10 +-
.../0.4.0/package/scripts/setup_ranger_xml.py | 19 +-
.../common-services/RANGER/1.0.0.3.0/alerts.json | 76 -
.../RANGER/1.0.0.3.0/configuration/admin-log4j.xml | 131 -
.../1.0.0.3.0/configuration/admin-properties.xml | 161 -
.../1.0.0.3.0/configuration/atlas-tagsync-ssl.xml | 72 -
.../1.0.0.3.0/configuration/ranger-admin-site.xml | 751 -
.../RANGER/1.0.0.3.0/configuration/ranger-env.xml | 536 -
.../configuration/ranger-solr-configuration.xml | 59 -
.../configuration/ranger-tagsync-policymgr-ssl.xml | 72 -
.../configuration/ranger-tagsync-site.xml | 201 -
.../1.0.0.3.0/configuration/ranger-ugsync-site.xml | 578 -
.../tagsync-application-properties.xml | 62 -
.../1.0.0.3.0/configuration/tagsync-log4j.xml | 89 -
.../1.0.0.3.0/configuration/usersync-log4j.xml | 88 -
.../common-services/RANGER/1.0.0.3.0/kerberos.json | 159 -
.../common-services/RANGER/1.0.0.3.0/metainfo.xml | 177 -
.../alerts/alert_ranger_admin_passwd_check.py | 195 -
.../RANGER/1.0.0.3.0/package/scripts/params.py | 450 -
.../1.0.0.3.0/package/scripts/ranger_admin.py | 217 -
.../1.0.0.3.0/package/scripts/ranger_service.py | 69 -
.../1.0.0.3.0/package/scripts/ranger_tagsync.py | 147 -
.../1.0.0.3.0/package/scripts/ranger_usersync.py | 117 -
.../1.0.0.3.0/package/scripts/service_check.py | 49 -
.../1.0.0.3.0/package/scripts/setup_ranger_xml.py | 853 -
.../1.0.0.3.0/package/scripts/status_params.py | 39 -
.../RANGER/1.0.0.3.0/package/scripts/upgrade.py | 29 -
.../package/templates/input.config-ranger.json.j2 | 79 -
.../package/templates/ranger_admin_pam.j2 | 22 -
.../package/templates/ranger_remote_pam.j2 | 22 -
.../package/templates/ranger_solr_jaas_conf.j2 | 26 -
.../1.0.0.3.0/properties/ranger-solrconfig.xml.j2 | 1874 --
.../RANGER/1.0.0.3.0/quicklinks/quicklinks.json | 41 -
.../RANGER/1.0.0.3.0/role_command_order.json | 9 -
.../RANGER/1.0.0.3.0/service_advisor.py | 774 -
.../RANGER/1.0.0.3.0/themes/theme_version_1.json | 1861 --
.../RANGER_KMS/0.5.0.2.3/metainfo.xml | 10 +-
.../RANGER_KMS/0.5.0.2.3/package/scripts/kms.py | 13 +-
.../0.5.0.2.3/package/scripts/kms_server.py | 6 +-
.../RANGER_KMS/1.0.0.3.0/alerts.json | 32 -
.../1.0.0.3.0/configuration/dbks-site.xml | 206 -
.../RANGER_KMS/1.0.0.3.0/configuration/kms-env.xml | 125 -
.../1.0.0.3.0/configuration/kms-log4j.xml | 118 -
.../1.0.0.3.0/configuration/kms-properties.xml | 166 -
.../1.0.0.3.0/configuration/kms-site.xml | 107 -
.../1.0.0.3.0/configuration/ranger-kms-audit.xml | 118 -
.../configuration/ranger-kms-policymgr-ssl.xml | 68 -
.../configuration/ranger-kms-security.xml | 64 -
.../1.0.0.3.0/configuration/ranger-kms-site.xml | 110 -
.../RANGER_KMS/1.0.0.3.0/kerberos.json | 81 -
.../RANGER_KMS/1.0.0.3.0/metainfo.xml | 111 -
.../RANGER_KMS/1.0.0.3.0/package/scripts/kms.py | 675 -
.../1.0.0.3.0/package/scripts/kms_server.py | 115 -
.../1.0.0.3.0/package/scripts/kms_service.py | 58 -
.../RANGER_KMS/1.0.0.3.0/package/scripts/params.py | 334 -
.../1.0.0.3.0/package/scripts/service_check.py | 41 -
.../1.0.0.3.0/package/scripts/status_params.py | 36 -
.../1.0.0.3.0/package/scripts/upgrade.py | 29 -
.../templates/input.config-ranger-kms.json.j2 | 48 -
.../RANGER_KMS/1.0.0.3.0/role_command_order.json | 7 -
.../RANGER_KMS/1.0.0.3.0/service_advisor.py | 359 -
.../1.0.0.3.0/themes/theme_version_1.json | 409 -
.../common-services/SLIDER/0.60.0.2.2/metainfo.xml | 15 +-
.../0.91.0.3.0/configuration/slider-client.xml | 56 -
.../SLIDER/0.91.0.3.0/configuration/slider-env.xml | 46 -
.../0.91.0.3.0/configuration/slider-log4j.xml | 92 -
.../SLIDER/0.91.0.3.0/kerberos.json | 18 -
.../common-services/SLIDER/0.91.0.3.0/metainfo.xml | 109 -
.../0.91.0.3.0/package/files/hbaseSmokeVerify.sh | 34 -
.../SLIDER/0.91.0.3.0/package/scripts/__init__.py | 19 -
.../SLIDER/0.91.0.3.0/package/scripts/params.py | 54 -
.../0.91.0.3.0/package/scripts/params_linux.py | 80 -
.../0.91.0.3.0/package/scripts/params_windows.py | 45 -
.../0.91.0.3.0/package/scripts/service_check.py | 63 -
.../SLIDER/0.91.0.3.0/package/scripts/slider.py | 100 -
.../0.91.0.3.0/package/scripts/slider_client.py | 61 -
.../package/templates/storm-slider-env.sh.j2 | 38 -
.../SLIDER/0.91.0.3.0/service_advisor.py | 134 -
.../common-services/SPARK/1.2.1/alerts.json | 2 +-
.../common-services/SPARK/1.2.1/metainfo.xml | 10 +-
.../SPARK/1.2.1/package/scripts/livy_service.py | 24 +-
.../SPARK/1.2.1/package/scripts/params.py | 2 +
.../SPARK/1.2.1/package/scripts/setup_spark.py | 20 +-
.../common-services/SPARK/1.3.1/metainfo.xml | 5 +-
.../common-services/SPARK/1.4.1/metainfo.xml | 5 +-
.../common-services/SPARK/1.5.2/metainfo.xml | 5 +-
.../common-services/SPARK/1.6.0/metainfo.xml | 15 +-
.../common-services/SPARK/2.2.0/alerts.json | 32 -
.../SPARK/2.2.0/configuration/livy-conf.xml | 114 -
.../SPARK/2.2.0/configuration/livy-env.xml | 107 -
.../2.2.0/configuration/livy-log4j-properties.xml | 42 -
.../2.2.0/configuration/livy-spark-blacklist.xml | 52 -
.../SPARK/2.2.0/configuration/spark-defaults.xml | 115 -
.../SPARK/2.2.0/configuration/spark-env.xml | 157 -
.../configuration/spark-hive-site-override.xml | 59 -
.../2.2.0/configuration/spark-log4j-properties.xml | 46 -
.../2.2.0/configuration/spark-logsearch-conf.xml | 98 -
.../configuration/spark-metrics-properties.xml | 165 -
.../configuration/spark-thrift-fairscheduler.xml | 36 -
.../2.2.0/configuration/spark-thrift-sparkconf.xml | 160 -
.../common-services/SPARK/2.2.0/kerberos.json | 127 -
.../common-services/SPARK/2.2.0/metainfo.xml | 283 -
.../2.2.0/package/scripts/job_history_server.py | 103 -
.../SPARK/2.2.0/package/scripts/livy_server.py | 146 -
.../SPARK/2.2.0/package/scripts/livy_service.py | 48 -
.../SPARK/2.2.0/package/scripts/params.py | 268 -
.../SPARK/2.2.0/package/scripts/service_check.py | 62 -
.../SPARK/2.2.0/package/scripts/setup_livy.py | 88 -
.../SPARK/2.2.0/package/scripts/setup_spark.py | 116 -
.../SPARK/2.2.0/package/scripts/spark_client.py | 57 -
.../SPARK/2.2.0/package/scripts/spark_service.py | 146 -
.../2.2.0/package/scripts/spark_thrift_server.py | 86 -
.../SPARK/2.2.0/package/scripts/status_params.py | 45 -
.../SPARK/2.2.0/quicklinks/quicklinks.json | 27 -
.../common-services/SPARK/2.2.0/service_advisor.py | 243 -
.../common-services/SPARK2/2.0.0/alerts.json | 2 +-
.../common-services/SPARK2/2.0.0/metainfo.xml | 15 +-
.../SPARK2/2.0.0/package/scripts/livy2_service.py | 24 +-
.../SPARK2/2.0.0/package/scripts/params.py | 2 +
.../SPARK2/2.0.0/package/scripts/setup_livy2.py | 2 +
.../SPARK2/2.0.0/package/scripts/setup_spark.py | 22 +-
.../common-services/SQOOP/1.4.4.2.0/metainfo.xml | 5 +-
.../sqoop-atlas-application.properties.xml | 47 -
.../SQOOP/1.4.4.3.0/configuration/sqoop-env.xml | 93 -
.../SQOOP/1.4.4.3.0/configuration/sqoop-site.xml | 38 -
.../common-services/SQOOP/1.4.4.3.0/kerberos.json | 20 -
.../common-services/SQOOP/1.4.4.3.0/metainfo.xml | 105 -
.../SQOOP/1.4.4.3.0/package/scripts/__init__.py | 19 -
.../SQOOP/1.4.4.3.0/package/scripts/params.py | 27 -
.../1.4.4.3.0/package/scripts/params_linux.py | 137 -
.../1.4.4.3.0/package/scripts/params_windows.py | 30 -
.../1.4.4.3.0/package/scripts/service_check.py | 59 -
.../SQOOP/1.4.4.3.0/package/scripts/sqoop.py | 124 -
.../1.4.4.3.0/package/scripts/sqoop_client.py | 61 -
.../SQOOP/1.4.4.3.0/role_command_order.json | 6 -
.../SQOOP/1.4.4.3.0/service_advisor.py | 197 -
.../common-services/STORM/0.9.1/metainfo.xml | 5 +-
.../0.9.1/package/scripts/setup_ranger_storm.py | 15 +-
.../common-services/STORM/1.0.1.3.0/alerts.json | 145 -
.../1.0.1.3.0/configuration/ranger-storm-audit.xml | 133 -
.../ranger-storm-plugin-properties.xml | 121 -
.../configuration/ranger-storm-policymgr-ssl.xml | 70 -
.../configuration/ranger-storm-security.xml | 67 -
.../storm-atlas-application.properties.xml | 31 -
.../configuration/storm-cluster-log4j.xml | 133 -
.../STORM/1.0.1.3.0/configuration/storm-env.xml | 171 -
.../STORM/1.0.1.3.0/configuration/storm-site.xml | 1002 -
.../1.0.1.3.0/configuration/storm-worker-log4j.xml | 189 -
.../common-services/STORM/1.0.1.3.0/kerberos.json | 139 -
.../common-services/STORM/1.0.1.3.0/metainfo.xml | 177 -
.../common-services/STORM/1.0.1.3.0/metrics.json | 1202 -
.../package/alerts/check_supervisor_process_win.py | 50 -
.../STORM/1.0.1.3.0/package/files/wordCount.jar | Bin 690588 -> 0 bytes
.../STORM/1.0.1.3.0/package/scripts/drpc_server.py | 86 -
.../STORM/1.0.1.3.0/package/scripts/nimbus.py | 110 -
.../STORM/1.0.1.3.0/package/scripts/nimbus_prod.py | 75 -
.../STORM/1.0.1.3.0/package/scripts/pacemaker.py | 85 -
.../STORM/1.0.1.3.0/package/scripts/params.py | 28 -
.../1.0.1.3.0/package/scripts/params_linux.py | 422 -
.../1.0.1.3.0/package/scripts/params_windows.py | 60 -
.../STORM/1.0.1.3.0/package/scripts/rest_api.py | 82 -
.../STORM/1.0.1.3.0/package/scripts/service.py | 95 -
.../1.0.1.3.0/package/scripts/service_check.py | 79 -
.../package/scripts/setup_ranger_storm.py | 133 -
.../1.0.1.3.0/package/scripts/status_params.py | 83 -
.../STORM/1.0.1.3.0/package/scripts/storm.py | 182 -
.../1.0.1.3.0/package/scripts/storm_upgrade.py | 177 -
.../1.0.1.3.0/package/scripts/storm_yaml_utils.py | 53 -
.../STORM/1.0.1.3.0/package/scripts/supervisor.py | 111 -
.../1.0.1.3.0/package/scripts/supervisor_prod.py | 78 -
.../package/scripts/supervisord_service.py | 34 -
.../STORM/1.0.1.3.0/package/scripts/ui_server.py | 132 -
.../package/templates/client_jaas.conf.j2 | 33 -
.../1.0.1.3.0/package/templates/config.yaml.j2 | 72 -
.../package/templates/input.config-storm.json.j2 | 78 -
.../package/templates/storm-metrics2.properties.j2 | 32 -
.../1.0.1.3.0/package/templates/storm.conf.j2 | 35 -
.../1.0.1.3.0/package/templates/storm_jaas.conf.j2 | 65 -
.../package/templates/worker-launcher.cfg.j2 | 19 -
.../STORM/1.0.1.3.0/quicklinks/quicklinks.json | 45 -
.../STORM/1.0.1.3.0/role_command_order.json | 13 -
.../STORM/1.0.1.3.0/service_advisor.py | 387 -
.../common-services/STORM/1.0.1.3.0/widgets.json | 127 -
.../STORM/1.0.1/configuration/storm-site.xml | 2 +-
.../common-services/SUPERSET/0.15.0/metainfo.xml | 2 +-
.../common-services/TEZ/0.4.0.2.1/metainfo.xml | 5 +-
.../TEZ/0.9.0.3.0/configuration/tez-env.xml | 97 -
.../TEZ/0.9.0.3.0/configuration/tez-site.xml | 523 -
.../common-services/TEZ/0.9.0.3.0/kerberos.json | 25 -
.../common-services/TEZ/0.9.0.3.0/metainfo.xml | 111 -
.../TEZ/0.9.0.3.0/package/scripts/params.py | 29 -
.../TEZ/0.9.0.3.0/package/scripts/params_linux.py | 116 -
.../0.9.0.3.0/package/scripts/params_windows.py | 54 -
.../TEZ/0.9.0.3.0/package/scripts/pre_upgrade.py | 59 -
.../TEZ/0.9.0.3.0/package/scripts/service_check.py | 111 -
.../TEZ/0.9.0.3.0/package/scripts/tez.py | 80 -
.../TEZ/0.9.0.3.0/package/scripts/tez_client.py | 130 -
.../TEZ/0.9.0.3.0/service_advisor.py | 371 -
.../2.1.0.2.0/configuration-mapred/mapred-site.xml | 2 +-
.../YARN/2.1.0.2.0/configuration/yarn-env.xml | 5 +
.../common-services/YARN/2.1.0.2.0/metainfo.xml | 20 +-
.../YARN/2.1.0.2.0/package/scripts/params_linux.py | 50 +-
.../YARN/2.1.0.2.0/package/scripts/yarn.py | 4 +-
.../YARN/3.0.0.3.0/MAPREDUCE2_metrics.json | 2596 --
.../YARN/3.0.0.3.0/YARN_metrics.json | 3486 ---
.../YARN/3.0.0.3.0/YARN_widgets.json | 670 -
.../common-services/YARN/3.0.0.3.0/alerts.json | 392 -
.../3.0.0.3.0/configuration-mapred/mapred-env.xml | 112 -
.../configuration-mapred/mapred-logsearch-conf.xml | 80 -
.../3.0.0.3.0/configuration-mapred/mapred-site.xml | 540 -
.../3.0.0.3.0/configuration/capacity-scheduler.xml | 183 -
.../3.0.0.3.0/configuration/ranger-yarn-audit.xml | 186 -
.../ranger-yarn-plugin-properties.xml | 92 -
.../configuration/ranger-yarn-policymgr-ssl.xml | 66 -
.../configuration/ranger-yarn-security.xml | 58 -
.../YARN/3.0.0.3.0/configuration/yarn-env.xml | 323 -
.../YARN/3.0.0.3.0/configuration/yarn-log4j.xml | 103 -
.../configuration/yarn-logsearch-conf.xml | 104 -
.../YARN/3.0.0.3.0/configuration/yarn-site.xml | 1197 -
.../common-services/YARN/3.0.0.3.0/kerberos.json | 294 -
.../common-services/YARN/3.0.0.3.0/metainfo.xml | 395 -
.../package/alerts/alert_nodemanager_health.py | 209 -
.../package/alerts/alert_nodemanagers_summary.py | 219 -
.../files/validateYarnComponentStatusWindows.py | 161 -
.../package/scripts/application_timeline_server.py | 97 -
.../3.0.0.3.0/package/scripts/historyserver.py | 132 -
.../YARN/3.0.0.3.0/package/scripts/install_jars.py | 99 -
.../package/scripts/mapred_service_check.py | 172 -
.../3.0.0.3.0/package/scripts/mapreduce2_client.py | 93 -
.../YARN/3.0.0.3.0/package/scripts/nodemanager.py | 102 -
.../package/scripts/nodemanager_upgrade.py | 74 -
.../YARN/3.0.0.3.0/package/scripts/params.py | 32 -
.../YARN/3.0.0.3.0/package/scripts/params_linux.py | 551 -
.../3.0.0.3.0/package/scripts/params_windows.py | 70 -
.../3.0.0.3.0/package/scripts/resourcemanager.py | 257 -
.../YARN/3.0.0.3.0/package/scripts/service.py | 113 -
.../3.0.0.3.0/package/scripts/service_check.py | 185 -
.../3.0.0.3.0/package/scripts/setup_ranger_yarn.py | 71 -
.../3.0.0.3.0/package/scripts/status_params.py | 49 -
.../YARN/3.0.0.3.0/package/scripts/yarn.py | 542 -
.../YARN/3.0.0.3.0/package/scripts/yarn_client.py | 63 -
.../package/templates/container-executor.cfg.j2 | 40 -
.../package/templates/exclude_hosts_list.j2 | 21 -
.../package/templates/include_hosts_list.j2 | 21 -
.../package/templates/mapred_jaas.conf.j2 | 28 -
.../3.0.0.3.0/package/templates/mapreduce.conf.j2 | 35 -
.../package/templates/taskcontroller.cfg.j2 | 38 -
.../YARN/3.0.0.3.0/package/templates/yarn.conf.j2 | 35 -
.../package/templates/yarn_ats_jaas.conf.j2 | 27 -
.../3.0.0.3.0/package/templates/yarn_jaas.conf.j2 | 36 -
.../package/templates/yarn_nm_jaas.conf.j2 | 27 -
.../3.0.0.3.0/quicklinks-mapred/quicklinks.json | 80 -
.../YARN/3.0.0.3.0/quicklinks/quicklinks.json | 80 -
.../YARN/3.0.0.3.0/service_advisor.py | 2009 --
.../YARN/3.0.0.3.0/themes-mapred/theme.json | 132 -
.../YARN/3.0.0.3.0/themes/theme.json | 250 -
.../common-services/ZEPPELIN/0.6.0/metainfo.xml | 5 +-
.../common-services/ZEPPELIN/0.7.0/metainfo.xml | 5 +-
.../package/scripts/interpreter_json_template.py | 154 +-
.../0.7.0/package/scripts/livy2_config_template.py | 112 -
.../ZEPPELIN/0.7.0/package/scripts/master.py | 109 +-
.../package/scripts/spark2_config_template.py | 84 -
.../custom_actions/scripts/install_packages.py | 67 +-
.../src/main/resources/key_properties.json | 3 -
ambari-server/src/main/resources/properties.json | 14 +-
.../src/main/resources/scripts/Ambaripreupload.py | 2 +-
.../resources/scripts/check_ambari_permissions.py | 8 +-
.../src/main/resources/scripts/kerberos-setup.sh | 4 +-
.../stack-hooks/after-INSTALL/scripts/params.py | 2 +-
.../stack-hooks/before-ANY/scripts/params.py | 2 +-
.../before-INSTALL/scripts/repo_initialization.py | 9 +-
.../stacks/BIGTOP/0.8/services/FLUME/metainfo.xml | 5 +-
.../stacks/BIGTOP/0.8/services/HBASE/metainfo.xml | 10 +-
.../stacks/BIGTOP/0.8/services/HDFS/metainfo.xml | 5 +-
.../stacks/BIGTOP/0.8/services/HIVE/metainfo.xml | 5 +-
.../stacks/BIGTOP/0.8/services/OOZIE/metainfo.xml | 5 +-
.../stacks/BIGTOP/0.8/services/PIG/metainfo.xml | 5 +-
.../stacks/BIGTOP/0.8/services/YARN/metainfo.xml | 10 +-
.../2.0.6.GlusterFS/services/HBASE/metainfo.xml | 12 +-
.../2.0.6.GlusterFS/services/SQOOP/metainfo.xml | 7 +-
.../HDP/2.0.6.GlusterFS/services/YARN/metainfo.xml | 10 +-
.../HDP/2.0.6/properties/stack_features.json | 6 +
.../HDP/2.0.6/properties/stack_packages.json | 143 +-
.../stacks/HDP/2.0.6/services/stack_advisor.py | 49 -
.../HDP/2.1.GlusterFS/services/FALCON/metainfo.xml | 5 +-
.../HDP/2.1.GlusterFS/services/FLUME/metainfo.xml | 7 +-
.../HDP/2.1.GlusterFS/services/HBASE/metainfo.xml | 12 +-
.../HDP/2.1.GlusterFS/services/SQOOP/metainfo.xml | 5 +-
.../HDP/2.1.GlusterFS/services/TEZ/metainfo.xml | 5 +-
.../HDP/2.1.GlusterFS/services/YARN/metainfo.xml | 10 +-
.../2.1/services/YARN/configuration/yarn-env.xml | 1 +
.../2.2/services/HDFS/configuration/hadoop-env.xml | 2 +
.../stacks/HDP/2.2/services/HIVE/metainfo.xml | 5 +-
.../stacks/HDP/2.2/services/PIG/metainfo.xml | 5 +-
.../2.2/services/TEZ/configuration/tez-site.xml | 4 +-
.../YARN/configuration-mapred/mapred-site.xml | 2 +-
.../stacks/HDP/2.3.ECS/services/HBASE/metainfo.xml | 10 +-
.../stacks/HDP/2.3.ECS/services/HIVE/metainfo.xml | 15 +-
.../stacks/HDP/2.3.ECS/services/YARN/metainfo.xml | 20 +-
.../2.3.GlusterFS/services/ACCUMULO/metainfo.xml | 5 +-
.../HDP/2.3.GlusterFS/services/FLUME/metainfo.xml | 5 +-
.../HDP/2.3.GlusterFS/services/HBASE/metainfo.xml | 5 +-
.../HDP/2.3.GlusterFS/services/SLIDER/metainfo.xml | 10 +-
.../HDP/2.3.GlusterFS/services/SQOOP/metainfo.xml | 5 +-
.../HDP/2.3.GlusterFS/services/YARN/metainfo.xml | 10 +-
.../2.3/services/HDFS/configuration/hadoop-env.xml | 2 +
.../2.3/services/HIVE/configuration/hive-env.xml | 1 +
.../2.3/services/OOZIE/configuration/oozie-env.xml | 1 +
.../2.3/services/YARN/configuration/yarn-env.xml | 1 +
.../stacks/HDP/2.3/services/stack_advisor.py | 9 +-
.../2.4/services/HDFS/configuration/hadoop-env.xml | 2 +
.../stacks/HDP/2.5/services/HIVE/metainfo.xml | 30 +-
.../2.5/services/YARN/configuration/yarn-site.xml | 4 +-
.../stacks/HDP/2.5/services/stack_advisor.py | 1 +
.../2.6/services/HDFS/configuration/hadoop-env.xml | 2 +
.../2.6/services/TEZ/configuration/tez-site.xml | 8 +
.../2.6/services/YARN/configuration/yarn-env.xml | 1 +
.../stacks/HDP/2.6/upgrades/config-upgrade.xml | 8 +-
.../HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml | 2 +-
.../stacks/HDP/2.6/upgrades/upgrade-2.6.xml | 2 +-
.../stacks/HDP/3.0/configuration/cluster-env.xml | 359 -
.../src/main/resources/stacks/HDP/3.0/metainfo.xml | 24 -
.../stacks/HDP/3.0/properties/stack_features.json | 373 -
.../stacks/HDP/3.0/properties/stack_packages.json | 1164 -
.../stacks/HDP/3.0/properties/stack_tools.json | 14 -
.../resources/stacks/HDP/3.0/repos/repoinfo.xml | 132 -
.../stacks/HDP/3.0/role_command_order.json | 172 -
.../stacks/HDP/3.0/services/ATLAS/metainfo.xml | 27 -
.../stacks/HDP/3.0/services/HBASE/metainfo.xml | 26 -
.../3.0/services/HDFS/configuration/hadoop-env.xml | 177 -
.../stacks/HDP/3.0/services/HDFS/metainfo.xml | 115 -
.../stacks/HDP/3.0/services/HIVE/metainfo.xml | 27 -
.../stacks/HDP/3.0/services/KAFKA/metainfo.xml | 27 -
.../stacks/HDP/3.0/services/KERBEROS/metainfo.xml | 26 -
.../stacks/HDP/3.0/services/KNOX/metainfo.xml | 27 -
.../stacks/HDP/3.0/services/OOZIE/metainfo.xml | 27 -
.../stacks/HDP/3.0/services/PIG/metainfo.xml | 27 -
.../stacks/HDP/3.0/services/RANGER/metainfo.xml | 27 -
.../HDP/3.0/services/RANGER_KMS/metainfo.xml | 27 -
.../stacks/HDP/3.0/services/SLIDER/metainfo.xml | 51 -
.../stacks/HDP/3.0/services/SPARK/metainfo.xml | 32 -
.../stacks/HDP/3.0/services/SQOOP/metainfo.xml | 27 -
.../stacks/HDP/3.0/services/STORM/metainfo.xml | 27 -
.../stacks/HDP/3.0/services/TEZ/metainfo.xml | 27 -
.../YARN/configuration-mapred/mapred-env.xml | 51 -
.../YARN/configuration-mapred/mapred-site.xml | 78 -
.../3.0/services/YARN/configuration/yarn-site.xml | 48 -
.../stacks/HDP/3.0/services/YARN/metainfo.xml | 84 -
.../stacks/HDP/3.0/services/ZEPPELIN/metainfo.xml | 27 -
.../stacks/HDP/3.0/services/ZOOKEEPER/metainfo.xml | 52 -
.../PERF/1.0/services/FAKEHBASE/metainfo.xml | 10 +-
.../stacks/PERF/1.0/services/FAKEHDFS/metainfo.xml | 5 +-
.../stacks/PERF/1.0/services/FAKEYARN/metainfo.xml | 15 +-
.../KERBEROS/configuration/kerberos-env.xml | 4 +-
.../services/KERBEROS/configuration/krb5-conf.xml | 11 +
.../services/KERBEROS/package/scripts/params.py | 2 +
.../1.0/services/KERBEROS/properties/krb5_conf.j2 | 3 +
.../src/main/resources/stacks/stack_advisor.py | 48 +
ambari-server/src/main/resources/upgrade-pack.xsd | 1 +
.../resources/webapp/WEB-INF/spring-security.xml | 13 +-
ambari-server/src/main/windows/ambari-server.ps1 | 2 -
.../actionmanager/ExecutionCommandWrapperTest.java | 7 +-
.../ambari/server/agent/AgentResourceTest.java | 7 +-
.../ambari/server/agent/TestHeartbeatHandler.java | 79 +-
.../apache/ambari/server/alerts/ThresholdTest.java | 90 +
.../query/render/ClusterBlueprintRendererTest.java | 32 +-
.../api/query/render/MinimalRendererTest.java | 6 +
.../api/resources/UserResourceDefinitionTest.java | 13 +-
.../server/api/services/AmbariMetaInfoTest.java | 134 +-
.../server/api/services/ComponentServiceTest.java | 32 +-
.../api/services/ConfigurationServiceTest.java | 27 +-
.../api/services/KerberosServiceMetaInfoTest.java | 7 +
.../server/api/services/ServiceServiceTest.java | 52 +-
.../StackAdvisorBlueprintProcessorTest.java | 86 +-
.../stackadvisor/StackAdvisorHelperTest.java | 9 +-
.../ambari/server/audit/LoginAuditEventTest.java | 36 +-
.../server/checks/ConfigurationMergeCheckTest.java | 12 +-
.../server/checks/InstallPackagesCheckTest.java | 8 +-
.../RequiredServicesInRepositoryCheckTest.java | 6 +-
.../checks/ServiceCheckValidityCheckTest.java | 1 +
.../server/configuration/ConfigurationTest.java | 249 +-
.../AmbariCustomCommandExecutionHelperTest.java | 194 +-
.../AmbariManagementControllerImplTest.java | 247 +-
.../controller/AmbariManagementControllerTest.java | 75 +-
.../server/controller/KerberosHelperTest.java | 47 +-
.../server/controller/MpackResponseTest.java | 4 +-
.../controller/RootServiceResponseFactoryTest.java | 145 +-
.../AbstractControllerResourceProviderTest.java | 10 +-
.../internal/AbstractDRResourceProviderTest.java | 2 -
.../AbstractPrivilegeResourceProviderTest.java | 38 -
.../internal/AbstractResourceProviderTest.java | 66 +-
.../internal/ActionResourceProviderTest.java | 4 -
.../ActiveWidgetLayoutResourceProviderTest.java | 6 +-
.../AlertDefinitionResourceProviderTest.java | 4 +-
.../internal/BaseBlueprintProcessorTest.java | 325 +-
.../BlueprintConfigurationProcessorTest.java | 98 +-
.../internal/BlueprintResourceProviderTest.java | 146 +-
.../internal/ClientConfigResourceProviderTest.java | 10 -
.../internal/ClusterControllerImplTest.java | 16 +-
...sterKerberosDescriptorResourceProviderTest.java | 17 -
.../internal/ClusterResourceProviderTest.java | 14 -
.../ClusterStackVersionResourceProviderTest.java | 133 +-
...tibleRepositoryVersionResourceProviderTest.java | 14 +-
.../controller/internal/CompositeStackTest.java | 110 +
.../internal/ConfigGroupResourceProviderTest.java | 2 -
.../ConfigurationResourceProviderTest.java | 6 -
.../internal/CredentialResourceProviderTest.java | 23 -
.../internal/ExportBlueprintRequestTest.java | 33 +-
.../internal/ExtensionResourceProviderTest.java | 2 -
.../internal/FeedResourceProviderTest.java | 29 +-
.../GroupPrivilegeResourceProviderTest.java | 46 +-
.../internal/GroupResourceProviderTest.java | 8 -
.../HostComponentProcessResourceProviderTest.java | 2 -
.../HostComponentResourceProviderTest.java | 49 +-
.../HostKerberosIdentityResourceProviderTest.java | 15 +-
.../internal/HostResourceProviderTest.java | 53 +-
.../HostStackVersionResourceProviderTest.java | 54 +-
.../internal/InstanceResourceProviderTest.java | 29 +-
.../controller/internal/JMXHostProviderTest.java | 5 +-
.../internal/JobResourceProviderTest.java | 37 +-
.../KerberosDescriptorResourceProviderTest.java | 6 +-
.../internal/MemberResourceProviderTest.java | 25 +-
.../internal/MpackResourceProviderTest.java | 43 +-
.../OverriddenMetricsHostProviderTest.java | 95 +
.../internal/RepositoryResourceProviderTest.java | 2 +
.../RepositoryVersionResourceProviderTest.java | 83 +-
.../controller/internal/RequestImplTest.java | 7 -
.../internal/RequestResourceProviderTest.java | 265 +-
.../RequestScheduleResourceProviderTest.java | 2 -
...ComponentConfigurationResourceProviderTest.java | 192 +-
.../RootServiceComponentResourceProviderTest.java | 2 -
...otServiceHostComponentResourceProviderTest.java | 2 -
.../internal/RootServiceResourceProviderTest.java | 2 -
.../internal/ScaleClusterRequestTest.java | 38 +-
.../internal/ServiceResourceProviderTest.java | 33 +-
.../internal/StackAdvisorResourceProviderTest.java | 12 +-
.../StackArtifactResourceProviderTest.java | 2 -
...onfigurationDependencyResourceProviderTest.java | 2 -
.../StackConfigurationResourceProviderTest.java | 4 -
.../StackDependencyResourceProviderTest.java | 5 +-
...tackLevelConfigurationResourceProviderTest.java | 13 +-
.../internal/StackResourceProviderTest.java | 2 -
.../internal/StackServiceResourceProviderTest.java | 4 -
.../server/controller/internal/StackTest.java | 516 +-
.../StackUpgradeConfigurationMergeTest.java | 8 +-
.../TargetClusterResourceProviderTest.java | 28 +-
.../internal/TaskAttemptResourceProviderTest.java | 2 +-
.../internal/TaskResourceProviderTest.java | 22 +-
.../internal/TestIvoryProviderModule.java | 6 +-
.../internal/UpgradeResourceProviderTest.java | 65 +-
.../UpgradeSummaryResourceProviderTest.java | 2 +-
...erAuthenticationSourceResourceProviderTest.java | 452 +
.../UserPrivilegeResourceProviderTest.java | 109 +-
.../internal/UserResourceProviderDBTest.java | 438 +-
.../internal/UserResourceProviderTest.java | 748 +-
.../internal/ValidationResourceProviderTest.java | 3 +-
.../VersionDefinitionResourceProviderTest.java | 24 +-
.../internal/WorkflowResourceProviderTest.java | 30 +-
.../server/controller/jmx/JMXMetricHolderTest.java | 75 +
.../logging/LogSearchDataRetrievalServiceTest.java | 21 +-
.../LoggingRequestHelperFactoryImplTest.java | 46 +
.../logging/LoggingRequestHelperImplTest.java | 49 +-
.../upgrade/AlertMaintenanceModeListenerTest.java | 4 +-
.../upgrade/StackVersionListenerTest.java | 7 +-
.../server/ldap/AmbariLdapConfigurationTest.java | 143 +
.../server/metadata/RoleCommandOrderTest.java | 7 +
.../ambari/server/orm/DBAccessorImplTest.java | 30 +
.../apache/ambari/server/orm/OrmTestHelper.java | 48 +-
.../org/apache/ambari/server/orm/TestOrmImpl.java | 29 +-
.../apache/ambari/server/orm/dao/CrudDAOTest.java | 3 +-
.../ambari/server/orm/dao/HostVersionDAOTest.java | 13 +
.../server/orm/dao/RepositoryVersionDAOTest.java | 15 +-
.../server/orm/dao/ServiceConfigDAOTest.java | 543 +-
.../apache/ambari/server/orm/dao/UserDAOTest.java | 53 +-
.../org/apache/ambari/server/orm/db/DDLTests.java | 45 +-
.../server/orm/entities/BlueprintEntityTest.java | 7 -
.../server/orm/entities/BlueprintEntityTest2.java | 180 +
.../server/security/SecurityHelperImplTest.java | 7 +-
.../server/security/TestAuthenticationFactory.java | 26 +-
.../AbstractAuthenticationProviderTest.java | 217 +
.../AmbariBasicAuthenticationFilterTest.java | 136 +-
.../AmbariJWTAuthenticationFilterTest.java | 191 -
.../AmbariLocalAuthenticationProviderTest.java | 90 +
.../jwt/AmbariJwtAuthenticationFilterTest.java | 493 +
.../jwt/JwtAuthenticationPropertiesTest.java | 51 +
.../AmbariAuthToLocalUserDetailsServiceTest.java | 33 +-
.../AmbariKerberosAuthenticationFilterTest.java | 183 +-
...AmbariKerberosAuthenticationPropertiesTest.java | 16 -
.../pam/AmbariPamAuthenticationProviderTest.java | 290 +
.../authorization/AmbariAuthenticationTest.java | 334 -
.../AmbariAuthorizationFilterTest.java | 5 +-
...AmbariAuthorizationProviderDisableUserTest.java | 99 -
...apAuthenticationProviderForDNWithSpaceTest.java | 63 +-
...AuthenticationProviderForDuplicateUserTest.java | 29 +-
.../AmbariLdapAuthenticationProviderTest.java | 88 +-
.../AmbariLdapBindAuthenticatorTest.java | 91 +-
.../authorization/AmbariLocalUserProviderTest.java | 166 -
.../AmbariPamAuthenticationProviderTest.java | 151 -
.../AmbariUserAuthenticationFilterTest.java | 20 +-
.../authorization/AuthorizationHelperTest.java | 24 +-
.../authorization/AuthorizationTestModule.java | 3 +-
.../AuthorizationTestModuleForLdapDNWithSpace.java | 5 +-
.../authorization/LdapServerPropertiesTest.java | 20 +-
.../TestAmbariLdapAuthoritiesPopulator.java | 4 +-
.../server/security/authorization/TestUsers.java | 320 +-
.../server/security/authorization/UsersTest.java | 17 +-
.../jwt/JwtAuthenticationFilterTest.java | 373 -
.../jwt/JwtAuthenticationPropertiesTest.java | 51 -
.../security/encryption/CredentialStoreTest.java | 2 +-
.../security/ldap/AmbariLdapDataPopulatorTest.java | 620 +-
.../server/security/ldap/LdapPerformanceTest.java | 28 +-
.../kerberos/ADKerberosOperationHandlerTest.java | 15 +-
.../ConfigureAmbariIdentitiesServerActionTest.java | 36 +-
.../kerberos/FinalizeKerberosServerActionTest.java | 5 +-
.../kerberos/IPAKerberosOperationHandlerTest.java | 19 +-
.../kerberos/KerberosOperationHandlerTest.java | 16 +
.../kerberos/KerberosServerActionTest.java | 26 +-
.../kerberos/MITKerberosOperationHandlerTest.java | 19 +-
.../upgrades/ComponentVersionCheckActionTest.java | 17 +-
.../upgrades/KerberosKeytabsActionTest.java | 4 +
.../upgrades/PreconfigureKerberosActionTest.java | 20 +-
.../ambari/server/stack/ComponentModuleTest.java | 27 +
.../apache/ambari/server/stack/HostsTypeTest.java | 82 +
.../ambari/server/stack/NameServiceTest.java | 136 +
.../stack/QuickLinksConfigurationModuleTest.java | 3 +
.../apache/ambari/server/stack/RepoUtilTest.java | 57 +-
.../ambari/server/stack/ServiceModuleTest.java | 93 +-
.../stack/StackManagerCommonServicesTest.java | 1 +
.../ambari/server/stack/StackManagerTest.java | 1 +
.../UpdateActiveRepoVersionOnStartupTest.java | 37 +-
.../org/apache/ambari/server/state/MpackTest.java | 103 +-
.../ambari/server/state/ServiceComponentTest.java | 5 +-
.../ambari/server/state/ServiceInfoTest.java | 102 +
.../ambari/server/state/UpgradeHelperTest.java | 153 +-
.../ambari/server/state/alert/AlertUriTest.java | 60 +
.../ambari/server/state/alert/JmxInfoTest.java | 85 +
.../ambari/server/state/cluster/ClusterTest.java | 12 +-
.../ambari/server/state/cluster/ClustersTest.java | 4 +-
.../KerberosDescriptorUpdateHelperTest.java | 2 +
.../state/repository/VersionDefinitionTest.java | 55 +
.../services/AlertNoticeDispatchServiceTest.java | 4 +
.../services/RetryUpgradeActionServiceTest.java | 4 +-
.../state/stack/ConfigUpgradeValidityTest.java | 41 +-
.../stack/upgrade/RepositoryVersionHelperTest.java | 58 -
.../ambari/server/topology/AmbariContextTest.java | 15 +-
.../server/topology/AsyncCallableServiceTest.java | 59 +-
.../server/topology/BlueprintFactoryTest.java | 159 +-
.../ambari/server/topology/BlueprintImplTest.java | 87 +-
.../ambari/server/topology/BlueprintTestUtil.java | 79 +
.../topology/BlueprintValidatorImplTest.java | 97 +-
.../topology/ClusterConfigurationRequestTest.java | 28 +-
.../topology/ClusterDeployWithStartOnlyTest.java | 32 +-
...terInstallWithoutStartOnComponentLevelTest.java | 37 +-
.../topology/ClusterInstallWithoutStartTest.java | 32 +-
.../ambari/server/topology/ConfigurableTest.java | 97 +
.../server/topology/ConfigureClusterTaskTest.java | 2 +-
.../topology/RequiredPasswordValidatorTest.java | 12 +-
.../server/topology/TopologyManagerTest.java | 43 +-
.../validators/HiveServiceValidatorTest.java | 4 +-
.../server/upgrade/UpgradeCatalog260Test.java | 20 +-
.../server/upgrade/UpgradeCatalog300Test.java | 464 +-
.../ambari/server/utils/PasswordUtilsTest.java | 126 +
.../ambari/server/utils/TestVersionUtils.java | 142 +
ambari-server/src/test/python/TestAmbariServer.py | 604 +-
ambari-server/src/test/python/TestVersion.py | 100 +-
.../HIVE/test_jdbc_driver_config.py | 21 -
.../RANGER/test_db_flavor_config.py | 22 -
.../RANGER_KMS/test_db_flavor_config.py | 22 -
.../SPARK/2.2.0/test_service_advisor.py | 289 -
.../SQOOP/test_jdbc_driver_config.py | 22 -
.../python/stacks/2.0.6/OOZIE/test_oozie_server.py | 176 +-
.../hooks/after-INSTALL/test_after_install.py | 8 +-
.../python/stacks/2.1/FALCON/test_falcon_server.py | 6 +-
.../stacks/2.2/KERBEROS/test_kerberos_client.py | 2 +-
.../python/stacks/2.2/KNOX/test_knox_gateway.py | 29 +-
.../python/stacks/2.2/configs/oozie-upgrade.json | 39 +-
.../python/stacks/2.3/common/test_stack_advisor.py | 17 +
.../python/stacks/2.4/LOGSEARCH/test_logfeeder.py | 34 +-
.../python/stacks/2.4/LOGSEARCH/test_logsearch.py | 31 +-
.../test/python/stacks/2.4/configs/default.json | 3 +-
.../python/stacks/2.5/SPARK/test_spark_livy.py | 3 +-
.../python/stacks/2.5/common/test_stack_advisor.py | 1 +
.../2.6/KAFKA/test_kafka_broker_other_sasl.py | 16 +
.../python/stacks/2.6/RANGER/test_ranger_admin.py | 10 +-
.../python/stacks/2.6/SPARK2/test_spark_livy2.py | 5 +-
.../2.6/ZEPPELIN/interpreter_json_generated.py | 8 +-
.../stacks/2.6/ZEPPELIN/test_zeppelin_070.py | 47 +
.../test/python/stacks/2.6/configs/default.json | 2 +
.../stacks/2.6/configs/secure_kafka_sasl_ssl.json | 632 +
.../src/test/python/stacks/utils/RMFTestCase.py | 2 +
ambari-server/src/test/resources/ambari.properties | 4 +-
.../test/resources/blueprint3.0/configurable.json | 16 +
.../test/resources/blueprint3.0/configurable2.json | 8 +
.../blueprint3.0/multi-instance-blueprint.json | 104 +
.../resources/child_quicklinks_to_override.json | 4 +
.../resources/common-services/PIG/1.0/metainfo.xml | 1 +
.../stacks/HDP/0.1/services/PIG/metainfo.xml | 1 +
.../stacks/HDP/2.0.5/services/HDFS/metainfo.xml | 1 +
.../stacks/HDP/2.0.6.1/services/FLUME/metainfo.xml | 5 +-
.../stacks/HDP/2.0.6.1/services/HBASE/metainfo.xml | 1 +
.../stacks/HDP/2.0.6/services/FLUME/metainfo.xml | 5 +-
.../HDP/2.0.6/services/HADOOP_CLIENTS/metainfo.xml | 41 +
.../stacks/HDP/2.0.6/services/HBASE/metainfo.xml | 3 +-
.../stacks/HDP/2.0.7/services/HBASE/metainfo.xml | 10 +-
.../stacks/HDP/2.0.7/services/OOZIE/metainfo.xml | 5 +-
.../HDP/2.1.1/services/AMBARI_METRICS/metainfo.xml | 5 +-
.../HDP/2.2.0/upgrades/upgrade_test_conditions.xml | 22 +-
ambari-web/app/assets/img/install-box.svg | 28 +
ambari-web/app/assets/test/tests.js | 8 +-
ambari-web/app/controllers/installer.js | 10 +-
.../hawq/addStandby/step3_controller.js | 3 +-
.../main/admin/kerberos/step1_controller.js | 105 +-
.../main/admin/kerberos/step2_controller.js | 4 +-
.../main/admin/kerberos/wizard_controller.js | 18 +-
.../main/admin/stack_and_upgrade_controller.js | 3 +-
.../main/charts/heatmap_metrics/heatmap_metric.js | 158 +-
.../main/host/bulk_operations_controller.js | 369 +-
ambari-web/app/controllers/main/host/details.js | 607 +-
.../app/controllers/main/service/info/configs.js | 41 +-
.../app/controllers/main/service/info/metric.js | 13 +
ambari-web/app/controllers/main/service/item.js | 35 +-
.../app/controllers/wizard/step3_controller.js | 2 +-
.../app/controllers/wizard/step4_controller.js | 128 +-
.../app/controllers/wizard/step6_controller.js | 12 -
.../app/controllers/wizard/step8_controller.js | 8 +-
ambari-web/app/data/db_properties_info.js | 15 +-
ambari-web/app/mappers/stack_service_mapper.js | 4 +
ambari-web/app/messages.js | 68 +-
.../mixins/common/configs/configs_comparator.js | 5 +-
.../app/mixins/common/configs/configs_loader.js | 8 +-
.../app/mixins/common/widgets/widget_mixin.js | 13 +-
.../details/host_components/install_component.js | 6 +-
.../configs/component_actions_by_configs.js | 4 +-
ambari-web/app/models/configs/config_group.js | 8 +
ambari-web/app/models/host_component.js | 9 +
ambari-web/app/models/repository.js | 3 +-
ambari-web/app/models/stack_service.js | 103 +
ambari-web/app/models/stack_service_component.js | 33 +
ambari-web/app/styles/application.less | 338 +-
ambari-web/app/styles/bootstrap_overrides.less | 25 +-
ambari-web/app/styles/common.less | 2 +
ambari-web/app/styles/config_history_flow.less | 414 -
ambari-web/app/styles/config_versions_control.less | 143 +
ambari-web/app/styles/dashboard.less | 14 +-
.../app/styles/enhanced_service_dashboard.less | 31 +-
ambari-web/app/styles/hosts.less | 75 +-
ambari-web/app/styles/modal_popups.less | 27 +-
ambari-web/app/styles/service_configurations.less | 297 +
ambari-web/app/styles/theme/bootstrap-ambari.css | 14 +-
ambari-web/app/styles/widgets.less | 12 +-
ambari-web/app/styles/wizard.less | 86 +-
ambari-web/app/templates.js | 2 +
ambari-web/app/templates/application.hbs | 135 +-
.../templates/common/assign_master_components.hbs | 24 +-
.../templates/common/configs/compare_property.hbs | 38 -
.../common/configs/config_history_dropdown_row.hbs | 24 -
.../common/configs/config_history_flow.hbs | 148 -
.../common/configs/config_versions_control.hbs | 42 +
.../common/configs/config_versions_dropdown.hbs | 69 +
.../common/configs/configs_comparison_cell.hbs | 26 +
.../common/configs/configs_comparison_row.hbs | 79 +
.../app/templates/common/configs/controls.hbs | 12 +-
.../templates/common/configs/service_config.hbs | 125 +-
.../common/configs/service_config_category.hbs | 120 +-
.../configs/service_config_layout_tab_compare.hbs | 80 +
.../common/configs/service_config_wizard.hbs | 10 +-
.../comparison/config_widget_comparison.hbs | 37 -
.../templates/common/configs/widgets/controls.hbs | 15 -
.../templates/common/filter_combo_cleanable.hbs | 7 +-
.../app/templates/common/host_progress_popup.hbs | 115 +-
.../common/modal_popups/widget_browser_footer.hbs | 1 -
.../app/templates/common/widget/gauge_widget.hbs | 2 +-
.../app/templates/common/widget/graph_widget.hbs | 2 +-
.../app/templates/common/widget/number_widget.hbs | 2 +-
.../templates/common/widget/template_widget.hbs | 2 +-
.../app/templates/main/admin/kerberos/step1.hbs | 14 +-
.../main/alerts/alert_notifications_popup.hbs | 30 +-
.../app/templates/main/dashboard/widgets.hbs | 4 +-
.../main/host/bulk_add_delete_confirm_popup.hbs | 40 +
.../app/templates/main/host/configs_service.hbs | 2 +-
.../main/host/delete_hosts_dry_run_popup.hbs | 32 -
.../app/templates/main/host/delete_hosts_popup.hbs | 21 +-
.../main/host/delete_hosts_result_popup.hbs | 4 +-
ambari-web/app/templates/main/host/details.hbs | 10 +-
.../templates/main/host/details/host_component.hbs | 289 +-
ambari-web/app/templates/main/host/summary.hbs | 121 +-
.../app/templates/main/service/info/configs.hbs | 2 +-
.../app/templates/main/service/menu_item.hbs | 8 +-
ambari-web/app/templates/wizard/step0.hbs | 2 +-
ambari-web/app/templates/wizard/step1.hbs | 2 -
.../step3/step3_host_warning_popup_footer.hbs | 2 +-
.../wizard/step3/step3_host_warnings_popup.hbs | 40 +-
ambari-web/app/templates/wizard/step4.hbs | 63 +-
ambari-web/app/templates/wizard/step6.hbs | 30 +-
.../templates/wizard/step6/step6_issues_popup.hbs | 43 -
ambari-web/app/templates/wizard/step8.hbs | 4 +-
ambari-web/app/utils/ajax/ajax.js | 36 +-
ambari-web/app/utils/config.js | 2 +-
ambari-web/app/utils/date/date.js | 86 +-
ambari-web/app/utils/heatmap.js | 48 -
ambari-web/app/utils/number_utils.js | 5 +
ambari-web/app/views.js | 6 +-
.../views/common/assign_master_components_view.js | 4 +-
ambari-web/app/views/common/breadcrumbs_view.js | 4 +-
.../views/common/configs/compare_property_view.js | 25 -
.../views/common/configs/config_history_flow.js | 644 -
.../common/configs/config_versions_control_view.js | 224 +
.../configs/config_versions_dropdown_view.js | 63 +
.../common/configs/overriddenPropertyRow_view.js | 31 -
.../service_config_layout_tab_compare_view.js | 41 +
.../views/common/configs/service_config_view.js | 69 +
.../configs/service_configs_by_category_view.js | 17 +-
.../configs/widgets/combo_config_widget_view.js | 8 +
.../comparison/config_widget_comparison_view.js | 23 -
ambari-web/app/views/common/controls_view.js | 7 +-
.../app/views/common/filter_combo_cleanable.js | 6 +-
.../common/form/manage_credentials_form_view.js | 3 +-
.../views/common/host_progress_popup_body_view.js | 12 +
.../common/modal_popups/confirmation_popup.js | 11 +-
.../app/views/common/quick_view_link_view.js | 64 +-
.../app/views/common/widget/heatmap_widget_view.js | 24 +-
.../stack_upgrade/upgrade_version_column_view.js | 11 +-
.../main/dashboard/widgets/hbase_master_uptime.js | 7 +-
.../main/dashboard/widgets/namenode_uptime.js | 7 +-
.../dashboard/widgets/resource_manager_uptime.js | 7 +-
.../main/dashboard/widgets/uptime_text_widget.js | 70 +-
ambari-web/app/views/main/host/details.js | 4 +
.../views/main/host/details/host_component_view.js | 92 +-
ambari-web/app/views/main/host/summary.js | 170 +-
ambari-web/app/views/main/menu.js | 4 +
ambari-web/app/views/main/service/item.js | 4 +
.../main/service/widgets/create/wizard_view.js | 2 +-
.../nameNode/step3_controller_test.js | 23 +-
.../kerberos/kerberos_wizard_controler_test.js | 8 +-
.../main/admin/kerberos/step2_controller_test.js | 2 +-
.../charts/heatmap_metrics/heatmap_metric_test.js | 260 +-
.../test/controllers/main/host/details_test.js | 643 +-
.../manage_config_groups_controller_test.js | 5 +-
ambari-web/test/controllers/wizard/step4_test.js | 45 +-
ambari-web/test/controllers/wizard/step8_test.js | 41 +-
ambari-web/test/mappers/service_mapper_test.js | 5 +-
.../common/configs/configs_comparator_test.js | 5 -
.../add_component_config_initializer_test.js | 140 +
ambari-web/test/utils/date/date_test.js | 52 +-
ambari-web/test/utils/heatmap_test.js | 141 -
.../test/views/common/breadcrumbs_view_test.js | 5 +
.../test/views/common/chart/linear_time_test.js | 10 +-
.../common/configs/config_history_flow_test.js | 756 -
.../configs/config_versions_control_view_test.js | 151 +
.../configs/config_versions_dropdown_view_test.js | 82 +
.../common/configs/overriddenProperty_view_test.js | 42 -
.../common/configs/service_config_view_test.js | 52 +-
.../service_configs_by_category_view_test.js | 18 +-
ambari-web/test/views/common/controls_view_test.js | 64 +-
.../common/host_progress_popup_body_view_test.js | 84 +-
.../test/views/common/quick_link_view_test.js | 15 +-
.../common/widget/heatmap_widget_view_test.js | 27 +-
.../stack_upgrade/upgrade_history_view_test.js | 4 +-
.../dashboard/widgets/hbase_master_uptime_test.js | 91 -
.../main/dashboard/widgets/namenode_uptime_test.js | 95 -
.../widgets/resource_manager_uptime_test.js | 83 -
.../dashboard/widgets/uptime_text_widget_test.js | 70 +-
.../main/host/details/host_component_view_test.js | 136 +-
ambari-web/test/views/main/host/summary_test.js | 396 +-
.../vendor/theme/fonts/Roboto-Bold-webfont.eot | Bin 0 -> 47517 bytes
.../vendor/theme/fonts/Roboto-Bold-webfont.svg | 607 +
.../vendor/theme/fonts/Roboto-Bold-webfont.ttf | Bin 0 -> 47319 bytes
.../vendor/theme/fonts/Roboto-Bold-webfont.woff | Bin 0 -> 21320 bytes
.../common-services/NIFI/1.0.0/metainfo.xml | 5 +-
.../management-packs/isilon-onefs-mpack/.gitignore | 1 +
.../management-packs/isilon-onefs-mpack/pom.xml | 133 +
.../src/main/assemblies/isilon-onefs-mpack.xml | 40 +
.../addon-services/ONEFS/1.0.0/alerts.json | 122 +
.../ONEFS/1.0.0/configuration/core-site.xml | 100 +
.../ONEFS/1.0.0/configuration/hadoop-env.xml | 404 +
.../ONEFS/1.0.0/configuration/hdfs-site.xml | 65 +
.../ONEFS/1.0.0/configuration/onefs.xml | 30 +
.../addon-services/ONEFS/1.0.0/kerberos.json | 73 +
.../addon-services/ONEFS/1.0.0/metainfo.xml | 111 +
.../addon-services/ONEFS/1.0.0/metrics.json | 230 +
.../ONEFS/1.0.0}/package/scripts/__init__.py | 0
.../ONEFS/1.0.0/package/scripts/onefs_client.py | 63 +
.../ONEFS/1.0.0/package/scripts/params.py | 29 +
.../ONEFS/1.0.0/package/scripts/params_linux.py | 70 +
.../ONEFS/1.0.0/package/scripts/params_windows.py | 83 +
.../ONEFS/1.0.0/package/scripts/service_check.py | 59 +
.../ONEFS/1.0.0}/package/scripts/status_params.py | 0
.../ONEFS/1.0.0/quicklinks/quicklinks.json | 31 +
.../addon-services/ONEFS/1.0.0/service_advisor.py | 122 +
.../addon-services/ONEFS/1.0.0/themes/theme.json | 60 +
.../addon-services/ONEFS/1.0.0/widgets.json | 141 +
.../src/main/resources/mpack.json | 28 +
.../src/test/python/TestServiceAdvisor.py | 67 +
.../src/test/python/unitTests.py | 132 +
.../MICROSOFT_R_SERVER/8.0.5/metainfo.xml | 5 +-
.../stacks/ODPi/2.0/services/HIVE/metainfo.xml | 15 +-
.../stacks/ODPi/2.0/services/YARN/metainfo.xml | 15 +-
.../ODPi/2.0/services/YARN/package/scripts/yarn.py | 4 +-
.../view/commons/hdfs/FileOperationService.java | 4 +-
.../resources/ui/app/services/file-operation.js | 2 +-
.../main/resources/ui/app/routes/savedqueries.js | 10 +-
contrib/views/pom.xml | 5 +
dev-support/build-ambari.sh | 58 +
docs/pom.xml | 16 +-
docs/src/site/apt/index.apt | 2 +-
docs/src/site/apt/whats-new.apt | 14 +-
docs/src/site/site.xml | 16 +-
pom.xml | 1 +
2207 files changed, 84814 insertions(+), 168147 deletions(-)
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000..53433fc
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,10 @@
+## What changes were proposed in this pull request?
+
+(Please fill in changes proposed in this fix)
+
+## How was this patch tested?
+
+(Please explain how this patch was tested. Ex: unit tests, manual tests)
+(If this patch involves UI changes, please attach a screen-shot; otherwise, remove this)
+
+Please review [Ambari Contributing Guide](https://cwiki.apache.org/confluence/display/AMBARI/How+to+Contribute) before opening a pull request.
\ No newline at end of file
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/index.html b/ambari-admin/src/main/resources/ui/admin-web/app/index.html
index bf033e6..99f1b94 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/index.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/index.html
@@ -54,15 +54,15 @@
<div class="container">
<div class="navbar-header navbar-nav">
<ol class="breadcrumb">
- <li ng-repeat="breadcrumb in breadcrumbs" ng-class="$last && 'active'">{{breadcrumb}}</li>
+ <li ng-repeat="breadcrumb in breadcrumbs" ng-class="$last && 'active'" ng-cloak>{{breadcrumb}}</li>
</ol>
</div>
<ul class="nav navbar-nav navbar-right">
<li>
- <p class="navbar-text">{{cluster.Clusters.cluster_name}}</p>
+ <p class="navbar-text" ng-cloak>{{cluster.Clusters.cluster_name}}</p>
</li>
<li class="dropdown">
- <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" ng-disabled="disabled">
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" ng-disabled="disabled" ng-cloak>
<i class="fa fa-user"></i> {{currentUser}} <span class="caret"></span>
</a>
<ul class="dropdown-menu">
@@ -150,6 +150,7 @@
<script src="scripts/directives/PasswordVerify.js"></script>
<script src="scripts/directives/disabledTooltip.js"></script>
<script src="scripts/directives/editableList.js"></script>
+<script src="scripts/directives/comboSearch.js"></script>
<script src="scripts/services/Utility.js"></script>
<script src="scripts/services/UserConstants.js"></script>
<script src="scripts/services/User.js"></script>
@@ -169,6 +170,8 @@
<script src="scripts/services/AddRepositoryModal.js"></script>
<script src="scripts/services/AddVersionModal.js"></script>
<script src="scripts/services/RoleDetailsModal.js"></script>
+<script src="scripts/services/Pagination.js"></script>
+<script src="scripts/services/Filters.js"></script>
<!-- endbuild -->
</body>
</html>
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/SideNavCtrl.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/SideNavCtrl.js
index 558d110..6bf356d 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/SideNavCtrl.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/SideNavCtrl.js
@@ -29,11 +29,7 @@ angular.module('ambariAdminConsole')
}, true);
function loadRepos() {
- Stack.allRepos({version: '',
- cluster: {
- options: [],
- current: null
- }}, {}).then(function (repos) {
+ Stack.allRepos().then(function (repos) {
$scope.totalRepos = repos.itemTotal;
});
}
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsListCtrl.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsListCtrl.js
index 8b37dca..f536e50 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsListCtrl.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsListCtrl.js
@@ -18,154 +18,65 @@
'use strict';
angular.module('ambariAdminConsole')
-.controller('ViewsListCtrl',['$scope', 'View','$modal', 'Alert', 'ConfirmationModal', '$translate', 'Settings', function($scope, View, $modal, Alert, ConfirmationModal, $translate, Settings) {
+.controller('ViewsListCtrl',
+['$scope', 'View','$modal', 'Alert', 'ConfirmationModal', '$translate', 'Settings', 'Pagination', 'Filters',
+function($scope, View, $modal, Alert, ConfirmationModal, $translate, Settings, Pagination, Filters) {
var $t = $translate.instant;
var VIEWS_VERSION_STATUS_TIMEOUT = 5000;
$scope.isLoading = false;
$scope.minInstanceForPagination = Settings.minRowsToShowPagination;
- function checkViewVersionStatus(view, versionObj, versionNumber) {
- var deferred = View.checkViewVersionStatus(view.view_name, versionNumber);
-
- deferred.promise.then(function (status) {
- if (versionNeedStatusUpdate(status)) {
- setTimeout(function() {
- checkViewVersionStatus(view, versionObj, versionNumber);
- }, VIEWS_VERSION_STATUS_TIMEOUT);
- } else {
- versionObj.status = status;
- angular.forEach(view.versions, function (version) {
- if (version.status === 'DEPLOYED') {
- view.canCreateInstance = true;
- }
- })
- }
- });
- }
-
- function versionNeedStatusUpdate(status) {
- return status !== 'DEPLOYED' && status !== 'ERROR';
- }
-
- function loadViews() {
- $scope.isLoading = true;
- View.all().then(function (views) {
- $scope.isLoading = false;
- $scope.views = views;
- $scope.instances = [];
- angular.forEach(views, function (view) {
- angular.forEach(view.versions, function (versionObj, versionNumber) {
- if (versionNeedStatusUpdate(versionObj.status)) {
- checkViewVersionStatus(view, versionObj, versionNumber);
- }
- });
- angular.forEach(view.instances, function (instance) {
- instance.ViewInstanceInfo.short_url_name = instance.ViewInstanceInfo.short_url_name || '';
- instance.ViewInstanceInfo.short_url = instance.ViewInstanceInfo.short_url || '';
- instance.ViewInstanceInfo.versionObj = view.versions[instance.ViewInstanceInfo.version] || {};
- $scope.instances.push(instance.ViewInstanceInfo);
- });
- });
- initTypeFilter();
- $scope.filterInstances();
- }).catch(function (data) {
- Alert.error($t('views.alerts.cannotLoadViews'), data.data.message);
- });
- }
-
- function initTypeFilter() {
- var uniqTypes = $.unique($scope.instances.map(function(instance) {
- return instance.view_name;
- }));
- $scope.typeFilterOptions = [ { label: $t('common.all'), value: '*'} ]
- .concat(uniqTypes.map(function(type) {
- return {
- label: type,
- value: type
- };
- }));
- $scope.instanceTypeFilter = $scope.typeFilterOptions[0];
- }
-
- function showInstancesOnPage() {
- var startIndex = ($scope.currentPage - 1) * $scope.instancesPerPage + 1;
- var endIndex = $scope.currentPage * $scope.instancesPerPage;
- var showedCount = 0;
- var filteredCount = 0;
-
- angular.forEach($scope.instances, function(instance) {
- instance.isShowed = false;
- if (instance.isFiltered) {
- filteredCount++;
- if (filteredCount >= startIndex && filteredCount <= endIndex) {
- instance.isShowed = true;
- showedCount++;
- }
- }
- });
- $scope.tableInfo.showed = showedCount;
- }
-
+ $scope.filters = [
+ {
+ key: 'short_url_name',
+ label: $t('common.name'),
+ options: []
+ },
+ {
+ key: 'url',
+ label: $t('urls.url'),
+ customValueConverter: function(item) {
+ return '/main/view/' + item.view_name + '/' + item.short_url;
+ },
+ options: []
+ },
+ {
+ key: 'view_name',
+ label: $t('views.table.viewType'),
+ options: []
+ },
+ {
+ key: 'instance_name',
+ label: $t('urls.viewInstance'),
+ options: []
+ }
+ ];
$scope.views = [];
$scope.instances = [];
- $scope.instancesPerPage = 10;
- $scope.currentPage = 1;
- $scope.instanceNameFilter = '';
- $scope.instanceUrlFilter = '';
- $scope.maxVisiblePages = 10;
- $scope.isNotEmptyFilter = true;
- $scope.instanceTypeFilter = '';
$scope.tableInfo = {
filtered: 0,
- showed: 0
+ showed: 0,
+ total: 0
};
+ $scope.pagination = Pagination.create();
- loadViews();
-
- $scope.filterInstances = function() {
- var filteredCount = 0;
- angular.forEach($scope.instances, function(instance) {
- if ($scope.instanceNameFilter && instance.short_url_name.indexOf($scope.instanceNameFilter) === -1) {
- return instance.isFiltered = false;
- }
- if ($scope.instanceUrlFilter && ('/main/view/'+ instance.view_name + '/' + instance.short_url).indexOf($scope.instanceUrlFilter) === -1) {
- return instance.isFiltered = false;
- }
- if ($scope.instanceTypeFilter.value !== '*' && instance.view_name.indexOf($scope.instanceTypeFilter.value) === -1) {
- return instance.isFiltered = false;
- }
- filteredCount++;
- instance.isFiltered = true;
- });
- $scope.tableInfo.filtered = filteredCount;
- $scope.resetPagination();
+ $scope.resetPagination = function() {
+ $scope.pagination.resetPagination($scope.instances, $scope.tableInfo);
};
$scope.pageChanged = function() {
- showInstancesOnPage();
+ $scope.pagination.pageChanged($scope.instances, $scope.tableInfo);
};
- $scope.resetPagination = function() {
- $scope.currentPage = 1;
- showInstancesOnPage();
+ $scope.filterInstances = function(appliedFilters) {
+ $scope.tableInfo.filtered = Filters.filterItems(appliedFilters, $scope.instances, $scope.filters);
+ $scope.pagination.resetPagination($scope.instances, $scope.tableInfo);
};
- $scope.clearFilters = function () {
- $scope.instanceNameFilter = '';
- $scope.instanceUrlFilter = '';
- $scope.instanceTypeFilter = $scope.typeFilterOptions[0];
- $scope.resetPagination();
+ $scope.toggleSearchBox = function() {
+ $('.search-box-button .popup-arrow-up, .search-box-row').toggleClass('hide');
};
- $scope.$watch(
- function (scope) {
- return Boolean(scope.instanceNameFilter || scope.instanceUrlFilter || (scope.instanceTypeFilter && scope.instanceTypeFilter.value !== '*'));
- },
- function (newValue, oldValue, scope) {
- scope.isNotEmptyFilter = newValue;
- }
- );
-
$scope.cloneInstance = function(instanceClone) {
$scope.createInstance(instanceClone);
};
@@ -207,4 +118,57 @@ angular.module('ambariAdminConsole')
});
});
};
+
+ loadViews();
+
+ function checkViewVersionStatus(view, versionObj, versionNumber) {
+ var deferred = View.checkViewVersionStatus(view.view_name, versionNumber);
+
+ deferred.promise.then(function (status) {
+ if (versionNeedStatusUpdate(status)) {
+ setTimeout(function() {
+ checkViewVersionStatus(view, versionObj, versionNumber);
+ }, VIEWS_VERSION_STATUS_TIMEOUT);
+ } else {
+ versionObj.status = status;
+ angular.forEach(view.versions, function (version) {
+ if (version.status === 'DEPLOYED') {
+ view.canCreateInstance = true;
+ }
+ })
+ }
+ });
+ }
+
+ function versionNeedStatusUpdate(status) {
+ return status !== 'DEPLOYED' && status !== 'ERROR';
+ }
+
+ function loadViews() {
+ $scope.isLoading = true;
+ View.all().then(function (views) {
+ $scope.isLoading = false;
+ $scope.views = views;
+ $scope.instances = [];
+ angular.forEach(views, function (view) {
+ angular.forEach(view.versions, function (versionObj, versionNumber) {
+ if (versionNeedStatusUpdate(versionObj.status)) {
+ checkViewVersionStatus(view, versionObj, versionNumber);
+ }
+ });
+ angular.forEach(view.instances, function (instance) {
+ instance.ViewInstanceInfo.short_url_name = instance.ViewInstanceInfo.short_url_name || '';
+ instance.ViewInstanceInfo.short_url = instance.ViewInstanceInfo.short_url || '';
+ instance.ViewInstanceInfo.versionObj = view.versions[instance.ViewInstanceInfo.version] || {};
+ $scope.instances.push(instance.ViewInstanceInfo);
+ });
+ });
+ $scope.tableInfo.total = $scope.instances.length;
+ Filters.initFilterOptions($scope.filters, $scope.instances);
+ $scope.filterInstances();
+ }).catch(function (data) {
+ Alert.error($t('views.alerts.cannotLoadViews'), data.data.message);
+ });
+ }
+
}]);
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/remoteClusters/RemoteClustersListCtrl.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/remoteClusters/RemoteClustersListCtrl.js
index 9d47307..5944d20 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/remoteClusters/RemoteClustersListCtrl.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/remoteClusters/RemoteClustersListCtrl.js
@@ -18,92 +18,74 @@
'use strict';
angular.module('ambariAdminConsole')
-.controller('RemoteClustersListCtrl', ['$scope', '$routeParams', '$translate', 'RemoteCluster', function ($scope, $routeParams, $translate, RemoteCluster) {
+.controller('RemoteClustersListCtrl',
+['$scope', '$routeParams', '$translate', 'RemoteCluster', 'Settings', 'Pagination', 'Filters',
+function ($scope, $routeParams, $translate, RemoteCluster, Settings, Pagination, Filters) {
var $t = $translate.instant;
+ $scope.minInstanceForPagination = Settings.minRowsToShowPagination;
$scope.clusterName = $routeParams.clusterName;
$scope.isLoading = false;
-
$scope.constants = {
groups: $t('common.clusters').toLowerCase()
};
-
- $scope.groupsPerPage = 10;
- $scope.currentPage = 1;
- $scope.totalGroups = 1;
- $scope.currentNameFilter = '';
- $scope.maxVisiblePages=20;
$scope.tableInfo = {
+ filtered: 0,
total: 0,
showed: 0
};
+ $scope.pagination = Pagination.create();
+ $scope.filters = [
+ {
+ key: 'clusterName',
+ label: $t('views.clusterName'),
+ options: []
+ },
+ {
+ key: 'service',
+ label: $t('common.services'),
+ customValueConverter: function (item) {
+ return item.ClusterInfo.services;
+ },
+ isMultiple: true,
+ options: []
+ }
+ ];
- $scope.isNotEmptyFilter = true;
-
- $scope.pageChanged = function() {
- loadRemoteClusters();
- };
- $scope.groupsPerPageChanges = function() {
- loadRemoteClusters();
+ $scope.toggleSearchBox = function () {
+ $('.search-box-button .popup-arrow-up, .search-box-row').toggleClass('hide');
};
- $scope.resetPagination = function() {
- $scope.currentPage = 1;
- loadRemoteClusters();
+ $scope.filterClusters = function (appliedFilters) {
+ $scope.tableInfo.filtered = Filters.filterItems(appliedFilters, $scope.remoteClusters, $scope.filters);
+ $scope.pagination.resetPagination($scope.remoteClusters, $scope.tableInfo);
};
- $scope.typeFilterOptions = [
- $t('common.any')
- ];
-
- $scope.currentTypeFilter = $scope.typeFilterOptions[0];
-
- $scope.clearFilters = function () {
- $scope.currentNameFilter = '';
- $scope.currentTypeFilter = $scope.typeFilterOptions[0];
- $scope.resetPagination();
+ $scope.pageChanged = function () {
+ $scope.pagination.pageChanged($scope.remoteClusters, $scope.tableInfo);
};
- function loadRemoteClusters(){
- $scope.isLoading = true;
- RemoteCluster.all({
- currentPage: $scope.currentPage,
- groupsPerPage: $scope.groupsPerPage,
- searchString: $scope.currentNameFilter,
- service: $scope.currentTypeFilter
- }).then(function(remoteclusters) {
- $scope.isLoading = false;
-
- $scope.totalGroups = remoteclusters.itemTotal;
- $scope.tableInfo.total = remoteclusters.itemTotal;
- $scope.tableInfo.showed = remoteclusters.items.length;
-
- $scope.remoteClusters = remoteclusters.items;
-
- remoteclusters.items.map(function(clusteritem){
- clusteritem.ClusterInfo.services.map(function(service){
- var serviceIndex = $scope.typeFilterOptions.indexOf(service);
- if(serviceIndex == -1){
- $scope.typeFilterOptions.push(service);
- }
- })
- })
+ $scope.resetPagination = function () {
+ $scope.pagination.resetPagination($scope.remoteClusters, $scope.tableInfo);
+ };
- })
- .catch(function(data) {
+ function loadRemoteClusters() {
+ $scope.isLoading = true;
+ RemoteCluster.all().then(function (remoteclusters) {
+ $scope.isLoading = false;
+ $scope.remoteClusters = remoteclusters.items.map(function (item) {
+ item.clusterName = item.ClusterInfo.name;
+ return item;
+ });
+ $scope.tableInfo.total = $scope.remoteClusters.length;
+ $scope.filterClusters();
+ Filters.initFilterOptions($scope.filters, $scope.remoteClusters);
+ })
+ .catch(function (data) {
console.error($t('remoteClusters.alerts.fetchError'), data);
});
- };
+ }
loadRemoteClusters();
- $scope.$watch(
- function (scope) {
- return Boolean(scope.currentNameFilter || (scope.currentTypeFilter));
- },
- function (newValue, oldValue, scope) {
- scope.isNotEmptyFilter = newValue;
- }
- );
-
}]);
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js
index 8ffb29b..2a2151d 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js
@@ -40,6 +40,16 @@ angular.module('ambariAdminConsole')
display_name: ''
};
+ $scope.isGPLAccepted = false;
+
+ $scope.isGPLRepo = function (repository) {
+ return repository.Repositories.tags && repository.Repositories.tags.indexOf('GPL') >= 0;
+ };
+
+ $scope.showRepo = function (repository) {
+ return $scope.isGPLAccepted || !$scope.isGPLRepo(repository);
+ };
+
$scope.publicOption = {
index: 1,
hasError: false
@@ -176,6 +186,15 @@ angular.module('ambariAdminConsole')
};
/**
+ * Load GPL License Accepted value
+ */
+ $scope.fetchGPLLicenseAccepted = function () {
+ Stack.getGPLLicenseAccepted().then(function (data) {
+ $scope.isGPLAccepted = data === 'true';
+ })
+ };
+
+ /**
* Load supported OS list
*/
$scope.afterStackVersionRead = function () {
@@ -350,7 +369,11 @@ angular.module('ambariAdminConsole')
$scope.updateRepoVersions = function () {
var skip = $scope.skipValidation || $scope.useRedhatSatellite;
- return Stack.validateBaseUrls(skip, $scope.osList, $scope.upgradeStack).then(function (invalidUrls) {
+ // Filter out repositories that are not shown in the UI
+ var osList = Object.assign([], $scope.osList).map(function(os) {
+ return Object.assign({}, os, {repositories: os.repositories.filter(function(repo) { return $scope.showRepo(repo); })});
+ });
+ return Stack.validateBaseUrls(skip, osList, $scope.upgradeStack).then(function (invalidUrls) {
if (invalidUrls.length === 0) {
Stack.updateRepo($scope.upgradeStack.stack_name, $scope.upgradeStack.stack_version, $scope.id, $scope.updateObj).then(function () {
Alert.success($t('versions.alerts.versionEdited', {
@@ -477,6 +500,9 @@ angular.module('ambariAdminConsole')
// load supported os type base on stack version
$scope.afterStackVersionRead();
+
+ // Load GPL license accepted value
+ $scope.fetchGPLLicenseAccepted();
};
$scope.selectRepoInList = function() {
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsEditCtrl.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsEditCtrl.js
index a4b121c..2a1d244 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsEditCtrl.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsEditCtrl.js
@@ -36,7 +36,7 @@ angular.module('ambariAdminConsole')
$scope.isGPLAccepted = false;
$scope.isGPLRepo = function (repository) {
- return repository.Repositories.tags && repository.Repositories.tags.indexOf('GPL') >= 0;
+ return repository.Repositories.tags.indexOf('GPL') >= 0;
};
$scope.showRepo = function (repository) {
@@ -136,7 +136,7 @@ angular.module('ambariAdminConsole')
};
$scope.isDeletable = function() {
- return !($scope.repoStatus == 'current' || $scope.repoStatus == 'installed');
+ return !($scope.repoStatus === 'CURRENT' || $scope.repoStatus === 'INSTALLED');
};
$scope.disableUnusedOS = function() {
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsListCtrl.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsListCtrl.js
index 003d472..ea7a480 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsListCtrl.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsListCtrl.js
@@ -18,93 +18,96 @@
'use strict';
angular.module('ambariAdminConsole')
- .controller('StackVersionsListCtrl', ['$scope', 'Cluster', 'Stack', '$routeParams', '$translate', 'Settings', function ($scope, Cluster, Stack, $routeParams, $translate, Settings) {
+ .controller('StackVersionsListCtrl',
+ ['$scope', 'Cluster', 'Stack', '$routeParams', '$translate', 'Settings', 'Pagination', '$q', 'Filters',
+ function ($scope, Cluster, Stack, $routeParams, $translate, Settings, Pagination, $q, Filters) {
var $t = $translate.instant;
$scope.getConstant = function (key) {
return $t(key).toLowerCase();
};
+ $scope.minInstanceForPagination = Settings.minRowsToShowPagination;
$scope.isLoading = false;
$scope.clusterName = $routeParams.clusterName;
- $scope.filter = {
- name: '',
- version: '',
- type: '',
- cluster: {
- options: [],
- current: null
- },
- stack: {
- options: [],
- current: null
- }
- };
- $scope.isNotEmptyFilter = true;
-
- $scope.pagination = {
- totalRepos: 10,
- maxVisiblePages: 20,
- itemsPerPage: 10,
- currentPage: 1
- };
-
$scope.tableInfo = {
total: 0,
showed: 0,
filtered: 0
};
-
$scope.repos = [];
$scope.dropDownClusters = [];
$scope.selectedCluster = $scope.dropDownClusters[0];
+ $scope.filters = [
+ {
+ key: 'stack',
+ label: $t('common.stack'),
+ customValueConverter: function(item) {
+ return item.stack_name + '-' + item.stack_version;
+ },
+ options: []
+ },
+ {
+ key: 'display_name',
+ label: $t('common.name'),
+ options: []
+ },
+ {
+ key: 'type',
+ label: $t('common.type'),
+ options: []
+ },
+ {
+ key: 'repository_version',
+ label: $t('common.version'),
+ options: []
+ },
+ {
+ key: 'cluster',
+ label: $t('common.cluster'),
+ options: []
+ }
+ ];
+ $scope.pagination = Pagination.create();
- $scope.resetPagination = function () {
- $scope.pagination.currentPage = 1;
- $scope.loadAllData();
+ $scope.resetPagination = function() {
+ $scope.pagination.resetPagination($scope.repos, $scope.tableInfo);
};
- $scope.pageChanged = function () {
- $scope.loadAllData();
+ $scope.pageChanged = function() {
+ $scope.pagination.pageChanged($scope.repos, $scope.tableInfo);
};
- $scope.goToCluster = function() {
- window.location.replace(Settings.siteRoot + '#/main/admin/stack/versions');
+ $scope.filterRepos = function (appliedFilters) {
+ $scope.tableInfo.filtered = Filters.filterItems(appliedFilters, $scope.repos, $scope.filters);
+ $scope.pagination.resetPagination($scope.repos, $scope.tableInfo);
+ };
+
+ $scope.toggleSearchBox = function() {
+ $('.search-box-button .popup-arrow-up, .search-box-row').toggleClass('hide');
};
- $scope.clearFilters = function () {
- $scope.filter.name = '';
- $scope.filter.version = '';
- $scope.filter.cluster.current = $scope.filter.cluster.options[0];
- $scope.filter.stack.current = $scope.filter.stack.options[0];
- $scope.resetPagination();
+ $scope.goToCluster = function() {
+ window.location.replace(Settings.siteRoot + '#/main/admin/stack/versions');
};
$scope.fetchRepoClusterStatus = function (allRepos) {
+ var calls = [];
if (allRepos && allRepos.length) {
- var clusterName = ($scope.clusters && $scope.clusters.length > 0) ? $scope.clusters[0].Clusters.cluster_name : null, // only support one cluster at the moment
- repos = [],
- processedRepos = 0;
+ // only support one cluster at the moment
+ var clusterName = $scope.cluster && $scope.cluster.Clusters.cluster_name;
if (clusterName) {
- angular.forEach(allRepos, function (repo) {
- Cluster.getRepoVersionStatus(clusterName, repo.id).then(function (response) {
- repo.cluster = (response.status == 'current' || response.status == 'installed') ? clusterName : '';
- if (!$scope.filter.cluster.current.value || repo.cluster) {
+ $scope.repos = allRepos;
+ $scope.tableInfo.total = allRepos.length;
+ angular.forEach($scope.repos, function (repo) {
+ calls.push(Cluster.getRepoVersionStatus(clusterName, repo.id).then(function (response) {
+ repo.cluster = (response.status === 'CURRENT' || response.status === 'INSTALLED') ? clusterName : '';
+ if (repo.cluster) {
repo.status = response.status;
repo.totalHosts = response.totalHosts;
repo.currentHosts = response.currentHosts;
repo.installedHosts = response.installedHosts;
repo.stackVersionId = response.stackVersionId;
- repos.push(repo);
}
- processedRepos++;
- if (processedRepos === allRepos.length) {
- var from = ($scope.pagination.currentPage - 1) * $scope.pagination.itemsPerPage;
- var to = (repos.length - from > $scope.pagination.itemsPerPage) ? from + $scope.pagination.itemsPerPage : repos.length;
- $scope.repos = repos.slice(from, to);
- $scope.tableInfo.total = repos.length;
- $scope.pagination.totalRepos = repos.length;
- $scope.tableInfo.showed = to - from;
- }
- });
+ }));
});
}
} else {
@@ -113,101 +116,52 @@ angular.module('ambariAdminConsole')
$scope.pagination.totalRepos = 0;
$scope.tableInfo.showed = 0;
}
+ $scope.tableInfo.total = $scope.repos.length;
+ return $q.all(calls);
};
$scope.fetchRepos = function () {
- return Stack.allRepos($scope.filter).then(function (repos) {
+ return Stack.allRepos().then(function (repos) {
$scope.isLoading = false;
return repos.items;
});
};
- $scope.fillClusters = function (clusters) {
- $scope.dropDownClusters = [].concat(clusters);
- var options = [{label: $t('common.all'), value: ''}];
- angular.forEach(clusters, function (cluster) {
- options.push({
- label: cluster.Clusters.cluster_name,
- value: cluster.Clusters.cluster_name
- });
- });
- $scope.filter.cluster.options = options;
- if (!$scope.filter.cluster.current) {
- $scope.filter.cluster.current = options[0];
- }
- };
-
$scope.fetchClusters = function () {
return Cluster.getAllClusters().then(function (clusters) {
if (clusters && clusters.length > 0) {
- $scope.clusters = clusters;
- $scope.fillClusters(clusters);
- }
- });
- };
-
- $scope.fetchStacks = function () {
- return Stack.allStackVersions().then(function (clusters) {
- if (clusters && clusters.length > 0) {
- $scope.stacks = clusters;
- $scope.fillStacks(clusters);
- }
- });
- };
-
- $scope.fillStacks = function() {
- var options = [{label: $t('common.all'), value: ''}];
- angular.forEach($scope.stacks, function (stack) {
- if (stack.active) {
- options.push({
- label: stack.displayName,
- value: stack.displayName
- });
+ $scope.dropDownClusters = clusters;
}
});
- $scope.filter.stack.options = options;
- if (!$scope.filter.stack.current) {
- $scope.filter.stack.current = options[0];
- }
};
$scope.loadAllData = function () {
$scope.isLoading = true;
- $scope.fetchStacks()
- .then(function () {
- return $scope.fetchClusters();
- })
- .then(function () {
- return $scope.fetchRepos();
- })
+ $scope.fetchRepos()
.then(function (repos) {
- $scope.fetchRepoClusterStatus(repos);
+ $scope.fetchClusters();
+ $scope.fetchRepoClusterStatus(repos).then(function() {
+ Filters.initFilterOptions($scope.filters, $scope.repos);
+ });
+ $scope.filterRepos();
});
};
$scope.loadAllData();
- $scope.$watch('filter', function (filter) {
- $scope.isNotEmptyFilter = Boolean(filter.name
- || filter.version
- || filter.type
- || (filter.cluster.current && filter.cluster.current.value)
- || (filter.stack.current && filter.stack.current.value));
- }, true);
-
$scope.toggleVisibility = function (repo) {
repo.isProccessing = true;
var payload = {
- RepositoryVersions:{
+ RepositoryVersions: {
hidden: repo.hidden
}
- }
- Stack.updateRepo(repo.stack_name, repo.stack_version, repo.id, payload).then( null, function () {
+ };
+ Stack.updateRepo(repo.stack_name, repo.stack_version, repo.id, payload).then(null, function () {
repo.hidden = !repo.hidden;
- }).finally( function () {
+ }).finally(function () {
delete repo.isProccessing;
});
- }
+ };
$scope.isHideCheckBoxEnabled = function ( repo ) {
return !repo.isProccessing && ( !repo.cluster || repo.isPatch && ( repo.status === 'installed' || repo.status === 'install_failed') );
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/userManagement/GroupsListCtrl.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/userManagement/GroupsListCtrl.js
index 61b5282..a28f827 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/userManagement/GroupsListCtrl.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/userManagement/GroupsListCtrl.js
@@ -19,8 +19,8 @@
angular.module('ambariAdminConsole')
.controller('GroupsListCtrl',
-['$scope', 'Group', '$modal', 'ConfirmationModal', '$rootScope', '$translate', 'Settings', 'Cluster', 'View', 'Alert',
-function($scope, Group, $modal, ConfirmationModal, $rootScope, $translate, Settings, Cluster, View, Alert) {
+['$scope', 'Group', '$modal', 'ConfirmationModal', '$rootScope', '$translate', 'Settings', 'Cluster', 'View', 'Alert', 'Pagination', 'Filters',
+function($scope, Group, $modal, ConfirmationModal, $rootScope, $translate, Settings, Cluster, View, Alert, Pagination, Filters) {
var $t = $translate.instant;
$scope.constants = {
groups: $t('common.groups').toLowerCase()
@@ -28,84 +28,64 @@ function($scope, Group, $modal, ConfirmationModal, $rootScope, $translate, Setti
$scope.minRowsToShowPagination = Settings.minRowsToShowPagination;
$scope.isLoading = false;
$scope.groups = [];
-
- $scope.groupsPerPage = 10;
- $scope.currentPage = 1;
- $scope.totalGroups = 0;
- $scope.filter = {
- name: '',
- type: null
- };
- $scope.maxVisiblePages=20;
$scope.tableInfo = {
+ filtered: 0,
total: 0,
showed: 0
};
- $scope.isNotEmptyFilter = true;
+ $scope.pagination = Pagination.create();
+ $scope.filters = [
+ {
+ key: 'group_name',
+ label: $t('groups.name'),
+ options: []
+ },
+ {
+ key: 'groupTypeName',
+ label: $t('common.type'),
+ options: []
+ }
+ ];
+
+ $scope.resetPagination = function() {
+ $scope.pagination.resetPagination($scope.groups, $scope.tableInfo);
+ };
$scope.pageChanged = function() {
- loadGroups();
+ $scope.pagination.pageChanged($scope.groups, $scope.tableInfo);
};
- $scope.groupsPerPageChanges = function() {
- loadGroups();
+
+ $scope.filterGroups = function(appliedFilters) {
+ $scope.tableInfo.filtered = Filters.filterItems(appliedFilters, $scope.groups, $scope.filters);
+ $scope.pagination.resetPagination($scope.groups, $scope.tableInfo);
};
- $scope.resetPagination = function() {
- $scope.currentPage = 1;
- loadGroups();
+ $scope.toggleSearchBox = function() {
+ $('.search-box-button .popup-arrow-up, .search-box-row').toggleClass('hide');
};
- function loadGroups(){
+ $scope.loadGroups = function() {
$scope.isLoading = true;
- Group.all({
- currentPage: $scope.currentPage,
- groupsPerPage: $scope.groupsPerPage,
- searchString: $scope.filter.name,
- group_type: $scope.filter.type.value
- }).then(function(groups) {
+ Group.all().then(function(groups) {
$scope.isLoading = false;
- $scope.totalGroups = groups.itemTotal;
$scope.groups = groups.map(Group.makeGroup);
- $scope.tableInfo.total = groups.itemTotal;
- $scope.tableInfo.showed = groups.length;
+ $scope.tableInfo.total = $scope.groups.length;
+ Filters.initFilterOptions($scope.filters, $scope.groups);
+ $scope.filterGroups();
})
.catch(function(data) {
Alert.error($t('groups.alerts.getGroupsListError'), data.data.message);
});
- }
-
- $scope.typeFilterOptions = [{ label: $t('common.all'), value: '*'}]
- .concat(Object.keys(Group.getTypes()).map(function(key) {
- return {
- label: $t(Group.getTypes()[key].LABEL_KEY),
- value: Group.getTypes()[key].VALUE
- };
- }));
- $scope.filter.type = $scope.typeFilterOptions[0];
-
- $scope.clearFilters = function () {
- $scope.filter.name = '';
- $scope.filter.type = $scope.typeFilterOptions[0];
- $scope.resetPagination();
};
-
- loadGroups();
- $scope.$watch(
- function (scope) {
- return Boolean(scope.filter.name || (scope.filter.type && scope.filter.type.value !== '*'));
- },
- function (newValue, oldValue, scope) {
- scope.isNotEmptyFilter = newValue;
- }
- );
+ $scope.loadGroups();
$rootScope.$watch(function(scope) {
return scope.LDAPSynced;
}, function(LDAPSynced) {
if(LDAPSynced === true){
$rootScope.LDAPSynced = false;
- loadGroups();
+ $scope.loadGroups();
}
});
@@ -116,7 +96,7 @@ function($scope, Group, $modal, ConfirmationModal, $rootScope, $translate, Setti
backdrop: 'static'
});
- modalInstance.result.catch(loadGroups);
+ modalInstance.result.finally($scope.loadGroups);
};
$scope.deleteGroup = function(group) {
@@ -158,7 +138,7 @@ function($scope, Group, $modal, ConfirmationModal, $rootScope, $translate, Setti
angular.forEach(viewsPrivileges, function(privilege) {
View.deletePrivilege(privilege);
});
- loadGroups();
+ $scope.loadGroups();
});
});
});
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/userManagement/UsersListCtrl.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/userManagement/UsersListCtrl.js
index 00bf9c3..7982f0b 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/userManagement/UsersListCtrl.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/userManagement/UsersListCtrl.js
@@ -19,95 +19,105 @@
angular.module('ambariAdminConsole')
.controller('UsersListCtrl',
-['$scope', 'User', '$modal', '$rootScope', 'UserConstants', '$translate', 'Cluster', 'View', 'ConfirmationModal', 'Settings',
-function($scope, User, $modal, $rootScope, UserConstants, $translate, Cluster, View, ConfirmationModal, Settings) {
+['$scope', 'User', '$modal', '$rootScope', 'UserConstants', '$translate', 'Cluster', 'View', 'ConfirmationModal', 'Settings', 'Pagination', 'Filters',
+function($scope, User, $modal, $rootScope, UserConstants, $translate, Cluster, View, ConfirmationModal, Settings, Pagination, Filters) {
var $t = $translate.instant;
$scope.constants = {
admin: $t('users.ambariAdmin'),
users: $t('common.users').toLowerCase()
};
+ $scope.users = [];
$scope.minRowsToShowPagination = Settings.minRowsToShowPagination;
$scope.isLoading = false;
- $scope.users = [];
- $scope.usersPerPage = 10;
- $scope.currentPage = 1;
- $scope.totalUsers = 0;
- $scope.filters = {
- name: '',
- status: null,
- type: null
- };
- $scope.maxVisiblePages = 20;
+ $scope.pagination = Pagination.create();
$scope.tableInfo = {
+ filtered: 0,
total: 0,
showed: 0
};
- $scope.isNotEmptyFilter = true;
+ $scope.filters = [
+ {
+ key: 'user_name',
+ label: $t('users.username'),
+ customValueConverter: function(item) {
+ return item.Users.user_name;
+ },
+ options: []
+ },
+ {
+ key: 'role',
+ label: $t('clusters.role'),
+ customValueConverter: function(item) {
+ return item.Users.roles[0] ? item.Users.roles[0].permission_label : '';
+ },
+ options: []
+ },
+ {
+ key: 'status',
+ label: $t('users.status'),
+ isStatic: true,
+ customValueConverter: function(item) {
+ return item.Users.active ? $t('users.active') : $t('users.inactive');
+ },
+ options: [
+ {
+ key: $t('users.active'),
+ label: $t('users.active')
+ },
+ {
+ key: $t('users.inactive'),
+ label: $t('users.inactive')
+ }
+ ]
+ },
+ {
+ key: 'type',
+ label: $t('common.type'),
+ customValueConverter: function(item) {
+ return item.Users.userTypeName;
+ },
+ options: []
+ },
+ {
+ key: 'group',
+ label: $t('common.group'),
+ isMultiple: true,
+ customValueConverter: function(item) {
+ return item.Users.groups;
+ },
+ options: []
+ }
+ ];
function loadUsers() {
$scope.isLoading = true;
- User.list({
- currentPage: $scope.currentPage,
- usersPerPage: $scope.usersPerPage,
- searchString: $scope.filters.name,
- user_type: $scope.filters.type.value,
- active: $scope.filters.status.value
- }).then(function (data) {
- $scope.totalUsers = data.data.itemTotal;
+ User.list().then(function (data) {
$scope.users = data.data.items.map(User.makeUser);
- $scope.tableInfo.showed = data.data.items.length;
- $scope.tableInfo.total = data.data.itemTotal;
+ $scope.tableInfo.total = $scope.users.length;
+ $scope.filterUsers();
+ Filters.initFilterOptions($scope.filters, $scope.users);
}).finally(function () {
$scope.isLoading = false;
});
}
- $scope.pageChanged = function () {
- loadUsers();
+ $scope.toggleSearchBox = function() {
+ $('.search-box-button .popup-arrow-up, .search-box-row').toggleClass('hide');
};
- $scope.usersPerPageChanges = function () {
- $scope.resetPagination();
+
+ $scope.pageChanged = function () {
+ $scope.pagination.pageChanged($scope.users, $scope.tableInfo);
};
$scope.resetPagination = function () {
- $scope.currentPage = 1;
- loadUsers();
+ $scope.pagination.resetPagination($scope.users, $scope.tableInfo);
};
- $scope.activeFilterOptions = [
- {label: $t('common.all'), value: '*'},
- {label: $t('users.active'), value: true},
- {label: $t('users.inactive'), value: false}
- ];
- $scope.filters.status = $scope.activeFilterOptions[0];
-
- $scope.typeFilterOptions = [{label: $t('common.all'), value: '*'}]
- .concat(Object.keys(UserConstants.TYPES).map(function (key) {
- return {
- label: $t(UserConstants.TYPES[key].LABEL_KEY),
- value: UserConstants.TYPES[key].VALUE
- };
- }));
-
- $scope.filters.type = $scope.typeFilterOptions[0];
-
- $scope.clearFilters = function () {
- $scope.filters.name = '';
- $scope.filters.type = $scope.typeFilterOptions[0];
- $scope.filters.status = $scope.activeFilterOptions[0];
- $scope.resetPagination();
+ $scope.filterUsers = function(appliedFilters) {
+ $scope.tableInfo.filtered = Filters.filterItems(appliedFilters, $scope.users, $scope.filters);
+ $scope.pagination.resetPagination($scope.users, $scope.tableInfo);
};
- $scope.$watch(
- function (scope) {
- return Boolean(scope.filters.name || (scope.filters.status && scope.filters.status.value !== '*')
- || (scope.filters.type && scope.filters.type.value !== '*'));
- },
- function (newValue, oldValue, scope) {
- scope.isNotEmptyFilter = newValue;
- }
- );
-
$rootScope.$watch(function (scope) {
return scope.LDAPSynced;
}, function (LDAPSynced) {
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/directives/comboSearch.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/directives/comboSearch.js
new file mode 100644
index 0000000..f1cd515
--- /dev/null
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/directives/comboSearch.js
@@ -0,0 +1,501 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+'use strict';
+
+
+/**
+ * Example:
+ * <combo-search suggestions="filters"
+ * filter-change="filterItems"
+ * placeholder="Search"
+ * supportCategories="true">
+ * </combo-search>
+ *
+ * filters = [
+ * {
+ * key: 'property1',
+ * label: $t('propertyLabel'),
+ * category: 'category1'
+ * options: []
+ * }
+ * ]
+ * Note: "category" field is optional, should be used only when supportCategories="true"
+ *
+ */
+
+angular.module('ambariAdminConsole')
+.directive('comboSearch', function() {
+ return {
+ restrict: 'E',
+ templateUrl: 'views/directives/comboSearch.html',
+ scope: {
+ suggestions: '=',
+ filterChange: '=',
+ placeholder: '@',
+ supportCategories: '@'
+ },
+ controller: ['$scope', function($scope) {
+ return {
+ suggestions: $scope.suggestions,
+ placeholder: $scope.placeholder,
+ filterChange: $scope.filterChange,
+ supportCategories: $scope.supportCategories === "true"
+ }
+ }],
+ link: function($scope, $elem, $attr, $ctrl) {
+ var idCounter = 1;
+ var suggestions = $ctrl.suggestions;
+ var supportCategories = $ctrl.supportCategories;
+ var mainInputElement = $elem.find('.main-input.combo-search-input');
+ $scope.placeholder = $ctrl.placeholder;
+ $scope.searchFilterInput = '';
+ $scope.filterSuggestions = [];
+ $scope.showAutoComplete = false;
+ $scope.appliedFilters = [];
+
+ attachInputWidthSetter(mainInputElement);
+ initKeyHandlers();
+ initBlurHandler();
+
+ $scope.$watch(function () {
+ return $scope.appliedFilters.length;
+ }, function () {
+ attachInputWidthSetter($elem.find('.combo-search-input'));
+ });
+
+ $scope.removeFilter = function(filter) {
+ $scope.appliedFilters = $scope.appliedFilters.filter(function(item) {
+ return filter.id !== item.id;
+ });
+ $scope.observeSearchFilterInput(event);
+ mainInputElement.focus();
+ $scope.updateFilters($scope.appliedFilters);
+ };
+
+ $scope.clearFilters = function() {
+ $scope.appliedFilters = [];
+ $scope.updateFilters($scope.appliedFilters);
+ };
+
+ $scope.selectFilter = function(filter, event) {
+ var newAppliedFilter = {
+ id: 'filter_' + idCounter++,
+ currentOption: null,
+ filteredOptions: [],
+ searchOptionInput: '',
+ key: filter.key,
+ label: filter.label,
+ options: filter.options || [],
+ showAutoComplete: false
+ };
+ $scope.appliedFilters.push(newAppliedFilter);
+ if (event) {
+ event.stopPropagation();
+ event.preventDefault();
+ }
+ $scope.isEditing = false;
+ $scope.showAutoComplete = false;
+ $scope.searchFilterInput = '';
+ _.debounce(function() {
+ $('input[name=' + newAppliedFilter.id + ']').focus().width(4);
+ }, 100)();
+ };
+
+ $scope.selectOption = function(event, option, filter) {
+ $('input[name=' + filter.id + ']').val(option.label).trigger('input');
+ filter.showAutoComplete = false;
+ mainInputElement.focus();
+ $scope.observeSearchFilterInput(event);
+ filter.currentOption = option;
+ $scope.updateFilters($scope.appliedFilters);
+ };
+
+ $scope.hideAutocomplete = function(filter) {
+ _.debounce(function() {
+ if (filter) {
+ filter.showAutoComplete = false;
+ } else {
+ if (!$scope.isEditing) {
+ $scope.showAutoComplete = false;
+ }
+ }
+ $scope.$apply();
+ }, 100)();
+ };
+
+ $scope.forceFocus = function(event, filter) {
+ $(event.currentTarget).find('.combo-search-input').focus();
+ $scope.showAutoComplete = false;
+ $scope.observeSearchOptionInput(filter);
+ event.stopPropagation();
+ event.preventDefault();
+ };
+
+ $scope.makeActive = function(active, all) {
+ if (active.isCategory) {
+ return false;
+ }
+ all.forEach(function(item) {
+ item.active = active.key === item.key;
+ });
+ };
+
+ $scope.observeSearchFilterInput = function(event) {
+ if (event) {
+ mainInputElement.focus();
+ $scope.isEditing = true;
+ event.stopPropagation();
+ event.preventDefault();
+ }
+
+ var filteredSuggestions = suggestions.filter(function(item) {
+ return (!$scope.searchFilterInput || item.label.toLowerCase().indexOf($scope.searchFilterInput.toLowerCase()) !== -1);
+ });
+ if (filteredSuggestions.length > 0) {
+ $scope.makeActive(filteredSuggestions[0], filteredSuggestions);
+ $scope.showAutoComplete = true;
+ } else {
+ $scope.showAutoComplete = false;
+ }
+ $scope.filterSuggestions = supportCategories ? formatCategorySuggestions(filteredSuggestions) : filteredSuggestions;
+ };
+
+ $scope.observeSearchOptionInput = function(filter) {
+ var appliedOptions = {};
+ $scope.appliedFilters.forEach(function(item) {
+ if (item.key === filter.key && item.currentOption) {
+ appliedOptions[item.currentOption.key] = true;
+ }
+ });
+
+ if (filter.currentOption && filter.currentOption.key !== filter.searchOptionInput) {
+ filter.currentOption = null;
+ }
+ filter.filteredOptions = filter.options.filter(function(option) {
+ return !(option.key === '' || option.key === undefined || appliedOptions[option.key])
+ && (!filter.searchOptionInput || option.label.toLowerCase().indexOf(filter.searchOptionInput.toLowerCase()) !== -1);
+ });
+ resetActive(filter.filteredOptions);
+ filter.showAutoComplete = filter.filteredOptions.length > 0;
+ };
+
+ $scope.extractFilters = function(filters) {
+ var map = {};
+ var result = [];
+
+ filters.forEach(function(filter) {
+ if (filter.currentOption) {
+ if (!map[filter.key]) {
+ map[filter.key] = [];
+ }
+ map[filter.key].push(filter.currentOption.key);
+ }
+ });
+ for(var key in map) {
+ result.push({
+ key: key,
+ values: map[key]
+ });
+ }
+ return result;
+ };
+
+ $scope.updateFilters = function(appliedFilters) {
+ $ctrl.filterChange($scope.extractFilters(appliedFilters));
+ };
+
+ function formatCategorySuggestions(suggestions) {
+ var categories = {};
+ var result = [];
+ suggestions.forEach(function(item) {
+ if (!item.category) {
+ item.category = 'default';
+ }
+ if (!categories[item.category]) {
+ categories[item.category] = [];
+ }
+ categories[item.category].push(item);
+ });
+
+ for(var cat in categories) {
+ result.push({
+ key: cat,
+ label: cat,
+ isCategory: true,
+ isDefault: cat === 'default'
+ });
+ result = result.concat(categories[cat]);
+ }
+ return result;
+ }
+
+ function initBlurHandler() {
+ $(document).click(function() {
+ $scope.isEditing = false;
+ $scope.hideAutocomplete();
+ });
+ }
+
+ function findActiveByName(array, name) {
+ for (var i = 0; i < array.length; i++) {
+ if (array[i].id === name) {
+ return i;
+ }
+ }
+ return null;
+ }
+
+ function findActiveByProperty(array) {
+ for (var i = 0; i < array.length; i++) {
+ if (array[i].active) {
+ return i;
+ }
+ }
+ return -1;
+ }
+
+ function resetActive(array) {
+ array.forEach(function(item) {
+ item.active = false;
+ });
+ }
+
+ function focusInput(filter) {
+ $('input[name=' + filter.id + ']').focus();
+ $scope.showAutoComplete = false;
+ $scope.observeSearchOptionInput(filter);
+ }
+
+ function initKeyHandlers() {
+ $($elem).keydown(function(event) {
+ if (event.which === 13) { // "Enter" key
+ enterKeyHandler();
+ $scope.$apply();
+ }
+ if (event.which === 8) { // "Backspace" key
+ backspaceKeyHandler(event);
+ $scope.$apply();
+ }
+ if (event.which === 38) { // "Up" key
+ upKeyHandler();
+ $scope.$apply();
+ }
+ if (event.which === 40) { // "Down" key
+ downKeyHandler();
+ $scope.$apply();
+ }
+ if (event.which === 39) { // "Right Arrow" key
+ rightArrowKeyHandler();
+ $scope.$apply();
+ }
+ if (event.which === 37) { // "Left Arrow" key
+ leftArrowKeyHandler();
+ $scope.$apply();
+ }
+ if (event.which === 27) { // "Escape" key
+ $scope.showAutoComplete = false;
+ $scope.$apply();
+ }
+ });
+ }
+
+ function leftArrowKeyHandler() {
+ var activeElement = $(document.activeElement);
+ if (activeElement.is('input') && activeElement[0].selectionStart === 0 && $scope.appliedFilters.length > 0) {
+ if (activeElement.hasClass('main-input')) {
+ focusInput($scope.appliedFilters[$scope.appliedFilters.length - 1]);
+ } else {
+ var activeIndex = findActiveByName($scope.appliedFilters, activeElement.attr('name'));
+ if (activeIndex !== null && activeIndex > 0) {
+ focusInput($scope.appliedFilters[activeIndex - 1]);
+ }
+ }
+ }
+ }
+
+ function rightArrowKeyHandler() {
+ var activeElement = $(document.activeElement);
+ if (activeElement.is('input') && activeElement[0].selectionStart === activeElement.val().length) {
+ if (!activeElement.hasClass('main-input')) {
+ var activeIndex = findActiveByName($scope.appliedFilters, activeElement.attr('name'));
+ if (activeIndex !== null) {
+ if (activeIndex === $scope.appliedFilters.length - 1) {
+ mainInputElement.focus();
+ $scope.observeSearchFilterInput();
+ } else {
+ focusInput($scope.appliedFilters[activeIndex + 1]);
+ }
+ }
+ }
+ }
+ }
+
+ function downKeyHandler() {
+ var activeIndex = 0;
+ var nextIndex = null;
+
+ if ($scope.showAutoComplete) {
+ activeIndex = findActiveByProperty($scope.filterSuggestions);
+ if (activeIndex < $scope.filterSuggestions.length - 1) {
+ if ($scope.filterSuggestions[activeIndex + 1].isCategory && activeIndex + 2 < $scope.filterSuggestions.length) {
+ nextIndex = activeIndex + 2;
+ } else {
+ nextIndex = activeIndex + 1;
+ }
+ } else {
+ nextIndex = ($scope.filterSuggestions[0].isCategory) ? 1 : 0;
+ }
+ if (nextIndex !== null) {
+ $scope.makeActive($scope.filterSuggestions[nextIndex], $scope.filterSuggestions);
+ }
+ } else {
+ var activeAppliedFilters = $scope.appliedFilters.filter(function(item) {
+ return item.showAutoComplete;
+ });
+ if (activeAppliedFilters.length > 0) {
+ var filteredOptions = activeAppliedFilters[0].filteredOptions;
+ activeIndex = findActiveByProperty(filteredOptions);
+ if (activeIndex < filteredOptions.length - 1) {
+ nextIndex = activeIndex + 1;
+ } else {
+ //switch to input of option
+ nextIndex = null;
+ resetActive(filteredOptions);
+ focusInput(activeAppliedFilters[0]);
+ }
+ }
+ if (nextIndex !== null) {
+ $scope.makeActive(filteredOptions[nextIndex], filteredOptions);
+ }
+ }
+ }
+
+ function upKeyHandler() {
+ var activeIndex = 0;
+ var nextIndex = null;
+
+ if ($scope.showAutoComplete) {
+ activeIndex = findActiveByProperty($scope.filterSuggestions);
+ if (activeIndex > 0) {
+ if ($scope.filterSuggestions[activeIndex - 1].isCategory) {
+ nextIndex = (activeIndex - 2 > 0) ? activeIndex - 2 : $scope.filterSuggestions.length - 1;
+ } else {
+ nextIndex = activeIndex - 1;
+ }
+ } else {
+ nextIndex = $scope.filterSuggestions.length - 1;
+ }
+ if (nextIndex !== null) {
+ $scope.makeActive($scope.filterSuggestions[nextIndex], $scope.filterSuggestions);
+ }
+ } else {
+ var activeAppliedFilters = $scope.appliedFilters.filter(function(item) {
+ return item.showAutoComplete;
+ });
+ if (activeAppliedFilters.length > 0) {
+ var filteredOptions = activeAppliedFilters[0].filteredOptions;
+ activeIndex = findActiveByProperty(filteredOptions);
+ if (activeIndex > 0) {
+ nextIndex = activeIndex - 1;
+ } else if (activeIndex === 0) {
+ //switch to input of option
+ nextIndex = null;
+ resetActive(filteredOptions);
+ focusInput(activeAppliedFilters[0]);
+ } else {
+ nextIndex = filteredOptions.length - 1;
+ }
+ }
+ if (nextIndex !== null) {
+ $scope.makeActive(filteredOptions[nextIndex], filteredOptions);
+ }
+ }
+ }
+
+ function enterKeyHandler() {
+ if ($scope.showAutoComplete) {
+ var activeFilters = $scope.filterSuggestions.filter(function(item) {
+ return item.active;
+ });
+ if (activeFilters.length > 0) {
+ $scope.selectFilter(activeFilters[0]);
+ }
+ } else {
+ var activeAppliedFilters = $scope.appliedFilters.filter(function(item) {
+ return item.showAutoComplete;
+ });
+ if (activeAppliedFilters.length > 0) {
+ var activeOptions = activeAppliedFilters[0].filteredOptions.filter(function(item) {
+ return item.active;
+ });
+ if (activeOptions.length > 0) {
+ $scope.selectOption(null, activeOptions[0], activeAppliedFilters[0]);
+ }
+ }
+ if (activeAppliedFilters.length === 0 || activeOptions.length === 0) {
+ $scope.appliedFilters.filter(function(item) {
+ return !item.currentOption;
+ }).forEach(function(item) {
+ if (item.searchOptionInput !== '') {
+ $scope.selectOption(null, {
+ key: item.searchOptionInput,
+ label: item.searchOptionInput
+ }, item);
+ }
+ });
+ }
+ }
+ }
+
+ function backspaceKeyHandler (event) {
+ if ($(document.activeElement).is('input') && $(document.activeElement)[0].selectionStart === 0) {
+ if ($(document.activeElement).hasClass('main-input') && $scope.appliedFilters.length > 0) {
+ var lastFilter = $scope.appliedFilters[$scope.appliedFilters.length - 1];
+ focusInput(lastFilter);
+ event.stopPropagation();
+ event.preventDefault();
+ } else {
+ var name = $(document.activeElement).attr('name');
+ var activeFilter = $scope.appliedFilters.filter(function(item) {
+ return name === item.id;
+ })[0];
+ if (activeFilter) {
+ $scope.removeFilter(activeFilter);
+ }
+ }
+ }
+ }
+
+ function attachInputWidthSetter(element) {
+ var textPadding = 4;
+ element.on('input', function() {
+ var inputWidth = $(this).textWidth();
+ $(this).css({
+ width: inputWidth + textPadding
+ })
+ }).trigger('input');
+ }
+ }
+ };
+});
+
+$.fn.textWidth = function(text, font) {
+ if (!$.fn.textWidth.fakeEl) $.fn.textWidth.fakeEl = $('<span>').hide().appendTo(document.body);
+ $.fn.textWidth.fakeEl.text(text || this.val() || this.text() || this.attr('placeholder')).css('font', font || this.css('font'));
+ return $.fn.textWidth.fakeEl.width();
+};
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Cluster.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Cluster.js
index 30ef91a..1a99a65 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Cluster.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Cluster.js
@@ -292,8 +292,7 @@ angular.module('ambariAdminConsole')
angular.forEach(hostStatus, function(status) {
totalHosts += status.length;
});
- response.status = currentHosts > 0? 'current' :
- installedHosts > 0? 'installed' : '';
+ response.status = data[0].ClusterStackVersions.state;
response.currentHosts = currentHosts;
response.installedHosts = installedHosts;
response.totalHosts = totalHosts;
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Filters.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Filters.js
new file mode 100644
index 0000000..7c6815f
--- /dev/null
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Filters.js
@@ -0,0 +1,84 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+'use strict';
+
+angular.module('ambariAdminConsole')
+.factory('Filters', function() {
+
+ function initFilterOptions(filters, items) {
+ filters.filter(function(filter) {
+ return !filter.isStatic;
+ }).forEach(function(filter) {
+ var preOptions = [];
+ if (filter.isMultiple) {
+ items.forEach(function(item) {
+ if (typeof filter.customValueConverter === 'function') {
+ preOptions = preOptions.concat(filter.customValueConverter(item));
+ } else {
+ preOptions = preOptions.concat(item[filter.key]);
+ }
+ });
+ } else {
+ preOptions = items.map(function(item) {
+ if (typeof filter.customValueConverter === 'function') {
+ return filter.customValueConverter(item);
+ }
+ return item[filter.key];
+ });
+ }
+ filter.options = $.unique(preOptions).filter(function(item) {
+ return item !== undefined && item !== null;
+ }).map(function(item) {
+ return {
+ key: item,
+ label: item
+ }
+ });
+ });
+ }
+
+ function filterItems(appliedFilters, items, filterDefinitions) {
+ var filteredCount = 0;
+ angular.forEach(items, function(item) {
+ item.isFiltered = !(appliedFilters && appliedFilters.length > 0 && appliedFilters.some(function(filter) {
+ var customValueFilter = filterDefinitions.filter(function(filterDefinition) {
+ return filterDefinition.key === filter.key && typeof filterDefinition.customValueConverter === 'function';
+ })[0];
+ if (customValueFilter) {
+ return filter.values.every(function(value) {
+ var itemValue = customValueFilter.customValueConverter(item);
+ return String(Array.isArray(itemValue) ? itemValue.join() : itemValue).indexOf(value) === -1;
+ });
+ }
+ return filter.values.every(function(value) {
+ var itemValue = item[filter.key];
+ return String(Array.isArray(itemValue) ? itemValue.join() : itemValue).indexOf(value) === -1;
+
+ });
+ }));
+
+ filteredCount += ~~item.isFiltered;
+ });
+ return filteredCount;
+ }
+
+ return {
+ initFilterOptions: initFilterOptions,
+ filterItems: filterItems
+ };
+});
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Group.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Group.js
index 0509e11..dc6d351 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Group.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Group.js
@@ -100,18 +100,11 @@ angular.module('ambariAdminConsole')
return $http.post(Settings.baseUrl + '/groups/' + groupName + '/members/'+memberName);
};
- Group.all = function(params) {
+ Group.all = function() {
var deferred = $q.defer();
- $http.get(Settings.baseUrl + '/groups?'
- + 'Groups/group_name.matches(.*'+params.searchString+'.*)'
- + '&fields=*'
- + '&from='+ (params.currentPage-1)*params.groupsPerPage
- + '&page_size=' + params.groupsPerPage
- + (params.group_type === '*' ? '' : '&Groups/group_type=' + params.group_type)
- )
+ $http.get(Settings.baseUrl + '/groups?fields=*')
.success(function(data) {
- data.items.itemTotal = data.itemTotal;
deferred.resolve(data.items);
})
.error(function(data) {
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Pagination.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Pagination.js
new file mode 100644
index 0000000..ac0a8bc
--- /dev/null
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Pagination.js
@@ -0,0 +1,59 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+'use strict';
+
+angular.module('ambariAdminConsole')
+.factory('Pagination', function() {
+
+ function showItemsOnPage(items, tableInfo) {
+ var startIndex = (this.currentPage - 1) * this.itemsPerPage + 1;
+ var endIndex = this.currentPage * this.itemsPerPage;
+ var showedCount = 0;
+ var filteredCount = 0;
+
+ angular.forEach(items, function (item) {
+ item.isShowed = false;
+ if (item.isFiltered) {
+ filteredCount++;
+ if (filteredCount >= startIndex && filteredCount <= endIndex) {
+ item.isShowed = true;
+ showedCount++;
+ }
+ }
+ });
+ tableInfo.showed = showedCount;
+ }
+
+ return {
+ create: function(options) {
+ options = options || {};
+ return {
+ itemsPerPage: options.itemsPerPage || 10,
+ currentPage: options.currentPage || 1,
+ maxVisiblePages: options.maxVisiblePages || 10,
+ pageChanged: function(items, tableInfo) {
+ showItemsOnPage.call(this, items, tableInfo);
+ },
+ resetPagination: function(items, tableInfo) {
+ this.currentPage = 1;
+ showItemsOnPage.call(this, items, tableInfo);
+ }
+ }
+ }
+ };
+});
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/RemoteCluster.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/RemoteCluster.js
index 49c6abc..86407fd 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/RemoteCluster.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/RemoteCluster.js
@@ -80,16 +80,10 @@ angular.module('ambariAdminConsole')
return deferred.promise;
}
- RemoteCluster.all = function(params) {
+ RemoteCluster.all = function() {
var deferred = $q.defer();
- $http.get(Settings.baseUrl + "/remoteclusters?"
- + 'ClusterInfo/name.matches(.*'+params.searchString+'.*)'
- + '&fields=*'
- + '&from='+ (params.currentPage-1)*params.groupsPerPage
- + '&page_size=' + params.groupsPerPage
- + (params.service === 'Any' ? '' : '&ClusterInfo/services.matches(.*'+params.service+'.*)')
- )
+ $http.get(Settings.baseUrl + "/remoteclusters")
.success(function(response) {
deferred.resolve(response);
})
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js
index f52e687..c86ee29 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js
@@ -92,7 +92,7 @@ angular.module('ambariAdminConsole')
$http.get(Settings.baseUrl + '/services/AMBARI/components/AMBARI_SERVER?fields=RootServiceComponents/properties/gpl.license.accepted&minimal_response=true', {mock: 'true'})
.then(function(data) {
- deferred.resolve(data.data.RootServiceComponents.properties['gpl.license.accepted']);
+ deferred.resolve(data.data.RootServiceComponents.properties && data.data.RootServiceComponents.properties['gpl.license.accepted']);
})
.catch(function(data) {
deferred.reject(data);
@@ -189,28 +189,8 @@ angular.module('ambariAdminConsole')
}
},
- allRepos: function (filter, pagination) {
- var versionFilter = filter.version;
- var nameFilter = filter.name;
- var typeFilter = filter.type;
- var stackFilter = filter.stack && filter.stack.current && filter.stack.current.value;
+ allRepos: function () {
var url = '/stacks?fields=versions/repository_versions/RepositoryVersions';
- if (versionFilter) {
- url += '&versions/repository_versions/RepositoryVersions/repository_version.matches(.*' + versionFilter + '.*)';
- }
- if (nameFilter) {
- url += '&versions/repository_versions/RepositoryVersions/display_name.matches(.*' + nameFilter + '.*)';
- }
- if (typeFilter){
- url += '&versions/repository_versions/RepositoryVersions/type.matches(.*' + typeFilter.toUpperCase() + '.*)';
- }
- if (stackFilter) {
- var stack = filter.stack.current.value.split('-'),
- stackNameFilter = stack[0],
- stackVersionFilter = stack[1];
- url += '&versions/repository_versions/RepositoryVersions/stack_name=' + stackNameFilter;
- url += '&versions/repository_versions/RepositoryVersions/stack_version=' + stackVersionFilter;
- }
var deferred = $q.defer();
$http.get(Settings.baseUrl + url, {mock: 'version/versions.json'})
.success(function (data) {
@@ -230,16 +210,8 @@ angular.module('ambariAdminConsole')
});
// prepare response data with client side pagination
var response = {};
+ response.items = repos;
response.itemTotal = repos.length;
- if (pagination) {
- var from = (pagination.currentPage - 1) * pagination.itemsPerPage;
- var to = (repos.length - from > pagination.itemsPerPage)? from + pagination.itemsPerPage : repos.length;
- response.items = repos.slice(from, to);
- response.showed = to - from;
- } else {
- response.items = repos;
- response.showed = repos.length;
- }
deferred.resolve(response);
})
.error(function (data) {
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/User.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/User.js
index 7932d9b..e44048c 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/User.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/User.js
@@ -33,17 +33,8 @@ angular.module('ambariAdminConsole')
var $t = $translate.instant;
return {
- list: function(params) {
- return $http.get(
- Settings.baseUrl + '/users/?'
- + 'Users/user_name.matches(.*'+params.searchString+'.*)'
- + '&fields=privileges/PrivilegeInfo/*,Users'
- + '&from=' + (params.currentPage-1)*params.usersPerPage
- + '&page_size=' + params.usersPerPage
- + (params.user_type === '*' ? '' : '&Users/user_type=' + params.user_type)
- + (params.active === '*' ? '' : '&Users/active=' + params.active)
- + (params.admin ? '&Users/admin=true' : '')
- );
+ list: function() {
+ return $http.get(Settings.baseUrl + '/users?fields=Users/*,privileges/*');
},
listByName: function(name) {
return $http.get(
@@ -90,6 +81,15 @@ angular.module('ambariAdminConsole')
}
});
},
+ resetLoginFailures: function(userId) {
+ return $http({
+ method: 'PUT',
+ url: Settings.baseUrl + '/users/' + userId,
+ data: {
+ 'Users/consecutive_failures': 0
+ }
+ });
+ },
/**
* Generate user info to display by response data from API.
* Generally this is a single point to manage all required and useful data
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/styles/cluster-information.css b/ambari-admin/src/main/resources/ui/admin-web/app/styles/cluster-information.css
index 64e9ecb..519eeae 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/styles/cluster-information.css
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/styles/cluster-information.css
@@ -52,7 +52,30 @@
padding: 30px;
}
-#cluster-information .fa-cloud {
- font-size: 150px;
- color: #f0f0f0;
+#cluster-information .install-button {
+ height: 40px;
+}
+
+#cluster-information .install-button a {
+ height: 100%;
+ padding: 0;
+ width: 225px;
+ font-size: 16px;
+ line-height: 40px;
+}
+
+@keyframes INSTALL-BOX-ROTATE {
+ 0% {transform: rotate(0deg)}
+ 12.5% {transform: rotate(-30deg)}
+ 37.5% {transform: rotate(30deg)}
+ 62.5% {transform: rotate(-30deg)}
+ 87.5% {transform: rotate(30deg)}
+ 100% {transform: rotate(0deg)}
+}
+
+#cluster-information #install-box {
+ animation: INSTALL-BOX-ROTATE 2s;
+ width: 116px;
+ margin-bottom: 20px;
+ margin-top: 40px;
}
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/styles/combo-search.css b/ambari-admin/src/main/resources/ui/admin-web/app/styles/combo-search.css
new file mode 100644
index 0000000..ee9909c
--- /dev/null
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/styles/combo-search.css
@@ -0,0 +1,164 @@
+/**
+ * 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.
+ */
+
+.combo-search .combo-search-inner {
+ position: relative;
+ border: 1px solid #ccc;
+ border-radius: 4px;
+ box-shadow: 0 0 1px #fff inset;
+ min-height: 34px;
+ line-height: 1em;
+ cursor: text;
+ padding-right: 30px;
+}
+
+.combo-search .combo-search-close {
+ font-size: 13px;
+ color: #999;
+ position: absolute;
+ right: 10px;
+ top: 30%;
+ cursor: pointer;
+}
+.combo-search .combo-search-close:hover {
+ color: #333;
+}
+.combo-search .combo-search-input {
+ background: transparent;
+ display: inline-block;
+ min-width: 4px;
+ width: 4px;
+ line-height: 10px;
+ height: 100%;
+ border: none;
+ outline: none;
+ margin-left: 1px;
+}
+
+.combo-search .combo-search-input-wrapper {
+ display: inline-block;
+ position: relative;
+ height: 32px;
+ margin-left: 5px;
+}
+
+.combo-search .combo-search-content {
+ display: inline-block;
+}
+
+.combo-search .combo-search-dropdown {
+ position: absolute;
+ border: 1px solid #ccc;
+ border-radius: 4px;
+ background-color: #fff;
+ cursor: pointer;
+ z-index: 10;
+ padding: 0;
+ margin: 0;
+ width: auto;
+ min-width: 80px;
+ max-width: 220px;
+ max-height: 240px;
+ overflow-y: auto;
+ overflow-x: hidden;
+ font-size: 13px;
+ top: 30px;
+ left: 5px;
+ box-shadow: 3px 4px 5px -2px rgba(0, 0, 0, 0.5);
+}
+
+.combo-search .combo-search-dropdown ul {
+ max-height: 250px;
+ list-style: none;
+ padding: 0;
+ margin: 0;
+}
+
+.combo-search .filter a {
+ display: block;
+ width: auto;
+ text-decoration: none;
+ color: initial;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ background: none;
+ border: none;
+ padding: 3px 10px 5px 5px;
+}
+
+.combo-search .category a {
+ display: block;
+ width: auto;
+ text-decoration: none;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ padding: 3px 10px 5px 5px;
+ text-transform: capitalize;
+ font-size: 11px;
+ font-weight: bold;
+ color: white;
+ cursor: default;
+ border-bottom: 1px solid #A2A2A2;
+ background-color: #B7B7B7;
+ text-shadow: 0 -1px 0 #999;
+}
+
+.combo-search .filter a.active {
+ background-color: #ddd;
+}
+
+.combo-search .combo-search-applied-filter {
+ position: relative;
+ display: inline-block;
+ padding: 0 3px 0 18px;
+ background-color: #dddddd;
+ border-radius: 4px;
+ margin: 4px 0 0 4px;
+ vertical-align: top;
+ border: 1px solid #d2d2d2;
+}
+
+.combo-search .combo-search-applied-filter i {
+ position: absolute;
+ left: 5px;
+ font-size: 12px;
+ top: 5px;
+ color: #999;
+ cursor: pointer;
+}
+
+.combo-search .combo-search-applied-filter i:hover {
+ color: #333;
+}
+
+.combo-search .combo-search-applied-filter span,
+.combo-search .combo-search-applied-filter input {
+ color: #666;
+ font-size: 11px;
+}
+
+.combo-search .combo-search-applied-filter span {
+ font-weight: bold;
+}
+
+.combo-search .combo-search-applied-filter .combo-search-input-wrapper {
+ height: 22px;
+ margin-left: 0;
+}
\ No newline at end of file
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css b/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
index b4aa558..b93ea7f 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
@@ -18,6 +18,15 @@
+/**
+ * When this css rule is loaded by the browser, all html elements (including their children)
+ * that are tagged with the ngCloak directive are hidden. When AngularJS encounters this directive
+ * during the compilation of the template it deletes the ngCloak element attribute, making the compiled element visible.
+ */
+[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
+ display: none !important;
+}
+
/*
------ START editable-list DIRECTIVE SECTION ------ -
*/
@@ -1331,3 +1340,39 @@ th.entity-actions {
.entity-actions a:focus:hover {
text-decoration: none;
}
+
+.search-box-button {
+ position: relative;
+ margin-right: 5px;
+}
+
+.search-box-button .btn {
+ padding: 10px;
+}
+
+.search-box-row {
+ padding-top: 15px;
+ padding-bottom: 5px;
+}
+
+.popup-arrow-up {
+ background: inherit;
+ z-index: 1;
+ left: 6px;
+ position: absolute;
+ width: 24px;
+ height: 16px;
+ overflow: hidden;
+}
+
+.popup-arrow-up:after {
+ content: "";
+ position: absolute;
+ width: 20px;
+ height: 20px;
+ background: #fff;
+ transform: rotate(45deg);
+ top: 10px;
+ left: 2px;
+ box-shadow: -2px -2px 10px -3px rgba(0, 0, 0, 0.5);
+}
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/styles/user-management.css b/ambari-admin/src/main/resources/ui/admin-web/app/styles/user-management.css
index 3c9756e..bca53ca 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/styles/user-management.css
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/styles/user-management.css
@@ -20,6 +20,10 @@
vertical-align: baseline;
}
+#user-management .search-box-row {
+ margin-top: -1px;
+}
+
#user-management .nav.nav-tabs {
margin-bottom: 0;
}
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/edit.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/edit.html
index a86e285..7f2f8a3 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/edit.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/edit.html
@@ -26,8 +26,8 @@
</li>
</ol>
<div class="pull-right top-margin-4" ng-switch="instance.ViewInstanceInfo.static">
- <button ng-switch-when="true" class="btn disabled btn-default btn-delete-instance" tooltip="{{'views.alerts.cannotDeleteStaticInstance' | translate}}">{{'common.delete' | translate: '{term: instanceType}'}}</button>
- <button ng-switch-when="false" class="btn btn-danger" ng-click="deleteInstance(instance)">{{'common.delete' | translate: '{term: constants.instance}'}}</button>
+ <button ng-switch-when="true" class="btn disabled btn-default btn-delete-instance" tooltip="{{'views.alerts.cannotDeleteStaticInstance' | translate}}">{{'common.delete' | translate:{term: instanceType} }}</button>
+ <button ng-switch-when="false" class="btn btn-danger" ng-click="deleteInstance(instance)">{{'common.delete' | translate:{term: constants.instance} }}</button>
</div>
</div>
<hr>
@@ -241,7 +241,7 @@
</fieldset>
</form>
<div ng-show="isConfigurationEmpty && !clusterConfigurable">
- <div class="alert alert-info">{{'views.alerts.notDefined' | translate: '{term: constants.props}'}}</div>
+ <div class="alert alert-info">{{'views.alerts.notDefined' | translate:{term: constants.props} }}</div>
</div>
</div>
</div>
@@ -296,7 +296,7 @@
<span translate="views.clusterPermissions.nonLocalClusterMessage"></span>
</div>
<div ng-show="isPermissionsEmpty">
- <div class="alert alert-info">{{'views.alerts.notDefined' | translate: '{term: constants.perms}'}}</div>
+ <div class="alert alert-info">{{'views.alerts.notDefined' | translate:{term: constants.perms} }}</div>
</div>
</div>
</div>
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/viewsList.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/viewsList.html
index 04901f1..48f445b 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/viewsList.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/viewsList.html
@@ -24,11 +24,21 @@
{{'views.create' | translate}}
</button>
</div>
+ <div class="search-box-button pull-right">
+ <button class="btn btn-default" ng-click="toggleSearchBox()">
+ <i class="fa fa-filter" aria-hidden="true"></i>
+ </button>
+ <div class="popup-arrow-up hide"></div>
+ </div>
+ </div>
+
+ <div class="search-box-row hide">
+ <combo-search suggestions="filters" filter-change="filterInstances" placeholder="Search"></combo-search>
</div>
<table class="table table-striped table-hover">
<thead>
- <tr class="fix-bottom">
+ <tr>
<th class="col-md-2">
<span>{{'common.name' | translate}}</span>
</th>
@@ -45,39 +55,6 @@
<span>{{'common.actions' | translate}}</span>
</th>
</tr>
- <tr class="fix-top">
- <th>
- <div class="search-container">
- <input type="text" class="form-control" placeholder="{{'common.any' | translate}}"
- ng-model="instanceNameFilter" ng-change="filterInstances()">
- <button type="button" class="close clearfilter" ng-show="instanceNameFilter"
- ng-click="instanceNameFilter=''; filterInstances()">
- <span aria-hidden="true">×</span>
- <span class="sr-only">{{'common.controls.close' | translate}}</span>
- </button>
- </div>
- </th>
- <th>
- <div class="search-container">
- <input type="text" class="form-control" placeholder="{{'common.any' | translate}}"
- ng-model="instanceUrlFilter" ng-change="filterInstances()">
- <button type="button" class="close clearfilter" ng-show="instanceUrlFilter"
- ng-click="instanceUrlFilter=''; filterInstances()">
- <span aria-hidden="true">×</span>
- <span class="sr-only">{{'common.controls.close' | translate}}</span>
- </button>
- </div>
- </th>
- <th>
- <select class="form-control typefilter v-small-input"
- ng-model="instanceTypeFilter"
- ng-options="item.label for item in typeFilterOptions"
- ng-change="filterInstances()">
- </select>
- </th>
- <th></th>
- <th></th>
- </tr>
</thead>
<tbody>
@@ -137,14 +114,13 @@
</div>
<div class="col-sm-12 table-bar" ng-show="instances.length >= minInstanceForPagination">
<div class="pull-left filtered-info">
- <span>{{'common.filterInfo' | translate: '{showed: tableInfo.showed, total: tableInfo.filtered, term: urs.urls}'}}</span>
- <span ng-show="isNotEmptyFilter">- <a href ng-click="clearFilters()">{{'common.controls.clearFilters' | translate}}</a></span>
+ <span>{{'common.filterInfo' | translate:{showed: tableInfo.showed, total: tableInfo.filtered, term: urs.urls} }}</span>
</div>
<div class="pull-right left-margin">
- <pagination class="paginator" total-items="tableInfo.filtered" max-size="maxVisiblePages" items-per-page="instancesPerPage" ng-model="currentPage" ng-change="pageChanged()"></pagination>
+ <pagination class="paginator" total-items="tableInfo.filtered" max-size="pagination.maxVisiblePages" items-per-page="pagination.itemsPerPage" ng-model="pagination.currentPage" ng-change="pageChanged()"></pagination>
</div>
<div class="pull-right">
- <select class="form-control" ng-model="instancesPerPage" ng-change="resetPagination()" ng-options="currOption for currOption in [10, 25, 50, 100]"></select>
+ <select class="form-control" ng-model="pagination.itemsPerPage" ng-change="resetPagination()" ng-options="currOption for currOption in [10, 25, 50, 100]"></select>
</div>
</div>
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/clusters/clusterInformation.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/clusters/clusterInformation.html
index ead73c3..9747add 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/clusters/clusterInformation.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/clusters/clusterInformation.html
@@ -20,17 +20,17 @@
<div ng-show="cluster.Clusters.provisioning_state !== 'INSTALLED'">
<div class="welcome-header">
<h1>{{'main.title' | translate}}</h1>
- <span>{{'main.noClusterDescription' | translate}}</span>
+ <span class="help-block">{{'main.noClusterDescription' | translate}}</span>
</div>
<div class="create-cluster-section">
<h2>{{'main.createCluster.title' | translate}}</h2>
<div>
- <span>
+ <span class="help-block">
{{'main.createCluster.description' | translate}}
</span>
</div>
- <div><i class="fa fa-cloud" aria-hidden="true"></i></div>
- <div>
+ <div><img id="install-box" src="/img/install-box.svg"></div>
+ <div class="install-button">
<a href="{{fromSiteRoot('/#/installer/step0')}}" class="btn btn-primary">
{{'main.createCluster.launchInstallWizard' | translate}}
</a>
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/directives/comboSearch.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/directives/comboSearch.html
new file mode 100644
index 0000000..a4fdfc2
--- /dev/null
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/directives/comboSearch.html
@@ -0,0 +1,63 @@
+<!--
+* 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.
+-->
+
+<div class="combo-search">
+ <div class="combo-search-inner" ng-click="observeSearchFilterInput($event)">
+ <div class="combo-search-applied-filter" ng-repeat="filter in appliedFilters" ng-click="forceFocus($event, filter)">
+ <i class="fa fa-times-circle" ng-click="removeFilter(filter)"></i>
+ <span>{{filter.label}}:</span>
+ <div class="combo-search-input-wrapper">
+ <input type="text"
+ autocomplete="off"
+ ng-attr-name="{{filter.id}}"
+ class="combo-search-input"
+ ng-model="filter.searchOptionInput"
+ ng-change="observeSearchOptionInput(filter)"
+ ng-blur="hideAutocomplete(filter)"/>
+ <div class="combo-search-dropdown" ng-show="filter.showAutoComplete">
+ <ul>
+ <li ng-repeat="item in filter.filteredOptions" class="filter">
+ <a ng-click="selectOption($event, item, filter)"
+ ng-class="{active: item.active}"
+ ng-mouseover="makeActive(item, filter.filteredOptions)">{{item.label}}</a>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ <div class="combo-search-input-wrapper">
+ <input type="text"
+ autocomplete="off"
+ placeholder="{{appliedFilters.length === 0 ? placeholder : ''}}"
+ class="combo-search-input main-input"
+ ng-model="searchFilterInput"
+ ng-change="observeSearchFilterInput()"/>
+ <div class="combo-search-dropdown" ng-show="showAutoComplete">
+ <ul>
+ <li ng-repeat="item in filterSuggestions"
+ ng-class="{category: item.isCategory, filter: !item.isCategory, hide: (item.isCategory && item.isDefault)}">
+ <a ng-click="selectFilter(item, $event)"
+ ng-class="{active: item.active}"
+ ng-mouseover="makeActive(item, filterSuggestions)">{{item.label}}</a>
+ </li>
+ </ul>
+ </div>
+ </div>
+ <i class="combo-search-close fa fa-times-circle" ng-show="appliedFilters.length" ng-click="clearFilters()"></i>
+ </div>
+</div>
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/directives/editableList.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/directives/editableList.html
index 5f482ef..7b4413f 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/directives/editableList.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/directives/editableList.html
@@ -27,7 +27,7 @@
</ul>
</div>
</li>
- <li class="item add-item" ng-show="!editMode && !items.length">{{'common.add' | translate: '{term: resourceType}'}}</li>
+ <li class="item add-item" ng-show="!editMode && !items.length">{{'common.add' | translate:{term: resourceType} }}</li>
</ul>
</div>
<div class="actions-panel" ng-show="editMode">
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/modals/AddRepositoryModal.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/modals/AddRepositoryModal.html
index 5639a3f..4434d28 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/modals/AddRepositoryModal.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/modals/AddRepositoryModal.html
@@ -21,7 +21,7 @@
<form class="form-horizontal" name="addRepoForm" novalidate>
<div class="modal-body">
<div class="alert alert-warning hide-soft" ng-class="{'visible' : showAlert}" role="alert">
- {{'versions.alerts.repositoryExists' | translate: '{os: repo.selectedOS}'}}
+ {{'versions.alerts.repositoryExists' | translate:{os: repo.selectedOS} }}
</div>
<div class="form-group">
<div class="col-sm-3">
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/modals/RoleDetailsModal.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/modals/RoleDetailsModal.html
index 942a733..61bd2d0 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/modals/RoleDetailsModal.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/modals/RoleDetailsModal.html
@@ -36,7 +36,7 @@
<div ng-repeat="level in orderedLevels">
<div class="table-row-wrapper table-section-title">
<div class="table-row">
- <div class="table-cell" colspan="{{roles.length + 1}}">{{'users.roles.permissionLevel' | translate: '{level: getLevelName(level)}'}}</div>
+ <div class="table-cell" colspan="{{roles.length + 1}}">{{'users.roles.permissionLevel' | translate:{level: getLevelName(level)} }}</div>
</div>
</div>
<div class="table-row-wrapper">
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/remoteClusters/list.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/remoteClusters/list.html
index 59d8acb..5f8a0be 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/remoteClusters/list.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/remoteClusters/list.html
@@ -23,30 +23,34 @@
{{'views.registerRemoteCluster' | translate}}
</a>
</div>
+ <div class="search-box-button pull-right">
+ <button class="btn btn-default" ng-click="toggleSearchBox()">
+ <i class="fa fa-filter" aria-hidden="true"></i>
+ </button>
+ <div class="popup-arrow-up hide"></div>
+ </div>
+ </div>
+
+ <div class="search-box-row hide">
+ <combo-search suggestions="filters" filter-change="filterClusters" placeholder="Search"></combo-search>
</div>
+
<table class="table table-striped table-hover">
<thead>
<tr>
<th class="col-sm-3">
<div class="search-container">
- <label for="">{{'views.clusterName' | translate}}</label>
- <input type="text" class="form-control namefilter" placeholder="{{'common.any' | translate}}" ng-model="currentNameFilter" ng-change="resetPagination()">
- <button type="button" class="close" ng-show="currentNameFilter" ng-click="currentNameFilter=''; resetPagination()"><span aria-hidden="true">×</span><span class="sr-only">{{'common.controls.close' | translate}}</span></button>
+ <label>{{'views.clusterName' | translate}}</label>
</div>
</th>
<th class="col-sm-9">
- <label for="">{{'common.services' | translate}}</label>
- <select class="form-control typefilter"
- ng-model="currentTypeFilter"
- ng-options="item for item in typeFilterOptions"
- ng-change="resetPagination();">
- </select>
+ <label>{{'common.services' | translate}}</label>
</th>
</tr>
</thead>
<tbody>
- <tr ng-repeat="remoteCluster in remoteClusters" >
- <td class="col-sm-3"><a href="#/remoteClusters/{{remoteCluster.ClusterInfo.name}}/edit">{{ remoteCluster.ClusterInfo.name }}</a></td>
+ <tr ng-repeat="remoteCluster in remoteClusters | filter : { isShowed: true }">
+ <td class="col-sm-3"><a href="#/remoteClusters/{{remoteCluster.ClusterInfo.name}}/edit">{{ remoteCluster.clusterName }}</a></td>
<td class="col-sm-9">
<span ng-repeat="service in remoteCluster.ClusterInfo.services" ng-if="remoteCluster.ClusterInfo.services.length > 0">{{ service }}{{$last ? '' : ','}} </span>
<span ng-if="remoteCluster.ClusterInfo.services.length == 0">--</span>
@@ -58,19 +62,18 @@
<div ng-if="isLoading" class="spinner-container">
<i class="fa fa-2x fa-spinner fa-spin" aria-hidden="true"></i>
</div>
- <div class="alert empty-table-alert col-sm-12" ng-show="!remoteClusters.length && !isLoading">
+ <div class="alert empty-table-alert col-sm-12" ng-show="!tableInfo.showed && !isLoading">
{{'common.alerts.noRemoteClusterDisplay' | translate}}
</div>
- <div class="col-sm-12 table-bar">
+ <div class="col-sm-12 table-bar" ng-show="tableInfo.total >= minInstanceForPagination">
<div class="pull-left filtered-info">
- <span>{{'common.filterInfo' | translate: '{showed: tableInfo.showed, total: tableInfo.total, term: constants.groups}'}}</span>
- <span ng-show="isNotEmptyFilter">- <a href ng-click="clearFilters()">{{'common.controls.clearFilters' | translate}}</a></span>
+ <span>{{'common.filterInfo' | translate:{showed: tableInfo.showed, total: tableInfo.total, term: constants.groups} }}</span>
</div>
<div class="pull-right left-margin">
- <pagination class="paginator" total-items="totalGroups" max-size="maxVisiblePages" items-per-page="groupsPerPage" ng-model="currentPage" ng-change="pageChanged()"></pagination>
+ <pagination class="paginator" total-items="tableInfo.filtered" max-size="pagination.maxVisiblePages" items-per-page="groupsPerPage" ng-model="pagination.currentPage" ng-change="pageChanged()"></pagination>
</div>
<div class="pull-right">
- <select class="form-control" ng-model="groupsPerPage" ng-change="groupsPerPageChanges()" ng-options="currOption for currOption in [10, 25, 50, 100]"></select>
+ <select class="form-control" ng-model="pagination.itemsPerPage" ng-change="resetPagination()" ng-options="currOption for currOption in [10, 25, 50, 100]"></select>
</div>
</div>
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/list.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/list.html
index cf5c516..697b3b2 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/list.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/list.html
@@ -23,47 +23,42 @@
{{'versions.register.title' | translate}}
</a>
</div>
+ <div class="search-box-button pull-right">
+ <button class="btn btn-default" ng-click="toggleSearchBox()">
+ <i class="fa fa-filter" aria-hidden="true"></i>
+ </button>
+ <div class="popup-arrow-up hide"></div>
+ </div>
+ </div>
+
+ <div class="search-box-row hide">
+ <combo-search suggestions="filters" filter-change="filterRepos" placeholder="Search"></combo-search>
</div>
+
<table class="table table-striped table-hover">
<thead>
<tr>
<th class="col-small">
<label>{{'common.stack' | translate}}</label>
- <select class="form-control"
- ng-change="resetPagination()"
- ng-model="filter.stack.current"
- ng-options="item.label for item in filter.stack.options track by item.value"
- ></select>
</th>
<th class="col-medium text-search-container">
<label>{{'common.name' | translate}}</label>
- <input type="text" class="form-control" ng-change="resetPagination()" ng-model="filter.name" placeholder="{{'common.any' | translate}}">
- <button type="button" class="close clearfilter" ng-show="filter.name" ng-click="filter.name=''; resetPagination()"><span aria-hidden="true">×</span><span class="sr-only">{{'common.controls.close' | translate}}</span></button>
</th>
<th class="col-medium text-search-container">
<label>{{'common.type' | translate}}</label>
- <input type="text" class="form-control" ng-change="resetPagination()" ng-model="filter.type" placeholder="{{'common.any' | translate}}">
- <button type="button" class="close clearfilter" ng-show="filter.type" ng-click="filter.type=''; resetPagination()"><span aria-hidden="true">×</span><span class="sr-only">{{'common.controls.close' | translate}}</span></button>
</th>
<th class="col-medium text-search-container">
<label>{{'common.version' | translate}}</label>
- <input type="text" class="form-control" ng-change="resetPagination()" ng-model="filter.version" placeholder="{{'common.any' | translate}}">
- <button type="button" class="close clearfilter" ng-show="filter.version" ng-click="filter.version=''; resetPagination()"><span aria-hidden="true">×</span><span class="sr-only">{{'common.controls.close' | translate}}</span></button>
</th>
<th class="col-small">
<label>{{'common.cluster' | translate}}</label>
- <select class="form-control"
- ng-change="resetPagination()"
- ng-model="filter.cluster.current"
- ng-options="item.label for item in filter.cluster.options track by item.value"
- ></select>
</th>
<th class="col-small"></th>
<th class="col-small text-center vertical-top">{{'common.hidden' | translate}}</th>
</tr>
</thead>
<tbody>
- <tr ng-repeat="repo in repos">
+ <tr ng-repeat="repo in repos | filter : { isShowed: true }">
<td class="col-small">
<span>{{repo.stack_name}}-{{repo.stack_version}}</span>
</td>
@@ -120,17 +115,16 @@
<div ng-if="isLoading" class="spinner-container">
<i class="fa fa-2x fa-spinner fa-spin" aria-hidden="true"></i>
</div>
- <div class="alert empty-table-alert col-sm-12" ng-show="!repos.length && !isLoading">
- {{'common.alerts.nothingToDisplay' | translate: '{term: getConstant("common.version")}'}}
+ <div class="alert empty-table-alert col-sm-12" ng-show="!tableInfo.showed && !isLoading">
+ {{'common.alerts.nothingToDisplay' | translate:{term: getConstant("common.version")} }}
</div>
- <div class="col-sm-12 table-bar">
+ <div class="col-sm-12 table-bar" ng-show="tableInfo.total >= minInstanceForPagination">
<div class="pull-left filtered-info">
- <span>{{'common.filterInfo' | translate: '{showed: tableInfo.showed, total: tableInfo.total, term: getConstant("common.versions")}'}}</span>
- <span ng-show="isNotEmptyFilter">- <a href ng-click="clearFilters()">{{'common.controls.clearFilters' | translate}}</a></span>
+ <span>{{'common.filterInfo' | translate:{showed: tableInfo.showed, total: tableInfo.total, term: getConstant("common.versions")} }}</span>
</div>
<div class="pull-right left-margin">
<pagination class="paginator"
- total-items="pagination.totalRepos"
+ total-items="tableInfo.total"
max-size="pagination.maxVisiblePages"
items-per-page="pagination.itemsPerPage"
ng-model="pagination.currentPage"
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html
index da1ab3f..0f06f7c 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html
@@ -96,10 +96,10 @@
<span class="dot">.</span>
<div class="form-group" ng-class="{'has-error' : versionRegForm.version.$error.pattern}">
<input class="form-control" name="version" type="text" ng-model="activeStackVersion.editableDisplayName" ng-pattern="activeStackVersion.subVersionPattern"
- placeholder="{{'versions.placeholder' | translate: '{pattern: activeStackVersion.pattern}'}}" ng-change="updateCurrentVersionInput()" required/>
+ placeholder="{{'versions.placeholder' | translate:{pattern: activeStackVersion.pattern} }}" ng-change="updateCurrentVersionInput()" required/>
</div>
<div class="text-danger" ng-show="versionRegForm.version.$error.pattern">
-  {{'common.alerts.isInvalid' | translate: '{term: activeStackVersion.displayName}'}}
+  {{'common.alerts.isInvalid' | translate:{term: activeStackVersion.displayName} }}
</div>
</div>
</div>
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/groupEdit.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/groupEdit.html
index 5656417..4688eb5 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/groupEdit.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/groupEdit.html
@@ -27,11 +27,11 @@
<button
ng-switch-when="true"
class="btn disabled deletegroup-btn"
- tooltip="{{'common.cannotDelete' | translate: '{term: constants.group}'}}">
- {{'common.delete' | translate: '{term: constants.group}'}}
+ tooltip="{{'common.cannotDelete' | translate:{term: constants.group} }}">
+ {{'common.delete' | translate:{term: constants.group} }}
</button>
<button ng-switch-when="false" class="btn btn-danger deletegroup-btn" ng-click="deleteGroup(group)">
- {{'common.delete' | translate: '{term: constants.group}'}}
+ {{'common.delete' | translate:{term: constants.group} }}
</button>
</div>
</div>
@@ -50,7 +50,7 @@
<editable-list items-source="group.editingUsers" resource-type="User" editable="group.group_type == 'LOCAL'"></editable-list>
</div>
</div>
- <div class="form-group">
+ <div class="form-group" ng-show="cluster">
<label for="role" class="col-sm-2 roles-label">
{{'groups.role' | translate}}
<i class="fa fa-question-circle" aria-hidden="true" ng-click="showHelpPage()"></i>
@@ -86,7 +86,7 @@
</td>
</tr>
<tr>
- <td ng-show="noClusterPriv">{{'common.alerts.noPrivileges' | translate: '{term: constants.cluster}'}}</td>
+ <td ng-show="noClusterPriv">{{'common.alerts.noPrivileges' | translate:{term: constants.cluster} }}</td>
</tr>
</tbody>
<thead class="view-permission-header">
@@ -109,12 +109,12 @@
</td>
</tr>
<tr>
- <td ng-show="noViewPriv">{{'common.alerts.noPrivileges' | translate: '{term: constants.view}'}}</td>
+ <td ng-show="noViewPriv">{{'common.alerts.noPrivileges' | translate:{term: constants.view} }}</td>
</tr>
</tbody>
</table>
<div class="alert alert-info" ng-show="hidePrivileges">
- {{'common.alerts.noPrivilegesDescription' | translate: '{term: constants.group.toLowerCase()}'}}
+ {{'common.alerts.noPrivilegesDescription' | translate:{term: constants.group.toLowerCase()} }}
</div>
</div>
</div>
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/groupsList.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/groupsList.html
index d79d14e..4218a65 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/groupsList.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/groupsList.html
@@ -16,11 +16,24 @@
* limitations under the License.
-->
<div class="groups-pane">
- <div class="clearfix panel">
- <button class="btn btn-default creategroup-btn pull-right" ng-click="createGroup()">
- {{'groups.createLocal' | translate}}
- </button>
+ <div class="clearfix">
+ <div class="pull-right">
+ <button class="btn btn-default creategroup-btn pull-right" ng-click="createGroup()">
+ {{'groups.createLocal' | translate}}
+ </button>
+ </div>
+ <div class="search-box-button pull-right">
+ <button class="btn btn-default" ng-click="toggleSearchBox()">
+ <i class="fa fa-filter" aria-hidden="true"></i>
+ </button>
+ <div class="popup-arrow-up hide"></div>
+ </div>
</div>
+
+ <div class="search-box-row hide">
+ <combo-search suggestions="filters" filter-change="filterGroups" placeholder="Search"></combo-search>
+ </div>
+
<table class="table table-striped table-hover col-sm-12">
<thead>
<tr>
@@ -37,31 +50,14 @@
<span>{{'common.actions' | translate}}</span>
</th>
</tr>
- <tr>
- <th class="col-sm-6">
- <div class="search-container">
- <input type="text" class="form-control namefilter" placeholder="{{'common.any' | translate}}" ng-model="filter.name" ng-change="resetPagination()">
- <button type="button" class="close" ng-show="filter.name" ng-click="filter.name=''; resetPagination()"><span aria-hidden="true">×</span><span class="sr-only">{{'common.controls.close' | translate}}</span></button>
- </div>
- </th>
- <th class="col-sm-2">
- <select class="form-control typefilter"
- ng-model="filter.type"
- ng-options="item.label for item in typeFilterOptions"
- ng-change="resetPagination();">
- </select>
- </th>
- <th class="col-sm-2"></th>
- <th class="col-sm-2"></th>
- </tr>
</thead>
<tbody>
- <tr ng-repeat="group in groups">
+ <tr ng-repeat="group in groups | filter : { isShowed: true }">
<td class="col-sm-8">
<span>{{group.group_name}}</span>
</td>
<td class="col-sm-2">{{group.groupTypeName | translate}}</td>
- <td class="col-sm-2">{{'groups.membersPlural' | translate: '{n: group.members && group.members.length || 0}'}}</td>
+ <td class="col-sm-2">{{'groups.membersPlural' | translate:{n: group.members && group.members.length || 0} }}</td>
<td class="entity-actions">
<link-to route="userManagement.editGroup" class="link-to-group" id="{{group.group_name}}">
<i class="fa fa-pencil"></i>
@@ -76,19 +72,18 @@
<div ng-if="isLoading" class="spinner-container">
<i class="fa fa-2x fa-spinner fa-spin" aria-hidden="true"></i>
</div>
- <div class="alert empty-table-alert col-sm-12" ng-show="!groups.length && !isLoading">
- {{'common.alerts.nothingToDisplay' | translate: '{term: constants.groups}'}}
+ <div class="alert empty-table-alert col-sm-12" ng-show="!tableInfo.showed && !isLoading">
+ {{'common.alerts.nothingToDisplay' | translate:{term: constants.groups} }}
</div>
- <div class="col-sm-12 table-bar" ng-show="totalGroups > minRowsToShowPagination">
+ <div class="col-sm-12 table-bar" ng-show="tableInfo.total > minRowsToShowPagination">
<div class="pull-left filtered-info">
- <span>{{'common.filterInfo' | translate: '{showed: tableInfo.showed, total: tableInfo.total, term: constants.groups}'}}</span>
- <span ng-show="isNotEmptyFilter">- <a href ng-click="clearFilters()">{{'common.controls.clearFilters' | translate}}</a></span>
+ <span>{{'common.filterInfo' | translate:{showed: tableInfo.showed, total: tableInfo.filtered, term: constants.groups} }}</span>
</div>
<div class="pull-right left-margin">
- <pagination class="paginator" total-items="totalGroups" max-size="maxVisiblePages" items-per-page="groupsPerPage" ng-model="currentPage" ng-change="pageChanged()"></pagination>
+ <pagination class="paginator" total-items="tableInfo.filtered" max-size="pagination.maxVisiblePages" items-per-page="pagination.itemsPerPage" ng-model="pagination.currentPage" ng-change="pageChanged()"></pagination>
</div>
<div class="pull-right">
- <select class="form-control" ng-model="groupsPerPage" ng-change="groupsPerPageChanges()" ng-options="currOption for currOption in [10, 25, 50, 100]"></select>
+ <select class="form-control" ng-model="pagination.itemsPerPage" ng-change="resetPagination()" ng-options="currOption for currOption in [10, 25, 50, 100]"></select>
</div>
</div>
</div>
\ No newline at end of file
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/modals/changePassword.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/modals/changePassword.html
index f29d315..2f52f08 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/modals/changePassword.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/modals/changePassword.html
@@ -16,7 +16,7 @@
* limitations under the License.
-->
<div class="modal-header">
- <h3 class="modal-title">{{'users.changePasswordFor' | translate: '{userName: userName}'}}</h3>
+ <h3 class="modal-title">{{'users.changePasswordFor' | translate:{userName: userName} }}</h3>
</div>
<div class="modal-body">
<form class="form-horizontal" novalidate name="form.passwordChangeForm" role="form" >
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/modals/groupCreate.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/modals/groupCreate.html
index 7692a68..8ea1b37 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/modals/groupCreate.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/modals/groupCreate.html
@@ -58,7 +58,7 @@
</div>
</div>
- <div class="row">
+ <div class="row" ng-show="cluster">
<div class="form-group col-sm-6"
ng-class="{ 'has-error': form.groupCreateForm.role.$error.required && form.groupCreateForm.submitted }">
<label for="role" class="nowrap roles-label">
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/modals/userCreate.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/modals/userCreate.html
index b1b5876..2e5bba6 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/modals/userCreate.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/modals/userCreate.html
@@ -38,6 +38,7 @@
tooltip="{{'users.userNameTip' | translate}}"
autocomplete="off"
tooltip-trigger="focus"
+ tooltip-placement="top"
class="form-control"
ng-model="formData.userName"
name="userName"
@@ -98,7 +99,7 @@
</div>
</div>
- <div class="row">
+ <div class="row" ng-show="cluster">
<div class="form-group col-sm-6"
ng-class="{ 'has-error': form.userCreateForm.role.$error.required && form.userCreateForm.submitted }">
<label for="role" class="nowrap roles-label">
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/userEdit.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/userEdit.html
index 8a96663..80e2196 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/userEdit.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/userEdit.html
@@ -24,8 +24,8 @@
</ol>
<div class="pull-right">
<div ng-switch="isCurrentUser || user.user_type != 'LOCAL'">
- <button class="btn deleteuser-btn disabled btn-default" ng-switch-when="true" tooltip="{{'common.cannotDelete' | translate: '{term: constants.user}'}}">{{'common.delete' | translate: '{term: constants.user}'}}</button>
- <button class="btn deleteuser-btn btn-danger" ng-switch-when="false" ng-click="deleteUser()">{{'common.delete' | translate: '{term: constants.user}'}}</button>
+ <button class="btn deleteuser-btn disabled btn-default" ng-switch-when="true" tooltip="{{'common.cannotDelete' | translate:{term: constants.user} }}">{{'common.delete' | translate:{term: constants.user} }}</button>
+ <button class="btn deleteuser-btn btn-danger" ng-switch-when="false" ng-click="deleteUser()">{{'common.delete' | translate:{term: constants.user} }}</button>
</div>
</div>
</div>
@@ -40,7 +40,7 @@
<div class="form-group">
<label class="col-sm-2 switch-inline-label">{{'users.status' | translate}}</label>
<div class="col-sm-10">
- <toggle-switch on-change="toggleUserActive()" disabled-tooltip="{{'users.alerts.cannotChange' | translate: '{term: constants.status}'}}" ng-disabled="isCurrentUser" model="user.active" class="switch-success userstatus {{user ? '' : 'no-animation'}}" data-off-color="danger"></toggle-switch>
+ <toggle-switch on-change="toggleUserActive()" disabled-tooltip="{{'users.alerts.cannotChange' | translate:{term: constants.status} }}" ng-disabled="isCurrentUser" model="user.active" class="switch-success userstatus {{user ? '' : 'no-animation'}}" data-off-color="danger"></toggle-switch>
<span ng-if="user.active" class="switch-option-label">{{'users.active' | translate}}</span>
<span ng-if="!user.active" class="switch-option-label">{{'users.inactive' | translate}}</span>
</div>
@@ -48,7 +48,7 @@
<div class="form-group">
<label class="col-sm-2 switch-inline-label"><span class="glyphicon glyphicon-flash"></span> {{'users.ambariAdmin' | translate}}</label>
<div class="col-sm-10">
- <toggle-switch on-change="toggleUserAdmin()" disabled-tooltip="{{'users.alerts.cannotChange' | translate: '{term: constants.admin}'}}" ng-disabled="isCurrentUser" model="user.admin" class="switch-success userstatus {{user ? '' : 'no-animation'}}" data-off-color="danger"></toggle-switch>
+ <toggle-switch on-change="toggleUserAdmin()" disabled-tooltip="{{'users.alerts.cannotChange' | translate:{term: constants.admin} }}" ng-disabled="isCurrentUser" model="user.admin" class="switch-success userstatus {{user ? '' : 'no-animation'}}" data-off-color="danger"></toggle-switch>
<span ng-if="user.admin" class="switch-option-label">{{'common.yes' | translate}}</span>
<span ng-if="!user.admin" class="switch-option-label">{{'common.no' | translate}}</span>
</div>
@@ -57,7 +57,7 @@
<label class="col-sm-2 ">{{'users.password' | translate}}</label>
<div class="col-sm-10">
<div ng-switch="user.user_type != 'LOCAL'">
- <button class="btn deleteuser-btn disabled btn-default" ng-switch-when="true" tooltip="{{'users.alerts.cannotChange' | translate: '{term: constants.password}'}}">{{'users.changePassword' | translate}}</button>
+ <button class="btn deleteuser-btn disabled btn-default" ng-switch-when="true" tooltip="{{'users.alerts.cannotChange' | translate:{term: constants.password} }}">{{'users.changePassword' | translate}}</button>
<a href ng-click="openChangePwdDialog()" ng-switch-when="false" class="btn btn-default changepassword">{{'users.changePassword' | translate}}</a>
</div>
@@ -70,7 +70,7 @@
</div>
</div>
- <div class="form-group">
+ <div class="form-group" ng-show="cluster">
<label for="role" class="col-sm-2 roles-label">
{{'users.role' | translate}}
<i class="fa fa-question-circle" aria-hidden="true" ng-click="showHelpPage()"></i>
@@ -109,7 +109,7 @@
</td>
</tr>
<tr>
- <td ng-show="noClusterPriv">{{'common.alerts.noPrivileges' | translate: '{term: constants.cluster}'}}</td>
+ <td ng-show="noClusterPriv">{{'common.alerts.noPrivileges' | translate:{term: constants.cluster} }}</td>
</tr>
</tbody>
<thead class="view-permission-header">
@@ -132,11 +132,11 @@
</td>
</tr>
<tr>
- <td ng-show="noViewPriv">{{'common.alerts.noPrivileges' | translate: '{term: constants.view}'}}</td>
+ <td ng-show="noViewPriv">{{'common.alerts.noPrivileges' | translate:{term: constants.view} }}</td>
</tr>
</tbody>
</table>
- <div class="alert alert-info" ng-show="hidePrivileges && !user.admin">{{'common.alerts.noPrivilegesDescription' | translate: '{term: constants.user}'}}</div>
+ <div class="alert alert-info" ng-show="hidePrivileges && !user.admin">{{'common.alerts.noPrivilegesDescription' | translate:{term: constants.user} }}</div>
<div class="alert alert-info" ng-show="user.admin">{{'users.userIsAdmin' | translate}}</div>
</div>
</div>
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/usersList.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/usersList.html
index 4a33a31..2348dad 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/usersList.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/usersList.html
@@ -17,14 +17,27 @@
-->
<div class="users-pane">
- <div class="clearfix panel">
- <button class="btn btn-default createuser-btn pull-right" ng-click="createUser();">
- {{'users.create' | translate}}
- </button>
+ <div class="clearfix">
+ <div class="pull-right">
+ <button class="btn btn-default createuser-btn pull-right" ng-click="createUser();">
+ {{'users.create' | translate}}
+ </button>
+ </div>
+ <div class="search-box-button pull-right">
+ <button class="btn btn-default" ng-click="toggleSearchBox()">
+ <i class="fa fa-filter" aria-hidden="true"></i>
+ </button>
+ <div class="popup-arrow-up hide"></div>
+ </div>
</div>
+
+ <div class="search-box-row hide">
+ <combo-search suggestions="filters" filter-change="filterUsers" placeholder="Search"></combo-search>
+ </div>
+
<table class="table table-striped table-hover">
<thead>
- <tr class="fix-bottom">
+ <tr>
<th>
<span>{{'users.username' | translate}}</span>
</th>
@@ -44,36 +57,9 @@
<span>{{'common.actions' | translate}}</span>
</th>
</tr>
- <tr class="fix-top">
- <th>
- <div class="search-container">
- <input type="text" class="form-control namefilter" placeholder="{{'common.any' | translate}}" ng-model="filters.name" ng-change="resetPagination()">
- <button type="button" class="close clearfilter" ng-show="filters.name" ng-click="filters.name=''; resetPagination()">
- <span aria-hidden="true">×</span><span class="sr-only">{{'common.controls.close' | translate}}</span>
- </button>
- </div>
- </th>
- <th></th>
- <th>
- <select class="form-control statusfilter"
- ng-model="filters.status"
- ng-options="item.label for item in activeFilterOptions"
- ng-change="resetPagination()">
- </select>
- </th>
- <th>
- <select class="form-control typefilter"
- ng-model="filters.type"
- ng-options="item.label for item in typeFilterOptions"
- ng-change="resetPagination()">
- </select>
- </th>
- <th></th>
- <th></th>
- </tr>
</thead>
<tbody>
- <tr ng-repeat="user in users">
+ <tr ng-repeat="user in users | filter : { isShowed: true }">
<td>
<span>{{user.Users.user_name}}</span>
</td>
@@ -101,19 +87,18 @@
<div ng-if="isLoading" class="spinner-container">
<i class="fa fa-2x fa-spinner fa-spin" aria-hidden="true"></i>
</div>
- <div class="alert empty-table-alert col-sm-12" ng-show="!users.length && !isLoading">
- {{'common.alerts.nothingToDisplay' | translate: '{term: constants.users}'}}
+ <div class="alert empty-table-alert col-sm-12" ng-show="!tableInfo.showed && !isLoading">
+ {{'common.alerts.nothingToDisplay' | translate:{term: constants.users} }}
</div>
- <div class="col-sm-12 table-bar" ng-show="totalUsers > minRowsToShowPagination">
+ <div class="col-sm-12 table-bar" ng-show="users.length > minRowsToShowPagination">
<div class="pull-left filtered-info">
- <span>{{'common.filterInfo' | translate: '{showed: tableInfo.showed, total: tableInfo.total, term: constants.users}'}}</span>
- <span ng-show="isNotEmptyFilter">- <a href ng-click="clearFilters()">{{'common.controls.clearFilters' | translate}}</a></span>
+ <span>{{'common.filterInfo' | translate:{showed: tableInfo.showed, total: tableInfo.total, term: constants.users} }}</span>
</div>
<div class="pull-right left-margin">
- <pagination class="paginator" total-items="totalUsers" max-size="maxVisiblePages" items-per-page="usersPerPage" ng-model="currentPage" ng-change="pageChanged()"></pagination>
+ <pagination class="paginator" total-items="tableInfo.filtered" max-size="pagination.maxVisiblePages" items-per-page="pagination.itemsPerPage" ng-model="pagination.currentPage" ng-change="pageChanged()"></pagination>
</div>
<div class="pull-right">
- <select class="form-control" ng-model="usersPerPage" ng-change="usersPerPageChanges()" ng-options="currOption for currOption in [10, 25, 50, 100]"></select>
+ <select class="form-control" ng-model="pagination.itemsPerPage" ng-change="resetPagination()" ng-options="currOption for currOption in [10, 25, 50, 100]"></select>
</div>
</div>
</div>
diff --git a/ambari-admin/src/main/resources/ui/admin-web/package.json b/ambari-admin/src/main/resources/ui/admin-web/package.json
index f718a0a..0d721d4 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/package.json
+++ b/ambari-admin/src/main/resources/ui/admin-web/package.json
@@ -24,7 +24,7 @@
"karma-jasmine": "0.1.5",
"karma-ng-html2js-preprocessor": "^0.1.0",
"karma-phantomjs-launcher": "0.1",
- "phantomjs": "1.9.20",
+ "phantomjs": "^2.1.7",
"protractor": "1.0.0"
},
"scripts": {
diff --git a/ambari-admin/src/main/resources/ui/admin-web/test/unit/controllers/ambariViews/ViewsListCtrl_test.js b/ambari-admin/src/main/resources/ui/admin-web/test/unit/controllers/ambariViews/ViewsListCtrl_test.js
new file mode 100644
index 0000000..ca8205c
--- /dev/null
+++ b/ambari-admin/src/main/resources/ui/admin-web/test/unit/controllers/ambariViews/ViewsListCtrl_test.js
@@ -0,0 +1,111 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+describe('#Cluster', function () {
+ describe('ViewsListCtrl', function() {
+ var scope, ctrl;
+
+ beforeEach(function () {
+ module('ambariAdminConsole');
+ inject(function($rootScope, $controller) {
+ scope = $rootScope.$new();
+ scope.pagination = {
+ resetPagination: angular.noop
+ };
+ ctrl = $controller('ViewsListCtrl', {$scope: scope});
+ });
+ scope.instances = [
+ {
+ short_url_name: 'sun1',
+ url: 'url1',
+ view_name: 'vn1',
+ instance_name: 'in1',
+ short_url: 'su1'
+ },
+ {
+ short_url_name: 'sun2',
+ url: 'url2',
+ view_name: 'vn2',
+ instance_name: 'in2',
+ short_url: 'su2'
+ }
+ ];
+ });
+
+ describe('#filterInstances', function() {
+ beforeEach(function() {
+ spyOn(scope.pagination, 'resetPagination');
+ });
+
+ it('all should be filtered when filters not applied', function() {
+ scope.filterInstances();
+ expect(scope.tableInfo.filtered).toEqual(2);
+ scope.filterInstances([]);
+ expect(scope.tableInfo.filtered).toEqual(2);
+ });
+
+ it('resetPagination should be called', function() {
+ scope.filterInstances();
+ expect(scope.pagination.resetPagination).toHaveBeenCalled();
+ });
+
+ it('one view should be filtered', function() {
+ var appliedFilters = [
+ {
+ key: 'view_name',
+ values: ['vn1']
+ }
+ ];
+ scope.filterInstances(appliedFilters);
+ expect(scope.tableInfo.filtered).toEqual(1);
+ expect(scope.instances[0].isFiltered).toBeTruthy();
+ expect(scope.instances[1].isFiltered).toBeFalsy();
+ });
+
+ it('two views should be filtered', function() {
+ var appliedFilters = [
+ {
+ key: 'view_name',
+ values: ['vn1', 'vn2']
+ }
+ ];
+ scope.filterInstances(appliedFilters);
+ expect(scope.tableInfo.filtered).toEqual(2);
+ expect(scope.instances[0].isFiltered).toBeTruthy();
+ expect(scope.instances[1].isFiltered).toBeTruthy();
+ });
+
+ it('one views should be filtered with combo filter', function() {
+ var appliedFilters = [
+ {
+ key: 'view_name',
+ values: ['vn1', 'vn2']
+ },
+ {
+ key: 'instance_name',
+ values: ['in2']
+ }
+ ];
+ scope.filterInstances(appliedFilters);
+ expect(scope.tableInfo.filtered).toEqual(1);
+ expect(scope.instances[0].isFiltered).toBeFalsy();
+ expect(scope.instances[1].isFiltered).toBeTruthy();
+ });
+ });
+ });
+});
diff --git a/ambari-admin/src/main/resources/ui/admin-web/test/unit/controllers/userManagement/GroupsListCtrl_test.js b/ambari-admin/src/main/resources/ui/admin-web/test/unit/controllers/userManagement/GroupsListCtrl_test.js
index 8d04757..1e76aec 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/test/unit/controllers/userManagement/GroupsListCtrl_test.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/test/unit/controllers/userManagement/GroupsListCtrl_test.js
@@ -20,110 +20,20 @@ describe('#Cluster', function () {
describe('GroupsListCtrl', function() {
- var scope, ctrl, $t, $httpBackend;
+ var $scope, ctrl, $t, $httpBackend, $group;
beforeEach(module('ambariAdminConsole', function () {}));
- beforeEach(inject(function($rootScope, $controller, _$translate_, _$httpBackend_) {
- scope = $rootScope.$new();
+ beforeEach(inject(function($rootScope, $controller, _$translate_, _$httpBackend_, _Group_) {
+ $scope = $rootScope.$new();
$t = _$translate_.instant;
$httpBackend = _$httpBackend_;
+ $group = _Group_;
ctrl = $controller('GroupsListCtrl', {
- $scope: scope
+ $scope: $scope
});
}));
- describe('#clearFilters()', function () {
-
- it('should clear filters and reset pagination', function () {
- scope.currentPage = 2;
- scope.filter.name = 'a';
- scope.filter.type = {
- label: $t('common.local'),
- value: false
- };
- scope.clearFilters();
- expect(scope.filter.name).toEqual('');
- expect(scope.filter.type).toEqual({
- label: $t('common.all'),
- value: '*'
- });
- expect(scope.currentPage).toEqual(1);
- });
-
- });
-
- describe('#isNotEmptyFilter', function () {
-
- var cases = [
- {
- currentNameFilter: '',
- currentTypeFilter: null,
- isNotEmptyFilter: false,
- title: 'no filters'
- },
- {
- currentNameFilter: '',
- currentTypeFilter: {
- value: '*'
- },
- isNotEmptyFilter: false,
- title: 'empty filters'
- },
- {
- currentNameFilter: 'a',
- currentTypeFilter: {
- value: '*'
- },
- isNotEmptyFilter: true,
- title: 'name filter'
- },
- {
- currentNameFilter: '0',
- currentTypeFilter: {
- value: '*'
- },
- isNotEmptyFilter: true,
- title: 'name filter with "0" as string'
- },
- {
- currentNameFilter: '',
- currentTypeFilter: {
- value: false
- },
- isNotEmptyFilter: true,
- title: 'type filter'
- },
- {
- currentNameFilter: 'a',
- currentTypeFilter: {
- value: false
- },
- isNotEmptyFilter: true,
- title: 'both filters'
- },
- {
- currentNameFilter: '0',
- currentTypeFilter: {
- value: false
- },
- isNotEmptyFilter: true,
- title: 'both filters with "0" as string'
- }
- ];
-
- cases.forEach(function (item) {
- it(item.title, function () {
- $httpBackend.expectGET(/\/api\/v1\/groups/).respond(200);
- scope.filter.name = item.currentNameFilter;
- scope.filter.type = item.currentTypeFilter;
- scope.$digest();
- expect(scope.isNotEmptyFilter).toEqual(item.isNotEmptyFilter);
- });
- });
-
- });
-
});
});
diff --git a/ambari-admin/src/main/resources/ui/admin-web/test/unit/controllers/userManagement/UsersListCtrl_test.js b/ambari-admin/src/main/resources/ui/admin-web/test/unit/controllers/userManagement/UsersListCtrl_test.js
index fcafa59..db91b56 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/test/unit/controllers/userManagement/UsersListCtrl_test.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/test/unit/controllers/userManagement/UsersListCtrl_test.js
@@ -33,312 +33,6 @@ describe('#Cluster', function () {
});
}));
- describe('#clearFilters()', function () {
-
- it('should clear filters and reset pagination', function () {
- scope.currentPage = 2;
- scope.filters.name = 'a';
- scope.filters.status = {
- label: $t('common.local'),
- value: false
- };
- scope.filters.type = {
- label: $t('common.local'),
- value: 'LOCAL'
- };
- scope.clearFilters();
- expect(scope.filters.name).toEqual('');
- expect(scope.filters.status).toEqual({
- label: $t('common.all'),
- value: '*'
- });
- expect(scope.filters.type).toEqual({
- label: $t('common.all'),
- value: '*'
- });
- expect(scope.currentPage).toEqual(1);
- });
-
- });
-
- describe('#isNotEmptyFilter', function () {
-
- var cases = [
- {
- currentNameFilter: '',
- currentTypeFilter: null,
- currentActiveFilter: null,
- isNotEmptyFilter: false,
- title: 'no filters'
- },
- {
- currentNameFilter: '',
- currentTypeFilter: {
- value: '*'
- },
- currentActiveFilter: {
- value: '*'
- },
- isNotEmptyFilter: false,
- title: 'empty filters'
- },
- {
- currentNameFilter: 'a',
- currentTypeFilter: {
- value: '*'
- },
- currentActiveFilter: {
- value: '*'
- },
- isNotEmptyFilter: true,
- title: 'name filter'
- },
- {
- currentNameFilter: '0',
- currentTypeFilter: {
- value: '*'
- },
- currentActiveFilter: {
- value: '*'
- },
- isNotEmptyFilter: true,
- title: 'name filter with "0" as string'
- },
- {
- currentNameFilter: '',
- currentTypeFilter: {
- value: 'LOCAL'
- },
- currentActiveFilter: {
- value: '*'
- },
- isNotEmptyFilter: true,
- title: 'type filter'
- },
- {
- currentNameFilter: '',
- currentTypeFilter: {
- value: '*'
- },
- currentActiveFilter: {
- value: false
- },
- isNotEmptyFilter: true,
- title: 'activity filter'
- },
- {
- currentNameFilter: 'a',
- currentTypeFilter: {
- value: 'LOCAL'
- },
- currentActiveFilter: {
- value: '*'
- },
- isNotEmptyFilter: true,
- title: 'name and type filters'
- },
- {
- currentNameFilter: 'a',
- currentTypeFilter: {
- value: '*'
- },
- currentActiveFilter: {
- value: false
- },
- isNotEmptyFilter: true,
- title: 'name and activity filters'
- },
- {
- currentNameFilter: 'a',
- currentTypeFilter: {
- value: '*'
- },
- currentActiveFilter: {
- value: '*'
- },
- isNotEmptyFilter: true,
- title: 'name and admin filters'
- },
- {
- currentNameFilter: '0',
- currentTypeFilter: {
- value: 'LOCAL'
- },
- currentActiveFilter: {
- value: '*'
- },
- isNotEmptyFilter: true,
- title: 'name and type filters with "0" as string'
- },
- {
- currentNameFilter: '0',
- currentTypeFilter: {
- value: '*'
- },
- currentActiveFilter: {
- value: false
- },
- isNotEmptyFilter: true,
- title: 'name and activity filters with "0" as string'
- },
- {
- currentNameFilter: '0',
- currentTypeFilter: {
- value: '*'
- },
- currentActiveFilter: {
- value: '*'
- },
- isNotEmptyFilter: true,
- title: 'name and admin filters with "0" as string'
- },
- {
- currentNameFilter: '',
- currentTypeFilter: {
- value: 'LOCAL'
- },
- currentActiveFilter: {
- value: false
- },
- isNotEmptyFilter: true,
- title: 'type and activity filters'
- },
- {
- currentNameFilter: '',
- currentTypeFilter: {
- value: 'LOCAL'
- },
- currentActiveFilter: {
- value: '*'
- },
- isNotEmptyFilter: true,
- title: 'type and admin filters'
- },
- {
- currentNameFilter: '',
- currentTypeFilter: {
- value: '*'
- },
- currentActiveFilter: {
- value: false
- },
- isNotEmptyFilter: true,
- title: 'activity and admin filters'
- },
- {
- currentNameFilter: '',
- currentTypeFilter: {
- value: 'LOCAL'
- },
- currentActiveFilter: {
- value: false
- },
- isNotEmptyFilter: true,
- title: 'all filters except name one'
- },
- {
- currentNameFilter: 'a',
- currentTypeFilter: {
- value: '*'
- },
- currentActiveFilter: {
- value: false
- },
- isNotEmptyFilter: true,
- title: 'all filters except type one'
- },
- {
- currentNameFilter: 'a',
- currentTypeFilter: {
- value: 'LOCAL'
- },
- currentActiveFilter: {
- value: '*'
- },
- isNotEmptyFilter: true,
- title: 'all filters except activity one'
- },
- {
- currentNameFilter: 'a',
- currentTypeFilter: {
- value: 'LOCAL'
- },
- currentActiveFilter: {
- value: false
- },
- isNotEmptyFilter: true,
- title: 'all filters except admin one'
- },
- {
- currentNameFilter: '0',
- currentTypeFilter: {
- value: '*'
- },
- currentActiveFilter: {
- value: false
- },
- isNotEmptyFilter: true,
- title: 'all filters with "0" as string except type one'
- },
- {
- currentNameFilter: '0',
- currentTypeFilter: {
- value: 'LOCAL'
- },
- currentActiveFilter: {
- value: '*'
- },
- isNotEmptyFilter: true,
- title: 'all filters with "0" as string except activity one'
- },
- {
- currentNameFilter: '0',
- currentTypeFilter: {
- value: 'LOCAL'
- },
- currentActiveFilter: {
- value: false
- },
- isNotEmptyFilter: true,
- title: 'all filters with "0" as string except admin one'
- },
- {
- currentNameFilter: 'a',
- currentTypeFilter: {
- value: false
- },
- currentActiveFilter: {
- value: 'LOCAL'
- },
- isNotEmptyFilter: true,
- title: 'all filters'
- },
- {
- currentNameFilter: '0',
- currentTypeFilter: {
- value: false
- },
- currentActiveFilter: {
- value: 'LOCAL'
- },
- isNotEmptyFilter: true,
- title: 'all filters with "0" as string'
- }
- ];
-
- cases.forEach(function (item) {
- it(item.title, function () {
- $httpBackend.expectGET(/\/api\/v1\/users/).respond(200);
- scope.filters.name = item.currentNameFilter;
- scope.filters.status = item.currentActiveFilter;
- scope.filters.type = item.currentTypeFilter;
- scope.$digest();
- expect(scope.isNotEmptyFilter).toEqual(item.isNotEmptyFilter);
- });
- });
-
- });
-
});
});
diff --git a/ambari-admin/src/main/resources/ui/admin-web/test/unit/directives/comboSearch_test.js b/ambari-admin/src/main/resources/ui/admin-web/test/unit/directives/comboSearch_test.js
new file mode 100644
index 0000000..59b74be
--- /dev/null
+++ b/ambari-admin/src/main/resources/ui/admin-web/test/unit/directives/comboSearch_test.js
@@ -0,0 +1,362 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+describe('#comboSearch', function () {
+ var scope, element;
+
+ beforeEach(module('ambariAdminConsole'));
+ beforeEach(module('views/directives/comboSearch.html'));
+
+ beforeEach(inject(function($rootScope, $compile) {
+ scope = $rootScope.$new();
+
+ var preCompiledElement = '<combo-search suggestions="filters" filter-change="filterItems" placeholder="Search"></combo-search>';
+
+ scope.filters = [
+ {
+ key: 'f1',
+ label: 'filter1',
+ options: []
+ },
+ {
+ key: 'f2',
+ label: 'filter2',
+ options: []
+ }
+ ];
+ scope.filterItems = angular.noop;
+ spyOn(scope, 'filterItems');
+
+
+ element = $compile(preCompiledElement)(scope);
+ scope.$digest();
+ }));
+
+ afterEach(function() {
+ element.remove();
+ });
+
+
+ describe('#removeFilter', function() {
+ it('should remove filter by id', function () {
+ var isoScope = element.isolateScope();
+ isoScope.appliedFilters.push({
+ id: 1
+ });
+ spyOn(isoScope, 'observeSearchFilterInput');
+ spyOn(isoScope, 'updateFilters');
+
+ isoScope.removeFilter({id: 1});
+
+ expect(isoScope.appliedFilters).toEqual([]);
+ expect(isoScope.observeSearchFilterInput).toHaveBeenCalled();
+ expect(isoScope.updateFilters).toHaveBeenCalledWith([]);
+ });
+ });
+
+ describe('#clearFilters', function() {
+ it('should empty appliedFilters', function () {
+ var isoScope = element.isolateScope();
+ isoScope.appliedFilters.push({
+ id: 1
+ });
+ spyOn(isoScope, 'updateFilters');
+
+ isoScope.clearFilters();
+
+ expect(isoScope.appliedFilters).toEqual([]);
+ expect(isoScope.updateFilters).toHaveBeenCalledWith([]);
+ });
+ });
+
+ describe('#selectFilter', function() {
+ it('should add new filter to appliedFilters', function () {
+ var isoScope = element.isolateScope();
+
+ isoScope.selectFilter({
+ key: 'f1',
+ label: 'filter1',
+ options: []
+ });
+
+ expect(isoScope.appliedFilters[0]).toEqual({
+ id: 'filter_1',
+ currentOption: null,
+ filteredOptions: [],
+ searchOptionInput: '',
+ key: 'f1',
+ label: 'filter1',
+ options: [],
+ showAutoComplete: false
+ });
+ expect(isoScope.isEditing).toBeFalsy();
+ expect(isoScope.showAutoComplete).toBeFalsy();
+ expect(isoScope.searchFilterInput).toEqual('');
+ });
+ });
+
+ describe('#selectOption', function() {
+ it('should set value to appliedFilter', function () {
+ var isoScope = element.isolateScope();
+ var filter = {};
+
+ spyOn(isoScope, 'observeSearchFilterInput');
+ spyOn(isoScope, 'updateFilters');
+
+ isoScope.selectOption(null, {
+ key: 'o1',
+ label: 'option1'
+ }, filter);
+
+ expect(filter.currentOption).toEqual({
+ key: 'o1',
+ label: 'option1'
+ });
+ expect(filter.showAutoComplete).toBeFalsy();
+ expect(isoScope.observeSearchFilterInput).toHaveBeenCalled();
+ expect(isoScope.updateFilters).toHaveBeenCalled();
+ });
+ });
+
+ describe('#makeActive', function() {
+ it('category option can not be active', function () {
+ var isoScope = element.isolateScope();
+ var active = {
+ key: 'o1',
+ isCategory: true,
+ active: false
+ };
+
+ isoScope.makeActive(active, [active]);
+
+ expect(active.active).toBeFalsy();
+ });
+
+ it('value option can be active', function () {
+ var isoScope = element.isolateScope();
+ var active = {
+ key: 'o1',
+ isCategory: false,
+ active: false
+ };
+
+ isoScope.makeActive(active, [active]);
+
+ expect(active.active).toBeTruthy();
+ });
+ });
+
+ describe('#updateFilters', function() {
+ it('filter function from parent scope should be called', function () {
+ var isoScope = element.isolateScope();
+ spyOn(isoScope, 'extractFilters').andReturn([{}]);
+
+ isoScope.updateFilters([{}]);
+
+ expect(scope.filterItems).toHaveBeenCalledWith([{}]);
+ });
+ });
+
+ describe('#extractFilters', function() {
+ it('should extract filters', function () {
+ var isoScope = element.isolateScope();
+ var filters = [
+ {
+ currentOption: { key: 'o1'},
+ key: 'f1'
+ },
+ {
+ currentOption: { key: 'o2'},
+ key: 'f1'
+ },
+ {
+ currentOption: null,
+ key: 'f2'
+ }
+ ];
+
+ expect(isoScope.extractFilters(filters)).toEqual([
+ {
+ key: 'f1',
+ values: ['o1', 'o2']
+ }
+ ]);
+ });
+ });
+
+ describe('#observeSearchFilterInput', function() {
+ it('should show all filters when search filter empty', function () {
+ var isoScope = element.isolateScope();
+ isoScope.searchFilterInput = '';
+
+ isoScope.observeSearchFilterInput();
+
+ expect(isoScope.showAutoComplete).toBeTruthy();
+ expect(isoScope.filterSuggestions).toEqual([
+ {
+ key: 'f1',
+ label: 'filter1',
+ options: [ ],
+ active: true
+ },
+ {
+ key: 'f2',
+ label: 'filter2',
+ options: [ ],
+ active: false
+ }
+ ]);
+ });
+
+ it('should show only searched filter when search filter not empty', function () {
+ var isoScope = element.isolateScope();
+ isoScope.searchFilterInput = 'filter1';
+
+ isoScope.observeSearchFilterInput();
+
+ expect(isoScope.showAutoComplete).toBeTruthy();
+ expect(isoScope.filterSuggestions).toEqual([
+ {
+ key: 'f1',
+ label: 'filter1',
+ options: [ ],
+ active: true
+ }
+ ]);
+ });
+
+ it('should show no filter when search filter not found', function () {
+ var isoScope = element.isolateScope();
+ isoScope.searchFilterInput = 'unknown-filter';
+
+ isoScope.observeSearchFilterInput();
+
+ expect(isoScope.showAutoComplete).toBeFalsy();
+ expect(isoScope.filterSuggestions).toEqual([]);
+ });
+ });
+
+ describe('#observeSearchOptionInput', function() {
+ it('should show all options when options search empty', function () {
+ var isoScope = element.isolateScope();
+ var filter = {
+ key: 'p1',
+ searchOptionInput: '',
+ currentOption: null,
+ options: [
+ {
+ key: 'op1',
+ label: 'op1'
+ },
+ {
+ key: 'op2',
+ label: 'op2'
+ }
+ ]
+ };
+ isoScope.appliedFilters = [
+ {
+ key: 'p5',
+ currentOption: {
+ key: 'op5'
+ }
+ }
+ ];
+
+ isoScope.observeSearchOptionInput(filter);
+
+ expect(filter.showAutoComplete).toBeTruthy();
+ expect(filter.filteredOptions).toEqual([
+ {
+ key: 'op1',
+ label: 'op1',
+ active: false
+ },
+ {
+ key: 'op2',
+ label: 'op2',
+ active: false
+ }
+ ]);
+ });
+
+ it('should show only filtered options when options search not empty', function () {
+ var isoScope = element.isolateScope();
+ var filter = {
+ key: 'p1',
+ currentOption: null,
+ searchOptionInput: 'op1',
+ options: [
+ {
+ key: 'op1',
+ label: 'op1'
+ },
+ {
+ key: 'op2',
+ label: 'op2'
+ }
+ ]
+ };
+ isoScope.appliedFilters = [
+ {
+ key: 'p5',
+ currentOption: {
+ key: 'op5'
+ }
+ }
+ ];
+
+ isoScope.observeSearchOptionInput(filter);
+
+ expect(filter.showAutoComplete).toBeTruthy();
+ expect(filter.filteredOptions).toEqual([
+ {
+ key: 'op1',
+ label: 'op1',
+ active: false
+ }
+ ]);
+ });
+
+ it('should show no options when options search not found', function () {
+ var isoScope = element.isolateScope();
+ var filter = {
+ key: 'p1',
+ currentOption: null,
+ searchOptionInput: 'op3',
+ options: [
+ {
+ key: 'op1',
+ label: 'op1'
+ },
+ {
+ key: 'op2',
+ label: 'op2'
+ }
+ ]
+ };
+ isoScope.appliedFilters = [];
+
+ isoScope.observeSearchOptionInput(filter);
+
+ expect(filter.showAutoComplete).toBeFalsy();
+ expect(filter.filteredOptions).toEqual([]);
+ });
+ });
+
+});
diff --git a/ambari-admin/src/main/resources/ui/admin-web/test/unit/services/Filters_test.js b/ambari-admin/src/main/resources/ui/admin-web/test/unit/services/Filters_test.js
new file mode 100644
index 0000000..a8b2924
--- /dev/null
+++ b/ambari-admin/src/main/resources/ui/admin-web/test/unit/services/Filters_test.js
@@ -0,0 +1,161 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+describe('Filters Service', function () {
+ var Filters;
+
+ beforeEach(function () {
+ module('ambariAdminConsole', angular.noop);
+ inject(function (_Filters_) {
+ Filters = _Filters_;
+ });
+ });
+ describe('#initFilterOptions', function() {
+ var items = [
+ {
+ k1: {
+ values: ['val1', 'val3']
+ },
+ k2: 'val2'
+ }
+ ];
+ var filters = [
+ {
+ isMultiple: true,
+ key: 'k1',
+ options: [],
+ customValueConverter: function(item) {
+ return item.k1.values;
+ }
+ },
+ {
+ key: 'k2',
+ options: []
+ },
+ {
+ isStatic: true,
+ options: [
+ {
+ key: 'static1',
+ label: 'static1'
+ }
+ ]
+ }
+ ];
+ beforeEach(function() {
+ Filters.initFilterOptions(filters, items);
+ });
+
+ it('should set static options of filters', function() {
+ expect(filters[2].options).toEqual([{
+ key: 'static1',
+ label: 'static1'
+ }]);
+ });
+
+ it('should set options of filters', function() {
+ expect(filters[1].options).toEqual([{
+ key: 'val2',
+ label: 'val2'
+ }]);
+ });
+
+ it('should set multiple options of filters', function() {
+ expect(filters[0].options).toEqual([
+ {
+ key: 'val1',
+ label: 'val1'
+ },
+ {
+ key: 'val3',
+ label: 'val3'
+ }
+ ]);
+ });
+ });
+
+ describe('#filterItems', function() {
+
+ it('all items should be filtered when no filters applied', function() {
+ var items = [{}];
+
+ expect(Filters.filterItems(null, items, [])).toEqual(1);
+ expect(items[0].isFiltered).toBeTruthy();
+ });
+
+ it('items should be filtered when simple filter applied', function() {
+ var appliedFilters = [
+ {
+ key: 'p1',
+ values: ['val1']
+ }
+ ];
+ var items = [
+ { p1: 'val1' },
+ { p1: 'val2' }
+ ];
+ var filterDefinitions = [];
+
+ expect(Filters.filterItems(appliedFilters, items, filterDefinitions)).toEqual(1);
+ expect(items[0].isFiltered).toBeTruthy();
+ expect(items[1].isFiltered).toBeFalsy();
+ });
+
+ it('items should be filtered when filter applied on array values', function() {
+ var appliedFilters = [
+ {
+ key: 'p1',
+ values: ['a']
+ }
+ ];
+ var items = [
+ { p1: ['a', 'b'] },
+ { p1: ['c', 'b'] }
+ ];
+ var filterDefinitions = [];
+
+ expect(Filters.filterItems(appliedFilters, items, filterDefinitions)).toEqual(1);
+ expect(items[0].isFiltered).toBeTruthy();
+ expect(items[1].isFiltered).toBeFalsy();
+ });
+
+ it('items should be filtered when custom filter applied', function() {
+ var appliedFilters = [
+ {
+ key: 'p1',
+ values: ['a']
+ }
+ ];
+ var items = [
+ { p1: { customValue: 'a' } },
+ { p1: { customValue: 'b' } }
+ ];
+ var filterDefinitions = [{
+ key: 'p1',
+ customValueConverter: function(item) {
+ return item.p1.customValue;
+ }
+ }];
+
+ expect(Filters.filterItems(appliedFilters, items, filterDefinitions)).toEqual(1);
+ expect(items[0].isFiltered).toBeTruthy();
+ expect(items[1].isFiltered).toBeFalsy();
+ });
+ });
+
+});
diff --git a/ambari-admin/src/main/resources/ui/admin-web/test/unit/services/Pagination_test.js b/ambari-admin/src/main/resources/ui/admin-web/test/unit/services/Pagination_test.js
new file mode 100644
index 0000000..ce6cb52
--- /dev/null
+++ b/ambari-admin/src/main/resources/ui/admin-web/test/unit/services/Pagination_test.js
@@ -0,0 +1,72 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+describe('Pagination Service', function () {
+ var Pagination, $pagination;
+
+ beforeEach(function () {
+ module('ambariAdminConsole', angular.noop);
+ inject(function (_Pagination_) {
+ Pagination = _Pagination_;
+ $pagination = Pagination.create({
+ itemsPerPage: 1
+ });
+ });
+ });
+
+ describe('#pageChanged', function() {
+
+ it('should show items on second page', function() {
+ var items = [
+ { isFiltered: true },
+ { isFiltered: true },
+ { isFiltered: true }
+ ];
+ var tableInfo = {
+ showed: 0
+ };
+ $pagination.currentPage = 2;
+ $pagination.pageChanged(items, tableInfo);
+ expect(items[0].isShowed).toBeFalsy();
+ expect(items[1].isShowed).toBeTruthy();
+ expect(items[2].isShowed).toBeFalsy();
+ expect(tableInfo.showed).toEqual(1);
+ });
+ });
+
+ describe('#resetPagination', function() {
+
+ it('should show items on first page', function() {
+ var items = [
+ { isFiltered: true },
+ { isFiltered: true },
+ { isFiltered: true }
+ ];
+ var tableInfo = {
+ showed: 0
+ };
+ $pagination.currentPage = 2;
+ $pagination.resetPagination(items, tableInfo);
+ expect(items[0].isShowed).toBeTruthy();
+ expect(items[1].isShowed).toBeFalsy();
+ expect(items[2].isShowed).toBeFalsy();
+ expect(tableInfo.showed).toEqual(1);
+ });
+ });
+
+});
diff --git a/ambari-agent/conf/unix/ambari-agent b/ambari-agent/conf/unix/ambari-agent
index f010800..8168002 100755
--- a/ambari-agent/conf/unix/ambari-agent
+++ b/ambari-agent/conf/unix/ambari-agent
@@ -62,7 +62,7 @@ export PATH=/usr/sbin:/sbin:/usr/lib/ambari-server/*:$PATH
export AMBARI_CONF_DIR=$HOME_DIR/etc/ambari-server/conf:$PATH
# Because Ambari rpm unpacks modules here on all systems
-export PYTHONPATH=/usr/lib/python2.6/site-packages:${PYTHONPATH:-}
+export PYTHONPATH=/usr/lib/ambari-agent/lib:${PYTHONPATH:-}
export AMBARI_PID_DIR=`get_agent_property piddir`
export AMBARI_PID_DIR=`valid_path "${AMBARI_PID_DIR:?}"`
@@ -79,11 +79,11 @@ PYTHON_WRAP=/usr/bin/ambari-python-wrap
PIDFILE=$AMBARI_PID_DIR/$AMBARI_AGENT.pid
OUTFILE=$AMBARI_AGENT_LOG_DIR/ambari-agent.out
LOGFILE=$AMBARI_AGENT_LOG_DIR/ambari-agent.log
-AGENT_SCRIPT=/usr/lib/python2.6/site-packages/ambari_agent/main.py
+AGENT_SCRIPT=/usr/lib/ambari-agent/lib/ambari_agent/main.py
AGENT_TMP_DIR=/var/lib/ambari-agent/tmp
AGENT_WORKING_DIR=/var/lib/ambari-agent
-AMBARI_AGENT_PY_SCRIPT=/usr/lib/python2.6/site-packages/ambari_agent/AmbariAgent.py
-COMMON_DIR=/usr/lib/python2.6/site-packages/ambari_commons
+AMBARI_AGENT_PY_SCRIPT=/usr/lib/ambari-agent/lib/ambari_agent/AmbariAgent.py
+COMMON_DIR=/usr/lib/ambari-agent/lib/ambari_commons
COMMON_DIR_AGENT=/usr/lib/ambari-agent/lib/ambari_commons
OK=0
NOTOK=1
diff --git a/ambari-agent/conf/unix/ambari-env.sh b/ambari-agent/conf/unix/ambari-env.sh
index 1f93431..6458b87 100644
--- a/ambari-agent/conf/unix/ambari-env.sh
+++ b/ambari-agent/conf/unix/ambari-env.sh
@@ -17,7 +17,7 @@
# given through environment variable
AMBARI_PASSPHRASE="DEV"
export PATH=$PATH:/var/lib/ambari-agent
-export PYTHONPATH=$PYTHONPATH:/usr/lib/python2.6/site-packages
+export PYTHONPATH=/usr/lib/ambari-agent/lib:$PYTHONPATH
# customize python binary for ambari
# export PYTHON=/usr/bin/python2
diff --git a/ambari-agent/conf/unix/install-helper.sh b/ambari-agent/conf/unix/install-helper.sh
index 37bbe4a..e305866 100644
--- a/ambari-agent/conf/unix/install-helper.sh
+++ b/ambari-agent/conf/unix/install-helper.sh
@@ -18,22 +18,32 @@
# AGENT INSTALL HELPER #
##################################################################
-COMMON_DIR="/usr/lib/python2.6/site-packages/ambari_commons"
-RESOURCE_MANAGEMENT_DIR="/usr/lib/python2.6/site-packages/resource_management"
-JINJA_DIR="/usr/lib/python2.6/site-packages/ambari_jinja2"
-SIMPLEJSON_DIR="/usr/lib/python2.6/site-packages/ambari_simplejson"
-OLD_COMMON_DIR="/usr/lib/python2.6/site-packages/common_functions"
INSTALL_HELPER_SERVER="/var/lib/ambari-server/install-helper.sh"
COMMON_DIR_AGENT="/usr/lib/ambari-agent/lib/ambari_commons"
RESOURCE_MANAGEMENT_DIR_AGENT="/usr/lib/ambari-agent/lib/resource_management"
JINJA_AGENT_DIR="/usr/lib/ambari-agent/lib/ambari_jinja2"
SIMPLEJSON_AGENT_DIR="/usr/lib/ambari-agent/lib/ambari_simplejson"
-AMBARI_AGENT="/usr/lib/python2.6/site-packages/ambari_agent"
PYTHON_WRAPER_TARGET="/usr/bin/ambari-python-wrap"
AMBARI_AGENT_VAR="/var/lib/ambari-agent"
AMBARI_AGENT_BINARY="/etc/init.d/ambari-agent"
AMBARI_AGENT_BINARY_SYMLINK="/usr/sbin/ambari-agent"
+
+OLD_COMMON_DIR="/usr/lib/python2.6/site-packages/ambari_commons"
+OLD_RESOURCE_MANAGEMENT_DIR="/usr/lib/python2.6/site-packages/resource_management"
+OLD_JINJA_DIR="/usr/lib/python2.6/site-packages/ambari_jinja2"
+OLD_SIMPLEJSON_DIR="/usr/lib/python2.6/site-packages/ambari_simplejson"
+OLD_AMBARI_AGENT_DIR="/usr/lib/python2.6/site-packages/ambari_agent"
+
+COMMON_DIR="/usr/lib/ambari-agent/lib/ambari_commons"
+RESOURCE_MANAGEMENT_DIR="/usr/lib/ambari-agent/lib/resource_management"
+JINJA_DIR="/usr/lib/ambari-agent/lib/ambari_jinja2"
+SIMPLEJSON_DIR="/usr/lib/ambari-agent/lib/ambari_simplejson"
+STOMP_DIR="/usr/lib/ambari-agent/lib/ambari_stomp"
+WS4PY_DIR="/usr/lib/ambari-agent/lib/ambari_ws4py"
+OLD_COMMON_DIR="/usr/lib/ambari-agent/lib/common_functions"
+AMBARI_AGENT="/usr/lib/ambari-agent/lib/ambari_agent"
+
clean_pyc_files(){
# cleaning old *.pyc files
find ${RESOURCE_MANAGEMENT_DIR:?} -name *.pyc -exec rm {} \;
@@ -49,27 +59,8 @@ do_install(){
mv /etc/ambari-agent/conf.save /etc/ambari-agent/conf_$(date '+%d_%m_%y_%H_%M').save
fi
- # setting up /usr/sbin/ambari-agent symlink
- rm -f "$AMBARI_AGENT_BINARY_SYMLINK"
- ln -s "$AMBARI_AGENT_BINARY" "$AMBARI_AGENT_BINARY_SYMLINK"
-
- # setting ambari_commons shared resource
- rm -rf "$OLD_COMMON_DIR"
- if [ ! -d "$COMMON_DIR" ]; then
- ln -s "$COMMON_DIR_AGENT" "$COMMON_DIR"
- fi
- # setting resource_management shared resource
- if [ ! -d "$RESOURCE_MANAGEMENT_DIR" ]; then
- ln -s "$RESOURCE_MANAGEMENT_DIR_AGENT" "$RESOURCE_MANAGEMENT_DIR"
- fi
- # setting jinja2 shared resource
- if [ ! -d "$JINJA_DIR" ]; then
- ln -s "$JINJA_AGENT_DIR" "$JINJA_DIR"
- fi
- # setting simplejson shared resource
- if [ ! -d "$SIMPLEJSON_DIR" ]; then
- ln -s "$SIMPLEJSON_AGENT_DIR" "$SIMPLEJSON_DIR"
- fi
+ # these symlinks (or directories) where created in ambari releases prior to ambari-2.6.2. Do clean up.
+ rm -rf "$OLD_COMMON_DIR" "$OLD_RESOURCE_MANAGEMENT_DIR" "$OLD_JINJA_DIR" "$OLD_SIMPLEJSON_DIR" "$OLD_COMMON_DIR" "$OLD_AMBARI_AGENT_DIR"
# on nano Ubuntu, when umask=027 those folders are created without 'x' bit for 'others'.
# which causes failures when hadoop users try to access tmp_dir
@@ -124,6 +115,14 @@ do_install(){
mv $BAK ${BAK}_$(date '+%d_%m_%y_%H_%M').save
fi
fi
+
+ if [ -f "$AMBARI_ENV_RPMSAVE" ] ; then
+ PYTHON_PATH_LINE='export PYTHONPATH=/usr/lib/ambari-agent/lib:$PYTHONPATH'
+ grep "^$PYTHON_PATH_LINE\$" "$AMBARI_ENV_RPMSAVE" > /dev/null
+ if [ $? -ne 0 ] ; then
+ echo -e "\n$PYTHON_PATH_LINE" >> $AMBARI_ENV_RPMSAVE
+ fi
+ fi
}
do_remove(){
@@ -158,10 +157,6 @@ do_remove(){
rm -f $SIMPLEJSON_DIR
fi
- if [ -d "$OLD_COMMON_DIR" ]; then
- rm -f $OLD_COMMON_DIR
- fi
-
# if server package exists, restore their settings
if [ -f "$INSTALL_HELPER_SERVER" ]; then # call server shared files installer
$INSTALL_HELPER_SERVER install
diff --git a/ambari-agent/pom.xml b/ambari-agent/pom.xml
index eede374..38a0ada 100644
--- a/ambari-agent/pom.xml
+++ b/ambari-agent/pom.xml
@@ -36,7 +36,7 @@
<package.log.dir>/var/log/ambari-agent</package.log.dir>
<package.pid.dir>/var/run/ambari-agent</package.pid.dir>
<skipTests>false</skipTests>
- <agent.install.dir>/usr/lib/python2.6/site-packages/ambari_agent</agent.install.dir>
+ <agent.install.dir>/usr/lib/ambari-agent/lib/ambari_agent</agent.install.dir>
<ambari_commons.install.dir>/usr/lib/ambari-agent/lib/ambari_commons</ambari_commons.install.dir>
<resource_management.install.dir>/usr/lib/ambari-agent/lib/resource_management</resource_management.install.dir>
<jinja.install.dir>/usr/lib/ambari-agent/lib/ambari_jinja2</jinja.install.dir>
@@ -285,17 +285,6 @@
</sources>
</mapping>
<mapping>
- <directory>/usr/lib/python2.6/site-packages</directory>
- <filemode>755</filemode>
- <username>root</username>
- <groupname>root</groupname>
- <sources>
- <source>
- <location>${project.build.directory}${dirsep}${project.artifactId}-${project.version}/usr/lib/python2.6/site-packages</location>
- </source>
- </sources>
- </mapping>
- <mapping>
<directory>/var/lib/ambari-agent</directory>
<filemode>755</filemode>
<username>root</username>
diff --git a/ambari-agent/src/main/package/rpm/posttrans_agent.sh b/ambari-agent/src/main/package/rpm/posttrans_agent.sh
index 723bb93..35ec59a 100644
--- a/ambari-agent/src/main/package/rpm/posttrans_agent.sh
+++ b/ambari-agent/src/main/package/rpm/posttrans_agent.sh
@@ -14,29 +14,9 @@
# limitations under the License
-RESOURCE_MANAGEMENT_DIR="/usr/lib/python2.6/site-packages/resource_management"
-RESOURCE_MANAGEMENT_DIR_AGENT="/usr/lib/ambari-agent/lib/resource_management"
-JINJA_DIR="/usr/lib/python2.6/site-packages/ambari_jinja2"
-JINJA_AGENT_DIR="/usr/lib/ambari-agent/lib/ambari_jinja2"
AMBARI_AGENT_BINARY="/etc/init.d/ambari-agent"
AMBARI_AGENT_BINARY_SYMLINK="/usr/sbin/ambari-agent"
-# remove RESOURCE_MANAGEMENT_DIR if it's a directory
-if [ -d "$RESOURCE_MANAGEMENT_DIR" ]; then # resource_management dir exists
- if [ ! -L "$RESOURCE_MANAGEMENT_DIR" ]; then # resource_management dir is not link
- rm -rf "$RESOURCE_MANAGEMENT_DIR"
- fi
-fi
-# setting resource_management shared resource
-if [ ! -d "$RESOURCE_MANAGEMENT_DIR" ]; then
- ln -s "$RESOURCE_MANAGEMENT_DIR_AGENT" "$RESOURCE_MANAGEMENT_DIR"
-fi
-
-# setting jinja2 shared resource
-if [ ! -d "$JINJA_DIR" ]; then
- ln -s "$JINJA_AGENT_DIR" "$JINJA_DIR"
-fi
-
# setting ambari-agent binary symlink
if [ ! -f "$AMBARI_AGENT_BINARY_SYMLINK" ]; then
ln -s "$AMBARI_AGENT_BINARY" "$AMBARI_AGENT_BINARY_SYMLINK"
diff --git a/ambari-agent/src/main/python/ambari_agent/ActionQueue.py b/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
index f1b3a42..1a85e76 100644
--- a/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
+++ b/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
@@ -121,7 +121,8 @@ class ActionQueue(threading.Thread):
for command in commands:
logger.info("Canceling command with taskId = {tid}".format(tid = str(command['target_task_id'])))
- logger.debug(pprint.pformat(command))
+ if logger.isEnabledFor(logging.DEBUG):
+ logger.debug(pprint.pformat(command))
task_id = command['target_task_id']
reason = command['reason']
@@ -144,8 +145,8 @@ class ActionQueue(threading.Thread):
self.customServiceOrchestrator.cancel_command(task_id, reason)
def run(self):
- try:
- while not self.stopped():
+ while not self.stopped():
+ try:
self.processBackgroundQueueSafeEmpty()
self.controller.get_status_commands_executor().process_results() # process status commands
try:
@@ -176,9 +177,8 @@ class ActionQueue(threading.Thread):
pass
except (Queue.Empty):
pass
- except:
- logger.exception("ActionQueue thread failed with exception:")
- raise
+ except:
+ logger.exception("ActionQueue thread failed with exception. Re-running it")
logger.info("ActionQueue thread has successfully finished")
@@ -200,7 +200,7 @@ class ActionQueue(threading.Thread):
def process_command(self, command):
# make sure we log failures
commandType = command['commandType']
- logger.debug("Took an element of Queue (command type = %s)." % commandType)
+ logger.debug("Took an element of Queue (command type = %s).", commandType)
try:
if commandType in [self.EXECUTION_COMMAND, self.BACKGROUND_EXECUTION_COMMAND, self.AUTO_EXECUTION_COMMAND]:
try:
@@ -211,7 +211,7 @@ class ActionQueue(threading.Thread):
if self.controller.recovery_manager.enabled():
self.controller.recovery_manager.stop_execution_command()
else:
- logger.error("Unrecognized command " + pprint.pformat(command))
+ logger.error("Unrecognized command %s", pprint.pformat(command))
except Exception:
logger.exception("Exception while processing {0} command".format(commandType))
@@ -475,14 +475,14 @@ class ActionQueue(threading.Thread):
self.customServiceOrchestrator
def on_background_command_complete_callback(self, process_condensed_result, handle):
- logger.debug('Start callback: %s' % process_condensed_result)
- logger.debug('The handle is: %s' % handle)
+ logger.debug('Start callback: %s', process_condensed_result)
+ logger.debug('The handle is: %s', handle)
status = self.COMPLETED_STATUS if handle.exitCode == 0 else self.FAILED_STATUS
aborted_postfix = self.customServiceOrchestrator.command_canceled_reason(handle.command['taskId'])
if aborted_postfix:
status = self.FAILED_STATUS
- logger.debug('Set status to: %s , reason = %s' % (status, aborted_postfix))
+ logger.debug('Set status to: %s , reason = %s', status, aborted_postfix)
else:
aborted_postfix = ''
@@ -556,11 +556,9 @@ class ActionQueue(threading.Thread):
result['extra'] = component_extra
- logger.debug("Got live status for component " + component + \
- " of service " + str(service) + \
- " of cluster " + str(cluster))
-
- logger.debug(pprint.pformat(result))
+ if logger.isEnabledFor(logging.DEBUG):
+ logger.debug("Got live status for component %s of service %s of cluster %s", component, service, cluster)
+ logger.debug(pprint.pformat(result))
if result is not None:
self.commandStatuses.put_command_status(command, result)
except Exception, err:
diff --git a/ambari-agent/src/main/python/ambari_agent/AmbariAgent.py b/ambari-agent/src/main/python/ambari_agent/AmbariAgent.py
index aeb200c..8475551 100644
--- a/ambari-agent/src/main/python/ambari_agent/AmbariAgent.py
+++ b/ambari-agent/src/main/python/ambari_agent/AmbariAgent.py
@@ -27,7 +27,7 @@ from Controller import AGENT_AUTO_RESTART_EXIT_CODE
if os.environ.has_key("PYTHON_BIN"):
AGENT_SCRIPT = os.path.join(os.environ["PYTHON_BIN"],"site-packages/ambari_agent/main.py")
else:
- AGENT_SCRIPT = "/usr/lib/python2.6/site-packages/ambari_agent/main.py"
+ AGENT_SCRIPT = "/usr/lib/ambari-agent/lib/ambari_agent/main.py"
if os.environ.has_key("AMBARI_PID_DIR"):
AGENT_PID_FILE = os.path.join(os.environ["AMBARI_PID_DIR"],"ambari-agent.pid")
else:
diff --git a/ambari-agent/src/main/python/ambari_agent/CommandStatusDict.py b/ambari-agent/src/main/python/ambari_agent/CommandStatusDict.py
index 7a97f3f..8ff5818 100644
--- a/ambari-agent/src/main/python/ambari_agent/CommandStatusDict.py
+++ b/ambari-agent/src/main/python/ambari_agent/CommandStatusDict.py
@@ -105,7 +105,7 @@ class CommandStatusDict():
# Component status is useful once, removing it
del self.current_state[key]
elif command ['commandType'] in [ActionQueue.AUTO_EXECUTION_COMMAND]:
- logger.debug("AUTO_EXECUTION_COMMAND task deleted " + str(command['commandId']))
+ logger.debug("AUTO_EXECUTION_COMMAND task deleted %s", command['commandId'])
del self.current_state[key]
pass
result = {
diff --git a/ambari-agent/src/main/python/ambari_agent/Controller.py b/ambari-agent/src/main/python/ambari_agent/Controller.py
index 4da631c..f231d27 100644
--- a/ambari-agent/src/main/python/ambari_agent/Controller.py
+++ b/ambari-agent/src/main/python/ambari_agent/Controller.py
@@ -165,18 +165,17 @@ class Controller(threading.Thread):
while not self.isRegistered:
try:
data = json.dumps(self.register.build(self.version))
- prettyData = pprint.pformat(data)
-
try:
server_ip = socket.gethostbyname(self.hostname)
- logger.info("Registering with %s (%s) (agent=%s)", self.hostname, server_ip, prettyData)
+ logger.info("Registering with %s (%s) (agent=%s)", self.hostname, server_ip, data)
except socket.error:
logger.warn("Unable to determine the IP address of '%s', agent registration may fail (agent=%s)",
- self.hostname, prettyData)
+ self.hostname, data)
ret = self.sendRequest(self.registerUrl, data)
- prettyData = pprint.pformat(ret)
- logger.debug("Registration response is %s", prettyData)
+
+ if logger.isEnabledFor(logging.DEBUG):
+ logger.debug("Registration response is %s", pprint.pformat(ret))
# exitstatus is a code of error which was raised on server side.
# exitstatus = 0 (OK - Default)
@@ -204,7 +203,7 @@ class Controller(threading.Thread):
self.cluster_configuration.update_configurations_from_heartbeat(ret)
self.recovery_manager.update_configuration_from_registration(ret)
self.config.update_configuration_from_registration(ret)
- logger.debug("Updated config:" + str(self.config))
+ logger.debug("Updated config: %s", self.config)
# Start StatusCommandExecutor child process or restart it if already running
# in order to receive up to date agent config.
@@ -428,7 +427,7 @@ class Controller(threading.Thread):
logger.log(logging_level, "Executing alert commands")
self.alert_scheduler_handler.execute_alert(response['alertExecutionCommands'])
- if "true" == response['restartAgent']:
+ if response['restartAgent']:
logger.error("Received the restartAgent command")
self.restartAgent()
else:
@@ -571,11 +570,11 @@ class Controller(threading.Thread):
if LiveStatus.SERVICES:
return
- logger.debug("Updating components map of cluster " + cluster_name)
+ logger.debug("Updating components map of cluster %s", cluster_name)
# May throw IOError on server connection error
response = self.sendRequest(self.componentsUrl + cluster_name, None)
- logger.debug("Response from %s was %s", self.serverHostname, str(response))
+ logger.debug("Response from %s was %s", self.serverHostname, response)
services, client_components, server_components = [], [], []
for service, components in response['components'].items():
@@ -592,9 +591,9 @@ class Controller(threading.Thread):
LiveStatus.COMPONENTS = server_components
logger.debug("Components map updated")
- logger.debug("LiveStatus.SERVICES" + str(LiveStatus.SERVICES))
- logger.debug("LiveStatus.CLIENT_COMPONENTS" + str(LiveStatus.CLIENT_COMPONENTS))
- logger.debug("LiveStatus.COMPONENTS" + str(LiveStatus.COMPONENTS))
+ logger.debug("LiveStatus.SERVICES %s", LiveStatus.SERVICES)
+ logger.debug("LiveStatus.CLIENT_COMPONENTS %s", LiveStatus.CLIENT_COMPONENTS)
+ logger.debug("LiveStatus.COMPONENTS %s", LiveStatus.COMPONENTS)
def get_status_commands_executor(self):
return self.statusCommandsExecutor
diff --git a/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py b/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
index ad9e19c..0a21ae3 100644
--- a/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
+++ b/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
@@ -114,7 +114,7 @@ class CustomServiceOrchestrator():
def map_task_to_process(self, task_id, processId):
with self.commands_in_progress_lock:
- logger.debug('Maps taskId=%s to pid=%s' % (task_id, processId))
+ logger.debug('Maps taskId=%s to pid=%s', task_id, processId)
self.commands_in_progress[task_id] = processId
def cancel_command(self, task_id, reason):
@@ -448,7 +448,7 @@ class CustomServiceOrchestrator():
def command_canceled_reason(self, task_id):
with self.commands_in_progress_lock:
if self.commands_in_progress.has_key(task_id):#Background command do not push in this collection (TODO)
- logger.debug('Pop with taskId %s' % task_id)
+ logger.debug('Pop with taskId %s', task_id)
pid = self.commands_in_progress.pop(task_id)
if not isinstance(pid, int):
reason = pid
diff --git a/ambari-agent/src/main/python/ambari_agent/DataCleaner.py b/ambari-agent/src/main/python/ambari_agent/DataCleaner.py
index 0b66fa7..9c3b2e1 100644
--- a/ambari-agent/src/main/python/ambari_agent/DataCleaner.py
+++ b/ambari-agent/src/main/python/ambari_agent/DataCleaner.py
@@ -68,7 +68,7 @@ class DataCleaner(threading.Thread):
logger.info('Data cleanup thread killed.')
def cleanup(self):
- logger.debug("Cleaning up inside directory " + self.data_dir)
+ logger.debug("Cleaning up inside directory %s", self.data_dir)
now = time.time()
total_size_bytes = 0
file_path_to_timestamp = {}
@@ -82,7 +82,7 @@ class DataCleaner(threading.Thread):
file_age = now - os.path.getmtime(file_path)
if file_age > self.file_max_age:
os.remove(os.path.join(file_path))
- logger.debug('Removed file: ' + file_path)
+ logger.debug('Removed file: %s', file_path)
else:
# Since file wasn't deleted in first pass, consider it for the second one with oldest files first
file_size = os.path.getsize(file_path)
diff --git a/ambari-agent/src/main/python/ambari_agent/Heartbeat.py b/ambari-agent/src/main/python/ambari_agent/Heartbeat.py
index d7c0325..11ad652 100644
--- a/ambari-agent/src/main/python/ambari_agent/Heartbeat.py
+++ b/ambari-agent/src/main/python/ambari_agent/Heartbeat.py
@@ -75,12 +75,12 @@ class Heartbeat:
if int(id) == 0:
componentsMapped = False
- logger.debug("Building Heartbeat: {responseId = %s, timestamp = %s, "
- "commandsInProgress = %s, componentsMapped = %s,"
- "recoveryTimestamp = %s}",
- str(id), str(timestamp), repr(commandsInProgress), repr(componentsMapped), str(recovery_timestamp))
-
- logger.debug("Heartbeat: %s", pformat(heartbeat))
+ if logger.isEnabledFor(logging.DEBUG):
+ logger.debug("Building Heartbeat: {responseId = %s, timestamp = %s, "
+ "commandsInProgress = %s, componentsMapped = %s, "
+ "recoveryTimestamp = %s}",
+ id, timestamp, commandsInProgress, componentsMapped, recovery_timestamp)
+ logger.debug("Heartbeat: %s", pformat(heartbeat))
hostInfo = HostInfo(self.config)
if add_state:
@@ -93,8 +93,9 @@ class Heartbeat:
mounts = Hardware(config=self.config, cache_info=False).osdisks()
heartbeat['mounts'] = mounts
- logger.debug("agentEnv: %s", str(nodeInfo))
- logger.debug("mounts: %s", str(mounts))
+ if logger.isEnabledFor(logging.DEBUG):
+ logger.debug("agentEnv: %s", nodeInfo)
+ logger.debug("mounts: %s", mounts)
if self.collector is not None:
heartbeat['alerts'] = self.collector.alerts()
diff --git a/ambari-agent/src/main/python/ambari_agent/HostCleanup.py b/ambari-agent/src/main/python/ambari_agent/HostCleanup.py
index 7ee3b1c..3db90ea 100644
--- a/ambari-agent/src/main/python/ambari_agent/HostCleanup.py
+++ b/ambari-agent/src/main/python/ambari_agent/HostCleanup.py
@@ -20,7 +20,7 @@ limitations under the License.
# For compatibility with different OSes
# Edit PYTHONPATH to be able to import common_functions
import sys
-sys.path.append("/usr/lib/python2.6/site-packages/")
+sys.path.append("/usr/lib/ambari-agent/lib/")
########################################################
import os
diff --git a/ambari-agent/src/main/python/ambari_agent/LiveStatus.py b/ambari-agent/src/main/python/ambari_agent/LiveStatus.py
index b6d54ed..a506e28 100644
--- a/ambari-agent/src/main/python/ambari_agent/LiveStatus.py
+++ b/ambari-agent/src/main/python/ambari_agent/LiveStatus.py
@@ -62,6 +62,5 @@ class LiveStatus:
if active_config is not None:
livestatus['configurationTags'] = active_config
- logger.debug("The live status for component " + str(self.component) +
- " of service " + str(self.service) + " is " + str(livestatus))
+ logger.debug("The live status for component %s of service %s is %s", self.component, self.service, livestatus)
return livestatus
diff --git a/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py b/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py
index ea6f895..139c141 100644
--- a/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py
+++ b/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py
@@ -93,7 +93,8 @@ class PythonExecutor(object):
The structured out file, however, is preserved during multiple invocations that use the same file.
"""
pythonCommand = self.python_command(script, script_params)
- logger.debug("Running command " + pprint.pformat(pythonCommand))
+ if logger.isEnabledFor(logging.DEBUG):
+ logger.debug("Running command %s", pprint.pformat(pythonCommand))
if handle is None:
tmpout, tmperr = self.open_subprocess_files(tmpoutfile, tmperrfile, override_output_files, backup_log_files)
@@ -127,7 +128,7 @@ class PythonExecutor(object):
"""
Log some useful information after task failure.
"""
- logger.info("Command " + pprint.pformat(pythonCommand) + " failed with exitcode=" + str(result['exitcode']))
+ logger.info("Command %s failed with exitcode=%s", pprint.pformat(pythonCommand), result['exitcode'])
log_process_information(logger)
def prepare_process_result(self, returncode, tmpoutfile, tmperrfile, tmpstructedoutfile, timeout=None):
@@ -138,7 +139,7 @@ class PythonExecutor(object):
(" after waiting %s secs" % str(timeout) if timeout else "")
returncode = 999
result = self.condenseOutput(out, error, returncode, structured_out)
- logger.debug("Result: %s" % result)
+ logger.debug("Result: %s", result)
return result
def read_result_from_files(self, out_path, err_path, structured_out_path):
@@ -223,10 +224,10 @@ class BackgroundThread(threading.Thread):
def run(self):
process_out, process_err = self.pythonExecutor.open_subprocess_files(self.holder.out_file, self.holder.err_file, True)
- logger.debug("Starting process command %s" % self.holder.command)
+ logger.debug("Starting process command %s", self.holder.command)
process = self.pythonExecutor.launch_python_subprocess(self.holder.command, process_out, process_err)
- logger.debug("Process has been started. Pid = %s" % process.pid)
+ logger.debug("Process has been started. Pid = %s", process.pid)
self.holder.handle.pid = process.pid
self.holder.handle.status = BackgroundCommandExecutionHandle.RUNNING_STATUS
@@ -236,6 +237,6 @@ class BackgroundThread(threading.Thread):
self.holder.handle.exitCode = process.returncode
process_condensed_result = self.pythonExecutor.prepare_process_result(process.returncode, self.holder.out_file, self.holder.err_file, self.holder.structured_out_file)
- logger.debug("Calling callback with args %s" % process_condensed_result)
+ logger.debug("Calling callback with args %s", process_condensed_result)
self.holder.handle.on_background_command_complete_callback(process_condensed_result, self.holder.handle)
- logger.debug("Exiting from thread for holder pid %s" % self.holder.handle.pid)
+ logger.debug("Exiting from thread for holder pid %s", self.holder.handle.pid)
diff --git a/ambari-agent/src/main/python/ambari_agent/PythonReflectiveExecutor.py b/ambari-agent/src/main/python/ambari_agent/PythonReflectiveExecutor.py
index b27d7d1..b021320 100644
--- a/ambari-agent/src/main/python/ambari_agent/PythonReflectiveExecutor.py
+++ b/ambari-agent/src/main/python/ambari_agent/PythonReflectiveExecutor.py
@@ -46,7 +46,8 @@ class PythonReflectiveExecutor(PythonExecutor):
override_output_files = True, backup_log_files = True,
handle = None, log_info_on_failure=True):
pythonCommand = self.python_command(script, script_params)
- logger.debug("Running command reflectively " + pprint.pformat(pythonCommand))
+ if logger.isEnabledFor(logging.DEBUG):
+ logger.debug("Running command reflectively %s", pprint.pformat(pythonCommand))
script_dir = os.path.dirname(script)
self.open_subprocess_files(tmpoutfile, tmperrfile, override_output_files, backup_log_files)
diff --git a/ambari-agent/src/main/python/ambari_agent/RecoveryManager.py b/ambari-agent/src/main/python/ambari_agent/RecoveryManager.py
index be335f2..c196fd8 100644
--- a/ambari-agent/src/main/python/ambari_agent/RecoveryManager.py
+++ b/ambari-agent/src/main/python/ambari_agent/RecoveryManager.py
@@ -128,7 +128,7 @@ class RecoveryManager:
def set_paused(self, paused):
if self.paused != paused:
- logger.debug("RecoveryManager is transitioning from isPaused = " + str(self.paused) + " to " + str(paused))
+ logger.debug("RecoveryManager is transitioning from isPaused = %s to %s", self.paused, paused)
self.paused = paused
def enabled(self):
@@ -574,7 +574,8 @@ class RecoveryManager:
if reg_resp and "recoveryConfig" in reg_resp:
- logger.info("RecoverConfig = " + pprint.pformat(reg_resp["recoveryConfig"]))
+ if logger.isEnabledFor(logging.INFO):
+ logger.info("RecoverConfig = %s", pprint.pformat(reg_resp["recoveryConfig"]))
config = reg_resp["recoveryConfig"]
if "type" in config:
if config["type"] in ["AUTO_INSTALL_START", "AUTO_START", "FULL"]:
@@ -691,8 +692,8 @@ class RecoveryManager:
if commands and len(commands) > 0:
for command in commands:
self.store_or_update_command(command)
- if self.EXECUTION_COMMAND_DETAILS in command:
- logger.debug("Details to construct exec commands: " + pprint.pformat(command[self.EXECUTION_COMMAND_DETAILS]))
+ if logger.isEnabledFor(logging.DEBUG) and self.EXECUTION_COMMAND_DETAILS in command:
+ logger.debug("Details to construct exec commands: %s", pprint.pformat(command[self.EXECUTION_COMMAND_DETAILS]))
pass
@@ -748,7 +749,7 @@ class RecoveryManager:
# Store the execution command details
self.remove_command(component)
self.add_command(component, command[self.EXECUTION_COMMAND_DETAILS])
- logger.debug("Stored command details for " + component)
+ logger.debug("Stored command details for %s", component)
else:
logger.warn("Expected field " + self.EXECUTION_COMMAND_DETAILS + " unavailable.")
pass
@@ -855,7 +856,7 @@ class RecoveryManager:
insert_time = self.stored_exec_commands[component_update_key]
age = self._now_() - insert_time
if self.COMMAND_REFRESH_DELAY_SEC < age:
- logger.debug("Removing stored command for component : " + str(component) + " as its " + str(age) + " sec old")
+ logger.debug("Removing stored command for component : %s as it's %s sec old", component, age)
self.remove_command(component)
pass
@@ -867,7 +868,7 @@ class RecoveryManager:
component_update_key = self.COMPONENT_UPDATE_KEY_FORMAT.format(component)
del self.stored_exec_commands[component]
del self.stored_exec_commands[component_update_key]
- logger.debug("Removed stored command for component : " + str(component))
+ logger.debug("Removed stored command for component : %s", component)
return True
finally:
self.__status_lock.release()
@@ -880,7 +881,7 @@ class RecoveryManager:
component_update_key = self.COMPONENT_UPDATE_KEY_FORMAT.format(component)
self.stored_exec_commands[component] = command
self.stored_exec_commands[component_update_key] = self._now_()
- logger.debug("Added command for component : " + str(component))
+ logger.debug("Added command for component : %s", component)
finally:
self.__status_lock.release()
diff --git a/ambari-agent/src/main/python/ambari_agent/StatusCommandsExecutor.py b/ambari-agent/src/main/python/ambari_agent/StatusCommandsExecutor.py
index f42e134..ad90b83 100644
--- a/ambari-agent/src/main/python/ambari_agent/StatusCommandsExecutor.py
+++ b/ambari-agent/src/main/python/ambari_agent/StatusCommandsExecutor.py
@@ -64,7 +64,8 @@ class SingleProcessStatusCommandsExecutor(StatusCommandsExecutor):
command['serviceName'] + " of cluster " + \
command['clusterName'] + " to the queue.")
self.statusCommandQueue.put(command)
- logger.debug(pprint.pformat(command))
+ if logger.isEnabledFor(logging.DEBUG):
+ logger.debug(pprint.pformat(command))
def process_results(self):
"""
diff --git a/ambari-agent/src/main/python/ambari_agent/alerts/ams_alert.py b/ambari-agent/src/main/python/ambari_agent/alerts/ams_alert.py
index 70f100f..cc2884e 100644
--- a/ambari-agent/src/main/python/ambari_agent/alerts/ams_alert.py
+++ b/ambari-agent/src/main/python/ambari_agent/alerts/ams_alert.py
@@ -22,7 +22,6 @@ import httplib
import imp
import time
import urllib
-from alerts.base_alert import BaseAlert
from alerts.metric_alert import MetricAlert
import ambari_simplejson as json
import logging
@@ -30,6 +29,7 @@ import re
import uuid
from resource_management.libraries.functions.get_port_from_url import get_port_from_url
+from ambari_commons import inet_utils
logger = logging.getLogger()
@@ -64,10 +64,11 @@ class AmsAlert(MetricAlert):
# use the URI lookup keys to get a final URI value to query
alert_uri = self._get_uri_from_structure(self.uri_property_keys)
- logger.debug("[Alert][{0}] Calculated metric URI to be {1} (ssl={2})".format(
- self.get_name(), alert_uri.uri, str(alert_uri.is_ssl_enabled)))
+ if logger.isEnabledFor(logging.DEBUG):
+ logger.debug("[Alert][{0}] Calculated metric URI to be {1} (ssl={2})".format(
+ self.get_name(), alert_uri.uri, str(alert_uri.is_ssl_enabled)))
- host = BaseAlert.get_host_from_url(alert_uri.uri)
+ host = inet_utils.get_host_from_url(alert_uri.uri)
if host is None:
host = self.host_name
@@ -94,7 +95,8 @@ class AmsAlert(MetricAlert):
collect_result = self._get_result(value_list[0] if compute_result is None else compute_result)
- logger.debug("[Alert][{0}] Computed result = {1}".format(self.get_name(), str(value_list)))
+ if logger.isEnabledFor(logging.DEBUG):
+ logger.debug("[Alert][{0}] Computed result = {1}".format(self.get_name(), str(value_list)))
return (collect_result, value_list)
diff --git a/ambari-agent/src/main/python/ambari_agent/alerts/base_alert.py b/ambari-agent/src/main/python/ambari_agent/alerts/base_alert.py
index 5c0305e..cdbe316 100644
--- a/ambari-agent/src/main/python/ambari_agent/alerts/base_alert.py
+++ b/ambari-agent/src/main/python/ambari_agent/alerts/base_alert.py
@@ -510,49 +510,4 @@ class BaseAlert(object):
:param state: the state of the alert in uppercase (such as OK, WARNING, etc)
:return: the parameterized text
'''
- return '{0}'
-
- """
- See RFC3986, Appendix B
- Tested on the following cases:
- "192.168.54.1"
- "192.168.54.2:7661
- "hdfs://192.168.54.3/foo/bar"
- "ftp://192.168.54.4:7842/foo/bar"
-
- Returns None if only a port is passed in
- """
- @staticmethod
- def get_host_from_url(uri):
- if uri is None:
- return None
-
- # if not a string, return None
- if not isinstance(uri, basestring):
- return None
-
- # RFC3986, Appendix B
- parts = re.findall('^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?', uri)
-
- # index of parts
- # scheme = 1
- # authority = 3
- # path = 4
- # query = 6
- # fragment = 8
-
- host_and_port = uri
- if 0 == len(parts[0][1]):
- host_and_port = parts[0][4]
- elif 0 == len(parts[0][2]):
- host_and_port = parts[0][1]
- elif parts[0][2].startswith("//"):
- host_and_port = parts[0][3]
-
- if -1 == host_and_port.find(':'):
- if host_and_port.isdigit():
- return None
-
- return host_and_port
- else:
- return host_and_port.split(':')[0]
+ return '{0}'
\ No newline at end of file
diff --git a/ambari-agent/src/main/python/ambari_agent/alerts/metric_alert.py b/ambari-agent/src/main/python/ambari_agent/alerts/metric_alert.py
index 803bdc6..64a1a29 100644
--- a/ambari-agent/src/main/python/ambari_agent/alerts/metric_alert.py
+++ b/ambari-agent/src/main/python/ambari_agent/alerts/metric_alert.py
@@ -30,6 +30,7 @@ from alerts.base_alert import BaseAlert
from ambari_commons.urllib_handlers import RefreshHeaderProcessor
from resource_management.libraries.functions.get_port_from_url import get_port_from_url
from resource_management.libraries.functions.curl_krb_request import curl_krb_request
+from ambari_commons import inet_utils
from ambari_agent import Constants
logger = logging.getLogger()
@@ -80,7 +81,7 @@ class MetricAlert(BaseAlert):
logger.debug("[Alert][{0}] Calculated metric URI to be {1} (ssl={2})".format(
self.get_name(), alert_uri.uri, str(alert_uri.is_ssl_enabled)))
- host = BaseAlert.get_host_from_url(alert_uri.uri)
+ host = inet_utils.get_host_from_url(alert_uri.uri)
if host is None:
host = self.host_name
@@ -107,7 +108,8 @@ class MetricAlert(BaseAlert):
collect_result = self._get_result(value_list[0] if check_value is None else check_value)
- logger.debug("[Alert][{0}] Resolved values = {1}".format(self.get_name(), str(value_list)))
+ if logger.isEnabledFor(logging.DEBUG):
+ logger.debug("[Alert][{0}] Resolved values = {1}".format(self.get_name(), str(value_list)))
return (collect_result, value_list)
diff --git a/ambari-agent/src/main/python/ambari_agent/alerts/port_alert.py b/ambari-agent/src/main/python/ambari_agent/alerts/port_alert.py
index 02cc91c..1e2e581 100644
--- a/ambari-agent/src/main/python/ambari_agent/alerts/port_alert.py
+++ b/ambari-agent/src/main/python/ambari_agent/alerts/port_alert.py
@@ -24,7 +24,7 @@ import time
from alerts.base_alert import BaseAlert
from resource_management.libraries.functions.get_port_from_url import get_port_from_url
from ambari_commons import OSCheck
-from ambari_commons.inet_utils import resolve_address
+from ambari_commons.inet_utils import resolve_address, get_host_from_url
logger = logging.getLogger()
# default timeouts
@@ -111,7 +111,7 @@ class PortAlert(BaseAlert):
break
- host = BaseAlert.get_host_from_url(uri_value)
+ host = get_host_from_url(uri_value)
if host is None or host == "localhost" or host == "0.0.0.0":
host = self.host_name
host_not_specified = True
diff --git a/ambari-agent/src/main/python/ambari_agent/alerts/web_alert.py b/ambari-agent/src/main/python/ambari_agent/alerts/web_alert.py
index 0e400f7..6e01b89 100644
--- a/ambari-agent/src/main/python/ambari_agent/alerts/web_alert.py
+++ b/ambari-agent/src/main/python/ambari_agent/alerts/web_alert.py
@@ -21,9 +21,7 @@ limitations under the License.
import logging
import time
import urllib2
-import ssl
-from functools import wraps
from urllib2 import HTTPError
from tempfile import gettempdir
@@ -33,7 +31,7 @@ from resource_management.libraries.functions.get_port_from_url import get_port_f
from resource_management.libraries.functions.get_path_from_url import get_path_from_url
from resource_management.libraries.functions.curl_krb_request import curl_krb_request
from ambari_commons import OSCheck
-from ambari_commons.inet_utils import resolve_address, ensure_ssl_using_protocol
+from ambari_commons.inet_utils import resolve_address, ensure_ssl_using_protocol, get_host_from_url
from ambari_agent import Constants
from ambari_agent.AmbariConfig import AmbariConfig
@@ -135,7 +133,7 @@ class WebAlert(BaseAlert):
uri_path = get_path_from_url(string_uri)
# start building the URL manually
- host = BaseAlert.get_host_from_url(alert_uri.uri)
+ host = get_host_from_url(alert_uri.uri)
if host is None:
host = self.host_name
diff --git a/ambari-agent/src/main/python/ambari_agent/security.py b/ambari-agent/src/main/python/ambari_agent/security.py
index 45de7bb..d752ee6 100644
--- a/ambari-agent/src/main/python/ambari_agent/security.py
+++ b/ambari-agent/src/main/python/ambari_agent/security.py
@@ -48,8 +48,7 @@ class VerifiedHTTPSConnection(httplib.HTTPSConnection):
def connect(self):
self.two_way_ssl_required = self.config.isTwoWaySSLConnection(self.host)
- logger.debug("Server two-way SSL authentication required: %s" % str(
- self.two_way_ssl_required))
+ logger.debug("Server two-way SSL authentication required: %s", self.two_way_ssl_required)
if self.two_way_ssl_required is True:
logger.info(
'Server require two-way SSL authentication. Use it instead of one-way...')
@@ -230,9 +229,10 @@ class CertificateManager():
f.close()
try:
data = json.loads(response)
- logger.debug("Sign response from Server: \n" + pprint.pformat(data))
+ if logger.isEnabledFor(logging.DEBUG):
+ logger.debug("Sign response from Server: \n" + pprint.pformat(data))
except Exception:
- logger.warn("Malformed response! data: " + str(data))
+ logger.warn("Malformed response! data: %s", data)
data = {'result': 'ERROR'}
result = data['result']
if result == 'OK':
diff --git a/ambari-agent/src/test/python/ambari_agent/TestController.py b/ambari-agent/src/test/python/ambari_agent/TestController.py
index 20da81f..cb69e5d 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestController.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestController.py
@@ -447,7 +447,7 @@ class TestController(unittest.TestCase):
self.controller.sendRequest = sendRequest
self.controller.responseId = 1
- response = {"responseId":"2", "restartAgent":"false"}
+ response = {"responseId":"2", "restartAgent":False}
sendRequest.return_value = response
def one_heartbeat(*args, **kwargs):
@@ -521,7 +521,7 @@ class TestController(unittest.TestCase):
# wrong responseId => restart
self.controller.responseId = 2
- response = {"responseId":"2", "restartAgent":"false"}
+ response = {"responseId":"2", "restartAgent":False}
restartAgent = MagicMock(name="restartAgent")
self.controller.restartAgent = restartAgent
@@ -553,7 +553,7 @@ class TestController(unittest.TestCase):
# restartAgent command
self.controller.responseId = 1
self.controller.DEBUG_STOP_HEARTBEATING = False
- response["restartAgent"] = "true"
+ response["restartAgent"] = True
restartAgent = MagicMock(name="restartAgent")
self.controller.restartAgent = restartAgent
self.controller.heartbeatWithServer()
@@ -564,7 +564,7 @@ class TestController(unittest.TestCase):
self.controller.responseId = 1
self.controller.DEBUG_STOP_HEARTBEATING = False
actionQueue.isIdle.return_value = False
- response["restartAgent"] = "false"
+ response["restartAgent"] = False
self.controller.heartbeatWithServer()
diff --git a/ambari-agent/src/test/python/ambari_agent/TestProcessUtils.py b/ambari-agent/src/test/python/ambari_agent/TestProcessUtils.py
deleted file mode 100644
index 8331910..0000000
--- a/ambari-agent/src/test/python/ambari_agent/TestProcessUtils.py
+++ /dev/null
@@ -1,224 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-'''
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-'''
-
-from ambari_agent import main
-
-main.MEMORY_LEAK_DEBUG_FILEPATH = "/tmp/memory_leak_debug.out"
-import unittest
-import signal
-import subprocess, time
-from mock.mock import patch, MagicMock, PropertyMock, call
-from ambari_commons import process_utils
-
-process_tree = {"111": "222\n 22",
- "222": "333\n 33",
- "22": "44\n 444",}
-
-
-class TestProcessUtils(unittest.TestCase):
- @patch("subprocess.Popen")
- def test_kill(self, popen_mock):
- process_mock = MagicMock()
- process_mock.communicate.return_value = (None, None)
- returncode_mock = PropertyMock()
- returncode_mock.return_value = 0
- type(process_mock).returncode = returncode_mock
- popen_mock.return_value = process_mock
- process_utils.kill_pids(["12321113230", "2312415453"], signal.SIGTERM)
- expected = [call(['kill', '-15', '12321113230', '2312415453'], stderr=-1, stdout=-1)]
- self.assertEquals(popen_mock.call_args_list, expected)
-
- @patch("subprocess.Popen")
- def test_get_children(self, popen_mock):
-
- process_mock = MagicMock()
- process_mock.communicate.return_value = ("123 \n \n 321\n", None)
- popen_mock.return_value = process_mock
- returncode_mock = PropertyMock()
- returncode_mock.return_value = 0
- type(process_mock).returncode = returncode_mock
- result = process_utils.get_children("2312415453")
-
- self.assertEquals(result, ["123", "321"])
-
- expected = [
- call(['ps', '-o', 'pid', '--no-headers', '--ppid', '2312415453'], stderr=subprocess.PIPE, stdout=subprocess.PIPE)]
- self.assertEquals(popen_mock.call_args_list, expected)
-
- @patch("subprocess.Popen")
- def test_get_flat_process_tree(self, popen_mock):
- def side_effect(*args, **kwargs):
- process_mock = MagicMock()
- returncode_mock = PropertyMock()
- returncode_mock.return_value = 0
- type(process_mock).returncode = returncode_mock
- if args[0][5] in process_tree.keys():
- process_mock.communicate.return_value = (process_tree[args[0][5]], None)
- else:
- process_mock.communicate.return_value = ("", None)
- return process_mock
-
- popen_mock.side_effect = side_effect
- result = process_utils.get_flat_process_tree("111")
- self.assertEquals(result, ['111', '222', '333', '33', '22', '44', '444'])
-
- expected = [call(['ps', '-o', 'pid', '--no-headers', '--ppid', '111'], stderr=-1, stdout=-1),
- call(['ps', '-o', 'pid', '--no-headers', '--ppid', '222'], stderr=-1, stdout=-1),
- call(['ps', '-o', 'pid', '--no-headers', '--ppid', '333'], stderr=-1, stdout=-1),
- call(['ps', '-o', 'pid', '--no-headers', '--ppid', '33'], stderr=-1, stdout=-1),
- call(['ps', '-o', 'pid', '--no-headers', '--ppid', '22'], stderr=-1, stdout=-1),
- call(['ps', '-o', 'pid', '--no-headers', '--ppid', '44'], stderr=-1, stdout=-1),
- call(['ps', '-o', 'pid', '--no-headers', '--ppid', '444'], stderr=-1, stdout=-1)]
- self.assertEquals(popen_mock.call_args_list, expected)
-
- @patch("subprocess.Popen")
- def test_get_command_by_pid(self, popen_mock):
-
- process_mock = MagicMock()
- process_mock.communicate.return_value = ("yum something", None)
- returncode_mock = PropertyMock()
- returncode_mock.return_value = 0
- type(process_mock).returncode = returncode_mock
- popen_mock.return_value = process_mock
-
- result = process_utils.get_command_by_pid("2312415453")
-
- self.assertEquals(result, "yum something")
-
- expected = [call(['ps', '-p', '2312415453', '-o', 'command', '--no-headers'], stderr=-1, stdout=-1)]
- self.assertEquals(popen_mock.call_args_list, expected)
-
- @patch("subprocess.Popen")
- def test_get_command_by_pid_not_exist(self, popen_mock):
-
- process_mock = MagicMock()
- process_mock.communicate.return_value = ("", None)
- returncode_mock = PropertyMock()
- returncode_mock.return_value = 1
- type(process_mock).returncode = returncode_mock
- popen_mock.return_value = process_mock
-
- result = process_utils.get_command_by_pid("2312415453")
-
- self.assertEquals(result, "NOT_FOUND[2312415453]")
-
- expected = [call(['ps', '-p', '2312415453', '-o', 'command', '--no-headers'], stderr=-1, stdout=-1)]
- self.assertEquals(popen_mock.call_args_list, expected)
-
- @patch("subprocess.Popen")
- def test_is_process_running(self, popen_mock):
-
- process_mock = MagicMock()
- process_mock.communicate.return_value = ("2312415453", None)
- returncode_mock = PropertyMock()
- returncode_mock.return_value = 0
- type(process_mock).returncode = returncode_mock
- popen_mock.return_value = process_mock
-
- result = process_utils.is_process_running("2312415453")
-
- self.assertEquals(result, True)
-
- expected = [call(['ps', '-p', '2312415453', '-o', 'pid', '--no-headers'], stderr=-1, stdout=-1)]
- self.assertEquals(popen_mock.call_args_list, expected)
-
- @patch("subprocess.Popen")
- def test_is_process_not_running(self, popen_mock):
-
- process_mock = MagicMock()
- process_mock.communicate.return_value = ("", None)
- returncode_mock = PropertyMock()
- returncode_mock.return_value = 1
- type(process_mock).returncode = returncode_mock
- popen_mock.return_value = process_mock
-
- result = process_utils.is_process_running("2312415453")
-
- self.assertEquals(result, False)
-
- expected = [call(['ps', '-p', '2312415453', '-o', 'pid', '--no-headers'], stderr=-1, stdout=-1)]
- self.assertEquals(popen_mock.call_args_list, expected)
-
- @patch("subprocess.Popen")
- def test_get_processes_running(self, popen_mock):
- def side_effect(*args, **kwargs):
- process_mock = MagicMock()
- returncode_mock = PropertyMock()
- if args[0][2] == "4321":
- returncode_mock.return_value = 0
- process_mock.communicate.return_value = ("4321", None)
- else:
- returncode_mock.return_value = 1
- process_mock.communicate.return_value = (None, None)
- type(process_mock).returncode = returncode_mock
- return process_mock
-
- popen_mock.side_effect = side_effect
-
- result = process_utils.get_processes_running(["1234", "4321"])
-
- self.assertEquals(result, ["4321"])
-
- expected = [call(['ps', '-p', '1234', '-o', 'pid', '--no-headers'], stderr=-1, stdout=-1),
- call(['ps', '-p', '4321', '-o', 'pid', '--no-headers'], stderr=-1, stdout=-1)]
- self.assertEquals(popen_mock.call_args_list, expected)
-
- @patch("time.sleep")
- @patch("subprocess.Popen")
- def test_wait_for_process_death(self, popen_mock, sleep_mock):
-
- process_mock = MagicMock()
- process_mock.communicate.side_effect = [("4321", None),("4321", None),(None, None)]
- returncode_mock = PropertyMock()
- returncode_mock.side_effect = [0, 0, 1]
- type(process_mock).returncode = returncode_mock
- popen_mock.return_value = process_mock
-
- process_utils.wait_for_process_death("4321")
-
- expected = [call(['ps', '-p', '4321', '-o', 'pid', '--no-headers'], stderr=-1, stdout=-1),
- call(['ps', '-p', '4321', '-o', 'pid', '--no-headers'], stderr=-1, stdout=-1),
- call(['ps', '-p', '4321', '-o', 'pid', '--no-headers'], stderr=-1, stdout=-1)]
- self.assertEquals(popen_mock.call_args_list, expected)
- expected = [call(0.1), call(0.1)]
- self.assertEquals(sleep_mock.call_args_list, expected)
-
- @patch("time.sleep")
- @patch("subprocess.Popen")
- def test_wait_for_entire_process_tree_death(self, popen_mock, sleep_mock):
-
- process_mock = MagicMock()
- process_mock.communicate.side_effect = [("1234", None), (None, None), ("4321", None), ("4321", None), (None, None)]
- returncode_mock = PropertyMock()
- returncode_mock.side_effect = [0, 1, 0, 0, 1]
- type(process_mock).returncode = returncode_mock
- popen_mock.return_value = process_mock
-
- process_utils.wait_for_entire_process_tree_death(["1234", "4321"])
-
- expected = [call(['ps', '-p', '1234', '-o', 'pid', '--no-headers'], stderr=-1, stdout=-1),
- call(['ps', '-p', '1234', '-o', 'pid', '--no-headers'], stderr=-1, stdout=-1),
- call(['ps', '-p', '4321', '-o', 'pid', '--no-headers'], stderr=-1, stdout=-1),
- call(['ps', '-p', '4321', '-o', 'pid', '--no-headers'], stderr=-1, stdout=-1),
- call(['ps', '-p', '4321', '-o', 'pid', '--no-headers'], stderr=-1, stdout=-1)]
- self.assertEquals(popen_mock.call_args_list, expected)
- expected = [call(0.1), call(0.1), call(0.1)]
- self.assertEquals(sleep_mock.call_args_list, expected)
diff --git a/ambari-agent/src/test/python/ambari_agent/TestShell.py b/ambari-agent/src/test/python/ambari_agent/TestShell.py
index 47923bd..0f72020 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestShell.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestShell.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-'''
+"""
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
@@ -9,71 +9,138 @@ regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
-
http://www.apache.org/licenses/LICENSE-2.0
-
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-'''
+"""
+from contextlib import contextmanager
-from ambari_agent import main
-main.MEMORY_LEAK_DEBUG_FILEPATH = "/tmp/memory_leak_debug.out"
-import os
import unittest
-import tempfile
+import signal
from mock.mock import patch, MagicMock, call
-from ambari_agent.AmbariConfig import AmbariConfig
from ambari_commons import shell
-from ambari_commons.shell import shellRunner
-from sys import platform as _platform
-from only_for_platform import not_for_platform, PLATFORM_WINDOWS
-import subprocess, time
+from ambari_commons import OSCheck
+from StringIO import StringIO
+
+ROOT_PID = 10
+ROOT_PID_CHILDREN = [10, 11, 12, 13]
+shell.logger = MagicMock() # suppress any log output
+
+__proc_fs = {
+ "/proc/10/task/10/children": "11 12",
+ "/proc/10/comm": "a",
+ "/proc/10/cmdline": "",
+
+ "/proc/11/task/11/children": "13",
+ "/proc/11/comm": "b",
+ "/proc/11/cmdline": "",
+
+ "/proc/12/task/12/children": "",
+ "/proc/12/comm": "c",
+ "/proc/12/cmdline": "",
+
+ "/proc/13/task/13/children": "",
+ "/proc/13/comm": "d",
+ "/proc/13/cmdline": ""
+}
+
+__proc_fs_yum = {
+ "/proc/10/task/10/children": "11",
+ "/proc/10/comm": "a",
+ "/proc/10/cmdline": "",
+
+ "/proc/11/task/11/children": "",
+ "/proc/11/comm": "yum",
+ "/proc/11/cmdline": "yum install something"
+}
+
+# Remove any wait delay, no need for tests
+__old_waiter = shell.wait_for_process_list_kill
+
+
+def __wait_for_process_list_kill(pids, timeout=5, check_step_time=0.1):
+ return __old_waiter(pids, 0, check_step_time)
+
+
+shell.wait_for_process_list_kill = __wait_for_process_list_kill
+
+
+class FakeSignals(object):
+ SIGTERM = signal.SIG_IGN
+ SIGKILL = signal.SIG_IGN
+
+
+@contextmanager
+def _open_mock(path, open_mode):
+ if path in __proc_fs:
+ yield StringIO(__proc_fs[path])
+ else:
+ yield StringIO("")
+
+
+@contextmanager
+def _open_mock_yum(path, open_mode):
+ if path in __proc_fs:
+ yield StringIO(__proc_fs_yum[path])
+ else:
+ yield StringIO("")
+
-@not_for_platform(PLATFORM_WINDOWS)
class TestShell(unittest.TestCase):
+ @patch("__builtin__.open", new=MagicMock(side_effect=_open_mock))
+ def test_get_all_children(self):
+
+ pid_list = [item[0] for item in shell.get_all_children(ROOT_PID)]
+
+ self.assertEquals(len(ROOT_PID_CHILDREN), len(pid_list))
+ self.assertEquals(ROOT_PID, pid_list[0])
+
+ for i in ROOT_PID_CHILDREN:
+ self.assertEquals(True, i in pid_list)
+
+ @patch("__builtin__.open", new=MagicMock(side_effect=_open_mock))
+ @patch.object(OSCheck, "get_os_family", new=MagicMock(return_value="redhat"))
+ @patch.object(shell, "signal", new_callable=FakeSignals)
+ @patch("os.listdir")
+ @patch("os.kill")
+ def test_kill_process_with_children(self, os_kill_mock, os_list_dir_mock, fake_signals):
+ pid_list = [item[0] for item in shell.get_all_children(ROOT_PID)]
+ pid_list_str = [str(i) for i in ROOT_PID_CHILDREN]
+ reverse_pid_list = sorted(pid_list, reverse=True)
+ os_list_dir_mock.side_effect = [pid_list_str, [], [], []]
+
+ shell.kill_process_with_children(ROOT_PID)
+
+ # test pid kill by SIGTERM
+ os_kill_pids = [item[0][0] for item in os_kill_mock.call_args_list]
+ self.assertEquals(len(os_kill_pids), len(pid_list))
+ self.assertEquals(reverse_pid_list, os_kill_pids)
+
+ os_kill_mock.reset_mock()
+ os_list_dir_mock.reset_mock()
+
+ os_list_dir_mock.side_effect = [pid_list_str, pid_list_str, pid_list_str, pid_list_str, [], []]
+ shell.kill_process_with_children(ROOT_PID)
+
+ # test pid kill by SIGKILL
+ os_kill_pids = [item[0][0] for item in os_kill_mock.call_args_list]
+ self.assertEquals(len(os_kill_pids), len(pid_list)*2)
+ self.assertEquals(reverse_pid_list + reverse_pid_list, os_kill_pids)
+
+ @patch("__builtin__.open", new=MagicMock(side_effect=_open_mock_yum))
+ @patch.object(OSCheck, "get_os_family", new=MagicMock(return_value="redhat"))
+ @patch.object(shell, "signal", new_callable=FakeSignals)
+ @patch("os.listdir")
+ @patch("os.kill")
+ def test_kill_process_with_children_except_yum(self, os_kill_mock, os_list_dir_mock, fake_signals):
+ os_list_dir_mock.side_effect = [["10", "12", "20"], [], [], []]
+ shell.kill_process_with_children(ROOT_PID)
- @patch("os.setuid")
- def test_changeUid(self, os_setUIDMock):
- shell.threadLocal.uid = 9999
- shell.changeUid()
- self.assertTrue(os_setUIDMock.called)
-
-
- @patch("pwd.getpwnam")
- def test_shellRunner_run(self, getpwnamMock):
- sh = shellRunner()
- result = sh.run(['echo'])
- self.assertEquals(result['exitCode'], 0)
- self.assertEquals(result['error'], '')
-
- getpwnamMock.return_value = [os.getuid(), os.getuid(), os.getuid()]
- result = sh.run(['echo'], 'non_exist_user_name')
- self.assertEquals(result['exitCode'], 0)
- self.assertEquals(result['error'], '')
-
- def test_kill_process_with_children(self):
- if _platform == "linux" or _platform == "linux2": # Test is Linux-specific
- sleep_cmd = "sleep 314"
- test_cmd = """ (({0}) & ({0} & {0})) """.format(sleep_cmd)
- # Starting process tree (multiple process groups)
- test_process = subprocess.Popen(test_cmd, stderr=subprocess.PIPE, stdout=subprocess.PIPE, shell=True)
- time.sleep(0.3) # Delay to allow subprocess to start
- # Check if processes are running
- ps_cmd = """ps auxww """
- ps_process = subprocess.Popen(ps_cmd, stderr=subprocess.PIPE, stdout=subprocess.PIPE, shell=True)
- (out, err) = ps_process.communicate()
- self.assertTrue(sleep_cmd in out)
- # Kill test process
- shell.kill_process_with_children(test_process.pid)
- test_process.communicate()
- # Now test process should not be running
- ps_process = subprocess.Popen(ps_cmd, stderr=subprocess.PIPE, stdout=subprocess.PIPE, shell=True)
- (out, err) = ps_process.communicate()
- self.assertFalse(sleep_cmd in out)
- else:
- # Do not run under other systems
- pass
+ # test clean pid by SIGTERM
+ os_kill_pids = [item[0][0] for item in os_kill_mock.call_args_list]
+ self.assertEquals(len(os_kill_pids), 1)
+ self.assertEquals([10], os_kill_pids)
diff --git a/ambari-agent/src/test/python/ambari_agent/examples/ControllerTester.py b/ambari-agent/src/test/python/ambari_agent/examples/ControllerTester.py
index bc46ac6..4a6e781 100644
--- a/ambari-agent/src/test/python/ambari_agent/examples/ControllerTester.py
+++ b/ambari-agent/src/test/python/ambari_agent/examples/ControllerTester.py
@@ -47,7 +47,7 @@ responces = [
"""
{
"responseId":"n",
- "restartAgent": "False",
+ "restartAgent": false,
"executionCommands":
[{
"commandId": "31-1",
@@ -89,7 +89,7 @@ responces = [
"""
{
"responseId":"n",
- "restartAgent": "False",
+ "restartAgent": false,
"executionCommands": [],
"statusCommands":[]
}
@@ -183,7 +183,7 @@ if __name__ == '__main__':
# s = """
# {
# "responseId":"n",
-# "restartAgent": "False",
+# "restartAgent": false,
# "executionCommands":
# [{
# "commandId": "31-1",
diff --git a/ambari-common/src/main/python/ambari_commons/inet_utils.py b/ambari-common/src/main/python/ambari_commons/inet_utils.py
index 5fd3e88..a226235 100644
--- a/ambari-common/src/main/python/ambari_commons/inet_utils.py
+++ b/ambari-common/src/main/python/ambari_commons/inet_utils.py
@@ -23,6 +23,7 @@ import time
import sys
import urllib2
import socket
+import re
from ambari_commons import OSCheck
from functools import wraps
@@ -266,3 +267,48 @@ def ensure_ssl_using_protocol(protocol="PROTOCOL_TLSv1", ca_certs=None):
return context
_create_default_https_context_patched._ambari_patched = True
ssl._create_default_https_context = _create_default_https_context_patched
+
+"""
+See RFC3986, Appendix B
+Tested on the following cases:
+ "192.168.54.1"
+ "192.168.54.2:7661
+ "hdfs://192.168.54.3/foo/bar"
+ "ftp://192.168.54.4:7842/foo/bar"
+
+ Returns None if only a port is passed in
+"""
+def get_host_from_url(uri):
+ if uri is None:
+ return None
+
+ # if not a string, return None
+ if not isinstance(uri, basestring):
+ return None
+
+ # RFC3986, Appendix B
+ parts = re.findall('^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?', uri)
+
+ # index of parts
+ # scheme = 1
+ # authority = 3
+ # path = 4
+ # query = 6
+ # fragment = 8
+
+ host_and_port = uri
+ if 0 == len(parts[0][1]):
+ host_and_port = parts[0][4]
+ elif 0 == len(parts[0][2]):
+ host_and_port = parts[0][1]
+ elif parts[0][2].startswith("//"):
+ host_and_port = parts[0][3]
+
+ if -1 == host_and_port.find(':'):
+ if host_and_port.isdigit():
+ return None
+
+ return host_and_port
+ else:
+ return host_and_port.split(':')[0]
+
diff --git a/ambari-common/src/main/python/ambari_commons/kerberos/__init__.py b/ambari-common/src/main/python/ambari_commons/kerberos/__init__.py
new file mode 100644
index 0000000..3cb6ecf
--- /dev/null
+++ b/ambari-common/src/main/python/ambari_commons/kerberos/__init__.py
@@ -0,0 +1,19 @@
+#!/usr/bin/env python2.6
+
+'''
+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.
+'''
diff --git a/ambari-common/src/main/python/ambari_commons/kerberos/kerberos_common.py b/ambari-common/src/main/python/ambari_commons/kerberos/kerberos_common.py
new file mode 100644
index 0000000..c0ac580
--- /dev/null
+++ b/ambari-common/src/main/python/ambari_commons/kerberos/kerberos_common.py
@@ -0,0 +1,168 @@
+"""
+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.
+
+"""
+
+import base64
+import getpass
+import os
+import stat
+from ambari_agent import Constants
+from collections import namedtuple
+from resource_management.core import sudo
+from resource_management.core.logger import Logger
+from resource_management.core.resources.klist import Klist
+from resource_management.core.resources.system import Directory, File
+from resource_management.core.source import InlineTemplate
+from tempfile import gettempdir
+from .utils import get_property_value
+
+KRB5_REALM_PROPERTIES = [
+ 'kdc',
+ 'admin_server',
+ 'default_domain',
+ 'master_kdc'
+]
+
+
+class MissingKeytabs(object):
+ class Identity(namedtuple('Identity', ['principal', 'keytab_file_path'])):
+ @staticmethod
+ def from_kerberos_record(item, hostname):
+ return MissingKeytabs.Identity(
+ get_property_value(item, 'principal').replace("_HOST", hostname),
+ get_property_value(item, 'keytab_file_path'))
+
+ def __str__(self):
+ return "Keytab: %s Principal: %s" % (self.keytab_file_path, self.principal)
+
+ @classmethod
+ def from_kerberos_records(self, kerberos_record, hostname):
+ with_missing_keytab = (each for each in kerberos_record \
+ if not self.keytab_exists(each) or not self.keytab_has_principal(each, hostname))
+ return MissingKeytabs(
+ set(MissingKeytabs.Identity.from_kerberos_record(each, hostname) for each in with_missing_keytab))
+
+ @staticmethod
+ def keytab_exists(kerberos_record):
+ return sudo.path_exists(get_property_value(kerberos_record, 'keytab_file_path'))
+
+ @staticmethod
+ def keytab_has_principal(kerberos_record, hostname):
+ principal = get_property_value(kerberos_record, 'principal').replace("_HOST", hostname)
+ keytab = get_property_value(kerberos_record, 'keytab_file_path')
+ klist = Klist.find_in_search_path()
+ return principal in klist.list_principals(keytab)
+
+ def __init__(self, items):
+ self.items = items
+
+ def as_dict(self):
+ return [each._asdict() for each in self.items]
+
+ def __str__(self):
+ return "Missing keytabs:\n%s" % ("\n".join(map(str, self.items))) if self.items else 'No missing keytabs'
+
+
+def write_krb5_conf(params):
+ Directory(params.krb5_conf_dir,
+ owner='root',
+ create_parents=True,
+ group='root',
+ mode=0755
+ )
+
+ content = InlineTemplate(params.krb5_conf_template)
+
+ File(params.krb5_conf_path,
+ content=content,
+ owner='root',
+ group='root',
+ mode=0644
+ )
+
+
+def clear_tmp_cache():
+ tmp_dir = Constants.AGENT_TMP_DIR
+ if tmp_dir is None:
+ tmp_dir = gettempdir()
+ curl_krb_cache_path = os.path.join(tmp_dir, "curl_krb_cache")
+ Directory(curl_krb_cache_path, action="delete")
+
+
+def write_keytab_file(params, output_hook=lambda principal, keytab_file_path: None):
+ if params.kerberos_command_params is not None:
+ for item in params.kerberos_command_params:
+ keytab_content_base64 = get_property_value(item, 'keytab_content_base64')
+ if (keytab_content_base64 is not None) and (len(keytab_content_base64) > 0):
+ keytab_file_path = get_property_value(item, 'keytab_file_path')
+ if (keytab_file_path is not None) and (len(keytab_file_path) > 0):
+ head, tail = os.path.split(keytab_file_path)
+ if head:
+ Directory(head, create_parents=True, mode=0755, owner="root", group="root")
+
+ owner = get_property_value(item, 'keytab_file_owner_name')
+ if not owner:
+ owner = getpass.getuser()
+ owner_access = get_property_value(item, 'keytab_file_owner_access')
+ group = get_property_value(item, 'keytab_file_group_name')
+ group_access = get_property_value(item, 'keytab_file_group_access')
+ mode = 0
+
+ if owner_access == 'rw':
+ mode |= stat.S_IREAD | stat.S_IWRITE
+ else:
+ mode |= stat.S_IREAD
+
+ if group_access == 'rw':
+ mode |= stat.S_IRGRP | stat.S_IWGRP
+ elif group_access == 'r':
+ mode |= stat.S_IRGRP
+
+ keytab_content = base64.b64decode(keytab_content_base64)
+
+ # to hide content in command output
+ def make_lambda(data):
+ return lambda: data
+
+ File(keytab_file_path,
+ content=make_lambda(keytab_content),
+ mode=mode,
+ owner=owner,
+ group=group)
+
+ principal = get_property_value(item, 'principal')
+
+ output_hook(principal, keytab_file_path)
+
+
+def delete_keytab_file(params, output_hook=lambda principal, keytab_file_path: None):
+ if params.kerberos_command_params is not None:
+ for item in params.kerberos_command_params:
+ keytab_file_path = get_property_value(item, 'keytab_file_path')
+ if (keytab_file_path is not None) and (len(keytab_file_path) > 0):
+ # Delete the keytab file
+ File(keytab_file_path, action="delete")
+
+ principal = get_property_value(item, 'principal')
+ output_hook(principal, keytab_file_path)
+
+
+def find_missing_keytabs(params, output_hook=lambda missing_keytabs: None):
+ missing_keytabs = MissingKeytabs.from_kerberos_records(params.kerberos_command_params, params.hostname)
+ Logger.info(str(missing_keytabs))
+ output_hook(missing_keytabs.as_dict())
diff --git a/ambari-common/src/main/python/ambari_commons/kerberos/utils.py b/ambari-common/src/main/python/ambari_commons/kerberos/utils.py
new file mode 100644
index 0000000..00b2638
--- /dev/null
+++ b/ambari-common/src/main/python/ambari_commons/kerberos/utils.py
@@ -0,0 +1,109 @@
+"""
+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.
+
+"""
+
+
+def get_property_value(dictionary, property_name, default_value=None, trim_string=False,
+ empty_value=""):
+ """
+ Get a property value from a dictionary, applying applying rules as necessary.
+
+ If dictionary does not contain a value for property_name or the value for property_name is None,
+ null_value is used as the value to return. Then, if trim_string is True and the value is None
+ or the value is an empty string, empty_value will be return else the (current) value is returned.
+
+ Note: the property value will most likely be a string or a unicode string, however in the event
+ it is not (for example a number), this method will behave properly and return the value as is.
+
+ :param dictionary: a dictionary of values
+ :param property_name: the name of a dictionary item to retrieve
+ :param default_value: the value to use if the item is not in the dictionary or the value of the item is None
+ :param trim_string: a Boolean value indicating whether to strip whitespace from the value (True) or not (False)
+ :param empty_value: the value to use if the (current) value is None or an empty string, if trim_string is True
+ :return: the requested property value with rules applied
+ """
+ # If property_name is not in the dictionary, set value to null_value
+ if property_name in dictionary:
+ value = dictionary[property_name]
+ if value is None:
+ value = default_value
+ else:
+ value = default_value
+
+ if trim_string:
+ # If the value is none, consider it empty...
+ if value is None:
+ value = empty_value
+ elif (type(value) == str) or (type(value) == unicode):
+ value = value.strip()
+
+ if len(value) == 0:
+ value = empty_value
+
+ return value
+
+
+def get_unstructured_data(dictionary, property_name):
+ prefix = property_name + '/'
+ prefix_len = len(prefix)
+ return dict((k[prefix_len:], v) for k, v in dictionary.iteritems() if k.startswith(prefix))
+
+
+def split_host_and_port(host):
+ """
+ Splits a string into its host and port components
+
+ :param host: a string matching the following pattern: <host name | ip address>[:port]
+ :return: a Dictionary containing 'host' and 'port' entries for the input value
+ """
+
+ if host is None:
+ host_and_port = None
+ else:
+ host_and_port = {}
+ parts = host.split(":")
+
+ if parts is not None:
+ length = len(parts)
+
+ if length > 0:
+ host_and_port['host'] = parts[0]
+
+ if length > 1:
+ host_and_port['port'] = int(parts[1])
+
+ return host_and_port
+
+
+def set_port(host, port):
+ """
+ Sets the port for a host specification, potentially replacing an existing port declaration
+
+ :param host: a string matching the following pattern: <host name | ip address>[:port]
+ :param port: a string or integer declaring the (new) port
+ :return: a string declaring the new host/port specification
+ """
+ if port is None:
+ return host
+ else:
+ host_and_port = split_host_and_port(host)
+
+ if (host_and_port is not None) and ('host' in host_and_port):
+ return "%s:%s" % (host_and_port['host'], port)
+ else:
+ return host
diff --git a/ambari-common/src/main/python/ambari_commons/os_check.py b/ambari-common/src/main/python/ambari_commons/os_check.py
index 0416584..b2b2274 100644
--- a/ambari-common/src/main/python/ambari_commons/os_check.py
+++ b/ambari-common/src/main/python/ambari_commons/os_check.py
@@ -164,6 +164,8 @@ class OS_CONST_TYPE(type):
class OSConst:
__metaclass__ = OS_CONST_TYPE
+ systemd_redhat_os_major_versions = ["7"]
+
class OSCheck:
diff --git a/ambari-common/src/main/python/ambari_commons/process_utils.py b/ambari-common/src/main/python/ambari_commons/process_utils.py
deleted file mode 100644
index 50ffd02..0000000
--- a/ambari-common/src/main/python/ambari_commons/process_utils.py
+++ /dev/null
@@ -1,100 +0,0 @@
-# !/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.
-'''
-
-import subprocess
-import time
-
-check_time_delay = 0.1 # seconds between checks of process killed
-
-
-def get_children(pid):
- PSCMD = ["ps", "-o", "pid", "--no-headers", "--ppid", str(pid)]
- ps_process = subprocess.Popen(PSCMD, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- stdout, stderr = ps_process.communicate()
- if ps_process.returncode != 0:
- return []
- return stdout.split()
-
-
-def get_flat_process_tree(pid):
- """
- :param pid: process id of parent process
- :return: list of child process pids. Resulting list also includes parent pid
- """
- res = [str(pid)]
- children = get_children(pid)
- for child in children:
- res += get_flat_process_tree(child)
- return res
-
-
-def kill_pids(pids, signal):
- from resource_management.core.exceptions import Fail
- CMD = ["kill", "-" + str(signal)]
- CMD.extend(pids)
- process = subprocess.Popen(CMD, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- stdout, stderr = process.communicate()
- if process.returncode != 0:
- raise Fail("Unable to kill PIDs {0} : {1}".format(str(pids),stderr))
-
-
-def get_command_by_pid(pid):
- CMD = ["ps", "-p", str(pid), "-o", "command", "--no-headers"]
- process = subprocess.Popen(CMD, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- stdout, stderr = process.communicate()
- if process.returncode != 0:
- return "NOT_FOUND[%s]" % pid
- return stdout
-
-
-def wait_for_entire_process_tree_death(pids):
- for child in pids:
- wait_for_process_death(child)
-
-
-def wait_for_process_death(pid, timeout=5):
- start = time.time()
- current_time = start
- while is_process_running(pid) and current_time < start + timeout:
- time.sleep(check_time_delay)
- current_time = time.time()
-
-
-def is_process_running(pid):
- CMD = ["ps", "-p", str(pid), "-o", "pid", "--no-headers"]
- process = subprocess.Popen(CMD, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- stdout, stderr = process.communicate()
- if process.returncode != 0:
- return False
- return pid in stdout
-
-
-
-def get_processes_running(process_pids):
- """
- Checks what processes are still running
- :param process_pids: list of process pids
- :return: list of pids for processes that are still running
- """
- result = []
- for pid in process_pids:
- if is_process_running(pid):
- result.append(pid)
- return result
diff --git a/ambari-common/src/main/python/ambari_commons/shell.py b/ambari-common/src/main/python/ambari_commons/shell.py
index 5b29de0..33756da 100644
--- a/ambari-common/src/main/python/ambari_commons/shell.py
+++ b/ambari-common/src/main/python/ambari_commons/shell.py
@@ -27,8 +27,7 @@ from contextlib import contextmanager
from ambari_commons import OSConst
from ambari_commons.os_family_impl import OsFamilyImpl, OsFamilyFuncImpl
-from ambari_commons.process_utils import get_flat_process_tree, kill_pids, wait_for_entire_process_tree_death, \
- get_processes_running, get_command_by_pid
+from resource_management.core import sudo
logger = logging.getLogger()
@@ -231,35 +230,170 @@ class shellRunnerWindows(shellRunner):
return _dict_to_object({'exitCode': code, 'output': out, 'error': err})
-#linux specific code
-@OsFamilyFuncImpl(os_family=OsFamilyImpl.DEFAULT)
-def kill_process_with_children(parent_pid):
+def get_all_children(base_pid):
"""
- Kills process tree starting from a given pid.
- :param parent_pid: head of tree
- :param graceful_kill_delays: map <command name, custom delay between SIGTERM and SIGKILL>
- :return:
+ Return all child PIDs of base_pid process
+
+ :param base_pid starting PID to scan for children
+ :return tuple of the following: pid, binary name, command line incl. binary
+
+ :type base_pid int
+ :rtype list[(int, str, str)]
"""
+ parent_pid_path_pattern = "/proc/{0}/task/{0}/children"
+ comm_path_pattern = "/proc/{0}/comm"
+ cmdline_path_pattern = "/proc/{0}/cmdline"
+
+ def read_children(pid):
+ try:
+ with open(parent_pid_path_pattern.format(pid), "r") as f:
+ return [int(item) for item in f.readline().strip().split(" ")]
+ except (IOError, ValueError):
+ return []
+
+ def read_command(pid):
+ try:
+ with open(comm_path_pattern.format(pid), "r") as f:
+ return f.readline().strip()
+ except IOError:
+ return ""
+
+ def read_cmdline(pid):
+ try:
+ with open(cmdline_path_pattern.format(pid), "r") as f:
+ return f.readline().strip()
+ except IOError:
+ return ""
+
+ pids = []
+ scan_pending = [int(base_pid)]
+
+ while scan_pending:
+ curr_pid = scan_pending.pop(0)
+ children = read_children(curr_pid)
- pids = get_flat_process_tree(parent_pid)
+ pids.append((curr_pid, read_command(curr_pid), read_cmdline(curr_pid)))
+ scan_pending.extend(children)
+
+ return pids
+
+
+def is_pid_exists(pid):
+ """
+ Check if process with PID still exist (not counting it real state)
+
+ :type pid int
+ :rtype bool
+ """
+ pid_path = "/proc/{0}"
try:
- kill_pids(pids, signal.SIGTERM)
- except Exception, e:
- logger.warn("Failed to kill PID %d" % parent_pid)
- logger.warn("Reported error: " + repr(e))
+ return os.path.exists(pid_path.format(pid))
+ except (OSError, IOError):
+ logger.debug("Failed to check PID existence")
+ return False
+
+
+def get_existing_pids(pids):
+ """
+ Check if process with pid still exists (not counting it real state).
+
+ Optimized to check PID list at once.
+
+ :param pids list of PIDs to filter
+ :return list of still existing PID
- wait_for_entire_process_tree_death(pids)
+ :type pids list[int]
+ :rtype list[int]
+ """
+
+ existing_pid_list = []
try:
- running_processes = get_processes_running(pids)
- if running_processes:
- process_names = map(lambda x: get_command_by_pid(x), running_processes)
- logger.warn("These PIDs %s did not die after SIGTERM, sending SIGKILL. Exact commands to be killed:\n %s" %
- (", ".join(running_processes), "\n".join(process_names)))
- kill_pids(running_processes, signal.SIGKILL)
- except Exception, e:
- logger.error("Failed to send SIGKILL to PID %d. Process exited?" % parent_pid)
- logger.error("Reported error: " + repr(e))
+ all_existing_pid_list = [int(item) for item in os.listdir("/proc") if item.isdigit()]
+ except (OSError, IOError):
+ logger.debug("Failed to check PIDs existence")
+ return existing_pid_list
+
+ for pid_item in pids:
+ if pid_item in all_existing_pid_list:
+ existing_pid_list.append(pid_item)
+
+ return existing_pid_list
+
+
+def wait_for_process_list_kill(pids, timeout=5, check_step_time=0.1):
+ """
+ Process tree waiter
+
+ :type pids list[int]
+ :type timeout int|float
+ :type check_step_time int|float
+
+ :param pids list of PIDs to watch
+ :param timeout how long wait till giving up, seconds. Set 0 for nowait or None for infinite time
+ :param check_step_time how often scan for existing PIDs, seconds
+ """
+ from threading import Thread, Event
+ import time
+
+ stop_waiting = Event()
+
+ def _wait_loop():
+ while not stop_waiting.is_set() and get_existing_pids(pids):
+ time.sleep(check_step_time)
+
+ if timeout == 0: # no need for loop if no timeout is set
+ return
+
+ th = Thread(target=_wait_loop)
+ stop_waiting.clear()
+
+ th.start()
+ th.join(timeout=timeout)
+ stop_waiting.set()
+
+ th.join()
+
+
+@OsFamilyFuncImpl(os_family=OsFamilyImpl.DEFAULT)
+def kill_process_with_children(base_pid):
+ """
+ Process tree killer
+
+ :type base_pid int
+ """
+ exception_list = ["apt-get", "apt", "yum", "zypper", "zypp"]
+ signals_to_post = {
+ "SIGTERM": signal.SIGTERM,
+ "SIGKILL": signal.SIGKILL
+ }
+ full_child_pids = get_all_children(base_pid)
+ all_child_pids = [item[0] for item in full_child_pids if item[1].lower() not in exception_list and item[0] != os.getpid()]
+ error_log = []
+
+ for sig_name, sig in signals_to_post.items():
+ # we need to kill processes from the bottom of the tree
+ pids_to_kill = sorted(get_existing_pids(all_child_pids), reverse=True)
+ for pid in pids_to_kill:
+ try:
+ sudo.kill(pid, sig)
+ except OSError as e:
+ error_log.append((sig_name, pid, repr(e)))
+
+ if pids_to_kill:
+ wait_for_process_list_kill(pids_to_kill)
+ still_existing_pids = get_existing_pids(pids_to_kill)
+ if still_existing_pids:
+ logger.warn("These PIDs {0} did not respond to {1} signal. Detailed commands list:\n {2}".format(
+ ", ".join([str(i) for i in still_existing_pids]),
+ sig_name,
+ "\n".join([i[2] for i in full_child_pids if i[0] in still_existing_pids])
+ ))
+
+ if get_existing_pids(all_child_pids) and error_log: # we're unable to kill all requested PIDs
+ logger.warn("Process termination error log:\n")
+ for error_item in error_log:
+ logger.warn("PID: {0}, Process: {1}, Exception message: {2}".format(*error_item))
def _changeUid():
diff --git a/ambari-common/src/main/python/resource_management/core/providers/package/__init__.py b/ambari-common/src/main/python/resource_management/core/providers/package/__init__.py
index fc695a7..f2a375f 100644
--- a/ambari-common/src/main/python/resource_management/core/providers/package/__init__.py
+++ b/ambari-common/src/main/python/resource_management/core/providers/package/__init__.py
@@ -66,6 +66,21 @@ class PackageProvider(Provider):
else:
return self.resource.package_name
+ def check_uncompleted_transactions(self):
+ """
+ Check package manager against uncompleted transactions.
+
+ :rtype bool
+ """
+ return False
+
+ def print_uncompleted_transaction_hint(self):
+ """
+ Print friendly message about they way to fix the issue
+
+ """
+ pass
+
def get_available_packages_in_repos(self, repositories):
"""
Gets all (both installed and available) packages that are available at given repositories.
diff --git a/ambari-common/src/main/python/resource_management/core/providers/package/yumrpm.py b/ambari-common/src/main/python/resource_management/core/providers/package/yumrpm.py
index 367e2af..3742ff6 100644
--- a/ambari-common/src/main/python/resource_management/core/providers/package/yumrpm.py
+++ b/ambari-common/src/main/python/resource_management/core/providers/package/yumrpm.py
@@ -28,6 +28,9 @@ from resource_management.core import shell
from resource_management.core.shell import string_cmd_from_args_list
from resource_management.core.logger import Logger
from resource_management.core.utils import suppress_stdout
+from resource_management.core import sudo
+
+from StringIO import StringIO
import re
import os
@@ -44,10 +47,13 @@ REMOVE_CMD = {
REMOVE_WITHOUT_DEPENDENCIES_CMD = ['rpm', '-e', '--nodeps']
+YUM_LIB_DIR = "/var/lib/yum"
+YUM_TR_PREFIX = "transaction-"
+
YUM_REPO_LOCATION = "/etc/yum.repos.d"
REPO_UPDATE_CMD = ['/usr/bin/yum', 'clean', 'metadata']
-ALL_INSTALLED_PACKAGES_CMD = [AMBARI_SUDO_BINARY, "yum", "list", "installed", "--noplugins"]
-ALL_AVAILABLE_PACKAGES_CMD = [AMBARI_SUDO_BINARY, "yum", "list", "available", "--noplugins"]
+ALL_INSTALLED_PACKAGES_CMD = [AMBARI_SUDO_BINARY, "yum", "list", "installed"]
+ALL_AVAILABLE_PACKAGES_CMD = [AMBARI_SUDO_BINARY, "yum", "list", "available"]
VERIFY_DEPENDENCY_CMD = ['/usr/bin/yum', '-d', '0', '-e', '0', 'check', 'dependencies']
# base command output sample:
@@ -185,7 +191,14 @@ class YumProvider(RPMBasedPackageProvider):
for line in lines[skip_index:]:
items = items + line.strip(' \t\n\r').split()
- for i in range(0, len(items), 3):
+ items_count = len(items)
+
+ for i in range(0, items_count, 3):
+
+ # check if we reach the end
+ if i+3 > items_count:
+ break
+
if '.' in items[i]:
items[i] = items[i][:items[i].rindex('.')]
if items[i + 2].find('@') == 0:
@@ -359,3 +372,105 @@ class YumProvider(RPMBasedPackageProvider):
repo_ids.append(section)
return set(repo_ids)
+
+ def __extract_transaction_id(self, filename):
+ """
+ :type filename str
+ """
+ return filename.split(".", 1)[1]
+
+ def __transaction_file_parser(self, f):
+ """
+ :type f file|BinaryIO|StringIO
+ :rtype collections.Iterable(str)
+ """
+ for line in f:
+ yield line.split(":", 1)[1].strip()
+
+ def uncomplete_transactions(self):
+ """
+ Transactions reader
+
+ :rtype collections.Iterable(YumTransactionItem)
+ """
+ transactions = {}
+
+ prefix_len = len(YUM_TR_PREFIX)
+ for item in sudo.listdir(YUM_LIB_DIR):
+ if YUM_TR_PREFIX == item[:prefix_len]:
+ tr_id = self.__extract_transaction_id(item)
+
+ f = StringIO(sudo.read_file(os.path.join(YUM_LIB_DIR, item)))
+ pkgs_in_transaction = list(self.__transaction_file_parser(f))
+
+ if tr_id not in transactions:
+ transactions[tr_id] = YumTransactionItem(tr_id)
+
+ if RPMTransactions.all in item:
+ transactions[tr_id].pkgs_all = pkgs_in_transaction
+ elif RPMTransactions.done in item:
+ transactions[tr_id].pkgs_done = pkgs_in_transaction
+
+ for tr in transactions.values():
+ if len(tr.pkgs_all) == 0:
+ continue
+
+ if isinstance(tr, YumTransactionItem):
+ yield tr
+
+ def check_uncompleted_transactions(self):
+ """
+ Check package manager against uncompleted transactions.
+
+ :rtype bool
+ """
+
+ transactions = list(self.uncomplete_transactions())
+
+ if len(transactions) > 0:
+ Logger.info("Yum non-completed transactions check failed, found {0} non-completed transaction(s):".format(len(transactions)))
+ for tr in transactions:
+ Logger.info("[{0}] Packages broken: {1}; Packages not-installed {2}".format(
+ tr.transaction_id,
+ ", ".join(tr.pkgs_done),
+ ", ".join(tr.pkgs_aborted)
+ ))
+
+ return True
+
+ Logger.info("Yum non-completed transactions check passed")
+ return False
+
+ def print_uncompleted_transaction_hint(self):
+ """
+ Print friendly message about they way to fix the issue
+
+ """
+ help_msg = """*** Incomplete Yum Transactions ***
+
+Ambari has detected that there are incomplete Yum transactions on this host. This will interfere with the installation process and must be resolved before continuing.
+
+- Identify the pending transactions with the command 'yum history list <packages failed>'
+- Revert each pending transaction with the command 'yum history undo'
+- Flush the transaction log with 'yum-complete-transaction --cleanup-only'
+"""
+
+ for line in help_msg.split("\n"):
+ Logger.error(line)
+
+
+class YumTransactionItem(object):
+ def __init__(self, transaction_id, pkgs_done=None, pkgs_all=None):
+ self.transaction_id = transaction_id
+ self.pkgs_done = pkgs_done if pkgs_done else []
+ self.pkgs_all = pkgs_all if pkgs_all else []
+
+ @property
+ def pkgs_aborted(self):
+ return set(self.pkgs_all) ^ set(self.pkgs_done)
+
+
+class RPMTransactions(object):
+ all = "all"
+ done = "done"
+ aborted = "aborted" # custom one
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/conf_select.py b/ambari-common/src/main/python/resource_management/libraries/functions/conf_select.py
index d38e273..9de2f8f 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/conf_select.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/conf_select.py
@@ -211,6 +211,13 @@ def convert_conf_directories_to_symlinks(package, version, dirs):
# determine which directories would be created, if any are needed
dry_run_directory = create(stack_name, package, version, dry_run = True)
+ # if the dry run reported an error, then we must assume that the package does not exist in
+ # the conf-select tool
+ if len(dry_run_directory) == 0:
+ Logger.info("The conf-select tool reported an error for the package {0}. The configuration linking will be skipped.".format(package))
+ return
+
+
need_dirs = []
for d in dry_run_directory:
if not os.path.exists(d):
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/constants.py b/ambari-common/src/main/python/resource_management/libraries/functions/constants.py
index b811861..212827c 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/constants.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/constants.py
@@ -111,13 +111,14 @@ class StackFeature:
KAFKA_RANGER_PLUGIN_SUPPORT = "kafka_ranger_plugin_support"
YARN_RANGER_PLUGIN_SUPPORT = "yarn_ranger_plugin_support"
RANGER_SOLR_CONFIG_SUPPORT='ranger_solr_config_support'
- HIVE_INTERACTIVE_ATLAS_HOOK_REQUIRED="hive_interactive_atlas_hook_required"
- CORE_SITE_FOR_RANGER_PLUGINS_SUPPORT='core_site_for_ranger_plugins'
- ATLAS_INSTALL_HOOK_PACKAGE_SUPPORT="atlas_install_hook_package_support"
- ATLAS_HDFS_SITE_ON_NAMENODE_HA='atlas_hdfs_site_on_namenode_ha'
- HIVE_INTERACTIVE_GA_SUPPORT='hive_interactive_ga'
+ HIVE_INTERACTIVE_ATLAS_HOOK_REQUIRED = "hive_interactive_atlas_hook_required"
+ CORE_SITE_FOR_RANGER_PLUGINS_SUPPORT = 'core_site_for_ranger_plugins'
+ ATLAS_INSTALL_HOOK_PACKAGE_SUPPORT = "atlas_install_hook_package_support"
+ ATLAS_HDFS_SITE_ON_NAMENODE_HA = 'atlas_hdfs_site_on_namenode_ha'
+ HIVE_INTERACTIVE_GA_SUPPORT = 'hive_interactive_ga'
SECURE_RANGER_SSL_PASSWORD = "secure_ranger_ssl_password"
RANGER_KMS_SSL = "ranger_kms_ssl"
KAFKA_ACL_MIGRATION_SUPPORT = "kafka_acl_migration_support"
ATLAS_CORE_SITE_SUPPORT="atlas_core_site_support"
KAFKA_EXTENDED_SASL_SUPPORT = "kafka_extended_sasl_support"
+ OOZIE_EXTJS_INCLUDED = "oozie_extjs_included"
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/lzo_utils.py b/ambari-common/src/main/python/resource_management/libraries/functions/lzo_utils.py
index d6d987f..c505969 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/lzo_utils.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/lzo_utils.py
@@ -36,9 +36,9 @@ def get_lzo_packages():
lzo_packages = []
script_instance = Script.get_instance()
if OSCheck.is_suse_family() and int(OSCheck.get_os_major_version()) >= 12:
- lzo_packages += ["liblzo2-2", "hadoop-lzo-native"]
+ lzo_packages += ["liblzo2-2"]
elif OSCheck.is_redhat_family() or OSCheck.is_suse_family():
- lzo_packages += ["lzo", "hadoop-lzo-native"]
+ lzo_packages += ["lzo"]
elif OSCheck.is_ubuntu_family():
lzo_packages += ["liblzo2-2"]
@@ -51,11 +51,12 @@ def get_lzo_packages():
else:
lzo_packages += [script_instance.format_package_name("hadooplzo_${stack_version}"),
script_instance.format_package_name("hadooplzo_${stack_version}-native")]
- else:
- lzo_packages += ["hadoop-lzo"]
return lzo_packages
+def is_gpl_license_accepted():
+ return default("/hostLevelParams/gpl_license_accepted", False)
+
def should_install_lzo():
"""
Return true if lzo is enabled via core-site.xml and GPL license (required for lzo) is accepted.
@@ -67,8 +68,7 @@ def should_install_lzo():
if not lzo_enabled:
return False
- is_gpl_license_accepted = default("/hostLevelParams/gpl_license_accepted", False)
- if not is_gpl_license_accepted:
+ if not is_gpl_license_accepted():
Logger.warning(INSTALLING_LZO_WITHOUT_GPL)
return False
@@ -81,6 +81,9 @@ def install_lzo_if_needed():
if not should_install_lzo():
return
+ # If user has just accepted GPL license. GPL repository can not yet be present.
+ Script.repository_util.create_repo_files()
+
lzo_packages = get_lzo_packages()
config = Script.get_config()
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/module_version.py b/ambari-common/src/main/python/resource_management/libraries/functions/module_version.py
new file mode 100644
index 0000000..6ec4ba3
--- /dev/null
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/module_version.py
@@ -0,0 +1,158 @@
+"""
+ 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.
+"""
+
+import re
+
+"""
+ This class should be used to compare module(service) versions.
+ Base method which should be used is parse(..), This method will validate and parse
+ version which you will pass as parameter, and return object of current class with
+ parsed version. Same thing you should do with another version, with which you are
+ planning to compare previous one. After that, use "==", "<", ">" to get final result.
+"""
+class ModuleVersion(object):
+ __module_version_pattern = "(?P<aMajor>[0-9]+).(?P<aMinor>[0-9]+).(?P<iMinor>[0-9]+).(?P<iMaint>[0-9]+)(-h(?P<hotfix>[0-9]+))*-b(?P<build>[0-9]+)"
+ __module_version_regex = re.compile(__module_version_pattern)
+
+ def __init__(self, apache_major, apache_minor, internal_minor, internal_maint, hotfix, build):
+ """
+ :type apache_major int
+ :type apache_minor int
+ :type internal_maint int
+ :type internal_minor int
+ :type hotfix int
+ :type build int
+ """
+ self.__apache_major = int(apache_major)
+ self.__apache_minor = int(apache_minor)
+ self.__internal_maint = int(internal_maint)
+ self.__internal_minor = int(internal_minor)
+ self.__hotfix = int(hotfix) if hotfix else 0 # hotfix is optional group
+ self.__build = int(build)
+
+ def __repr__(self):
+ return "{0}.{1}.{2}.{3}-h{4}-b{5}".format(*self.to_list())
+
+ def to_list(self):
+ """
+ Return version elements as list
+
+ :rtype list
+ """
+ return [
+ self.__apache_major,
+ self.__apache_minor,
+ self.__internal_minor,
+ self.__internal_maint,
+ self.__hotfix,
+ self.__build
+ ]
+
+ def __cmp__(self, other):
+ """
+ :type other ModuleVersion
+
+ :raise TypeError
+ """
+ if other and not isinstance(other, self.__class__):
+ raise TypeError("Operand type is different from {0}".format(self.__class__.__name__))
+
+ r = 0
+ x = self.to_list()
+ y = other.to_list()
+
+ for i in range(0, len(x)):
+ r = x[i] - y[i]
+ if r != 0:
+ break
+
+ return 1 if r > 0 else -1 if r < 0 else 0
+
+ @classmethod
+ def parse(cls, module_version):
+ """
+ Parse string to module version
+
+ :type module_version str
+ :rtype ModuleVersion
+ """
+ matcher = cls.validate(module_version)
+ return ModuleVersion(
+ matcher.group("aMajor"),
+ matcher.group("aMinor"),
+ matcher.group("iMinor"),
+ matcher.group("iMaint"),
+ matcher.group("hotfix"),
+ matcher.group("build")
+ )
+
+ @classmethod
+ def validate(cls, module_version):
+ """
+ Check if provided version is valid. If version is valid will return match object
+ or will raise exception.
+
+ :param module_version version to check
+ :type module_version str
+
+ :rtype __Match[T] | None
+
+ :raise ValueError
+ """
+
+ if not module_version:
+ raise ValueError("Module version can't be empty or null")
+
+ version = module_version.strip()
+
+ if not version:
+ raise ValueError("Module version can't be empty or null")
+
+ matcher = cls.__module_version_regex.match(version)
+
+ if not matcher:
+ raise ValueError("{0} is not a valid {1}".format(version, cls.__name__))
+
+ return matcher
+
+ @property
+ def apache_major(self):
+ return self.__apache_major
+
+ @property
+ def apache_minor(self):
+ return self.__apache_minor
+
+ @property
+ def internal_minor(self):
+ return self.__internal_minor
+
+ @property
+ def internal_maint(self):
+ return self.__internal_maint
+
+ @property
+ def hotfix(self):
+ return self.__hotfix
+
+ @property
+ def build(self):
+ return self.__build
+
+
+
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/mpack_version.py b/ambari-common/src/main/python/resource_management/libraries/functions/mpack_version.py
new file mode 100644
index 0000000..664f9fe
--- /dev/null
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/mpack_version.py
@@ -0,0 +1,207 @@
+"""
+ 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.
+"""
+
+import re
+
+"""
+ This class should be used to compare mpack and stack versions.
+ Base method which should be used is parse/parse_stack_version, depends
+ on which versions you want to compare. This method will validate and parse
+ version which you will pass as parameter, and return object of current class with
+ parsed version. Same thing you should do with another version, with which you are
+ planning to compare previous one. After that, use "==", ">", "<" to get final result.
+"""
+class MpackVersion(object):
+ __mpack_version_pattern = "(?P<major>[0-9]+).(?P<minor>[0-9]+).(?P<maint>[0-9]+)(-h(?P<hotfix>[0-9]+))*-b(?P<build>[0-9]+)"
+ __mpack_legacy_stack_version_pattern = "(?P<major>[0-9]+).(?P<minor>[0-9]+).(?P<maint>[0-9]+).(?P<hotfix>[0-9]+)(-(?P<build>[0-9]+))"
+ __mpack_version_regex = re.compile(__mpack_version_pattern)
+ __mpack_legacy_stack_version_regex = re.compile(__mpack_legacy_stack_version_pattern)
+
+ def __init__(self, major, minor, maint, hotfix, build):
+ """
+ :type major int
+ :type minor int
+ :type maint int
+ :type hotfix int
+ :type build int
+ """
+ self.__major = int(major)
+ self.__minor = int(minor)
+ self.__maint = int(maint)
+ self.__hotfix = int(hotfix) if hotfix else 0 # hotfix is optional group
+ self.__build = int(build)
+
+ def __repr__(self):
+ return "{0}.{1}.{2}-h{3}-b{4}".format(*self.to_list())
+
+ def to_list(self):
+ """
+ Return version elements as list
+
+ :rtype list
+ """
+ return [
+ self.__major,
+ self.__minor,
+ self.__maint,
+ self.__hotfix,
+ self.__build
+ ]
+
+ def __cmp__(self, other):
+ """
+ :type other MpackVersion
+
+ :raise TypeError
+ """
+ if other and not isinstance(other, self.__class__):
+ raise TypeError("Operand type is different from {0}".format(self.__class__.__name__))
+
+ r = 0
+ x = self.to_list()
+ y = other.to_list()
+
+ for i in range(0, len(x)):
+ r = x[i] - y[i]
+ if r != 0:
+ break
+
+ return 1 if r > 0 else -1 if r < 0 else 0
+
+ @classmethod
+ def parse(cls, mpack_version):
+ """
+ Parse string to mpack version
+
+ :type mpack_version str
+ :rtype MpackVersion
+ """
+ matcher = cls.validate(mpack_version)
+ return MpackVersion(
+ matcher.group("major"),
+ matcher.group("minor"),
+ matcher.group("maint"),
+ matcher.group("hotfix"),
+ matcher.group("build")
+ )
+
+
+ @classmethod
+ def parse_stack_version(cls, stack_version):
+ """
+ Parse string to mpack version
+
+ :type stack_version str
+ :rtype MpackVersion
+ """
+ matcher = cls.validate_stack_version(stack_version)
+ return MpackVersion(
+ matcher.group("major"),
+ matcher.group("minor"),
+ matcher.group("maint"),
+ matcher.group("hotfix"),
+ matcher.group("build")
+ )
+
+
+ @classmethod
+ def validate_stack_version(cls, stack_version):
+ """
+ Check if provided version is valid. If version is valid will return match object
+ or will raise exception.
+
+ :param stack_version version to check
+ :type stack_version str
+
+ :rtype __Match[T] | None
+
+ :raise ValueError
+ """
+
+ if not stack_version:
+ raise ValueError("Module version can't be empty or null")
+
+ version = stack_version.strip()
+
+ if not version:
+ raise ValueError("Module version can't be empty or null")
+
+ matcher = cls.__mpack_version_regex.match(version)
+
+ if not matcher:
+ matcher = cls.__mpack_legacy_stack_version_regex.match(version)
+ if not matcher:
+ raise ValueError("{0} is not a valid {1}".format(version, cls.__name__))
+ else:
+ if not matcher.group("hotfix"):
+ raise ValueError("{0} is not a valid {1}".format(version, cls.__name__))
+
+ return matcher
+
+
+ @classmethod
+ def validate(cls, mpack_version):
+ """
+ Check if provided version is valid. If version is valid will return match object
+ or will raise exception.
+
+ :param module_version version to check
+ :type module_version str
+
+ :rtype __Match[T] | None
+
+ :raise ValueError
+ """
+
+ if not mpack_version:
+ raise ValueError("Module version can't be empty or null")
+
+ version = mpack_version.strip()
+
+ if not version:
+ raise ValueError("Module version can't be empty or null")
+
+ matcher = cls.__mpack_version_regex.match(version)
+
+ if not matcher:
+ raise ValueError("{0} is not a valid {1}".format(version, cls.__name__))
+
+ return matcher
+
+ @property
+ def major(self):
+ return self.__major
+
+ @property
+ def minor(self):
+ return self.__minor
+
+ @property
+ def maint(self):
+ return self.__maint
+
+ @property
+ def hotfix(self):
+ return self.__hotfix
+
+ @property
+ def build(self):
+ return self.__build
+
+
+
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/namenode_ha_utils.py b/ambari-common/src/main/python/resource_management/libraries/functions/namenode_ha_utils.py
index 8a2ff25..7a2635f 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/namenode_ha_utils.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/namenode_ha_utils.py
@@ -239,11 +239,13 @@ def get_nameservice(hdfs_site):
"""
name_service = hdfs_site.get('dfs.internal.nameservices', None)
if not name_service:
- import re
name_service = hdfs_site.get('dfs.nameservices', None)
- if name_service:
- for ns in name_service.split(","):
- if 'dfs.namenode.shared.edits.dir' in hdfs_site and re.match(r'.*%s$' % ns, hdfs_site['dfs.namenode.shared.edits.dir']): # better would be core_site['fs.defaultFS'] but it's not available
- return ns
- return name_service.split(",")[0] # default to return the first nameservice
+
+ if name_service and ',' in name_service:
+ import re
+ for ns in name_service.split(","):
+ if 'dfs.namenode.shared.edits.dir' in hdfs_site and re.match(r'.*%s$' % ns, hdfs_site['dfs.namenode.shared.edits.dir']): # better would be core_site['fs.defaultFS'] but it's not available
+ return ns
+ return name_service.split(",")[0] # default to return the first nameservice
+
return name_service
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/repository_util.py b/ambari-common/src/main/python/resource_management/libraries/functions/repository_util.py
index ef54f40..7faa33f 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/repository_util.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/repository_util.py
@@ -17,61 +17,83 @@ limitations under the License.
"""
+from ambari_commons.os_check import OSCheck
from resource_management.core.exceptions import Fail
from resource_management.core.logger import Logger
from resource_management.libraries.resources.repository import Repository
+from resource_management.libraries.functions.is_empty import is_empty
import ambari_simplejson as json
-__all__ = ["create_repo_files", "CommandRepository"]
+__all__ = ["RepositoryUtil", "CommandRepository"]
# components_lits = repoName + postfix
UBUNTU_REPO_COMPONENTS_POSTFIX = "main"
+class RepositoryUtil:
+ def __init__(self, config, tags_to_skip):
+ self.tags_to_skip = tags_to_skip
-def create_repo_files(template, command_repository):
- """
- Creates repositories in a consistent manner for all types
- :param command_repository: a CommandRepository instance
- :type command_repository CommandRepository
- :return: a dictionary with repo ID => repo file name mapping
- """
+ # repo templates
+ repo_file = config['repositoryFile']
+ repo_rhel_suse = config['configurations']['cluster-env']['repo_suse_rhel_template']
+ repo_ubuntu = config['configurations']['cluster-env']['repo_ubuntu_template']
- if command_repository.version_id is None:
- raise Fail("The command repository was not parsed correctly")
+ if is_empty(repo_file):
+ return
- if 0 == len(command_repository.items):
- Logger.warning(
- "Repository for {0}/{1} has no repositories. Ambari may not be managing this version.".format(
- command_repository.stack_name, command_repository.version_string))
- return {}
+ self.template = repo_rhel_suse if OSCheck.is_redhat_family() or OSCheck.is_suse_family() else repo_ubuntu
+ self.command_repository = CommandRepository(repo_file)
- append_to_file = False # initialize to False to create the file anew.
- repo_files = {}
-
- for repository in command_repository.items:
-
- if repository.repo_id is None:
- raise Fail("Repository with url {0} has no id".format(repository.base_url))
+ def create_repo_files(self):
+ """
+ Creates repositories in a consistent manner for all types
+ :return: a dictionary with repo ID => repo file name mapping
+ """
+ if self.command_repository.version_id is None:
+ raise Fail("The command repository was not parsed correctly")
- if not repository.ambari_managed:
+ if 0 == len(self.command_repository.items):
Logger.warning(
- "Repository for {0}/{1}/{2} is not managed by Ambari".format(
- command_repository.stack_name, command_repository.version_string, repository.repo_id))
- else:
- Repository(repository.repo_id,
- action="create",
- base_url=repository.base_url,
- mirror_list=repository.mirrors_list,
- repo_file_name=command_repository.repo_filename,
- repo_template=template,
- components=repository.ubuntu_components,
- append_to_file=append_to_file)
- append_to_file = True
- repo_files[repository.repo_id] = command_repository.repo_filename
-
- return repo_files
+ "Repository for {0}/{1} has no repositories. Ambari may not be managing this version.".format(
+ self.command_repository.stack_name, self.command_repository.version_string))
+ return {}
+
+ append_to_file = False # initialize to False to create the file anew.
+ repo_files = {}
+ for repository in self.command_repository.items:
+ if repository.repo_id is None:
+ raise Fail("Repository with url {0} has no id".format(repository.base_url))
+
+ if self.tags_to_skip & repository.tags:
+ Logger.info("Repository with url {0} is not created due to its tags: {1}".format(repository.base_url, repository.tags))
+ continue
+
+ if not repository.ambari_managed:
+ Logger.warning(
+ "Repository for {0}/{1}/{2} is not managed by Ambari".format(
+ self.command_repository.stack_name, self.command_repository.version_string, repository.repo_id))
+ else:
+ Repository(repository.repo_id,
+ action="create",
+ base_url=repository.base_url,
+ mirror_list=repository.mirrors_list,
+ repo_file_name=self.command_repository.repo_filename,
+ repo_template=self.template,
+ components=repository.ubuntu_components,
+ append_to_file=append_to_file)
+ append_to_file = True
+ repo_files[repository.repo_id] = self.command_repository.repo_filename
+
+ return repo_files
+def create_repo_files(template, command_repository):
+ """
+ DEPRECATED. Is present for usage by old mpacks.
+ Please use Script.repository_util.create_repo_files() instead.
+ """
+ from resource_management.libraries.script import Script
+ return RepositoryUtil(Script.get_config(), set()).create_repo_files()
def _find_value(dictionary, key, default=None):
"""
@@ -146,6 +168,7 @@ class CommandRepositoryItem(object):
self.components = _find_value(json_dict, 'components')
self.base_url = _find_value(json_dict, 'baseUrl')
self.mirrors_list = _find_value(json_dict, 'mirrorsList')
+ self.tags = set(_find_value(json_dict, 'tags', default=[]))
self.ambari_managed = _find_value(json_dict, 'ambariManaged', default=True)
self.ubuntu_components = [self.distribution if self.distribution else self.repo_name] + \
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/setup_atlas_hook.py b/ambari-common/src/main/python/resource_management/libraries/functions/setup_atlas_hook.py
index 367afc8..985eb37 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/setup_atlas_hook.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/setup_atlas_hook.py
@@ -162,14 +162,9 @@ def setup_atlas_jar_symlinks(hook_name, jar_source_dir):
import params
stack_root = Script.get_stack_root()
- atlas_home_dir = os.path.join(stack_root, "current", "atlas-server")
-
- # if this is an upgrade/downagrade, then we must link in the correct version
- # which may not be "current", so change the home directory location
- upgrade_type = Script.get_upgrade_type(default("/commandParams/upgrade_type", ""))
- if upgrade_type is not None:
- version_dir_segment = stack_features.get_stack_feature_version(Script.get_config())
- atlas_home_dir = os.path.join(stack_root, version_dir_segment, "atlas")
+ atlas_component_name = "atlas"
+ stack_version = stack_features.get_stack_feature_version(Script.get_config())
+ atlas_home_dir = os.path.join(stack_root, stack_version, atlas_component_name)
# Will only exist if this host contains Atlas Server
atlas_hook_dir = os.path.join(atlas_home_dir, "hook", hook_name)
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/setup_ranger_plugin_xml.py b/ambari-common/src/main/python/resource_management/libraries/functions/setup_ranger_plugin_xml.py
index 485c1a6..78692cb 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/setup_ranger_plugin_xml.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/setup_ranger_plugin_xml.py
@@ -240,14 +240,14 @@ def setup_ranger_plugin_keystore(service_name, audit_db_is_enabled, stack_versio
mode = 0640
)
-def setup_core_site_for_required_plugins(component_user, component_group, create_core_site_path, config):
+def setup_core_site_for_required_plugins(component_user, component_group, create_core_site_path, configurations = {}, configuration_attributes = {}):
XmlConfig('core-site.xml',
- conf_dir=create_core_site_path,
- configurations=config['configurations']['core-site'],
- configuration_attributes=config['configuration_attributes']['core-site'],
- owner=component_user,
- group=component_group,
- mode=0644
+ conf_dir = create_core_site_path,
+ configurations = configurations,
+ configuration_attributes = configuration_attributes,
+ owner = component_user,
+ group = component_group,
+ mode = 0644
)
def get_audit_configs(config):
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/solr_cloud_util.py b/ambari-common/src/main/python/resource_management/libraries/functions/solr_cloud_util.py
index 12356ed..b92c77e 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/solr_cloud_util.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/solr_cloud_util.py
@@ -32,9 +32,11 @@ from resource_management.core.logger import Logger
__all__ = ["upload_configuration_to_zk", "create_collection", "setup_kerberos", "set_cluster_prop",
"setup_kerberos_plugin", "create_znode", "check_znode", "secure_solr_znode", "secure_znode"]
-def __create_solr_cloud_cli_prefix(zookeeper_quorum, solr_znode, java64_home, separated_znode=False):
+def __create_solr_cloud_cli_prefix(zookeeper_quorum, solr_znode, java64_home, java_opts=None, separated_znode=False):
sudo = AMBARI_SUDO_BINARY
- solr_cli_prefix = format('{sudo} JAVA_HOME={java64_home} /usr/lib/ambari-infra-solr-client/solrCloudCli.sh ' \
+
+ infra_solr_cli_opts= format(' INFRA_SOLR_CLI_OPTS="{java_opts}"') if java_opts is not None else ''
+ solr_cli_prefix = format('{sudo} JAVA_HOME={java64_home}{infra_solr_cli_opts} /usr/lib/ambari-infra-solr-client/solrCloudCli.sh ' \
'--zookeeper-connect-string {zookeeper_quorum}')
if separated_znode:
solr_cli_prefix+=format(' --znode {solr_znode}')
@@ -49,7 +51,7 @@ def __append_flags_if_exists(command, flagsDict):
return command
def upload_configuration_to_zk(zookeeper_quorum, solr_znode, config_set, config_set_dir, tmp_dir,
- java64_home, retry = 5, interval = 10, solrconfig_content = None, jaas_file=None):
+ java64_home, retry = 5, interval = 10, solrconfig_content = None, jaas_file=None, java_opts=None):
"""
Upload configuration set to zookeeper with solrCloudCli.sh
At first, it tries to download configuration set if exists into a temporary location, then upload that one to
@@ -57,7 +59,7 @@ def upload_configuration_to_zk(zookeeper_quorum, solr_znode, config_set, config_
"""
random_num = random.random()
tmp_config_set_dir = format('{tmp_dir}/solr_config_{config_set}_{random_num}')
- solr_cli_prefix = __create_solr_cloud_cli_prefix(zookeeper_quorum, solr_znode, java64_home)
+ solr_cli_prefix = __create_solr_cloud_cli_prefix(zookeeper_quorum, solr_znode, java64_home, java_opts)
Execute(format('{solr_cli_prefix} --download-config --config-dir {tmp_config_set_dir} --config-set {config_set} --retry {retry} --interval {interval}'),
only_if=format("{solr_cli_prefix} --check-config --config-set {config_set} --retry {retry} --interval {interval}"))
appendableDict = {}
@@ -88,7 +90,7 @@ def create_collection(zookeeper_quorum, solr_znode, collection, config_set, java
shards = 1, replication_factor = 1, max_shards = 1, retry = 5, interval = 10,
router_name = None, router_field = None, jaas_file = None, key_store_location = None,
key_store_password = None, key_store_type = None, trust_store_location = None,
- trust_store_password = None, trust_store_type = None):
+ trust_store_password = None, trust_store_type = None, java_opts=None):
"""
Create Solr collection based on a configuration set in zookeeper.
If this method called again the with higher shard number (or max_shard number), then it will indicate
@@ -98,7 +100,7 @@ def create_collection(zookeeper_quorum, solr_znode, collection, config_set, java
If you would like to add shards later to a collection, then use implicit routing, e.g.:
router_name = "implicit", router_field = "_router_field_"
"""
- solr_cli_prefix = __create_solr_cloud_cli_prefix(zookeeper_quorum, solr_znode, java64_home)
+ solr_cli_prefix = __create_solr_cloud_cli_prefix(zookeeper_quorum, solr_znode, java64_home, java_opts)
if max_shards == 1: # if max shards is not specified use this strategy
max_shards = replication_factor * shards
@@ -121,59 +123,59 @@ def create_collection(zookeeper_quorum, solr_znode, collection, config_set, java
Execute(create_collection_cmd)
-def setup_kerberos(zookeeper_quorum, solr_znode, copy_from_znode, java64_home, secure=False, jaas_file=None):
+def setup_kerberos(zookeeper_quorum, solr_znode, copy_from_znode, java64_home, secure=False, jaas_file=None, java_opts=None):
"""
Copy all unsecured (or secured) Znode content to a secured (or unsecured) Znode,
and restrict the world permissions there.
"""
- solr_cli_prefix = __create_solr_cloud_cli_prefix(zookeeper_quorum, solr_znode, java64_home, True)
+ solr_cli_prefix = __create_solr_cloud_cli_prefix(zookeeper_quorum, solr_znode, java64_home, java_opts, True)
setup_kerberos_cmd = format('{solr_cli_prefix} --setup-kerberos --copy-from-znode {copy_from_znode}')
if secure and jaas_file is not None:
setup_kerberos_cmd+=format(' --secure --jaas-file {jaas_file}')
Execute(setup_kerberos_cmd)
-def check_znode(zookeeper_quorum, solr_znode, java64_home, retry = 5, interval = 10):
+def check_znode(zookeeper_quorum, solr_znode, java64_home, retry = 5, interval = 10, java_opts=None):
"""
Check znode exists or not, throws exception if does not accessible.
"""
- solr_cli_prefix = __create_solr_cloud_cli_prefix(zookeeper_quorum, solr_znode, java64_home, True)
+ solr_cli_prefix = __create_solr_cloud_cli_prefix(zookeeper_quorum, solr_znode, java64_home, java_opts, True)
check_znode_cmd = format('{solr_cli_prefix} --check-znode --retry {retry} --interval {interval}')
Execute(check_znode_cmd)
-def create_znode(zookeeper_quorum, solr_znode, java64_home, retry = 5 , interval = 10):
+def create_znode(zookeeper_quorum, solr_znode, java64_home, retry = 5 , interval = 10, java_opts=None):
"""
Create znode if does not exists, throws exception if zookeeper is not accessible.
"""
- solr_cli_prefix = __create_solr_cloud_cli_prefix(zookeeper_quorum, solr_znode, java64_home, True)
+ solr_cli_prefix = __create_solr_cloud_cli_prefix(zookeeper_quorum, solr_znode, java64_home, java_opts, True)
create_znode_cmd = format('{solr_cli_prefix} --create-znode --retry {retry} --interval {interval}')
Execute(create_znode_cmd)
-def setup_kerberos_plugin(zookeeper_quorum, solr_znode, java64_home, secure=False, security_json_location = None, jaas_file = None):
+def setup_kerberos_plugin(zookeeper_quorum, solr_znode, java64_home, secure=False, security_json_location = None, jaas_file = None, java_opts=None):
"""
Set Kerberos plugin on the Solr znode in security.json, if secure is False, then clear the security.json
"""
- solr_cli_prefix = __create_solr_cloud_cli_prefix(zookeeper_quorum, solr_znode, java64_home, True)
+ solr_cli_prefix = __create_solr_cloud_cli_prefix(zookeeper_quorum, solr_znode, java64_home, java_opts, True)
setup_kerberos_plugin_cmd = format('{solr_cli_prefix} --setup-kerberos-plugin')
if secure and jaas_file is not None and security_json_location is not None:
setup_kerberos_plugin_cmd+=format(' --jaas-file {jaas_file} --secure --security-json-location {security_json_location}')
Execute(setup_kerberos_plugin_cmd)
-def set_cluster_prop(zookeeper_quorum, solr_znode, prop_name, prop_value, java64_home, jaas_file = None):
+def set_cluster_prop(zookeeper_quorum, solr_znode, prop_name, prop_value, java64_home, jaas_file = None, java_opts=None):
"""
Set a cluster property on the Solr znode in clusterprops.json
"""
- solr_cli_prefix = __create_solr_cloud_cli_prefix(zookeeper_quorum, solr_znode, java64_home)
+ solr_cli_prefix = __create_solr_cloud_cli_prefix(zookeeper_quorum, solr_znode, java64_home, java_opts)
set_cluster_prop_cmd = format('{solr_cli_prefix} --cluster-prop --property-name {prop_name} --property-value {prop_value}')
if jaas_file is not None:
set_cluster_prop_cmd+=format(' --jaas-file {jaas_file}')
Execute(set_cluster_prop_cmd)
-def secure_znode(config, zookeeper_quorum, solr_znode, jaas_file, java64_home, sasl_users=[], retry = 5 , interval = 10):
+def secure_znode(config, zookeeper_quorum, solr_znode, jaas_file, java64_home, sasl_users=[], retry = 5 , interval = 10, java_opts=None):
"""
Secure znode, set a list of sasl users acl to 'cdrwa', and set acl to 'r' only for the world.
Add infra-solr user by default if its available.
"""
- solr_cli_prefix = __create_solr_cloud_cli_prefix(zookeeper_quorum, solr_znode, java64_home, True)
+ solr_cli_prefix = __create_solr_cloud_cli_prefix(zookeeper_quorum, solr_znode, java64_home, java_opts, True)
if "infra-solr-env" in config['configurations']:
sasl_users.append(__get_name_from_principal(config['configurations']['infra-solr-env']['infra_solr_kerberos_principal']))
sasl_users_str = ",".join(str(__get_name_from_principal(x)) for x in sasl_users)
@@ -181,20 +183,20 @@ def secure_znode(config, zookeeper_quorum, solr_znode, jaas_file, java64_home, s
Execute(secure_znode_cmd)
-def secure_solr_znode(zookeeper_quorum, solr_znode, jaas_file, java64_home, sasl_users_str=''):
+def secure_solr_znode(zookeeper_quorum, solr_znode, jaas_file, java64_home, sasl_users_str='', java_opts=None):
"""
Secure solr znode - setup acls to 'cdrwa' for solr user, set 'r' only for the world, skipping /znode/configs and znode/collections (set those to 'cr' for the world)
sasl_users_str: comma separated sasl users
"""
- solr_cli_prefix = __create_solr_cloud_cli_prefix(zookeeper_quorum, solr_znode, java64_home, True)
+ solr_cli_prefix = __create_solr_cloud_cli_prefix(zookeeper_quorum, solr_znode, java64_home, java_opts, True)
secure_solr_znode_cmd = format('{solr_cli_prefix} --secure-solr-znode --jaas-file {jaas_file} --sasl-users {sasl_users_str}')
Execute(secure_solr_znode_cmd)
-def remove_admin_handlers(zookeeper_quorum, solr_znode, java64_home, collection, jaas_file, retry = 5, interval = 10):
+def remove_admin_handlers(zookeeper_quorum, solr_znode, java64_home, collection, jaas_file, retry = 5, interval = 10, java_opts=None):
"""
Remove "solr.admin.AdminHandlers" request handler from collection config. Required for migrating to Solr 6 from Solr 5.
"""
- solr_cli_prefix = __create_solr_cloud_cli_prefix(zookeeper_quorum, solr_znode, java64_home)
+ solr_cli_prefix = __create_solr_cloud_cli_prefix(zookeeper_quorum, solr_znode, java64_home, java_opts)
remove_admin_handlers_cmd = format('{solr_cli_prefix} --remove-admin-handlers --collection {collection} --retry {retry} --interval {interval}')
if jaas_file is not None:
remove_admin_handlers_cmd+=format(' --jaas-file {jaas_file}')
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/tar_archive.py b/ambari-common/src/main/python/resource_management/libraries/functions/tar_archive.py
index 7976587..372a894 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/tar_archive.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/tar_archive.py
@@ -25,7 +25,7 @@ from contextlib import closing
from resource_management.core.resources.system import Execute
def archive_dir(output_filename, input_dir):
- Execute(('tar', '-zcvf', output_filename, input_dir),
+ Execute(('tar', '-zcf', output_filename, '-C', input_dir, '.'),
sudo = True,
tries = 3,
try_sleep = 1,
@@ -40,7 +40,7 @@ def archive_directory_dereference(archive, directory):
:return: None
"""
- Execute(('tar', '-zcvhf', archive, directory),
+ Execute(('tar', '-zchf', archive, '-C', directory, '.'),
sudo = True,
tries = 3,
try_sleep = 1,
diff --git a/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py b/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py
index 0c45719..0028e84 100644
--- a/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py
+++ b/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py
@@ -204,6 +204,8 @@ class WebHDFSUtil:
depending on if query was successful or not, we can assert this for them
"""
target = HdfsResourceProvider.parse_path(target)
+ if not target:
+ raise Fail("Target cannot be empty")
url = format("{address}/webhdfs/v1{target}?op={operation}", address=self.address)
request_args = kwargs
diff --git a/ambari-common/src/main/python/resource_management/libraries/script/script.py b/ambari-common/src/main/python/resource_management/libraries/script/script.py
index 88e5336..1faaf51 100644
--- a/ambari-common/src/main/python/resource_management/libraries/script/script.py
+++ b/ambari-common/src/main/python/resource_management/libraries/script/script.py
@@ -53,7 +53,7 @@ from resource_management.libraries.functions.version import format_stack_version
from resource_management.libraries.functions import stack_tools
from resource_management.libraries.functions.constants import Direction
from resource_management.libraries.script.config_dictionary import ConfigDictionary, UnknownConfiguration
-from resource_management.libraries.functions.repository_util import CommandRepository
+from resource_management.libraries.functions.repository_util import CommandRepository, RepositoryUtil
from resource_management.core.resources.system import Execute
from contextlib import closing
from resource_management.libraries.functions.stack_features import check_stack_feature
@@ -356,6 +356,14 @@ class Script(object):
Logger.logger.exception("Can not read json file with command parameters: ")
sys.exit(1)
+ from resource_management.libraries.functions import lzo_utils
+
+ repo_tags_to_skip = set()
+ if not lzo_utils.is_gpl_license_accepted():
+ repo_tags_to_skip.add("GPL")
+
+ Script.repository_util = RepositoryUtil(Script.config, repo_tags_to_skip)
+
# Run class method depending on a command type
try:
method = self.choose_method_to_execute(self.command_name)
diff --git a/ambari-funtest/src/test/resources/stacks/HDP/2.0.6.1/services/FLUME/metainfo.xml b/ambari-funtest/src/test/resources/stacks/HDP/2.0.6.1/services/FLUME/metainfo.xml
index 4f6bbd9..efe535f 100644
--- a/ambari-funtest/src/test/resources/stacks/HDP/2.0.6.1/services/FLUME/metainfo.xml
+++ b/ambari-funtest/src/test/resources/stacks/HDP/2.0.6.1/services/FLUME/metainfo.xml
@@ -55,7 +55,10 @@
</commandScript>
<requiredServices>
- <service>HDFS</service>
+ <service>
+ <name>HDFS</name>
+ <dependencyType>INSTALL</dependencyType>
+ </service>
</requiredServices>
<configuration-dependencies>
diff --git a/ambari-funtest/src/test/resources/stacks/HDP/2.0.6/services/FLUME/metainfo.xml b/ambari-funtest/src/test/resources/stacks/HDP/2.0.6/services/FLUME/metainfo.xml
index 4f6bbd9..efe535f 100644
--- a/ambari-funtest/src/test/resources/stacks/HDP/2.0.6/services/FLUME/metainfo.xml
+++ b/ambari-funtest/src/test/resources/stacks/HDP/2.0.6/services/FLUME/metainfo.xml
@@ -55,7 +55,10 @@
</commandScript>
<requiredServices>
- <service>HDFS</service>
+ <service>
+ <name>HDFS</name>
+ <dependencyType>INSTALL</dependencyType>
+ </service>
</requiredServices>
<configuration-dependencies>
diff --git a/ambari-funtest/src/test/resources/stacks/HDP/2.0.7/services/HBASE/metainfo.xml b/ambari-funtest/src/test/resources/stacks/HDP/2.0.7/services/HBASE/metainfo.xml
index acd3556..589d8d9 100644
--- a/ambari-funtest/src/test/resources/stacks/HDP/2.0.7/services/HBASE/metainfo.xml
+++ b/ambari-funtest/src/test/resources/stacks/HDP/2.0.7/services/HBASE/metainfo.xml
@@ -118,8 +118,14 @@
<timeout>50</timeout>
</commandScript>
<requiredServices>
- <service>HDFS</service>
- <service>TEZ</service>
+ <service>
+ <name>HDFS</name>
+ <dependencyType>INSTALL</dependencyType>
+ </service>
+ <service>
+ <name>TEZ</name>
+ <dependencyType>INSTALL</dependencyType>
+ </service>
</requiredServices>
<configuration-dependencies>
<config-type>global</config-type>
diff --git a/ambari-funtest/src/test/resources/stacks/HDP/2.1.1/services/AMBARI_METRICS/metainfo.xml b/ambari-funtest/src/test/resources/stacks/HDP/2.1.1/services/AMBARI_METRICS/metainfo.xml
index fe3b860..044784c 100644
--- a/ambari-funtest/src/test/resources/stacks/HDP/2.1.1/services/AMBARI_METRICS/metainfo.xml
+++ b/ambari-funtest/src/test/resources/stacks/HDP/2.1.1/services/AMBARI_METRICS/metainfo.xml
@@ -116,7 +116,10 @@
</commandScript>
<requiredServices>
- <service>ZOOKEEPER</service>
+ <service>
+ <name>ZOOKEEPER</name>
+ <dependencyType>INSTALL</dependencyType>
+ </service>
</requiredServices>
<configuration-dependencies>
diff --git a/ambari-infra/ambari-infra-assembly/pom.xml b/ambari-infra/ambari-infra-assembly/pom.xml
index bf0e679..41fa573 100644
--- a/ambari-infra/ambari-infra-assembly/pom.xml
+++ b/ambari-infra/ambari-infra-assembly/pom.xml
@@ -25,7 +25,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ambari-infra-assembly</artifactId>
- <name>Ambari Infra Solr Assembly</name>
+ <name>Ambari Infra Assembly</name>
<url>http://maven.apache.org</url>
<properties>
@@ -41,7 +41,7 @@
<infra-manager.package.name>ambari-infra-manager</infra-manager.package.name>
<infra-manager.dir>${project.basedir}/../ambari-infra-manager</infra-manager.dir>
<infra-manager.mapping.path>${mapping.base.path}/${infra-manager.package.name}</infra-manager.mapping.path>
- <infra-manager.conf.mapping.path>/etc/${infra-manager.package.name}/conf</infra-manager.conf.mapping.path>
+ <infra-manager.conf.mapping.path>${infra-manager.mapping.path}/conf</infra-manager.conf.mapping.path>
</properties>
<profiles>
@@ -142,30 +142,16 @@
<scriptFile>${project.basedir}/src/main/package/rpm/manager/postinstall.sh</scriptFile>
<fileEncoding>utf-8</fileEncoding>
</postinstallScriptlet>
+ <postremoveScriptlet>
+ <scriptFile>${project.basedir}/src/main/package/rpm/manager/postremove.sh</scriptFile>
+ <fileEncoding>utf-8</fileEncoding>
+ </postremoveScriptlet>
<mappings>
<mapping>
<directory>${infra-manager.mapping.path}</directory>
<sources>
<source>
<location>${infra-manager.dir}/target/package</location>
- <excludes>
- <exclude>log4j.xml</exclude>
- <exclude>infra-manager.properties</exclude>
- <exclude>infra-manager-env.sh</exclude>
- </excludes>
- </source>
- </sources>
- </mapping>
- <mapping>
- <directory>${infra-manager.conf.mapping.path}</directory>
- <sources>
- <source>
- <location>${infra-manager.dir}/target/package</location>
- <includes>
- <include>log4j.xml</include>
- <include>infra-manager.properties</include>
- <include>infra-manager-env.sh</include>
- </includes>
</source>
</sources>
</mapping>
@@ -354,23 +340,6 @@
<group>root</group>
<prefix>${infra-manager.mapping.path}</prefix>
</mapper>
- <excludes>
- log4j.xml,infra-manager.properties,infra-manager-env.sh
- </excludes>
- </data>
- <data>
- <src>${infra-manager.dir}/target/package</src>
- <type>directory</type>
- <mapper>
- <prefix>${infra-manager.conf.mapping.path}</prefix>
- <type>perm</type>
- <user>root</user>
- <group>root</group>
- <filemode>644</filemode>
- </mapper>
- <includes>
- log4j.xml,infra-manager.properties,infra-manager-env.sh
- </includes>
</data>
</dataSet>
</configuration>
diff --git a/ambari-infra/ambari-infra-assembly/src/main/package/deb/manager/postinst b/ambari-infra/ambari-infra-assembly/src/main/package/deb/manager/postinst
index c8d6ecd..acce62d 100644
--- a/ambari-infra/ambari-infra-assembly/src/main/package/deb/manager/postinst
+++ b/ambari-infra/ambari-infra-assembly/src/main/package/deb/manager/postinst
@@ -15,6 +15,13 @@
# limitations under the License
INFRA_MANAGER_LINK_NAME="/usr/bin/infra-manager"
-INFRA_MANAGER_SOURCE="/usr/lib/ambari-infra-manager/infraManager.sh"
+INFRA_MANAGER_SOURCE="/usr/lib/ambari-infra-manager/bin/infraManager.sh"
+INFRA_MANAGER_CONF_LINK_DIR="/etc/ambari-infra-manager"
+INFRA_MANAGER_CONF_LINK_NAME="$INFRA_MANAGER_CONF_LINK_DIR/conf"
+INFRA_MANAGER_CONF_SOURCE="/usr/lib/ambari-infra-manager/conf"
rm -f $INFRA_MANAGER_LINK_NAME ; ln -s $INFRA_MANAGER_SOURCE $INFRA_MANAGER_LINK_NAME
+rm -f $INFRA_MANAGER_CONF_LINK_NAME
+rm -rf $INFRA_MANAGER_CONF_LINK_DIR
+mkdir -p $INFRA_MANAGER_CONF_LINK_DIR
+ln -s $INFRA_MANAGER_CONF_SOURCE $INFRA_MANAGER_CONF_LINK_NAME
diff --git a/ambari-infra/ambari-infra-assembly/src/main/package/deb/manager/postrm b/ambari-infra/ambari-infra-assembly/src/main/package/deb/manager/postrm
index 21a01fa..e62abc6 100644
--- a/ambari-infra/ambari-infra-assembly/src/main/package/deb/manager/postrm
+++ b/ambari-infra/ambari-infra-assembly/src/main/package/deb/manager/postrm
@@ -13,3 +13,11 @@
# 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
+
+INFRA_MANAGER_CONF_LINK_DIR="/etc/ambari-infra-manager"
+INFRA_MANAGER_CONF_LINK_NAME="$INFRA_MANAGER_CONF_LINK_DIR/conf"
+INFRA_MANAGER_LINK_NAME="/usr/bin/infra-manager"
+
+rm -f $INFRA_MANAGER_LINK_NAME
+rm -f $INFRA_MANAGER_CONF_LINK_NAME
+rm -rf $INFRA_MANAGER_CONF_LINK_DIR
\ No newline at end of file
diff --git a/ambari-infra/ambari-infra-assembly/src/main/package/rpm/manager/postinstall.sh b/ambari-infra/ambari-infra-assembly/src/main/package/rpm/manager/postinstall.sh
index 48a3998..acce62d 100644
--- a/ambari-infra/ambari-infra-assembly/src/main/package/rpm/manager/postinstall.sh
+++ b/ambari-infra/ambari-infra-assembly/src/main/package/rpm/manager/postinstall.sh
@@ -15,6 +15,13 @@
# limitations under the License
INFRA_MANAGER_LINK_NAME="/usr/bin/infra-manager"
-INFRA_MANAGER_SOURCE="/usr/lib/ambari-infra-manager/infraManager.sh"
+INFRA_MANAGER_SOURCE="/usr/lib/ambari-infra-manager/bin/infraManager.sh"
+INFRA_MANAGER_CONF_LINK_DIR="/etc/ambari-infra-manager"
+INFRA_MANAGER_CONF_LINK_NAME="$INFRA_MANAGER_CONF_LINK_DIR/conf"
+INFRA_MANAGER_CONF_SOURCE="/usr/lib/ambari-infra-manager/conf"
-rm -f $INFRA_MANAGER_LINK_NAME ; ln -s $INFRA_MANAGER_SOURCE $INFRA_MANAGER_LINK_NAME
\ No newline at end of file
+rm -f $INFRA_MANAGER_LINK_NAME ; ln -s $INFRA_MANAGER_SOURCE $INFRA_MANAGER_LINK_NAME
+rm -f $INFRA_MANAGER_CONF_LINK_NAME
+rm -rf $INFRA_MANAGER_CONF_LINK_DIR
+mkdir -p $INFRA_MANAGER_CONF_LINK_DIR
+ln -s $INFRA_MANAGER_CONF_SOURCE $INFRA_MANAGER_CONF_LINK_NAME
diff --git a/ambari-infra/ambari-infra-assembly/src/main/package/rpm/manager/postremove.sh b/ambari-infra/ambari-infra-assembly/src/main/package/rpm/manager/postremove.sh
new file mode 100644
index 0000000..e62abc6
--- /dev/null
+++ b/ambari-infra/ambari-infra-assembly/src/main/package/rpm/manager/postremove.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+# 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
+
+INFRA_MANAGER_CONF_LINK_DIR="/etc/ambari-infra-manager"
+INFRA_MANAGER_CONF_LINK_NAME="$INFRA_MANAGER_CONF_LINK_DIR/conf"
+INFRA_MANAGER_LINK_NAME="/usr/bin/infra-manager"
+
+rm -f $INFRA_MANAGER_LINK_NAME
+rm -f $INFRA_MANAGER_CONF_LINK_NAME
+rm -rf $INFRA_MANAGER_CONF_LINK_DIR
\ No newline at end of file
diff --git a/ambari-infra/ambari-infra-manager-it/pom.xml b/ambari-infra/ambari-infra-manager-it/pom.xml
new file mode 100644
index 0000000..6dcb4b6
--- /dev/null
+++ b/ambari-infra/ambari-infra-manager-it/pom.xml
@@ -0,0 +1,167 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <parent>
+ <artifactId>ambari-infra</artifactId>
+ <groupId>org.apache.ambari</groupId>
+ <version>2.0.0.0-SNAPSHOT</version>
+ </parent>
+
+ <name>Ambari Infra Manager Integration Tests</name>
+ <url>http://maven.apache.org</url>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>ambari-infra-manager-it</artifactId>
+
+ <properties>
+ <jbehave.version>4.0.5</jbehave.version>
+ <failsafe-plugin.version>2.20</failsafe-plugin.version>
+ <docker.host>localhost</docker.host>
+ <stories.location>NONE</stories.location>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.solr</groupId>
+ <artifactId>solr-solrj</artifactId>
+ <version>${solr.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.amazonaws</groupId>
+ <artifactId>aws-java-sdk-s3</artifactId>
+ <version>1.11.5</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.5</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.7.20</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.7.20</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jbehave</groupId>
+ <artifactId>jbehave-core</artifactId>
+ <version>${jbehave.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.easymock</groupId>
+ <artifactId>easymock</artifactId>
+ <version>3.4</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-all</artifactId>
+ <version>1.3</version>
+ <scope>test</scope>
+ </dependency>
+ <!-- Hadoop -->
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-common</artifactId>
+ <version>${hadoop.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-hdfs-client</artifactId>
+ <version>${hadoop.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <testOutputDirectory>target/classes</testOutputDirectory>
+ <testResources>
+ <testResource>
+ <directory>src/test/java/</directory>
+ <includes>
+ <include>**/*.story</include>
+ </includes>
+ </testResource>
+ <testResource>
+ <directory>src/test/resources</directory>
+ </testResource>
+ </testResources>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>it</id>
+ <activation>
+ <property>
+ <name>it</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <version>${failsafe-plugin.version}</version>
+ <executions>
+ <execution>
+ <id>run-integration-tests</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>integration-test</goal>
+ </goals>
+ <configuration>
+ <includes>
+ <include>**/*Stories.java</include>
+ </includes>
+ <systemPropertyVariables>
+ <log4j.configuration>file:${project.build.testOutputDirectory}/log4j.properties</log4j.configuration>
+ <docker.host>${docker.host}</docker.host>
+ <backend.stories.location>${stories.location}</backend.stories.location>
+ </systemPropertyVariables>
+ </configuration>
+ </execution>
+ <execution>
+ <id>verify-integration-tests</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
... 319216 lines suppressed ...
--
To stop receiving notification emails like this one, please contact
ishanbha@apache.org.