You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by rl...@apache.org on 2017/12/01 21:40:37 UTC

[01/29] ambari git commit: AMBARI-22554. UI should pass repo_name for repository validation (vsubramanian)

Repository: ambari
Updated Branches:
  refs/heads/branch-feature-AMBARI-20859 44ed90e21 -> b6cf4325e


AMBARI-22554. UI should pass repo_name for repository validation (vsubramanian)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ca174fb3
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ca174fb3
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ca174fb3

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: ca174fb32a0e34582776b0607b6a2d14dc72c20d
Parents: 323ce7a
Author: Vivek Ratnavel Subramanian <vi...@gmail.com>
Authored: Wed Nov 29 16:22:20 2017 -0800
Committer: Vivek Ratnavel Subramanian <vi...@gmail.com>
Committed: Wed Nov 29 16:22:20 2017 -0800

----------------------------------------------------------------------
 .../main/resources/ui/admin-web/app/scripts/services/Stack.js   | 3 ++-
 ambari-web/app/controllers/installer.js                         | 5 ++++-
 2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ca174fb3/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js
----------------------------------------------------------------------
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 90f4f48..f52e687 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
@@ -405,7 +405,8 @@ angular.module('ambariAdminConsole')
               $http.post(url + '/operating_systems/' + os.OperatingSystems.os_type + '/repositories/' + repo.Repositories.repo_id + '?validate_only=true',
                 {
                   "Repositories": {
-                    "base_url": repo.Repositories.base_url
+                    "base_url": repo.Repositories.base_url,
+                    "repo_name": repo.Repositories.repo_name
                   }
                 },
                 {

http://git-wip-us.apache.org/repos/asf/ambari/blob/ca174fb3/ambari-web/app/controllers/installer.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/installer.js b/ambari-web/app/controllers/installer.js
index d6be78d..f49fc11 100644
--- a/ambari-web/app/controllers/installer.js
+++ b/ambari-web/app/controllers/installer.js
@@ -315,7 +315,9 @@ App.InstallerController = App.WizardController.extend(App.Persist, {
       App.Repository.find().findProperty('id', repo.id).set('baseUrl', repo.base_url);
     });
     _oses.forEach(function (os) {
-      App.OperatingSystem.find().findProperty('id', os.id).set('isSelected', os.is_selected);
+      if (App.OperatingSystem.find().findProperty('id', os.id)) {
+        App.OperatingSystem.find().findProperty('id', os.id).set('isSelected', os.is_selected);
+      }
     });
     //should delete the record on going to step 2, on going back to step 1, still need the record
     if (App.router.get('currentState.name') != "step1") {
@@ -863,6 +865,7 @@ App.InstallerController = App.WizardController.extend(App.Persist, {
                   data: {
                     'Repositories': {
                       'base_url': repo.get('baseUrl'),
+                      'repo_name': repo.get('repoName'),
                       "verify_base_url": verifyBaseUrl
                     }
                   }


[24/29] ambari git commit: AMBARI-22536 - Remove Deprecated Non-Versioned LZO Packages from LZO Install (jonathanhurley)

Posted by rl...@apache.org.
AMBARI-22536 - Remove Deprecated Non-Versioned LZO Packages from LZO Install (jonathanhurley)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a873684b
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a873684b
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a873684b

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: a873684b829e60352b47df003cbf217e10712c6d
Parents: da8f54e
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Tue Nov 28 16:22:00 2017 -0500
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Fri Dec 1 09:05:08 2017 -0500

----------------------------------------------------------------------
 .../resource_management/libraries/functions/lzo_utils.py       | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a873684b/ambari-common/src/main/python/resource_management/libraries/functions/lzo_utils.py
----------------------------------------------------------------------
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..68ee607 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,8 +51,6 @@ 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
 


[18/29] ambari git commit: AMBARI-22565. Repository validation fails for HDP-GPL. (mpapirkovskyy)

Posted by rl...@apache.org.
AMBARI-22565. Repository validation fails for HDP-GPL. (mpapirkovskyy)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/58868f7f
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/58868f7f
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/58868f7f

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 58868f7f3352b501466c8087c68cfd420bf83abf
Parents: 195195f
Author: Myroslav Papirkovskyi <mp...@hortonworks.com>
Authored: Thu Nov 30 17:51:00 2017 +0200
Committer: Myroslav Papirkovskyi <mp...@hortonworks.com>
Committed: Thu Nov 30 22:35:35 2017 +0200

----------------------------------------------------------------------
 .../AmbariManagementControllerImpl.java         |  6 ++++--
 .../server/controller/RepositoryRequest.java    | 22 ++++++++++++++++++--
 .../internal/RepositoryResourceProvider.java    |  3 ++-
 .../AmbariManagementControllerImplTest.java     |  7 +------
 .../AmbariManagementControllerTest.java         |  7 ++++---
 5 files changed, 31 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/58868f7f/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
index 455814a..da206c6 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
@@ -4522,8 +4522,10 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
     URLStreamProvider usp = new URLStreamProvider(REPO_URL_CONNECT_TIMEOUT, REPO_URL_READ_TIMEOUT, null, null, null);
     usp.setSetupTruststoreForHttps(false);
 
-    RepositoryInfo repositoryInfo = ambariMetaInfo.getRepository(request.getStackName(), request.getStackVersion(), request.getOsType(), request.getRepoId());
-    String repoName = repositoryInfo.getRepoName();
+    String repoName = request.getRepoName();
+    if (StringUtils.isEmpty(repoName)) {
+      throw new IllegalArgumentException("repo_name is required to verify repository");
+    }
 
     String errorMessage = null;
     Exception e = null;

http://git-wip-us.apache.org/repos/asf/ambari/blob/58868f7f/ambari-server/src/main/java/org/apache/ambari/server/controller/RepositoryRequest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/RepositoryRequest.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/RepositoryRequest.java
index 30790ab..1f6ab5b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/RepositoryRequest.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/RepositoryRequest.java
@@ -25,10 +25,12 @@ public class RepositoryRequest extends OperatingSystemRequest {
   private String mirrorsList;
   private boolean verify = true;
   private Long clusterVersionId = null;
+  private String repoName = null;
 
-  public RepositoryRequest(String stackName, String stackVersion, String osType, String repoId) {
+  public RepositoryRequest(String stackName, String stackVersion, String osType, String repoId, String repoName) {
     super(stackName, stackVersion, osType);
     setRepoId(repoId);
+    setRepoName(repoName);
   }
 
   public String getRepoId() {
@@ -85,15 +87,31 @@ public class RepositoryRequest extends OperatingSystemRequest {
     return clusterVersionId;
   }
 
+  /**
+   * @return name of the repository (without version identifier)
+   */
+  public String getRepoName() {
+    return repoName;
+  }
+
+  /**
+   * @param repoName name of the repository (without version identifier)
+   */
+  public void setRepoName(String repoName) {
+    this.repoName = repoName;
+  }
+
   @Override
   public String toString() {
     return "RepositoryRequest [repoId=" + repoId + ", baseUrl=" + baseUrl
         + ", verify=" + verify + ", getOsType()=" + getOsType()
         + ", getRepositoryVersionId()=" + getRepositoryVersionId()
         + ", getStackVersion()=" + getStackVersion() + ", getStackName()="
-        + getStackName() + "]";
+        + getStackName() + ", getRepoName()=" + getRepoName() + "]";
   }
 
+
+
   /**
    * Gets the mirrors list for the repo.
    *

http://git-wip-us.apache.org/repos/asf/ambari/blob/58868f7f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryResourceProvider.java
index a2c3c49..edec1ee 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryResourceProvider.java
@@ -226,7 +226,8 @@ public class RepositoryResourceProvider extends AbstractControllerResourceProvid
         (String) properties.get(REPOSITORY_STACK_NAME_PROPERTY_ID),
         (String) properties.get(REPOSITORY_STACK_VERSION_PROPERTY_ID),
         (String) properties.get(REPOSITORY_OS_TYPE_PROPERTY_ID),
-        (String) properties.get(REPOSITORY_REPO_ID_PROPERTY_ID));
+        (String) properties.get(REPOSITORY_REPO_ID_PROPERTY_ID),
+        (String) properties.get(REPOSITORY_REPO_NAME_PROPERTY_ID));
 
     if (properties.containsKey(REPOSITORY_REPOSITORY_VERSION_ID_PROPERTY_ID)) {
       request.setRepositoryVersionId(Long.parseLong(properties.get(REPOSITORY_REPOSITORY_VERSION_ID_PROPERTY_ID).toString()));

http://git-wip-us.apache.org/repos/asf/ambari/blob/58868f7f/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java
index b774436..d1f235f 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java
@@ -2253,11 +2253,6 @@ public class AmbariManagementControllerImplTest {
     expect(injector.getInstance(MaintenanceStateHelper.class)).andReturn(null);
     expect(injector.getInstance(KerberosHelper.class)).andReturn(createNiceMock(KerberosHelper.class));
 
-    RepositoryInfo dummyRepoInfo = new RepositoryInfo();
-    dummyRepoInfo.setRepoName("repo_name");
-
-    expect(ambariMetaInfo.getRepository("stackName", "stackVersion", "redhat6", "repoId")).andReturn(dummyRepoInfo);
-
     Configuration configuration = createNiceMock(Configuration.class);
     String[] suffices = {"/repodata/repomd.xml"};
     expect(configuration.getRepoValidationSuffixes("redhat6")).andReturn(suffices);
@@ -2276,7 +2271,7 @@ public class AmbariManagementControllerImplTest {
     f.set(controller, configuration);
 
     Set<RepositoryRequest> requests = new HashSet<>();
-    RepositoryRequest request = new RepositoryRequest("stackName", "stackVersion", "redhat6", "repoId");
+    RepositoryRequest request = new RepositoryRequest("stackName", "stackVersion", "redhat6", "repoId", "repo_name");
     request.setBaseUrl("file:///some/repo");
     requests.add(request);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/58868f7f/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
index e76ecb9..a1f28f1 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
@@ -189,6 +189,7 @@ public class AmbariManagementControllerTest {
   private static final String NEW_STACK_VERSION = "2.0.6";
   private static final String OS_TYPE = "centos5";
   private static final String REPO_ID = "HDP-1.1.1.16";
+  private static final String REPO_NAME = "HDP";
   private static final String PROPERTY_NAME = "hbase.regionserver.msginterval";
   private static final String SERVICE_NAME = "HDFS";
   private static final String FAKE_SERVICE_NAME = "FAKENAGIOS";
@@ -7002,11 +7003,11 @@ public class AmbariManagementControllerTest {
   @Test
   public void testGetRepositories() throws Exception {
 
-    RepositoryRequest request = new RepositoryRequest(STACK_NAME, STACK_VERSION, OS_TYPE, null);
+    RepositoryRequest request = new RepositoryRequest(STACK_NAME, STACK_VERSION, OS_TYPE, null, REPO_NAME);
     Set<RepositoryResponse> responses = controller.getRepositories(Collections.singleton(request));
     Assert.assertEquals(REPOS_CNT, responses.size());
 
-    RepositoryRequest requestWithParams = new RepositoryRequest(STACK_NAME, STACK_VERSION, OS_TYPE, REPO_ID);
+    RepositoryRequest requestWithParams = new RepositoryRequest(STACK_NAME, STACK_VERSION, OS_TYPE, REPO_ID, REPO_NAME);
     requestWithParams.setClusterVersionId(525L);
     Set<RepositoryResponse> responsesWithParams = controller.getRepositories(Collections.singleton(requestWithParams));
     Assert.assertEquals(1, responsesWithParams.size());
@@ -7015,7 +7016,7 @@ public class AmbariManagementControllerTest {
       Assert.assertEquals(525L, responseWithParams.getClusterVersionId().longValue());
     }
 
-    RepositoryRequest invalidRequest = new RepositoryRequest(STACK_NAME, STACK_VERSION, OS_TYPE, NON_EXT_VALUE);
+    RepositoryRequest invalidRequest = new RepositoryRequest(STACK_NAME, STACK_VERSION, OS_TYPE, NON_EXT_VALUE, REPO_NAME);
     try {
       controller.getRepositories(Collections.singleton(invalidRequest));
     } catch (StackAccessException e) {


[04/29] ambari git commit: AMBARI-22479 After removing force_delete_components option hosts are not deleted (dsen)

Posted by rl...@apache.org.
AMBARI-22479 After removing force_delete_components option hosts are not deleted (dsen)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1f7bd75e
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1f7bd75e
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1f7bd75e

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 1f7bd75e0e8514539ca27fe53b7a39a01a11c285
Parents: 19e6518
Author: Dmytro Sen <ds...@apache.org>
Authored: Thu Nov 30 10:45:18 2017 +0200
Committer: Dmytro Sen <ds...@apache.org>
Committed: Thu Nov 30 10:45:18 2017 +0200

----------------------------------------------------------------------
 .../AmbariManagementControllerImpl.java         |  9 ----
 .../internal/HostResourceProvider.java          | 54 ++++++--------------
 .../AmbariManagementControllerTest.java         | 42 +++++----------
 .../internal/HostResourceProviderTest.java      |  6 +--
 4 files changed, 30 insertions(+), 81 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/1f7bd75e/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
index 3d09154..455814a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
@@ -3477,15 +3477,6 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
               + ", hostname=" + request.getHostname()
               + ", request=" + request);
     }
-
-    // Only allow removing master/slave components in DISABLED/UNKNOWN/INSTALL_FAILED/INIT state without stages
-    // generation.
-    // Clients may be removed without a state check.
-    if (!component.isClientComponent() &&
-            !componentHost.getState().isRemovableState()) {
-      throw new AmbariException("To remove master or slave components they must be in " +
-              "DISABLED/INIT/INSTALLED/INSTALL_FAILED/UNKNOWN state. Current=" + componentHost.getState() + ".");
-    }
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f7bd75e/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java
index 2b18eb2..5c740f1 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java
@@ -62,7 +62,6 @@ import org.apache.ambari.server.state.DesiredConfig;
 import org.apache.ambari.server.state.Host;
 import org.apache.ambari.server.state.MaintenanceState;
 import org.apache.ambari.server.state.ServiceComponentHost;
-import org.apache.ambari.server.state.State;
 import org.apache.ambari.server.state.stack.OsFamily;
 import org.apache.ambari.server.topology.ClusterTopology;
 import org.apache.ambari.server.topology.InvalidTopologyException;
@@ -146,9 +145,6 @@ public class HostResourceProvider extends AbstractControllerResourceProvider {
 
   //todo use the same json structure for cluster host addition (cluster template and upscale)
 
-  protected static final String FORCE_DELETE_COMPONENTS = "force_delete_components";
-
-
   private static final Set<String> PK_PROPERTY_IDS = ImmutableSet.of(HOST_HOST_NAME_PROPERTY_ID);
 
   @Inject
@@ -320,8 +316,6 @@ public class HostResourceProvider extends AbstractControllerResourceProvider {
 
     final Set<HostRequest> requests = new HashSet<>();
     Map<String, String> requestInfoProperties = request.getRequestInfoProperties();
-    final boolean forceDelete = requestInfoProperties.containsKey(FORCE_DELETE_COMPONENTS) &&
-                  requestInfoProperties.get(FORCE_DELETE_COMPONENTS).equals("true");
 
     for (Map<String, Object> propertyMap : getPropertyMaps(predicate)) {
       requests.add(getRequest(propertyMap));
@@ -330,7 +324,7 @@ public class HostResourceProvider extends AbstractControllerResourceProvider {
     DeleteStatusMetaData deleteStatusMetaData = modifyResources(new Command<DeleteStatusMetaData>() {
       @Override
       public DeleteStatusMetaData invoke() throws AmbariException {
-        return deleteHosts(requests, request.isDryRunRequest(), forceDelete);
+        return deleteHosts(requests, request.isDryRunRequest());
       }
     });
 
@@ -848,7 +842,7 @@ public class HostResourceProvider extends AbstractControllerResourceProvider {
   }
 
   @Transactional
-  protected DeleteStatusMetaData deleteHosts(Set<HostRequest> requests, boolean dryRun, boolean forceDelete)
+  protected DeleteStatusMetaData deleteHosts(Set<HostRequest> requests, boolean dryRun)
       throws AmbariException {
 
     AmbariManagementController controller = getManagementController();
@@ -863,7 +857,7 @@ public class HostResourceProvider extends AbstractControllerResourceProvider {
       }
 
       try {
-        validateHostInDeleteFriendlyState(hostRequest, clusters, forceDelete);
+        validateHostInDeleteFriendlyState(hostRequest, clusters);
         okToRemove.add(hostRequest);
       } catch (Exception ex) {
         deleteStatusMetaData.addException(hostName, ex);
@@ -964,7 +958,7 @@ public class HostResourceProvider extends AbstractControllerResourceProvider {
     clusters.publishHostsDeletion(allClustersWithHosts, hostNames);
   }
 
-  private void validateHostInDeleteFriendlyState(HostRequest hostRequest, Clusters clusters, boolean forceDelete) throws AmbariException {
+  private void validateHostInDeleteFriendlyState(HostRequest hostRequest, Clusters clusters) throws AmbariException {
     Set<String> clusterNamesForHost = new HashSet<>();
     String hostName = hostRequest.getHostname();
     if (null != hostRequest.getClusterName()) {
@@ -984,43 +978,25 @@ public class HostResourceProvider extends AbstractControllerResourceProvider {
       List<ServiceComponentHost> list = cluster.getServiceComponentHosts(hostName);
 
       if (!list.isEmpty()) {
-        List<String> componentsToRemove = new ArrayList<>();
         List<String> componentsStarted = new ArrayList<>();
         for (ServiceComponentHost sch : list) {
-          componentsToRemove.add(sch.getServiceComponentName());
-          if (sch.getState() == State.STARTED) {
+          if (!sch.canBeRemoved()) {
             componentsStarted.add(sch.getServiceComponentName());
           }
         }
 
-        if (forceDelete) {
-          // error if components are running
-          if (!componentsStarted.isEmpty()) {
-            StringBuilder reason = new StringBuilder("Cannot remove host ")
-                .append(hostName)
-                .append(" from ")
-                .append(hostRequest.getClusterName())
-                .append(
-                    ".  The following roles exist, and these components must be stopped: ");
+        // error if components are running
+        if (!componentsStarted.isEmpty()) {
+          StringBuilder reason = new StringBuilder("Cannot remove host ")
+              .append(hostName)
+              .append(" from ")
+              .append(hostRequest.getClusterName())
+              .append(
+                  ".  The following roles exist, and these components are not in the removable state: ");
 
-            reason.append(StringUtils.join(componentsToRemove, ", "));
+          reason.append(StringUtils.join(componentsStarted, ", "));
 
-            throw new AmbariException(reason.toString());
-          }
-        } else {
-//          TODO why host with all components stopped can't be deleted? This functional is implemented and only this validation stops the request.
-          if (!componentsToRemove.isEmpty()) {
-            StringBuilder reason = new StringBuilder("Cannot remove host ")
-                .append(hostName)
-                .append(" from ")
-                .append(hostRequest.getClusterName())
-                .append(
-                    ".  The following roles exist, and these components must be stopped if running, and then deleted: ");
-
-            reason.append(StringUtils.join(componentsToRemove, ", "));
-
-            throw new AmbariException(reason.toString());
-          }
+          throw new AmbariException(reason.toString());
         }
       }
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f7bd75e/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
index f8b6709..e76ecb9 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
@@ -8001,7 +8001,7 @@ public class AmbariManagementControllerTest {
   }
 
   @Test
-  public void testDeleteHostComponentWithForce() throws Exception {
+  public void testDeleteHostWithComponent() throws Exception {
     String cluster1 = getUniqueName();
 
     createCluster(cluster1);
@@ -8045,51 +8045,39 @@ public class AmbariManagementControllerTest {
       cHost.handleEvent(new ServiceComponentHostOpSucceededEvent(cHost.getServiceComponentName(), cHost.getHostName(), System.currentTimeMillis()));
     }
 
-    // Case 1: Attempt delete when components still exist
+    // Case 1: Attempt delete when some components are STARTED
     Set<HostRequest> requests = new HashSet<>();
     requests.clear();
     requests.add(new HostRequest(host1, cluster1));
-    try {
-      HostResourceProviderTest.deleteHosts(controller, requests, false, false);
-      fail("Expect failure deleting hosts when components exist and have not been deleted.");
-    } catch (Exception e) {
-      LOG.info("Exception is - " + e.getMessage());
-      Assert.assertTrue(e.getMessage().contains("these components must be stopped if running, and then deleted"));
-    }
 
     Service s = cluster.getService(serviceName);
     s.getServiceComponent("DATANODE").getServiceComponentHost(host1).setState(State.STARTED);
     try {
-      HostResourceProviderTest.deleteHosts(controller, requests, false, true);
+      HostResourceProviderTest.deleteHosts(controller, requests, false);
       fail("Expect failure deleting hosts when components exist and have not been stopped.");
     } catch (Exception e) {
       LOG.info("Exception is - " + e.getMessage());
-      Assert.assertTrue(e.getMessage().contains("these components must be stopped:"));
+      Assert.assertTrue(e.getMessage().contains("these components are not in the removable state:"));
     }
 
+    // Case 2: Attempt delete dryRun = true
     DeleteStatusMetaData data = null;
-    try {
-      data = HostResourceProviderTest.deleteHosts(controller, requests, true, true);
-      Assert.assertTrue(data.getDeletedKeys().size() == 0);
-    } catch (Exception e) {
-      LOG.info("Exception is - " + e.getMessage());
-      fail("Do not expect failure deleting hosts when components exist and are stopped.");
-    }
 
     LOG.info("Test dry run of delete with all host components");
     s.getServiceComponent("DATANODE").getServiceComponentHost(host1).setState(State.INSTALLED);
     try {
-      data = HostResourceProviderTest.deleteHosts(controller, requests, true, true);
+      data = HostResourceProviderTest.deleteHosts(controller, requests, true);
       Assert.assertTrue(data.getDeletedKeys().size() == 1);
     } catch (Exception e) {
       LOG.info("Exception is - " + e.getMessage());
       fail("Do not expect failure deleting hosts when components exist and are stopped.");
     }
 
+    // Case 3: Attempt delete dryRun = false
     LOG.info("Test successful delete with all host components");
     s.getServiceComponent("DATANODE").getServiceComponentHost(host1).setState(State.INSTALLED);
     try {
-      data = HostResourceProviderTest.deleteHosts(controller, requests, false, true);
+      data = HostResourceProviderTest.deleteHosts(controller, requests, false);
       Assert.assertNotNull(data);
       Assert.assertTrue(4 == data.getDeletedKeys().size());
       Assert.assertTrue(0 == data.getExceptionForKeys().size());
@@ -8154,17 +8142,11 @@ public class AmbariManagementControllerTest {
       cHost.handleEvent(new ServiceComponentHostOpSucceededEvent(cHost.getServiceComponentName(), cHost.getHostName(), System.currentTimeMillis()));
     }
 
-    // Case 1: Attempt delete when components still exist
     Set<HostRequest> requests = new HashSet<>();
     requests.clear();
     requests.add(new HostRequest(host1, cluster1));
-    try {
-      HostResourceProviderTest.deleteHosts(controller, requests);
-      fail("Expect failure deleting hosts when components exist and have not been deleted.");
-    } catch (Exception e) {
-    }
 
-    // Case 2: Delete host that is still part of cluster, but do not specify the cluster_name in the request
+    // Case 1: Delete host that is still part of cluster, but do not specify the cluster_name in the request
     Set<ServiceComponentHostRequest> schRequests = new HashSet<>();
     // Disable HC for non-clients
     schRequests.add(new ServiceComponentHostRequest(cluster1, serviceName, componentName1, host1, "DISABLED"));
@@ -8201,7 +8183,7 @@ public class AmbariManagementControllerTest {
     List<HostRoleCommandEntity> tasks = hostRoleCommandDAO.findByHostId(firstHostId);
     assertEquals(0, tasks.size());
 
-    // Case 3: Delete host that is still part of the cluster, and specify the cluster_name in the request
+    // Case 2: Delete host that is still part of the cluster, and specify the cluster_name in the request
     requests.clear();
     requests.add(new HostRequest(host2, cluster1));
     try {
@@ -8214,7 +8196,7 @@ public class AmbariManagementControllerTest {
     Assert.assertFalse(clusters.getClustersForHost(host2).contains(cluster));
     Assert.assertNull(topologyHostInfoDAO.findByHostname(host2));
 
-    // Case 4: Attempt to delete a host that has already been deleted
+    // Case 3: Attempt to delete a host that has already been deleted
     requests.clear();
     requests.add(new HostRequest(host1, null));
     try {
@@ -8232,7 +8214,7 @@ public class AmbariManagementControllerTest {
       // expected
     }
 
-    // Case 5: Attempt to delete a host that was never added to the cluster
+    // Case 4: Attempt to delete a host that was never added to the cluster
     requests.clear();
     requests.add(new HostRequest(host3, null));
     try {

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f7bd75e/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostResourceProviderTest.java
index fd28081..5e6201b 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostResourceProviderTest.java
@@ -1346,11 +1346,11 @@ public class HostResourceProviderTest extends EasyMockSupport {
 
     HostResourceProvider provider = getHostProvider(controller);
     HostResourceProvider.setTopologyManager(topologyManager);
-    provider.deleteHosts(requests, false, false);
+    provider.deleteHosts(requests, false);
   }
 
   public static DeleteStatusMetaData deleteHosts(AmbariManagementController controller,
-                                                 Set<HostRequest> requests, boolean dryRun, boolean forceDelete)
+                                                 Set<HostRequest> requests, boolean dryRun)
       throws AmbariException {
     TopologyManager topologyManager = EasyMock.createNiceMock(TopologyManager.class);
     expect(topologyManager.getRequests(Collections.emptyList())).andReturn(Collections.emptyList()).anyTimes();
@@ -1359,7 +1359,7 @@ public class HostResourceProviderTest extends EasyMockSupport {
 
     HostResourceProvider provider = getHostProvider(controller);
     HostResourceProvider.setTopologyManager(topologyManager);
-    return provider.deleteHosts(requests, dryRun, forceDelete);
+    return provider.deleteHosts(requests, dryRun);
   }
 
   public static void updateHosts(AmbariManagementController controller, Set<HostRequest> requests)


[22/29] ambari git commit: AMBARI-22537 : Storm jmxetric config not getting removed during patch upgrade (ydavis via mradhakrishnan)

Posted by rl...@apache.org.
AMBARI-22537 : Storm jmxetric config not getting removed during patch upgrade (ydavis via mradhakrishnan)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/3a802ae3
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3a802ae3
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3a802ae3

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 3a802ae3ee9ee8dd944328344c4cfe19c5aaae02
Parents: 7b6fef1
Author: Madhuvanthi Radhakrishnan <mr...@hortonworks.com>
Authored: Thu Nov 30 20:28:48 2017 -0800
Committer: Madhuvanthi Radhakrishnan <mr...@hortonworks.com>
Committed: Thu Nov 30 20:28:48 2017 -0800

----------------------------------------------------------------------
 .../resources/stacks/HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml   | 2 +-
 .../src/main/resources/stacks/HDP/2.6/upgrades/upgrade-2.6.xml     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/3a802ae3/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml
index 2184060..d3b2e56 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml
@@ -336,7 +336,7 @@
       </execute-stage>
 
       <execute-stage service="STORM" component="NIMBUS" title="Removing jmxetric from childopts">
-        <task xsi:type="configure" id="storm_remove_jmxetric"/>
+        <task xsi:type="configure" id="storm_remove_jmxetric" supports-patch="true"/>
       </execute-stage>
 
       <!-- YARN -->

http://git-wip-us.apache.org/repos/asf/ambari/blob/3a802ae3/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/upgrade-2.6.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/upgrade-2.6.xml
index 70f84ab..4f10ea5 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/upgrade-2.6.xml
@@ -988,7 +988,7 @@
       <component name="NIMBUS">
         <pre-upgrade>
           <task xsi:type="configure" id="hdp_2_6_maint_ranger_storm_plugin_cluster_name"/>
-          <task xsi:type="configure" id="storm_remove_jmxetric"/>
+          <task xsi:type="configure" id="storm_remove_jmxetric" supports-patch="true"/>
         </pre-upgrade>
         <pre-downgrade/> <!--  no-op to prevent config changes on downgrade -->
         <upgrade>


[25/29] ambari git commit: AMBARI-22560. Remove obsolete hack to set KDC admin credentials via Cluster session API (Sandor Molnar via rlevas)

Posted by rl...@apache.org.
AMBARI-22560. Remove obsolete hack to set KDC admin credentials via Cluster session API (Sandor Molnar via rlevas)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/943aa715
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/943aa715
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/943aa715

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 943aa715d81301077b469c64551231169b525f50
Parents: a873684
Author: Sandor Molnar <sm...@hortonworks.com>
Authored: Fri Dec 1 12:14:28 2017 -0500
Committer: Robert Levas <rl...@hortonworks.com>
Committed: Fri Dec 1 12:14:28 2017 -0500

----------------------------------------------------------------------
 .../AmbariManagementControllerImpl.java         | 65 --------------------
 .../AmbariManagementControllerImplTest.java     | 46 +++++---------
 2 files changed, 14 insertions(+), 97 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/943aa715/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
index da206c6..232737c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
@@ -141,7 +141,6 @@ import org.apache.ambari.server.security.authorization.RoleAuthorization;
 import org.apache.ambari.server.security.authorization.User;
 import org.apache.ambari.server.security.authorization.UserType;
 import org.apache.ambari.server.security.authorization.Users;
-import org.apache.ambari.server.security.credential.PrincipalKeyCredential;
 import org.apache.ambari.server.security.encryption.CredentialStoreService;
 import org.apache.ambari.server.security.encryption.CredentialStoreType;
 import org.apache.ambari.server.security.ldap.AmbariLdapDataPopulator;
@@ -1449,70 +1448,6 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
     // We have to allow for multiple requests to account for multiple
     // configuration updates (create multiple configuration resources)...
     for (ClusterRequest request : requests) {
-      // TODO : Is there ever a real world case where we could have multiple non-null responses?
-
-      // ***************************************************
-      // set any session attributes for this cluster request
-      Cluster cluster;
-      if (request.getClusterId() == null) {
-        cluster = clusters.getCluster(request.getClusterName());
-      } else {
-        cluster = clusters.getClusterById(request.getClusterId());
-      }
-
-      if (cluster == null) {
-        throw new AmbariException("The cluster may not be null");
-      }
-
-      Map<String, Object> sessionAttributes = request.getSessionAttributes();
-
-      // TODO: Once the UI uses the Credential Resource API, remove this block to _clean_ the
-      // TODO: session attributes and store any KDC administrator credentials in the secure
-      // TODO: credential provider facility.
-      // For now, to keep things backwards compatible, get and remove the KDC administrator credentials
-      // from the session attributes and store them in the CredentialsProvider. The KDC administrator
-      // credentials are prefixed with kdc_admin/. The following attributes are expected, if setting
-      // the KDC administrator credentials:
-      //    kerberos_admin/principal
-      //    kerberos_admin/password
-      if((sessionAttributes != null) && !sessionAttributes.isEmpty()) {
-        Map<String, Object> cleanedSessionAttributes = new HashMap<>();
-        String principal = null;
-        char[] password = null;
-
-        for(Map.Entry<String,Object> entry: sessionAttributes.entrySet()) {
-          String name = entry.getKey();
-          Object value = entry.getValue();
-
-          if ("kerberos_admin/principal".equals(name)) {
-            if(value instanceof String) {
-              principal = (String)value;
-            }
-          }
-          else if ("kerberos_admin/password".equals(name)) {
-            if(value instanceof String) {
-              password = ((String) value).toCharArray();
-            }
-          } else {
-            cleanedSessionAttributes.put(name, value);
-          }
-        }
-
-        if(principal != null) {
-          // The KDC admin principal exists... set the credentials in the credentials store
-          credentialStoreService.setCredential(cluster.getClusterName(),
-              KerberosHelper.KDC_ADMINISTRATOR_CREDENTIAL_ALIAS,
-              new PrincipalKeyCredential(principal, password), CredentialStoreType.TEMPORARY);
-        }
-
-        sessionAttributes = cleanedSessionAttributes;
-      }
-      // TODO: END
-
-      cluster.addSessionAttributes(sessionAttributes);
-      //
-      // ***************************************************
-
       response = updateCluster(request, requestProperties);
     }
     return response;

http://git-wip-us.apache.org/repos/asf/ambari/blob/943aa715/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java
index d1f235f..e795d28 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java
@@ -577,15 +577,12 @@ public class AmbariManagementControllerImplTest {
     expect(injector.getInstance(MaintenanceStateHelper.class)).andReturn(null);
     expect(injector.getInstance(KerberosHelper.class)).andReturn(kerberosHelper);
     expect(clusterRequest.getClusterName()).andReturn("clusterNew").times(3);
-    expect(clusterRequest.getClusterId()).andReturn(1L).times(6);
+    expect(clusterRequest.getClusterId()).andReturn(1L).times(4);
     expect(clusterRequest.getDesiredConfig()).andReturn(configRequests);
     expect(configurationRequest.getVersionTag()).andReturn(null).times(1);
-    expect(clusters.getClusterById(1L)).andReturn(cluster).times(2);
+    expect(clusters.getClusterById(1L)).andReturn(cluster).times(1);
     expect(cluster.getClusterName()).andReturn("clusterOld").times(1);
 
-    cluster.addSessionAttributes(EasyMock.anyObject());
-    expectLastCall().once();
-
     cluster.setClusterName("clusterNew");
     expectLastCall();
 
@@ -689,13 +686,10 @@ public class AmbariManagementControllerImplTest {
     expect(injector.getInstance(Gson.class)).andReturn(null);
     expect(injector.getInstance(MaintenanceStateHelper.class)).andReturn(null);
     expect(injector.getInstance(KerberosHelper.class)).andReturn(kerberosHelper);
-    expect(clusterRequest.getClusterId()).andReturn(1L).times(6);
-    expect(clusters.getClusterById(1L)).andReturn(cluster).times(2);
+    expect(clusterRequest.getClusterId()).andReturn(1L).times(4);
+    expect(clusters.getClusterById(1L)).andReturn(cluster).times(1);
     expect(cluster.getClusterName()).andReturn("cluster").times(1);
 
-    cluster.addSessionAttributes(EasyMock.anyObject());
-    expectLastCall().once();
-
     // replay mocks
     replay(actionManager, cluster, clusters, injector, clusterRequest, sessionManager, kerberosHelper);
 
@@ -731,15 +725,12 @@ public class AmbariManagementControllerImplTest {
     expect(injector.getInstance(Gson.class)).andReturn(null);
     expect(injector.getInstance(MaintenanceStateHelper.class)).andReturn(null);
     expect(injector.getInstance(KerberosHelper.class)).andReturn(kerberosHelper);
-    expect(clusterRequest.getClusterId()).andReturn(1L).times(6);
+    expect(clusterRequest.getClusterId()).andReturn(1L).times(4);
     expect(clusterRequest.getSecurityType()).andReturn(SecurityType.KERBEROS).anyTimes();
-    expect(clusters.getClusterById(1L)).andReturn(cluster).times(2);
+    expect(clusters.getClusterById(1L)).andReturn(cluster).times(1);
     expect(cluster.getClusterName()).andReturn("cluster").times(1);
     expect(cluster.getSecurityType()).andReturn(SecurityType.KERBEROS).anyTimes();
 
-    cluster.addSessionAttributes(EasyMock.anyObject());
-    expectLastCall().once();
-
     expect(kerberosHelper.shouldExecuteCustomOperations(SecurityType.KERBEROS, null))
         .andReturn(false)
         .once();
@@ -781,15 +772,12 @@ public class AmbariManagementControllerImplTest {
     expect(injector.getInstance(Gson.class)).andReturn(null);
     expect(injector.getInstance(MaintenanceStateHelper.class)).andReturn(null);
     expect(injector.getInstance(KerberosHelper.class)).andReturn(kerberosHelper);
-    expect(clusterRequest.getClusterId()).andReturn(1L).times(6);
+    expect(clusterRequest.getClusterId()).andReturn(1L).times(4);
     expect(clusterRequest.getSecurityType()).andReturn(SecurityType.KERBEROS).anyTimes();
-    expect(clusters.getClusterById(1L)).andReturn(cluster).times(2);
+    expect(clusters.getClusterById(1L)).andReturn(cluster).times(1);
     expect(cluster.getClusterName()).andReturn("cluster").times(1);
     expect(cluster.getSecurityType()).andReturn(SecurityType.NONE).anyTimes();
 
-    cluster.addSessionAttributes(EasyMock.anyObject());
-    expectLastCall().once();
-
     expect(kerberosHelper.shouldExecuteCustomOperations(SecurityType.KERBEROS, null))
         .andReturn(false)
         .once();
@@ -865,15 +853,12 @@ public class AmbariManagementControllerImplTest {
     expect(injector.getInstance(Gson.class)).andReturn(null);
     expect(injector.getInstance(MaintenanceStateHelper.class)).andReturn(null);
     expect(injector.getInstance(KerberosHelper.class)).andReturn(kerberosHelper);
-    expect(clusterRequest.getClusterId()).andReturn(1L).times(6);
+    expect(clusterRequest.getClusterId()).andReturn(1L).times(4);
     expect(clusterRequest.getSecurityType()).andReturn(SecurityType.NONE).anyTimes();
-    expect(clusters.getClusterById(1L)).andReturn(cluster).times(2);
+    expect(clusters.getClusterById(1L)).andReturn(cluster).times(1);
     expect(cluster.getClusterName()).andReturn("cluster").times(1);
     expect(cluster.getSecurityType()).andReturn(SecurityType.KERBEROS).anyTimes();
 
-    cluster.addSessionAttributes(EasyMock.anyObject());
-    expectLastCall().once();
-
     expect(kerberosHelper.shouldExecuteCustomOperations(SecurityType.NONE, null))
         .andReturn(false)
         .once();
@@ -922,9 +907,9 @@ public class AmbariManagementControllerImplTest {
     expect(injector.getInstance(Gson.class)).andReturn(null);
     expect(injector.getInstance(MaintenanceStateHelper.class)).andReturn(null);
     expect(injector.getInstance(KerberosHelper.class)).andReturn(kerberosHelper);
-    expect(clusterRequest.getClusterId()).andReturn(1L).times(6);
+    expect(clusterRequest.getClusterId()).andReturn(1L).times(4);
     expect(clusterRequest.getSecurityType()).andReturn(SecurityType.NONE).anyTimes();
-    expect(clusters.getClusterById(1L)).andReturn(cluster).times(2);
+    expect(clusters.getClusterById(1L)).andReturn(cluster).times(1);
     expect(cluster.getResourceId()).andReturn(1L).times(3);
     expect(cluster.getClusterName()).andReturn("cluster").times(1);
     expect(cluster.getSecurityType()).andReturn(SecurityType.KERBEROS).anyTimes();
@@ -937,9 +922,6 @@ public class AmbariManagementControllerImplTest {
     cluster.setClusterName(anyObject(String.class));
     expectLastCall().once();
 
-    cluster.addSessionAttributes(EasyMock.anyObject());
-    expectLastCall().once();
-
     expect(kerberosHelper.shouldExecuteCustomOperations(SecurityType.NONE, null))
         .andReturn(false)
         .once();
@@ -993,8 +975,8 @@ public class AmbariManagementControllerImplTest {
     expect(injector.getInstance(MaintenanceStateHelper.class)).andReturn(null);
     expect(injector.getInstance(KerberosHelper.class)).andReturn(createNiceMock(KerberosHelper.class));
     expect(clusterRequest.getClusterName()).andReturn("clusterNew").times(3);
-    expect(clusterRequest.getClusterId()).andReturn(1L).times(6);
-    expect(clusters.getClusterById(1L)).andReturn(cluster).times(2);
+    expect(clusterRequest.getClusterId()).andReturn(1L).times(4);
+    expect(clusters.getClusterById(1L)).andReturn(cluster).times(1);
     expect(cluster.getClusterName()).andReturn("clusterOld").times(1);
     cluster.setClusterName("clusterNew");
     expectLastCall().andThrow(new RollbackException());


[06/29] ambari git commit: AMBARI-22481. Make Ambari LDAP configuration API consistent with existing API (rlevas)

Posted by rl...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/main/java/org/apache/ambari/server/ldap/domain/AmbariLdapConfiguration.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/domain/AmbariLdapConfiguration.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/domain/AmbariLdapConfiguration.java
index 6c466ba..193a5c2 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/domain/AmbariLdapConfiguration.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/domain/AmbariLdapConfiguration.java
@@ -15,17 +15,15 @@
 
 package org.apache.ambari.server.ldap.domain;
 
+import java.util.Collections;
+import java.util.HashMap;
 import java.util.Map;
 
-import javax.inject.Inject;
-
 import org.apache.commons.lang.builder.EqualsBuilder;
 import org.apache.commons.lang.builder.HashCodeBuilder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.inject.assistedinject.Assisted;
-
 /**
  * This class is an immutable representation of all the LDAP related configurationMap entries.
  */
@@ -35,142 +33,145 @@ public class AmbariLdapConfiguration {
 
   private final Map<String, String> configurationMap;
 
-  private Object configValue(AmbariLdapConfigKeys ambariLdapConfigKeys) {
+  private Object configValue(AmbariLdapConfigurationKeys ambariLdapConfigurationKeys) {
     Object value = null;
-    if (configurationMap.containsKey(ambariLdapConfigKeys.key())) {
-      value = configurationMap.get(ambariLdapConfigKeys.key());
+    if (configurationMap.containsKey(ambariLdapConfigurationKeys.key())) {
+      value = configurationMap.get(ambariLdapConfigurationKeys.key());
     } else {
-      LOGGER.warn("Ldap configuration property [{}] hasn't been set", ambariLdapConfigKeys.key());
+      LOGGER.warn("Ldap configuration property [{}] hasn't been set", ambariLdapConfigurationKeys.key());
     }
     return value;
   }
 
-  public void setValueFor(AmbariLdapConfigKeys ambariLdapConfigKeys, String value) {
-    configurationMap.put(ambariLdapConfigKeys.key(), value);
+  public void setValueFor(AmbariLdapConfigurationKeys ambariLdapConfigurationKeys, String value) {
+    configurationMap.put(ambariLdapConfigurationKeys.key(), value);
   }
 
-  // intentionally package private, instances to be created through the factory
-  @Inject
-  AmbariLdapConfiguration(@Assisted Map<String, String> configuration) {
+  public AmbariLdapConfiguration(Map<String, String> configuration) {
     this.configurationMap = configuration;
   }
 
   public boolean ldapEnabled() {
-    return Boolean.valueOf((String) configValue(AmbariLdapConfigKeys.LDAP_ENABLED));
+    return Boolean.valueOf((String) configValue(AmbariLdapConfigurationKeys.LDAP_ENABLED));
   }
 
   public String serverHost() {
-    return (String) configValue(AmbariLdapConfigKeys.SERVER_HOST);
+    return (String) configValue(AmbariLdapConfigurationKeys.SERVER_HOST);
   }
 
   public int serverPort() {
-    return Integer.valueOf((String) configValue(AmbariLdapConfigKeys.SERVER_PORT));
+    return Integer.valueOf((String) configValue(AmbariLdapConfigurationKeys.SERVER_PORT));
   }
 
   public boolean useSSL() {
-    return Boolean.valueOf((String) configValue(AmbariLdapConfigKeys.USE_SSL));
+    return Boolean.valueOf((String) configValue(AmbariLdapConfigurationKeys.USE_SSL));
   }
 
   public String trustStore() {
-    return (String) configValue(AmbariLdapConfigKeys.TRUST_STORE);
+    return (String) configValue(AmbariLdapConfigurationKeys.TRUST_STORE);
   }
 
   public String trustStoreType() {
-    return (String) configValue(AmbariLdapConfigKeys.TRUST_STORE_TYPE);
+    return (String) configValue(AmbariLdapConfigurationKeys.TRUST_STORE_TYPE);
   }
 
   public String trustStorePath() {
-    return (String) configValue(AmbariLdapConfigKeys.TRUST_STORE_PATH);
+    return (String) configValue(AmbariLdapConfigurationKeys.TRUST_STORE_PATH);
   }
 
   public String trustStorePassword() {
-    return (String) configValue(AmbariLdapConfigKeys.TRUST_STORE_PASSWORD);
+    return (String) configValue(AmbariLdapConfigurationKeys.TRUST_STORE_PASSWORD);
   }
 
   public boolean anonymousBind() {
-    return Boolean.valueOf((String) configValue(AmbariLdapConfigKeys.ANONYMOUS_BIND));
+    return Boolean.valueOf((String) configValue(AmbariLdapConfigurationKeys.ANONYMOUS_BIND));
   }
 
   public String bindDn() {
-    return (String) configValue(AmbariLdapConfigKeys.BIND_DN);
+    return (String) configValue(AmbariLdapConfigurationKeys.BIND_DN);
   }
 
   public String bindPassword() {
-    return (String) configValue(AmbariLdapConfigKeys.BIND_PASSWORD);
+    return (String) configValue(AmbariLdapConfigurationKeys.BIND_PASSWORD);
   }
 
   public String attributeDetection() {
-    return (String) configValue(AmbariLdapConfigKeys.ATTR_DETECTION);
+    return (String) configValue(AmbariLdapConfigurationKeys.ATTR_DETECTION);
   }
 
   public String dnAttribute() {
-    return (String) configValue(AmbariLdapConfigKeys.DN_ATTRIBUTE);
+    return (String) configValue(AmbariLdapConfigurationKeys.DN_ATTRIBUTE);
   }
 
   public String userObjectClass() {
-    return (String) configValue(AmbariLdapConfigKeys.USER_OBJECT_CLASS);
+    return (String) configValue(AmbariLdapConfigurationKeys.USER_OBJECT_CLASS);
   }
 
   public String userNameAttribute() {
-    return (String) configValue(AmbariLdapConfigKeys.USER_NAME_ATTRIBUTE);
+    return (String) configValue(AmbariLdapConfigurationKeys.USER_NAME_ATTRIBUTE);
   }
 
   public String userSearchBase() {
-    return (String) configValue(AmbariLdapConfigKeys.USER_SEARCH_BASE);
+    return (String) configValue(AmbariLdapConfigurationKeys.USER_SEARCH_BASE);
   }
 
   public String groupObjectClass() {
-    return (String) configValue(AmbariLdapConfigKeys.GROUP_OBJECT_CLASS);
+    return (String) configValue(AmbariLdapConfigurationKeys.GROUP_OBJECT_CLASS);
   }
 
   public String groupNameAttribute() {
-    return (String) configValue(AmbariLdapConfigKeys.GROUP_NAME_ATTRIBUTE);
+    return (String) configValue(AmbariLdapConfigurationKeys.GROUP_NAME_ATTRIBUTE);
   }
 
   public String groupMemberAttribute() {
-    return (String) configValue(AmbariLdapConfigKeys.GROUP_MEMBER_ATTRIBUTE);
+    return (String) configValue(AmbariLdapConfigurationKeys.GROUP_MEMBER_ATTRIBUTE);
   }
 
   public String groupSearchBase() {
-    return (String) configValue(AmbariLdapConfigKeys.GROUP_SEARCH_BASE);
+    return (String) configValue(AmbariLdapConfigurationKeys.GROUP_SEARCH_BASE);
   }
 
   public String userSearchFilter() {
-    return (String) configValue(AmbariLdapConfigKeys.USER_SEARCH_FILTER);
+    return (String) configValue(AmbariLdapConfigurationKeys.USER_SEARCH_FILTER);
   }
 
   public String userMemberReplacePattern() {
-    return (String) configValue(AmbariLdapConfigKeys.USER_MEMBER_REPLACE_PATTERN);
+    return (String) configValue(AmbariLdapConfigurationKeys.USER_MEMBER_REPLACE_PATTERN);
   }
 
   public String userMemberFilter() {
-    return (String) configValue(AmbariLdapConfigKeys.USER_MEMBER_FILTER);
+    return (String) configValue(AmbariLdapConfigurationKeys.USER_MEMBER_FILTER);
   }
 
   public String groupSearchFilter() {
-    return (String) configValue(AmbariLdapConfigKeys.GROUP_SEARCH_FILTER);
+    return (String) configValue(AmbariLdapConfigurationKeys.GROUP_SEARCH_FILTER);
   }
 
   public String groupMemberReplacePattern() {
-    return (String) configValue(AmbariLdapConfigKeys.GROUP_MEMBER_REPLACE_PATTERN);
+    return (String) configValue(AmbariLdapConfigurationKeys.GROUP_MEMBER_REPLACE_PATTERN);
   }
 
   public String groupMemberFilter() {
-    return (String) configValue(AmbariLdapConfigKeys.GROUP_MEMBER_FILTER);
+    return (String) configValue(AmbariLdapConfigurationKeys.GROUP_MEMBER_FILTER);
   }
 
   public boolean forceLowerCaseUserNames() {
-    return Boolean.valueOf((String) configValue(AmbariLdapConfigKeys.FORCE_LOWERCASE_USERNAMES));
+    return Boolean.valueOf((String) configValue(AmbariLdapConfigurationKeys.FORCE_LOWERCASE_USERNAMES));
   }
 
   public boolean paginationEnabled() {
-    return Boolean.valueOf((String) configValue(AmbariLdapConfigKeys.PAGINATION_ENABLED));
+    return Boolean.valueOf((String) configValue(AmbariLdapConfigurationKeys.PAGINATION_ENABLED));
   }
 
   public String referralHandling() {
-    return (String) configValue(AmbariLdapConfigKeys.REFERRAL_HANDLING);
+    return (String) configValue(AmbariLdapConfigurationKeys.REFERRAL_HANDLING);
   }
 
+  public Map<String, String> toMap() {
+    return (configurationMap == null)
+        ? Collections.emptyMap()
+        : new HashMap<>(configurationMap);
+  }
 
   @Override
   public String toString() {

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/main/java/org/apache/ambari/server/ldap/domain/AmbariLdapConfigurationFactory.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/domain/AmbariLdapConfigurationFactory.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/domain/AmbariLdapConfigurationFactory.java
deleted file mode 100644
index aafd204..0000000
--- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/domain/AmbariLdapConfigurationFactory.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ambari.server.ldap.domain;
-
-import java.util.Map;
-
-/**
- * Factory interface for AmbariLdapConfiguration instances.
- * It's registered as a factory in the GUICE context (so no implementations required)
- *
- * To be extended with other factory methods upon needs.
- */
-public interface AmbariLdapConfigurationFactory {
-
-  /**
-   * Creates an AmbariLdapConfiguration instance with the provided map of configuration settings.
-   *
-   * @param configuration a map where keys are the configuration properties and values are the configuration values
-   * @return an AmbariLdapConfiguration instance
-   */
-  AmbariLdapConfiguration createLdapConfiguration(Map<String, String> configuration);
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/main/java/org/apache/ambari/server/ldap/domain/AmbariLdapConfigurationKeys.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/domain/AmbariLdapConfigurationKeys.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/domain/AmbariLdapConfigurationKeys.java
new file mode 100644
index 0000000..2e1c36b
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/domain/AmbariLdapConfigurationKeys.java
@@ -0,0 +1,83 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.server.ldap.domain;
+
+/**
+ * Constants representing supported LDAP related property names
+ * // todo extend this with validation information, description, defaults maybe
+ */
+public enum AmbariLdapConfigurationKeys {
+
+  LDAP_ENABLED("ambari.ldap.authentication.enabled"),
+  SERVER_HOST("ambari.ldap.connectivity.server.host"),
+  SERVER_PORT("ambari.ldap.connectivity.server.port"),
+  USE_SSL("ambari.ldap.connectivity.use_ssl"),
+
+  TRUST_STORE("ambari.ldap.connectivity.trust_store"),
+  TRUST_STORE_TYPE("ambari.ldap.connectivity.trust_store.type"),
+  TRUST_STORE_PATH("ambari.ldap.connectivity.trust_store.path"),
+  TRUST_STORE_PASSWORD("ambari.ldap.connectivity.trust_store.password"),
+  ANONYMOUS_BIND("ambari.ldap.connectivity.anonymous_bind"),
+
+  BIND_DN("ambari.ldap.connectivity.bind_dn"),
+  BIND_PASSWORD("ambari.ldap.connectivity.bind_password"),
+
+  ATTR_DETECTION("ambari.ldap.attributes.detection"), // manual | auto
+
+  DN_ATTRIBUTE("ambari.ldap.attributes.dn_attr"),
+
+  USER_OBJECT_CLASS("ambari.ldap.attributes.user.object_class"),
+  USER_NAME_ATTRIBUTE("ambari.ldap.attributes.user.name_attr"),
+  USER_GROUP_MEMBER_ATTRIBUTE("ambari.ldap.attributes.user.group_member_attr"),
+  USER_SEARCH_BASE("ambari.ldap.attributes.user.search_base"),
+
+  GROUP_OBJECT_CLASS("ambari.ldap.attributes.group.object_class"),
+  GROUP_NAME_ATTRIBUTE("ambari.ldap.attributes.group.name_attr"),
+  GROUP_MEMBER_ATTRIBUTE("ambari.ldap.attributes.group.member_attr"),
+  GROUP_SEARCH_BASE("ambari.ldap.attributes.group.search_base"),
+
+  USER_SEARCH_FILTER("ambari.ldap.advanced.user_search_filter"),
+  USER_MEMBER_REPLACE_PATTERN("ambari.ldap.advanced.user_member_replace_pattern"),
+  USER_MEMBER_FILTER("ambari.ldap.advanced.user_member_filter"),
+
+  GROUP_SEARCH_FILTER("ambari.ldap.advanced.group_search_filter"),
+  GROUP_MEMBER_REPLACE_PATTERN("ambari.ldap.advanced.group_member_replace_pattern"),
+  GROUP_MEMBER_FILTER("ambari.ldap.advanced.group_member_filter"),
+
+  FORCE_LOWERCASE_USERNAMES("ambari.ldap.advanced.force_lowercase_usernames"),
+  REFERRAL_HANDLING("ambari.ldap.advanced.referrals"), // folow
+  PAGINATION_ENABLED("ambari.ldap.advanced.pagination_enabled"); // true | false
+
+  private String propertyName;
+
+  AmbariLdapConfigurationKeys(String propName) {
+    this.propertyName = propName;
+  }
+
+  public String key() {
+    return this.propertyName;
+  }
+
+  public static AmbariLdapConfigurationKeys fromKeyStr(String keyStr) {
+    for (AmbariLdapConfigurationKeys key : values()) {
+      if (key.key().equals(keyStr)) {
+        return key;
+      }
+    }
+
+    throw new IllegalStateException("invalid konfiguration key found!");
+
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/AmbariLdapConfigurationProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/AmbariLdapConfigurationProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/AmbariLdapConfigurationProvider.java
index ac9c1bc..f1e1881 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/AmbariLdapConfigurationProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/AmbariLdapConfigurationProvider.java
@@ -1,7 +1,11 @@
 /*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * 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
  *
@@ -18,10 +22,10 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.ambari.server.controller.internal.AmbariServerConfigurationCategory;
 import org.apache.ambari.server.events.AmbariConfigurationChangedEvent;
 import org.apache.ambari.server.events.publishers.AmbariEventPublisher;
 import org.apache.ambari.server.ldap.domain.AmbariLdapConfiguration;
-import org.apache.ambari.server.ldap.domain.AmbariLdapConfigurationFactory;
 import org.apache.ambari.server.orm.dao.AmbariConfigurationDAO;
 import org.apache.ambari.server.orm.entities.AmbariConfigurationEntity;
 import org.apache.ambari.server.security.authorization.AmbariLdapAuthenticationProvider;
@@ -56,9 +60,6 @@ public class AmbariLdapConfigurationProvider implements Provider<AmbariLdapConfi
   private Provider<AmbariConfigurationDAO> ambariConfigurationDAOProvider;
 
   @Inject
-  private AmbariLdapConfigurationFactory ldapConfigurationFactory;
-
-  @Inject
   public AmbariLdapConfigurationProvider() {
   }
 
@@ -81,11 +82,11 @@ public class AmbariLdapConfigurationProvider implements Provider<AmbariLdapConfi
     List<AmbariConfigurationEntity> configEntities;
 
     LOGGER.info("Loading LDAP configuration ...");
-    configEntities = ambariConfigurationDAOProvider.get().findByCategory("ldap-configuration");
+    configEntities = ambariConfigurationDAOProvider.get().findByCategory(AmbariServerConfigurationCategory.LDAP_CONFIGURATION.getCategoryName());
 
     if (configEntities != null) {
       Map<String, String> properties = toProperties(configEntities);
-      instance = ldapConfigurationFactory.createLdapConfiguration(properties);
+      instance = new AmbariLdapConfiguration(properties);
     }
 
     LOGGER.info("Loaded LDAP configuration instance: [ {} ]", instance);

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/AmbariLdapFacade.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/AmbariLdapFacade.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/AmbariLdapFacade.java
index 0118840..a9fd59b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/AmbariLdapFacade.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/AmbariLdapFacade.java
@@ -114,9 +114,7 @@ public class AmbariLdapFacade implements LdapFacade {
 
     // todo handle the case where group membership is stored in the user rather than the group
     LOGGER.info("Testing LDAP group attributes with test user dn: {}", userDn);
-    Set<String> groups = ldapConfigurationService.checkGroupAttributes(userDn, ldapConfiguration);
-
-    return groups;
+    return ldapConfigurationService.checkGroupAttributes(userDn, ldapConfiguration);
   }
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/LdapFacade.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/LdapFacade.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/LdapFacade.java
index ef84d1b..fc7ef98 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/LdapFacade.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/LdapFacade.java
@@ -22,7 +22,7 @@ import org.apache.ambari.server.ldap.domain.AmbariLdapConfiguration;
 /**
  * The contract defining all the operations required by the application when communicating with an arbitrary LDAP server.
  * This interface is intended to decouple LDAP specific details from the application.
- *
+ * <p>
  * Any operation that requires interaction with an LDAP server from within Ambari should go through this interface.
  * (LDAP)
  */
@@ -39,11 +39,11 @@ public interface LdapFacade {
 
   /**
    * Runs the user and group attribute detection algorithms.
-   * The method is not intended to be used as a coniguration factory, the returned instance may not be suitable for use.
+   * The method is not intended to be used as a configuration factory, the returned instance may not be suitable for use.
    *
    * @param ambariLdapConfiguration partially filled configuration instance to be extended with detected properties
    * @return a configuration instance, with properties filled with potentially correct values
-   * @throws AmbariLdapException
+   * @throws AmbariLdapException if the attribute detection fails
    */
   AmbariLdapConfiguration detectAttributes(AmbariLdapConfiguration ambariLdapConfiguration) throws AmbariLdapException;
 
@@ -51,7 +51,8 @@ public interface LdapFacade {
    * Checks user and group related LDAP configuration attributes in the configuration object with the help of the provided parameters
    *
    * @param parameters              a map of property name and value pairs holding information to facilitate checking the attributes
-   * @param ambariLdapConfiguration configutration instance with available attributes
+   * @param ambariLdapConfiguration configuration instance with available attributes
+   * @return the set of groups assigned to the test user
    * @throws AmbariLdapException if the attribute checking fails
    */
   Set<String> checkLdapAttributes(Map<String, Object> parameters, AmbariLdapConfiguration ambariLdapConfiguration) throws AmbariLdapException;

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapAttributeDetectionService.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapAttributeDetectionService.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapAttributeDetectionService.java
index a9a9b53..23254c9 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapAttributeDetectionService.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapAttributeDetectionService.java
@@ -20,8 +20,8 @@ import java.util.Map;
 import javax.inject.Inject;
 import javax.inject.Singleton;
 
-import org.apache.ambari.server.ldap.domain.AmbariLdapConfigKeys;
 import org.apache.ambari.server.ldap.domain.AmbariLdapConfiguration;
+import org.apache.ambari.server.ldap.domain.AmbariLdapConfigurationKeys;
 import org.apache.ambari.server.ldap.service.AmbariLdapException;
 import org.apache.ambari.server.ldap.service.AttributeDetector;
 import org.apache.ambari.server.ldap.service.LdapAttributeDetectionService;
@@ -154,7 +154,7 @@ public class DefaultLdapAttributeDetectionService implements LdapAttributeDetect
 
     for (Map.Entry<String, String> detecteMapEntry : detectedAttributes.entrySet()) {
       LOG.info("Setting detected configuration value: [{}] - > [{}]", detecteMapEntry.getKey(), detecteMapEntry.getValue());
-      ambariLdapConfiguration.setValueFor(AmbariLdapConfigKeys.fromKeyStr(detecteMapEntry.getKey()), detecteMapEntry.getValue());
+      ambariLdapConfiguration.setValueFor(AmbariLdapConfigurationKeys.fromKeyStr(detecteMapEntry.getKey()), detecteMapEntry.getValue());
     }
 
   }
@@ -163,7 +163,7 @@ public class DefaultLdapAttributeDetectionService implements LdapAttributeDetect
     try {
 
       SearchRequest req = ldapConnectionTemplate.newSearchRequest(ambariLdapConfiguration.userSearchBase(),
-        FilterBuilder.present(ambariLdapConfiguration.dnAttribute()).toString(), SearchScope.SUBTREE);
+        FilterBuilder.present("objectClass").toString(), SearchScope.SUBTREE);
       req.setSizeLimit(SAMPLE_RESULT_SIZE);
 
       return req;
@@ -178,7 +178,7 @@ public class DefaultLdapAttributeDetectionService implements LdapAttributeDetect
     try {
 
       SearchRequest req = ldapConnectionTemplate.newSearchRequest(ambariLdapConfiguration.groupSearchBase(),
-        FilterBuilder.present(ambariLdapConfiguration.dnAttribute()).toString(), SearchScope.SUBTREE);
+        FilterBuilder.present("objectClass").toString(), SearchScope.SUBTREE);
       req.setSizeLimit(SAMPLE_RESULT_SIZE);
 
       return req;

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapConfigurationService.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapConfigurationService.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapConfigurationService.java
index 3f6995c..cffb190 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapConfigurationService.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapConfigurationService.java
@@ -106,8 +106,8 @@ public class DefaultLdapConfigurationService implements LdapConfigurationService
       userDn = ldapConnectionTemplateFactory.create(ambariLdapConfiguration).searchFirst(new Dn(ambariLdapConfiguration.userSearchBase()), filter, SearchScope.SUBTREE, getUserDnNameEntryMapper(ambariLdapConfiguration));
 
       if (null == userDn) {
-        LOGGER.info("Could not find user based on the provided configuration. User attributes are not complete ");
-        throw new AmbariLdapException("User attribute configuration incomplete");
+        LOGGER.info("Could not find test user based on the provided configuration. User attributes may not be complete or the user may not exist.");
+        throw new AmbariLdapException("Could not find test user based on the provided configuration. User attributes may not be complete or the user may not exist.");
       }
       LOGGER.info("Attribute validation succeeded. Filter: [{}]", filter);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/GroupMemberAttrDetector.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/GroupMemberAttrDetector.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/GroupMemberAttrDetector.java
index 8c34ef8..191c8ee 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/GroupMemberAttrDetector.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/GroupMemberAttrDetector.java
@@ -16,7 +16,7 @@ package org.apache.ambari.server.ldap.service.ads.detectors;
 
 import javax.inject.Inject;
 
-import org.apache.ambari.server.ldap.domain.AmbariLdapConfigKeys;
+import org.apache.ambari.server.ldap.domain.AmbariLdapConfigurationKeys;
 import org.apache.directory.api.ldap.model.entry.Entry;
 
 public class GroupMemberAttrDetector extends OccurrenceAndWeightBasedDetector {
@@ -60,6 +60,6 @@ public class GroupMemberAttrDetector extends OccurrenceAndWeightBasedDetector {
 
   @Override
   public String detectedProperty() {
-    return AmbariLdapConfigKeys.GROUP_MEMBER_ATTRIBUTE.key();
+    return AmbariLdapConfigurationKeys.GROUP_MEMBER_ATTRIBUTE.key();
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/GroupNameAttrDetector.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/GroupNameAttrDetector.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/GroupNameAttrDetector.java
index 0315ef2..4bd429a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/GroupNameAttrDetector.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/GroupNameAttrDetector.java
@@ -16,18 +16,17 @@ package org.apache.ambari.server.ldap.service.ads.detectors;
 
 import javax.inject.Inject;
 
-import org.apache.ambari.server.ldap.domain.AmbariLdapConfigKeys;
+import org.apache.ambari.server.ldap.domain.AmbariLdapConfigurationKeys;
 import org.apache.directory.api.ldap.model.entry.Entry;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class GroupNameAttrDetector extends OccurrenceAndWeightBasedDetector {
-  private static final Logger LOGGER = LoggerFactory.getLogger(UserNameAttrDetector.class);
+  private static final Logger LOGGER = LoggerFactory.getLogger(GroupNameAttrDetector.class);
 
   private enum GroupNameAttr {
 
     DISTINGUISHED_NAME("distinguishedName", 1),
-
     CN("cn", 1);
 
     private String attrName;
@@ -65,6 +64,6 @@ public class GroupNameAttrDetector extends OccurrenceAndWeightBasedDetector {
 
   @Override
   public String detectedProperty() {
-    return AmbariLdapConfigKeys.GROUP_NAME_ATTRIBUTE.key();
+    return AmbariLdapConfigurationKeys.GROUP_NAME_ATTRIBUTE.key();
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/GroupObjectClassDetector.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/GroupObjectClassDetector.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/GroupObjectClassDetector.java
index b681134..407c1b0 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/GroupObjectClassDetector.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/GroupObjectClassDetector.java
@@ -16,7 +16,7 @@ package org.apache.ambari.server.ldap.service.ads.detectors;
 
 import javax.inject.Inject;
 
-import org.apache.ambari.server.ldap.domain.AmbariLdapConfigKeys;
+import org.apache.ambari.server.ldap.domain.AmbariLdapConfigurationKeys;
 import org.apache.directory.api.ldap.model.entry.Entry;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -26,13 +26,9 @@ public class GroupObjectClassDetector extends OccurrenceAndWeightBasedDetector {
   private static final Logger LOGGER = LoggerFactory.getLogger(GroupObjectClassDetector.class);
 
   private enum ObjectClassValue {
-
     GROUP("group", 1),
-
     GROUP_OF_NAMES("groupOfNames", 1),
-
     POSIX_GROUP("posixGroup", 1),
-
     GROUP_OF_UNIQUE_NAMES("groupOfUniqueNames", 1);
 
     private String ocVal;
@@ -68,6 +64,6 @@ public class GroupObjectClassDetector extends OccurrenceAndWeightBasedDetector {
 
   @Override
   public String detectedProperty() {
-    return AmbariLdapConfigKeys.GROUP_OBJECT_CLASS.key();
+    return AmbariLdapConfigurationKeys.GROUP_OBJECT_CLASS.key();
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserGroupMemberAttrDetector.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserGroupMemberAttrDetector.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserGroupMemberAttrDetector.java
index b34a2b2..c785483 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserGroupMemberAttrDetector.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserGroupMemberAttrDetector.java
@@ -16,13 +16,12 @@ package org.apache.ambari.server.ldap.service.ads.detectors;
 
 import javax.inject.Inject;
 
-import org.apache.ambari.server.ldap.domain.AmbariLdapConfigKeys;
+import org.apache.ambari.server.ldap.domain.AmbariLdapConfigurationKeys;
 import org.apache.directory.api.ldap.model.entry.Entry;
 
 public class UserGroupMemberAttrDetector extends OccurrenceAndWeightBasedDetector {
 
   private enum UserGroupMemberAttr {
-
     MEMBER_OF("memberOf", 1),
     IS_MEMBER_OF("ismemberOf", 1);
 
@@ -59,6 +58,6 @@ public class UserGroupMemberAttrDetector extends OccurrenceAndWeightBasedDetecto
 
   @Override
   public String detectedProperty() {
-    return AmbariLdapConfigKeys.USER_GROUP_MEMBER_ATTRIBUTE.key();
+    return AmbariLdapConfigurationKeys.USER_GROUP_MEMBER_ATTRIBUTE.key();
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserNameAttrDetector.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserNameAttrDetector.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserNameAttrDetector.java
index dec4459..aee0b3a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserNameAttrDetector.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserNameAttrDetector.java
@@ -17,7 +17,7 @@ package org.apache.ambari.server.ldap.service.ads.detectors;
 import javax.inject.Inject;
 import javax.inject.Singleton;
 
-import org.apache.ambari.server.ldap.domain.AmbariLdapConfigKeys;
+import org.apache.ambari.server.ldap.domain.AmbariLdapConfigurationKeys;
 import org.apache.directory.api.ldap.model.entry.Entry;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -65,7 +65,7 @@ public class UserNameAttrDetector extends OccurrenceAndWeightBasedDetector {
 
   @Override
   public String detectedProperty() {
-    return AmbariLdapConfigKeys.USER_NAME_ATTRIBUTE.key();
+    return AmbariLdapConfigurationKeys.USER_NAME_ATTRIBUTE.key();
   }
 
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserObjectClassDetector.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserObjectClassDetector.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserObjectClassDetector.java
index bf2f5b8..bb9fa1e 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserObjectClassDetector.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserObjectClassDetector.java
@@ -16,7 +16,7 @@ package org.apache.ambari.server.ldap.service.ads.detectors;
 
 import javax.inject.Inject;
 
-import org.apache.ambari.server.ldap.domain.AmbariLdapConfigKeys;
+import org.apache.ambari.server.ldap.domain.AmbariLdapConfigurationKeys;
 import org.apache.directory.api.ldap.model.entry.Entry;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -63,7 +63,7 @@ public class UserObjectClassDetector extends OccurrenceAndWeightBasedDetector {
 
   @Override
   public String detectedProperty() {
-    return AmbariLdapConfigKeys.USER_OBJECT_CLASS.key();
+    return AmbariLdapConfigurationKeys.USER_OBJECT_CLASS.key();
   }
 
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/test/java/org/apache/ambari/server/api/services/stackadvisor/commands/StackAdvisorCommandTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/stackadvisor/commands/StackAdvisorCommandTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/stackadvisor/commands/StackAdvisorCommandTest.java
index 2afbf8a..99cd80e 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/stackadvisor/commands/StackAdvisorCommandTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/stackadvisor/commands/StackAdvisorCommandTest.java
@@ -18,7 +18,6 @@
 
 package org.apache.ambari.server.api.services.stackadvisor.commands;
 
-import static org.apache.ambari.server.api.services.stackadvisor.commands.StackAdvisorCommand.LDAP_CONFIGURATION_PROPERTY;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
@@ -56,6 +55,7 @@ import org.apache.ambari.server.api.services.stackadvisor.StackAdvisorRequestExc
 import org.apache.ambari.server.api.services.stackadvisor.StackAdvisorResponse;
 import org.apache.ambari.server.api.services.stackadvisor.StackAdvisorRunner;
 import org.apache.ambari.server.api.services.stackadvisor.commands.StackAdvisorCommand.StackAdvisorData;
+import org.apache.ambari.server.controller.internal.AmbariServerConfigurationCategory;
 import org.apache.ambari.server.state.ServiceInfo;
 import org.apache.commons.io.FileUtils;
 import org.codehaus.jackson.JsonNode;
@@ -318,7 +318,7 @@ public class StackAdvisorCommandTest {
     command.populateLdapConfiguration((ObjectNode)servicesRootNode);
 
     JsonNode expectedLdapConfig = json(
-      map(LDAP_CONFIGURATION_PROPERTY, ldapConfigData)
+      map(AmbariServerConfigurationCategory.LDAP_CONFIGURATION.getCategoryName(), ldapConfigData)
     );
 
     assertEquals(expectedLdapConfig, servicesRootNode);

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationResourceProviderTest.java
index 5016160..13c644a 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationResourceProviderTest.java
@@ -35,6 +35,7 @@ import java.util.TreeMap;
 
 import javax.persistence.EntityManager;
 
+import org.apache.ambari.server.api.services.RootServiceComponentConfigurationService;
 import org.apache.ambari.server.controller.RootComponent;
 import org.apache.ambari.server.controller.RootService;
 import org.apache.ambari.server.controller.predicate.AndPredicate;
@@ -42,6 +43,7 @@ import org.apache.ambari.server.controller.spi.Predicate;
 import org.apache.ambari.server.controller.spi.Request;
 import org.apache.ambari.server.controller.spi.Resource;
 import org.apache.ambari.server.controller.spi.ResourceProvider;
+import org.apache.ambari.server.controller.spi.SystemException;
 import org.apache.ambari.server.controller.utilities.PredicateBuilder;
 import org.apache.ambari.server.events.AmbariConfigurationChangedEvent;
 import org.apache.ambari.server.events.publishers.AmbariEventPublisher;
@@ -60,6 +62,7 @@ import com.google.inject.AbstractModule;
 import com.google.inject.Guice;
 import com.google.inject.Injector;
 
+import edu.emory.mathcs.backport.java.util.Collections;
 import junit.framework.Assert;
 
 public class RootServiceComponentConfigurationResourceProviderTest extends EasyMockSupport {
@@ -74,30 +77,55 @@ public class RootServiceComponentConfigurationResourceProviderTest extends EasyM
 
   @Test
   public void testCreateResources_Administrator() throws Exception {
-    testCreateResources(TestAuthenticationFactory.createAdministrator());
+    testCreateResources(TestAuthenticationFactory.createAdministrator(), null);
   }
 
   @Test(expected = AuthorizationException.class)
   public void testCreateResources_ClusterAdministrator() throws Exception {
-    testCreateResources(TestAuthenticationFactory.createClusterAdministrator());
+    testCreateResources(TestAuthenticationFactory.createClusterAdministrator(), null);
   }
 
   @Test(expected = AuthorizationException.class)
   public void testCreateResources_ClusterOperator() throws Exception {
-    testCreateResources(TestAuthenticationFactory.createClusterOperator());
+    testCreateResources(TestAuthenticationFactory.createClusterOperator(), null);
   }
 
   @Test(expected = AuthorizationException.class)
   public void testCreateResources_ServiceAdministrator() throws Exception {
-    testCreateResources(TestAuthenticationFactory.createServiceAdministrator());
+    testCreateResources(TestAuthenticationFactory.createServiceAdministrator(), null);
   }
 
   @Test(expected = AuthorizationException.class)
   public void testCreateResources_ServiceOperator() throws Exception {
-    testCreateResources(TestAuthenticationFactory.createServiceOperator());
+    testCreateResources(TestAuthenticationFactory.createServiceOperator(), null);
   }
 
-  private void testCreateResources(Authentication authentication) throws Exception {
+  @Test
+  public void testCreateResourcesWithDirective_Administrator() throws Exception {
+    testCreateResources(TestAuthenticationFactory.createAdministrator(), "test-directive");
+  }
+
+  @Test(expected = AuthorizationException.class)
+  public void testCreateResourcesWithDirective_ClusterAdministrator() throws Exception {
+    testCreateResources(TestAuthenticationFactory.createClusterAdministrator(), "test-directive");
+  }
+
+  @Test(expected = AuthorizationException.class)
+  public void testCreateResourcesWithDirective_ClusterOperator() throws Exception {
+    testCreateResources(TestAuthenticationFactory.createClusterOperator(), "test-directive");
+  }
+
+  @Test(expected = AuthorizationException.class)
+  public void testCreateResourcesWithDirective_ServiceAdministrator() throws Exception {
+    testCreateResources(TestAuthenticationFactory.createServiceAdministrator(), "test-directive");
+  }
+
+  @Test(expected = AuthorizationException.class)
+  public void testCreateResourcesWithDirective_ServiceOperator() throws Exception {
+    testCreateResources(TestAuthenticationFactory.createServiceOperator(), "test-directive");
+  }
+
+  private void testCreateResources(Authentication authentication, String opDirective) throws Exception {
     Injector injector = createInjector();
 
     ResourceProvider resourceProvider = injector.getInstance(RootServiceComponentConfigurationResourceProvider.class);
@@ -110,38 +138,79 @@ public class RootServiceComponentConfigurationResourceProviderTest extends EasyM
     propertySets.add(toRequestProperties(CATEGORY_NAME_1, properties1));
 
     Map<String, String> properties2 = new HashMap<>();
-    properties2.put("property1b", "value1");
-    properties2.put("property2b", "value2");
-    propertySets.add(toRequestProperties(CATEGORY_NAME_2, properties2));
+    if (opDirective == null) {
+      properties2.put("property1b", "value1");
+      properties2.put("property2b", "value2");
+      propertySets.add(toRequestProperties(CATEGORY_NAME_2, properties2));
+    }
+
+    Map<String, String> requestInfoProperties;
+    if (opDirective == null) {
+      requestInfoProperties = Collections.emptyMap();
+    } else {
+      requestInfoProperties = Collections.singletonMap(RootServiceComponentConfigurationService.DIRECTIVE_OPERATION, opDirective);
+    }
 
     Request request = createMock(Request.class);
     expect(request.getProperties()).andReturn(propertySets).once();
+    expect(request.getRequestInfoProperties()).andReturn(requestInfoProperties).once();
 
     Capture<Map<String, String>> capturedProperties1 = newCapture();
     Capture<Map<String, String>> capturedProperties2 = newCapture();
 
-    AmbariConfigurationDAO dao = injector.getInstance(AmbariConfigurationDAO.class);
-    expect(dao.reconcileCategory(eq(CATEGORY_NAME_1), capture(capturedProperties1), eq(true)))
-        .andReturn(true)
-        .once();
-    expect(dao.reconcileCategory(eq(CATEGORY_NAME_2), capture(capturedProperties2), eq(true)))
-        .andReturn(true)
-        .once();
+    if (opDirective == null) {
+      AmbariConfigurationDAO dao = injector.getInstance(AmbariConfigurationDAO.class);
+      expect(dao.reconcileCategory(eq(CATEGORY_NAME_1), capture(capturedProperties1), eq(true)))
+          .andReturn(true)
+          .once();
+      expect(dao.reconcileCategory(eq(CATEGORY_NAME_2), capture(capturedProperties2), eq(true)))
+          .andReturn(true)
+          .once();
 
-    AmbariEventPublisher publisher = injector.getInstance(AmbariEventPublisher.class);
-    publisher.publish(anyObject(AmbariConfigurationChangedEvent.class));
-    expectLastCall().times(2);
+
+      AmbariEventPublisher publisher = injector.getInstance(AmbariEventPublisher.class);
+      publisher.publish(anyObject(AmbariConfigurationChangedEvent.class));
+      expectLastCall().times(2);
+    }
+
+    RootServiceComponentConfigurationHandlerFactory factory = injector.getInstance(RootServiceComponentConfigurationHandlerFactory.class);
+    expect(factory.getInstance(RootService.AMBARI.name(), RootComponent.AMBARI_SERVER.name(), CATEGORY_NAME_1))
+        .andReturn(new AmbariServerConfigurationHandler())
+        .once();
+    if (opDirective == null) {
+      expect(factory.getInstance(RootService.AMBARI.name(), RootComponent.AMBARI_SERVER.name(), CATEGORY_NAME_2))
+          .andReturn(new AmbariServerConfigurationHandler())
+          .once();
+    }
 
     replayAll();
 
     SecurityContextHolder.getContext().setAuthentication(authentication);
 
-    resourceProvider.createResources(request);
+    try {
+      resourceProvider.createResources(request);
+      if (opDirective != null) {
+        Assert.fail("Expected SystemException to be thrown");
+      }
+    } catch (AuthorizationException e) {
+      throw e;
+    } catch (SystemException e) {
+      if (opDirective == null) {
+        Assert.fail("Unexpected exception: " + e.getMessage());
+      } else {
+        Assert.assertEquals("The requested operation is not supported for this category: " + CATEGORY_NAME_1, e.getMessage());
+      }
+    }
 
     verifyAll();
 
-    validateCapturedProperties(properties1, capturedProperties1);
-    validateCapturedProperties(properties2, capturedProperties2);
+    if (opDirective == null) {
+      validateCapturedProperties(properties1, capturedProperties1);
+      validateCapturedProperties(properties2, capturedProperties2);
+    } else {
+      Assert.assertFalse(capturedProperties1.hasCaptured());
+      Assert.assertFalse(capturedProperties2.hasCaptured());
+    }
   }
 
   @Test
@@ -185,6 +254,11 @@ public class RootServiceComponentConfigurationResourceProviderTest extends EasyM
     publisher.publish(anyObject(AmbariConfigurationChangedEvent.class));
     expectLastCall().once();
 
+    RootServiceComponentConfigurationHandlerFactory factory = injector.getInstance(RootServiceComponentConfigurationHandlerFactory.class);
+    expect(factory.getInstance(RootService.AMBARI.name(), RootComponent.AMBARI_SERVER.name(), CATEGORY_NAME_1))
+        .andReturn(new AmbariServerConfigurationHandler())
+        .once();
+
     replayAll();
 
     SecurityContextHolder.getContext().setAuthentication(authentication);
@@ -236,6 +310,11 @@ public class RootServiceComponentConfigurationResourceProviderTest extends EasyM
     AmbariConfigurationDAO dao = injector.getInstance(AmbariConfigurationDAO.class);
     expect(dao.findByCategory(CATEGORY_NAME_1)).andReturn(createEntities(CATEGORY_NAME_1, properties)).once();
 
+    RootServiceComponentConfigurationHandlerFactory factory = injector.getInstance(RootServiceComponentConfigurationHandlerFactory.class);
+    expect(factory.getInstance(RootService.AMBARI.name(), RootComponent.AMBARI_SERVER.name(), CATEGORY_NAME_1))
+        .andReturn(new AmbariServerConfigurationHandler())
+        .once();
+
     replayAll();
 
     SecurityContextHolder.getContext().setAuthentication(authentication);
@@ -265,30 +344,55 @@ public class RootServiceComponentConfigurationResourceProviderTest extends EasyM
 
   @Test
   public void testUpdateResources_Administrator() throws Exception {
-    testUpdateResources(TestAuthenticationFactory.createAdministrator());
+    testUpdateResources(TestAuthenticationFactory.createAdministrator(), null);
   }
 
   @Test(expected = AuthorizationException.class)
   public void testUpdateResources_ClusterAdministrator() throws Exception {
-    testUpdateResources(TestAuthenticationFactory.createClusterAdministrator());
+    testUpdateResources(TestAuthenticationFactory.createClusterAdministrator(), null);
   }
 
   @Test(expected = AuthorizationException.class)
   public void testUpdateResources_ClusterOperator() throws Exception {
-    testUpdateResources(TestAuthenticationFactory.createClusterOperator());
+    testUpdateResources(TestAuthenticationFactory.createClusterOperator(), null);
   }
 
   @Test(expected = AuthorizationException.class)
   public void testUpdateResources_ServiceAdministrator() throws Exception {
-    testUpdateResources(TestAuthenticationFactory.createServiceAdministrator());
+    testUpdateResources(TestAuthenticationFactory.createServiceAdministrator(), null);
   }
 
   @Test(expected = AuthorizationException.class)
   public void testUpdateResources_ServiceOperator() throws Exception {
-    testUpdateResources(TestAuthenticationFactory.createServiceOperator());
+    testUpdateResources(TestAuthenticationFactory.createServiceOperator(), null);
+  }
+
+  @Test
+  public void testUpdateResourcesWithDirective_Administrator() throws Exception {
+    testUpdateResources(TestAuthenticationFactory.createAdministrator(), "test-directive");
+  }
+
+  @Test(expected = AuthorizationException.class)
+  public void testUpdateResourcesWithDirective_ClusterAdministrator() throws Exception {
+    testUpdateResources(TestAuthenticationFactory.createClusterAdministrator(), "test-directive");
   }
 
-  private void testUpdateResources(Authentication authentication) throws Exception {
+  @Test(expected = AuthorizationException.class)
+  public void testUpdateResourcesWithDirective_ClusterOperator() throws Exception {
+    testUpdateResources(TestAuthenticationFactory.createClusterOperator(), "test-directive");
+  }
+
+  @Test(expected = AuthorizationException.class)
+  public void testUpdateResourcesWithDirective_ServiceAdministrator() throws Exception {
+    testUpdateResources(TestAuthenticationFactory.createServiceAdministrator(), "test-directive");
+  }
+
+  @Test(expected = AuthorizationException.class)
+  public void testUpdateResourcesWithDirective_ServiceOperator() throws Exception {
+    testUpdateResources(TestAuthenticationFactory.createServiceOperator(), "test-directive");
+  }
+
+  private void testUpdateResources(Authentication authentication, String opDirective) throws Exception {
     Injector injector = createInjector();
 
     ResourceProvider resourceProvider = injector.getInstance(RootServiceComponentConfigurationResourceProvider.class);
@@ -302,29 +406,62 @@ public class RootServiceComponentConfigurationResourceProviderTest extends EasyM
     properties1.put("property2a", "value2");
     propertySets.add(toRequestProperties(CATEGORY_NAME_1, properties1));
 
+    Map<String, String> requestInfoProperties;
+    if (opDirective == null) {
+      requestInfoProperties = Collections.emptyMap();
+    } else {
+      requestInfoProperties = Collections.singletonMap(RootServiceComponentConfigurationService.DIRECTIVE_OPERATION, opDirective);
+    }
+
     Request request = createMock(Request.class);
     expect(request.getProperties()).andReturn(propertySets).once();
+    expect(request.getRequestInfoProperties()).andReturn(requestInfoProperties).once();
 
     Capture<Map<String, String>> capturedProperties1 = newCapture();
 
-    AmbariConfigurationDAO dao = injector.getInstance(AmbariConfigurationDAO.class);
-    expect(dao.reconcileCategory(eq(CATEGORY_NAME_1), capture(capturedProperties1), eq(false)))
-        .andReturn(true)
-        .once();
+    if (opDirective == null) {
+      AmbariConfigurationDAO dao = injector.getInstance(AmbariConfigurationDAO.class);
+      expect(dao.reconcileCategory(eq(CATEGORY_NAME_1), capture(capturedProperties1), eq(false)))
+          .andReturn(true)
+          .once();
 
-    AmbariEventPublisher publisher = injector.getInstance(AmbariEventPublisher.class);
-    publisher.publish(anyObject(AmbariConfigurationChangedEvent.class));
-    expectLastCall().times(1);
+      AmbariEventPublisher publisher = injector.getInstance(AmbariEventPublisher.class);
+      publisher.publish(anyObject(AmbariConfigurationChangedEvent.class));
+      expectLastCall().times(1);
+    }
+
+    RootServiceComponentConfigurationHandlerFactory factory = injector.getInstance(RootServiceComponentConfigurationHandlerFactory.class);
+    expect(factory.getInstance(RootService.AMBARI.name(), RootComponent.AMBARI_SERVER.name(), CATEGORY_NAME_1))
+        .andReturn(new AmbariServerConfigurationHandler())
+        .once();
 
     replayAll();
 
     SecurityContextHolder.getContext().setAuthentication(authentication);
 
-    resourceProvider.updateResources(request, predicate);
+    try {
+      resourceProvider.updateResources(request, predicate);
+
+      if (opDirective != null) {
+        Assert.fail("Expected SystemException to be thrown");
+      }
+    } catch (AuthorizationException e) {
+      throw e;
+    } catch (SystemException e) {
+      if (opDirective == null) {
+        Assert.fail("Unexpected exception: " + e.getMessage());
+      } else {
+        Assert.assertEquals("The requested operation is not supported for this category: " + CATEGORY_NAME_1, e.getMessage());
+      }
+    }
 
     verifyAll();
 
-    validateCapturedProperties(properties1, capturedProperties1);
+    if (opDirective == null) {
+      validateCapturedProperties(properties1, capturedProperties1);
+    } else {
+      Assert.assertFalse(capturedProperties1.hasCaptured());
+    }
   }
 
   private Predicate createPredicate(String serviceName, String componentName, String categoryName) {
@@ -387,6 +524,9 @@ public class RootServiceComponentConfigurationResourceProviderTest extends EasyM
         bind(EntityManager.class).toInstance(createNiceMock(EntityManager.class));
         bind(AmbariConfigurationDAO.class).toInstance(createMock(AmbariConfigurationDAO.class));
         bind(AmbariEventPublisher.class).toInstance(createMock(AmbariEventPublisher.class));
+        bind(RootServiceComponentConfigurationHandlerFactory.class).toInstance(createMock(RootServiceComponentConfigurationHandlerFactory.class));
+
+        binder().requestStaticInjection(AmbariServerConfigurationHandler.class);
       }
     });
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/test/java/org/apache/ambari/server/ldap/LdapModuleFunctionalTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/ldap/LdapModuleFunctionalTest.java b/ambari-server/src/test/java/org/apache/ambari/server/ldap/LdapModuleFunctionalTest.java
index 3917cdf..75c9ea3 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/ldap/LdapModuleFunctionalTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/ldap/LdapModuleFunctionalTest.java
@@ -14,14 +14,18 @@
 
 package org.apache.ambari.server.ldap;
 
+import static org.easymock.EasyMock.createNiceMock;
+
 import java.util.Map;
 
-import org.apache.ambari.server.ldap.domain.AmbariLdapConfigKeys;
+import javax.persistence.EntityManager;
+
 import org.apache.ambari.server.ldap.domain.AmbariLdapConfiguration;
-import org.apache.ambari.server.ldap.domain.AmbariLdapConfigurationFactory;
-import org.apache.ambari.server.ldap.domain.TestAmbariLdapConfigurationFactory;
+import org.apache.ambari.server.ldap.domain.AmbariLdapConfigurationKeys;
 import org.apache.ambari.server.ldap.service.ads.LdapConnectionTemplateFactory;
 import org.apache.ambari.server.ldap.service.ads.detectors.AttributeDetectorFactory;
+import org.apache.ambari.server.orm.DBAccessor;
+import org.apache.ambari.server.state.stack.OsFamily;
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
 import org.apache.directory.api.ldap.model.exception.LdapException;
 import org.apache.directory.ldap.client.api.LdapConnection;
@@ -67,7 +71,9 @@ public class LdapModuleFunctionalTest {
       @Override
       protected void configure() {
         // override the configuration instance binding not to access the database
-        bind(AmbariLdapConfiguration.class).toInstance(new TestAmbariLdapConfigurationFactory().createLdapConfiguration(getADProps()));
+        bind(EntityManager.class).toInstance(createNiceMock(EntityManager.class));
+        bind(DBAccessor.class).toInstance(createNiceMock(DBAccessor.class));
+        bind(OsFamily.class).toInstance(createNiceMock(OsFamily.class));
       }
     });
 
@@ -82,8 +88,7 @@ public class LdapModuleFunctionalTest {
 
     // WHEN
     LdapConnectionTemplateFactory ldapConnectionTemplateFactory = injector.getInstance(LdapConnectionTemplateFactory.class);
-    AmbariLdapConfigurationFactory ambariLdapConfigurationFactory = injector.getInstance(AmbariLdapConfigurationFactory.class);
-    AmbariLdapConfiguration ldapConfiguration = ambariLdapConfigurationFactory.createLdapConfiguration(getADProps());
+    AmbariLdapConfiguration ldapConfiguration = new AmbariLdapConfiguration(getProps());
     LdapConnectionTemplate template = ldapConnectionTemplateFactory.create(ldapConfiguration);
 
     // THEN
@@ -103,36 +108,28 @@ public class LdapModuleFunctionalTest {
   }
 
 
-  private static Map<String, Object> getProps() {
-    Map<String, Object> ldapPropsMap = Maps.newHashMap();
+  private static Map<String, String> getProps() {
+    Map<String, String> ldapPropsMap = Maps.newHashMap();
 
-    ldapPropsMap.put(AmbariLdapConfigKeys.ANONYMOUS_BIND.key(), "true");
-    ldapPropsMap.put(AmbariLdapConfigKeys.SERVER_HOST.key(), "ldap.forumsys.com");
-    ldapPropsMap.put(AmbariLdapConfigKeys.SERVER_PORT.key(), "389");
-    ldapPropsMap.put(AmbariLdapConfigKeys.BIND_DN.key(), "cn=read-only-admin,dc=example,dc=com");
-    ldapPropsMap.put(AmbariLdapConfigKeys.BIND_PASSWORD.key(), "password");
+    ldapPropsMap.put(AmbariLdapConfigurationKeys.ANONYMOUS_BIND.key(), "true");
+    ldapPropsMap.put(AmbariLdapConfigurationKeys.SERVER_HOST.key(), "ldap.forumsys.com");
+    ldapPropsMap.put(AmbariLdapConfigurationKeys.SERVER_PORT.key(), "389");
+    ldapPropsMap.put(AmbariLdapConfigurationKeys.BIND_DN.key(), "cn=read-only-admin,dc=example,dc=com");
+    ldapPropsMap.put(AmbariLdapConfigurationKeys.BIND_PASSWORD.key(), "password");
 //    ldapPropsMap.put(AmbariLdapConfigKeys.USE_SSL.key(), "true");
 
-    ldapPropsMap.put(AmbariLdapConfigKeys.USER_OBJECT_CLASS.key(), SchemaConstants.PERSON_OC);
-    ldapPropsMap.put(AmbariLdapConfigKeys.USER_NAME_ATTRIBUTE.key(), SchemaConstants.UID_AT);
-    ldapPropsMap.put(AmbariLdapConfigKeys.USER_SEARCH_BASE.key(), "dc=example,dc=com");
-    ldapPropsMap.put(AmbariLdapConfigKeys.DN_ATTRIBUTE.key(), SchemaConstants.UID_AT);
+    ldapPropsMap.put(AmbariLdapConfigurationKeys.USER_OBJECT_CLASS.key(), SchemaConstants.PERSON_OC);
+    ldapPropsMap.put(AmbariLdapConfigurationKeys.USER_NAME_ATTRIBUTE.key(), SchemaConstants.UID_AT);
+    ldapPropsMap.put(AmbariLdapConfigurationKeys.USER_SEARCH_BASE.key(), "dc=example,dc=com");
+    ldapPropsMap.put(AmbariLdapConfigurationKeys.DN_ATTRIBUTE.key(), SchemaConstants.UID_AT);
 //    ldapPropsMap.put(AmbariLdapConfigKeys.TRUST_STORE.key(), "custom");
-    ldapPropsMap.put(AmbariLdapConfigKeys.TRUST_STORE_TYPE.key(), "JKS");
+    ldapPropsMap.put(AmbariLdapConfigurationKeys.TRUST_STORE_TYPE.key(), "JKS");
 //    ldapPropsMap.put(AmbariLdapConfigKeys.TRUST_STORE_PATH.key(), "/Users/lpuskas/my_truststore/KeyStore.jks");
 
 
     return ldapPropsMap;
   }
 
-  private static Map<String, String> getADProps() {
-    Map<String, String> ldapPropsMap = Maps.newHashMap();
-
-
-
-    return ldapPropsMap;
-  }
-
   @Test
   public void testShouldDetectorsBeBound() throws Exception {
     // GIVEN

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/test/java/org/apache/ambari/server/ldap/domain/TestAmbariLdapConfigurationFactory.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/ldap/domain/TestAmbariLdapConfigurationFactory.java b/ambari-server/src/test/java/org/apache/ambari/server/ldap/domain/TestAmbariLdapConfigurationFactory.java
deleted file mode 100644
index 1082250..0000000
--- a/ambari-server/src/test/java/org/apache/ambari/server/ldap/domain/TestAmbariLdapConfigurationFactory.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ambari.server.ldap.domain;
-
-
-import java.util.Map;
-
-/**
- * Implementation used for testing purposes only!
- */
-public class TestAmbariLdapConfigurationFactory implements AmbariLdapConfigurationFactory {
-
-  @Override
-  public AmbariLdapConfiguration createLdapConfiguration(Map<String, String> configuration) {
-    return new AmbariLdapConfiguration(configuration);
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/test/java/org/apache/ambari/server/ldap/service/AmbariLdapFacadeTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/ldap/service/AmbariLdapFacadeTest.java b/ambari-server/src/test/java/org/apache/ambari/server/ldap/service/AmbariLdapFacadeTest.java
index 97ce30e..59622b5 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/ldap/service/AmbariLdapFacadeTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/ldap/service/AmbariLdapFacadeTest.java
@@ -17,10 +17,8 @@ package org.apache.ambari.server.ldap.service;
 import java.util.Map;
 import java.util.Set;
 
-import org.apache.ambari.server.ldap.domain.AmbariLdapConfigKeys;
 import org.apache.ambari.server.ldap.domain.AmbariLdapConfiguration;
-import org.apache.ambari.server.ldap.domain.AmbariLdapConfigurationFactory;
-import org.apache.ambari.server.ldap.domain.TestAmbariLdapConfigurationFactory;
+import org.apache.ambari.server.ldap.domain.AmbariLdapConfigurationKeys;
 import org.easymock.Capture;
 import org.easymock.EasyMock;
 import org.easymock.EasyMockRule;
@@ -50,9 +48,6 @@ public class AmbariLdapFacadeTest extends EasyMockSupport {
   @Mock(type = MockType.STRICT)
   public LdapAttributeDetectionService ldapAttributeDetectionServiceMock;
 
-  private AmbariLdapConfigurationFactory ambariLdapConfigurationFactory;
-
-
   @TestSubject
   private LdapFacade ldapFacade = new AmbariLdapFacade();
 
@@ -63,8 +58,7 @@ public class AmbariLdapFacadeTest extends EasyMockSupport {
 
   @Before
   public void before() {
-    ambariLdapConfigurationFactory = new TestAmbariLdapConfigurationFactory();
-    ambariLdapConfiguration = ambariLdapConfigurationFactory.createLdapConfiguration(Maps.newHashMap());
+    ambariLdapConfiguration = new AmbariLdapConfiguration(Maps.newHashMap());
     ambariLdapConfigurationCapture = Capture.newInstance();
 
 
@@ -90,7 +84,7 @@ public class AmbariLdapFacadeTest extends EasyMockSupport {
     // THEN
     // the captured configuration instance is the same the facade method got called with
     Assert.assertEquals("The configuration instance souldn't change before passing it to the service",
-      ambariLdapConfiguration, ambariLdapConfigurationCapture.getValue());
+        ambariLdapConfiguration, ambariLdapConfigurationCapture.getValue());
   }
 
   @Test(expected = AmbariLdapException.class)
@@ -122,10 +116,10 @@ public class AmbariLdapFacadeTest extends EasyMockSupport {
     Capture<String> userDnCapture = Capture.newInstance();
 
     EasyMock.expect(ldapConfigurationServiceMock.checkUserAttributes(EasyMock.capture(testUserCapture), EasyMock.capture(testPasswordCapture),
-      EasyMock.capture(ambariLdapConfigurationCapture))).andReturn("userDn");
+        EasyMock.capture(ambariLdapConfigurationCapture))).andReturn("userDn");
 
     EasyMock.expect(ldapConfigurationServiceMock.checkGroupAttributes(EasyMock.capture(userDnCapture),
-      EasyMock.capture(ambariLdapConfigurationCapture))).andReturn(Sets.newHashSet("userGroup"));
+        EasyMock.capture(ambariLdapConfigurationCapture))).andReturn(Sets.newHashSet("userGroup"));
 
     replayAll();
 
@@ -149,7 +143,7 @@ public class AmbariLdapFacadeTest extends EasyMockSupport {
     parameters.put(AmbariLdapFacade.Parameters.TEST_USER_PASSWORD.getParameterKey(), "testPassword");
 
     EasyMock.expect(ldapConfigurationServiceMock.checkUserAttributes(EasyMock.anyString(), EasyMock.anyString(),
-      EasyMock.anyObject(AmbariLdapConfiguration.class))).andThrow(new AmbariLdapException("Testing ..."));
+        EasyMock.anyObject(AmbariLdapConfiguration.class))).andThrow(new AmbariLdapException("Testing ..."));
 
     replayAll();
 
@@ -164,23 +158,23 @@ public class AmbariLdapFacadeTest extends EasyMockSupport {
 
     // configuration map with user attributes detected
     Map<String, String> userConfigMap = Maps.newHashMap();
-    userConfigMap.put(AmbariLdapConfigKeys.USER_NAME_ATTRIBUTE.key(), "uid");
-    AmbariLdapConfiguration userAttrDecoratedConfig = ambariLdapConfigurationFactory.createLdapConfiguration(userConfigMap);
+    userConfigMap.put(AmbariLdapConfigurationKeys.USER_NAME_ATTRIBUTE.key(), "uid");
+    AmbariLdapConfiguration userAttrDecoratedConfig = new AmbariLdapConfiguration(userConfigMap);
 
     // configuration map with user+group attributes detected
     Map<String, String> groupConfigMap = Maps.newHashMap(userConfigMap);
-    groupConfigMap.put(AmbariLdapConfigKeys.GROUP_NAME_ATTRIBUTE.key(), "dn");
-    AmbariLdapConfiguration groupAttrDecoratedConfig = ambariLdapConfigurationFactory.createLdapConfiguration(groupConfigMap);
+    groupConfigMap.put(AmbariLdapConfigurationKeys.GROUP_NAME_ATTRIBUTE.key(), "dn");
+    AmbariLdapConfiguration groupAttrDecoratedConfig = new AmbariLdapConfiguration(groupConfigMap);
 
     Capture<AmbariLdapConfiguration> userAttrDetectionConfigCapture = Capture.newInstance();
     Capture<AmbariLdapConfiguration> groupAttrDetectionConfigCapture = Capture.newInstance();
 
     // GIVEN
     EasyMock.expect(ldapAttributeDetectionServiceMock.detectLdapUserAttributes(EasyMock.capture(userAttrDetectionConfigCapture)))
-      .andReturn(userAttrDecoratedConfig);
+        .andReturn(userAttrDecoratedConfig);
 
     EasyMock.expect(ldapAttributeDetectionServiceMock.detectLdapGroupAttributes(EasyMock.capture(groupAttrDetectionConfigCapture)))
-      .andReturn(groupAttrDecoratedConfig);
+        .andReturn(groupAttrDecoratedConfig);
 
     replayAll();
 
@@ -189,10 +183,10 @@ public class AmbariLdapFacadeTest extends EasyMockSupport {
 
     // THEN
     Assert.assertEquals("User attribute detection called with the wrong configuration", ambariLdapConfiguration,
-      userAttrDetectionConfigCapture.getValue());
+        userAttrDetectionConfigCapture.getValue());
 
     Assert.assertEquals("Group attribute detection called with the wrong configuration", userAttrDecoratedConfig,
-      groupAttrDetectionConfigCapture.getValue());
+        groupAttrDetectionConfigCapture.getValue());
 
     Assert.assertEquals("Attribute detection returned an invalid configuration", groupAttrDecoratedConfig, detected);
 
@@ -202,7 +196,7 @@ public class AmbariLdapFacadeTest extends EasyMockSupport {
   public void testShouldAttributeDetectionFailuresResultInAmbariLdapException() throws Exception {
     // GIVEN
     EasyMock.expect(ldapAttributeDetectionServiceMock.detectLdapUserAttributes(EasyMock.anyObject(AmbariLdapConfiguration.class)))
-      .andThrow(new AmbariLdapException("Testing ..."));
+        .andThrow(new AmbariLdapException("Testing ..."));
 
     replayAll();
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/test/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapAttributeDetectionServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapAttributeDetectionServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapAttributeDetectionServiceTest.java
index a44bf7c..e23421e 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapAttributeDetectionServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapAttributeDetectionServiceTest.java
@@ -17,10 +17,8 @@ package org.apache.ambari.server.ldap.service.ads;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.ambari.server.ldap.domain.AmbariLdapConfigKeys;
 import org.apache.ambari.server.ldap.domain.AmbariLdapConfiguration;
-import org.apache.ambari.server.ldap.domain.AmbariLdapConfigurationFactory;
-import org.apache.ambari.server.ldap.domain.TestAmbariLdapConfigurationFactory;
+import org.apache.ambari.server.ldap.domain.AmbariLdapConfigurationKeys;
 import org.apache.ambari.server.ldap.service.AmbariLdapException;
 import org.apache.ambari.server.ldap.service.ads.detectors.AttributeDetectorFactory;
 import org.apache.ambari.server.ldap.service.ads.detectors.ChainedAttributeDetector;
@@ -63,9 +61,6 @@ public class DefaultLdapAttributeDetectionServiceTest extends EasyMockSupport {
   @Mock
   private SearchRequest searchRequestMock;
 
-
-  private AmbariLdapConfigurationFactory ldapConfigurationFactory = new TestAmbariLdapConfigurationFactory();
-
   @TestSubject
   private DefaultLdapAttributeDetectionService defaultLdapAttributeDetectionService = new DefaultLdapAttributeDetectionService();
 
@@ -79,8 +74,8 @@ public class DefaultLdapAttributeDetectionServiceTest extends EasyMockSupport {
   public void shouldLdapUserAttributeDetection() throws Exception {
     // GIVEN
     Map<String, String> configMap = Maps.newHashMap();
-    configMap.put(AmbariLdapConfigKeys.USER_SEARCH_BASE.key(), "dc=example,dc=com");
-    AmbariLdapConfiguration ldapConfiguration = ldapConfigurationFactory.createLdapConfiguration(configMap);
+    configMap.put(AmbariLdapConfigurationKeys.USER_SEARCH_BASE.key(), "dc=example,dc=com");
+    AmbariLdapConfiguration ldapConfiguration = new AmbariLdapConfiguration(configMap);
 
     List<Object> entryList = Lists.newArrayList(new DefaultEntry("uid=gauss"));
 
@@ -110,8 +105,8 @@ public class DefaultLdapAttributeDetectionServiceTest extends EasyMockSupport {
   public void testShouldUserAttributeDetectionFailWhenLdapOerationFails() throws Exception {
     // GIVEN
     Map<String, String> configMap = Maps.newHashMap();
-    configMap.put(AmbariLdapConfigKeys.USER_SEARCH_BASE.key(), "dc=example,dc=com");
-    AmbariLdapConfiguration ldapConfiguration = ldapConfigurationFactory.createLdapConfiguration(configMap);
+    configMap.put(AmbariLdapConfigurationKeys.USER_SEARCH_BASE.key(), "dc=example,dc=com");
+    AmbariLdapConfiguration ldapConfiguration = new AmbariLdapConfiguration(configMap);
 
     EasyMock.expect(ldapConnectionTemplateFactoryMock.create(ldapConfiguration)).andThrow(new AmbariLdapException("Testing ..."));
 
@@ -130,8 +125,8 @@ public class DefaultLdapAttributeDetectionServiceTest extends EasyMockSupport {
   public void shouldLdapGroupAttributeDetection() throws Exception {
     // GIVEN
     Map<String, String> configMap = Maps.newHashMap();
-    configMap.put(AmbariLdapConfigKeys.GROUP_SEARCH_BASE.key(), "dc=example,dc=com");
-    AmbariLdapConfiguration ldapConfiguration = ldapConfigurationFactory.createLdapConfiguration(configMap);
+    configMap.put(AmbariLdapConfigurationKeys.GROUP_SEARCH_BASE.key(), "dc=example,dc=com");
+    AmbariLdapConfiguration ldapConfiguration = new AmbariLdapConfiguration(configMap);
 
     List<Object> entryList = Lists.newArrayList(new DefaultEntry("uid=gauss"));
 
@@ -161,8 +156,8 @@ public class DefaultLdapAttributeDetectionServiceTest extends EasyMockSupport {
   public void testShouldGroupAttributeDetectionFailWhenLdapOerationFails() throws Exception {
     // GIVEN
     Map<String, String> configMap = Maps.newHashMap();
-    configMap.put(AmbariLdapConfigKeys.GROUP_SEARCH_BASE.key(), "dc=example,dc=com");
-    AmbariLdapConfiguration ldapConfiguration = ldapConfigurationFactory.createLdapConfiguration(configMap);
+    configMap.put(AmbariLdapConfigurationKeys.GROUP_SEARCH_BASE.key(), "dc=example,dc=com");
+    AmbariLdapConfiguration ldapConfiguration = new AmbariLdapConfiguration(configMap);
 
     EasyMock.expect(ldapConnectionTemplateFactoryMock.create(ldapConfiguration)).andThrow(new AmbariLdapException("Testing ..."));
 
@@ -175,7 +170,6 @@ public class DefaultLdapAttributeDetectionServiceTest extends EasyMockSupport {
 
   }
 
-
   private EntryMapper<Entry> entryMapperMock() {
     return new EntryMapper<Entry>() {
       @Override

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/test/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapConfigurationServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapConfigurationServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapConfigurationServiceTest.java
index ec78e56..998844c 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapConfigurationServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapConfigurationServiceTest.java
@@ -17,9 +17,8 @@ package org.apache.ambari.server.ldap.service.ads;
 import java.util.Map;
 import java.util.Set;
 
-import org.apache.ambari.server.ldap.domain.AmbariLdapConfigKeys;
 import org.apache.ambari.server.ldap.domain.AmbariLdapConfiguration;
-import org.apache.ambari.server.ldap.domain.TestAmbariLdapConfigurationFactory;
+import org.apache.ambari.server.ldap.domain.AmbariLdapConfigurationKeys;
 import org.apache.ambari.server.ldap.service.AmbariLdapException;
 import org.apache.ambari.server.ldap.service.LdapConfigurationService;
 import org.apache.directory.api.ldap.model.message.SearchRequest;
@@ -65,7 +64,7 @@ public class DefaultLdapConfigurationServiceTest extends EasyMockSupport {
   @Test
   public void testShouldConnectionCheckSucceedWhenConnectionCallbackSucceeds() throws Exception {
     // GIVEN
-    AmbariLdapConfiguration ambariLdapConfiguration = new TestAmbariLdapConfigurationFactory().createLdapConfiguration(Maps.newHashMap());
+    AmbariLdapConfiguration ambariLdapConfiguration = new AmbariLdapConfiguration(Maps.newHashMap());
 
     // the cllback returns TRUE
     EasyMock.expect(ldapConnectionTemplateMock.execute(EasyMock.anyObject(ConnectionCallback.class))).andReturn(Boolean.TRUE);
@@ -84,7 +83,7 @@ public class DefaultLdapConfigurationServiceTest extends EasyMockSupport {
   public void testShouldConnectionCheckFailWhenConnectionCallbackFails() throws Exception {
 
     // GIVEN
-    AmbariLdapConfiguration ambariLdapConfiguration = new TestAmbariLdapConfigurationFactory().createLdapConfiguration(Maps.newHashMap());
+    AmbariLdapConfiguration ambariLdapConfiguration = new AmbariLdapConfiguration(Maps.newHashMap());
 
     // the callback returns FALSE
     EasyMock.expect(ldapConnectionTemplateMock.execute(EasyMock.anyObject(ConnectionCallback.class))).andReturn(Boolean.FALSE);
@@ -103,10 +102,10 @@ public class DefaultLdapConfigurationServiceTest extends EasyMockSupport {
   public void testShouldUserAttributeConfigurationCheckSucceedWhenUserDnIsFound() throws Exception {
     // GIVEN
     Map<String, String> configMap = Maps.newHashMap();
-    configMap.put(AmbariLdapConfigKeys.USER_OBJECT_CLASS.key(), "person");
-    configMap.put(AmbariLdapConfigKeys.USER_NAME_ATTRIBUTE.key(), "uid");
+    configMap.put(AmbariLdapConfigurationKeys.USER_OBJECT_CLASS.key(), "person");
+    configMap.put(AmbariLdapConfigurationKeys.USER_NAME_ATTRIBUTE.key(), "uid");
 
-    AmbariLdapConfiguration ambariLdapConfiguration = new TestAmbariLdapConfigurationFactory().createLdapConfiguration(configMap);
+    AmbariLdapConfiguration ambariLdapConfiguration = new AmbariLdapConfiguration(configMap);
 
     // the callback returns FALSE
     EasyMock.expect(ldapConnectionTemplateFactory.create(ambariLdapConfiguration)).andReturn(ldapConnectionTemplateMock);
@@ -127,10 +126,10 @@ public class DefaultLdapConfigurationServiceTest extends EasyMockSupport {
   public void testShouldUserAttributeConfigurationCheckFailWhenNoUsersFound() throws Exception {
     // GIVEN
     Map<String, String> configMap = Maps.newHashMap();
-    configMap.put(AmbariLdapConfigKeys.USER_OBJECT_CLASS.key(), "posixAccount");
-    configMap.put(AmbariLdapConfigKeys.USER_NAME_ATTRIBUTE.key(), "dn");
+    configMap.put(AmbariLdapConfigurationKeys.USER_OBJECT_CLASS.key(), "posixAccount");
+    configMap.put(AmbariLdapConfigurationKeys.USER_NAME_ATTRIBUTE.key(), "dn");
 
-    AmbariLdapConfiguration ambariLdapConfiguration = new TestAmbariLdapConfigurationFactory().createLdapConfiguration(configMap);
+    AmbariLdapConfiguration ambariLdapConfiguration = new AmbariLdapConfiguration(configMap);
 
     // the callback returns FALSE
     EasyMock.expect(ldapConnectionTemplateFactory.create(ambariLdapConfiguration)).andReturn(ldapConnectionTemplateMock);
@@ -159,7 +158,7 @@ public class DefaultLdapConfigurationServiceTest extends EasyMockSupport {
 
     SearchRequest sr = new SearchRequestImpl();
 
-    AmbariLdapConfiguration ambariLdapConfiguration = new TestAmbariLdapConfigurationFactory().createLdapConfiguration(configMap);
+    AmbariLdapConfiguration ambariLdapConfiguration = new AmbariLdapConfiguration(configMap);
 
     // the callback returns FALSE
     EasyMock.expect(ldapConnectionTemplateFactory.create(ambariLdapConfiguration)).andReturn(ldapConnectionTemplateMock);
@@ -188,7 +187,7 @@ public class DefaultLdapConfigurationServiceTest extends EasyMockSupport {
 
     SearchRequest sr = new SearchRequestImpl();
 
-    AmbariLdapConfiguration ambariLdapConfiguration = new TestAmbariLdapConfigurationFactory().createLdapConfiguration(configMap);
+    AmbariLdapConfiguration ambariLdapConfiguration = new AmbariLdapConfiguration(configMap);
 
     // the callback returns FALSE
     EasyMock.expect(ldapConnectionTemplateFactory.create(ambariLdapConfiguration)).andReturn(ldapConnectionTemplateMock);
@@ -210,10 +209,10 @@ public class DefaultLdapConfigurationServiceTest extends EasyMockSupport {
 
   private Map<String, String> groupConfigObjectMap() {
     Map<String, String> configMap = Maps.newHashMap();
-    configMap.put(AmbariLdapConfigKeys.GROUP_OBJECT_CLASS.key(), "groupOfNames");
-    configMap.put(AmbariLdapConfigKeys.GROUP_SEARCH_BASE.key(), "dc=example,dc=com");
-    configMap.put(AmbariLdapConfigKeys.GROUP_NAME_ATTRIBUTE.key(), "uid");
-    configMap.put(AmbariLdapConfigKeys.GROUP_MEMBER_ATTRIBUTE.key(), "member");
+    configMap.put(AmbariLdapConfigurationKeys.GROUP_OBJECT_CLASS.key(), "groupOfNames");
+    configMap.put(AmbariLdapConfigurationKeys.GROUP_SEARCH_BASE.key(), "dc=example,dc=com");
+    configMap.put(AmbariLdapConfigurationKeys.GROUP_NAME_ATTRIBUTE.key(), "uid");
+    configMap.put(AmbariLdapConfigurationKeys.GROUP_MEMBER_ATTRIBUTE.key(), "member");
     return configMap;
   }
 


[17/29] ambari git commit: AMBARI-22544. Upgrade from Ambari 2.5.2 to 2.6.0 fails. (mpapirkovskyy)

Posted by rl...@apache.org.
AMBARI-22544. Upgrade from Ambari 2.5.2 to 2.6.0 fails. (mpapirkovskyy)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/195195fa
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/195195fa
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/195195fa

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 195195fac3fc625c21e5229af8130a854998f99b
Parents: f822778
Author: Myroslav Papirkovskyi <mp...@hortonworks.com>
Authored: Wed Nov 29 22:44:40 2017 +0200
Committer: Myroslav Papirkovskyi <mp...@hortonworks.com>
Committed: Thu Nov 30 22:10:32 2017 +0200

----------------------------------------------------------------------
 .../java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java | 4 ++++
 .../org/apache/ambari/server/upgrade/UpgradeCatalog260Test.java  | 4 ++++
 2 files changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/195195fa/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
index 4d9a5da..11b765c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
@@ -104,6 +104,8 @@ public class UpgradeCatalog260 extends AbstractUpgradeCatalog {
   public static final String FK_SDS_DESIRED_STACK_ID = "FK_sds_desired_stack_id";
   public static final String FK_REPO_VERSION_ID = "FK_repo_version_id";
 
+  public static final String CLUSTERS_TABLE = "clusters";
+
   public static final String UPGRADE_TABLE = "upgrade";
   public static final String UPGRADE_GROUP_TABLE = "upgrade_group";
   public static final String UPGRADE_ITEM_TABLE = "upgrade_item";
@@ -346,6 +348,8 @@ public class UpgradeCatalog260 extends AbstractUpgradeCatalog {
    * @throws java.sql.SQLException
    */
   private void updateUpgradeTable() throws SQLException {
+    dbAccessor.clearTableColumn(CLUSTERS_TABLE, UPGRADE_ID_COLUMN, null);
+
     dbAccessor.clearTable(UPGRADE_ITEM_TABLE);
     dbAccessor.clearTable(UPGRADE_GROUP_TABLE);
     dbAccessor.clearTable(UPGRADE_TABLE);

http://git-wip-us.apache.org/repos/asf/ambari/blob/195195fa/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog260Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog260Test.java b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog260Test.java
index 22e8ccc..c88d1a1 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog260Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog260Test.java
@@ -341,6 +341,10 @@ public class UpgradeCatalog260Test {
                                        Capture<DBColumnInfo> orchestration, Capture<DBColumnInfo> revertAllowed)
       throws SQLException {
 
+    dbAccessor.clearTableColumn(eq(UpgradeCatalog260.CLUSTERS_TABLE), eq(UpgradeCatalog260.UPGRADE_ID_COLUMN),
+        eq(null));
+    expectLastCall().once();
+
     dbAccessor.clearTable(eq(UpgradeCatalog260.UPGRADE_TABLE));
     expectLastCall().once();
 


[16/29] ambari git commit: AMBARI-22485 : Allow Ambari to support non-kerberos SASL mechanisms for Kafka - Addendum, missed the new files (ydavis via mradhakrishnan)

Posted by rl...@apache.org.
AMBARI-22485 : Allow Ambari to support non-kerberos SASL mechanisms for Kafka - Addendum, missed the new files (ydavis via mradhakrishnan)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f8227780
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f8227780
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f8227780

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: f8227780834f1b795a815380c8d2951fed1ea9ca
Parents: 4aef8fe
Author: Madhuvanthi Radhakrishnan <mr...@hortonworks.com>
Authored: Thu Nov 30 11:56:43 2017 -0800
Committer: Madhuvanthi Radhakrishnan <mr...@hortonworks.com>
Committed: Thu Nov 30 11:56:43 2017 -0800

----------------------------------------------------------------------
 .../KAFKA/0.10.0/configuration/kafka-broker.xml |  39 ++
 .../configuration/kafka_client_jaas_conf.xml    |  43 ++
 .../0.10.0/configuration/kafka_jaas_conf.xml    | 116 ++++
 .../2.6/KAFKA/test_kafka_broker_other_sasl.py   |  97 +++
 .../2.6/configs/default_kafka_plaintext.json    | 631 +++++++++++++++++++
 .../configs/default_kafka_plaintextsasl.json    | 631 +++++++++++++++++++
 .../configs/default_kafka_sasl_plaintext.json   | 631 +++++++++++++++++++
 .../2.6/configs/default_kafka_sasl_ssl.json     | 631 +++++++++++++++++++
 8 files changed, 2819 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f8227780/ambari-server/src/main/resources/common-services/KAFKA/0.10.0/configuration/kafka-broker.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.10.0/configuration/kafka-broker.xml b/ambari-server/src/main/resources/common-services/KAFKA/0.10.0/configuration/kafka-broker.xml
new file mode 100644
index 0000000..da382d5
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.10.0/configuration/kafka-broker.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0"?>
+<!--
+ censed 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.
+ */
+-->
+<configuration xmlns:xi="http://www.w3.org/2001/XInclude" supports_final="true">
+    <property>
+        <name>sasl.enabled.mechanisms</name>
+        <value>GSSAPI</value>
+        <description>The list of SASL mechanisms enabled in the Kafka server. The list may contain any mechanism for which a security provider is available. Only GSSAPI is enabled by default.</description>
+        <on-ambari-upgrade add="upgrade"/>
+    </property>
+    <property>
+        <name>security.inter.broker.protocol</name>
+        <value>PLAINTEXT</value>
+        <description>Security protocol used to communicate between brokers. Valid values are: PLAINTEXT, SSL, SASL_PLAINTEXT, SASL_SSL. It is an error to set this and inter.broker.listener.name properties at the same time.</description>
+        <on-ambari-upgrade add="true"/>
+    </property>
+    <property>
+        <name>sasl.mechanism.inter.broker.protocol</name>
+        <value>GSSAPI</value>
+        <description>SASL mechanism used for inter-broker communication. Default is GSSAPI.</description>
+        <on-ambari-upgrade add="true"/>
+    </property>
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f8227780/ambari-server/src/main/resources/common-services/KAFKA/0.10.0/configuration/kafka_client_jaas_conf.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.10.0/configuration/kafka_client_jaas_conf.xml b/ambari-server/src/main/resources/common-services/KAFKA/0.10.0/configuration/kafka_client_jaas_conf.xml
new file mode 100644
index 0000000..56ad27f
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.10.0/configuration/kafka_client_jaas_conf.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * 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.
+ */
+-->
+<configuration supports_final="false" supports_adding_forbidden="true">
+    <property>
+        <name>content</name>
+        <display-name>kafka_client_jaas template</display-name>
+        <description>Kafka client jaas config</description>
+        <value>
+{% if kerberos_security_enabled %}
+KafkaClient {
+com.sun.security.auth.module.Krb5LoginModule required
+useTicketCache=true
+renewTicket=true
+serviceName="{{kafka_bare_jaas_principal}}";
+};
+{% endif %}
+        </value>
+        <value-attributes>
+            <type>content</type>
+            <show-property-name>false</show-property-name>
+        </value-attributes>
+        <on-ambari-upgrade add="true"/>
+    </property>
+</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/f8227780/ambari-server/src/main/resources/common-services/KAFKA/0.10.0/configuration/kafka_jaas_conf.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.10.0/configuration/kafka_jaas_conf.xml b/ambari-server/src/main/resources/common-services/KAFKA/0.10.0/configuration/kafka_jaas_conf.xml
new file mode 100644
index 0000000..acedf7b
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.10.0/configuration/kafka_jaas_conf.xml
@@ -0,0 +1,116 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * 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.
+ */
+-->
+<configuration supports_final="false" supports_adding_forbidden="true">
+    <property>
+        <name>content</name>
+        <display-name>kafka_jaas template</display-name>
+        <description>Kafka jaas configuration file</description>
+        <value>
+/**
+* Example of SASL/PLAIN Configuration
+*
+* KafkaServer {
+*   org.apache.kafka.common.security.plain.PlainLoginModule required
+*   username="admin"
+*   password="admin-secret"
+*   user_admin="admin-secret"
+*   user_alice="alice-secret";
+*   };
+*
+* Example of SASL/SCRAM
+*
+* KafkaServer {
+*   org.apache.kafka.common.security.scram.ScramLoginModule required
+*   username="admin"
+*   password="admin-secret"
+*   };
+*
+* Example of Enabling multiple SASL mechanisms in a broker:
+*
+*   KafkaServer {
+*
+*    com.sun.security.auth.module.Krb5LoginModule required
+*    useKeyTab=true
+*    storeKey=true
+*    keyTab="/etc/security/keytabs/kafka_server.keytab"
+*    principal="kafka/kafka1.hostname.com@EXAMPLE.COM";
+*
+*    org.apache.kafka.common.security.plain.PlainLoginModule required
+*    username="admin"
+*    password="admin-secret"
+*    user_admin="admin-secret"
+*    user_alice="alice-secret";
+*
+*    org.apache.kafka.common.security.scram.ScramLoginModule required
+*    username="scram-admin"
+*    password="scram-admin-secret";
+*    };
+*
+**/
+
+{% if kerberos_security_enabled %}
+
+    KafkaServer {
+    com.sun.security.auth.module.Krb5LoginModule required
+    useKeyTab=true
+    keyTab="{{kafka_keytab_path}}"
+    storeKey=true
+    useTicketCache=false
+    serviceName="{{kafka_bare_jaas_principal}}"
+    principal="{{kafka_jaas_principal}}";
+    };
+    KafkaClient {
+    com.sun.security.auth.module.Krb5LoginModule required
+    useTicketCache=true
+    renewTicket=true
+    serviceName="{{kafka_bare_jaas_principal}}";
+    };
+    Client {
+    com.sun.security.auth.module.Krb5LoginModule required
+    useKeyTab=true
+    keyTab="{{kafka_keytab_path}}"
+    storeKey=true
+    useTicketCache=false
+    serviceName="zookeeper"
+    principal="{{kafka_jaas_principal}}";
+    };
+    com.sun.security.jgss.krb5.initiate {
+    com.sun.security.auth.module.Krb5LoginModule required
+    renewTGT=false
+    doNotPrompt=true
+    useKeyTab=true
+    keyTab="{{kafka_keytab_path}}"
+    storeKey=true
+    useTicketCache=false
+    serviceName="{{kafka_bare_jaas_principal}}"
+    principal="{{kafka_jaas_principal}}";
+    };
+
+{% endif %}
+        </value>
+        <value-attributes>
+            <type>content</type>
+            <show-property-name>false</show-property-name>
+        </value-attributes>
+        <on-ambari-upgrade add="true"/>
+    </property>
+</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/f8227780/ambari-server/src/test/python/stacks/2.6/KAFKA/test_kafka_broker_other_sasl.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.6/KAFKA/test_kafka_broker_other_sasl.py b/ambari-server/src/test/python/stacks/2.6/KAFKA/test_kafka_broker_other_sasl.py
new file mode 100644
index 0000000..e0bab40
--- /dev/null
+++ b/ambari-server/src/test/python/stacks/2.6/KAFKA/test_kafka_broker_other_sasl.py
@@ -0,0 +1,97 @@
+#!/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 json
+from stacks.utils.RMFTestCase import *
+from mock.mock import patch
+
+from only_for_platform import not_for_platform, PLATFORM_WINDOWS
+
+@not_for_platform(PLATFORM_WINDOWS)
+class TestKafkaBroker(RMFTestCase):
+    COMMON_SERVICES_PACKAGE_DIR = "KAFKA/0.8.1/package"
+    STACK_VERSION = "2.6"
+    CONFIG_OVERRIDES = {"serviceName":"KAFKA", "role":"KAFKA_BROKER"}
+
+    def test_configure_plaintextsasl(self):
+        self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/kafka_broker.py",
+                           classname = "KafkaBroker",
+                           command = "configure",
+                           config_file="default_kafka_plaintextsasl.json",
+                           stack_version = self.STACK_VERSION,
+                           target = RMFTestCase.TARGET_COMMON_SERVICES
+                           )
+
+        self.assertResourceCalledIgnoreEarlier('TemplateConfig', '/usr/hdp/current/kafka-broker/config/kafka_jaas.conf',
+                                  owner = 'kafka')
+
+        self.assertResourceCalledIgnoreEarlier('TemplateConfig', '/usr/hdp/current/kafka-broker/config/kafka_client_jaas.conf',
+                                               owner = 'kafka')
+
+    def test_configure_sasl_plaintext(self):
+        self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/kafka_broker.py",
+                           classname = "KafkaBroker",
+                           command = "configure",
+                           config_file="default_kafka_sasl_plaintext.json",
+                           stack_version = self.STACK_VERSION,
+                           target = RMFTestCase.TARGET_COMMON_SERVICES
+                           )
+
+        self.assertResourceCalledIgnoreEarlier('TemplateConfig', '/usr/hdp/current/kafka-broker/config/kafka_jaas.conf',
+                                               owner = 'kafka')
+
+        self.assertResourceCalledIgnoreEarlier('TemplateConfig', '/usr/hdp/current/kafka-broker/config/kafka_client_jaas.conf',
+                                               owner = 'kafka')
+
+    def test_configure_sasl_ssl(self):
+        self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/kafka_broker.py",
+                           classname = "KafkaBroker",
+                           command = "configure",
+                           config_file="default_kafka_sasl_ssl.json",
+                           stack_version = self.STACK_VERSION,
+                           target = RMFTestCase.TARGET_COMMON_SERVICES
+                           )
+
+        self.assertResourceCalledIgnoreEarlier('TemplateConfig', '/usr/hdp/current/kafka-broker/config/kafka_jaas.conf',
+                                               owner = 'kafka')
+
+        self.assertResourceCalledIgnoreEarlier('TemplateConfig', '/usr/hdp/current/kafka-broker/config/kafka_client_jaas.conf',
+                                               owner = 'kafka')
+
+
+    def test_configure_plaintext(self):
+        self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/kafka_broker.py",
+                           classname = "KafkaBroker",
+                           command = "configure",
+                           config_file="default_kafka_plaintext.json",
+                           stack_version = self.STACK_VERSION,
+                           target = RMFTestCase.TARGET_COMMON_SERVICES
+                           )
+
+        try:
+            self.assertResourceCalledIgnoreEarlier('TemplateConfig', '/usr/hdp/current/kafka-broker/config/kafka_jaas.conf',
+                                               owner = 'kafka')
+        except AssertionError:
+            pass
+
+        try:
+            self.assertResourceCalledIgnoreEarlier('TemplateConfig', '/usr/hdp/current/kafka-broker/config/kafka_client_jaas.conf',
+                                               owner = 'kafka')
+        except AssertionError:
+            pass

http://git-wip-us.apache.org/repos/asf/ambari/blob/f8227780/ambari-server/src/test/python/stacks/2.6/configs/default_kafka_plaintext.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.6/configs/default_kafka_plaintext.json b/ambari-server/src/test/python/stacks/2.6/configs/default_kafka_plaintext.json
new file mode 100644
index 0000000..aee3d1b
--- /dev/null
+++ b/ambari-server/src/test/python/stacks/2.6/configs/default_kafka_plaintext.json
@@ -0,0 +1,631 @@
+{
+  "roleCommand": "SERVICE_CHECK",
+  "clusterName": "c1",
+  "hostname": "c6401.ambari.apache.org",
+  "hostLevelParams": {
+    "not_managed_hdfs_path_list": "[\"/apps/hive/warehouse\",\"/apps/falcon\",\"/mr-history/done\",\"/app-logs\",\"/tmp\"]",
+    "agent_stack_retry_count": "5",
+    "agent_stack_retry_on_unavailability": "false",
+    "jdk_location": "http://c6401.ambari.apache.org:8080/resources/",
+    "ambari_db_rca_password": "mapred",
+    "ambari_db_rca_url": "jdbc:postgresql://c6401.ambari.apache.org/ambarirca",
+    "jce_name": "UnlimitedJCEPolicyJDK7.zip",
+    "stack_version": "2.6.5.0",
+    "stack_name": "HDP",
+    "ambari_db_rca_driver": "org.postgresql.Driver",
+    "jdk_name": "jdk-7u67-linux-x64.tar.gz",
+    "ambari_db_rca_username": "mapred",
+    "java_home": "/usr/jdk64/jdk1.7.0_45",
+    "db_name": "ambari",
+    "custom_mysql_jdbc_name": "mysql-connector-java.jar"
+  },
+  "commandType": "EXECUTION_COMMAND",
+  "roleParams": {},
+  "serviceName": "SLIDER",
+  "role": "SLIDER",
+  "commandParams": {
+    "version": "2.6.5.0-1235",
+    "command_timeout": "300",
+    "service_package_folder": "OOZIE",
+    "script_type": "PYTHON",
+    "script": "scripts/service_check.py",
+    "excluded_hosts": "host1,host2"
+  },
+  "taskId": 152,
+  "public_hostname": "c6401.ambari.apache.org",
+  "configurations": {
+    "slider-client": {
+      "slider.yarn.queue": "default"
+    },
+    "sqoop-site": {
+      "atlas.cluster.name": "c1",
+      "sqoop.job.data.publish.class": "org.apache.atlas.sqoop.hook.SqoopHook"
+    },
+    "mahout-env": {
+      "mahout_user": "mahout"
+    },
+    "hbase-env": {
+      "hbase_user": "hbase"
+    },
+    "yarn-env": {
+      "yarn_user": "yarn"
+    },
+    "mahout-log4j": {
+      "content": "\n            #\n            #\n            # Licensed to the Apache Software Foundation (ASF) under one\n            # or more contributor license agreements.  See the NOTICE file\n            # distributed with this work for additional information\n            # regarding copyright ownership.  The ASF licenses this file\n            # to you under the Apache License, Version 2.0 (the\n            # \"License\"); you may not use this file except in compliance\n            # with the License.  You may obtain a copy of the License at\n            #\n            #   http://www.apache.org/licenses/LICENSE-2.0\n            #\n            # Unless required by applicable law or agreed to in writing,\n            # software distributed under the License is distributed on an\n            # \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n            # KIND, either express or implied.  See the License for the\n            # specific language governing permissions a
 nd limitations\n            # under the License.\n            #\n            #\n            #\n\n            # Set everything to be logged to the console\n            log4j.rootCategory=WARN, console\n            log4j.appender.console=org.apache.log4j.ConsoleAppender\n            log4j.appender.console.target=System.err\n            log4j.appender.console.layout=org.apache.log4j.PatternLayout\n            log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n\n\n            # Settings to quiet third party logs that are too verbose\n            log4j.logger.org.eclipse.jetty=WARN\n            log4j.logger.org.apache.spark.repl.SparkIMain$exprTyper=WARN\n            log4j.logger.org.apache.spark.repl.SparkILoop$SparkILoopInterpreter=WARN"
+    },
+    "hadoop-env": {
+      "hdfs_user": "hdfs",
+      "hdfs_tmp_dir": "/tmp"
+    },
+    "core-site": {
+      "fs.defaultFS": "hdfs://c6401.ambari.apache.org:8020"
+    },
+    "hdfs-site": {
+      "a": "b"
+    },
+    "yarn-site": {
+      "yarn.application.classpath": "/etc/hadoop/conf,/usr/lib/hadoop/*,/usr/lib/hadoop/lib/*,/usr/lib/hadoop-hdfs/*,/usr/lib/hadoop-hdfs/lib/*,/usr/lib/hadoop-yarn/*,/usr/lib/hadoop-yarn/lib/*,/usr/lib/hadoop-mapreduce/*,/usr/lib/hadoop-mapreduce/lib/*",
+      "yarn.resourcemanager.address": "c6401.ambari.apache.org:8050",
+      "yarn.resourcemanager.scheduler.address": "c6401.ambari.apache.org:8030"
+    },
+    "cluster-env": {
+      "managed_hdfs_resource_property_names": "",
+      "security_enabled": "false",
+      "ignore_groupsusers_create": "false",
+      "smokeuser": "ambari-qa",
+      "kerberos_domain": "EXAMPLE.COM",
+      "user_group": "hadoop"
+    },
+    "webhcat-site": {
+      "templeton.jar": "/usr/hdp/current/hive-webhcat/share/webhcat/svr/lib/hive-webhcat-*.jar",
+      "templeton.pig.archive": "hdfs:///hdp/apps/{{ hdp_stack_version }}/pig/pig.tar.gz",
+      "templeton.hive.archive": "hdfs:///hdp/apps/{{ hdp_stack_version }}/hive/hive.tar.gz",
+      "templeton.sqoop.archive": "hdfs:///hdp/apps/{{ hdp_stack_version }}/sqoop/sqoop.tar.gz",
+      "templeton.streaming.jar": "hdfs:///hdp/apps/{{ hdp_stack_version }}/mr/hadoop-streaming.jar"
+    },
+    "slider-log4j": {
+      "content": "log4jproperties\nline2"
+    },
+    "slider-env": {
+      "content": "envproperties\nline2"
+    },
+    "gateway-site": {
+      "java.security.auth.login.config": "/etc/knox/conf/krb5JAASLogin.conf",
+      "gateway.hadoop.kerberos.secured": "false",
+      "gateway.gateway.conf.dir": "deployments",
+      "gateway.path": "gateway",
+      "sun.security.krb5.debug": "true",
+      "java.security.krb5.conf": "/etc/knox/conf/krb5.conf",
+      "gateway.port": "8443"
+    },
+
+    "users-ldif": {
+      "content": "\n            # Licensed to the Apache Software Foundation (ASF) under one\n            # or more contributor license agreements.  See the NOTICE file\n            # distributed with this work for additional information\n            # regarding copyright ownership.  The ASF licenses this file\n            # to you under the Apache License, Version 2.0 (the\n            # \"License\"); you may not use this file except in compliance\n            # with the License.  You may obtain a copy of the License at\n            #\n            #     http://www.apache.org/licenses/LICENSE-2.0\n            #\n            # Unless required by applicable law or agreed to in writing, software\n            # distributed under the License is distributed on an \"AS IS\" BASIS,\n            # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n            # See the License for the specific language governing permissions and\n            # limitations under the Lice
 nse.\n\n            version: 1\n\n            # Please replace with site specific values\n            dn: dc=hadoop,dc=apache,dc=org\n            objectclass: organization\n            objectclass: dcObject\n            o: Hadoop\n            dc: hadoop\n\n            # Entry for a sample people container\n            # Please replace with site specific values\n            dn: ou=people,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass:organizationalUnit\n            ou: people\n\n            # Entry for a sample end user\n            # Please replace with site specific values\n            dn: uid=guest,ou=people,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass:person\n            objectclass:organizationalPerson\n            objectclass:inetOrgPerson\n            cn: Guest\n            sn: User\n            uid: guest\n            userPassword:guest-password\n\n            # entry for sample user admin\n            dn: 
 uid=admin,ou=people,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass:person\n            objectclass:organizationalPerson\n            objectclass:inetOrgPerson\n            cn: Admin\n            sn: Admin\n            uid: admin\n            userPassword:admin-password\n\n            # entry for sample user sam\n            dn: uid=sam,ou=people,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass:person\n            objectclass:organizationalPerson\n            objectclass:inetOrgPerson\n            cn: sam\n            sn: sam\n            uid: sam\n            userPassword:sam-password\n\n            # entry for sample user tom\n            dn: uid=tom,ou=people,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass:person\n            objectclass:organizationalPerson\n            objectclass:inetOrgPerson\n            cn: tom\n            sn: tom\n            uid: tom\n            userPasswor
 d:tom-password\n\n            # create FIRST Level groups branch\n            dn: ou=groups,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass:organizationalUnit\n            ou: groups\n            description: generic groups branch\n\n            # create the analyst group under groups\n            dn: cn=analyst,ou=groups,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass: groupofnames\n            cn: analyst\n            description:analyst  group\n            member: uid=sam,ou=people,dc=hadoop,dc=apache,dc=org\n            member: uid=tom,ou=people,dc=hadoop,dc=apache,dc=org\n\n\n            # create the scientist group under groups\n            dn: cn=scientist,ou=groups,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass: groupofnames\n            cn: scientist\n            description: scientist group\n            member: uid=sam,ou=people,dc=hadoop,dc=apache,dc=org"
+    },
+
+    "topology": {
+      "content": "\n        <topology>\n\n            <gateway>\n\n                <provider>\n                    <role>authentication</role>\n                    <name>ShiroProvider</name>\n                    <enabled>true</enabled>\n                    <param>\n                        <name>sessionTimeout</name>\n                        <value>30</value>\n                    </param>\n                    <param>\n                        <name>main.ldapRealm</name>\n                        <value>org.apache.hadoop.gateway.shirorealm.KnoxLdapRealm</value>\n                    </param>\n                    <param>\n                        <name>main.ldapRealm.userDnTemplate</name>\n                        <value>uid={0},ou=people,dc=hadoop,dc=apache,dc=org</value>\n                    </param>\n                    <param>\n                        <name>main.ldapRealm.contextFactory.url</name>\n                        <value>ldap://{{knox_host_name}}:33389</value>\n                 
    </param>\n                    <param>\n                        <name>main.ldapRealm.contextFactory.authenticationMechanism</name>\n                        <value>simple</value>\n                    </param>\n                    <param>\n                        <name>urls./**</name>\n                        <value>authcBasic</value>\n                    </param>\n                </provider>\n\n                <provider>\n                    <role>identity-assertion</role>\n                    <name>Default</name>\n                    <enabled>true</enabled>\n                </provider>\n\n            </gateway>\n\n            <service>\n                <role>NAMENODE</role>\n                <url>hdfs://{{namenode_host}}:{{namenode_rpc_port}}</url>\n            </service>\n\n            <service>\n                <role>JOBTRACKER</role>\n                <url>rpc://{{rm_host}}:{{jt_rpc_port}}</url>\n            </service>\n\n            <service>\n                <role>WEBHDFS</role
 >\n                <url>http://{{namenode_host}}:{{namenode_http_port}}/webhdfs</url>\n            </service>\n\n            <service>\n                <role>WEBHCAT</role>\n                <url>http://{{webhcat_server_host}}:{{templeton_port}}/templeton</url>\n            </service>\n\n            <service>\n                <role>OOZIE</role>\n                <url>http://{{oozie_server_host}}:{{oozie_server_port}}/oozie</url>\n            </service>\n\n            <service>\n                <role>WEBHBASE</role>\n                <url>http://{{hbase_master_host}}:{{hbase_master_port}}</url>\n            </service>\n\n            <service>\n                <role>HIVE</role>\n                <url>http://{{hive_server_host}}:{{hive_http_port}}/{{hive_http_path}}</url>\n            </service>\n\n            <service>\n                <role>RESOURCEMANAGER</role>\n                <url>http://{{rm_host}}:{{rm_port}}/ws</url>\n            </service>\n        </topology>"
+    },
+
+    "ldap-log4j": {
+      "content": "\n        # Licensed to the Apache Software Foundation (ASF) under one\n        # or more contributor license agreements.  See the NOTICE file\n        # distributed with this work for additional information\n        # regarding copyright ownership.  The ASF licenses this file\n        # to you under the Apache License, Version 2.0 (the\n        # \"License\"); you may not use this file except in compliance\n        # with the License.  You may obtain a copy of the License at\n        #\n        #     http://www.apache.org/licenses/LICENSE-2.0\n        #\n        # Unless required by applicable law or agreed to in writing, software\n        # distributed under the License is distributed on an \"AS IS\" BASIS,\n        # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n        # See the License for the specific language governing permissions and\n        # limitations under the License.\n        #testing\n\n        app.log.dir=${launcher.dir
 }/../logs\n        app.log.file=${launcher.name}.log\n\n        log4j.rootLogger=ERROR, drfa\n        log4j.logger.org.apache.directory.server.ldap.LdapServer=INFO\n        log4j.logger.org.apache.directory=WARN\n\n        log4j.appender.stdout=org.apache.log4j.ConsoleAppender\n        log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\n        log4j.appender.stdout.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n\n\n        log4j.appender.drfa=org.apache.log4j.DailyRollingFileAppender\n        log4j.appender.drfa.File=${app.log.dir}/${app.log.file}\n        log4j.appender.drfa.DatePattern=.yyyy-MM-dd\n        log4j.appender.drfa.layout=org.apache.log4j.PatternLayout\n        log4j.appender.drfa.layout.ConversionPattern=%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n"
+    },
+
+    "gateway-log4j": {
+      "content": "\n\n      # Licensed to the Apache Software Foundation (ASF) under one\n      # or more contributor license agreements. See the NOTICE file\n      # distributed with this work for additional information\n      # regarding copyright ownership. The ASF licenses this file\n      # to you under the Apache License, Version 2.0 (the\n      # \"License\"); you may not use this file except in compliance\n      # with the License. You may obtain a copy of the License at\n      #\n      # http://www.apache.org/licenses/LICENSE-2.0\n      #\n      # Unless required by applicable law or agreed to in writing, software\n      # distributed under the License is distributed on an \"AS IS\" BASIS,\n      # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n      # See the License for the specific language governing permissions and\n      # limitations under the License.\n\n      app.log.dir=${launcher.dir}/../logs\n      app.log.file=${launcher.name}.log\n   
    app.audit.file=${launcher.name}-audit.log\n\n      log4j.rootLogger=ERROR, drfa\n\n      log4j.logger.org.apache.hadoop.gateway=INFO\n      #log4j.logger.org.apache.hadoop.gateway=DEBUG\n\n      #log4j.logger.org.eclipse.jetty=DEBUG\n      #log4j.logger.org.apache.shiro=DEBUG\n      #log4j.logger.org.apache.http=DEBUG\n      #log4j.logger.org.apache.http.client=DEBUG\n      #log4j.logger.org.apache.http.headers=DEBUG\n      #log4j.logger.org.apache.http.wire=DEBUG\n\n      log4j.appender.stdout=org.apache.log4j.ConsoleAppender\n      log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\n      log4j.appender.stdout.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n\n\n      log4j.appender.drfa=org.apache.log4j.DailyRollingFileAppender\n      log4j.appender.drfa.File=${app.log.dir}/${app.log.file}\n      log4j.appender.drfa.DatePattern=.yyyy-MM-dd\n      log4j.appender.drfa.layout=org.apache.log4j.PatternLayout\n      log4j.appender.drfa.layout.ConversionPattern=%
 d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n\n\n      log4j.logger.audit=INFO, auditfile\n      log4j.appender.auditfile=org.apache.log4j.DailyRollingFileAppender\n      log4j.appender.auditfile.File=${app.log.dir}/${app.audit.file}\n      log4j.appender.auditfile.Append = true\n      log4j.appender.auditfile.DatePattern = '.'yyyy-MM-dd\n      log4j.appender.auditfile.layout = org.apache.hadoop.gateway.audit.log4j.layout.AuditLayout"
+    },
+    "knox-env": {
+      "knox_master_secret": "sa",
+      "knox_group": "knox",
+      "knox_pid_dir": "/var/run/knox",
+      "knox_user": "knox"
+    },
+    "kafka-env": {
+      "kafka_user_nproc_limit": "65536",
+      "content": "\n#!/bin/bash\n\n# Set KAFKA specific environment variables here.\n\n# The java implementation to use.\nexport JAVA_HOME={{java64_home}}\nexport PATH=$PATH:$JAVA_HOME/bin\nexport PID_DIR={{kafka_pid_dir}}\nexport LOG_DIR={{kafka_log_dir}}\n{% if kerberos_security_enabled or kafka_other_sasl_enabled %}\nexport KAFKA_KERBEROS_PARAMS=\"-Djavax.security.auth.useSubjectCredsOnly=false {{kafka_kerberos_params}}\"\n{% else %}\nexport KAFKA_KERBEROS_PARAMS={{kafka_kerberos_params}}\n{% endif %}\n# Add kafka sink to classpath and related depenencies\nif [ -e \"/usr/lib/ambari-metrics-kafka-sink/ambari-metrics-kafka-sink.jar\" ]; then\n  export CLASSPATH=$CLASSPATH:/usr/lib/ambari-metrics-kafka-sink/ambari-metrics-kafka-sink.jar\n  export CLASSPATH=$CLASSPATH:/usr/lib/ambari-metrics-kafka-sink/lib/*\nfi\nif [ -f /etc/kafka/conf/kafka-ranger-env.sh ]; then\n. /etc/kafka/conf/kafka-ranger-env.sh\nfi",
+      "kafka_log_dir": "/var/log/kafka",
+      "kafka_pid_dir": "/var/run/kafka",
+      "kafka_user_nofile_limit": "128000",
+      "is_supported_kafka_ranger": "true",
+      "kafka_user": "kafka"
+    },
+    "kafka-log4j": {
+      "kafka_log_maxbackupindex": "20",
+      "content": "\n#\n#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements.  See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership.  The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License.  You may obtain a copy of the License at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied.  See the License for the\n# specific language governing permissions and limitations\n# under the License.\n#\n#\n#\nkafka.logs.dir=logs\n\nlog4j.rootLogger=INFO, stdout\n\nlog4j.appender.stdout=org.apache.log4j.ConsoleAppender\nlog4j.appender.stdout.layout=org.apache.log4j
 .PatternLayout\nlog4j.appender.stdout.layout.ConversionPattern=[%d] %p %m (%c)%n\n\nlog4j.appender.kafkaAppender=org.apache.log4j.DailyRollingFileAppender\nlog4j.appender.kafkaAppender.DatePattern='.'yyyy-MM-dd-HH\nlog4j.appender.kafkaAppender.File=${kafka.logs.dir}/server.log\nlog4j.appender.kafkaAppender.layout=org.apache.log4j.PatternLayout\nlog4j.appender.kafkaAppender.layout.ConversionPattern=[%d] %p %m (%c)%n\nlog4j.appender.kafkaAppender.MaxFileSize = {{kafka_log_maxfilesize}}MB\nlog4j.appender.kafkaAppender.MaxBackupIndex = {{kafka_log_maxbackupindex}}\n\nlog4j.appender.stateChangeAppender=org.apache.log4j.DailyRollingFileAppender\nlog4j.appender.stateChangeAppender.DatePattern='.'yyyy-MM-dd-HH\nlog4j.appender.stateChangeAppender.File=${kafka.logs.dir}/state-change.log\nlog4j.appender.stateChangeAppender.layout=org.apache.log4j.PatternLayout\nlog4j.appender.stateChangeAppender.layout.ConversionPattern=[%d] %p %m (%c)%n\n\nlog4j.appender.requestAppender=org.apache.log4j.Daily
 RollingFileAppender\nlog4j.appender.requestAppender.DatePattern='.'yyyy-MM-dd-HH\nlog4j.appender.requestAppender.File=${kafka.logs.dir}/kafka-request.log\nlog4j.appender.requestAppender.layout=org.apache.log4j.PatternLayout\nlog4j.appender.requestAppender.layout.ConversionPattern=[%d] %p %m (%c)%n\n\nlog4j.appender.cleanerAppender=org.apache.log4j.DailyRollingFileAppender\nlog4j.appender.cleanerAppender.DatePattern='.'yyyy-MM-dd-HH\nlog4j.appender.cleanerAppender.File=${kafka.logs.dir}/log-cleaner.log\nlog4j.appender.cleanerAppender.layout=org.apache.log4j.PatternLayout\nlog4j.appender.cleanerAppender.layout.ConversionPattern=[%d] %p %m (%c)%n\n\nlog4j.appender.controllerAppender=org.apache.log4j.DailyRollingFileAppender\nlog4j.appender.controllerAppender.DatePattern='.'yyyy-MM-dd-HH\nlog4j.appender.controllerAppender.File=${kafka.logs.dir}/controller.log\nlog4j.appender.controllerAppender.layout=org.apache.log4j.PatternLayout\nlog4j.appender.controllerAppender.layout.ConversionPatt
 ern=[%d] %p %m (%c)%n\nlog4j.appender.controllerAppender.MaxFileSize = {{controller_log_maxfilesize}}MB\nlog4j.appender.controllerAppender.MaxBackupIndex = {{controller_log_maxbackupindex}}\n# Turn on all our debugging info\n#log4j.logger.kafka.producer.async.DefaultEventHandler=DEBUG, kafkaAppender\n#log4j.logger.kafka.client.ClientUtils=DEBUG, kafkaAppender\n#log4j.logger.kafka.perf=DEBUG, kafkaAppender\n#log4j.logger.kafka.perf.ProducerPerformance$ProducerThread=DEBUG, kafkaAppender\n#log4j.logger.org.I0Itec.zkclient.ZkClient=DEBUG\nlog4j.logger.kafka=INFO, kafkaAppender\nlog4j.logger.kafka.network.RequestChannel$=WARN, requestAppender\nlog4j.additivity.kafka.network.RequestChannel$=false\n\n#log4j.logger.kafka.network.Processor=TRACE, requestAppender\n#log4j.logger.kafka.server.KafkaApis=TRACE, requestAppender\n#log4j.additivity.kafka.server.KafkaApis=false\nlog4j.logger.kafka.request.logger=WARN, requestAppender\nlog4j.additivity.kafka.request.logger=false\n\nlog4j.logger.kafka
 .controller=TRACE, controllerAppender\nlog4j.additivity.kafka.controller=false\n\nlog4j.logger.kafka.log.LogCleaner=INFO, cleanerAppender\nlog4j.additivity.kafka.log.LogCleaner=false\n\nlog4j.logger.state.change.logger=TRACE, stateChangeAppender\nlog4j.additivity.state.change.logger=false",
+      "kafka_log_maxfilesize": "256",
+      "controller_log_maxfilesize": "256",
+      "controller_log_maxbackupindex": "20"
+    },
+    "kafka-broker": {
+      "auto.leader.rebalance.enable": "true",
+      "kafka.ganglia.metrics.port": "8671",
+      "socket.send.buffer.bytes": "102400",
+      "num.network.threads": "3",
+      "log.segment.bytes": "1073741824",
+      "kafka.ganglia.metrics.host": "localhost",
+      "kafka.timeline.metrics.maxRowCacheSize": "10000",
+      "replica.lag.time.max.ms": "10000",
+      "num.io.threads": "8",
+      "offsets.retention.minutes": "86400000",
+      "fetch.purgatory.purge.interval.requests": "10000",
+      "offsets.topic.compression.codec": "0",
+      "default.replication.factor": "1",
+      "port": "6667",
+      "num.recovery.threads.per.data.dir": "1",
+      "kafka.metrics.reporters": "org.apache.hadoop.metrics2.sink.kafka.KafkaTimelineMetricsReporter",
+      "log.retention.bytes": "-1",
+      "producer.purgatory.purge.interval.requests": "10000",
+      "replica.lag.max.messages": "4000",
+      "replica.high.watermark.checkpoint.interval.ms": "5000",
+      "zookeeper.connect": "ydavis-kafka-ambari-upgrade-1.openstacklocal:2181",
+      "controlled.shutdown.retry.backoff.ms": "5000",
+      "sasl.enabled.mechanisms": "GSSAPI",
+      "kafka.timeline.metrics.reporter.sendInterval": "5900",
+      "num.partitions": "1",
+      "offsets.topic.segment.bytes": "104857600",
+      "replica.fetch.min.bytes": "1",
+      "zookeeper.sync.time.ms": "2000",
+      "offset.metadata.max.bytes": "4096",
+      "kafka.timeline.metrics.reporter.enabled": "true",
+      "kafka.timeline.metrics.truststore.type": "{{metric_truststore_type}}",
+      "controlled.shutdown.max.retries": "3",
+      "leader.imbalance.per.broker.percentage": "10",
+      "min.insync.replicas": "1",
+      "offsets.commit.required.acks": "-1",
+      "replica.fetch.wait.max.ms": "500",
+      "controlled.shutdown.enable": "true",
+      "log.roll.hours": "168",
+      "log.cleanup.interval.mins": "10",
+      "replica.socket.receive.buffer.bytes": "65536",
+      "kafka.ganglia.metrics.reporter.enabled": "true",
+      "kafka.timeline.metrics.truststore.path": "{{metric_truststore_path}}",
+      "zookeeper.connection.timeout.ms": "25000",
+      "delete.topic.enable": "false",
+      "offsets.load.buffer.size": "5242880",
+      "num.replica.fetchers": "1",
+      "socket.request.max.bytes": "104857600",
+      "message.max.bytes": "1000000",
+      "controller.message.queue.size": "10",
+      "kafka.ganglia.metrics.group": "kafka",
+      "compression.type": "producer",
+      "queued.max.requests": "500",
+      "log.index.interval.bytes": "4096",
+      "replica.fetch.max.bytes": "1048576",
+      "offsets.topic.num.partitions": "50",
+      "socket.receive.buffer.bytes": "102400",
+      "kafka.timeline.metrics.port": "{{metric_collector_port}}",
+      "offsets.commit.timeout.ms": "5000",
+      "offsets.topic.replication.factor": "3",
+      "external.kafka.metrics.include.prefix": "kafka.network.RequestMetrics.ResponseQueueTimeMs.request.OffsetCommit.98percentile,kafka.network.RequestMetrics.ResponseQueueTimeMs.request.Offsets.95percentile,kafka.network.RequestMetrics.ResponseSendTimeMs.request.Fetch.95percentile,kafka.network.RequestMetrics.RequestsPerSec.request",
+      "offsets.retention.check.interval.ms": "600000",
+      "log.index.size.max.bytes": "10485760",
+      "log.dirs": "/kafka-logs",
+      "listeners": "PLAINTEXT://localhost:6667",
+      "kafka.timeline.metrics.hosts": "{{ams_collector_hosts}}",
+      "controller.socket.timeout.ms": "30000",
+      "replica.socket.timeout.ms": "30000",
+      "zookeeper.session.timeout.ms": "30000",
+      "auto.create.topics.enable": "true",
+      "kafka.timeline.metrics.truststore.password": "{{metric_truststore_password}}",
+      "external.kafka.metrics.exclude.prefix": "kafka.network.RequestMetrics,kafka.server.DelayedOperationPurgatory,kafka.server.BrokerTopicMetrics.BytesRejectedPerSec,kafka.server.KafkaServer.ClusterId",
+      "leader.imbalance.check.interval.seconds": "300",
+      "sasl.mechanism.inter.broker.protocol": "GSSAPI",
+      "log.retention.hours": "168",
+      "kafka.timeline.metrics.protocol": "{{metric_collector_protocol}}"
+    },
+    "spark-defaults": {
+      "spark.yarn.applicationMaster.waitTries": "10",
+      "spark.history.kerberos.keytab": "none",
+      "spark.yarn.preserve.staging.files": "false",
+      "spark.yarn.submit.file.replication": "3",
+      "spark.history.kerberos.principal": "none",
+      "spark.yarn.driver.memoryOverhead": "384",
+      "spark.yarn.queue": "default",
+      "spark.yarn.containerLauncherMaxThreads": "25",
+      "spark.yarn.scheduler.heartbeat.interval-ms": "5000",
+      "spark.history.ui.port": "18080",
+      "spark.yarn.max.executor.failures": "3",
+      "spark.driver.extraJavaOptions": "",
+      "spark.history.provider": "org.apache.spark.deploy.yarn.history.YarnHistoryProvider",
+      "spark.yarn.am.extraJavaOptions": "",
+      "spark.yarn.executor.memoryOverhead": "384"
+    },
+    "spark-javaopts-properties": {
+      "content": " "
+    },
+    "spark-log4j-properties": {
+      "content": "\n# Set everything to be logged to the console\nlog4j.rootCategory=INFO, console\nlog4j.appender.console=org.apache.log4j.ConsoleAppender\nlog4j.appender.console.target=System.err\nlog4j.appender.console.layout=org.apache.log4j.PatternLayout\nlog4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n\n\n# Settings to quiet third party logs that are too verbose\nlog4j.logger.org.eclipse.jetty=WARN\nlog4j.logger.org.eclipse.jetty.util.component.AbstractLifeCycle=ERROR\nlog4j.logger.org.apache.spark.repl.SparkIMain$exprTyper=INFO\nlog4j.logger.org.apache.spark.repl.SparkILoop$SparkILoopInterpreter=INFO"
+    },
+    "spark-env": {
+      "content": "\n#!/usr/bin/env bash\n\n# This file is sourced when running various Spark programs.\n# Copy it as spark-env.sh and edit that to configure Spark for your site.\n\n# Options read in YARN client mode\n#SPARK_EXECUTOR_INSTANCES=\"2\" #Number of workers to start (Default: 2)\n#SPARK_EXECUTOR_CORES=\"1\" #Number of cores for the workers (Default: 1).\n#SPARK_EXECUTOR_MEMORY=\"1G\" #Memory per Worker (e.g. 1000M, 2G) (Default: 1G)\n#SPARK_DRIVER_MEMORY=\"512 Mb\" #Memory for Master (e.g. 1000M, 2G) (Default: 512 Mb)\n#SPARK_YARN_APP_NAME=\"spark\" #The name of your application (Default: Spark)\n#SPARK_YARN_QUEUE=\"~@~Xdefault~@~Y\" #The hadoop queue to use for allocation requests (Default: @~Xdefault~@~Y)\n#SPARK_YARN_DIST_FILES=\"\" #Comma separated list of files to be distributed with the job.\n#SPARK_YARN_DIST_ARCHIVES=\"\" #Comma separated list of archives to be distributed with the job.\n\n# Generic options for the daemons used in the standalone deploy mode\n\n# Alt
 ernate conf dir. (Default: ${SPARK_HOME}/conf)\nexport SPARK_CONF_DIR=${SPARK_HOME:-{{spark_home}}}/conf\n\n# Where log files are stored.(Default:${SPARK_HOME}/logs)\n#export SPARK_LOG_DIR=${SPARK_HOME:-{{spark_home}}}/logs\nexport SPARK_LOG_DIR={{spark_log_dir}}\n\n# Where the pid file is stored. (Default: /tmp)\nexport SPARK_PID_DIR={{spark_pid_dir}}\n\n# A string representing this instance of spark.(Default: $USER)\nSPARK_IDENT_STRING=$USER\n\n# The scheduling priority for daemons. (Default: 0)\nSPARK_NICENESS=0\n\nexport HADOOP_HOME=${HADOOP_HOME:-{{hadoop_home}}}\nexport HADOOP_CONF_DIR=${HADOOP_CONF_DIR:-{{hadoop_conf_dir}}}\n\n# The java implementation to use.\nexport JAVA_HOME={{java_home}}\n\nif [ -d \"/etc/tez/conf/\" ]; then\n  export TEZ_CONF_DIR=/etc/tez/conf\nelse\n  export TEZ_CONF_DIR=\nfi",
+      "spark_pid_dir": "/var/run/spark",
+      "spark_log_dir": "/var/log/spark",
+      "spark_group": "spark",
+      "spark_user": "spark"
+    },
+    "spark2-env": {
+      "content": "\n#!/usr/bin/env bash\n\n# This file is sourced when running various Spark programs.\n# Copy it as spark-env.sh and edit that to configure Spark for your site.\n\n# Options read in YARN client mode\n#SPARK_EXECUTOR_INSTANCES=\"2\" #Number of workers to start (Default: 2)\n#SPARK_EXECUTOR_CORES=\"1\" #Number of cores for the workers (Default: 1).\n#SPARK_EXECUTOR_MEMORY=\"1G\" #Memory per Worker (e.g. 1000M, 2G) (Default: 1G)\n#SPARK_DRIVER_MEMORY=\"512 Mb\" #Memory for Master (e.g. 1000M, 2G) (Default: 512 Mb)\n#SPARK_YARN_APP_NAME=\"spark\" #The name of your application (Default: Spark)\n#SPARK_YARN_QUEUE=\"~@~Xdefault~@~Y\" #The hadoop queue to use for allocation requests (Default: @~Xdefault~@~Y)\n#SPARK_YARN_DIST_FILES=\"\" #Comma separated list of files to be distributed with the job.\n#SPARK_YARN_DIST_ARCHIVES=\"\" #Comma separated list of archives to be distributed with the job.\n\n# Generic options for the daemons used in the standalone deploy mode\n\n# Alt
 ernate conf dir. (Default: ${SPARK_HOME}/conf)\nexport SPARK_CONF_DIR=${SPARK_HOME:-{{spark_home}}}/conf\n\n# Where log files are stored.(Default:${SPARK_HOME}/logs)\n#export SPARK_LOG_DIR=${SPARK_HOME:-{{spark_home}}}/logs\nexport SPARK_LOG_DIR={{spark_log_dir}}\n\n# Where the pid file is stored. (Default: /tmp)\nexport SPARK_PID_DIR={{spark_pid_dir}}\n\n# A string representing this instance of spark.(Default: $USER)\nSPARK_IDENT_STRING=$USER\n\n# The scheduling priority for daemons. (Default: 0)\nSPARK_NICENESS=0\n\nexport HADOOP_HOME=${HADOOP_HOME:-{{hadoop_home}}}\nexport HADOOP_CONF_DIR=${HADOOP_CONF_DIR:-{{hadoop_conf_dir}}}\n\n# The java implementation to use.\nexport JAVA_HOME={{java_home}}\n\nif [ -d \"/etc/tez/conf/\" ]; then\n  export TEZ_CONF_DIR=/etc/tez/conf\nelse\n  export TEZ_CONF_DIR=\nfi",
+      "spark_pid_dir": "/var/run/spark",
+      "spark_log_dir": "/var/log/spark",
+      "spark_group": "spark",
+      "spark_user": "spark"
+    },
+    "spark-metrics-properties": {
+      "content": "\n# syntax: [instance].sink|source.[name].[options]=[value]\n\n# This file configures Spark's internal metrics system. The metrics system is\n# divided into instances which correspond to internal components.\n# Each instance can be configured to report its metrics to one or more sinks.\n# Accepted values for [instance] are \"master\", \"worker\", \"executor\", \"driver\",\n# and \"applications\". A wild card \"*\" can be used as an instance name, in\n# which case all instances will inherit the supplied property.\n#\n# Within an instance, a \"source\" specifies a particular set of grouped metrics.\n# there are two kinds of sources:\n# 1. Spark internal sources, like MasterSource, WorkerSource, etc, which will\n# collect a Spark component's internal state. Each instance is paired with a\n# Spark source that is added automatically.\n# 2. Common sources, like JvmSource, which will collect low level state.\n# These can be added through configuration options and are then
  loaded\n# using reflection.\n#\n# A \"sink\" specifies where metrics are delivered to. Each instance can be\n# assigned one or more sinks.\n#\n# The sink|source field specifies whether the property relates to a sink or\n# source.\n#\n# The [name] field specifies the name of source or sink.\n#\n# The [options] field is the specific property of this source or sink. The\n# source or sink is responsible for parsing this property.\n#\n# Notes:\n# 1. To add a new sink, set the \"class\" option to a fully qualified class\n# name (see examples below).\n# 2. Some sinks involve a polling period. The minimum allowed polling period\n# is 1 second.\n# 3. Wild card properties can be overridden by more specific properties.\n# For example, master.sink.console.period takes precedence over\n# *.sink.console.period.\n# 4. A metrics specific configuration\n# \"spark.metrics.conf=${SPARK_HOME}/conf/metrics.properties\" should be\n# added to Java properties using -Dspark.metrics.conf=xxx if you want to\
 n# customize metrics system. You can also put the file in ${SPARK_HOME}/conf\n# and it will be loaded automatically.\n# 5. MetricsServlet is added by default as a sink in master, worker and client\n# driver, you can send http request \"/metrics/json\" to get a snapshot of all the\n# registered metrics in json format. For master, requests \"/metrics/master/json\" and\n# \"/metrics/applications/json\" can be sent seperately to get metrics snapshot of\n# instance master and applications. MetricsServlet may not be configured by self.\n#\n\n## List of available sinks and their properties.\n\n# org.apache.spark.metrics.sink.ConsoleSink\n# Name: Default: Description:\n# period 10 Poll period\n# unit seconds Units of poll period\n\n# org.apache.spark.metrics.sink.CSVSink\n# Name: Default: Description:\n# period 10 Poll period\n# unit seconds Units of poll period\n# directory /tmp Where to store CSV files\n\n# org.apache.spark.metrics.sink.GangliaSink\n# Name: Default: Description:\n# host N
 ONE Hostname or multicast group of Ganglia server\n# port NONE Port of Ganglia server(s)\n# period 10 Poll period\n# unit seconds Units of poll period\n# ttl 1 TTL of messages sent by Ganglia\n# mode multicast Ganglia network mode ('unicast' or 'multicast')\n\n# org.apache.spark.metrics.sink.JmxSink\n\n# org.apache.spark.metrics.sink.MetricsServlet\n# Name: Default: Description:\n# path VARIES* Path prefix from the web server root\n# sample false Whether to show entire set of samples for histograms ('false' or 'true')\n#\n# * Default path is /metrics/json for all instances except the master. The master has two paths:\n# /metrics/aplications/json # App information\n# /metrics/master/json # Master information\n\n# org.apache.spark.metrics.sink.GraphiteSink\n# Name: Default: Description:\n# host NONE Hostname of Graphite server\n# port NONE Port of Graphite server\n# period 10 Poll period\n# unit seconds Units of poll period\n# prefix EMPTY STRING Prefix to prepend to metric name\n\n##
  Examples\n# Enable JmxSink for all instances by class name\n#*.sink.jmx.class=org.apache.spark.metrics.sink.JmxSink\n\n# Enable ConsoleSink for all instances by class name\n#*.sink.console.class=org.apache.spark.metrics.sink.ConsoleSink\n\n# Polling period for ConsoleSink\n#*.sink.console.period=10\n\n#*.sink.console.unit=seconds\n\n# Master instance overlap polling period\n#master.sink.console.period=15\n\n#master.sink.console.unit=seconds\n\n# Enable CsvSink for all instances\n#*.sink.csv.class=org.apache.spark.metrics.sink.CsvSink\n\n# Polling period for CsvSink\n#*.sink.csv.period=1\n\n#*.sink.csv.unit=minutes\n\n# Polling directory for CsvSink\n#*.sink.csv.directory=/tmp/\n\n# Worker instance overlap polling period\n#worker.sink.csv.period=10\n\n#worker.sink.csv.unit=minutes\n\n# Enable jvm source for instance master, worker, driver and executor\n#master.source.jvm.class=org.apache.spark.metrics.source.JvmSource\n\n#worker.source.jvm.class=org.apache.spark.metrics.source.JvmSo
 urce\n\n#driver.source.jvm.class=org.apache.spark.metrics.source.JvmSource\n\n#executor.source.jvm.class=org.apache.spark.metrics.source.JvmSource"
+    },
+    "spark-metrics-properties": {
+      "content": "\n# syntax: [instance].sink|source.[name].[options]=[value]\n\n# This file configures Spark's internal metrics system. The metrics system is\n# divided into instances which correspond to internal components.\n# Each instance can be configured to report its metrics to one or more sinks.\n# Accepted values for [instance] are \"master\", \"worker\", \"executor\", \"driver\",\n# and \"applications\". A wild card \"*\" can be used as an instance name, in\n# which case all instances will inherit the supplied property.\n#\n# Within an instance, a \"source\" specifies a particular set of grouped metrics.\n# there are two kinds of sources:\n# 1. Spark internal sources, like MasterSource, WorkerSource, etc, which will\n# collect a Spark component's internal state. Each instance is paired with a\n# Spark source that is added automatically.\n# 2. Common sources, like JvmSource, which will collect low level state.\n# These can be added through configuration options and are then
  loaded\n# using reflection.\n#\n# A \"sink\" specifies where metrics are delivered to. Each instance can be\n# assigned one or more sinks.\n#\n# The sink|source field specifies whether the property relates to a sink or\n# source.\n#\n# The [name] field specifies the name of source or sink.\n#\n# The [options] field is the specific property of this source or sink. The\n# source or sink is responsible for parsing this property.\n#\n# Notes:\n# 1. To add a new sink, set the \"class\" option to a fully qualified class\n# name (see examples below).\n# 2. Some sinks involve a polling period. The minimum allowed polling period\n# is 1 second.\n# 3. Wild card properties can be overridden by more specific properties.\n# For example, master.sink.console.period takes precedence over\n# *.sink.console.period.\n# 4. A metrics specific configuration\n# \"spark.metrics.conf=${SPARK_HOME}/conf/metrics.properties\" should be\n# added to Java properties using -Dspark.metrics.conf=xxx if you want to\
 n# customize metrics system. You can also put the file in ${SPARK_HOME}/conf\n# and it will be loaded automatically.\n# 5. MetricsServlet is added by default as a sink in master, worker and client\n# driver, you can send http request \"/metrics/json\" to get a snapshot of all the\n# registered metrics in json format. For master, requests \"/metrics/master/json\" and\n# \"/metrics/applications/json\" can be sent seperately to get metrics snapshot of\n# instance master and applications. MetricsServlet may not be configured by self.\n#\n\n## List of available sinks and their properties.\n\n# org.apache.spark.metrics.sink.ConsoleSink\n# Name: Default: Description:\n# period 10 Poll period\n# unit seconds Units of poll period\n\n# org.apache.spark.metrics.sink.CSVSink\n# Name: Default: Description:\n# period 10 Poll period\n# unit seconds Units of poll period\n# directory /tmp Where to store CSV files\n\n# org.apache.spark.metrics.sink.GangliaSink\n# Name: Default: Description:\n# host N
 ONE Hostname or multicast group of Ganglia server\n# port NONE Port of Ganglia server(s)\n# period 10 Poll period\n# unit seconds Units of poll period\n# ttl 1 TTL of messages sent by Ganglia\n# mode multicast Ganglia network mode ('unicast' or 'multicast')\n\n# org.apache.spark.metrics.sink.JmxSink\n\n# org.apache.spark.metrics.sink.MetricsServlet\n# Name: Default: Description:\n# path VARIES* Path prefix from the web server root\n# sample false Whether to show entire set of samples for histograms ('false' or 'true')\n#\n# * Default path is /metrics/json for all instances except the master. The master has two paths:\n# /metrics/aplications/json # App information\n# /metrics/master/json # Master information\n\n# org.apache.spark.metrics.sink.GraphiteSink\n# Name: Default: Description:\n# host NONE Hostname of Graphite server\n# port NONE Port of Graphite server\n# period 10 Poll period\n# unit seconds Units of poll period\n# prefix EMPTY STRING Prefix to prepend to metric name\n\n##
  Examples\n# Enable JmxSink for all instances by class name\n#*.sink.jmx.class=org.apache.spark.metrics.sink.JmxSink\n\n# Enable ConsoleSink for all instances by class name\n#*.sink.console.class=org.apache.spark.metrics.sink.ConsoleSink\n\n# Polling period for ConsoleSink\n#*.sink.console.period=10\n\n#*.sink.console.unit=seconds\n\n# Master instance overlap polling period\n#master.sink.console.period=15\n\n#master.sink.console.unit=seconds\n\n# Enable CsvSink for all instances\n#*.sink.csv.class=org.apache.spark.metrics.sink.CsvSink\n\n# Polling period for CsvSink\n#*.sink.csv.period=1\n\n#*.sink.csv.unit=minutes\n\n# Polling directory for CsvSink\n#*.sink.csv.directory=/tmp/\n\n# Worker instance overlap polling period\n#worker.sink.csv.period=10\n\n#worker.sink.csv.unit=minutes\n\n# Enable jvm source for instance master, worker, driver and executor\n#master.source.jvm.class=org.apache.spark.metrics.source.JvmSource\n\n#worker.source.jvm.class=org.apache.spark.metrics.source.JvmSo
 urce\n\n#driver.source.jvm.class=org.apache.spark.metrics.source.JvmSource\n\n#executor.source.jvm.class=org.apache.spark.metrics.source.JvmSource"
+    },
+    "livy-log4j-properties": {
+      "content": "\n            # Set everything to be logged to the console\n            log4j.rootCategory=INFO, console\n            log4j.appender.console=org.apache.log4j.ConsoleAppender\n            log4j.appender.console.target=System.err\n            log4j.appender.console.layout=org.apache.log4j.PatternLayout\n            log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n\n\n            log4j.logger.org.eclipse.jetty=WARN"
+    },
+    "livy2-log4j-properties": {
+      "content": "\n            # Set everything to be logged to the console\n            log4j.rootCategory=INFO, console\n            log4j.appender.console=org.apache.log4j.ConsoleAppender\n            log4j.appender.console.target=System.err\n            log4j.appender.console.layout=org.apache.log4j.PatternLayout\n            log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n\n\n            log4j.logger.org.eclipse.jetty=WARN"
+    },
+    "livy-conf": {
+      "livy.server.port": "8998",
+      "livy.server.csrf_protection.enabled": "true",
+      "livy.environment": "production",
+      "livy.impersonation.enabled": "true",
+      "livy.server.session.timeout": "3600000"
+    },
+    "livy2-conf": {
+      "livy.server.port": "8999",
+      "livy.server.csrf_protection.enabled": "true",
+      "livy.environment": "production",
+      "livy.impersonation.enabled": "true",
+      "livy.server.session.timeout": "3600000"
+    },
+    "livy-spark-blacklist": {
+      "content": "\n            #\n            # Configuration override / blacklist. Defines a list of properties that users are not allowed\n            # to override when starting Spark sessions.\n            #\n            # This file takes a list of property names (one per line). Empty lines and lines starting with \"#\"\n            # are ignored.\n            #"
+    },
+    "livy2-spark-blacklist": {
+      "content": "\n            #\n            # Configuration override / blacklist. Defines a list of properties that users are not allowed\n            # to override when starting Spark sessions.\n            #\n            # This file takes a list of property names (one per line). Empty lines and lines starting with \"#\"\n            # are ignored.\n            #"
+    },
+    "livy-env": {
+      "livy_group": "livy",
+      "spark_home": "/usr/hdp/current/spark-client",
+      "content": "\n            #!/usr/bin/env bash\n\n            # - SPARK_HOME      Spark which you would like to use in livy\n            # - HADOOP_CONF_DIR Directory containing the Hadoop / YARN configuration to use.\n            # - LIVY_LOG_DIR    Where log files are stored.  (Default: ${LIVY_HOME}/logs)\n            # - LIVY_PID_DIR    Where the pid file is stored. (Default: /tmp)\n            # - LIVY_SERVER_JAVA_OPTS  Java Opts for running livy server (You can set jvm related setting here, like jvm memory/gc algorithm and etc.)\n        export SPARK_HOME=/usr/hdp/current/spark-client\n        export HADOOP_CONF_DIR=/etc/hadoop/conf\n        export LIVY_LOG_DIR={{livy_log_dir}}\n        export LIVY_PID_DIR={{livy_pid_dir}}\n        export LIVY_SERVER_JAVA_OPTS=\"-Xmx2g\"",
+      "livy_pid_dir": "/var/run/livy",
+      "livy_log_dir": "/var/log/livy",
+      "livy_user": "livy"
+    },
+    "livy2-env": {
+      "livy2_group": "livy",
+      "spark_home": "/usr/hdp/current/spark2-client",
+      "content": "\n            #!/usr/bin/env bash\n\n            # - SPARK_HOME      Spark which you would like to use in livy\n            # - HADOOP_CONF_DIR Directory containing the Hadoop / YARN configuration to use.\n            # - LIVY_LOG_DIR    Where log files are stored.  (Default: ${LIVY_HOME}/logs)\n            # - LIVY_PID_DIR    Where the pid file is stored. (Default: /tmp)\n            # - LIVY_SERVER_JAVA_OPTS  Java Opts for running livy server (You can set jvm related setting here, like jvm memory/gc algorithm and etc.)\n        export SPARK_HOME=/usr/hdp/current/spark2-client\n        export HADOOP_CONF_DIR=/etc/hadoop/conf\n        export LIVY_LOG_DIR={{livy_log_dir}}\n        export LIVY_PID_DIR={{livy_pid_dir}}\n        export LIVY_SERVER_JAVA_OPTS=\"-Xmx2g\"",
+      "livy2_pid_dir": "/var/run/livy2",
+      "livy2_log_dir": "/var/log/livy2",
+      "livy2_user": "livy"
+    },
+    "infra-solr-env": {
+      "infra_solr_znode": "/infra-solr",
+      "infra_solr_user": "solr",
+      "infra_solr_client_log_dir" :"/var/log/ambari-infra-solr-client"
+    },
+    "infra-solr-client-log4j" : {
+      "infra_solr_client_log_dir" : "/var/log/ambari-infra-solr-client",
+      "content" : "content"
+    },
+    "application-properties": {
+      "atlas.cluster.name" : "c2",
+      "atlas.rest.address": "http://c6401.ambari.apache.org:21000",
+      "atlas.graph.storage.backend": "berkeleyje",
+      "atlas.graph.storage.directory": "data/berkley",
+      "atlas.graph.index.search.backend": "solr5",
+      "atlas.graph.index.search.directory": "data/es",
+      "atlas.graph.index.search.elasticsearch.client-only": false,
+      "atlas.graph.index.search.elasticsearch.local-mode": true,
+      "atlas.lineage.hive.table.type.name": "Table",
+      "atlas.lineage.hive.column.type.name": "Column",
+      "atlas.lineage.hive.table.column.name": "columns",
+      "atlas.lineage.hive.process.type.name": "LoadProcess",
+      "atlas.lineage.hive.process.inputs.name": "inputTables",
+      "atlas.lineage.hive.process.outputs.name": "outputTables",
+      "atlas.enableTLS": false,
+      "atlas.authentication.method": "simple",
+      "atlas.authentication.principal": "atlas",
+      "atlas.authentication.keytab": "/etc/security/keytabs/atlas.service.keytab",
+      "atlas.http.authentication.enabled": false,
+      "atlas.http.authentication.type": "simple",
+      "atlas.http.authentication.kerberos.principal": "HTTP/_HOST@EXAMPLE.COM",
+      "atlas.http.authentication.kerberos.keytab": "/etc/security/keytabs/spnego.service.keytab",
+      "atlas.http.authentication.kerberos.name.rules": "DEFAULT",
+      "atlas.server.http.port" : "21000",
+      "atlas.notification.embedded" : false,
+      "atlas.kafka.bootstrap.servers" : "c6401.ambari.apache.org:6667",
+      "atlas.kafka.data" : "/usr/hdp/current/atlas-server/data/kafka",
+      "atlas.kafka.entities.group.id" : "entities",
+      "atlas.kafka.hook.group.id" : "atlas",
+      "atlas.kafka.zookeeper.connect" : "c6401.ambari.apache.org:2181"
+    },
+    "atlas-env": {
+      "content": "# The java implementation to use. If JAVA_HOME is not found we expect java and jar to be in path\nexport JAVA_HOME={{java64_home}}\n# any additional java opts you want to set. This will apply to both client and server operations\nexport METADATA_OPTS={{metadata_opts}}\n# metadata configuration directory\nexport METADATA_CONF={{conf_dir}}\n# Where log files are stored. Defatult is logs directory under the base install location\nexport METADATA_LOG_DIR={{log_dir}}\n# additional classpath entries\nexport METADATACPPATH={{metadata_classpath}}\n# data dir\nexport METADATA_DATA_DIR={{data_dir}}\n# Where do you want to expand the war file. By Default it is in /server/webapp dir under the base install dir.\nexport METADATA_EXPANDED_WEBAPP_DIR={{expanded_war_dir}}",
+      "metadata_user": "atlas",
+      "metadata_port": 21000,
+      "metadata_pid_dir": "/var/run/atlas",
+      "metadata_log_dir": "/var/log/atlas",
+      "metadata_data_dir": "/var/lib/atlas/data",
+      "metadata_expanded_war_dir": "/var/lib/atlas/server/webapp"
+    },
+    "atlas-log4j": {
+      "content": "<property><name>content</name><description>Custom log4j.properties</description><value></value></property>",
+      "atlas_log_level": "debug",
+      "audit_log_level": "OFF"
+    },
+    "atlas-solrconfig": {
+      "content": "<property><name>content</name><description>Custom solrconfig properties</description><value></value></property>"
+    },
+    "zeppelin-env": {
+      "zeppelin.server.kerberos.keytab": "", 
+      "shiro_ini_content": "\n[users]\n# List of users with their password allowed to access Zeppelin.\n# To use a different strategy (LDAP / Database / ...) check the shiro doc at http://shiro.apache.org/configuration.html#Configuration-INISections\n#admin = password1\n#user1 = password2, role1, role2\n#user2 = password3, role3\n#user3 = password4, role2\n\n# Sample LDAP configuration, for user Authentication, currently tested for single Realm\n[main]\n#ldapRealm = org.apache.shiro.realm.ldap.JndiLdapRealm\n#ldapRealm.userDnTemplate = uid={0},cn=users,cn=accounts,dc=hortonworks,dc=com\n#ldapRealm.contextFactory.url = ldap://ldaphost:389\n#ldapRealm.contextFactory.authenticationMechanism = SIMPLE\n#sessionManager = org.apache.shiro.web.session.mgt.DefaultWebSessionManager\n#securityManager.sessionManager = $sessionManager\n# 86,400,000 milliseconds = 24 hour\n#securityManager.sessionManager.globalSessionTimeout = 86400000\nshiro.loginUrl = /api/login\n\n[urls]\n# anon means the acce
 ss is anonymous.\n# authcBasic means Basic Auth Security\n# To enfore security, comment the line below and uncomment the next one\n/api/version = anon\n/** = anon\n#/** = authc", 
+      "zeppelin.spark.jar.dir": "/apps/zeppelin", 
+      "zeppelin.executor.mem": "512m", 
+      "zeppelin_pid_dir": "/var/run/zeppelin", 
+      "zeppelin.executor.instances": "2", 
+      "log4j_properties_content": "\nlog4j.rootLogger = INFO, dailyfile\nlog4j.appender.stdout = org.apache.log4j.ConsoleAppender\nlog4j.appender.stdout.layout = org.apache.log4j.PatternLayout\nlog4j.appender.stdout.layout.ConversionPattern=%5p [%d] ({%t} %F[%M]:%L) - %m%n\nlog4j.appender.dailyfile.DatePattern=.yyyy-MM-dd\nlog4j.appender.dailyfile.Threshold = INFO\nlog4j.appender.dailyfile = org.apache.log4j.DailyRollingFileAppender\nlog4j.appender.dailyfile.File = ${zeppelin.log.file}\nlog4j.appender.dailyfile.layout = org.apache.log4j.PatternLayout\nlog4j.appender.dailyfile.layout.ConversionPattern=%5p [%d] ({%t} %F[%M]:%L) - %m%n",
+      "zeppelin.server.kerberos.principal": "", 
+      "zeppelin_user": "zeppelin", 
+      "zeppelin_env_content": "\n# Spark master url. eg. spark://master_addr:7077. Leave empty if you want to use local mode\nexport MASTER=yarn-client\nexport SPARK_YARN_JAR={{spark_jar}}\n\n\n# Where log files are stored.  PWD by default.\nexport ZEPPELIN_LOG_DIR={{zeppelin_log_dir}}\n\n# The pid files are stored. /tmp by default.\nexport ZEPPELIN_PID_DIR={{zeppelin_pid_dir}}\n\n\nexport JAVA_HOME={{java64_home}}\n\n# Additional jvm options. for example, export ZEPPELIN_JAVA_OPTS=\"-Dspark.executor.memory=8g -Dspark.cores.max=16\"\nexport ZEPPELIN_JAVA_OPTS=\"-Dhdp.version={{full_stack_version}} -Dspark.executor.memory={{executor_mem}} -Dspark.executor.instances={{executor_instances}} -Dspark.yarn.queue={{spark_queue}}\"\n\n\n# Zeppelin jvm mem options Default -Xmx1024m -XX:MaxPermSize=512m\n# export ZEPPELIN_MEM\n\n# zeppelin interpreter process jvm mem options. Defualt = ZEPPELIN_MEM\n# export ZEPPELIN_INTP_MEM\n\n# zeppelin interpreter process jvm options. Default = ZEPPELIN_JA
 VA_OPTS\n# export ZEPPELIN_INTP_JAVA_OPTS\n\n# Where notebook saved\n# export ZEPPELIN_NOTEBOOK_DIR\n\n# Id of notebook to be displayed in homescreen. ex) 2A94M5J1Z\n# export ZEPPELIN_NOTEBOOK_HOMESCREEN\n\n# hide homescreen notebook from list when this value set to \"true\". default \"false\"\n# export ZEPPELIN_NOTEBOOK_HOMESCREEN_HIDE\n\n# Bucket where notebook saved\n# export ZEPPELIN_NOTEBOOK_S3_BUCKET\n\n# User in bucket where notebook saved. For example bucket/user/notebook/2A94M5J1Z/note.json\n# export ZEPPELIN_NOTEBOOK_S3_USER\n\n# A string representing this instance of zeppelin. $USER by default\n# export ZEPPELIN_IDENT_STRING\n\n# The scheduling priority for daemons. Defaults to 0.\n# export ZEPPELIN_NICENESS\n\n\n#### Spark interpreter configuration ####\n\n## Use provided spark installation ##\n## defining SPARK_HOME makes Zeppelin run spark interpreter process using spark-submit\n##\n# (required) When it is defined, load it instead of Zeppelin embedded Spark libraries\n
 export SPARK_HOME={{spark_home}}\n\n# (optional) extra options to pass to spark submit. eg) \"--driver-memory 512M --executor-memory 1G\".\n# export SPARK_SUBMIT_OPTIONS\n\n## Use embedded spark binaries ##\n## without SPARK_HOME defined, Zeppelin still able to run spark interpreter process using embedded spark binaries.\n## however, it is not encouraged when you can define SPARK_HOME\n##\n# Options read in YARN client mode\n# yarn-site.xml is located in configuration directory in HADOOP_CONF_DIR.\nexport HADOOP_CONF_DIR=/etc/hadoop/conf\n\n# Pyspark (supported with Spark 1.2.1 and above)\n# To configure pyspark, you need to set spark distribution's path to 'spark.home' property in Interpreter setting screen in Zeppelin GUI\n# path to the python command. must be the same path on the driver(Zeppelin) and all workers.\n# export PYSPARK_PYTHON\n\nexport PYTHONPATH=\"${SPARK_HOME}/python:${SPARK_HOME}/python/lib/py4j-0.8.2.1-src.zip\"\nexport SPARK_YARN_USER_ENV=\"PYTHONPATH=${PYTHONPAT
 H}\"\n\n## Spark interpreter options ##\n##\n# Use HiveContext instead of SQLContext if set true. true by default.\n# export ZEPPELIN_SPARK_USEHIVECONTEXT\n\n# Execute multiple SQL concurrently if set true. false by default.\n# export ZEPPELIN_SPARK_CONCURRENTSQL\n\n# Max number of SparkSQL result to display. 1000 by default.\n# export ZEPPELIN_SPARK_MAXRESULT", 
+      "zeppelin_log_dir": "/var/log/zeppelin", 
+      "zeppelin_group": "zeppelin"
+    },
+"zeppelin-config": {
+            "zeppelin.server.port": "9995",
+            "zeppelin.server.ssl.port": "9995",
+            "zeppelin.ssl.truststore.password": "change me", 
+            "zeppelin.interpreters": "org.apache.zeppelin.spark.SparkInterpreter,org.apache.zeppelin.spark.PySparkInterpreter,org.apache.zeppelin.spark.SparkSqlInterpreter,org.apache.zeppelin.spark.DepInterpreter,org.apache.zeppelin.markdown.Markdown,org.apache.zeppelin.angular.AngularInterpreter,org.apache.zeppelin.shell.ShellInterpreter,org.apache.zeppelin.jdbc.JDBCInterpreter,org.apache.zeppelin.phoenix.PhoenixInterpreter,org.apache.zeppelin.livy.LivySparkInterpreter,org.apache.zeppelin.livy.LivyPySparkInterpreter,org.apache.zeppelin.livy.LivySparkRInterpreter,org.apache.zeppelin.livy.LivySparkSQLInterpreter",
+            "zeppelin.interpreter.group.order": "spark,angular,jdbc,livy,md,sh",
+            "zeppelin.ssl.truststore.path": "conf/truststore", 
+            "zeppelin.notebook.dir": "notebook", 
+            "zeppelin.ssl.keystore.password": "change me", 
+            "zeppelin.ssl.keystore.path": "conf/keystore", 
+            "zeppelin.server.addr": "0.0.0.0", 
+            "zeppelin.ssl.client.auth": "false", 
+            "zeppelin.notebook.homescreen": " ", 
+            "zeppelin.interpreter.dir": "interpreter", 
+            "zeppelin.ssl.keystore.type": "JKS", 
+            "zeppelin.notebook.s3.user": "user", 
+            "zeppelin.ssl.key.manager.password": "change me", 
+            "zeppelin.anonymous.allowed": "true", 
+            "zeppelin.ssl.truststore.type": "JKS", 
+            "zeppelin.ssl": "false", 
+            "zeppelin.notebook.storage": "org.apache.zeppelin.notebook.repo.VFSNotebookRepo", 
+            "zeppelin.websocket.max.text.message.size": "1024000", 
+            "zeppelin.interpreter.connect.timeout": "30000", 
+            "zeppelin.notebook.s3.bucket": "zeppelin", 
+            "zeppelin.notebook.homescreen.hide": "false", 
+            "zeppelin.server.allowed.origins": "*"
+        },
+    "zoo.cfg": {
+      "clientPort": "2181"
+    },
+    "ranger-hbase-plugin-properties": {
+      "ranger-hbase-plugin-enabled":"yes"
+    },
+    "ranger-hive-plugin-properties": {
+      "ranger-hive-plugin-enabled":"yes"
+    },
+    "ranger-env": {
+      "xml_configurations_supported" : "true"
+    },
+    "tagsync-application-properties": {
+            "atlas.kafka.hook.group.id": "atlas",
+            "atlas.kafka.zookeeper.connect": "os-mv-31-dev-4.novalocal:2181",
+            "atlas.kafka.acks": "1",
+            "atlas.kafka.entities.group.id": "ranger_entities_consumer",
+            "atlas.kafka.data": "/usr/hdp/current/atlas-server/data/kafka",
+            "atlas.kafka.bootstrap.servers": "localhost:2181",
+            "atlas.notification.embedded": "false"
+    },
+    "ranger-tagsync-site": {
+            "ranger.tagsync.sink.impl.class": "org.apache.ranger.tagsync.sink.tagadmin.TagAdminRESTSink",
+            "ranger.tagsync.atlasrestsource.endpoint": "",
+            "ranger.tagsync.tagadmin.rest.ssl.config.file": "/usr/hdp/current/ranger-tagsync/conf/mytruststore.jks",
+            "ranger.tagsync.logdir": "/var/log/ranger/tagsync",
+            "ranger.tagsync.filesource.filename": "/usr/hdp/current/ranger-tagsync/conf/etc/ranger/data/tags.json",
+            "ranger.tagsync.enabled": "true",
+            "ranger.tagsync.tagadmin.rest.url": "{{ranger_external_url}}",
+            "ranger.tagsync.atlasrestsource.download.interval": "",
+            "ranger.tagsync.filesource.modtime.check.interval": "60000",
+            "ranger.tagsync.tagadmin.password": "rangertagsync",
+            "ranger.tagsync.source.impl.class": "file",
+            "ranger.tagsync.source.atlas.custom.resource.mappers": "",
+            "ranger.tagsync.tagadmin.alias": "tagsync.tagadmin",
+            "ranger.tagsync.tagadmin.keystore": "/usr/hdp/current/ranger-tagsync/conf/rangertagsync.jceks",
+            "ranger.tagsync.atlas.to.service.mapping": ""
+    },
+    "druid-env": {
+      "druid_log_dir" : "/var/log/druid",
+      "druid_pid_dir" : "/var/run/druid",
+      "content" : "#!/bin/bash\n # Set DRUID specific environment variables here.\n# The java implementation to use\nexport JAVA_HOME={{java8_home}}\nexport PATH=$PATH:$JAVA_HOME/bin\nexport DRUID_PID_DIR={{druid_pid_dir}}\nexport DRUID_LOG_DIR={{druid_log_dir}}\nexport DRUID_CONF_DIR={{druid_conf_dir}}\nexport DRUID_LIB_DIR={{druid_home}}/lib",
+      "druid.coordinator.jvm.heap.memory" : 1024,
+      "druid.coordinator.jvm.direct.memory": 2048,
+      "druid.coordinator.jvm.opts": "-Duser.timezone=UTC -Dfile.encoding=UTF-8",
+      "druid.broker.jvm.heap.memory" : 1024,
+      "druid.broker.jvm.direct.memory": 2048,
+      "druid.broker.jvm.opts": "-Duser.timezone=UTC -Dfile.encoding=UTF-8",
+      "druid.middlemanager.jvm.heap.memory" : 1024,
+      "druid.middlemanager.jvm.direct.memory": 2048,
+      "druid.middlemanager.jvm.opts": "-Duser.timezone=UTC -Dfile.encoding=UTF-8",
+      "druid.historical.jvm.heap.memory" : 1024,
+      "druid.historical.jvm.direct.memory": 2048,
+      "druid.historical.jvm.opts": "-Duser.timezone=UTC -Dfile.encoding=UTF-8",
+      "druid.overlord.jvm.heap.memory" : 1024,
+      "druid.overlord.jvm.direct.memory": 2048,
+      "druid.overlord.jvm.opts": "-Duser.timezone=UTC -Dfile.encoding=UTF-8",
+      "druid.router.jvm.heap.memory" : 1024,
+      "druid.router.jvm.direct.memory": 2048,
+      "druid.router.jvm.opts": "-Duser.timezone=UTC -Dfile.encoding=UTF-8",
+      "druid_user": "druid"
+    },
+    "druid-common" : {
+      "druid.metadata.storage.type" : "mysql",
+      "druid.metadata.storage.connector.connectURI" : "jdbc:mysql://my-db-host:3306/druid?createDatabaseIfNotExist=true",
+      "druid.metadata.storage.connector.user" : "druid",
+      "druid.metadata.storage.connector.password" : "diurd",
+      "druid.storage.type" : "hdfs",
+      "druid.storage.storageDirectory" : "/user/druid/data",
+      "druid.indexer.logs.type": "hdfs",
+      "druid.indexer.logs.directory": "/user/druid/logs",
+      "druid.extensions.pullList": "[\"custom-druid-extension\"]",
+      "druid.extensions.repositoryList": "[\"http://custom-mvn-repo/public/release\"]",
+      "druid.extensions.loadList": "[\"mysql-metadata-storage\", \"druid-datasketches\"]",
+      "druid.security.extensions.loadList": "[\"druid-kerberos\"]"
+    },
+    "druid-historical" : {
+      "druid.segmentCache.infoDir" : "/apps/druid/segmentCache/info_dir",
+      "druid.segmentCache.locations" :"[{\"path\":\"/apps/druid/segmentCache\",\"maxSize\":300000000000}]"
+    },
+    "druid-coordinator" : {
+      "druid.service" : "druid/coordinator"
+    },
+    "druid-overlord" : {
+      "druid.service" : "druid/overlord"
+    },
+    "druid-broker" : {
+      "druid.service" : "druid/broker"
+    },
+    "druid-middlemanager" : {
+      "druid.service" : "druid/middlemanager",
+      "druid.indexer.task.hadoopWorkingPath" : "/tmp/druid-indexing",
+      "druid.indexer.task.baseTaskDir" : "/apps/druid/tasks"
+    },
+    "druid-router" : {
+      "druid.service" : "druid/router"
+    },
+    "druid-log4j" : {
+      "content" : "<![CDATA[<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one\n  ~ or more contributor license agreements.  See the NOTICE file\n  ~ distributed with this work for additional information\n  ~ regarding copyright ownership.  The ASF licenses this file\n  ~ to you under the Apache License, Version 2.0 (the\n  ~ \"License\"); you may not use this file except in compliance\n  ~ with the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n    <Configuration>\n        <Appenders>\n            <Console name=\"Console\
 " target=\"SYSTEM_OUT\">\n                <PatternLayout pattern=\"%d{ISO8601} %p [%t] %c - %m%n\"/>\n            </Console>\n        </Appenders>\n        <Loggers>\n            <Logger name=\"com.metamx\" level=\"{{metamx_log_level}}\"/>\n            <Logger name=\"io.druid\" level=\"{{druid_log_level}}\"/>\n            <Root level=\"{{root_log_level}}\">\n                <AppenderRef ref=\"Console\"/>\n            </Root>\n        </Loggers>\n    </Configuration>\n      ]]>\n"
+    },
+    "druid-logrotate" : {
+      "content" : "<![CDATA[\n    {{druid_log_dir}}/*.log {\n        copytruncate\n        rotate 7\n        daily\n        nocompress\n        missingok\n        notifempty\n        create 660 druid users\n        dateext\n        dateformat -%Y-%m-%d-%s\n        }\n      ]]>\n"
+    },
+    "superset" : {
+      "SUPERSET_DATABASE_TYPE" : "sqllite"
+    }
+  },
+  "configuration_attributes": {
+    "sqoop-site": {},
+    "yarn-site": {
+      "final": {
+        "yarn.nodemanager.disk-health-checker.min-healthy-disks": "true",
+        "yarn.nodemanager.container-executor.class": "true",
+        "yarn.nodemanager.local-dirs": "true"
+      }
+    },
+    "yarn-site": {
+      "final": {
+        "is_supported_yarn_ranger": "true"
+      }
+    },
+    "hdfs-site": {
+      "final": {
+        "dfs.web.ugi": "true",
+        "dfs.support.append": "true",
+        "dfs.cluster.administrators": "true"
+      }
+    },
+    "core-site": {
+      "final": {
+        "hadoop.proxyuser.hive.groups": "true",
+        "webinterface.private.actions": "true",
+        "hadoop.proxyuser.oozie.hosts": "true"
+      }
+    },
+    "knox-env": {},
+    "gateway-site": {},
+    "users-ldif": {},
+    "kafka-env": {},
+    "kafka-log4j": {},
+    "kafka-broker": {},
+    "metadata-env": {},
+    "atlas-hbase-site": {},
+    "tagsync-application-properties": {},
+    "ranger-tagsync-site": {}
+  },
+  "configurationTags": {
+    "slider-client": {
+      "tag": "version1"
+    },
+    "slider-log4j": {
+      "tag": "version1"
+    },
+    "slider-env": {
+      "tag": "version1"
+    },
+    "core-site": {
+      "tag": "version1"
+    },
+    "hdfs-site": {
+      "tag": "version1"
+    },
+    "yarn-site": {
+      "tag": "version1"
+    },
+    "gateway-site": {
+      "tag": "version1"
+    },
+    "topology": {
+      "tag": "version1"
+    },
+    "users-ldif": {
+      "tag": "version1"
+    },
+    "kafka-env": {
+      "tag": "version1"
+    },
+    "kafka-log4j": {
+      "tag": "version1"
+    },
+    "kafka-broker": {
+      "tag": "version1"
+    },
+    "metadata-env": {
+      "tag": "version1"
+    },
+    "tagsync-application-properties": {
+      "tag": "version1"
+    },
+    "ranger-tagsync-site": {
+      "tag": "version1"
+    }
+  },
+  "commandId": "7-1",
+  "clusterHostInfo": {
+    "ambari_server_host": [
+      "c6401.ambari.apache.org"
+    ],
+    "all_ping_ports": [
+      "8670",
+      "8670"
+    ],
+    "rm_host": [
+      "c6402.ambari.apache.org"
+    ],
+    "all_hosts": [
+      "c6401.ambari.apache.org",
+      "c6402.ambari.apache.org"
+    ],
+    "knox_gateway_hosts": [
+      "jaimin-knox-1.c.pramod-thangali.internal"
+    ],
+    "kafka_broker_hosts": [
+      "c6401.ambari.apache.org"
+    ],
+    "infra_solr_hosts": [
+      "c6401.ambari.apache.org"
+    ],
+    "zookeeper_hosts": [
+      "c6401.ambari.apache.org"
+    ],
+    "ranger_tagsync_hosts": [
+      "c6401.ambari.apache.org"
+    ],
+    "atlas_server_hosts": [
+      "c6401.ambari.apache.org"
+    ],
+    "zeppelin_master_hosts": [
+      "c6401.ambari.apache.org"
+    ]
+  }
+}


[09/29] ambari git commit: AMBARI-22564 Log Search UI: layout and behaviour changes for filtering. (ababiichuk)

Posted by rl...@apache.org.
AMBARI-22564 Log Search UI: layout and behaviour changes for filtering. (ababiichuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/63a15872
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/63a15872
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/63a15872

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 63a15872fec4ffec793878258b13b356e74528fa
Parents: 1a803cc
Author: ababiichuk <ab...@hortonworks.com>
Authored: Thu Nov 30 18:03:18 2017 +0200
Committer: ababiichuk <ab...@hortonworks.com>
Committed: Thu Nov 30 20:39:06 2017 +0200

----------------------------------------------------------------------
 .../action-menu/action-menu.component.less      |  3 -
 .../action-menu/action-menu.component.ts        |  4 --
 .../audit-logs-table.component.html             |  8 ++-
 .../dropdown-button.component.html              |  4 +-
 .../dropdown-button.component.less              | 17 +++---
 .../dropdown-button.component.ts                |  3 +
 .../filters-panel/filters-panel.component.html  | 14 ++---
 .../filters-panel/filters-panel.component.less  | 11 +++-
 .../filters-panel/filters-panel.component.ts    | 21 +++++--
 .../menu-button/menu-button.component.less      | 13 +---
 .../src/app/components/mixins.less              | 17 ++++++
 .../pagination/pagination.component.html        |  4 +-
 .../search-box/search-box.component.html        |  2 +-
 .../search-box/search-box.component.less        | 18 +++---
 .../search-box/search-box.component.ts          | 38 ++++++++----
 .../service-logs-table.component.html           |  7 ++-
 .../service-logs-table.component.less           |  1 -
 .../components/top-menu/top-menu.component.html |  7 ++-
 .../components/top-menu/top-menu.component.less |  4 ++
 .../top-menu/top-menu.component.spec.ts         | 64 +++++++++++++++++++-
 .../components/top-menu/top-menu.component.ts   | 25 +++++++-
 .../src/app/components/variables.less           |  3 +-
 .../src/app/services/logs-container.service.ts  | 11 +++-
 .../src/assets/i18n/en.json                     |  2 +-
 .../ambari-logsearch-web/webpack.config.js      | 20 +++---
 25 files changed, 225 insertions(+), 96 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/63a15872/ambari-logsearch/ambari-logsearch-web/src/app/components/action-menu/action-menu.component.less
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/action-menu/action-menu.component.less b/ambari-logsearch/ambari-logsearch-web/src/app/components/action-menu/action-menu.component.less
index 880a97b..fff57df 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/action-menu/action-menu.component.less
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/action-menu/action-menu.component.less
@@ -15,13 +15,10 @@
  * limitations under the License.
  */
 
-@import '../variables';
-
 :host {
   display: block;
   margin-left: auto;
   menu-button {
     margin: 0 1em;
-    color: @table-border-color;
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/63a15872/ambari-logsearch/ambari-logsearch-web/src/app/components/action-menu/action-menu.component.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/action-menu/action-menu.component.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/action-menu/action-menu.component.ts
index 58e0025..72037f8 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/action-menu/action-menu.component.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/action-menu/action-menu.component.ts
@@ -30,7 +30,6 @@ export class ActionMenuComponent {
     {
       iconClass: 'fa fa-arrow-left',
       label: 'topMenu.undo',
-      labelClass: 'unstyled-link',
       action: 'undo',
       subItems: [
         {
@@ -50,7 +49,6 @@ export class ActionMenuComponent {
     {
       iconClass: 'fa fa-arrow-right',
       label: 'topMenu.redo',
-      labelClass: 'unstyled-link',
       action: 'redo',
       subItems: [
         {
@@ -67,13 +65,11 @@ export class ActionMenuComponent {
     {
       iconClass: 'fa fa-refresh',
       label: 'topMenu.refresh',
-      labelClass: 'unstyled-link',
       action: 'refresh'
     },
     {
       iconClass: 'fa fa-history',
       label: 'topMenu.history',
-      labelClass: 'unstyled-link',
       action: 'openHistory',
       isRightAlign: true,
       subItems: [

http://git-wip-us.apache.org/repos/asf/ambari/blob/63a15872/ambari-logsearch/ambari-logsearch-web/src/app/components/audit-logs-table/audit-logs-table.component.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/audit-logs-table/audit-logs-table.component.html b/ambari-logsearch/ambari-logsearch-web/src/app/components/audit-logs-table/audit-logs-table.component.html
index d6e9091..cad09bc 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/audit-logs-table/audit-logs-table.component.html
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/audit-logs-table/audit-logs-table.component.html
@@ -15,12 +15,14 @@
   limitations under the License.
 -->
 
-<dropdown-button class="pull-right" label="logs.columns" [options]="columns" [isRightAlign]="true"
+<dropdown-button class="pull-right" label="{{'logs.columns' | translate}}" [options]="columns" [isRightAlign]="true"
                  [isMultipleChoice]="true" action="updateSelectedColumns"
                  [additionalArgs]="logsTypeMapObject.fieldsModel"></dropdown-button>
 <form *ngIf="logs && logs.length" [formGroup]="filtersForm" class="row pull-right">
-  <filter-dropdown class="col-md-12" [label]="filters.auditLogsSorting.label" formControlName="auditLogsSorting"
-                   [options]="filters.auditLogsSorting.options" [isRightAlign]="true"></filter-dropdown></form>
+  <filter-dropdown class="col-md-12" label="{{filters.auditLogsSorting.label | translate}}"
+                   formControlName="auditLogsSorting" [options]="filters.auditLogsSorting.options"
+                   [isRightAlign]="true"></filter-dropdown>
+</form>
 <div class="panel panel-default">
   <div class="panel-body">
     <table class="table">

http://git-wip-us.apache.org/repos/asf/ambari/blob/63a15872/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-button/dropdown-button.component.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-button/dropdown-button.component.html b/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-button/dropdown-button.component.html
index b5f1e56..d047d7a 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-button/dropdown-button.component.html
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-button/dropdown-button.component.html
@@ -16,11 +16,11 @@
 -->
 
 <div [ngClass]="{'dropup': isDropup}">
-  <button class="btn btn-link dropdown-toggle" data-toggle="dropdown">
+  <button [ngClass]="['btn', 'btn-link', 'dropdown-toggle', buttonClass]" data-toggle="dropdown">
     <span *ngIf="iconClass || label"
           [ngClass]="{'filter-label': true, 'plain': !isMultipleChoice && !hideCaret && showSelectedValue}">
       <span *ngIf="iconClass" [ngClass]="iconClass"></span>
-      <span *ngIf="label">{{label | translate}}</span>
+      <span *ngIf="label">{{label}}</span>
     </span>
     <span *ngIf="showSelectedValue && !isMultipleChoice && selection.length">{{selection[0].label | translate}}</span>
     <span *ngIf="!hideCaret" class="caret"></span>

http://git-wip-us.apache.org/repos/asf/ambari/blob/63a15872/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-button/dropdown-button.component.less
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-button/dropdown-button.component.less b/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-button/dropdown-button.component.less
index d767e15..7b560c1 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-button/dropdown-button.component.less
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-button/dropdown-button.component.less
@@ -20,17 +20,16 @@
 :host {
   .default-flex;
   position: relative;
-  float: left;
 
-  .filter-label {
-    padding: @input-group-addon-padding;
+  button {
+    text-transform: none;
 
-    &.plain {
-      color: initial;
-    }
-  }
+    .filter-label {
+      padding: @input-group-addon-padding;
 
-  .btn {
-    text-transform: none;
+      &.plain {
+        color: initial;
+      }
+    }
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/63a15872/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-button/dropdown-button.component.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-button/dropdown-button.component.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-button/dropdown-button.component.ts
index 148e1b4..a8037d0 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-button/dropdown-button.component.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-button/dropdown-button.component.ts
@@ -35,6 +35,9 @@ export class DropdownButtonComponent {
   label?: string;
 
   @Input()
+  buttonClass: string = '';
+
+  @Input()
   iconClass?: string;
 
   @Input()

http://git-wip-us.apache.org/repos/asf/ambari/blob/63a15872/ambari-logsearch/ambari-logsearch-web/src/app/components/filters-panel/filters-panel.component.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/filters-panel/filters-panel.component.html b/ambari-logsearch/ambari-logsearch-web/src/app/components/filters-panel/filters-panel.component.html
index 4fe169d..440efde 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/filters-panel/filters-panel.component.html
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/filters-panel/filters-panel.component.html
@@ -17,22 +17,20 @@
 
 <form [formGroup]="filtersForm">
   <div class="form-inline filter-input-container col-md-8">
-    <filter-dropdown *ngIf="isFilterConditionDisplayed('clusters')" [label]="filters.clusters.label"
-                     formControlName="clusters" [options]="filters.clusters.options" [isMultipleChoice]="true"
-                     class="filter-input"></filter-dropdown>
     <search-box [parameterAddSubject]="queryParameterAdd" [parameterNameChangeSubject]="queryParameterNameChange"
                 formControlName="query" [items]="searchBoxItemsTranslated" [itemsOptions]="options"
-                class="filter-input"></search-box>
+                [updateValueImmediately]="false" [updateValueSubject]="searchBoxValueUpdate" class="filter-input"></search-box>
     <time-range-picker *ngIf="isFilterConditionDisplayed('timeRange')" formControlName="timeRange"
                        class="filter-input"></time-range-picker>
     <timezone-picker class="filter-input"></timezone-picker>
-    <!--button class="btn btn-success" type="button">
+    <button class="btn btn-success search-button" type="button" (click)="updateSearchBoxValue()">
       <span class="fa fa-search"></span>
-    </button-->
+    </button>
   </div>
   <div class="filter-buttons col-md-4">
-    <dropdown-button [options]="searchBoxItems | async" iconClass="fa fa-search-minus" label="filter.excluded"
-                     [hideCaret]="true" [showSelectedValue]="false" action="proceedWithExclude"></dropdown-button>
+    <dropdown-button [options]="searchBoxItems | async" iconClass="fa fa-search-minus" action="proceedWithExclude"
+                     label="{{'filter.exclude' | translate}}" [hideCaret]="true"
+                     [showSelectedValue]="false"></dropdown-button>
     <filter-button *ngIf="isFilterConditionDisplayed('hosts')" formControlName="hosts"
                    label="{{filters.hosts.label | translate}}" [iconClass]="filters.hosts.iconClass"
                    [subItems]="filters.hosts.options" [isMultipleChoice]="true" [isRightAlign]="true"

http://git-wip-us.apache.org/repos/asf/ambari/blob/63a15872/ambari-logsearch/ambari-logsearch-web/src/app/components/filters-panel/filters-panel.component.less
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/filters-panel/filters-panel.component.less b/ambari-logsearch/ambari-logsearch-web/src/app/components/filters-panel/filters-panel.component.less
index 962199b..e2f9a1e 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/filters-panel/filters-panel.component.less
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/filters-panel/filters-panel.component.less
@@ -28,9 +28,14 @@
     align-items: flex-start;
     justify-content: flex-start;
 
-    .btn-success {
-      border-top-left-radius: 0;
-      border-bottom-left-radius: 0;
+    .search-button {
+      border: 1px solid @submit-color;
+      height: auto;
+
+      &:last-child {
+        border-top-left-radius: 0;
+        border-bottom-left-radius: 0;
+      }
     }
 
     .filter-input {

http://git-wip-us.apache.org/repos/asf/ambari/blob/63a15872/ambari-logsearch/ambari-logsearch-web/src/app/components/filters-panel/filters-panel.component.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/filters-panel/filters-panel.component.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/filters-panel/filters-panel.component.ts
index 01a8932..1717bd7 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/filters-panel/filters-panel.component.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/filters-panel/filters-panel.component.ts
@@ -20,7 +20,8 @@ import {Component, OnChanges, SimpleChanges, Input} from '@angular/core';
 import {FormGroup} from '@angular/forms';
 import {Observable} from 'rxjs/Observable';
 import {Subject} from 'rxjs/Subject';
-import {FilterCondition} from '@app/classes/filtering';
+import 'rxjs/add/observable/from';
+import {FilterCondition, SearchBoxParameter, SearchBoxParameterTriggered} from '@app/classes/filtering';
 import {ListItem} from '@app/classes/list-item';
 import {LogsType} from '@app/classes/string';
 import {CommonEntry} from '@app/classes/models/common-entry';
@@ -46,6 +47,9 @@ export class FiltersPanelComponent implements OnChanges {
         case 'serviceLogs':
           result = this.logsContainer.serviceLogsColumns;
           break;
+        default:
+          result = Observable.from([]);
+          break;
       }
       this.searchBoxItems = result;
     }
@@ -65,6 +69,8 @@ export class FiltersPanelComponent implements OnChanges {
         return this.logsContainer.auditLogsColumnsTranslated;
       case 'serviceLogs':
         return this.logsContainer.serviceLogsColumnsTranslated;
+      default:
+        return [];
     }
   }
 
@@ -93,11 +99,11 @@ export class FiltersPanelComponent implements OnChanges {
     }, {});
   }
 
-  get queryParameterNameChange(): Subject<any> {
+  get queryParameterNameChange(): Subject<SearchBoxParameterTriggered> {
     return this.logsContainer.queryParameterNameChange;
   }
 
-  get queryParameterAdd(): Subject<any> {
+  get queryParameterAdd(): Subject<SearchBoxParameter> {
     return this.logsContainer.queryParameterAdd;
   }
 
@@ -105,9 +111,14 @@ export class FiltersPanelComponent implements OnChanges {
     return this.logsContainer.captureSeconds;
   }
 
+  searchBoxValueUpdate: Subject<void> = new Subject();
+
   isFilterConditionDisplayed(key: string): boolean {
-    return this.logsContainer.logsTypeMap[this.logsType].listFilters.indexOf(key) > -1
-      && Boolean(this.filtersForm.controls[key]);
+    return this.logsContainer.isFilterConditionDisplayed(key);
+  }
+
+  updateSearchBoxValue(): void {
+    this.searchBoxValueUpdate.next();
   }
 
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/63a15872/ambari-logsearch/ambari-logsearch-web/src/app/components/menu-button/menu-button.component.less
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/menu-button/menu-button.component.less b/ambari-logsearch/ambari-logsearch-web/src/app/components/menu-button/menu-button.component.less
index 0207561..0ec3dd0 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/menu-button/menu-button.component.less
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/menu-button/menu-button.component.less
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-@import '../variables';
+@import '../mixins';
 
 :host {
   cursor: pointer;
@@ -24,8 +24,7 @@
   a {
     text-align: center;
     text-decoration: none;
-    i {
-      color: @link-color;
+    .icon {
       display: inline-block;
       position: relative;
       &.fa-caret-down {
@@ -36,14 +35,6 @@
       display: block;
     }
   }
-  a:hover, a:focus {
-    i {
-      color: @link-hover-color;
-    }
-  }
-  .unstyled-link {
-    color: inherit;
-  }
 
   .badge {
     background: @badge-bg;

http://git-wip-us.apache.org/repos/asf/ambari/blob/63a15872/ambari-logsearch/ambari-logsearch-web/src/app/components/mixins.less
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/mixins.less b/ambari-logsearch/ambari-logsearch-web/src/app/components/mixins.less
index 4460821..0bf169d 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/mixins.less
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/mixins.less
@@ -140,6 +140,23 @@
   }
 }
 
+.grey {
+  color: @grey-color;
+}
+
+.collapsed-form-control {
+  width: 0;
+  padding: 0;
+}
+
+.inherited-color {
+  color: inherit;
+
+  &:hover {
+    color: inherit;
+  }
+}
+
 /**
  * Caret mixin definition.
  * The .caret mixin has two parameters: the width of the caret and the direction of the caret

http://git-wip-us.apache.org/repos/asf/ambari/blob/63a15872/ambari-logsearch/ambari-logsearch-web/src/app/components/pagination/pagination.component.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/pagination/pagination.component.html b/ambari-logsearch/ambari-logsearch-web/src/app/components/pagination/pagination.component.html
index 4be0a47..02ed84b 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/pagination/pagination.component.html
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/pagination/pagination.component.html
@@ -16,8 +16,8 @@
 -->
 
 <form class="pagination-form" [formGroup]="filtersForm">
-  <filter-dropdown [label]="filterInstance.label" formControlName="pageSize" [options]="filterInstance.options"
-                   [isRightAlign]="true" [isDropup]="true"></filter-dropdown>
+  <filter-dropdown label="{{filterInstance.label | translate}}" formControlName="pageSize"
+                   [options]="filterInstance.options" [isRightAlign]="true" [isDropup]="true"></filter-dropdown>
   <span>{{'pagination.numbers' | translate: numbersTranslateParams}}</span>
   <pagination-controls formControlName="page" [totalCount]="totalCount" [pagesCount]="pagesCount"
                        (currentPageChange)="setCurrentPage($event)"></pagination-controls>

http://git-wip-us.apache.org/repos/asf/ambari/blob/63a15872/ambari-logsearch/ambari-logsearch-web/src/app/components/search-box/search-box.component.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/search-box/search-box.component.html b/ambari-logsearch/ambari-logsearch-web/src/app/components/search-box/search-box.component.html
index 5bffdc5..5ab9a69 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/search-box/search-box.component.html
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/search-box/search-box.component.html
@@ -30,7 +30,7 @@
            (valueChanged)="changeParameterName({value: $event.value, isExclude: false})"
            (keyup)="onParameterKeyUp($event)">
   </span>
-  <span [ngClass]="{'no-value-options': !activeItemValueOptions.length}">
+  <span [ngClass]="{'no-options': !activeItemValueOptions.length}">
     <input #valueInput auto-complete [(ngModel)]="currentValue" [source]="activeItemValueOptions"
            [list-formatter]="itemsListFormatter" [value-formatter]="itemsValueFormatter" [match-formatted]="true"
            (valueChanged)="onParameterValueChange($event.value)" (keydown)="onParameterValueKeyDown($event)"

http://git-wip-us.apache.org/repos/asf/ambari/blob/63a15872/ambari-logsearch/ambari-logsearch-web/src/app/components/search-box/search-box.component.less
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/search-box/search-box.component.less b/ambari-logsearch/ambari-logsearch-web/src/app/components/search-box/search-box.component.less
index eac3bd6..9deea92 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/search-box/search-box.component.less
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/search-box/search-box.component.less
@@ -20,10 +20,6 @@
 
 @inactive-input-width: 1px;
 @label-margin: 2px;
-.collapsed-form-control {
-  width: 0;
-  padding: 0;
-}
 
 :host {
   display: flex;
@@ -38,7 +34,7 @@
     margin: @label-margin;
     border-radius: @dropdown-border-radius;
     padding: @search-parameter-padding;
-    background-color: @search-parameter-background-color;
+    background-color: @grey-color;
     color: @base-font-color;
     font-size: 0.8em;
 
@@ -97,16 +93,16 @@
           }
         }
 
-        .no-value-options {
-          /deep/ .ng2-auto-complete {
-            display: none;
-          }
-        }
-
         .value-input {
           width: 100%;
         }
       }
+
+      .no-options {
+        /deep/ .ng2-auto-complete {
+          display: none;
+        }
+      }
     }
 
     /deep/ .ng2-auto-complete {

http://git-wip-us.apache.org/repos/asf/ambari/blob/63a15872/ambari-logsearch/ambari-logsearch-web/src/app/components/search-box/search-box.component.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/search-box/search-box.component.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/search-box/search-box.component.ts
index 14cc89b..64b8c36 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/search-box/search-box.component.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/search-box/search-box.component.ts
@@ -51,6 +51,7 @@ export class SearchBoxComponent implements OnInit, OnDestroy, ControlValueAccess
     this.valueInput.addEventListener('blur', this.onValueInputBlur);
     this.parameterNameChangeSubject.subscribe(this.onParameterNameChange);
     this.parameterAddSubject.subscribe(this.onParameterAdd);
+    this.updateValueSubject.subscribe(this.updateValue);
   }
 
   ngOnDestroy(): void {
@@ -61,6 +62,7 @@ export class SearchBoxComponent implements OnInit, OnDestroy, ControlValueAccess
     this.valueInput.removeEventListener('blur', this.onValueInputBlur);
     this.parameterNameChangeSubject.unsubscribe();
     this.parameterAddSubject.unsubscribe();
+    this.updateValueSubject.unsubscribe();
   }
 
   private readonly messageParameterName: string = 'log_message';
@@ -69,8 +71,6 @@ export class SearchBoxComponent implements OnInit, OnDestroy, ControlValueAccess
 
   private isExclude: boolean = false;
 
-  private defaultSubject: Subject<any> = new Subject();
-
   isActive: boolean = false;
 
   isParameterInput: boolean = false;
@@ -86,10 +86,20 @@ export class SearchBoxComponent implements OnInit, OnDestroy, ControlValueAccess
   itemsOptions: {[key: string]: CommonEntry[]};
 
   @Input()
-  parameterNameChangeSubject: Subject<SearchBoxParameterTriggered> = this.defaultSubject;
+  parameterNameChangeSubject: Subject<SearchBoxParameterTriggered> = new Subject();
+
+  @Input()
+  parameterAddSubject: Subject<SearchBoxParameter> = new Subject();
+
+  @Input()
+  updateValueSubject: Subject<void> = new Subject();
 
+  /**
+   * Indicates whether form should receive updated value immediately after user adds new search parameter
+   * @type {boolean}
+   */
   @Input()
-  parameterAddSubject: Subject<SearchBoxParameter> = this.defaultSubject;
+  updateValueImmediately: boolean = true;
 
   @ViewChild('parameterInput')
   parameterInputRef: ElementRef;
@@ -147,7 +157,7 @@ export class SearchBoxComponent implements OnInit, OnDestroy, ControlValueAccess
   private switchToParameterInput = (): void => {
     this.activeItem = null;
     this.isValueInput = false;
-    setTimeout(() => this.parameterInput.focus());
+    setTimeout(() => this.parameterInput.focus(), 0);
   };
 
   private getItemByValue(name: string): CommonEntry {
@@ -211,7 +221,9 @@ export class SearchBoxComponent implements OnInit, OnDestroy, ControlValueAccess
         value: value,
         isExclude: this.isExclude
       });
-      this.updateValue();
+      if (this.updateValueImmediately) {
+        this.updateValueSubject.next();
+      }
     }
     this.switchToParameterInput();
   }
@@ -225,7 +237,9 @@ export class SearchBoxComponent implements OnInit, OnDestroy, ControlValueAccess
       value: options.value,
       isExclude: options.isExclude
     });
-    this.updateValue();
+    if (this.updateValueImmediately) {
+      this.updateValueSubject.next();
+    }
   };
 
   onParameterKeyUp = (event: KeyboardEvent): void => {
@@ -248,20 +262,22 @@ export class SearchBoxComponent implements OnInit, OnDestroy, ControlValueAccess
 
   removeParameter(event: MouseEvent, id: number): void {
     this.parameters = this.parameters.filter((parameter: SearchBoxParameterProcessed): boolean => parameter.id !== id);
-    this.updateValue();
+    if (this.updateValueImmediately) {
+      this.updateValueSubject.next();
+    }
     event.stopPropagation();
   }
 
-  updateValue(): void {
+  updateValue = (): void => {
     this.currentValue = '';
     if (this.onChange) {
       this.onChange(this.parameters);
     }
-  }
+  };
 
   writeValue(parameters: SearchBoxParameterProcessed[] = []): void {
     this.parameters = parameters;
-    this.updateValue();
+    this.updateValueSubject.next();
   }
 
   registerOnChange(callback: any): void {

http://git-wip-us.apache.org/repos/asf/ambari/blob/63a15872/ambari-logsearch/ambari-logsearch-web/src/app/components/service-logs-table/service-logs-table.component.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/service-logs-table/service-logs-table.component.html b/ambari-logsearch/ambari-logsearch-web/src/app/components/service-logs-table/service-logs-table.component.html
index a2e666e..7f9c6d7 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/service-logs-table/service-logs-table.component.html
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/service-logs-table/service-logs-table.component.html
@@ -15,12 +15,13 @@
   limitations under the License.
 -->
 
-<dropdown-button class="pull-right" label="logs.columns" [options]="columns" [isRightAlign]="true"
+<dropdown-button class="pull-right" label="{{'logs.columns' | translate}}" [options]="columns" [isRightAlign]="true"
                  [isMultipleChoice]="true" action="updateSelectedColumns"
                  [additionalArgs]="logsTypeMapObject.fieldsModel"></dropdown-button>
 <form *ngIf="logs && logs.length" [formGroup]="filtersForm" class="row pull-right">
-  <filter-dropdown class="col-md-12" [label]="filters.serviceLogsSorting.label" formControlName="serviceLogsSorting"
-                   [options]="filters.serviceLogsSorting.options" [isRightAlign]="true"></filter-dropdown>
+  <filter-dropdown class="col-md-12" label="{{filters.serviceLogsSorting.label | translate}}"
+                   formControlName="serviceLogsSorting" [options]="filters.serviceLogsSorting.options"
+                   [isRightAlign]="true"></filter-dropdown>
 </form>
 <div class="panel panel-default">
   <div class="panel-body">

http://git-wip-us.apache.org/repos/asf/ambari/blob/63a15872/ambari-logsearch/ambari-logsearch-web/src/app/components/service-logs-table/service-logs-table.component.less
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/service-logs-table/service-logs-table.component.less b/ambari-logsearch/ambari-logsearch-web/src/app/components/service-logs-table/service-logs-table.component.less
index bd6d012..dfa1889 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/service-logs-table/service-logs-table.component.less
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/service-logs-table/service-logs-table.component.less
@@ -53,7 +53,6 @@
       }
     }
     &.log-time {
-      color: @grey-color;
       min-width: 7em;
       text-align: right;
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/63a15872/ambari-logsearch/ambari-logsearch-web/src/app/components/top-menu/top-menu.component.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/top-menu/top-menu.component.html b/ambari-logsearch/ambari-logsearch-web/src/app/components/top-menu/top-menu.component.html
index 369ddd4..910e55f 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/top-menu/top-menu.component.html
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/top-menu/top-menu.component.html
@@ -16,8 +16,13 @@
 -->
 
 <div class="pull-right">
+  <form [formGroup]="filtersForm" class="filters">
+    <filter-dropdown *ngIf="isClustersFilterDisplayed" formControlName="clusters" [options]="filters.clusters.options"
+                     [isMultipleChoice]="true" label="{{filters.clusters.label | translate}}" [isRightAlign]="true"
+                     buttonClass="inherited-color"></filter-dropdown>
+  </form>
   <menu-button *ngFor="let item of items" label="{{item.label | translate}}" [action]="item.action"
                [iconClass]="item.iconClass" [labelClass]="item.labelClass" [subItems]="item.subItems"
-               [hideCaret]="item.hideCaret" [badge]="item.badge"  [isRightAlign]="item.isRightAlign">
+               [hideCaret]="item.hideCaret" [badge]="item.badge" [isRightAlign]="item.isRightAlign">
   </menu-button>
 </div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/63a15872/ambari-logsearch/ambari-logsearch-web/src/app/components/top-menu/top-menu.component.less
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/top-menu/top-menu.component.less b/ambari-logsearch/ambari-logsearch-web/src/app/components/top-menu/top-menu.component.less
index 32d1beb..257768c 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/top-menu/top-menu.component.less
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/top-menu/top-menu.component.less
@@ -20,4 +20,8 @@
 :host {
   .default-flex;
   margin-right: 0;
+
+  .filters {
+    display: inline-block;
+  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/63a15872/ambari-logsearch/ambari-logsearch-web/src/app/components/top-menu/top-menu.component.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/top-menu/top-menu.component.spec.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/top-menu/top-menu.component.spec.ts
index 6679ba1..ba5b613 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/top-menu/top-menu.component.spec.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/top-menu/top-menu.component.spec.ts
@@ -18,18 +18,80 @@
 
 import {CUSTOM_ELEMENTS_SCHEMA} from '@angular/core';
 import {async, ComponentFixture, TestBed} from '@angular/core/testing';
+import {ReactiveFormsModule} from '@angular/forms';
+import {StoreModule} from '@ngrx/store';
 import {TranslationModules} from '@app/test-config.spec';
+import {AuditLogsService, auditLogs} from '@app/services/storage/audit-logs.service';
+import {ServiceLogsService, serviceLogs} from '@app/services/storage/service-logs.service';
+import {AuditLogsFieldsService, auditLogsFields} from '@app/services/storage/audit-logs-fields.service';
+import {ServiceLogsFieldsService, serviceLogsFields} from '@app/services/storage/service-logs-fields.service';
+import {
+  ServiceLogsHistogramDataService, serviceLogsHistogramData
+} from '@app/services/storage/service-logs-histogram-data.service';
+import {ServiceLogsTruncatedService, serviceLogsTruncated} from '@app/services/storage/service-logs-truncated.service';
+import {AppStateService, appState} from '@app/services/storage/app-state.service';
+import {AppSettingsService, appSettings} from '@app/services/storage/app-settings.service';
+import {TabsService, tabs} from '@app/services/storage/tabs.service';
+import {ClustersService, clusters} from '@app/services/storage/clusters.service';
+import {ComponentsService, components} from '@app/services/storage/components.service';
+import {HostsService, hosts} from '@app/services/storage/hosts.service';
+import {LogsContainerService} from '@app/services/logs-container.service';
+import {HttpClientService} from '@app/services/http-client.service';
 
 import {TopMenuComponent} from './top-menu.component';
 
 describe('TopMenuComponent', () => {
   let component: TopMenuComponent;
   let fixture: ComponentFixture<TopMenuComponent>;
+  const httpClient = {
+    get: () => {
+      return {
+        subscribe: () => {
+        }
+      };
+    }
+  };
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      imports: TranslationModules,
+      imports: [
+        ReactiveFormsModule,
+        StoreModule.provideStore({
+          auditLogs,
+          serviceLogs,
+          auditLogsFields,
+          serviceLogsFields,
+          serviceLogsHistogramData,
+          serviceLogsTruncated,
+          appState,
+          appSettings,
+          tabs,
+          clusters,
+          components,
+          hosts
+        }),
+        ...TranslationModules
+      ],
       declarations: [TopMenuComponent],
+      providers: [
+        LogsContainerService,
+        {
+          provide: HttpClientService,
+          useValue: httpClient
+        },
+        AuditLogsService,
+        ServiceLogsService,
+        AuditLogsFieldsService,
+        ServiceLogsFieldsService,
+        ServiceLogsHistogramDataService,
+        ServiceLogsTruncatedService,
+        AppStateService,
+        AppSettingsService,
+        TabsService,
+        ClustersService,
+        ComponentsService,
+        HostsService
+      ],
       schemas: [CUSTOM_ELEMENTS_SCHEMA]
     })
     .compileComponents();

http://git-wip-us.apache.org/repos/asf/ambari/blob/63a15872/ambari-logsearch/ambari-logsearch-web/src/app/components/top-menu/top-menu.component.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/top-menu/top-menu.component.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/top-menu/top-menu.component.ts
index 91f27e8..6df7ab3 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/top-menu/top-menu.component.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/top-menu/top-menu.component.ts
@@ -17,6 +17,10 @@
  */
 
 import {Component} from '@angular/core';
+import {FormGroup} from '@angular/forms';
+import {FilterCondition, TimeUnitListItem} from '@app/classes/filtering';
+import {ListItem} from '@app/classes/list-item';
+import {LogsContainerService} from '@app/services/logs-container.service';
 
 @Component({
   selector: 'top-menu',
@@ -25,10 +29,21 @@ import {Component} from '@angular/core';
 })
 export class TopMenuComponent {
 
+  constructor(private logsContainer: LogsContainerService) {
+  }
+
+  get filtersForm(): FormGroup {
+    return this.logsContainer.filtersForm;
+  };
+
+  get filters(): {[key: string]: FilterCondition} {
+    return this.logsContainer.filters;
+  };
+
   //TODO implement loading of real data into subItems
   readonly items = [
     {
-      iconClass: 'fa fa-user unstyled-link',
+      iconClass: 'fa fa-user grey',
       hideCaret: true,
       isRightAlign: true,
       subItems: [
@@ -43,4 +58,12 @@ export class TopMenuComponent {
     }
   ];
 
+  get clusters(): (ListItem | TimeUnitListItem[])[] {
+    return this.filters.clusters.options;
+  }
+
+  get isClustersFilterDisplayed(): boolean {
+    return this.logsContainer.isFilterConditionDisplayed('clusters') && this.clusters.length > 1;
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/63a15872/ambari-logsearch/ambari-logsearch-web/src/app/components/variables.less
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/variables.less b/ambari-logsearch/ambari-logsearch-web/src/app/components/variables.less
index 18268ad..a9ca3b4 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/variables.less
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/variables.less
@@ -27,7 +27,7 @@
 @block-margin-top: 20px;
 @link-color: #1491C1;
 @link-hover-color: #23527C;
-@grey-color: #666;
+@grey-color: #DDD;
 @default-line-height: 1.42857143;
 @main-background-color: #ECECEC;
 @filters-panel-background-color: #FFF;
@@ -52,7 +52,6 @@
 @submit-color: #5CB85C;
 @submit-hover-color: #449D44;
 @exclude-color: #EF6162;
-@search-parameter-background-color: #DDD;
 
 // Panels
 @panel-heading: rgba(255, 255, 255, 1);

http://git-wip-us.apache.org/repos/asf/ambari/blob/63a15872/ambari-logsearch/ambari-logsearch-web/src/app/services/logs-container.service.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/services/logs-container.service.ts b/ambari-logsearch/ambari-logsearch-web/src/app/services/logs-container.service.ts
index 64b14b8..4adf577 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/services/logs-container.service.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/services/logs-container.service.ts
@@ -546,7 +546,7 @@ export class LogsContainerService {
 
   activeLogsType: LogsType;
 
-  private filtersFormChange: Subject<any> = new Subject();
+  private filtersFormChange: Subject<void> = new Subject();
 
   private columnsMapper<FieldT extends LogField>(fields: FieldT[]): ListItem[] {
     return fields.filter((field: FieldT): boolean => field.isAvailable).map((field: FieldT): ListItem => {
@@ -628,9 +628,9 @@ export class LogsContainerService {
 
   queryParameterAdd: Subject<SearchBoxParameter> = new Subject();
 
-  private stopTimer: Subject<any> = new Subject();
+  private stopTimer: Subject<void> = new Subject();
 
-  private stopAutoRefreshCountdown: Subject<any> = new Subject();
+  private stopAutoRefreshCountdown: Subject<void> = new Subject();
 
   captureSeconds: number = 0;
 
@@ -962,4 +962,9 @@ export class LogsContainerService {
     }, {});
   }
 
+  isFilterConditionDisplayed(key: string): boolean {
+    return this.logsTypeMap[this.activeLogsType].listFilters.indexOf(key) > -1
+      && Boolean(this.filtersForm.controls[key]);
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/63a15872/ambari-logsearch/ambari-logsearch-web/src/assets/i18n/en.json
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/assets/i18n/en.json b/ambari-logsearch/ambari-logsearch-web/src/assets/i18n/en.json
index 98b9e29..6c916aa 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/assets/i18n/en.json
+++ b/ambari-logsearch/ambari-logsearch-web/src/assets/i18n/en.json
@@ -26,7 +26,7 @@
   "filter.clusters": "Clusters",
   "filter.components": "Components",
   "filter.levels": "Levels",
-  "filter.excluded": "Excluded",
+  "filter.exclude": "Exclude",
   "filter.hosts": "Hosts",
 
   "filter.capture": "Capture",

http://git-wip-us.apache.org/repos/asf/ambari/blob/63a15872/ambari-logsearch/ambari-logsearch-web/webpack.config.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/webpack.config.js b/ambari-logsearch/ambari-logsearch-web/webpack.config.js
index 75d6aee..e1a2366 100644
--- a/ambari-logsearch/ambari-logsearch-web/webpack.config.js
+++ b/ambari-logsearch/ambari-logsearch-web/webpack.config.js
@@ -102,11 +102,11 @@ module.exports = {
       "./src/polyfills.ts"
     ],
     "styles": [
-      "./src/styles.less",
       "./node_modules/bootstrap/dist/css/bootstrap.min.css",
       "./node_modules/font-awesome/css/font-awesome.min.css",
       "./src/vendor/css/bootstrap-logsearch.min.css",
-      "./src/vendor/css/bootstrap-datetimepicker.min.css"
+      "./src/vendor/css/bootstrap-datetimepicker.min.css",
+      "./src/styles.less"
     ]
   },
   "output": {
@@ -271,11 +271,11 @@ module.exports = {
       },
       {
         "include": [
-          path.join(process.cwd(), "src/styles.less"),
           path.join(process.cwd(), "node_modules/bootstrap/dist/css/bootstrap.min.css"),
           path.join(process.cwd(), "node_modules/font-awesome/css/font-awesome.min.css"),
           path.join(process.cwd(), "src/vendor/css/bootstrap-logsearch.min.css"),
-          path.join(process.cwd(), "src/vendor/css/bootstrap-datetimepicker.min.css")
+          path.join(process.cwd(), "src/vendor/css/bootstrap-datetimepicker.min.css"),
+          path.join(process.cwd(), "src/styles.less")
         ],
         "test": /\.css$/,
         "use": [
@@ -298,11 +298,11 @@ module.exports = {
       },
       {
         "include": [
-          path.join(process.cwd(), "src/styles.less"),
           path.join(process.cwd(), "node_modules/bootstrap/dist/css/bootstrap.min.css"),
           path.join(process.cwd(), "node_modules/font-awesome/css/font-awesome.min.css"),
           path.join(process.cwd(), "src/vendor/css/bootstrap-logsearch.min.css"),
-          path.join(process.cwd(), "src/vendor/css/bootstrap-datetimepicker.min.css")
+          path.join(process.cwd(), "src/vendor/css/bootstrap-datetimepicker.min.css"),
+          path.join(process.cwd(), "src/styles.less")
         ],
         "test": /\.scss$|\.sass$/,
         "use": [
@@ -333,11 +333,11 @@ module.exports = {
       },
       {
         "include": [
-          path.join(process.cwd(), "src/styles.less"),
           path.join(process.cwd(), "node_modules/bootstrap/dist/css/bootstrap.min.css"),
           path.join(process.cwd(), "node_modules/font-awesome/css/font-awesome.min.css"),
           path.join(process.cwd(), "src/vendor/css/bootstrap-logsearch.min.css"),
-          path.join(process.cwd(), "src/vendor/css/bootstrap-datetimepicker.min.css")
+          path.join(process.cwd(), "src/vendor/css/bootstrap-datetimepicker.min.css"),
+          path.join(process.cwd(), "src/styles.less")
         ],
         "test": /\.less$/,
         "use": [
@@ -367,11 +367,11 @@ module.exports = {
       },
       {
         "include": [
-          path.join(process.cwd(), "src/styles.less"),
           path.join(process.cwd(), "node_modules/bootstrap/dist/css/bootstrap.min.css"),
           path.join(process.cwd(), "node_modules/font-awesome/css/font-awesome.min.css"),
           path.join(process.cwd(), "src/vendor/css/bootstrap-logsearch.min.css"),
-          path.join(process.cwd(), "src/vendor/css/bootstrap-datetimepicker.min.css")
+          path.join(process.cwd(), "src/vendor/css/bootstrap-datetimepicker.min.css"),
+          path.join(process.cwd(), "src/styles.less")
         ],
         "test": /\.styl$/,
         "use": [


[13/29] ambari git commit: AMBARI-22485 : Allow Ambari to support non-kerberos SASL mechanisms for Kafka - Addendum, missed the new files (ydavis via mradhakrishnan)

Posted by rl...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f8227780/ambari-server/src/test/python/stacks/2.6/configs/default_kafka_sasl_ssl.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.6/configs/default_kafka_sasl_ssl.json b/ambari-server/src/test/python/stacks/2.6/configs/default_kafka_sasl_ssl.json
new file mode 100644
index 0000000..8f81c71
--- /dev/null
+++ b/ambari-server/src/test/python/stacks/2.6/configs/default_kafka_sasl_ssl.json
@@ -0,0 +1,631 @@
+{
+  "roleCommand": "SERVICE_CHECK",
+  "clusterName": "c1",
+  "hostname": "c6401.ambari.apache.org",
+  "hostLevelParams": {
+    "not_managed_hdfs_path_list": "[\"/apps/hive/warehouse\",\"/apps/falcon\",\"/mr-history/done\",\"/app-logs\",\"/tmp\"]",
+    "agent_stack_retry_count": "5",
+    "agent_stack_retry_on_unavailability": "false",
+    "jdk_location": "http://c6401.ambari.apache.org:8080/resources/",
+    "ambari_db_rca_password": "mapred",
+    "ambari_db_rca_url": "jdbc:postgresql://c6401.ambari.apache.org/ambarirca",
+    "jce_name": "UnlimitedJCEPolicyJDK7.zip",
+    "stack_version": "2.6.5.0",
+    "stack_name": "HDP",
+    "ambari_db_rca_driver": "org.postgresql.Driver",
+    "jdk_name": "jdk-7u67-linux-x64.tar.gz",
+    "ambari_db_rca_username": "mapred",
+    "java_home": "/usr/jdk64/jdk1.7.0_45",
+    "db_name": "ambari",
+    "custom_mysql_jdbc_name": "mysql-connector-java.jar"
+  },
+  "commandType": "EXECUTION_COMMAND",
+  "roleParams": {},
+  "serviceName": "SLIDER",
+  "role": "SLIDER",
+  "commandParams": {
+    "version": "2.6.5.0-1235",
+    "command_timeout": "300",
+    "service_package_folder": "OOZIE",
+    "script_type": "PYTHON",
+    "script": "scripts/service_check.py",
+    "excluded_hosts": "host1,host2"
+  },
+  "taskId": 152,
+  "public_hostname": "c6401.ambari.apache.org",
+  "configurations": {
+    "slider-client": {
+      "slider.yarn.queue": "default"
+    },
+    "sqoop-site": {
+      "atlas.cluster.name": "c1",
+      "sqoop.job.data.publish.class": "org.apache.atlas.sqoop.hook.SqoopHook"
+    },
+    "mahout-env": {
+      "mahout_user": "mahout"
+    },
+    "hbase-env": {
+      "hbase_user": "hbase"
+    },
+    "yarn-env": {
+      "yarn_user": "yarn"
+    },
+    "mahout-log4j": {
+      "content": "\n            #\n            #\n            # Licensed to the Apache Software Foundation (ASF) under one\n            # or more contributor license agreements.  See the NOTICE file\n            # distributed with this work for additional information\n            # regarding copyright ownership.  The ASF licenses this file\n            # to you under the Apache License, Version 2.0 (the\n            # \"License\"); you may not use this file except in compliance\n            # with the License.  You may obtain a copy of the License at\n            #\n            #   http://www.apache.org/licenses/LICENSE-2.0\n            #\n            # Unless required by applicable law or agreed to in writing,\n            # software distributed under the License is distributed on an\n            # \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n            # KIND, either express or implied.  See the License for the\n            # specific language governing permissions a
 nd limitations\n            # under the License.\n            #\n            #\n            #\n\n            # Set everything to be logged to the console\n            log4j.rootCategory=WARN, console\n            log4j.appender.console=org.apache.log4j.ConsoleAppender\n            log4j.appender.console.target=System.err\n            log4j.appender.console.layout=org.apache.log4j.PatternLayout\n            log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n\n\n            # Settings to quiet third party logs that are too verbose\n            log4j.logger.org.eclipse.jetty=WARN\n            log4j.logger.org.apache.spark.repl.SparkIMain$exprTyper=WARN\n            log4j.logger.org.apache.spark.repl.SparkILoop$SparkILoopInterpreter=WARN"
+    },
+    "hadoop-env": {
+      "hdfs_user": "hdfs",
+      "hdfs_tmp_dir": "/tmp"
+    },
+    "core-site": {
+      "fs.defaultFS": "hdfs://c6401.ambari.apache.org:8020"
+    },
+    "hdfs-site": {
+      "a": "b"
+    },
+    "yarn-site": {
+      "yarn.application.classpath": "/etc/hadoop/conf,/usr/lib/hadoop/*,/usr/lib/hadoop/lib/*,/usr/lib/hadoop-hdfs/*,/usr/lib/hadoop-hdfs/lib/*,/usr/lib/hadoop-yarn/*,/usr/lib/hadoop-yarn/lib/*,/usr/lib/hadoop-mapreduce/*,/usr/lib/hadoop-mapreduce/lib/*",
+      "yarn.resourcemanager.address": "c6401.ambari.apache.org:8050",
+      "yarn.resourcemanager.scheduler.address": "c6401.ambari.apache.org:8030"
+    },
+    "cluster-env": {
+      "managed_hdfs_resource_property_names": "",
+      "security_enabled": "false",
+      "ignore_groupsusers_create": "false",
+      "smokeuser": "ambari-qa",
+      "kerberos_domain": "EXAMPLE.COM",
+      "user_group": "hadoop"
+    },
+    "webhcat-site": {
+      "templeton.jar": "/usr/hdp/current/hive-webhcat/share/webhcat/svr/lib/hive-webhcat-*.jar",
+      "templeton.pig.archive": "hdfs:///hdp/apps/{{ hdp_stack_version }}/pig/pig.tar.gz",
+      "templeton.hive.archive": "hdfs:///hdp/apps/{{ hdp_stack_version }}/hive/hive.tar.gz",
+      "templeton.sqoop.archive": "hdfs:///hdp/apps/{{ hdp_stack_version }}/sqoop/sqoop.tar.gz",
+      "templeton.streaming.jar": "hdfs:///hdp/apps/{{ hdp_stack_version }}/mr/hadoop-streaming.jar"
+    },
+    "slider-log4j": {
+      "content": "log4jproperties\nline2"
+    },
+    "slider-env": {
+      "content": "envproperties\nline2"
+    },
+    "gateway-site": {
+      "java.security.auth.login.config": "/etc/knox/conf/krb5JAASLogin.conf",
+      "gateway.hadoop.kerberos.secured": "false",
+      "gateway.gateway.conf.dir": "deployments",
+      "gateway.path": "gateway",
+      "sun.security.krb5.debug": "true",
+      "java.security.krb5.conf": "/etc/knox/conf/krb5.conf",
+      "gateway.port": "8443"
+    },
+
+    "users-ldif": {
+      "content": "\n            # Licensed to the Apache Software Foundation (ASF) under one\n            # or more contributor license agreements.  See the NOTICE file\n            # distributed with this work for additional information\n            # regarding copyright ownership.  The ASF licenses this file\n            # to you under the Apache License, Version 2.0 (the\n            # \"License\"); you may not use this file except in compliance\n            # with the License.  You may obtain a copy of the License at\n            #\n            #     http://www.apache.org/licenses/LICENSE-2.0\n            #\n            # Unless required by applicable law or agreed to in writing, software\n            # distributed under the License is distributed on an \"AS IS\" BASIS,\n            # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n            # See the License for the specific language governing permissions and\n            # limitations under the Lice
 nse.\n\n            version: 1\n\n            # Please replace with site specific values\n            dn: dc=hadoop,dc=apache,dc=org\n            objectclass: organization\n            objectclass: dcObject\n            o: Hadoop\n            dc: hadoop\n\n            # Entry for a sample people container\n            # Please replace with site specific values\n            dn: ou=people,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass:organizationalUnit\n            ou: people\n\n            # Entry for a sample end user\n            # Please replace with site specific values\n            dn: uid=guest,ou=people,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass:person\n            objectclass:organizationalPerson\n            objectclass:inetOrgPerson\n            cn: Guest\n            sn: User\n            uid: guest\n            userPassword:guest-password\n\n            # entry for sample user admin\n            dn: 
 uid=admin,ou=people,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass:person\n            objectclass:organizationalPerson\n            objectclass:inetOrgPerson\n            cn: Admin\n            sn: Admin\n            uid: admin\n            userPassword:admin-password\n\n            # entry for sample user sam\n            dn: uid=sam,ou=people,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass:person\n            objectclass:organizationalPerson\n            objectclass:inetOrgPerson\n            cn: sam\n            sn: sam\n            uid: sam\n            userPassword:sam-password\n\n            # entry for sample user tom\n            dn: uid=tom,ou=people,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass:person\n            objectclass:organizationalPerson\n            objectclass:inetOrgPerson\n            cn: tom\n            sn: tom\n            uid: tom\n            userPasswor
 d:tom-password\n\n            # create FIRST Level groups branch\n            dn: ou=groups,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass:organizationalUnit\n            ou: groups\n            description: generic groups branch\n\n            # create the analyst group under groups\n            dn: cn=analyst,ou=groups,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass: groupofnames\n            cn: analyst\n            description:analyst  group\n            member: uid=sam,ou=people,dc=hadoop,dc=apache,dc=org\n            member: uid=tom,ou=people,dc=hadoop,dc=apache,dc=org\n\n\n            # create the scientist group under groups\n            dn: cn=scientist,ou=groups,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass: groupofnames\n            cn: scientist\n            description: scientist group\n            member: uid=sam,ou=people,dc=hadoop,dc=apache,dc=org"
+    },
+
+    "topology": {
+      "content": "\n        <topology>\n\n            <gateway>\n\n                <provider>\n                    <role>authentication</role>\n                    <name>ShiroProvider</name>\n                    <enabled>true</enabled>\n                    <param>\n                        <name>sessionTimeout</name>\n                        <value>30</value>\n                    </param>\n                    <param>\n                        <name>main.ldapRealm</name>\n                        <value>org.apache.hadoop.gateway.shirorealm.KnoxLdapRealm</value>\n                    </param>\n                    <param>\n                        <name>main.ldapRealm.userDnTemplate</name>\n                        <value>uid={0},ou=people,dc=hadoop,dc=apache,dc=org</value>\n                    </param>\n                    <param>\n                        <name>main.ldapRealm.contextFactory.url</name>\n                        <value>ldap://{{knox_host_name}}:33389</value>\n                 
    </param>\n                    <param>\n                        <name>main.ldapRealm.contextFactory.authenticationMechanism</name>\n                        <value>simple</value>\n                    </param>\n                    <param>\n                        <name>urls./**</name>\n                        <value>authcBasic</value>\n                    </param>\n                </provider>\n\n                <provider>\n                    <role>identity-assertion</role>\n                    <name>Default</name>\n                    <enabled>true</enabled>\n                </provider>\n\n            </gateway>\n\n            <service>\n                <role>NAMENODE</role>\n                <url>hdfs://{{namenode_host}}:{{namenode_rpc_port}}</url>\n            </service>\n\n            <service>\n                <role>JOBTRACKER</role>\n                <url>rpc://{{rm_host}}:{{jt_rpc_port}}</url>\n            </service>\n\n            <service>\n                <role>WEBHDFS</role
 >\n                <url>http://{{namenode_host}}:{{namenode_http_port}}/webhdfs</url>\n            </service>\n\n            <service>\n                <role>WEBHCAT</role>\n                <url>http://{{webhcat_server_host}}:{{templeton_port}}/templeton</url>\n            </service>\n\n            <service>\n                <role>OOZIE</role>\n                <url>http://{{oozie_server_host}}:{{oozie_server_port}}/oozie</url>\n            </service>\n\n            <service>\n                <role>WEBHBASE</role>\n                <url>http://{{hbase_master_host}}:{{hbase_master_port}}</url>\n            </service>\n\n            <service>\n                <role>HIVE</role>\n                <url>http://{{hive_server_host}}:{{hive_http_port}}/{{hive_http_path}}</url>\n            </service>\n\n            <service>\n                <role>RESOURCEMANAGER</role>\n                <url>http://{{rm_host}}:{{rm_port}}/ws</url>\n            </service>\n        </topology>"
+    },
+
+    "ldap-log4j": {
+      "content": "\n        # Licensed to the Apache Software Foundation (ASF) under one\n        # or more contributor license agreements.  See the NOTICE file\n        # distributed with this work for additional information\n        # regarding copyright ownership.  The ASF licenses this file\n        # to you under the Apache License, Version 2.0 (the\n        # \"License\"); you may not use this file except in compliance\n        # with the License.  You may obtain a copy of the License at\n        #\n        #     http://www.apache.org/licenses/LICENSE-2.0\n        #\n        # Unless required by applicable law or agreed to in writing, software\n        # distributed under the License is distributed on an \"AS IS\" BASIS,\n        # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n        # See the License for the specific language governing permissions and\n        # limitations under the License.\n        #testing\n\n        app.log.dir=${launcher.dir
 }/../logs\n        app.log.file=${launcher.name}.log\n\n        log4j.rootLogger=ERROR, drfa\n        log4j.logger.org.apache.directory.server.ldap.LdapServer=INFO\n        log4j.logger.org.apache.directory=WARN\n\n        log4j.appender.stdout=org.apache.log4j.ConsoleAppender\n        log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\n        log4j.appender.stdout.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n\n\n        log4j.appender.drfa=org.apache.log4j.DailyRollingFileAppender\n        log4j.appender.drfa.File=${app.log.dir}/${app.log.file}\n        log4j.appender.drfa.DatePattern=.yyyy-MM-dd\n        log4j.appender.drfa.layout=org.apache.log4j.PatternLayout\n        log4j.appender.drfa.layout.ConversionPattern=%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n"
+    },
+
+    "gateway-log4j": {
+      "content": "\n\n      # Licensed to the Apache Software Foundation (ASF) under one\n      # or more contributor license agreements. See the NOTICE file\n      # distributed with this work for additional information\n      # regarding copyright ownership. The ASF licenses this file\n      # to you under the Apache License, Version 2.0 (the\n      # \"License\"); you may not use this file except in compliance\n      # with the License. You may obtain a copy of the License at\n      #\n      # http://www.apache.org/licenses/LICENSE-2.0\n      #\n      # Unless required by applicable law or agreed to in writing, software\n      # distributed under the License is distributed on an \"AS IS\" BASIS,\n      # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n      # See the License for the specific language governing permissions and\n      # limitations under the License.\n\n      app.log.dir=${launcher.dir}/../logs\n      app.log.file=${launcher.name}.log\n   
    app.audit.file=${launcher.name}-audit.log\n\n      log4j.rootLogger=ERROR, drfa\n\n      log4j.logger.org.apache.hadoop.gateway=INFO\n      #log4j.logger.org.apache.hadoop.gateway=DEBUG\n\n      #log4j.logger.org.eclipse.jetty=DEBUG\n      #log4j.logger.org.apache.shiro=DEBUG\n      #log4j.logger.org.apache.http=DEBUG\n      #log4j.logger.org.apache.http.client=DEBUG\n      #log4j.logger.org.apache.http.headers=DEBUG\n      #log4j.logger.org.apache.http.wire=DEBUG\n\n      log4j.appender.stdout=org.apache.log4j.ConsoleAppender\n      log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\n      log4j.appender.stdout.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n\n\n      log4j.appender.drfa=org.apache.log4j.DailyRollingFileAppender\n      log4j.appender.drfa.File=${app.log.dir}/${app.log.file}\n      log4j.appender.drfa.DatePattern=.yyyy-MM-dd\n      log4j.appender.drfa.layout=org.apache.log4j.PatternLayout\n      log4j.appender.drfa.layout.ConversionPattern=%
 d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n\n\n      log4j.logger.audit=INFO, auditfile\n      log4j.appender.auditfile=org.apache.log4j.DailyRollingFileAppender\n      log4j.appender.auditfile.File=${app.log.dir}/${app.audit.file}\n      log4j.appender.auditfile.Append = true\n      log4j.appender.auditfile.DatePattern = '.'yyyy-MM-dd\n      log4j.appender.auditfile.layout = org.apache.hadoop.gateway.audit.log4j.layout.AuditLayout"
+    },
+    "knox-env": {
+      "knox_master_secret": "sa",
+      "knox_group": "knox",
+      "knox_pid_dir": "/var/run/knox",
+      "knox_user": "knox"
+    },
+    "kafka-env": {
+      "kafka_user_nproc_limit": "65536",
+      "content": "\n#!/bin/bash\n\n# Set KAFKA specific environment variables here.\n\n# The java implementation to use.\nexport JAVA_HOME={{java64_home}}\nexport PATH=$PATH:$JAVA_HOME/bin\nexport PID_DIR={{kafka_pid_dir}}\nexport LOG_DIR={{kafka_log_dir}}\n{% if kerberos_security_enabled or kafka_other_sasl_enabled %}\nexport KAFKA_KERBEROS_PARAMS=\"-Djavax.security.auth.useSubjectCredsOnly=false {{kafka_kerberos_params}}\"\n{% else %}\nexport KAFKA_KERBEROS_PARAMS={{kafka_kerberos_params}}\n{% endif %}\n# Add kafka sink to classpath and related depenencies\nif [ -e \"/usr/lib/ambari-metrics-kafka-sink/ambari-metrics-kafka-sink.jar\" ]; then\n  export CLASSPATH=$CLASSPATH:/usr/lib/ambari-metrics-kafka-sink/ambari-metrics-kafka-sink.jar\n  export CLASSPATH=$CLASSPATH:/usr/lib/ambari-metrics-kafka-sink/lib/*\nfi\nif [ -f /etc/kafka/conf/kafka-ranger-env.sh ]; then\n. /etc/kafka/conf/kafka-ranger-env.sh\nfi",
+      "kafka_log_dir": "/var/log/kafka",
+      "kafka_pid_dir": "/var/run/kafka",
+      "kafka_user_nofile_limit": "128000",
+      "is_supported_kafka_ranger": "true",
+      "kafka_user": "kafka"
+    },
+    "kafka-log4j": {
+      "kafka_log_maxbackupindex": "20",
+      "content": "\n#\n#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements.  See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership.  The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License.  You may obtain a copy of the License at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied.  See the License for the\n# specific language governing permissions and limitations\n# under the License.\n#\n#\n#\nkafka.logs.dir=logs\n\nlog4j.rootLogger=INFO, stdout\n\nlog4j.appender.stdout=org.apache.log4j.ConsoleAppender\nlog4j.appender.stdout.layout=org.apache.log4j
 .PatternLayout\nlog4j.appender.stdout.layout.ConversionPattern=[%d] %p %m (%c)%n\n\nlog4j.appender.kafkaAppender=org.apache.log4j.DailyRollingFileAppender\nlog4j.appender.kafkaAppender.DatePattern='.'yyyy-MM-dd-HH\nlog4j.appender.kafkaAppender.File=${kafka.logs.dir}/server.log\nlog4j.appender.kafkaAppender.layout=org.apache.log4j.PatternLayout\nlog4j.appender.kafkaAppender.layout.ConversionPattern=[%d] %p %m (%c)%n\nlog4j.appender.kafkaAppender.MaxFileSize = {{kafka_log_maxfilesize}}MB\nlog4j.appender.kafkaAppender.MaxBackupIndex = {{kafka_log_maxbackupindex}}\n\nlog4j.appender.stateChangeAppender=org.apache.log4j.DailyRollingFileAppender\nlog4j.appender.stateChangeAppender.DatePattern='.'yyyy-MM-dd-HH\nlog4j.appender.stateChangeAppender.File=${kafka.logs.dir}/state-change.log\nlog4j.appender.stateChangeAppender.layout=org.apache.log4j.PatternLayout\nlog4j.appender.stateChangeAppender.layout.ConversionPattern=[%d] %p %m (%c)%n\n\nlog4j.appender.requestAppender=org.apache.log4j.Daily
 RollingFileAppender\nlog4j.appender.requestAppender.DatePattern='.'yyyy-MM-dd-HH\nlog4j.appender.requestAppender.File=${kafka.logs.dir}/kafka-request.log\nlog4j.appender.requestAppender.layout=org.apache.log4j.PatternLayout\nlog4j.appender.requestAppender.layout.ConversionPattern=[%d] %p %m (%c)%n\n\nlog4j.appender.cleanerAppender=org.apache.log4j.DailyRollingFileAppender\nlog4j.appender.cleanerAppender.DatePattern='.'yyyy-MM-dd-HH\nlog4j.appender.cleanerAppender.File=${kafka.logs.dir}/log-cleaner.log\nlog4j.appender.cleanerAppender.layout=org.apache.log4j.PatternLayout\nlog4j.appender.cleanerAppender.layout.ConversionPattern=[%d] %p %m (%c)%n\n\nlog4j.appender.controllerAppender=org.apache.log4j.DailyRollingFileAppender\nlog4j.appender.controllerAppender.DatePattern='.'yyyy-MM-dd-HH\nlog4j.appender.controllerAppender.File=${kafka.logs.dir}/controller.log\nlog4j.appender.controllerAppender.layout=org.apache.log4j.PatternLayout\nlog4j.appender.controllerAppender.layout.ConversionPatt
 ern=[%d] %p %m (%c)%n\nlog4j.appender.controllerAppender.MaxFileSize = {{controller_log_maxfilesize}}MB\nlog4j.appender.controllerAppender.MaxBackupIndex = {{controller_log_maxbackupindex}}\n# Turn on all our debugging info\n#log4j.logger.kafka.producer.async.DefaultEventHandler=DEBUG, kafkaAppender\n#log4j.logger.kafka.client.ClientUtils=DEBUG, kafkaAppender\n#log4j.logger.kafka.perf=DEBUG, kafkaAppender\n#log4j.logger.kafka.perf.ProducerPerformance$ProducerThread=DEBUG, kafkaAppender\n#log4j.logger.org.I0Itec.zkclient.ZkClient=DEBUG\nlog4j.logger.kafka=INFO, kafkaAppender\nlog4j.logger.kafka.network.RequestChannel$=WARN, requestAppender\nlog4j.additivity.kafka.network.RequestChannel$=false\n\n#log4j.logger.kafka.network.Processor=TRACE, requestAppender\n#log4j.logger.kafka.server.KafkaApis=TRACE, requestAppender\n#log4j.additivity.kafka.server.KafkaApis=false\nlog4j.logger.kafka.request.logger=WARN, requestAppender\nlog4j.additivity.kafka.request.logger=false\n\nlog4j.logger.kafka
 .controller=TRACE, controllerAppender\nlog4j.additivity.kafka.controller=false\n\nlog4j.logger.kafka.log.LogCleaner=INFO, cleanerAppender\nlog4j.additivity.kafka.log.LogCleaner=false\n\nlog4j.logger.state.change.logger=TRACE, stateChangeAppender\nlog4j.additivity.state.change.logger=false",
+      "kafka_log_maxfilesize": "256",
+      "controller_log_maxfilesize": "256",
+      "controller_log_maxbackupindex": "20"
+    },
+    "kafka-broker": {
+      "auto.leader.rebalance.enable": "true",
+      "kafka.ganglia.metrics.port": "8671",
+      "socket.send.buffer.bytes": "102400",
+      "num.network.threads": "3",
+      "log.segment.bytes": "1073741824",
+      "kafka.ganglia.metrics.host": "localhost",
+      "kafka.timeline.metrics.maxRowCacheSize": "10000",
+      "replica.lag.time.max.ms": "10000",
+      "num.io.threads": "8",
+      "offsets.retention.minutes": "86400000",
+      "fetch.purgatory.purge.interval.requests": "10000",
+      "offsets.topic.compression.codec": "0",
+      "default.replication.factor": "1",
+      "port": "6667",
+      "num.recovery.threads.per.data.dir": "1",
+      "kafka.metrics.reporters": "org.apache.hadoop.metrics2.sink.kafka.KafkaTimelineMetricsReporter",
+      "log.retention.bytes": "-1",
+      "producer.purgatory.purge.interval.requests": "10000",
+      "replica.lag.max.messages": "4000",
+      "replica.high.watermark.checkpoint.interval.ms": "5000",
+      "zookeeper.connect": "ydavis-kafka-ambari-upgrade-1.openstacklocal:2181",
+      "controlled.shutdown.retry.backoff.ms": "5000",
+      "sasl.enabled.mechanisms": "GSSAPI",
+      "kafka.timeline.metrics.reporter.sendInterval": "5900",
+      "num.partitions": "1",
+      "offsets.topic.segment.bytes": "104857600",
+      "replica.fetch.min.bytes": "1",
+      "zookeeper.sync.time.ms": "2000",
+      "offset.metadata.max.bytes": "4096",
+      "kafka.timeline.metrics.reporter.enabled": "true",
+      "kafka.timeline.metrics.truststore.type": "{{metric_truststore_type}}",
+      "controlled.shutdown.max.retries": "3",
+      "leader.imbalance.per.broker.percentage": "10",
+      "min.insync.replicas": "1",
+      "offsets.commit.required.acks": "-1",
+      "replica.fetch.wait.max.ms": "500",
+      "controlled.shutdown.enable": "true",
+      "log.roll.hours": "168",
+      "log.cleanup.interval.mins": "10",
+      "replica.socket.receive.buffer.bytes": "65536",
+      "kafka.ganglia.metrics.reporter.enabled": "true",
+      "kafka.timeline.metrics.truststore.path": "{{metric_truststore_path}}",
+      "zookeeper.connection.timeout.ms": "25000",
+      "delete.topic.enable": "false",
+      "offsets.load.buffer.size": "5242880",
+      "num.replica.fetchers": "1",
+      "socket.request.max.bytes": "104857600",
+      "message.max.bytes": "1000000",
+      "controller.message.queue.size": "10",
+      "kafka.ganglia.metrics.group": "kafka",
+      "compression.type": "producer",
+      "queued.max.requests": "500",
+      "log.index.interval.bytes": "4096",
+      "replica.fetch.max.bytes": "1048576",
+      "offsets.topic.num.partitions": "50",
+      "socket.receive.buffer.bytes": "102400",
+      "kafka.timeline.metrics.port": "{{metric_collector_port}}",
+      "offsets.commit.timeout.ms": "5000",
+      "offsets.topic.replication.factor": "3",
+      "external.kafka.metrics.include.prefix": "kafka.network.RequestMetrics.ResponseQueueTimeMs.request.OffsetCommit.98percentile,kafka.network.RequestMetrics.ResponseQueueTimeMs.request.Offsets.95percentile,kafka.network.RequestMetrics.ResponseSendTimeMs.request.Fetch.95percentile,kafka.network.RequestMetrics.RequestsPerSec.request",
+      "offsets.retention.check.interval.ms": "600000",
+      "log.index.size.max.bytes": "10485760",
+      "log.dirs": "/kafka-logs",
+      "listeners": "PLAINTEXT://localhost:6667,SASL_SSL://localhost:6668",
+      "kafka.timeline.metrics.hosts": "{{ams_collector_hosts}}",
+      "controller.socket.timeout.ms": "30000",
+      "replica.socket.timeout.ms": "30000",
+      "zookeeper.session.timeout.ms": "30000",
+      "auto.create.topics.enable": "true",
+      "kafka.timeline.metrics.truststore.password": "{{metric_truststore_password}}",
+      "external.kafka.metrics.exclude.prefix": "kafka.network.RequestMetrics,kafka.server.DelayedOperationPurgatory,kafka.server.BrokerTopicMetrics.BytesRejectedPerSec,kafka.server.KafkaServer.ClusterId",
+      "leader.imbalance.check.interval.seconds": "300",
+      "sasl.mechanism.inter.broker.protocol": "GSSAPI",
+      "log.retention.hours": "168",
+      "kafka.timeline.metrics.protocol": "{{metric_collector_protocol}}"
+    },
+    "spark-defaults": {
+      "spark.yarn.applicationMaster.waitTries": "10",
+      "spark.history.kerberos.keytab": "none",
+      "spark.yarn.preserve.staging.files": "false",
+      "spark.yarn.submit.file.replication": "3",
+      "spark.history.kerberos.principal": "none",
+      "spark.yarn.driver.memoryOverhead": "384",
+      "spark.yarn.queue": "default",
+      "spark.yarn.containerLauncherMaxThreads": "25",
+      "spark.yarn.scheduler.heartbeat.interval-ms": "5000",
+      "spark.history.ui.port": "18080",
+      "spark.yarn.max.executor.failures": "3",
+      "spark.driver.extraJavaOptions": "",
+      "spark.history.provider": "org.apache.spark.deploy.yarn.history.YarnHistoryProvider",
+      "spark.yarn.am.extraJavaOptions": "",
+      "spark.yarn.executor.memoryOverhead": "384"
+    },
+    "spark-javaopts-properties": {
+      "content": " "
+    },
+    "spark-log4j-properties": {
+      "content": "\n# Set everything to be logged to the console\nlog4j.rootCategory=INFO, console\nlog4j.appender.console=org.apache.log4j.ConsoleAppender\nlog4j.appender.console.target=System.err\nlog4j.appender.console.layout=org.apache.log4j.PatternLayout\nlog4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n\n\n# Settings to quiet third party logs that are too verbose\nlog4j.logger.org.eclipse.jetty=WARN\nlog4j.logger.org.eclipse.jetty.util.component.AbstractLifeCycle=ERROR\nlog4j.logger.org.apache.spark.repl.SparkIMain$exprTyper=INFO\nlog4j.logger.org.apache.spark.repl.SparkILoop$SparkILoopInterpreter=INFO"
+    },
+    "spark-env": {
+      "content": "\n#!/usr/bin/env bash\n\n# This file is sourced when running various Spark programs.\n# Copy it as spark-env.sh and edit that to configure Spark for your site.\n\n# Options read in YARN client mode\n#SPARK_EXECUTOR_INSTANCES=\"2\" #Number of workers to start (Default: 2)\n#SPARK_EXECUTOR_CORES=\"1\" #Number of cores for the workers (Default: 1).\n#SPARK_EXECUTOR_MEMORY=\"1G\" #Memory per Worker (e.g. 1000M, 2G) (Default: 1G)\n#SPARK_DRIVER_MEMORY=\"512 Mb\" #Memory for Master (e.g. 1000M, 2G) (Default: 512 Mb)\n#SPARK_YARN_APP_NAME=\"spark\" #The name of your application (Default: Spark)\n#SPARK_YARN_QUEUE=\"~@~Xdefault~@~Y\" #The hadoop queue to use for allocation requests (Default: @~Xdefault~@~Y)\n#SPARK_YARN_DIST_FILES=\"\" #Comma separated list of files to be distributed with the job.\n#SPARK_YARN_DIST_ARCHIVES=\"\" #Comma separated list of archives to be distributed with the job.\n\n# Generic options for the daemons used in the standalone deploy mode\n\n# Alt
 ernate conf dir. (Default: ${SPARK_HOME}/conf)\nexport SPARK_CONF_DIR=${SPARK_HOME:-{{spark_home}}}/conf\n\n# Where log files are stored.(Default:${SPARK_HOME}/logs)\n#export SPARK_LOG_DIR=${SPARK_HOME:-{{spark_home}}}/logs\nexport SPARK_LOG_DIR={{spark_log_dir}}\n\n# Where the pid file is stored. (Default: /tmp)\nexport SPARK_PID_DIR={{spark_pid_dir}}\n\n# A string representing this instance of spark.(Default: $USER)\nSPARK_IDENT_STRING=$USER\n\n# The scheduling priority for daemons. (Default: 0)\nSPARK_NICENESS=0\n\nexport HADOOP_HOME=${HADOOP_HOME:-{{hadoop_home}}}\nexport HADOOP_CONF_DIR=${HADOOP_CONF_DIR:-{{hadoop_conf_dir}}}\n\n# The java implementation to use.\nexport JAVA_HOME={{java_home}}\n\nif [ -d \"/etc/tez/conf/\" ]; then\n  export TEZ_CONF_DIR=/etc/tez/conf\nelse\n  export TEZ_CONF_DIR=\nfi",
+      "spark_pid_dir": "/var/run/spark",
+      "spark_log_dir": "/var/log/spark",
+      "spark_group": "spark",
+      "spark_user": "spark"
+    },
+    "spark2-env": {
+      "content": "\n#!/usr/bin/env bash\n\n# This file is sourced when running various Spark programs.\n# Copy it as spark-env.sh and edit that to configure Spark for your site.\n\n# Options read in YARN client mode\n#SPARK_EXECUTOR_INSTANCES=\"2\" #Number of workers to start (Default: 2)\n#SPARK_EXECUTOR_CORES=\"1\" #Number of cores for the workers (Default: 1).\n#SPARK_EXECUTOR_MEMORY=\"1G\" #Memory per Worker (e.g. 1000M, 2G) (Default: 1G)\n#SPARK_DRIVER_MEMORY=\"512 Mb\" #Memory for Master (e.g. 1000M, 2G) (Default: 512 Mb)\n#SPARK_YARN_APP_NAME=\"spark\" #The name of your application (Default: Spark)\n#SPARK_YARN_QUEUE=\"~@~Xdefault~@~Y\" #The hadoop queue to use for allocation requests (Default: @~Xdefault~@~Y)\n#SPARK_YARN_DIST_FILES=\"\" #Comma separated list of files to be distributed with the job.\n#SPARK_YARN_DIST_ARCHIVES=\"\" #Comma separated list of archives to be distributed with the job.\n\n# Generic options for the daemons used in the standalone deploy mode\n\n# Alt
 ernate conf dir. (Default: ${SPARK_HOME}/conf)\nexport SPARK_CONF_DIR=${SPARK_HOME:-{{spark_home}}}/conf\n\n# Where log files are stored.(Default:${SPARK_HOME}/logs)\n#export SPARK_LOG_DIR=${SPARK_HOME:-{{spark_home}}}/logs\nexport SPARK_LOG_DIR={{spark_log_dir}}\n\n# Where the pid file is stored. (Default: /tmp)\nexport SPARK_PID_DIR={{spark_pid_dir}}\n\n# A string representing this instance of spark.(Default: $USER)\nSPARK_IDENT_STRING=$USER\n\n# The scheduling priority for daemons. (Default: 0)\nSPARK_NICENESS=0\n\nexport HADOOP_HOME=${HADOOP_HOME:-{{hadoop_home}}}\nexport HADOOP_CONF_DIR=${HADOOP_CONF_DIR:-{{hadoop_conf_dir}}}\n\n# The java implementation to use.\nexport JAVA_HOME={{java_home}}\n\nif [ -d \"/etc/tez/conf/\" ]; then\n  export TEZ_CONF_DIR=/etc/tez/conf\nelse\n  export TEZ_CONF_DIR=\nfi",
+      "spark_pid_dir": "/var/run/spark",
+      "spark_log_dir": "/var/log/spark",
+      "spark_group": "spark",
+      "spark_user": "spark"
+    },
+    "spark-metrics-properties": {
+      "content": "\n# syntax: [instance].sink|source.[name].[options]=[value]\n\n# This file configures Spark's internal metrics system. The metrics system is\n# divided into instances which correspond to internal components.\n# Each instance can be configured to report its metrics to one or more sinks.\n# Accepted values for [instance] are \"master\", \"worker\", \"executor\", \"driver\",\n# and \"applications\". A wild card \"*\" can be used as an instance name, in\n# which case all instances will inherit the supplied property.\n#\n# Within an instance, a \"source\" specifies a particular set of grouped metrics.\n# there are two kinds of sources:\n# 1. Spark internal sources, like MasterSource, WorkerSource, etc, which will\n# collect a Spark component's internal state. Each instance is paired with a\n# Spark source that is added automatically.\n# 2. Common sources, like JvmSource, which will collect low level state.\n# These can be added through configuration options and are then
  loaded\n# using reflection.\n#\n# A \"sink\" specifies where metrics are delivered to. Each instance can be\n# assigned one or more sinks.\n#\n# The sink|source field specifies whether the property relates to a sink or\n# source.\n#\n# The [name] field specifies the name of source or sink.\n#\n# The [options] field is the specific property of this source or sink. The\n# source or sink is responsible for parsing this property.\n#\n# Notes:\n# 1. To add a new sink, set the \"class\" option to a fully qualified class\n# name (see examples below).\n# 2. Some sinks involve a polling period. The minimum allowed polling period\n# is 1 second.\n# 3. Wild card properties can be overridden by more specific properties.\n# For example, master.sink.console.period takes precedence over\n# *.sink.console.period.\n# 4. A metrics specific configuration\n# \"spark.metrics.conf=${SPARK_HOME}/conf/metrics.properties\" should be\n# added to Java properties using -Dspark.metrics.conf=xxx if you want to\
 n# customize metrics system. You can also put the file in ${SPARK_HOME}/conf\n# and it will be loaded automatically.\n# 5. MetricsServlet is added by default as a sink in master, worker and client\n# driver, you can send http request \"/metrics/json\" to get a snapshot of all the\n# registered metrics in json format. For master, requests \"/metrics/master/json\" and\n# \"/metrics/applications/json\" can be sent seperately to get metrics snapshot of\n# instance master and applications. MetricsServlet may not be configured by self.\n#\n\n## List of available sinks and their properties.\n\n# org.apache.spark.metrics.sink.ConsoleSink\n# Name: Default: Description:\n# period 10 Poll period\n# unit seconds Units of poll period\n\n# org.apache.spark.metrics.sink.CSVSink\n# Name: Default: Description:\n# period 10 Poll period\n# unit seconds Units of poll period\n# directory /tmp Where to store CSV files\n\n# org.apache.spark.metrics.sink.GangliaSink\n# Name: Default: Description:\n# host N
 ONE Hostname or multicast group of Ganglia server\n# port NONE Port of Ganglia server(s)\n# period 10 Poll period\n# unit seconds Units of poll period\n# ttl 1 TTL of messages sent by Ganglia\n# mode multicast Ganglia network mode ('unicast' or 'multicast')\n\n# org.apache.spark.metrics.sink.JmxSink\n\n# org.apache.spark.metrics.sink.MetricsServlet\n# Name: Default: Description:\n# path VARIES* Path prefix from the web server root\n# sample false Whether to show entire set of samples for histograms ('false' or 'true')\n#\n# * Default path is /metrics/json for all instances except the master. The master has two paths:\n# /metrics/aplications/json # App information\n# /metrics/master/json # Master information\n\n# org.apache.spark.metrics.sink.GraphiteSink\n# Name: Default: Description:\n# host NONE Hostname of Graphite server\n# port NONE Port of Graphite server\n# period 10 Poll period\n# unit seconds Units of poll period\n# prefix EMPTY STRING Prefix to prepend to metric name\n\n##
  Examples\n# Enable JmxSink for all instances by class name\n#*.sink.jmx.class=org.apache.spark.metrics.sink.JmxSink\n\n# Enable ConsoleSink for all instances by class name\n#*.sink.console.class=org.apache.spark.metrics.sink.ConsoleSink\n\n# Polling period for ConsoleSink\n#*.sink.console.period=10\n\n#*.sink.console.unit=seconds\n\n# Master instance overlap polling period\n#master.sink.console.period=15\n\n#master.sink.console.unit=seconds\n\n# Enable CsvSink for all instances\n#*.sink.csv.class=org.apache.spark.metrics.sink.CsvSink\n\n# Polling period for CsvSink\n#*.sink.csv.period=1\n\n#*.sink.csv.unit=minutes\n\n# Polling directory for CsvSink\n#*.sink.csv.directory=/tmp/\n\n# Worker instance overlap polling period\n#worker.sink.csv.period=10\n\n#worker.sink.csv.unit=minutes\n\n# Enable jvm source for instance master, worker, driver and executor\n#master.source.jvm.class=org.apache.spark.metrics.source.JvmSource\n\n#worker.source.jvm.class=org.apache.spark.metrics.source.JvmSo
 urce\n\n#driver.source.jvm.class=org.apache.spark.metrics.source.JvmSource\n\n#executor.source.jvm.class=org.apache.spark.metrics.source.JvmSource"
+    },
+    "spark-metrics-properties": {
+      "content": "\n# syntax: [instance].sink|source.[name].[options]=[value]\n\n# This file configures Spark's internal metrics system. The metrics system is\n# divided into instances which correspond to internal components.\n# Each instance can be configured to report its metrics to one or more sinks.\n# Accepted values for [instance] are \"master\", \"worker\", \"executor\", \"driver\",\n# and \"applications\". A wild card \"*\" can be used as an instance name, in\n# which case all instances will inherit the supplied property.\n#\n# Within an instance, a \"source\" specifies a particular set of grouped metrics.\n# there are two kinds of sources:\n# 1. Spark internal sources, like MasterSource, WorkerSource, etc, which will\n# collect a Spark component's internal state. Each instance is paired with a\n# Spark source that is added automatically.\n# 2. Common sources, like JvmSource, which will collect low level state.\n# These can be added through configuration options and are then
  loaded\n# using reflection.\n#\n# A \"sink\" specifies where metrics are delivered to. Each instance can be\n# assigned one or more sinks.\n#\n# The sink|source field specifies whether the property relates to a sink or\n# source.\n#\n# The [name] field specifies the name of source or sink.\n#\n# The [options] field is the specific property of this source or sink. The\n# source or sink is responsible for parsing this property.\n#\n# Notes:\n# 1. To add a new sink, set the \"class\" option to a fully qualified class\n# name (see examples below).\n# 2. Some sinks involve a polling period. The minimum allowed polling period\n# is 1 second.\n# 3. Wild card properties can be overridden by more specific properties.\n# For example, master.sink.console.period takes precedence over\n# *.sink.console.period.\n# 4. A metrics specific configuration\n# \"spark.metrics.conf=${SPARK_HOME}/conf/metrics.properties\" should be\n# added to Java properties using -Dspark.metrics.conf=xxx if you want to\
 n# customize metrics system. You can also put the file in ${SPARK_HOME}/conf\n# and it will be loaded automatically.\n# 5. MetricsServlet is added by default as a sink in master, worker and client\n# driver, you can send http request \"/metrics/json\" to get a snapshot of all the\n# registered metrics in json format. For master, requests \"/metrics/master/json\" and\n# \"/metrics/applications/json\" can be sent seperately to get metrics snapshot of\n# instance master and applications. MetricsServlet may not be configured by self.\n#\n\n## List of available sinks and their properties.\n\n# org.apache.spark.metrics.sink.ConsoleSink\n# Name: Default: Description:\n# period 10 Poll period\n# unit seconds Units of poll period\n\n# org.apache.spark.metrics.sink.CSVSink\n# Name: Default: Description:\n# period 10 Poll period\n# unit seconds Units of poll period\n# directory /tmp Where to store CSV files\n\n# org.apache.spark.metrics.sink.GangliaSink\n# Name: Default: Description:\n# host N
 ONE Hostname or multicast group of Ganglia server\n# port NONE Port of Ganglia server(s)\n# period 10 Poll period\n# unit seconds Units of poll period\n# ttl 1 TTL of messages sent by Ganglia\n# mode multicast Ganglia network mode ('unicast' or 'multicast')\n\n# org.apache.spark.metrics.sink.JmxSink\n\n# org.apache.spark.metrics.sink.MetricsServlet\n# Name: Default: Description:\n# path VARIES* Path prefix from the web server root\n# sample false Whether to show entire set of samples for histograms ('false' or 'true')\n#\n# * Default path is /metrics/json for all instances except the master. The master has two paths:\n# /metrics/aplications/json # App information\n# /metrics/master/json # Master information\n\n# org.apache.spark.metrics.sink.GraphiteSink\n# Name: Default: Description:\n# host NONE Hostname of Graphite server\n# port NONE Port of Graphite server\n# period 10 Poll period\n# unit seconds Units of poll period\n# prefix EMPTY STRING Prefix to prepend to metric name\n\n##
  Examples\n# Enable JmxSink for all instances by class name\n#*.sink.jmx.class=org.apache.spark.metrics.sink.JmxSink\n\n# Enable ConsoleSink for all instances by class name\n#*.sink.console.class=org.apache.spark.metrics.sink.ConsoleSink\n\n# Polling period for ConsoleSink\n#*.sink.console.period=10\n\n#*.sink.console.unit=seconds\n\n# Master instance overlap polling period\n#master.sink.console.period=15\n\n#master.sink.console.unit=seconds\n\n# Enable CsvSink for all instances\n#*.sink.csv.class=org.apache.spark.metrics.sink.CsvSink\n\n# Polling period for CsvSink\n#*.sink.csv.period=1\n\n#*.sink.csv.unit=minutes\n\n# Polling directory for CsvSink\n#*.sink.csv.directory=/tmp/\n\n# Worker instance overlap polling period\n#worker.sink.csv.period=10\n\n#worker.sink.csv.unit=minutes\n\n# Enable jvm source for instance master, worker, driver and executor\n#master.source.jvm.class=org.apache.spark.metrics.source.JvmSource\n\n#worker.source.jvm.class=org.apache.spark.metrics.source.JvmSo
 urce\n\n#driver.source.jvm.class=org.apache.spark.metrics.source.JvmSource\n\n#executor.source.jvm.class=org.apache.spark.metrics.source.JvmSource"
+    },
+    "livy-log4j-properties": {
+      "content": "\n            # Set everything to be logged to the console\n            log4j.rootCategory=INFO, console\n            log4j.appender.console=org.apache.log4j.ConsoleAppender\n            log4j.appender.console.target=System.err\n            log4j.appender.console.layout=org.apache.log4j.PatternLayout\n            log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n\n\n            log4j.logger.org.eclipse.jetty=WARN"
+    },
+    "livy2-log4j-properties": {
+      "content": "\n            # Set everything to be logged to the console\n            log4j.rootCategory=INFO, console\n            log4j.appender.console=org.apache.log4j.ConsoleAppender\n            log4j.appender.console.target=System.err\n            log4j.appender.console.layout=org.apache.log4j.PatternLayout\n            log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n\n\n            log4j.logger.org.eclipse.jetty=WARN"
+    },
+    "livy-conf": {
+      "livy.server.port": "8998",
+      "livy.server.csrf_protection.enabled": "true",
+      "livy.environment": "production",
+      "livy.impersonation.enabled": "true",
+      "livy.server.session.timeout": "3600000"
+    },
+    "livy2-conf": {
+      "livy.server.port": "8999",
+      "livy.server.csrf_protection.enabled": "true",
+      "livy.environment": "production",
+      "livy.impersonation.enabled": "true",
+      "livy.server.session.timeout": "3600000"
+    },
+    "livy-spark-blacklist": {
+      "content": "\n            #\n            # Configuration override / blacklist. Defines a list of properties that users are not allowed\n            # to override when starting Spark sessions.\n            #\n            # This file takes a list of property names (one per line). Empty lines and lines starting with \"#\"\n            # are ignored.\n            #"
+    },
+    "livy2-spark-blacklist": {
+      "content": "\n            #\n            # Configuration override / blacklist. Defines a list of properties that users are not allowed\n            # to override when starting Spark sessions.\n            #\n            # This file takes a list of property names (one per line). Empty lines and lines starting with \"#\"\n            # are ignored.\n            #"
+    },
+    "livy-env": {
+      "livy_group": "livy",
+      "spark_home": "/usr/hdp/current/spark-client",
+      "content": "\n            #!/usr/bin/env bash\n\n            # - SPARK_HOME      Spark which you would like to use in livy\n            # - HADOOP_CONF_DIR Directory containing the Hadoop / YARN configuration to use.\n            # - LIVY_LOG_DIR    Where log files are stored.  (Default: ${LIVY_HOME}/logs)\n            # - LIVY_PID_DIR    Where the pid file is stored. (Default: /tmp)\n            # - LIVY_SERVER_JAVA_OPTS  Java Opts for running livy server (You can set jvm related setting here, like jvm memory/gc algorithm and etc.)\n        export SPARK_HOME=/usr/hdp/current/spark-client\n        export HADOOP_CONF_DIR=/etc/hadoop/conf\n        export LIVY_LOG_DIR={{livy_log_dir}}\n        export LIVY_PID_DIR={{livy_pid_dir}}\n        export LIVY_SERVER_JAVA_OPTS=\"-Xmx2g\"",
+      "livy_pid_dir": "/var/run/livy",
+      "livy_log_dir": "/var/log/livy",
+      "livy_user": "livy"
+    },
+    "livy2-env": {
+      "livy2_group": "livy",
+      "spark_home": "/usr/hdp/current/spark2-client",
+      "content": "\n            #!/usr/bin/env bash\n\n            # - SPARK_HOME      Spark which you would like to use in livy\n            # - HADOOP_CONF_DIR Directory containing the Hadoop / YARN configuration to use.\n            # - LIVY_LOG_DIR    Where log files are stored.  (Default: ${LIVY_HOME}/logs)\n            # - LIVY_PID_DIR    Where the pid file is stored. (Default: /tmp)\n            # - LIVY_SERVER_JAVA_OPTS  Java Opts for running livy server (You can set jvm related setting here, like jvm memory/gc algorithm and etc.)\n        export SPARK_HOME=/usr/hdp/current/spark2-client\n        export HADOOP_CONF_DIR=/etc/hadoop/conf\n        export LIVY_LOG_DIR={{livy_log_dir}}\n        export LIVY_PID_DIR={{livy_pid_dir}}\n        export LIVY_SERVER_JAVA_OPTS=\"-Xmx2g\"",
+      "livy2_pid_dir": "/var/run/livy2",
+      "livy2_log_dir": "/var/log/livy2",
+      "livy2_user": "livy"
+    },
+    "infra-solr-env": {
+      "infra_solr_znode": "/infra-solr",
+      "infra_solr_user": "solr",
+      "infra_solr_client_log_dir" :"/var/log/ambari-infra-solr-client"
+    },
+    "infra-solr-client-log4j" : {
+      "infra_solr_client_log_dir" : "/var/log/ambari-infra-solr-client",
+      "content" : "content"
+    },
+    "application-properties": {
+      "atlas.cluster.name" : "c2",
+      "atlas.rest.address": "http://c6401.ambari.apache.org:21000",
+      "atlas.graph.storage.backend": "berkeleyje",
+      "atlas.graph.storage.directory": "data/berkley",
+      "atlas.graph.index.search.backend": "solr5",
+      "atlas.graph.index.search.directory": "data/es",
+      "atlas.graph.index.search.elasticsearch.client-only": false,
+      "atlas.graph.index.search.elasticsearch.local-mode": true,
+      "atlas.lineage.hive.table.type.name": "Table",
+      "atlas.lineage.hive.column.type.name": "Column",
+      "atlas.lineage.hive.table.column.name": "columns",
+      "atlas.lineage.hive.process.type.name": "LoadProcess",
+      "atlas.lineage.hive.process.inputs.name": "inputTables",
+      "atlas.lineage.hive.process.outputs.name": "outputTables",
+      "atlas.enableTLS": false,
+      "atlas.authentication.method": "simple",
+      "atlas.authentication.principal": "atlas",
+      "atlas.authentication.keytab": "/etc/security/keytabs/atlas.service.keytab",
+      "atlas.http.authentication.enabled": false,
+      "atlas.http.authentication.type": "simple",
+      "atlas.http.authentication.kerberos.principal": "HTTP/_HOST@EXAMPLE.COM",
+      "atlas.http.authentication.kerberos.keytab": "/etc/security/keytabs/spnego.service.keytab",
+      "atlas.http.authentication.kerberos.name.rules": "DEFAULT",
+      "atlas.server.http.port" : "21000",
+      "atlas.notification.embedded" : false,
+      "atlas.kafka.bootstrap.servers" : "c6401.ambari.apache.org:6667",
+      "atlas.kafka.data" : "/usr/hdp/current/atlas-server/data/kafka",
+      "atlas.kafka.entities.group.id" : "entities",
+      "atlas.kafka.hook.group.id" : "atlas",
+      "atlas.kafka.zookeeper.connect" : "c6401.ambari.apache.org:2181"
+    },
+    "atlas-env": {
+      "content": "# The java implementation to use. If JAVA_HOME is not found we expect java and jar to be in path\nexport JAVA_HOME={{java64_home}}\n# any additional java opts you want to set. This will apply to both client and server operations\nexport METADATA_OPTS={{metadata_opts}}\n# metadata configuration directory\nexport METADATA_CONF={{conf_dir}}\n# Where log files are stored. Defatult is logs directory under the base install location\nexport METADATA_LOG_DIR={{log_dir}}\n# additional classpath entries\nexport METADATACPPATH={{metadata_classpath}}\n# data dir\nexport METADATA_DATA_DIR={{data_dir}}\n# Where do you want to expand the war file. By Default it is in /server/webapp dir under the base install dir.\nexport METADATA_EXPANDED_WEBAPP_DIR={{expanded_war_dir}}",
+      "metadata_user": "atlas",
+      "metadata_port": 21000,
+      "metadata_pid_dir": "/var/run/atlas",
+      "metadata_log_dir": "/var/log/atlas",
+      "metadata_data_dir": "/var/lib/atlas/data",
+      "metadata_expanded_war_dir": "/var/lib/atlas/server/webapp"
+    },
+    "atlas-log4j": {
+      "content": "<property><name>content</name><description>Custom log4j.properties</description><value></value></property>",
+      "atlas_log_level": "debug",
+      "audit_log_level": "OFF"
+    },
+    "atlas-solrconfig": {
+      "content": "<property><name>content</name><description>Custom solrconfig properties</description><value></value></property>"
+    },
+    "zeppelin-env": {
+      "zeppelin.server.kerberos.keytab": "", 
+      "shiro_ini_content": "\n[users]\n# List of users with their password allowed to access Zeppelin.\n# To use a different strategy (LDAP / Database / ...) check the shiro doc at http://shiro.apache.org/configuration.html#Configuration-INISections\n#admin = password1\n#user1 = password2, role1, role2\n#user2 = password3, role3\n#user3 = password4, role2\n\n# Sample LDAP configuration, for user Authentication, currently tested for single Realm\n[main]\n#ldapRealm = org.apache.shiro.realm.ldap.JndiLdapRealm\n#ldapRealm.userDnTemplate = uid={0},cn=users,cn=accounts,dc=hortonworks,dc=com\n#ldapRealm.contextFactory.url = ldap://ldaphost:389\n#ldapRealm.contextFactory.authenticationMechanism = SIMPLE\n#sessionManager = org.apache.shiro.web.session.mgt.DefaultWebSessionManager\n#securityManager.sessionManager = $sessionManager\n# 86,400,000 milliseconds = 24 hour\n#securityManager.sessionManager.globalSessionTimeout = 86400000\nshiro.loginUrl = /api/login\n\n[urls]\n# anon means the acce
 ss is anonymous.\n# authcBasic means Basic Auth Security\n# To enfore security, comment the line below and uncomment the next one\n/api/version = anon\n/** = anon\n#/** = authc", 
+      "zeppelin.spark.jar.dir": "/apps/zeppelin", 
+      "zeppelin.executor.mem": "512m", 
+      "zeppelin_pid_dir": "/var/run/zeppelin", 
+      "zeppelin.executor.instances": "2", 
+      "log4j_properties_content": "\nlog4j.rootLogger = INFO, dailyfile\nlog4j.appender.stdout = org.apache.log4j.ConsoleAppender\nlog4j.appender.stdout.layout = org.apache.log4j.PatternLayout\nlog4j.appender.stdout.layout.ConversionPattern=%5p [%d] ({%t} %F[%M]:%L) - %m%n\nlog4j.appender.dailyfile.DatePattern=.yyyy-MM-dd\nlog4j.appender.dailyfile.Threshold = INFO\nlog4j.appender.dailyfile = org.apache.log4j.DailyRollingFileAppender\nlog4j.appender.dailyfile.File = ${zeppelin.log.file}\nlog4j.appender.dailyfile.layout = org.apache.log4j.PatternLayout\nlog4j.appender.dailyfile.layout.ConversionPattern=%5p [%d] ({%t} %F[%M]:%L) - %m%n",
+      "zeppelin.server.kerberos.principal": "", 
+      "zeppelin_user": "zeppelin", 
+      "zeppelin_env_content": "\n# Spark master url. eg. spark://master_addr:7077. Leave empty if you want to use local mode\nexport MASTER=yarn-client\nexport SPARK_YARN_JAR={{spark_jar}}\n\n\n# Where log files are stored.  PWD by default.\nexport ZEPPELIN_LOG_DIR={{zeppelin_log_dir}}\n\n# The pid files are stored. /tmp by default.\nexport ZEPPELIN_PID_DIR={{zeppelin_pid_dir}}\n\n\nexport JAVA_HOME={{java64_home}}\n\n# Additional jvm options. for example, export ZEPPELIN_JAVA_OPTS=\"-Dspark.executor.memory=8g -Dspark.cores.max=16\"\nexport ZEPPELIN_JAVA_OPTS=\"-Dhdp.version={{full_stack_version}} -Dspark.executor.memory={{executor_mem}} -Dspark.executor.instances={{executor_instances}} -Dspark.yarn.queue={{spark_queue}}\"\n\n\n# Zeppelin jvm mem options Default -Xmx1024m -XX:MaxPermSize=512m\n# export ZEPPELIN_MEM\n\n# zeppelin interpreter process jvm mem options. Defualt = ZEPPELIN_MEM\n# export ZEPPELIN_INTP_MEM\n\n# zeppelin interpreter process jvm options. Default = ZEPPELIN_JA
 VA_OPTS\n# export ZEPPELIN_INTP_JAVA_OPTS\n\n# Where notebook saved\n# export ZEPPELIN_NOTEBOOK_DIR\n\n# Id of notebook to be displayed in homescreen. ex) 2A94M5J1Z\n# export ZEPPELIN_NOTEBOOK_HOMESCREEN\n\n# hide homescreen notebook from list when this value set to \"true\". default \"false\"\n# export ZEPPELIN_NOTEBOOK_HOMESCREEN_HIDE\n\n# Bucket where notebook saved\n# export ZEPPELIN_NOTEBOOK_S3_BUCKET\n\n# User in bucket where notebook saved. For example bucket/user/notebook/2A94M5J1Z/note.json\n# export ZEPPELIN_NOTEBOOK_S3_USER\n\n# A string representing this instance of zeppelin. $USER by default\n# export ZEPPELIN_IDENT_STRING\n\n# The scheduling priority for daemons. Defaults to 0.\n# export ZEPPELIN_NICENESS\n\n\n#### Spark interpreter configuration ####\n\n## Use provided spark installation ##\n## defining SPARK_HOME makes Zeppelin run spark interpreter process using spark-submit\n##\n# (required) When it is defined, load it instead of Zeppelin embedded Spark libraries\n
 export SPARK_HOME={{spark_home}}\n\n# (optional) extra options to pass to spark submit. eg) \"--driver-memory 512M --executor-memory 1G\".\n# export SPARK_SUBMIT_OPTIONS\n\n## Use embedded spark binaries ##\n## without SPARK_HOME defined, Zeppelin still able to run spark interpreter process using embedded spark binaries.\n## however, it is not encouraged when you can define SPARK_HOME\n##\n# Options read in YARN client mode\n# yarn-site.xml is located in configuration directory in HADOOP_CONF_DIR.\nexport HADOOP_CONF_DIR=/etc/hadoop/conf\n\n# Pyspark (supported with Spark 1.2.1 and above)\n# To configure pyspark, you need to set spark distribution's path to 'spark.home' property in Interpreter setting screen in Zeppelin GUI\n# path to the python command. must be the same path on the driver(Zeppelin) and all workers.\n# export PYSPARK_PYTHON\n\nexport PYTHONPATH=\"${SPARK_HOME}/python:${SPARK_HOME}/python/lib/py4j-0.8.2.1-src.zip\"\nexport SPARK_YARN_USER_ENV=\"PYTHONPATH=${PYTHONPAT
 H}\"\n\n## Spark interpreter options ##\n##\n# Use HiveContext instead of SQLContext if set true. true by default.\n# export ZEPPELIN_SPARK_USEHIVECONTEXT\n\n# Execute multiple SQL concurrently if set true. false by default.\n# export ZEPPELIN_SPARK_CONCURRENTSQL\n\n# Max number of SparkSQL result to display. 1000 by default.\n# export ZEPPELIN_SPARK_MAXRESULT", 
+      "zeppelin_log_dir": "/var/log/zeppelin", 
+      "zeppelin_group": "zeppelin"
+    },
+"zeppelin-config": {
+            "zeppelin.server.port": "9995",
+            "zeppelin.server.ssl.port": "9995",
+            "zeppelin.ssl.truststore.password": "change me", 
+            "zeppelin.interpreters": "org.apache.zeppelin.spark.SparkInterpreter,org.apache.zeppelin.spark.PySparkInterpreter,org.apache.zeppelin.spark.SparkSqlInterpreter,org.apache.zeppelin.spark.DepInterpreter,org.apache.zeppelin.markdown.Markdown,org.apache.zeppelin.angular.AngularInterpreter,org.apache.zeppelin.shell.ShellInterpreter,org.apache.zeppelin.jdbc.JDBCInterpreter,org.apache.zeppelin.phoenix.PhoenixInterpreter,org.apache.zeppelin.livy.LivySparkInterpreter,org.apache.zeppelin.livy.LivyPySparkInterpreter,org.apache.zeppelin.livy.LivySparkRInterpreter,org.apache.zeppelin.livy.LivySparkSQLInterpreter",
+            "zeppelin.interpreter.group.order": "spark,angular,jdbc,livy,md,sh",
+            "zeppelin.ssl.truststore.path": "conf/truststore", 
+            "zeppelin.notebook.dir": "notebook", 
+            "zeppelin.ssl.keystore.password": "change me", 
+            "zeppelin.ssl.keystore.path": "conf/keystore", 
+            "zeppelin.server.addr": "0.0.0.0", 
+            "zeppelin.ssl.client.auth": "false", 
+            "zeppelin.notebook.homescreen": " ", 
+            "zeppelin.interpreter.dir": "interpreter", 
+            "zeppelin.ssl.keystore.type": "JKS", 
+            "zeppelin.notebook.s3.user": "user", 
+            "zeppelin.ssl.key.manager.password": "change me", 
+            "zeppelin.anonymous.allowed": "true", 
+            "zeppelin.ssl.truststore.type": "JKS", 
+            "zeppelin.ssl": "false", 
+            "zeppelin.notebook.storage": "org.apache.zeppelin.notebook.repo.VFSNotebookRepo", 
+            "zeppelin.websocket.max.text.message.size": "1024000", 
+            "zeppelin.interpreter.connect.timeout": "30000", 
+            "zeppelin.notebook.s3.bucket": "zeppelin", 
+            "zeppelin.notebook.homescreen.hide": "false", 
+            "zeppelin.server.allowed.origins": "*"
+        },
+    "zoo.cfg": {
+      "clientPort": "2181"
+    },
+    "ranger-hbase-plugin-properties": {
+      "ranger-hbase-plugin-enabled":"yes"
+    },
+    "ranger-hive-plugin-properties": {
+      "ranger-hive-plugin-enabled":"yes"
+    },
+    "ranger-env": {
+      "xml_configurations_supported" : "true"
+    },
+    "tagsync-application-properties": {
+            "atlas.kafka.hook.group.id": "atlas",
+            "atlas.kafka.zookeeper.connect": "os-mv-31-dev-4.novalocal:2181",
+            "atlas.kafka.acks": "1",
+            "atlas.kafka.entities.group.id": "ranger_entities_consumer",
+            "atlas.kafka.data": "/usr/hdp/current/atlas-server/data/kafka",
+            "atlas.kafka.bootstrap.servers": "localhost:2181",
+            "atlas.notification.embedded": "false"
+    },
+    "ranger-tagsync-site": {
+            "ranger.tagsync.sink.impl.class": "org.apache.ranger.tagsync.sink.tagadmin.TagAdminRESTSink",
+            "ranger.tagsync.atlasrestsource.endpoint": "",
+            "ranger.tagsync.tagadmin.rest.ssl.config.file": "/usr/hdp/current/ranger-tagsync/conf/mytruststore.jks",
+            "ranger.tagsync.logdir": "/var/log/ranger/tagsync",
+            "ranger.tagsync.filesource.filename": "/usr/hdp/current/ranger-tagsync/conf/etc/ranger/data/tags.json",
+            "ranger.tagsync.enabled": "true",
+            "ranger.tagsync.tagadmin.rest.url": "{{ranger_external_url}}",
+            "ranger.tagsync.atlasrestsource.download.interval": "",
+            "ranger.tagsync.filesource.modtime.check.interval": "60000",
+            "ranger.tagsync.tagadmin.password": "rangertagsync",
+            "ranger.tagsync.source.impl.class": "file",
+            "ranger.tagsync.source.atlas.custom.resource.mappers": "",
+            "ranger.tagsync.tagadmin.alias": "tagsync.tagadmin",
+            "ranger.tagsync.tagadmin.keystore": "/usr/hdp/current/ranger-tagsync/conf/rangertagsync.jceks",
+            "ranger.tagsync.atlas.to.service.mapping": ""
+    },
+    "druid-env": {
+      "druid_log_dir" : "/var/log/druid",
+      "druid_pid_dir" : "/var/run/druid",
+      "content" : "#!/bin/bash\n # Set DRUID specific environment variables here.\n# The java implementation to use\nexport JAVA_HOME={{java8_home}}\nexport PATH=$PATH:$JAVA_HOME/bin\nexport DRUID_PID_DIR={{druid_pid_dir}}\nexport DRUID_LOG_DIR={{druid_log_dir}}\nexport DRUID_CONF_DIR={{druid_conf_dir}}\nexport DRUID_LIB_DIR={{druid_home}}/lib",
+      "druid.coordinator.jvm.heap.memory" : 1024,
+      "druid.coordinator.jvm.direct.memory": 2048,
+      "druid.coordinator.jvm.opts": "-Duser.timezone=UTC -Dfile.encoding=UTF-8",
+      "druid.broker.jvm.heap.memory" : 1024,
+      "druid.broker.jvm.direct.memory": 2048,
+      "druid.broker.jvm.opts": "-Duser.timezone=UTC -Dfile.encoding=UTF-8",
+      "druid.middlemanager.jvm.heap.memory" : 1024,
+      "druid.middlemanager.jvm.direct.memory": 2048,
+      "druid.middlemanager.jvm.opts": "-Duser.timezone=UTC -Dfile.encoding=UTF-8",
+      "druid.historical.jvm.heap.memory" : 1024,
+      "druid.historical.jvm.direct.memory": 2048,
+      "druid.historical.jvm.opts": "-Duser.timezone=UTC -Dfile.encoding=UTF-8",
+      "druid.overlord.jvm.heap.memory" : 1024,
+      "druid.overlord.jvm.direct.memory": 2048,
+      "druid.overlord.jvm.opts": "-Duser.timezone=UTC -Dfile.encoding=UTF-8",
+      "druid.router.jvm.heap.memory" : 1024,
+      "druid.router.jvm.direct.memory": 2048,
+      "druid.router.jvm.opts": "-Duser.timezone=UTC -Dfile.encoding=UTF-8",
+      "druid_user": "druid"
+    },
+    "druid-common" : {
+      "druid.metadata.storage.type" : "mysql",
+      "druid.metadata.storage.connector.connectURI" : "jdbc:mysql://my-db-host:3306/druid?createDatabaseIfNotExist=true",
+      "druid.metadata.storage.connector.user" : "druid",
+      "druid.metadata.storage.connector.password" : "diurd",
+      "druid.storage.type" : "hdfs",
+      "druid.storage.storageDirectory" : "/user/druid/data",
+      "druid.indexer.logs.type": "hdfs",
+      "druid.indexer.logs.directory": "/user/druid/logs",
+      "druid.extensions.pullList": "[\"custom-druid-extension\"]",
+      "druid.extensions.repositoryList": "[\"http://custom-mvn-repo/public/release\"]",
+      "druid.extensions.loadList": "[\"mysql-metadata-storage\", \"druid-datasketches\"]",
+      "druid.security.extensions.loadList": "[\"druid-kerberos\"]"
+    },
+    "druid-historical" : {
+      "druid.segmentCache.infoDir" : "/apps/druid/segmentCache/info_dir",
+      "druid.segmentCache.locations" :"[{\"path\":\"/apps/druid/segmentCache\",\"maxSize\":300000000000}]"
+    },
+    "druid-coordinator" : {
+      "druid.service" : "druid/coordinator"
+    },
+    "druid-overlord" : {
+      "druid.service" : "druid/overlord"
+    },
+    "druid-broker" : {
+      "druid.service" : "druid/broker"
+    },
+    "druid-middlemanager" : {
+      "druid.service" : "druid/middlemanager",
+      "druid.indexer.task.hadoopWorkingPath" : "/tmp/druid-indexing",
+      "druid.indexer.task.baseTaskDir" : "/apps/druid/tasks"
+    },
+    "druid-router" : {
+      "druid.service" : "druid/router"
+    },
+    "druid-log4j" : {
+      "content" : "<![CDATA[<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one\n  ~ or more contributor license agreements.  See the NOTICE file\n  ~ distributed with this work for additional information\n  ~ regarding copyright ownership.  The ASF licenses this file\n  ~ to you under the Apache License, Version 2.0 (the\n  ~ \"License\"); you may not use this file except in compliance\n  ~ with the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n    <Configuration>\n        <Appenders>\n            <Console name=\"Console\
 " target=\"SYSTEM_OUT\">\n                <PatternLayout pattern=\"%d{ISO8601} %p [%t] %c - %m%n\"/>\n            </Console>\n        </Appenders>\n        <Loggers>\n            <Logger name=\"com.metamx\" level=\"{{metamx_log_level}}\"/>\n            <Logger name=\"io.druid\" level=\"{{druid_log_level}}\"/>\n            <Root level=\"{{root_log_level}}\">\n                <AppenderRef ref=\"Console\"/>\n            </Root>\n        </Loggers>\n    </Configuration>\n      ]]>\n"
+    },
+    "druid-logrotate" : {
+      "content" : "<![CDATA[\n    {{druid_log_dir}}/*.log {\n        copytruncate\n        rotate 7\n        daily\n        nocompress\n        missingok\n        notifempty\n        create 660 druid users\n        dateext\n        dateformat -%Y-%m-%d-%s\n        }\n      ]]>\n"
+    },
+    "superset" : {
+      "SUPERSET_DATABASE_TYPE" : "sqllite"
+    }
+  },
+  "configuration_attributes": {
+    "sqoop-site": {},
+    "yarn-site": {
+      "final": {
+        "yarn.nodemanager.disk-health-checker.min-healthy-disks": "true",
+        "yarn.nodemanager.container-executor.class": "true",
+        "yarn.nodemanager.local-dirs": "true"
+      }
+    },
+    "yarn-site": {
+      "final": {
+        "is_supported_yarn_ranger": "true"
+      }
+    },
+    "hdfs-site": {
+      "final": {
+        "dfs.web.ugi": "true",
+        "dfs.support.append": "true",
+        "dfs.cluster.administrators": "true"
+      }
+    },
+    "core-site": {
+      "final": {
+        "hadoop.proxyuser.hive.groups": "true",
+        "webinterface.private.actions": "true",
+        "hadoop.proxyuser.oozie.hosts": "true"
+      }
+    },
+    "knox-env": {},
+    "gateway-site": {},
+    "users-ldif": {},
+    "kafka-env": {},
+    "kafka-log4j": {},
+    "kafka-broker": {},
+    "metadata-env": {},
+    "atlas-hbase-site": {},
+    "tagsync-application-properties": {},
+    "ranger-tagsync-site": {}
+  },
+  "configurationTags": {
+    "slider-client": {
+      "tag": "version1"
+    },
+    "slider-log4j": {
+      "tag": "version1"
+    },
+    "slider-env": {
+      "tag": "version1"
+    },
+    "core-site": {
+      "tag": "version1"
+    },
+    "hdfs-site": {
+      "tag": "version1"
+    },
+    "yarn-site": {
+      "tag": "version1"
+    },
+    "gateway-site": {
+      "tag": "version1"
+    },
+    "topology": {
+      "tag": "version1"
+    },
+    "users-ldif": {
+      "tag": "version1"
+    },
+    "kafka-env": {
+      "tag": "version1"
+    },
+    "kafka-log4j": {
+      "tag": "version1"
+    },
+    "kafka-broker": {
+      "tag": "version1"
+    },
+    "metadata-env": {
+      "tag": "version1"
+    },
+    "tagsync-application-properties": {
+      "tag": "version1"
+    },
+    "ranger-tagsync-site": {
+      "tag": "version1"
+    }
+  },
+  "commandId": "7-1",
+  "clusterHostInfo": {
+    "ambari_server_host": [
+      "c6401.ambari.apache.org"
+    ],
+    "all_ping_ports": [
+      "8670",
+      "8670"
+    ],
+    "rm_host": [
+      "c6402.ambari.apache.org"
+    ],
+    "all_hosts": [
+      "c6401.ambari.apache.org",
+      "c6402.ambari.apache.org"
+    ],
+    "knox_gateway_hosts": [
+      "jaimin-knox-1.c.pramod-thangali.internal"
+    ],
+    "kafka_broker_hosts": [
+      "c6401.ambari.apache.org"
+    ],
+    "infra_solr_hosts": [
+      "c6401.ambari.apache.org"
+    ],
+    "zookeeper_hosts": [
+      "c6401.ambari.apache.org"
+    ],
+    "ranger_tagsync_hosts": [
+      "c6401.ambari.apache.org"
+    ],
+    "atlas_server_hosts": [
+      "c6401.ambari.apache.org"
+    ],
+    "zeppelin_master_hosts": [
+      "c6401.ambari.apache.org"
+    ]
+  }
+}


[12/29] ambari git commit: AMBARI-22555. Update server setup to deny GPL as default. Fixed for silent setup. (swagle)

Posted by rl...@apache.org.
AMBARI-22555. Update server setup to deny GPL as default. Fixed for silent setup. (swagle)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4aef8fe0
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4aef8fe0
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4aef8fe0

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 4aef8fe07fdabc684e2a25c4a4b78073710a5f77
Parents: 21e37b1
Author: Siddharth Wagle <sw...@hortonworks.com>
Authored: Thu Nov 30 11:41:48 2017 -0800
Committer: Siddharth Wagle <sw...@hortonworks.com>
Committed: Thu Nov 30 11:41:48 2017 -0800

----------------------------------------------------------------------
 .../src/main/python/ambari_server/serverConfiguration.py        | 4 ++--
 ambari-server/src/main/python/ambari_server/serverSetup.py      | 5 ++---
 ambari-server/src/main/python/ambari_server/serverUpgrade.py    | 2 +-
 3 files changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4aef8fe0/ambari-server/src/main/python/ambari_server/serverConfiguration.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/ambari_server/serverConfiguration.py b/ambari-server/src/main/python/ambari_server/serverConfiguration.py
index d6ab453..27b4472 100644
--- a/ambari-server/src/main/python/ambari_server/serverConfiguration.py
+++ b/ambari-server/src/main/python/ambari_server/serverConfiguration.py
@@ -1147,7 +1147,7 @@ def update_ambari_env():
   return 0
  
 # default should be false / not accepted 
-def write_gpl_license_accepted(text = GPL_LICENSE_PROMPT_TEXT):
+def write_gpl_license_accepted(default_prompt_value = False, text = GPL_LICENSE_PROMPT_TEXT):
   properties = get_ambari_properties()
   if properties == -1:
     err = "Error getting ambari properties"
@@ -1157,7 +1157,7 @@ def write_gpl_license_accepted(text = GPL_LICENSE_PROMPT_TEXT):
   if GPL_LICENSE_ACCEPTED_PROPERTY in properties.keys() and properties.get_property(GPL_LICENSE_ACCEPTED_PROPERTY).lower() == "true":
     return True
 
-  result = get_YN_input(text, False)
+  result = get_YN_input(text, default_prompt_value)
 
   properties.process_pair(GPL_LICENSE_ACCEPTED_PROPERTY, str(result).lower())
   update_properties(properties)

http://git-wip-us.apache.org/repos/asf/ambari/blob/4aef8fe0/ambari-server/src/main/python/ambari_server/serverSetup.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/ambari_server/serverSetup.py b/ambari-server/src/main/python/ambari_server/serverSetup.py
index af45584..3b41fff 100644
--- a/ambari-server/src/main/python/ambari_server/serverSetup.py
+++ b/ambari-server/src/main/python/ambari_server/serverSetup.py
@@ -1182,9 +1182,8 @@ def setup(options):
     err = 'Downloading or installing JDK failed: {0}. Exiting.'.format(e)
     raise FatalException(e.code, err)
 
-  if not get_silent() or options.accept_gpl:
-    print 'Checking GPL software agreement...'
-    write_gpl_license_accepted()
+  print 'Checking GPL software agreement...'
+  write_gpl_license_accepted(default_prompt_value=options.accept_gpl)
 
   print 'Completing setup...'
   retcode = configure_os_settings()

http://git-wip-us.apache.org/repos/asf/ambari/blob/4aef8fe0/ambari-server/src/main/python/ambari_server/serverUpgrade.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/ambari_server/serverUpgrade.py b/ambari-server/src/main/python/ambari_server/serverUpgrade.py
index c2b7de8..dd847e3 100644
--- a/ambari-server/src/main/python/ambari_server/serverUpgrade.py
+++ b/ambari-server/src/main/python/ambari_server/serverUpgrade.py
@@ -179,7 +179,7 @@ def check_gpl_license_approved(upgrade_response):
   if 'lzo_enabled' not in upgrade_response or upgrade_response['lzo_enabled'].lower() != "true":
     return
 
-  while not write_gpl_license_accepted(LZO_ENABLED_GPL_TEXT) and not get_YN_input(INSTALLED_LZO_WITHOUT_GPL_TEXT, False):
+  while not write_gpl_license_accepted(text = LZO_ENABLED_GPL_TEXT) and not get_YN_input(INSTALLED_LZO_WITHOUT_GPL_TEXT, False):
     pass
 
 #


[28/29] ambari git commit: AMBARI-22563. Packages Cannot Be Installed When Yum Transactions Fail (Dmytro Grinenko via ncole)

Posted by rl...@apache.org.
AMBARI-22563. Packages Cannot Be Installed When Yum Transactions Fail (Dmytro Grinenko via ncole)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/959ad900
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/959ad900
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/959ad900

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 959ad900e40c0d04c57145cd84414983175a629a
Parents: 158c94a
Author: Nate Cole <nc...@hortonworks.com>
Authored: Fri Dec 1 16:39:01 2017 -0500
Committer: Nate Cole <nc...@hortonworks.com>
Committed: Fri Dec 1 16:39:01 2017 -0500

----------------------------------------------------------------------
 .../core/providers/package/__init__.py          |  15 +++
 .../core/providers/package/yumrpm.py            | 108 +++++++++++++++++++
 .../custom_actions/scripts/install_packages.py  |  12 ++-
 3 files changed, 133 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/959ad900/ambari-common/src/main/python/resource_management/core/providers/package/__init__.py
----------------------------------------------------------------------
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.

http://git-wip-us.apache.org/repos/asf/ambari/blob/959ad900/ambari-common/src/main/python/resource_management/core/providers/package/yumrpm.py
----------------------------------------------------------------------
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..c83a3ce 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,6 +47,9 @@ 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"]
@@ -359,3 +365,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

http://git-wip-us.apache.org/repos/asf/ambari/blob/959ad900/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py b/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py
index fff18bb..862f205 100644
--- a/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py
+++ b/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py
@@ -112,7 +112,7 @@ class InstallPackages(Script):
           "Will install packages for repository version {0}".format(self.repository_version))
         new_repo_files = create_repo_files(template, command_repository)
         self.repo_files.update(new_repo_files)
-    except Exception, err:
+    except Exception as err:
       Logger.logger.exception("Cannot install repository files. Error: {0}".format(str(err)))
       num_errors += 1
 
@@ -124,6 +124,14 @@ class InstallPackages(Script):
 
     self.put_structured_out(self.structured_output)
 
+    try:
+      # check package manager non-completed transactions
+      if self.pkg_provider.check_uncompleted_transactions():
+        self.pkg_provider.print_uncompleted_transaction_hint()
+        num_errors += 1
+    except Exception as e:  # we need to ignore any exception
+      Logger.warning("Failed to check for uncompleted package manager transactions: " + str(e))
+
     if num_errors > 0:
       raise Fail("Failed to distribute repositories/install packages")
 
@@ -139,7 +147,7 @@ class InstallPackages(Script):
         is_package_install_successful = True
       else:
         num_errors += 1
-    except Exception, err:
+    except Exception as err:
       num_errors += 1
       Logger.logger.exception("Could not install packages. Error: {0}".format(str(err)))
 


[02/29] ambari git commit: AMBARI-22490. Uploading a Zero KB file to HDFS via File View Fails (pallavkul)

Posted by rl...@apache.org.
AMBARI-22490. Uploading a Zero KB file to HDFS via File View Fails (pallavkul)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ff08592a
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ff08592a
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ff08592a

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: ff08592a32d3b8bf4c2ba2c674b73233c775f424
Parents: ca174fb
Author: pallavkul <pa...@gmail.com>
Authored: Thu Nov 30 07:16:47 2017 +0530
Committer: pallavkul <pa...@gmail.com>
Committed: Thu Nov 30 07:16:47 2017 +0530

----------------------------------------------------------------------
 .../resources/ui/app/components/upload-file.js  | 38 ++++++++++----------
 1 file changed, 19 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ff08592a/contrib/views/files/src/main/resources/ui/app/components/upload-file.js
----------------------------------------------------------------------
diff --git a/contrib/views/files/src/main/resources/ui/app/components/upload-file.js b/contrib/views/files/src/main/resources/ui/app/components/upload-file.js
index 8a14272..1a5e911 100644
--- a/contrib/views/files/src/main/resources/ui/app/components/upload-file.js
+++ b/contrib/views/files/src/main/resources/ui/app/components/upload-file.js
@@ -104,25 +104,25 @@ export default Ember.Component.extend(OperationModal, {
           url: url
         });
         this.set('uploader', uploader);
-        if(!Ember.isEmpty(file)) {
-          uploader.upload(file, {path: this.get('path')});
-          this.setUploading(file.name);
-          uploader.on('progress', (e) => {
-            this.setUploadPercent(e.percent);
-          });
-          uploader.on('didUpload', (e) => {
-            this.set('uploader');
-            this.send('close');
-            this.sendAction('refreshAction');
-          });
-          uploader.on('didError', (jqXHR, textStatus, errorThrown) => {
-            var error = Ember.$.parseJSON(jqXHR.responseText);
-            this.set('uploader');
-            this.get('logger').danger(`Failed to upload ${file.name} to ${this.get('path')}`, error);
-            this.send('close');
-            return false;
-          });
-        }
+        uploader.upload(file, {
+          path: this.get('path')
+        });
+        this.setUploading(file.name);
+        uploader.on('progress', (e) => {
+          this.setUploadPercent(e.percent);
+        });
+        uploader.on('didUpload', (e) => {
+          this.set('uploader');
+          this.send('close');
+          this.sendAction('refreshAction');
+        });
+        uploader.on('didError', (jqXHR, textStatus, errorThrown) => {
+          var error = Ember.$.parseJSON(jqXHR.responseText);
+          this.set('uploader');
+          this.get('logger').danger(`Failed to upload ${file.name} to ${this.get('path')}`, error);
+          this.send('close');
+          return false;
+        });
       }, (error) => {
         console.error("Cannot add a directory.", error);
         this.send('close');


[20/29] ambari git commit: AMBARI-22524 : Journal Node start failing when AMS is installed during BP deploy - Addendum patch. (avijayan)

Posted by rl...@apache.org.
AMBARI-22524 : Journal Node start failing when AMS is installed during BP deploy - Addendum patch. (avijayan)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b2655aa6
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b2655aa6
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b2655aa6

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: b2655aa664bf77c015b9cf320d456c850613a809
Parents: f43277e
Author: Aravindan Vijayan <av...@hortonworks.com>
Authored: Thu Nov 30 13:15:08 2017 -0800
Committer: Aravindan Vijayan <av...@hortonworks.com>
Committed: Thu Nov 30 13:15:08 2017 -0800

----------------------------------------------------------------------
 ambari-metrics/ambari-metrics-hadoop-sink/pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b2655aa6/ambari-metrics/ambari-metrics-hadoop-sink/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-hadoop-sink/pom.xml b/ambari-metrics/ambari-metrics-hadoop-sink/pom.xml
index a9d342f..83a2159 100644
--- a/ambari-metrics/ambari-metrics-hadoop-sink/pom.xml
+++ b/ambari-metrics/ambari-metrics-hadoop-sink/pom.xml
@@ -31,7 +31,7 @@ limitations under the License.
   <packaging>jar</packaging>
   <properties>
     <sinkJarName>${project.artifactId}-with-common-${project.version}.jar</sinkJarName>
-    <hadoop.version>3.0.0-beta1</hadoop.version>
+    <hadoopVersion>3.0.0-beta1</hadoopVersion>
   </properties>
 
 
@@ -142,7 +142,7 @@ limitations under the License.
     <dependency>
       <groupId>org.apache.hadoop</groupId>
       <artifactId>hadoop-common</artifactId>
-      <version>${hadoop.version}</version>
+      <version>${hadoopVersion}</version>
       <scope>compile</scope>
     </dependency>
     <dependency>


[14/29] ambari git commit: AMBARI-22485 : Allow Ambari to support non-kerberos SASL mechanisms for Kafka - Addendum, missed the new files (ydavis via mradhakrishnan)

Posted by rl...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f8227780/ambari-server/src/test/python/stacks/2.6/configs/default_kafka_sasl_plaintext.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.6/configs/default_kafka_sasl_plaintext.json b/ambari-server/src/test/python/stacks/2.6/configs/default_kafka_sasl_plaintext.json
new file mode 100644
index 0000000..40218f1
--- /dev/null
+++ b/ambari-server/src/test/python/stacks/2.6/configs/default_kafka_sasl_plaintext.json
@@ -0,0 +1,631 @@
+{
+  "roleCommand": "SERVICE_CHECK",
+  "clusterName": "c1",
+  "hostname": "c6401.ambari.apache.org",
+  "hostLevelParams": {
+    "not_managed_hdfs_path_list": "[\"/apps/hive/warehouse\",\"/apps/falcon\",\"/mr-history/done\",\"/app-logs\",\"/tmp\"]",
+    "agent_stack_retry_count": "5",
+    "agent_stack_retry_on_unavailability": "false",
+    "jdk_location": "http://c6401.ambari.apache.org:8080/resources/",
+    "ambari_db_rca_password": "mapred",
+    "ambari_db_rca_url": "jdbc:postgresql://c6401.ambari.apache.org/ambarirca",
+    "jce_name": "UnlimitedJCEPolicyJDK7.zip",
+    "stack_version": "2.6.5.0",
+    "stack_name": "HDP",
+    "ambari_db_rca_driver": "org.postgresql.Driver",
+    "jdk_name": "jdk-7u67-linux-x64.tar.gz",
+    "ambari_db_rca_username": "mapred",
+    "java_home": "/usr/jdk64/jdk1.7.0_45",
+    "db_name": "ambari",
+    "custom_mysql_jdbc_name": "mysql-connector-java.jar"
+  },
+  "commandType": "EXECUTION_COMMAND",
+  "roleParams": {},
+  "serviceName": "SLIDER",
+  "role": "SLIDER",
+  "commandParams": {
+    "version": "2.6.5.0-1235",
+    "command_timeout": "300",
+    "service_package_folder": "OOZIE",
+    "script_type": "PYTHON",
+    "script": "scripts/service_check.py",
+    "excluded_hosts": "host1,host2"
+  },
+  "taskId": 152,
+  "public_hostname": "c6401.ambari.apache.org",
+  "configurations": {
+    "slider-client": {
+      "slider.yarn.queue": "default"
+    },
+    "sqoop-site": {
+      "atlas.cluster.name": "c1",
+      "sqoop.job.data.publish.class": "org.apache.atlas.sqoop.hook.SqoopHook"
+    },
+    "mahout-env": {
+      "mahout_user": "mahout"
+    },
+    "hbase-env": {
+      "hbase_user": "hbase"
+    },
+    "yarn-env": {
+      "yarn_user": "yarn"
+    },
+    "mahout-log4j": {
+      "content": "\n            #\n            #\n            # Licensed to the Apache Software Foundation (ASF) under one\n            # or more contributor license agreements.  See the NOTICE file\n            # distributed with this work for additional information\n            # regarding copyright ownership.  The ASF licenses this file\n            # to you under the Apache License, Version 2.0 (the\n            # \"License\"); you may not use this file except in compliance\n            # with the License.  You may obtain a copy of the License at\n            #\n            #   http://www.apache.org/licenses/LICENSE-2.0\n            #\n            # Unless required by applicable law or agreed to in writing,\n            # software distributed under the License is distributed on an\n            # \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n            # KIND, either express or implied.  See the License for the\n            # specific language governing permissions a
 nd limitations\n            # under the License.\n            #\n            #\n            #\n\n            # Set everything to be logged to the console\n            log4j.rootCategory=WARN, console\n            log4j.appender.console=org.apache.log4j.ConsoleAppender\n            log4j.appender.console.target=System.err\n            log4j.appender.console.layout=org.apache.log4j.PatternLayout\n            log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n\n\n            # Settings to quiet third party logs that are too verbose\n            log4j.logger.org.eclipse.jetty=WARN\n            log4j.logger.org.apache.spark.repl.SparkIMain$exprTyper=WARN\n            log4j.logger.org.apache.spark.repl.SparkILoop$SparkILoopInterpreter=WARN"
+    },
+    "hadoop-env": {
+      "hdfs_user": "hdfs",
+      "hdfs_tmp_dir": "/tmp"
+    },
+    "core-site": {
+      "fs.defaultFS": "hdfs://c6401.ambari.apache.org:8020"
+    },
+    "hdfs-site": {
+      "a": "b"
+    },
+    "yarn-site": {
+      "yarn.application.classpath": "/etc/hadoop/conf,/usr/lib/hadoop/*,/usr/lib/hadoop/lib/*,/usr/lib/hadoop-hdfs/*,/usr/lib/hadoop-hdfs/lib/*,/usr/lib/hadoop-yarn/*,/usr/lib/hadoop-yarn/lib/*,/usr/lib/hadoop-mapreduce/*,/usr/lib/hadoop-mapreduce/lib/*",
+      "yarn.resourcemanager.address": "c6401.ambari.apache.org:8050",
+      "yarn.resourcemanager.scheduler.address": "c6401.ambari.apache.org:8030"
+    },
+    "cluster-env": {
+      "managed_hdfs_resource_property_names": "",
+      "security_enabled": "false",
+      "ignore_groupsusers_create": "false",
+      "smokeuser": "ambari-qa",
+      "kerberos_domain": "EXAMPLE.COM",
+      "user_group": "hadoop"
+    },
+    "webhcat-site": {
+      "templeton.jar": "/usr/hdp/current/hive-webhcat/share/webhcat/svr/lib/hive-webhcat-*.jar",
+      "templeton.pig.archive": "hdfs:///hdp/apps/{{ hdp_stack_version }}/pig/pig.tar.gz",
+      "templeton.hive.archive": "hdfs:///hdp/apps/{{ hdp_stack_version }}/hive/hive.tar.gz",
+      "templeton.sqoop.archive": "hdfs:///hdp/apps/{{ hdp_stack_version }}/sqoop/sqoop.tar.gz",
+      "templeton.streaming.jar": "hdfs:///hdp/apps/{{ hdp_stack_version }}/mr/hadoop-streaming.jar"
+    },
+    "slider-log4j": {
+      "content": "log4jproperties\nline2"
+    },
+    "slider-env": {
+      "content": "envproperties\nline2"
+    },
+    "gateway-site": {
+      "java.security.auth.login.config": "/etc/knox/conf/krb5JAASLogin.conf",
+      "gateway.hadoop.kerberos.secured": "false",
+      "gateway.gateway.conf.dir": "deployments",
+      "gateway.path": "gateway",
+      "sun.security.krb5.debug": "true",
+      "java.security.krb5.conf": "/etc/knox/conf/krb5.conf",
+      "gateway.port": "8443"
+    },
+
+    "users-ldif": {
+      "content": "\n            # Licensed to the Apache Software Foundation (ASF) under one\n            # or more contributor license agreements.  See the NOTICE file\n            # distributed with this work for additional information\n            # regarding copyright ownership.  The ASF licenses this file\n            # to you under the Apache License, Version 2.0 (the\n            # \"License\"); you may not use this file except in compliance\n            # with the License.  You may obtain a copy of the License at\n            #\n            #     http://www.apache.org/licenses/LICENSE-2.0\n            #\n            # Unless required by applicable law or agreed to in writing, software\n            # distributed under the License is distributed on an \"AS IS\" BASIS,\n            # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n            # See the License for the specific language governing permissions and\n            # limitations under the Lice
 nse.\n\n            version: 1\n\n            # Please replace with site specific values\n            dn: dc=hadoop,dc=apache,dc=org\n            objectclass: organization\n            objectclass: dcObject\n            o: Hadoop\n            dc: hadoop\n\n            # Entry for a sample people container\n            # Please replace with site specific values\n            dn: ou=people,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass:organizationalUnit\n            ou: people\n\n            # Entry for a sample end user\n            # Please replace with site specific values\n            dn: uid=guest,ou=people,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass:person\n            objectclass:organizationalPerson\n            objectclass:inetOrgPerson\n            cn: Guest\n            sn: User\n            uid: guest\n            userPassword:guest-password\n\n            # entry for sample user admin\n            dn: 
 uid=admin,ou=people,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass:person\n            objectclass:organizationalPerson\n            objectclass:inetOrgPerson\n            cn: Admin\n            sn: Admin\n            uid: admin\n            userPassword:admin-password\n\n            # entry for sample user sam\n            dn: uid=sam,ou=people,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass:person\n            objectclass:organizationalPerson\n            objectclass:inetOrgPerson\n            cn: sam\n            sn: sam\n            uid: sam\n            userPassword:sam-password\n\n            # entry for sample user tom\n            dn: uid=tom,ou=people,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass:person\n            objectclass:organizationalPerson\n            objectclass:inetOrgPerson\n            cn: tom\n            sn: tom\n            uid: tom\n            userPasswor
 d:tom-password\n\n            # create FIRST Level groups branch\n            dn: ou=groups,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass:organizationalUnit\n            ou: groups\n            description: generic groups branch\n\n            # create the analyst group under groups\n            dn: cn=analyst,ou=groups,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass: groupofnames\n            cn: analyst\n            description:analyst  group\n            member: uid=sam,ou=people,dc=hadoop,dc=apache,dc=org\n            member: uid=tom,ou=people,dc=hadoop,dc=apache,dc=org\n\n\n            # create the scientist group under groups\n            dn: cn=scientist,ou=groups,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass: groupofnames\n            cn: scientist\n            description: scientist group\n            member: uid=sam,ou=people,dc=hadoop,dc=apache,dc=org"
+    },
+
+    "topology": {
+      "content": "\n        <topology>\n\n            <gateway>\n\n                <provider>\n                    <role>authentication</role>\n                    <name>ShiroProvider</name>\n                    <enabled>true</enabled>\n                    <param>\n                        <name>sessionTimeout</name>\n                        <value>30</value>\n                    </param>\n                    <param>\n                        <name>main.ldapRealm</name>\n                        <value>org.apache.hadoop.gateway.shirorealm.KnoxLdapRealm</value>\n                    </param>\n                    <param>\n                        <name>main.ldapRealm.userDnTemplate</name>\n                        <value>uid={0},ou=people,dc=hadoop,dc=apache,dc=org</value>\n                    </param>\n                    <param>\n                        <name>main.ldapRealm.contextFactory.url</name>\n                        <value>ldap://{{knox_host_name}}:33389</value>\n                 
    </param>\n                    <param>\n                        <name>main.ldapRealm.contextFactory.authenticationMechanism</name>\n                        <value>simple</value>\n                    </param>\n                    <param>\n                        <name>urls./**</name>\n                        <value>authcBasic</value>\n                    </param>\n                </provider>\n\n                <provider>\n                    <role>identity-assertion</role>\n                    <name>Default</name>\n                    <enabled>true</enabled>\n                </provider>\n\n            </gateway>\n\n            <service>\n                <role>NAMENODE</role>\n                <url>hdfs://{{namenode_host}}:{{namenode_rpc_port}}</url>\n            </service>\n\n            <service>\n                <role>JOBTRACKER</role>\n                <url>rpc://{{rm_host}}:{{jt_rpc_port}}</url>\n            </service>\n\n            <service>\n                <role>WEBHDFS</role
 >\n                <url>http://{{namenode_host}}:{{namenode_http_port}}/webhdfs</url>\n            </service>\n\n            <service>\n                <role>WEBHCAT</role>\n                <url>http://{{webhcat_server_host}}:{{templeton_port}}/templeton</url>\n            </service>\n\n            <service>\n                <role>OOZIE</role>\n                <url>http://{{oozie_server_host}}:{{oozie_server_port}}/oozie</url>\n            </service>\n\n            <service>\n                <role>WEBHBASE</role>\n                <url>http://{{hbase_master_host}}:{{hbase_master_port}}</url>\n            </service>\n\n            <service>\n                <role>HIVE</role>\n                <url>http://{{hive_server_host}}:{{hive_http_port}}/{{hive_http_path}}</url>\n            </service>\n\n            <service>\n                <role>RESOURCEMANAGER</role>\n                <url>http://{{rm_host}}:{{rm_port}}/ws</url>\n            </service>\n        </topology>"
+    },
+
+    "ldap-log4j": {
+      "content": "\n        # Licensed to the Apache Software Foundation (ASF) under one\n        # or more contributor license agreements.  See the NOTICE file\n        # distributed with this work for additional information\n        # regarding copyright ownership.  The ASF licenses this file\n        # to you under the Apache License, Version 2.0 (the\n        # \"License\"); you may not use this file except in compliance\n        # with the License.  You may obtain a copy of the License at\n        #\n        #     http://www.apache.org/licenses/LICENSE-2.0\n        #\n        # Unless required by applicable law or agreed to in writing, software\n        # distributed under the License is distributed on an \"AS IS\" BASIS,\n        # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n        # See the License for the specific language governing permissions and\n        # limitations under the License.\n        #testing\n\n        app.log.dir=${launcher.dir
 }/../logs\n        app.log.file=${launcher.name}.log\n\n        log4j.rootLogger=ERROR, drfa\n        log4j.logger.org.apache.directory.server.ldap.LdapServer=INFO\n        log4j.logger.org.apache.directory=WARN\n\n        log4j.appender.stdout=org.apache.log4j.ConsoleAppender\n        log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\n        log4j.appender.stdout.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n\n\n        log4j.appender.drfa=org.apache.log4j.DailyRollingFileAppender\n        log4j.appender.drfa.File=${app.log.dir}/${app.log.file}\n        log4j.appender.drfa.DatePattern=.yyyy-MM-dd\n        log4j.appender.drfa.layout=org.apache.log4j.PatternLayout\n        log4j.appender.drfa.layout.ConversionPattern=%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n"
+    },
+
+    "gateway-log4j": {
+      "content": "\n\n      # Licensed to the Apache Software Foundation (ASF) under one\n      # or more contributor license agreements. See the NOTICE file\n      # distributed with this work for additional information\n      # regarding copyright ownership. The ASF licenses this file\n      # to you under the Apache License, Version 2.0 (the\n      # \"License\"); you may not use this file except in compliance\n      # with the License. You may obtain a copy of the License at\n      #\n      # http://www.apache.org/licenses/LICENSE-2.0\n      #\n      # Unless required by applicable law or agreed to in writing, software\n      # distributed under the License is distributed on an \"AS IS\" BASIS,\n      # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n      # See the License for the specific language governing permissions and\n      # limitations under the License.\n\n      app.log.dir=${launcher.dir}/../logs\n      app.log.file=${launcher.name}.log\n   
    app.audit.file=${launcher.name}-audit.log\n\n      log4j.rootLogger=ERROR, drfa\n\n      log4j.logger.org.apache.hadoop.gateway=INFO\n      #log4j.logger.org.apache.hadoop.gateway=DEBUG\n\n      #log4j.logger.org.eclipse.jetty=DEBUG\n      #log4j.logger.org.apache.shiro=DEBUG\n      #log4j.logger.org.apache.http=DEBUG\n      #log4j.logger.org.apache.http.client=DEBUG\n      #log4j.logger.org.apache.http.headers=DEBUG\n      #log4j.logger.org.apache.http.wire=DEBUG\n\n      log4j.appender.stdout=org.apache.log4j.ConsoleAppender\n      log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\n      log4j.appender.stdout.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n\n\n      log4j.appender.drfa=org.apache.log4j.DailyRollingFileAppender\n      log4j.appender.drfa.File=${app.log.dir}/${app.log.file}\n      log4j.appender.drfa.DatePattern=.yyyy-MM-dd\n      log4j.appender.drfa.layout=org.apache.log4j.PatternLayout\n      log4j.appender.drfa.layout.ConversionPattern=%
 d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n\n\n      log4j.logger.audit=INFO, auditfile\n      log4j.appender.auditfile=org.apache.log4j.DailyRollingFileAppender\n      log4j.appender.auditfile.File=${app.log.dir}/${app.audit.file}\n      log4j.appender.auditfile.Append = true\n      log4j.appender.auditfile.DatePattern = '.'yyyy-MM-dd\n      log4j.appender.auditfile.layout = org.apache.hadoop.gateway.audit.log4j.layout.AuditLayout"
+    },
+    "knox-env": {
+      "knox_master_secret": "sa",
+      "knox_group": "knox",
+      "knox_pid_dir": "/var/run/knox",
+      "knox_user": "knox"
+    },
+    "kafka-env": {
+      "kafka_user_nproc_limit": "65536",
+      "content": "\n#!/bin/bash\n\n# Set KAFKA specific environment variables here.\n\n# The java implementation to use.\nexport JAVA_HOME={{java64_home}}\nexport PATH=$PATH:$JAVA_HOME/bin\nexport PID_DIR={{kafka_pid_dir}}\nexport LOG_DIR={{kafka_log_dir}}\n{% if kerberos_security_enabled or kafka_other_sasl_enabled %}\nexport KAFKA_KERBEROS_PARAMS=\"-Djavax.security.auth.useSubjectCredsOnly=false {{kafka_kerberos_params}}\"\n{% else %}\nexport KAFKA_KERBEROS_PARAMS={{kafka_kerberos_params}}\n{% endif %}\n# Add kafka sink to classpath and related depenencies\nif [ -e \"/usr/lib/ambari-metrics-kafka-sink/ambari-metrics-kafka-sink.jar\" ]; then\n  export CLASSPATH=$CLASSPATH:/usr/lib/ambari-metrics-kafka-sink/ambari-metrics-kafka-sink.jar\n  export CLASSPATH=$CLASSPATH:/usr/lib/ambari-metrics-kafka-sink/lib/*\nfi\nif [ -f /etc/kafka/conf/kafka-ranger-env.sh ]; then\n. /etc/kafka/conf/kafka-ranger-env.sh\nfi",
+      "kafka_log_dir": "/var/log/kafka",
+      "kafka_pid_dir": "/var/run/kafka",
+      "kafka_user_nofile_limit": "128000",
+      "is_supported_kafka_ranger": "true",
+      "kafka_user": "kafka"
+    },
+    "kafka-log4j": {
+      "kafka_log_maxbackupindex": "20",
+      "content": "\n#\n#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements.  See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership.  The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License.  You may obtain a copy of the License at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied.  See the License for the\n# specific language governing permissions and limitations\n# under the License.\n#\n#\n#\nkafka.logs.dir=logs\n\nlog4j.rootLogger=INFO, stdout\n\nlog4j.appender.stdout=org.apache.log4j.ConsoleAppender\nlog4j.appender.stdout.layout=org.apache.log4j
 .PatternLayout\nlog4j.appender.stdout.layout.ConversionPattern=[%d] %p %m (%c)%n\n\nlog4j.appender.kafkaAppender=org.apache.log4j.DailyRollingFileAppender\nlog4j.appender.kafkaAppender.DatePattern='.'yyyy-MM-dd-HH\nlog4j.appender.kafkaAppender.File=${kafka.logs.dir}/server.log\nlog4j.appender.kafkaAppender.layout=org.apache.log4j.PatternLayout\nlog4j.appender.kafkaAppender.layout.ConversionPattern=[%d] %p %m (%c)%n\nlog4j.appender.kafkaAppender.MaxFileSize = {{kafka_log_maxfilesize}}MB\nlog4j.appender.kafkaAppender.MaxBackupIndex = {{kafka_log_maxbackupindex}}\n\nlog4j.appender.stateChangeAppender=org.apache.log4j.DailyRollingFileAppender\nlog4j.appender.stateChangeAppender.DatePattern='.'yyyy-MM-dd-HH\nlog4j.appender.stateChangeAppender.File=${kafka.logs.dir}/state-change.log\nlog4j.appender.stateChangeAppender.layout=org.apache.log4j.PatternLayout\nlog4j.appender.stateChangeAppender.layout.ConversionPattern=[%d] %p %m (%c)%n\n\nlog4j.appender.requestAppender=org.apache.log4j.Daily
 RollingFileAppender\nlog4j.appender.requestAppender.DatePattern='.'yyyy-MM-dd-HH\nlog4j.appender.requestAppender.File=${kafka.logs.dir}/kafka-request.log\nlog4j.appender.requestAppender.layout=org.apache.log4j.PatternLayout\nlog4j.appender.requestAppender.layout.ConversionPattern=[%d] %p %m (%c)%n\n\nlog4j.appender.cleanerAppender=org.apache.log4j.DailyRollingFileAppender\nlog4j.appender.cleanerAppender.DatePattern='.'yyyy-MM-dd-HH\nlog4j.appender.cleanerAppender.File=${kafka.logs.dir}/log-cleaner.log\nlog4j.appender.cleanerAppender.layout=org.apache.log4j.PatternLayout\nlog4j.appender.cleanerAppender.layout.ConversionPattern=[%d] %p %m (%c)%n\n\nlog4j.appender.controllerAppender=org.apache.log4j.DailyRollingFileAppender\nlog4j.appender.controllerAppender.DatePattern='.'yyyy-MM-dd-HH\nlog4j.appender.controllerAppender.File=${kafka.logs.dir}/controller.log\nlog4j.appender.controllerAppender.layout=org.apache.log4j.PatternLayout\nlog4j.appender.controllerAppender.layout.ConversionPatt
 ern=[%d] %p %m (%c)%n\nlog4j.appender.controllerAppender.MaxFileSize = {{controller_log_maxfilesize}}MB\nlog4j.appender.controllerAppender.MaxBackupIndex = {{controller_log_maxbackupindex}}\n# Turn on all our debugging info\n#log4j.logger.kafka.producer.async.DefaultEventHandler=DEBUG, kafkaAppender\n#log4j.logger.kafka.client.ClientUtils=DEBUG, kafkaAppender\n#log4j.logger.kafka.perf=DEBUG, kafkaAppender\n#log4j.logger.kafka.perf.ProducerPerformance$ProducerThread=DEBUG, kafkaAppender\n#log4j.logger.org.I0Itec.zkclient.ZkClient=DEBUG\nlog4j.logger.kafka=INFO, kafkaAppender\nlog4j.logger.kafka.network.RequestChannel$=WARN, requestAppender\nlog4j.additivity.kafka.network.RequestChannel$=false\n\n#log4j.logger.kafka.network.Processor=TRACE, requestAppender\n#log4j.logger.kafka.server.KafkaApis=TRACE, requestAppender\n#log4j.additivity.kafka.server.KafkaApis=false\nlog4j.logger.kafka.request.logger=WARN, requestAppender\nlog4j.additivity.kafka.request.logger=false\n\nlog4j.logger.kafka
 .controller=TRACE, controllerAppender\nlog4j.additivity.kafka.controller=false\n\nlog4j.logger.kafka.log.LogCleaner=INFO, cleanerAppender\nlog4j.additivity.kafka.log.LogCleaner=false\n\nlog4j.logger.state.change.logger=TRACE, stateChangeAppender\nlog4j.additivity.state.change.logger=false",
+      "kafka_log_maxfilesize": "256",
+      "controller_log_maxfilesize": "256",
+      "controller_log_maxbackupindex": "20"
+    },
+    "kafka-broker": {
+      "auto.leader.rebalance.enable": "true",
+      "kafka.ganglia.metrics.port": "8671",
+      "socket.send.buffer.bytes": "102400",
+      "num.network.threads": "3",
+      "log.segment.bytes": "1073741824",
+      "kafka.ganglia.metrics.host": "localhost",
+      "kafka.timeline.metrics.maxRowCacheSize": "10000",
+      "replica.lag.time.max.ms": "10000",
+      "num.io.threads": "8",
+      "offsets.retention.minutes": "86400000",
+      "fetch.purgatory.purge.interval.requests": "10000",
+      "offsets.topic.compression.codec": "0",
+      "default.replication.factor": "1",
+      "port": "6667",
+      "num.recovery.threads.per.data.dir": "1",
+      "kafka.metrics.reporters": "org.apache.hadoop.metrics2.sink.kafka.KafkaTimelineMetricsReporter",
+      "log.retention.bytes": "-1",
+      "producer.purgatory.purge.interval.requests": "10000",
+      "replica.lag.max.messages": "4000",
+      "replica.high.watermark.checkpoint.interval.ms": "5000",
+      "zookeeper.connect": "ydavis-kafka-ambari-upgrade-1.openstacklocal:2181",
+      "controlled.shutdown.retry.backoff.ms": "5000",
+      "sasl.enabled.mechanisms": "GSSAPI",
+      "kafka.timeline.metrics.reporter.sendInterval": "5900",
+      "num.partitions": "1",
+      "offsets.topic.segment.bytes": "104857600",
+      "replica.fetch.min.bytes": "1",
+      "zookeeper.sync.time.ms": "2000",
+      "offset.metadata.max.bytes": "4096",
+      "kafka.timeline.metrics.reporter.enabled": "true",
+      "kafka.timeline.metrics.truststore.type": "{{metric_truststore_type}}",
+      "controlled.shutdown.max.retries": "3",
+      "leader.imbalance.per.broker.percentage": "10",
+      "min.insync.replicas": "1",
+      "offsets.commit.required.acks": "-1",
+      "replica.fetch.wait.max.ms": "500",
+      "controlled.shutdown.enable": "true",
+      "log.roll.hours": "168",
+      "log.cleanup.interval.mins": "10",
+      "replica.socket.receive.buffer.bytes": "65536",
+      "kafka.ganglia.metrics.reporter.enabled": "true",
+      "kafka.timeline.metrics.truststore.path": "{{metric_truststore_path}}",
+      "zookeeper.connection.timeout.ms": "25000",
+      "delete.topic.enable": "false",
+      "offsets.load.buffer.size": "5242880",
+      "num.replica.fetchers": "1",
+      "socket.request.max.bytes": "104857600",
+      "message.max.bytes": "1000000",
+      "controller.message.queue.size": "10",
+      "kafka.ganglia.metrics.group": "kafka",
+      "compression.type": "producer",
+      "queued.max.requests": "500",
+      "log.index.interval.bytes": "4096",
+      "replica.fetch.max.bytes": "1048576",
+      "offsets.topic.num.partitions": "50",
+      "socket.receive.buffer.bytes": "102400",
+      "kafka.timeline.metrics.port": "{{metric_collector_port}}",
+      "offsets.commit.timeout.ms": "5000",
+      "offsets.topic.replication.factor": "3",
+      "external.kafka.metrics.include.prefix": "kafka.network.RequestMetrics.ResponseQueueTimeMs.request.OffsetCommit.98percentile,kafka.network.RequestMetrics.ResponseQueueTimeMs.request.Offsets.95percentile,kafka.network.RequestMetrics.ResponseSendTimeMs.request.Fetch.95percentile,kafka.network.RequestMetrics.RequestsPerSec.request",
+      "offsets.retention.check.interval.ms": "600000",
+      "log.index.size.max.bytes": "10485760",
+      "log.dirs": "/kafka-logs",
+      "listeners": "SASL_PLAINTEXT://localhost:6667",
+      "kafka.timeline.metrics.hosts": "{{ams_collector_hosts}}",
+      "controller.socket.timeout.ms": "30000",
+      "replica.socket.timeout.ms": "30000",
+      "zookeeper.session.timeout.ms": "30000",
+      "auto.create.topics.enable": "true",
+      "kafka.timeline.metrics.truststore.password": "{{metric_truststore_password}}",
+      "external.kafka.metrics.exclude.prefix": "kafka.network.RequestMetrics,kafka.server.DelayedOperationPurgatory,kafka.server.BrokerTopicMetrics.BytesRejectedPerSec,kafka.server.KafkaServer.ClusterId",
+      "leader.imbalance.check.interval.seconds": "300",
+      "sasl.mechanism.inter.broker.protocol": "GSSAPI",
+      "log.retention.hours": "168",
+      "kafka.timeline.metrics.protocol": "{{metric_collector_protocol}}"
+    },
+    "spark-defaults": {
+      "spark.yarn.applicationMaster.waitTries": "10",
+      "spark.history.kerberos.keytab": "none",
+      "spark.yarn.preserve.staging.files": "false",
+      "spark.yarn.submit.file.replication": "3",
+      "spark.history.kerberos.principal": "none",
+      "spark.yarn.driver.memoryOverhead": "384",
+      "spark.yarn.queue": "default",
+      "spark.yarn.containerLauncherMaxThreads": "25",
+      "spark.yarn.scheduler.heartbeat.interval-ms": "5000",
+      "spark.history.ui.port": "18080",
+      "spark.yarn.max.executor.failures": "3",
+      "spark.driver.extraJavaOptions": "",
+      "spark.history.provider": "org.apache.spark.deploy.yarn.history.YarnHistoryProvider",
+      "spark.yarn.am.extraJavaOptions": "",
+      "spark.yarn.executor.memoryOverhead": "384"
+    },
+    "spark-javaopts-properties": {
+      "content": " "
+    },
+    "spark-log4j-properties": {
+      "content": "\n# Set everything to be logged to the console\nlog4j.rootCategory=INFO, console\nlog4j.appender.console=org.apache.log4j.ConsoleAppender\nlog4j.appender.console.target=System.err\nlog4j.appender.console.layout=org.apache.log4j.PatternLayout\nlog4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n\n\n# Settings to quiet third party logs that are too verbose\nlog4j.logger.org.eclipse.jetty=WARN\nlog4j.logger.org.eclipse.jetty.util.component.AbstractLifeCycle=ERROR\nlog4j.logger.org.apache.spark.repl.SparkIMain$exprTyper=INFO\nlog4j.logger.org.apache.spark.repl.SparkILoop$SparkILoopInterpreter=INFO"
+    },
+    "spark-env": {
+      "content": "\n#!/usr/bin/env bash\n\n# This file is sourced when running various Spark programs.\n# Copy it as spark-env.sh and edit that to configure Spark for your site.\n\n# Options read in YARN client mode\n#SPARK_EXECUTOR_INSTANCES=\"2\" #Number of workers to start (Default: 2)\n#SPARK_EXECUTOR_CORES=\"1\" #Number of cores for the workers (Default: 1).\n#SPARK_EXECUTOR_MEMORY=\"1G\" #Memory per Worker (e.g. 1000M, 2G) (Default: 1G)\n#SPARK_DRIVER_MEMORY=\"512 Mb\" #Memory for Master (e.g. 1000M, 2G) (Default: 512 Mb)\n#SPARK_YARN_APP_NAME=\"spark\" #The name of your application (Default: Spark)\n#SPARK_YARN_QUEUE=\"~@~Xdefault~@~Y\" #The hadoop queue to use for allocation requests (Default: @~Xdefault~@~Y)\n#SPARK_YARN_DIST_FILES=\"\" #Comma separated list of files to be distributed with the job.\n#SPARK_YARN_DIST_ARCHIVES=\"\" #Comma separated list of archives to be distributed with the job.\n\n# Generic options for the daemons used in the standalone deploy mode\n\n# Alt
 ernate conf dir. (Default: ${SPARK_HOME}/conf)\nexport SPARK_CONF_DIR=${SPARK_HOME:-{{spark_home}}}/conf\n\n# Where log files are stored.(Default:${SPARK_HOME}/logs)\n#export SPARK_LOG_DIR=${SPARK_HOME:-{{spark_home}}}/logs\nexport SPARK_LOG_DIR={{spark_log_dir}}\n\n# Where the pid file is stored. (Default: /tmp)\nexport SPARK_PID_DIR={{spark_pid_dir}}\n\n# A string representing this instance of spark.(Default: $USER)\nSPARK_IDENT_STRING=$USER\n\n# The scheduling priority for daemons. (Default: 0)\nSPARK_NICENESS=0\n\nexport HADOOP_HOME=${HADOOP_HOME:-{{hadoop_home}}}\nexport HADOOP_CONF_DIR=${HADOOP_CONF_DIR:-{{hadoop_conf_dir}}}\n\n# The java implementation to use.\nexport JAVA_HOME={{java_home}}\n\nif [ -d \"/etc/tez/conf/\" ]; then\n  export TEZ_CONF_DIR=/etc/tez/conf\nelse\n  export TEZ_CONF_DIR=\nfi",
+      "spark_pid_dir": "/var/run/spark",
+      "spark_log_dir": "/var/log/spark",
+      "spark_group": "spark",
+      "spark_user": "spark"
+    },
+    "spark2-env": {
+      "content": "\n#!/usr/bin/env bash\n\n# This file is sourced when running various Spark programs.\n# Copy it as spark-env.sh and edit that to configure Spark for your site.\n\n# Options read in YARN client mode\n#SPARK_EXECUTOR_INSTANCES=\"2\" #Number of workers to start (Default: 2)\n#SPARK_EXECUTOR_CORES=\"1\" #Number of cores for the workers (Default: 1).\n#SPARK_EXECUTOR_MEMORY=\"1G\" #Memory per Worker (e.g. 1000M, 2G) (Default: 1G)\n#SPARK_DRIVER_MEMORY=\"512 Mb\" #Memory for Master (e.g. 1000M, 2G) (Default: 512 Mb)\n#SPARK_YARN_APP_NAME=\"spark\" #The name of your application (Default: Spark)\n#SPARK_YARN_QUEUE=\"~@~Xdefault~@~Y\" #The hadoop queue to use for allocation requests (Default: @~Xdefault~@~Y)\n#SPARK_YARN_DIST_FILES=\"\" #Comma separated list of files to be distributed with the job.\n#SPARK_YARN_DIST_ARCHIVES=\"\" #Comma separated list of archives to be distributed with the job.\n\n# Generic options for the daemons used in the standalone deploy mode\n\n# Alt
 ernate conf dir. (Default: ${SPARK_HOME}/conf)\nexport SPARK_CONF_DIR=${SPARK_HOME:-{{spark_home}}}/conf\n\n# Where log files are stored.(Default:${SPARK_HOME}/logs)\n#export SPARK_LOG_DIR=${SPARK_HOME:-{{spark_home}}}/logs\nexport SPARK_LOG_DIR={{spark_log_dir}}\n\n# Where the pid file is stored. (Default: /tmp)\nexport SPARK_PID_DIR={{spark_pid_dir}}\n\n# A string representing this instance of spark.(Default: $USER)\nSPARK_IDENT_STRING=$USER\n\n# The scheduling priority for daemons. (Default: 0)\nSPARK_NICENESS=0\n\nexport HADOOP_HOME=${HADOOP_HOME:-{{hadoop_home}}}\nexport HADOOP_CONF_DIR=${HADOOP_CONF_DIR:-{{hadoop_conf_dir}}}\n\n# The java implementation to use.\nexport JAVA_HOME={{java_home}}\n\nif [ -d \"/etc/tez/conf/\" ]; then\n  export TEZ_CONF_DIR=/etc/tez/conf\nelse\n  export TEZ_CONF_DIR=\nfi",
+      "spark_pid_dir": "/var/run/spark",
+      "spark_log_dir": "/var/log/spark",
+      "spark_group": "spark",
+      "spark_user": "spark"
+    },
+    "spark-metrics-properties": {
+      "content": "\n# syntax: [instance].sink|source.[name].[options]=[value]\n\n# This file configures Spark's internal metrics system. The metrics system is\n# divided into instances which correspond to internal components.\n# Each instance can be configured to report its metrics to one or more sinks.\n# Accepted values for [instance] are \"master\", \"worker\", \"executor\", \"driver\",\n# and \"applications\". A wild card \"*\" can be used as an instance name, in\n# which case all instances will inherit the supplied property.\n#\n# Within an instance, a \"source\" specifies a particular set of grouped metrics.\n# there are two kinds of sources:\n# 1. Spark internal sources, like MasterSource, WorkerSource, etc, which will\n# collect a Spark component's internal state. Each instance is paired with a\n# Spark source that is added automatically.\n# 2. Common sources, like JvmSource, which will collect low level state.\n# These can be added through configuration options and are then
  loaded\n# using reflection.\n#\n# A \"sink\" specifies where metrics are delivered to. Each instance can be\n# assigned one or more sinks.\n#\n# The sink|source field specifies whether the property relates to a sink or\n# source.\n#\n# The [name] field specifies the name of source or sink.\n#\n# The [options] field is the specific property of this source or sink. The\n# source or sink is responsible for parsing this property.\n#\n# Notes:\n# 1. To add a new sink, set the \"class\" option to a fully qualified class\n# name (see examples below).\n# 2. Some sinks involve a polling period. The minimum allowed polling period\n# is 1 second.\n# 3. Wild card properties can be overridden by more specific properties.\n# For example, master.sink.console.period takes precedence over\n# *.sink.console.period.\n# 4. A metrics specific configuration\n# \"spark.metrics.conf=${SPARK_HOME}/conf/metrics.properties\" should be\n# added to Java properties using -Dspark.metrics.conf=xxx if you want to\
 n# customize metrics system. You can also put the file in ${SPARK_HOME}/conf\n# and it will be loaded automatically.\n# 5. MetricsServlet is added by default as a sink in master, worker and client\n# driver, you can send http request \"/metrics/json\" to get a snapshot of all the\n# registered metrics in json format. For master, requests \"/metrics/master/json\" and\n# \"/metrics/applications/json\" can be sent seperately to get metrics snapshot of\n# instance master and applications. MetricsServlet may not be configured by self.\n#\n\n## List of available sinks and their properties.\n\n# org.apache.spark.metrics.sink.ConsoleSink\n# Name: Default: Description:\n# period 10 Poll period\n# unit seconds Units of poll period\n\n# org.apache.spark.metrics.sink.CSVSink\n# Name: Default: Description:\n# period 10 Poll period\n# unit seconds Units of poll period\n# directory /tmp Where to store CSV files\n\n# org.apache.spark.metrics.sink.GangliaSink\n# Name: Default: Description:\n# host N
 ONE Hostname or multicast group of Ganglia server\n# port NONE Port of Ganglia server(s)\n# period 10 Poll period\n# unit seconds Units of poll period\n# ttl 1 TTL of messages sent by Ganglia\n# mode multicast Ganglia network mode ('unicast' or 'multicast')\n\n# org.apache.spark.metrics.sink.JmxSink\n\n# org.apache.spark.metrics.sink.MetricsServlet\n# Name: Default: Description:\n# path VARIES* Path prefix from the web server root\n# sample false Whether to show entire set of samples for histograms ('false' or 'true')\n#\n# * Default path is /metrics/json for all instances except the master. The master has two paths:\n# /metrics/aplications/json # App information\n# /metrics/master/json # Master information\n\n# org.apache.spark.metrics.sink.GraphiteSink\n# Name: Default: Description:\n# host NONE Hostname of Graphite server\n# port NONE Port of Graphite server\n# period 10 Poll period\n# unit seconds Units of poll period\n# prefix EMPTY STRING Prefix to prepend to metric name\n\n##
  Examples\n# Enable JmxSink for all instances by class name\n#*.sink.jmx.class=org.apache.spark.metrics.sink.JmxSink\n\n# Enable ConsoleSink for all instances by class name\n#*.sink.console.class=org.apache.spark.metrics.sink.ConsoleSink\n\n# Polling period for ConsoleSink\n#*.sink.console.period=10\n\n#*.sink.console.unit=seconds\n\n# Master instance overlap polling period\n#master.sink.console.period=15\n\n#master.sink.console.unit=seconds\n\n# Enable CsvSink for all instances\n#*.sink.csv.class=org.apache.spark.metrics.sink.CsvSink\n\n# Polling period for CsvSink\n#*.sink.csv.period=1\n\n#*.sink.csv.unit=minutes\n\n# Polling directory for CsvSink\n#*.sink.csv.directory=/tmp/\n\n# Worker instance overlap polling period\n#worker.sink.csv.period=10\n\n#worker.sink.csv.unit=minutes\n\n# Enable jvm source for instance master, worker, driver and executor\n#master.source.jvm.class=org.apache.spark.metrics.source.JvmSource\n\n#worker.source.jvm.class=org.apache.spark.metrics.source.JvmSo
 urce\n\n#driver.source.jvm.class=org.apache.spark.metrics.source.JvmSource\n\n#executor.source.jvm.class=org.apache.spark.metrics.source.JvmSource"
+    },
+    "spark-metrics-properties": {
+      "content": "\n# syntax: [instance].sink|source.[name].[options]=[value]\n\n# This file configures Spark's internal metrics system. The metrics system is\n# divided into instances which correspond to internal components.\n# Each instance can be configured to report its metrics to one or more sinks.\n# Accepted values for [instance] are \"master\", \"worker\", \"executor\", \"driver\",\n# and \"applications\". A wild card \"*\" can be used as an instance name, in\n# which case all instances will inherit the supplied property.\n#\n# Within an instance, a \"source\" specifies a particular set of grouped metrics.\n# there are two kinds of sources:\n# 1. Spark internal sources, like MasterSource, WorkerSource, etc, which will\n# collect a Spark component's internal state. Each instance is paired with a\n# Spark source that is added automatically.\n# 2. Common sources, like JvmSource, which will collect low level state.\n# These can be added through configuration options and are then
  loaded\n# using reflection.\n#\n# A \"sink\" specifies where metrics are delivered to. Each instance can be\n# assigned one or more sinks.\n#\n# The sink|source field specifies whether the property relates to a sink or\n# source.\n#\n# The [name] field specifies the name of source or sink.\n#\n# The [options] field is the specific property of this source or sink. The\n# source or sink is responsible for parsing this property.\n#\n# Notes:\n# 1. To add a new sink, set the \"class\" option to a fully qualified class\n# name (see examples below).\n# 2. Some sinks involve a polling period. The minimum allowed polling period\n# is 1 second.\n# 3. Wild card properties can be overridden by more specific properties.\n# For example, master.sink.console.period takes precedence over\n# *.sink.console.period.\n# 4. A metrics specific configuration\n# \"spark.metrics.conf=${SPARK_HOME}/conf/metrics.properties\" should be\n# added to Java properties using -Dspark.metrics.conf=xxx if you want to\
 n# customize metrics system. You can also put the file in ${SPARK_HOME}/conf\n# and it will be loaded automatically.\n# 5. MetricsServlet is added by default as a sink in master, worker and client\n# driver, you can send http request \"/metrics/json\" to get a snapshot of all the\n# registered metrics in json format. For master, requests \"/metrics/master/json\" and\n# \"/metrics/applications/json\" can be sent seperately to get metrics snapshot of\n# instance master and applications. MetricsServlet may not be configured by self.\n#\n\n## List of available sinks and their properties.\n\n# org.apache.spark.metrics.sink.ConsoleSink\n# Name: Default: Description:\n# period 10 Poll period\n# unit seconds Units of poll period\n\n# org.apache.spark.metrics.sink.CSVSink\n# Name: Default: Description:\n# period 10 Poll period\n# unit seconds Units of poll period\n# directory /tmp Where to store CSV files\n\n# org.apache.spark.metrics.sink.GangliaSink\n# Name: Default: Description:\n# host N
 ONE Hostname or multicast group of Ganglia server\n# port NONE Port of Ganglia server(s)\n# period 10 Poll period\n# unit seconds Units of poll period\n# ttl 1 TTL of messages sent by Ganglia\n# mode multicast Ganglia network mode ('unicast' or 'multicast')\n\n# org.apache.spark.metrics.sink.JmxSink\n\n# org.apache.spark.metrics.sink.MetricsServlet\n# Name: Default: Description:\n# path VARIES* Path prefix from the web server root\n# sample false Whether to show entire set of samples for histograms ('false' or 'true')\n#\n# * Default path is /metrics/json for all instances except the master. The master has two paths:\n# /metrics/aplications/json # App information\n# /metrics/master/json # Master information\n\n# org.apache.spark.metrics.sink.GraphiteSink\n# Name: Default: Description:\n# host NONE Hostname of Graphite server\n# port NONE Port of Graphite server\n# period 10 Poll period\n# unit seconds Units of poll period\n# prefix EMPTY STRING Prefix to prepend to metric name\n\n##
  Examples\n# Enable JmxSink for all instances by class name\n#*.sink.jmx.class=org.apache.spark.metrics.sink.JmxSink\n\n# Enable ConsoleSink for all instances by class name\n#*.sink.console.class=org.apache.spark.metrics.sink.ConsoleSink\n\n# Polling period for ConsoleSink\n#*.sink.console.period=10\n\n#*.sink.console.unit=seconds\n\n# Master instance overlap polling period\n#master.sink.console.period=15\n\n#master.sink.console.unit=seconds\n\n# Enable CsvSink for all instances\n#*.sink.csv.class=org.apache.spark.metrics.sink.CsvSink\n\n# Polling period for CsvSink\n#*.sink.csv.period=1\n\n#*.sink.csv.unit=minutes\n\n# Polling directory for CsvSink\n#*.sink.csv.directory=/tmp/\n\n# Worker instance overlap polling period\n#worker.sink.csv.period=10\n\n#worker.sink.csv.unit=minutes\n\n# Enable jvm source for instance master, worker, driver and executor\n#master.source.jvm.class=org.apache.spark.metrics.source.JvmSource\n\n#worker.source.jvm.class=org.apache.spark.metrics.source.JvmSo
 urce\n\n#driver.source.jvm.class=org.apache.spark.metrics.source.JvmSource\n\n#executor.source.jvm.class=org.apache.spark.metrics.source.JvmSource"
+    },
+    "livy-log4j-properties": {
+      "content": "\n            # Set everything to be logged to the console\n            log4j.rootCategory=INFO, console\n            log4j.appender.console=org.apache.log4j.ConsoleAppender\n            log4j.appender.console.target=System.err\n            log4j.appender.console.layout=org.apache.log4j.PatternLayout\n            log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n\n\n            log4j.logger.org.eclipse.jetty=WARN"
+    },
+    "livy2-log4j-properties": {
+      "content": "\n            # Set everything to be logged to the console\n            log4j.rootCategory=INFO, console\n            log4j.appender.console=org.apache.log4j.ConsoleAppender\n            log4j.appender.console.target=System.err\n            log4j.appender.console.layout=org.apache.log4j.PatternLayout\n            log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n\n\n            log4j.logger.org.eclipse.jetty=WARN"
+    },
+    "livy-conf": {
+      "livy.server.port": "8998",
+      "livy.server.csrf_protection.enabled": "true",
+      "livy.environment": "production",
+      "livy.impersonation.enabled": "true",
+      "livy.server.session.timeout": "3600000"
+    },
+    "livy2-conf": {
+      "livy.server.port": "8999",
+      "livy.server.csrf_protection.enabled": "true",
+      "livy.environment": "production",
+      "livy.impersonation.enabled": "true",
+      "livy.server.session.timeout": "3600000"
+    },
+    "livy-spark-blacklist": {
+      "content": "\n            #\n            # Configuration override / blacklist. Defines a list of properties that users are not allowed\n            # to override when starting Spark sessions.\n            #\n            # This file takes a list of property names (one per line). Empty lines and lines starting with \"#\"\n            # are ignored.\n            #"
+    },
+    "livy2-spark-blacklist": {
+      "content": "\n            #\n            # Configuration override / blacklist. Defines a list of properties that users are not allowed\n            # to override when starting Spark sessions.\n            #\n            # This file takes a list of property names (one per line). Empty lines and lines starting with \"#\"\n            # are ignored.\n            #"
+    },
+    "livy-env": {
+      "livy_group": "livy",
+      "spark_home": "/usr/hdp/current/spark-client",
+      "content": "\n            #!/usr/bin/env bash\n\n            # - SPARK_HOME      Spark which you would like to use in livy\n            # - HADOOP_CONF_DIR Directory containing the Hadoop / YARN configuration to use.\n            # - LIVY_LOG_DIR    Where log files are stored.  (Default: ${LIVY_HOME}/logs)\n            # - LIVY_PID_DIR    Where the pid file is stored. (Default: /tmp)\n            # - LIVY_SERVER_JAVA_OPTS  Java Opts for running livy server (You can set jvm related setting here, like jvm memory/gc algorithm and etc.)\n        export SPARK_HOME=/usr/hdp/current/spark-client\n        export HADOOP_CONF_DIR=/etc/hadoop/conf\n        export LIVY_LOG_DIR={{livy_log_dir}}\n        export LIVY_PID_DIR={{livy_pid_dir}}\n        export LIVY_SERVER_JAVA_OPTS=\"-Xmx2g\"",
+      "livy_pid_dir": "/var/run/livy",
+      "livy_log_dir": "/var/log/livy",
+      "livy_user": "livy"
+    },
+    "livy2-env": {
+      "livy2_group": "livy",
+      "spark_home": "/usr/hdp/current/spark2-client",
+      "content": "\n            #!/usr/bin/env bash\n\n            # - SPARK_HOME      Spark which you would like to use in livy\n            # - HADOOP_CONF_DIR Directory containing the Hadoop / YARN configuration to use.\n            # - LIVY_LOG_DIR    Where log files are stored.  (Default: ${LIVY_HOME}/logs)\n            # - LIVY_PID_DIR    Where the pid file is stored. (Default: /tmp)\n            # - LIVY_SERVER_JAVA_OPTS  Java Opts for running livy server (You can set jvm related setting here, like jvm memory/gc algorithm and etc.)\n        export SPARK_HOME=/usr/hdp/current/spark2-client\n        export HADOOP_CONF_DIR=/etc/hadoop/conf\n        export LIVY_LOG_DIR={{livy_log_dir}}\n        export LIVY_PID_DIR={{livy_pid_dir}}\n        export LIVY_SERVER_JAVA_OPTS=\"-Xmx2g\"",
+      "livy2_pid_dir": "/var/run/livy2",
+      "livy2_log_dir": "/var/log/livy2",
+      "livy2_user": "livy"
+    },
+    "infra-solr-env": {
+      "infra_solr_znode": "/infra-solr",
+      "infra_solr_user": "solr",
+      "infra_solr_client_log_dir" :"/var/log/ambari-infra-solr-client"
+    },
+    "infra-solr-client-log4j" : {
+      "infra_solr_client_log_dir" : "/var/log/ambari-infra-solr-client",
+      "content" : "content"
+    },
+    "application-properties": {
+      "atlas.cluster.name" : "c2",
+      "atlas.rest.address": "http://c6401.ambari.apache.org:21000",
+      "atlas.graph.storage.backend": "berkeleyje",
+      "atlas.graph.storage.directory": "data/berkley",
+      "atlas.graph.index.search.backend": "solr5",
+      "atlas.graph.index.search.directory": "data/es",
+      "atlas.graph.index.search.elasticsearch.client-only": false,
+      "atlas.graph.index.search.elasticsearch.local-mode": true,
+      "atlas.lineage.hive.table.type.name": "Table",
+      "atlas.lineage.hive.column.type.name": "Column",
+      "atlas.lineage.hive.table.column.name": "columns",
+      "atlas.lineage.hive.process.type.name": "LoadProcess",
+      "atlas.lineage.hive.process.inputs.name": "inputTables",
+      "atlas.lineage.hive.process.outputs.name": "outputTables",
+      "atlas.enableTLS": false,
+      "atlas.authentication.method": "simple",
+      "atlas.authentication.principal": "atlas",
+      "atlas.authentication.keytab": "/etc/security/keytabs/atlas.service.keytab",
+      "atlas.http.authentication.enabled": false,
+      "atlas.http.authentication.type": "simple",
+      "atlas.http.authentication.kerberos.principal": "HTTP/_HOST@EXAMPLE.COM",
+      "atlas.http.authentication.kerberos.keytab": "/etc/security/keytabs/spnego.service.keytab",
+      "atlas.http.authentication.kerberos.name.rules": "DEFAULT",
+      "atlas.server.http.port" : "21000",
+      "atlas.notification.embedded" : false,
+      "atlas.kafka.bootstrap.servers" : "c6401.ambari.apache.org:6667",
+      "atlas.kafka.data" : "/usr/hdp/current/atlas-server/data/kafka",
+      "atlas.kafka.entities.group.id" : "entities",
+      "atlas.kafka.hook.group.id" : "atlas",
+      "atlas.kafka.zookeeper.connect" : "c6401.ambari.apache.org:2181"
+    },
+    "atlas-env": {
+      "content": "# The java implementation to use. If JAVA_HOME is not found we expect java and jar to be in path\nexport JAVA_HOME={{java64_home}}\n# any additional java opts you want to set. This will apply to both client and server operations\nexport METADATA_OPTS={{metadata_opts}}\n# metadata configuration directory\nexport METADATA_CONF={{conf_dir}}\n# Where log files are stored. Defatult is logs directory under the base install location\nexport METADATA_LOG_DIR={{log_dir}}\n# additional classpath entries\nexport METADATACPPATH={{metadata_classpath}}\n# data dir\nexport METADATA_DATA_DIR={{data_dir}}\n# Where do you want to expand the war file. By Default it is in /server/webapp dir under the base install dir.\nexport METADATA_EXPANDED_WEBAPP_DIR={{expanded_war_dir}}",
+      "metadata_user": "atlas",
+      "metadata_port": 21000,
+      "metadata_pid_dir": "/var/run/atlas",
+      "metadata_log_dir": "/var/log/atlas",
+      "metadata_data_dir": "/var/lib/atlas/data",
+      "metadata_expanded_war_dir": "/var/lib/atlas/server/webapp"
+    },
+    "atlas-log4j": {
+      "content": "<property><name>content</name><description>Custom log4j.properties</description><value></value></property>",
+      "atlas_log_level": "debug",
+      "audit_log_level": "OFF"
+    },
+    "atlas-solrconfig": {
+      "content": "<property><name>content</name><description>Custom solrconfig properties</description><value></value></property>"
+    },
+    "zeppelin-env": {
+      "zeppelin.server.kerberos.keytab": "", 
+      "shiro_ini_content": "\n[users]\n# List of users with their password allowed to access Zeppelin.\n# To use a different strategy (LDAP / Database / ...) check the shiro doc at http://shiro.apache.org/configuration.html#Configuration-INISections\n#admin = password1\n#user1 = password2, role1, role2\n#user2 = password3, role3\n#user3 = password4, role2\n\n# Sample LDAP configuration, for user Authentication, currently tested for single Realm\n[main]\n#ldapRealm = org.apache.shiro.realm.ldap.JndiLdapRealm\n#ldapRealm.userDnTemplate = uid={0},cn=users,cn=accounts,dc=hortonworks,dc=com\n#ldapRealm.contextFactory.url = ldap://ldaphost:389\n#ldapRealm.contextFactory.authenticationMechanism = SIMPLE\n#sessionManager = org.apache.shiro.web.session.mgt.DefaultWebSessionManager\n#securityManager.sessionManager = $sessionManager\n# 86,400,000 milliseconds = 24 hour\n#securityManager.sessionManager.globalSessionTimeout = 86400000\nshiro.loginUrl = /api/login\n\n[urls]\n# anon means the acce
 ss is anonymous.\n# authcBasic means Basic Auth Security\n# To enfore security, comment the line below and uncomment the next one\n/api/version = anon\n/** = anon\n#/** = authc", 
+      "zeppelin.spark.jar.dir": "/apps/zeppelin", 
+      "zeppelin.executor.mem": "512m", 
+      "zeppelin_pid_dir": "/var/run/zeppelin", 
+      "zeppelin.executor.instances": "2", 
+      "log4j_properties_content": "\nlog4j.rootLogger = INFO, dailyfile\nlog4j.appender.stdout = org.apache.log4j.ConsoleAppender\nlog4j.appender.stdout.layout = org.apache.log4j.PatternLayout\nlog4j.appender.stdout.layout.ConversionPattern=%5p [%d] ({%t} %F[%M]:%L) - %m%n\nlog4j.appender.dailyfile.DatePattern=.yyyy-MM-dd\nlog4j.appender.dailyfile.Threshold = INFO\nlog4j.appender.dailyfile = org.apache.log4j.DailyRollingFileAppender\nlog4j.appender.dailyfile.File = ${zeppelin.log.file}\nlog4j.appender.dailyfile.layout = org.apache.log4j.PatternLayout\nlog4j.appender.dailyfile.layout.ConversionPattern=%5p [%d] ({%t} %F[%M]:%L) - %m%n",
+      "zeppelin.server.kerberos.principal": "", 
+      "zeppelin_user": "zeppelin", 
+      "zeppelin_env_content": "\n# Spark master url. eg. spark://master_addr:7077. Leave empty if you want to use local mode\nexport MASTER=yarn-client\nexport SPARK_YARN_JAR={{spark_jar}}\n\n\n# Where log files are stored.  PWD by default.\nexport ZEPPELIN_LOG_DIR={{zeppelin_log_dir}}\n\n# The pid files are stored. /tmp by default.\nexport ZEPPELIN_PID_DIR={{zeppelin_pid_dir}}\n\n\nexport JAVA_HOME={{java64_home}}\n\n# Additional jvm options. for example, export ZEPPELIN_JAVA_OPTS=\"-Dspark.executor.memory=8g -Dspark.cores.max=16\"\nexport ZEPPELIN_JAVA_OPTS=\"-Dhdp.version={{full_stack_version}} -Dspark.executor.memory={{executor_mem}} -Dspark.executor.instances={{executor_instances}} -Dspark.yarn.queue={{spark_queue}}\"\n\n\n# Zeppelin jvm mem options Default -Xmx1024m -XX:MaxPermSize=512m\n# export ZEPPELIN_MEM\n\n# zeppelin interpreter process jvm mem options. Defualt = ZEPPELIN_MEM\n# export ZEPPELIN_INTP_MEM\n\n# zeppelin interpreter process jvm options. Default = ZEPPELIN_JA
 VA_OPTS\n# export ZEPPELIN_INTP_JAVA_OPTS\n\n# Where notebook saved\n# export ZEPPELIN_NOTEBOOK_DIR\n\n# Id of notebook to be displayed in homescreen. ex) 2A94M5J1Z\n# export ZEPPELIN_NOTEBOOK_HOMESCREEN\n\n# hide homescreen notebook from list when this value set to \"true\". default \"false\"\n# export ZEPPELIN_NOTEBOOK_HOMESCREEN_HIDE\n\n# Bucket where notebook saved\n# export ZEPPELIN_NOTEBOOK_S3_BUCKET\n\n# User in bucket where notebook saved. For example bucket/user/notebook/2A94M5J1Z/note.json\n# export ZEPPELIN_NOTEBOOK_S3_USER\n\n# A string representing this instance of zeppelin. $USER by default\n# export ZEPPELIN_IDENT_STRING\n\n# The scheduling priority for daemons. Defaults to 0.\n# export ZEPPELIN_NICENESS\n\n\n#### Spark interpreter configuration ####\n\n## Use provided spark installation ##\n## defining SPARK_HOME makes Zeppelin run spark interpreter process using spark-submit\n##\n# (required) When it is defined, load it instead of Zeppelin embedded Spark libraries\n
 export SPARK_HOME={{spark_home}}\n\n# (optional) extra options to pass to spark submit. eg) \"--driver-memory 512M --executor-memory 1G\".\n# export SPARK_SUBMIT_OPTIONS\n\n## Use embedded spark binaries ##\n## without SPARK_HOME defined, Zeppelin still able to run spark interpreter process using embedded spark binaries.\n## however, it is not encouraged when you can define SPARK_HOME\n##\n# Options read in YARN client mode\n# yarn-site.xml is located in configuration directory in HADOOP_CONF_DIR.\nexport HADOOP_CONF_DIR=/etc/hadoop/conf\n\n# Pyspark (supported with Spark 1.2.1 and above)\n# To configure pyspark, you need to set spark distribution's path to 'spark.home' property in Interpreter setting screen in Zeppelin GUI\n# path to the python command. must be the same path on the driver(Zeppelin) and all workers.\n# export PYSPARK_PYTHON\n\nexport PYTHONPATH=\"${SPARK_HOME}/python:${SPARK_HOME}/python/lib/py4j-0.8.2.1-src.zip\"\nexport SPARK_YARN_USER_ENV=\"PYTHONPATH=${PYTHONPAT
 H}\"\n\n## Spark interpreter options ##\n##\n# Use HiveContext instead of SQLContext if set true. true by default.\n# export ZEPPELIN_SPARK_USEHIVECONTEXT\n\n# Execute multiple SQL concurrently if set true. false by default.\n# export ZEPPELIN_SPARK_CONCURRENTSQL\n\n# Max number of SparkSQL result to display. 1000 by default.\n# export ZEPPELIN_SPARK_MAXRESULT", 
+      "zeppelin_log_dir": "/var/log/zeppelin", 
+      "zeppelin_group": "zeppelin"
+    },
+"zeppelin-config": {
+            "zeppelin.server.port": "9995",
+            "zeppelin.server.ssl.port": "9995",
+            "zeppelin.ssl.truststore.password": "change me", 
+            "zeppelin.interpreters": "org.apache.zeppelin.spark.SparkInterpreter,org.apache.zeppelin.spark.PySparkInterpreter,org.apache.zeppelin.spark.SparkSqlInterpreter,org.apache.zeppelin.spark.DepInterpreter,org.apache.zeppelin.markdown.Markdown,org.apache.zeppelin.angular.AngularInterpreter,org.apache.zeppelin.shell.ShellInterpreter,org.apache.zeppelin.jdbc.JDBCInterpreter,org.apache.zeppelin.phoenix.PhoenixInterpreter,org.apache.zeppelin.livy.LivySparkInterpreter,org.apache.zeppelin.livy.LivyPySparkInterpreter,org.apache.zeppelin.livy.LivySparkRInterpreter,org.apache.zeppelin.livy.LivySparkSQLInterpreter",
+            "zeppelin.interpreter.group.order": "spark,angular,jdbc,livy,md,sh",
+            "zeppelin.ssl.truststore.path": "conf/truststore", 
+            "zeppelin.notebook.dir": "notebook", 
+            "zeppelin.ssl.keystore.password": "change me", 
+            "zeppelin.ssl.keystore.path": "conf/keystore", 
+            "zeppelin.server.addr": "0.0.0.0", 
+            "zeppelin.ssl.client.auth": "false", 
+            "zeppelin.notebook.homescreen": " ", 
+            "zeppelin.interpreter.dir": "interpreter", 
+            "zeppelin.ssl.keystore.type": "JKS", 
+            "zeppelin.notebook.s3.user": "user", 
+            "zeppelin.ssl.key.manager.password": "change me", 
+            "zeppelin.anonymous.allowed": "true", 
+            "zeppelin.ssl.truststore.type": "JKS", 
+            "zeppelin.ssl": "false", 
+            "zeppelin.notebook.storage": "org.apache.zeppelin.notebook.repo.VFSNotebookRepo", 
+            "zeppelin.websocket.max.text.message.size": "1024000", 
+            "zeppelin.interpreter.connect.timeout": "30000", 
+            "zeppelin.notebook.s3.bucket": "zeppelin", 
+            "zeppelin.notebook.homescreen.hide": "false", 
+            "zeppelin.server.allowed.origins": "*"
+        },
+    "zoo.cfg": {
+      "clientPort": "2181"
+    },
+    "ranger-hbase-plugin-properties": {
+      "ranger-hbase-plugin-enabled":"yes"
+    },
+    "ranger-hive-plugin-properties": {
+      "ranger-hive-plugin-enabled":"yes"
+    },
+    "ranger-env": {
+      "xml_configurations_supported" : "true"
+    },
+    "tagsync-application-properties": {
+            "atlas.kafka.hook.group.id": "atlas",
+            "atlas.kafka.zookeeper.connect": "os-mv-31-dev-4.novalocal:2181",
+            "atlas.kafka.acks": "1",
+            "atlas.kafka.entities.group.id": "ranger_entities_consumer",
+            "atlas.kafka.data": "/usr/hdp/current/atlas-server/data/kafka",
+            "atlas.kafka.bootstrap.servers": "localhost:2181",
+            "atlas.notification.embedded": "false"
+    },
+    "ranger-tagsync-site": {
+            "ranger.tagsync.sink.impl.class": "org.apache.ranger.tagsync.sink.tagadmin.TagAdminRESTSink",
+            "ranger.tagsync.atlasrestsource.endpoint": "",
+            "ranger.tagsync.tagadmin.rest.ssl.config.file": "/usr/hdp/current/ranger-tagsync/conf/mytruststore.jks",
+            "ranger.tagsync.logdir": "/var/log/ranger/tagsync",
+            "ranger.tagsync.filesource.filename": "/usr/hdp/current/ranger-tagsync/conf/etc/ranger/data/tags.json",
+            "ranger.tagsync.enabled": "true",
+            "ranger.tagsync.tagadmin.rest.url": "{{ranger_external_url}}",
+            "ranger.tagsync.atlasrestsource.download.interval": "",
+            "ranger.tagsync.filesource.modtime.check.interval": "60000",
+            "ranger.tagsync.tagadmin.password": "rangertagsync",
+            "ranger.tagsync.source.impl.class": "file",
+            "ranger.tagsync.source.atlas.custom.resource.mappers": "",
+            "ranger.tagsync.tagadmin.alias": "tagsync.tagadmin",
+            "ranger.tagsync.tagadmin.keystore": "/usr/hdp/current/ranger-tagsync/conf/rangertagsync.jceks",
+            "ranger.tagsync.atlas.to.service.mapping": ""
+    },
+    "druid-env": {
+      "druid_log_dir" : "/var/log/druid",
+      "druid_pid_dir" : "/var/run/druid",
+      "content" : "#!/bin/bash\n # Set DRUID specific environment variables here.\n# The java implementation to use\nexport JAVA_HOME={{java8_home}}\nexport PATH=$PATH:$JAVA_HOME/bin\nexport DRUID_PID_DIR={{druid_pid_dir}}\nexport DRUID_LOG_DIR={{druid_log_dir}}\nexport DRUID_CONF_DIR={{druid_conf_dir}}\nexport DRUID_LIB_DIR={{druid_home}}/lib",
+      "druid.coordinator.jvm.heap.memory" : 1024,
+      "druid.coordinator.jvm.direct.memory": 2048,
+      "druid.coordinator.jvm.opts": "-Duser.timezone=UTC -Dfile.encoding=UTF-8",
+      "druid.broker.jvm.heap.memory" : 1024,
+      "druid.broker.jvm.direct.memory": 2048,
+      "druid.broker.jvm.opts": "-Duser.timezone=UTC -Dfile.encoding=UTF-8",
+      "druid.middlemanager.jvm.heap.memory" : 1024,
+      "druid.middlemanager.jvm.direct.memory": 2048,
+      "druid.middlemanager.jvm.opts": "-Duser.timezone=UTC -Dfile.encoding=UTF-8",
+      "druid.historical.jvm.heap.memory" : 1024,
+      "druid.historical.jvm.direct.memory": 2048,
+      "druid.historical.jvm.opts": "-Duser.timezone=UTC -Dfile.encoding=UTF-8",
+      "druid.overlord.jvm.heap.memory" : 1024,
+      "druid.overlord.jvm.direct.memory": 2048,
+      "druid.overlord.jvm.opts": "-Duser.timezone=UTC -Dfile.encoding=UTF-8",
+      "druid.router.jvm.heap.memory" : 1024,
+      "druid.router.jvm.direct.memory": 2048,
+      "druid.router.jvm.opts": "-Duser.timezone=UTC -Dfile.encoding=UTF-8",
+      "druid_user": "druid"
+    },
+    "druid-common" : {
+      "druid.metadata.storage.type" : "mysql",
+      "druid.metadata.storage.connector.connectURI" : "jdbc:mysql://my-db-host:3306/druid?createDatabaseIfNotExist=true",
+      "druid.metadata.storage.connector.user" : "druid",
+      "druid.metadata.storage.connector.password" : "diurd",
+      "druid.storage.type" : "hdfs",
+      "druid.storage.storageDirectory" : "/user/druid/data",
+      "druid.indexer.logs.type": "hdfs",
+      "druid.indexer.logs.directory": "/user/druid/logs",
+      "druid.extensions.pullList": "[\"custom-druid-extension\"]",
+      "druid.extensions.repositoryList": "[\"http://custom-mvn-repo/public/release\"]",
+      "druid.extensions.loadList": "[\"mysql-metadata-storage\", \"druid-datasketches\"]",
+      "druid.security.extensions.loadList": "[\"druid-kerberos\"]"
+    },
+    "druid-historical" : {
+      "druid.segmentCache.infoDir" : "/apps/druid/segmentCache/info_dir",
+      "druid.segmentCache.locations" :"[{\"path\":\"/apps/druid/segmentCache\",\"maxSize\":300000000000}]"
+    },
+    "druid-coordinator" : {
+      "druid.service" : "druid/coordinator"
+    },
+    "druid-overlord" : {
+      "druid.service" : "druid/overlord"
+    },
+    "druid-broker" : {
+      "druid.service" : "druid/broker"
+    },
+    "druid-middlemanager" : {
+      "druid.service" : "druid/middlemanager",
+      "druid.indexer.task.hadoopWorkingPath" : "/tmp/druid-indexing",
+      "druid.indexer.task.baseTaskDir" : "/apps/druid/tasks"
+    },
+    "druid-router" : {
+      "druid.service" : "druid/router"
+    },
+    "druid-log4j" : {
+      "content" : "<![CDATA[<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one\n  ~ or more contributor license agreements.  See the NOTICE file\n  ~ distributed with this work for additional information\n  ~ regarding copyright ownership.  The ASF licenses this file\n  ~ to you under the Apache License, Version 2.0 (the\n  ~ \"License\"); you may not use this file except in compliance\n  ~ with the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n    <Configuration>\n        <Appenders>\n            <Console name=\"Console\
 " target=\"SYSTEM_OUT\">\n                <PatternLayout pattern=\"%d{ISO8601} %p [%t] %c - %m%n\"/>\n            </Console>\n        </Appenders>\n        <Loggers>\n            <Logger name=\"com.metamx\" level=\"{{metamx_log_level}}\"/>\n            <Logger name=\"io.druid\" level=\"{{druid_log_level}}\"/>\n            <Root level=\"{{root_log_level}}\">\n                <AppenderRef ref=\"Console\"/>\n            </Root>\n        </Loggers>\n    </Configuration>\n      ]]>\n"
+    },
+    "druid-logrotate" : {
+      "content" : "<![CDATA[\n    {{druid_log_dir}}/*.log {\n        copytruncate\n        rotate 7\n        daily\n        nocompress\n        missingok\n        notifempty\n        create 660 druid users\n        dateext\n        dateformat -%Y-%m-%d-%s\n        }\n      ]]>\n"
+    },
+    "superset" : {
+      "SUPERSET_DATABASE_TYPE" : "sqllite"
+    }
+  },
+  "configuration_attributes": {
+    "sqoop-site": {},
+    "yarn-site": {
+      "final": {
+        "yarn.nodemanager.disk-health-checker.min-healthy-disks": "true",
+        "yarn.nodemanager.container-executor.class": "true",
+        "yarn.nodemanager.local-dirs": "true"
+      }
+    },
+    "yarn-site": {
+      "final": {
+        "is_supported_yarn_ranger": "true"
+      }
+    },
+    "hdfs-site": {
+      "final": {
+        "dfs.web.ugi": "true",
+        "dfs.support.append": "true",
+        "dfs.cluster.administrators": "true"
+      }
+    },
+    "core-site": {
+      "final": {
+        "hadoop.proxyuser.hive.groups": "true",
+        "webinterface.private.actions": "true",
+        "hadoop.proxyuser.oozie.hosts": "true"
+      }
+    },
+    "knox-env": {},
+    "gateway-site": {},
+    "users-ldif": {},
+    "kafka-env": {},
+    "kafka-log4j": {},
+    "kafka-broker": {},
+    "metadata-env": {},
+    "atlas-hbase-site": {},
+    "tagsync-application-properties": {},
+    "ranger-tagsync-site": {}
+  },
+  "configurationTags": {
+    "slider-client": {
+      "tag": "version1"
+    },
+    "slider-log4j": {
+      "tag": "version1"
+    },
+    "slider-env": {
+      "tag": "version1"
+    },
+    "core-site": {
+      "tag": "version1"
+    },
+    "hdfs-site": {
+      "tag": "version1"
+    },
+    "yarn-site": {
+      "tag": "version1"
+    },
+    "gateway-site": {
+      "tag": "version1"
+    },
+    "topology": {
+      "tag": "version1"
+    },
+    "users-ldif": {
+      "tag": "version1"
+    },
+    "kafka-env": {
+      "tag": "version1"
+    },
+    "kafka-log4j": {
+      "tag": "version1"
+    },
+    "kafka-broker": {
+      "tag": "version1"
+    },
+    "metadata-env": {
+      "tag": "version1"
+    },
+    "tagsync-application-properties": {
+      "tag": "version1"
+    },
+    "ranger-tagsync-site": {
+      "tag": "version1"
+    }
+  },
+  "commandId": "7-1",
+  "clusterHostInfo": {
+    "ambari_server_host": [
+      "c6401.ambari.apache.org"
+    ],
+    "all_ping_ports": [
+      "8670",
+      "8670"
+    ],
+    "rm_host": [
+      "c6402.ambari.apache.org"
+    ],
+    "all_hosts": [
+      "c6401.ambari.apache.org",
+      "c6402.ambari.apache.org"
+    ],
+    "knox_gateway_hosts": [
+      "jaimin-knox-1.c.pramod-thangali.internal"
+    ],
+    "kafka_broker_hosts": [
+      "c6401.ambari.apache.org"
+    ],
+    "infra_solr_hosts": [
+      "c6401.ambari.apache.org"
+    ],
+    "zookeeper_hosts": [
+      "c6401.ambari.apache.org"
+    ],
+    "ranger_tagsync_hosts": [
+      "c6401.ambari.apache.org"
+    ],
+    "atlas_server_hosts": [
+      "c6401.ambari.apache.org"
+    ],
+    "zeppelin_master_hosts": [
+      "c6401.ambari.apache.org"
+    ]
+  }
+}


[23/29] ambari git commit: AMBARI-22568 - Oozie Fails To Restart During Upgrade Because of Missing ExtJS Library (jonathanhurley)

Posted by rl...@apache.org.
AMBARI-22568 - Oozie Fails To Restart During Upgrade Because of Missing ExtJS Library (jonathanhurley)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/da8f54e0
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/da8f54e0
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/da8f54e0

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: da8f54e0da11c4b5c5d6669484d30bb4b2e9dfae
Parents: 3a802ae
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Thu Nov 30 15:24:24 2017 -0500
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Fri Dec 1 08:51:24 2017 -0500

----------------------------------------------------------------------
 .../libraries/functions/constants.py            | 11 +++--
 .../package/scripts/oozie_server_upgrade.py     | 24 ++++++++--
 .../package/scripts/oozie_server_upgrade.py     | 50 +++++++++++++++-----
 .../HDP/2.0.6/properties/stack_features.json    |  6 +++
 .../HDP/3.0/properties/stack_features.json      |  6 +++
 .../stacks/2.0.6/OOZIE/test_oozie_server.py     | 24 ++++++++--
 6 files changed, 95 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/da8f54e0/ambari-common/src/main/python/resource_management/libraries/functions/constants.py
----------------------------------------------------------------------
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"

http://git-wip-us.apache.org/repos/asf/ambari/blob/da8f54e0/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_server_upgrade.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_server_upgrade.py b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_server_upgrade.py
index 23b39ef..2826e80 100644
--- a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_server_upgrade.py
+++ b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_server_upgrade.py
@@ -28,6 +28,7 @@ from resource_management.core.resources.system import File
 from resource_management.libraries.functions import Direction
 from resource_management.libraries.functions import format
 from resource_management.libraries.functions import stack_select
+from resource_management.libraries.functions import lzo_utils
 from resource_management.libraries.functions.oozie_prepare_war import prepare_war
 from resource_management.libraries.script.script import Script
 from resource_management.libraries.functions import StackFeature
@@ -52,7 +53,8 @@ class OozieUpgrade(Script):
     import params
 
     # some stack versions don't need the lzo compression libraries
-    target_version_needs_compression_libraries = params.version and check_stack_feature(StackFeature.LZO, params.version)
+    target_version_needs_compression_libraries = check_stack_feature(StackFeature.LZO,
+      params.version_for_stack_feature_checks)
 
     # ensure the directory exists
     Directory(params.oozie_libext_dir, mode = 0777)
@@ -66,6 +68,9 @@ class OozieUpgrade(Script):
     # When a version is Installed, it is responsible for downloading the hadoop-lzo packages
     # if lzo is enabled.
     if params.lzo_enabled and (params.upgrade_direction == Direction.UPGRADE or target_version_needs_compression_libraries):
+      # ensure that the LZO files are installed for this version of Oozie
+      lzo_utils.install_lzo_if_needed()
+
       hadoop_lzo_pattern = 'hadoop-lzo*.jar'
       hadoop_client_new_lib_dir = format("{stack_root}/{version}/hadoop/lib")
 
@@ -86,6 +91,12 @@ class OozieUpgrade(Script):
         raise Fail("There are no files at {0} matching {1}".format(
           hadoop_client_new_lib_dir, hadoop_lzo_pattern))
 
+    # ExtJS is used to build a working Oozie Web UI - without it, Oozie will startup and work
+    # but will not have a functioning user interface - Some stacks no longer ship ExtJS,
+    # so it's optional now. On an upgrade, we should make sure that if it's not found, that's OK
+    # However, if it is found on the system (from an earlier install) then it should be used
+    extjs_included = check_stack_feature(StackFeature.OOZIE_EXTJS_INCLUDED, params.version_for_stack_feature_checks)
+
     # something like <stack-root>/current/oozie-server/libext/ext-2.2.zip
     oozie_ext_zip_target_path = os.path.join(params.oozie_libext_dir, params.ext_js_file)
 
@@ -104,14 +115,17 @@ class OozieUpgrade(Script):
           Logger.info("Copying {0} to {1}".format(source_ext_zip_path, params.oozie_libext_dir))
           Execute(("cp", source_ext_zip_path, params.oozie_libext_dir), sudo=True)
           Execute(("chown", format("{oozie_user}:{user_group}"), oozie_ext_zip_target_path), sudo=True)
-          File(oozie_ext_zip_target_path,
-               mode=0644
-               )
+          File(oozie_ext_zip_target_path, mode=0644)
           break
 
-    if not found_at_least_one_oozie_ext_file:
+    # ExtJS was expected to the be on the system, but was not found
+    if extjs_included and not found_at_least_one_oozie_ext_file:
       raise Fail("Unable to find any Oozie source extension files from the following paths {0}".format(source_ext_zip_paths))
 
+    # ExtJS is not expected, so it's OK - just log a warning
+    if not found_at_least_one_oozie_ext_file:
+      Logger.warning("Unable to find ExtJS in any of the following paths. The Oozie UI will not be available. Source Paths: {0}".format(source_ext_zip_paths))
+
     # Redownload jdbc driver to a new current location
     oozie.download_database_library_if_needed()
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/da8f54e0/ambari-server/src/main/resources/common-services/OOZIE/4.2.0.3.0/package/scripts/oozie_server_upgrade.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.2.0.3.0/package/scripts/oozie_server_upgrade.py b/ambari-server/src/main/resources/common-services/OOZIE/4.2.0.3.0/package/scripts/oozie_server_upgrade.py
index 402c7cb..2826e80 100644
--- a/ambari-server/src/main/resources/common-services/OOZIE/4.2.0.3.0/package/scripts/oozie_server_upgrade.py
+++ b/ambari-server/src/main/resources/common-services/OOZIE/4.2.0.3.0/package/scripts/oozie_server_upgrade.py
@@ -28,6 +28,7 @@ from resource_management.core.resources.system import File
 from resource_management.libraries.functions import Direction
 from resource_management.libraries.functions import format
 from resource_management.libraries.functions import stack_select
+from resource_management.libraries.functions import lzo_utils
 from resource_management.libraries.functions.oozie_prepare_war import prepare_war
 from resource_management.libraries.script.script import Script
 from resource_management.libraries.functions import StackFeature
@@ -41,7 +42,7 @@ BACKUP_CONF_ARCHIVE = "oozie-conf-backup.tar"
 class OozieUpgrade(Script):
 
   @staticmethod
-  def prepare_libext_directory():
+  def prepare_libext_directory(upgrade_type=None):
     """
     Performs the following actions on libext:
       - creates <stack-root>/current/oozie/libext and recursively
@@ -52,7 +53,8 @@ class OozieUpgrade(Script):
     import params
 
     # some stack versions don't need the lzo compression libraries
-    target_version_needs_compression_libraries = params.version and check_stack_feature(StackFeature.LZO, params.version)
+    target_version_needs_compression_libraries = check_stack_feature(StackFeature.LZO,
+      params.version_for_stack_feature_checks)
 
     # ensure the directory exists
     Directory(params.oozie_libext_dir, mode = 0777)
@@ -66,6 +68,9 @@ class OozieUpgrade(Script):
     # When a version is Installed, it is responsible for downloading the hadoop-lzo packages
     # if lzo is enabled.
     if params.lzo_enabled and (params.upgrade_direction == Direction.UPGRADE or target_version_needs_compression_libraries):
+      # ensure that the LZO files are installed for this version of Oozie
+      lzo_utils.install_lzo_if_needed()
+
       hadoop_lzo_pattern = 'hadoop-lzo*.jar'
       hadoop_client_new_lib_dir = format("{stack_root}/{version}/hadoop/lib")
 
@@ -86,21 +91,40 @@ class OozieUpgrade(Script):
         raise Fail("There are no files at {0} matching {1}".format(
           hadoop_client_new_lib_dir, hadoop_lzo_pattern))
 
-    # copy ext ZIP to libext dir
-    oozie_ext_zip_file = params.ext_js_path
+    # ExtJS is used to build a working Oozie Web UI - without it, Oozie will startup and work
+    # but will not have a functioning user interface - Some stacks no longer ship ExtJS,
+    # so it's optional now. On an upgrade, we should make sure that if it's not found, that's OK
+    # However, if it is found on the system (from an earlier install) then it should be used
+    extjs_included = check_stack_feature(StackFeature.OOZIE_EXTJS_INCLUDED, params.version_for_stack_feature_checks)
 
     # something like <stack-root>/current/oozie-server/libext/ext-2.2.zip
     oozie_ext_zip_target_path = os.path.join(params.oozie_libext_dir, params.ext_js_file)
 
-    if not os.path.isfile(oozie_ext_zip_file):
-      raise Fail("Unable to copy {0} because it does not exist".format(oozie_ext_zip_file))
-
-    Logger.info("Copying {0} to {1}".format(oozie_ext_zip_file, params.oozie_libext_dir))
-    Execute(("cp", oozie_ext_zip_file, params.oozie_libext_dir), sudo=True)
-    Execute(("chown", format("{oozie_user}:{user_group}"), oozie_ext_zip_target_path), sudo=True)
-    File(oozie_ext_zip_target_path,
-         mode=0644
-    )
+    # Copy ext ZIP to libext dir
+    # Default to /usr/share/$TARGETSTACK-oozie/ext-2.2.zip as the first path
+    source_ext_zip_paths = oozie.get_oozie_ext_zip_source_paths(upgrade_type, params)
+
+    found_at_least_one_oozie_ext_file = False
+
+    # Copy the first oozie ext-2.2.zip file that is found.
+    # This uses a list to handle the cases when migrating from some versions of BigInsights to HDP.
+    if source_ext_zip_paths is not None:
+      for source_ext_zip_path in source_ext_zip_paths:
+        if os.path.isfile(source_ext_zip_path):
+          found_at_least_one_oozie_ext_file = True
+          Logger.info("Copying {0} to {1}".format(source_ext_zip_path, params.oozie_libext_dir))
+          Execute(("cp", source_ext_zip_path, params.oozie_libext_dir), sudo=True)
+          Execute(("chown", format("{oozie_user}:{user_group}"), oozie_ext_zip_target_path), sudo=True)
+          File(oozie_ext_zip_target_path, mode=0644)
+          break
+
+    # ExtJS was expected to the be on the system, but was not found
+    if extjs_included and not found_at_least_one_oozie_ext_file:
+      raise Fail("Unable to find any Oozie source extension files from the following paths {0}".format(source_ext_zip_paths))
+
+    # ExtJS is not expected, so it's OK - just log a warning
+    if not found_at_least_one_oozie_ext_file:
+      Logger.warning("Unable to find ExtJS in any of the following paths. The Oozie UI will not be available. Source Paths: {0}".format(source_ext_zip_paths))
 
     # Redownload jdbc driver to a new current location
     oozie.download_database_library_if_needed()

http://git-wip-us.apache.org/repos/asf/ambari/blob/da8f54e0/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json b/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json
index 2109a5d..6d622ec 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json
@@ -452,6 +452,12 @@
         "name": "kafka_extended_sasl_support",
         "description": "Support SASL PLAIN and GSSAPI",
         "min_version": "2.6.5.0"
+      },
+      {
+        "name": "oozie_extjs_included",
+        "description": "ExtJS is included in the repository and automatically installed by Ambari",
+        "min_version": "2.2.0.0",
+        "max_version": "2.6.0.0"
       }
     ]
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/da8f54e0/ambari-server/src/main/resources/stacks/HDP/3.0/properties/stack_features.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/3.0/properties/stack_features.json b/ambari-server/src/main/resources/stacks/HDP/3.0/properties/stack_features.json
index afd5183..68d81dc 100644
--- a/ambari-server/src/main/resources/stacks/HDP/3.0/properties/stack_features.json
+++ b/ambari-server/src/main/resources/stacks/HDP/3.0/properties/stack_features.json
@@ -367,6 +367,12 @@
         "name": "atlas_hdfs_site_on_namenode_ha",
         "description": "Need to create hdfs-site under atlas-conf dir when Namenode-HA is enabled.",
         "min_version": "2.6.0.0"
+      },
+      {
+        "name": "oozie_extjs_included",
+        "description": "ExtJS is included in the repository and automatically installed by Ambari",
+        "min_version": "2.2.0.0",
+        "max_version": "2.6.0.0"
       }
     ]
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/da8f54e0/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py b/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py
index 4d94723..10a83d6 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py
@@ -28,7 +28,10 @@ from resource_management.libraries import functions
 from resource_management.libraries.providers.hdfs_resource import WebHDFSUtil
 import tempfile
 
-@patch.object(Script, 'format_package_name', new = MagicMock())
+def format_package_name_side_effect(name):
+  return name.replace("${stack_version}", "1_2_3_4")
+
+@patch.object(Script, 'format_package_name', new = MagicMock(side_effect=format_package_name_side_effect))
 @patch("platform.linux_distribution", new = MagicMock(return_value="Linux"))
 @patch.object(WebHDFSUtil, "run_command", new=MagicMock(return_value={}))
 @patch.object(tempfile, "gettempdir", new=MagicMock(return_value="/tmp"))
@@ -1178,8 +1181,7 @@ class TestOozieServer(RMFTestCase):
   @patch("glob.iglob")
   @patch("shutil.copy2", new = MagicMock())
   @patch("resource_management.core.sudo.path_isdir", new = MagicMock(return_value = True))
-  def test_upgrade(self, glob_mock, remove_mock,
-      isfile_mock, exists_mock, isdir_mock):
+  def test_upgrade(self, glob_mock, remove_mock, isfile_mock, exists_mock, isdir_mock):
 
     def exists_mock_side_effect(path):
       if path == '/tmp/oozie-upgrade-backup/oozie-conf-backup.tar':
@@ -1217,6 +1219,9 @@ class TestOozieServer(RMFTestCase):
       sudo = True )
 
     self.assertResourceCalled('Directory', '/usr/hdp/current/oozie-server/libext', mode = 0777)
+    self.assertResourceCalled('Package', ('lzo'), retry_count=5, retry_on_repo_unavailability= False)
+    self.assertResourceCalled('Package', ('hadooplzo_1_2_3_4'), retry_count = 5, retry_on_repo_unavailability = False)
+    self.assertResourceCalled('Package', ('hadooplzo_1_2_3_4-native'), retry_count = 5, retry_on_repo_unavailability = False)
     self.assertResourceCalled('Execute', ('cp', '/usr/share/HDP-oozie/ext-2.2.zip', '/usr/hdp/current/oozie-server/libext'), sudo=True)
     self.assertResourceCalled('Execute', ('chown', 'oozie:hadoop', '/usr/hdp/current/oozie-server/libext/ext-2.2.zip'), sudo=True)
     self.assertResourceCalled('File', '/usr/hdp/current/oozie-server/libext/ext-2.2.zip', mode = 0644)
@@ -1278,6 +1283,10 @@ class TestOozieServer(RMFTestCase):
 
     self.assertResourceCalled('Directory', '/usr/hdp/current/oozie-server/libext', mode = 0777)
 
+    self.assertResourceCalled('Package', ('lzo'), retry_count=5, retry_on_repo_unavailability= False)
+    self.assertResourceCalled('Package', ('hadooplzo_1_2_3_4'), retry_count = 5, retry_on_repo_unavailability = False)
+    self.assertResourceCalled('Package', ('hadooplzo_1_2_3_4-native'), retry_count = 5, retry_on_repo_unavailability = False)
+
     self.assertResourceCalled('Execute', ('cp', '/usr/share/HDP-oozie/ext-2.2.zip', '/usr/hdp/current/oozie-server/libext'), sudo=True)
     self.assertResourceCalled('Execute', ('chown', 'oozie:hadoop', '/usr/hdp/current/oozie-server/libext/ext-2.2.zip'), sudo=True)
     self.assertResourceCalled('File', '/usr/hdp/current/oozie-server/libext/ext-2.2.zip', mode = 0644)
@@ -1346,6 +1355,10 @@ class TestOozieServer(RMFTestCase):
 
     self.assertResourceCalled('Directory', '/usr/hdp/current/oozie-server/libext', mode = 0777)
 
+    self.assertResourceCalled('Package', ('lzo'), retry_count=5, retry_on_repo_unavailability= False)
+    self.assertResourceCalled('Package', ('hadooplzo_1_2_3_4'), retry_count = 5, retry_on_repo_unavailability = False)
+    self.assertResourceCalled('Package', ('hadooplzo_1_2_3_4-native'), retry_count = 5, retry_on_repo_unavailability = False)
+
     self.assertResourceCalled('Execute', ('cp', '/usr/share/HDP-oozie/ext-2.2.zip', '/usr/hdp/current/oozie-server/libext'), sudo=True)
     self.assertResourceCalled('Execute', ('chown', 'oozie:hadoop', '/usr/hdp/current/oozie-server/libext/ext-2.2.zip'), sudo=True)
     self.assertResourceCalled('File', '/usr/hdp/current/oozie-server/libext/ext-2.2.zip', mode = 0644)
@@ -1383,6 +1396,7 @@ class TestOozieServer(RMFTestCase):
     self.assertResourceCalled('Execute', ('ambari-python-wrap', '/usr/bin/hdp-select', 'set', 'oozie-server', u'2.2.0.0-0000'), sudo = True)
 
     self.assertResourceCalled('Directory', '/usr/hdp/current/oozie-server/libext',mode = 0777)
+
     self.assertResourceCalled('Execute', ('cp', '/usr/share/HDP-oozie/ext-2.2.zip', '/usr/hdp/current/oozie-server/libext'), sudo=True)
     self.assertResourceCalled('Execute', ('chown', 'oozie:hadoop', '/usr/hdp/current/oozie-server/libext/ext-2.2.zip'), sudo=True)
     self.assertResourceCalled('File', '/usr/hdp/current/oozie-server/libext/ext-2.2.zip',mode = 0644)
@@ -1581,6 +1595,10 @@ class TestOozieServer(RMFTestCase):
 
     self.assertResourceCalled('Directory', '/usr/hdp/current/oozie-server/libext', mode = 0777)
 
+    self.assertResourceCalled('Package', ('lzo'), retry_count=5, retry_on_repo_unavailability= False)
+    self.assertResourceCalled('Package', ('hadooplzo_1_2_3_4'), retry_count = 5, retry_on_repo_unavailability = False)
+    self.assertResourceCalled('Package', ('hadooplzo_1_2_3_4-native'), retry_count = 5, retry_on_repo_unavailability = False)
+
     self.assertResourceCalled('Execute', ('cp', '/usr/share/HDP-oozie/ext-2.2.zip', '/usr/hdp/current/oozie-server/libext'), sudo=True)
     self.assertResourceCalled('Execute', ('chown', 'oozie:hadoop', '/usr/hdp/current/oozie-server/libext/ext-2.2.zip'), sudo=True)
 


[03/29] ambari git commit: AMBARI-22550. Service install/start failure due to wrong version directory

Posted by rl...@apache.org.
AMBARI-22550. Service install/start failure due to wrong version directory


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/19e6518d
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/19e6518d
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/19e6518d

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 19e6518d42170a33ca2e0161ec2d3abb5190f976
Parents: ff08592
Author: Doroszlai, Attila <ad...@hortonworks.com>
Authored: Wed Nov 29 19:02:32 2017 +0100
Committer: Doroszlai, Attila <ad...@hortonworks.com>
Committed: Thu Nov 30 09:02:46 2017 +0100

----------------------------------------------------------------------
 .../actionmanager/ExecutionCommandWrapper.java       |  5 +++++
 .../actionmanager/ExecutionCommandWrapperTest.java   | 15 +++++++++++++--
 2 files changed, 18 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/19e6518d/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapper.java b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapper.java
index 7b693cd..191e86c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapper.java
@@ -297,7 +297,12 @@ public class ExecutionCommandWrapper {
       if (null != repositoryVersion) {
         // only set the version if it's not set and this is NOT an install
         // command
+        // Some stack scripts use version for path purposes.  Sending unresolved version first (for
+        // blueprints) and then resolved one would result in various issues: duplicate directories
+        // (/hdp/apps/2.6.3.0 + /hdp/apps/2.6.3.0-235), parent directory not found, and file not
+        // found, etc.  Hence requiring repositoryVersion to be resolved.
         if (!commandParams.containsKey(VERSION)
+          && repositoryVersion.isResolved()
           && executionCommand.getRoleCommand() != RoleCommand.INSTALL) {
           commandParams.put(VERSION, repositoryVersion.getVersion());
         }

http://git-wip-us.apache.org/repos/asf/ambari/blob/19e6518d/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapperTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapperTest.java b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapperTest.java
index fb84df5..f12c701 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapperTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapperTest.java
@@ -312,8 +312,7 @@ public class ExecutionCommandWrapperTest {
     commandParams = processedExecutionCommand.getCommandParams();
     Assert.assertFalse(commandParams.containsKey(KeyNames.VERSION));
 
-    // now try with a START command which should populate the version even
-    // though the state is INSTALLING
+    // now try with a START command, but still unresolved
     executionCommand = new ExecutionCommand();
     commandParams = new HashMap<>();
 
@@ -334,6 +333,17 @@ public class ExecutionCommandWrapperTest {
 
     processedExecutionCommand = execCommWrap.getExecutionCommand();
     commandParams = processedExecutionCommand.getCommandParams();
+    Assert.assertFalse(commandParams.containsKey(KeyNames.VERSION));
+
+    // now that the repositoryVersion is resolved, it should populate the version even
+    // though the state is INSTALLING
+    repositoryVersion.setResolved(true);
+    ormTestHelper.repositoryVersionDAO.merge(repositoryVersion);
+    execCommWrap = new ExecutionCommandWrapper(json);
+    injector.injectMembers(execCommWrap);
+
+    processedExecutionCommand = execCommWrap.getExecutionCommand();
+    commandParams = processedExecutionCommand.getCommandParams();
     Assert.assertEquals("0.1-0000", commandParams.get(KeyNames.VERSION));
     }
 
@@ -346,6 +356,7 @@ public class ExecutionCommandWrapperTest {
 
     StackId stackId = cluster.getDesiredStackVersion();
     RepositoryVersionEntity repositoryVersion = ormTestHelper.getOrCreateRepositoryVersion(stackId, "0.1-0000");
+    repositoryVersion.setResolved(true); // has build number
     Service service = cluster.getService("HDFS");
     service.setDesiredRepositoryVersion(repositoryVersion);
 


[26/29] ambari git commit: AMBARI-22572. During cluster installation bower cannot resolve angularjs version (alexantonenko)

Posted by rl...@apache.org.
AMBARI-22572. During cluster installation bower cannot resolve angularjs version (alexantonenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/88b59a66
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/88b59a66
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/88b59a66

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 88b59a6641a0b177f39e32c725acf04d85477c01
Parents: 943aa71
Author: Alex Antonenko <aa...@hortonworks.com>
Authored: Fri Dec 1 20:33:50 2017 +0300
Committer: Alex Antonenko <aa...@hortonworks.com>
Committed: Fri Dec 1 20:33:50 2017 +0300

----------------------------------------------------------------------
 ambari-admin/src/main/resources/ui/admin-web/bower.json | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/88b59a66/ambari-admin/src/main/resources/ui/admin-web/bower.json
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/bower.json b/ambari-admin/src/main/resources/ui/admin-web/bower.json
index c9e67f0..5bbada9 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/bower.json
+++ b/ambari-admin/src/main/resources/ui/admin-web/bower.json
@@ -19,5 +19,8 @@
     "chai": "1.8.0",
     "mocha": "1.14.0",
     "sinon": "1.10.3"
+  },
+  "resolutions": {
+    "angular": "1.5.11"
   }
 }


[11/29] ambari git commit: AMBARI-22505 : Kafka service check fails when using a non-root user in kerberized environment (ydavis via mradhakrishnan)

Posted by rl...@apache.org.
AMBARI-22505 : Kafka service check fails when using a non-root user in kerberized environment (ydavis via mradhakrishnan)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/21e37b16
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/21e37b16
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/21e37b16

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 21e37b164f87edeb21b7533af1558e4758d5ee60
Parents: d342949
Author: Madhuvanthi Radhakrishnan <mr...@hortonworks.com>
Authored: Thu Nov 30 11:31:51 2017 -0800
Committer: Madhuvanthi Radhakrishnan <mr...@hortonworks.com>
Committed: Thu Nov 30 11:31:51 2017 -0800

----------------------------------------------------------------------
 .../KAFKA/0.8.1/package/scripts/service_check.py     | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/21e37b16/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/service_check.py b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/service_check.py
index cb66f98..38a7f24 100644
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/service_check.py
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/service_check.py
@@ -19,8 +19,10 @@ limitations under the License.
 """
 from resource_management.libraries.script.script import Script
 from resource_management.libraries.functions.validate import call_and_match_output
+from resource_management.core import shell
 from resource_management.libraries.functions.format import format
 from resource_management.core.logger import Logger
+from resource_management.core.exceptions import Fail
 from resource_management.core import sudo
 import subprocess
 
@@ -31,15 +33,20 @@ class ServiceCheck(Script):
 
     # TODO, Kafka Service check should be more robust , It should get all the broker_hosts
     # Produce some messages and check if consumer reads same no.of messages.
-    
+
     kafka_config = self.read_kafka_config()
     topic = "ambari_kafka_service_check"
     create_topic_cmd_created_output = "Created topic \"ambari_kafka_service_check\"."
     create_topic_cmd_exists_output = "Topic \"ambari_kafka_service_check\" already exists."
     source_cmd = format("source {conf_dir}/kafka-env.sh")
-    topic_exists_cmd = format("{kafka_home}/bin/kafka-topics.sh --zookeeper {kafka_config[zookeeper.connect]} --topic {topic} --list")
-    topic_exists_cmd_p = subprocess.Popen(topic_exists_cmd.split(" "), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
-    topic_exists_cmd_out, topic_exists_cmd_err = topic_exists_cmd_p.communicate()
+    topic_exists_cmd = format(source_cmd + " ; " + "{kafka_home}/bin/kafka-topics.sh --zookeeper {kafka_config[zookeeper.connect]} --topic {topic} --list")
+    topic_exists_cmd_code, topic_exists_cmd_out = shell.call(topic_exists_cmd, logoutput=True, quiet=False, user=params.kafka_user)
+
+    if topic_exists_cmd_code > 0:
+      raise Fail("Error encountered when attempting to list topics: {0}".format(topic_exists_cmd_out))
+
+
+  # run create topic command only if the topic doesn't exists
     
     delete_topic_cmd = format("{kafka_home}/bin/kafka-topics.sh --zookeeper {kafka_config[zookeeper.connect]} --delete --topic {topic}")
     create_topic_cmd = format("{kafka_home}/bin/kafka-topics.sh --zookeeper {kafka_config[zookeeper.connect]} --create --topic {topic} --partitions 1 --replication-factor 1")


[29/29] ambari git commit: Merge branch 'trunk' into branch-feature-AMBARI-20859

Posted by rl...@apache.org.
Merge branch 'trunk' into branch-feature-AMBARI-20859


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b6cf4325
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b6cf4325
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b6cf4325

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: b6cf4325ef29a7928131d415432c9bb7271621d5
Parents: 44ed90e 959ad90
Author: Robert Levas <rl...@hortonworks.com>
Authored: Fri Dec 1 16:40:26 2017 -0500
Committer: Robert Levas <rl...@hortonworks.com>
Committed: Fri Dec 1 16:40:26 2017 -0500

----------------------------------------------------------------------
 .../resources/ui/admin-web/app/scripts/app.js   |   2 +-
 .../stackVersions/StackVersionsCreateCtrl.js    |  28 +-
 .../stackVersions/StackVersionsEditCtrl.js      |   2 +-
 .../ui/admin-web/app/scripts/services/Stack.js  |   3 +-
 .../ui/admin-web/app/styles/toggle-switch.css   |  72 +++
 .../app/views/ambariViews/modals/create.html    |   3 +-
 .../app/views/authentication/main.html          |   6 +-
 .../views/loginActivities/homeDirectory.html    |   6 +-
 .../app/views/loginActivities/loginMessage.html |   6 +-
 .../userManagement/modals/groupCreate.html      |   3 +-
 .../views/userManagement/modals/userCreate.html |  11 +-
 .../app/views/userManagement/userEdit.html      |  12 +-
 .../src/main/resources/ui/admin-web/bower.json  |  11 +-
 .../main/resources/ui/admin-web/package.json    |   2 +-
 .../core/providers/package/__init__.py          |  15 +
 .../core/providers/package/yumrpm.py            | 108 ++++
 .../libraries/functions/constants.py            |  12 +-
 .../libraries/functions/lzo_utils.py            |   6 +-
 .../action-menu/action-menu.component.less      |   3 -
 .../action-menu/action-menu.component.ts        |   4 -
 .../audit-logs-table.component.html             |   8 +-
 .../dropdown-button.component.html              |   4 +-
 .../dropdown-button.component.less              |  17 +-
 .../dropdown-button.component.ts                |   3 +
 .../filters-panel/filters-panel.component.html  |  14 +-
 .../filters-panel/filters-panel.component.less  |  11 +-
 .../filters-panel/filters-panel.component.ts    |  21 +-
 .../menu-button/menu-button.component.less      |  13 +-
 .../src/app/components/mixins.less              |  17 +
 .../pagination/pagination.component.html        |   4 +-
 .../search-box/search-box.component.html        |   2 +-
 .../search-box/search-box.component.less        |  18 +-
 .../search-box/search-box.component.ts          |  38 +-
 .../service-logs-table.component.html           |   7 +-
 .../service-logs-table.component.less           |   1 -
 .../components/top-menu/top-menu.component.html |   7 +-
 .../components/top-menu/top-menu.component.less |   4 +
 .../top-menu/top-menu.component.spec.ts         |  64 +-
 .../components/top-menu/top-menu.component.ts   |  25 +-
 .../src/app/components/variables.less           |   3 +-
 .../src/app/services/logs-container.service.ts  |  11 +-
 .../src/assets/i18n/en.json                     |   2 +-
 .../ambari-logsearch-web/webpack.config.js      |  20 +-
 .../ambari-metrics-hadoop-sink/pom.xml          |   4 +-
 .../actionmanager/ExecutionCommandWrapper.java  |   5 +
 .../server/api/handlers/CreateHandler.java      |   8 +-
 .../server/api/handlers/UpdateHandler.java      |   8 +-
 .../resources/ResourceInstanceFactoryImpl.java  |   4 +-
 ...ootServiceComponentConfigurationService.java |  15 +
 .../api/services/ldap/AmbariConfiguration.java  |  46 --
 .../api/services/ldap/LdapConfigOperation.java  |  43 --
 .../services/ldap/LdapConfigurationRequest.java |  49 --
 .../services/ldap/LdapConfigurationService.java | 185 ------
 .../api/services/ldap/LdapRequestInfo.java      |  61 --
 .../services/serializers/JsonSerializer.java    |  38 +-
 .../commands/StackAdvisorCommand.java           |  14 +-
 .../AmbariManagementControllerImpl.java         |  80 +--
 .../server/controller/RepositoryRequest.java    |  22 +-
 .../AmbariServerConfigurationCategory.java      |  69 ++
 .../AmbariServerConfigurationHandler.java       | 110 ++++
 .../AmbariServerLDAPConfigurationHandler.java   | 172 +++++
 .../internal/HostResourceProvider.java          |  54 +-
 .../internal/OperationStatusMetaData.java       |  90 +++
 .../internal/RepositoryResourceProvider.java    |   3 +-
 ...ootServiceComponentConfigurationHandler.java | 114 ++++
 ...iceComponentConfigurationHandlerFactory.java |  54 ++
 ...eComponentConfigurationResourceProvider.java | 243 +++----
 .../apache/ambari/server/ldap/LdapModule.java   |   4 -
 .../ldap/domain/AmbariLdapConfigKeys.java       |  83 ---
 .../ldap/domain/AmbariLdapConfiguration.java    |  85 +--
 .../domain/AmbariLdapConfigurationFactory.java  |  34 -
 .../domain/AmbariLdapConfigurationKeys.java     |  83 +++
 .../AmbariLdapConfigurationProvider.java        |  19 +-
 .../server/ldap/service/AmbariLdapFacade.java   |   4 +-
 .../ambari/server/ldap/service/LdapFacade.java  |   9 +-
 .../DefaultLdapAttributeDetectionService.java   |   8 +-
 .../ads/DefaultLdapConfigurationService.java    |   4 +-
 .../ads/detectors/GroupMemberAttrDetector.java  |   4 +-
 .../ads/detectors/GroupNameAttrDetector.java    |   7 +-
 .../ads/detectors/GroupObjectClassDetector.java |   8 +-
 .../detectors/UserGroupMemberAttrDetector.java  |   5 +-
 .../ads/detectors/UserNameAttrDetector.java     |   4 +-
 .../ads/detectors/UserObjectClassDetector.java  |   4 +-
 .../server/upgrade/UpgradeCatalog260.java       |   4 +
 .../python/ambari_server/serverConfiguration.py |  17 +-
 .../main/python/ambari_server/serverSetup.py    |   5 +-
 .../main/python/ambari_server/serverUpgrade.py  |  14 +-
 .../KAFKA/0.10.0/configuration/kafka-broker.xml |  39 ++
 .../configuration/kafka_client_jaas_conf.xml    |  43 ++
 .../0.10.0/configuration/kafka_jaas_conf.xml    | 116 ++++
 .../KAFKA/0.8.1/configuration/kafka-env.xml     |   2 +-
 .../KAFKA/0.8.1/package/scripts/kafka.py        |   4 +-
 .../KAFKA/0.8.1/package/scripts/params.py       |  16 +-
 .../0.8.1/package/scripts/service_check.py      |  15 +-
 .../0.8.1/package/scripts/setup_ranger_kafka.py |   8 +-
 .../KAFKA/0.8.1/package/scripts/upgrade.py      |   3 +-
 .../package/templates/kafka_client_jaas.conf.j2 |   3 +
 .../0.8.1/package/templates/kafka_jaas.conf.j2  |  47 ++
 .../KAFKA/0.9.0/configuration/kafka-broker.xml  |   2 +-
 .../package/scripts/oozie_server_upgrade.py     |  24 +-
 .../package/scripts/oozie_server_upgrade.py     |  50 +-
 .../common-services/SPARK/1.2.1/alerts.json     |   2 +-
 .../common-services/SPARK2/2.0.0/alerts.json    |   2 +-
 .../custom_actions/scripts/install_packages.py  |  12 +-
 .../HDP/2.0.6/properties/stack_features.json    |  11 +
 .../stacks/HDP/2.0.6/services/stack_advisor.py  |   2 +-
 .../HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml |   2 +-
 .../stacks/HDP/2.6/upgrades/upgrade-2.6.xml     |   2 +-
 .../HDP/3.0/properties/stack_features.json      |   6 +
 .../ExecutionCommandWrapperTest.java            |  15 +-
 .../commands/StackAdvisorCommandTest.java       |   4 +-
 .../AmbariManagementControllerImplTest.java     |  53 +-
 .../AmbariManagementControllerTest.java         |  49 +-
 .../internal/HostResourceProviderTest.java      |   6 +-
 ...ponentConfigurationResourceProviderTest.java | 214 +++++--
 .../server/ldap/LdapModuleFunctionalTest.java   |  49 +-
 .../TestAmbariLdapConfigurationFactory.java     |  29 -
 .../ldap/service/AmbariLdapFacadeTest.java      |  36 +-
 ...efaultLdapAttributeDetectionServiceTest.java |  24 +-
 .../DefaultLdapConfigurationServiceTest.java    |  31 +-
 .../server/upgrade/UpgradeCatalog260Test.java   |   4 +
 .../stacks/2.0.6/OOZIE/test_oozie_server.py     |  24 +-
 .../stacks/2.0.6/common/test_stack_advisor.py   |   4 +-
 .../2.6/KAFKA/test_kafka_broker_other_sasl.py   |  97 +++
 .../2.6/configs/default_kafka_plaintext.json    | 631 +++++++++++++++++++
 .../configs/default_kafka_plaintextsasl.json    | 631 +++++++++++++++++++
 .../configs/default_kafka_sasl_plaintext.json   | 631 +++++++++++++++++++
 .../2.6/configs/default_kafka_sasl_ssl.json     | 631 +++++++++++++++++++
 ambari-web/app/controllers/installer.js         |   5 +-
 .../resources/ui/app/components/upload-file.js  |  38 +-
 130 files changed, 4839 insertions(+), 1303 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b6cf4325/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/b6cf4325/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
----------------------------------------------------------------------
diff --cc ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
index 13b0925,232737c..a255474
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
@@@ -139,8 -139,8 +139,7 @@@ import org.apache.ambari.server.securit
  import org.apache.ambari.server.security.authorization.ResourceType;
  import org.apache.ambari.server.security.authorization.RoleAuthorization;
  import org.apache.ambari.server.security.authorization.User;
 -import org.apache.ambari.server.security.authorization.UserType;
  import org.apache.ambari.server.security.authorization.Users;
- import org.apache.ambari.server.security.credential.PrincipalKeyCredential;
  import org.apache.ambari.server.security.encryption.CredentialStoreService;
  import org.apache.ambari.server.security.encryption.CredentialStoreType;
  import org.apache.ambari.server.security.ldap.AmbariLdapDataPopulator;

http://git-wip-us.apache.org/repos/asf/ambari/blob/b6cf4325/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
----------------------------------------------------------------------


[19/29] ambari git commit: AMBARI-22566. Upgrade Angular for Ambari Admin View (alexantonenko)

Posted by rl...@apache.org.
AMBARI-22566. Upgrade Angular for Ambari Admin View (alexantonenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f43277eb
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f43277eb
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f43277eb

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: f43277ebbe6e675c842be00ff318c966901d4a6f
Parents: 58868f7
Author: Alex Antonenko <hi...@gmail.com>
Authored: Thu Nov 30 23:03:22 2017 +0200
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Thu Nov 30 23:03:22 2017 +0200

----------------------------------------------------------------------
 .../src/main/resources/ui/admin-web/app/scripts/app.js       | 2 +-
 .../controllers/stackVersions/StackVersionsEditCtrl.js       | 2 +-
 ambari-admin/src/main/resources/ui/admin-web/bower.json      | 8 ++++----
 ambari-admin/src/main/resources/ui/admin-web/package.json    | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f43277eb/ambari-admin/src/main/resources/ui/admin-web/app/scripts/app.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/app.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/app.js
index 225eb12..98b0383 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/app.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/app.js
@@ -63,7 +63,7 @@ angular.module('ambariAdminConsole', [
     };
   }]);
 
-  $httpProvider.responseInterceptors.push(['$rootScope', '$q', function (scope, $q) {
+  $httpProvider.interceptors.push(['$rootScope', '$q', function (scope, $q) {
     function success(response) {
       return response;
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/f43277eb/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsEditCtrl.js
----------------------------------------------------------------------
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 542772e..a4b121c 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.indexOf('GPL') >= 0;
+    return repository.Repositories.tags && repository.Repositories.tags.indexOf('GPL') >= 0;
   };
 
   $scope.showRepo = function (repository) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/f43277eb/ambari-admin/src/main/resources/ui/admin-web/bower.json
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/bower.json b/ambari-admin/src/main/resources/ui/admin-web/bower.json
index c38f464..c9e67f0 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/bower.json
+++ b/ambari-admin/src/main/resources/ui/admin-web/bower.json
@@ -3,18 +3,18 @@
   "private": true,
   "dependencies": {
     "bootstrap": "3.3.7",
-    "angular": "1.2.26",
-    "angular-route": "1.2.26",
+    "angular": "1.5.11",
+    "angular-route": "1.5.11",
     "angular-bootstrap": "0.11.0",
     "underscore": "1.7.0",
     "restangular": "1.4.0",
     "angular-bootstrap-toggle-switch": "0.5.1",
-    "angular-animate": "1.2.26",
+    "angular-animate": "1.5.11",
     "angular-translate": "2.2.0",
     "font-awesome": "4.2.0"
   },
   "devDependencies": {
-    "angular-mocks": "1.2.26",
+    "angular-mocks": "1.5.11",
     "commonjs": "0.2.0",
     "chai": "1.8.0",
     "mocha": "1.14.0",

http://git-wip-us.apache.org/repos/asf/ambari/blob/f43277eb/ambari-admin/src/main/resources/ui/admin-web/package.json
----------------------------------------------------------------------
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 b7c514c..ab117ef 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/package.json
+++ b/ambari-admin/src/main/resources/ui/admin-web/package.json
@@ -14,7 +14,7 @@
     "gulp-flatten": "0.0.2",
     "gulp-load-plugins": "0.5.0",
     "gulp-order": "1.1.1",
-    "gulp-plumber": "0.6.6",
+    "gulp-plumber": "1.1.0",
     "gulp-size": "0.3.0",
     "gulp-uglify": "0.2.1",
     "gulp-useref": "0.4.2",


[21/29] ambari git commit: AMBARI-22570. Repository Fields missing when register version is clicked (vsubramanian)

Posted by rl...@apache.org.
AMBARI-22570. Repository Fields missing when register version is clicked (vsubramanian)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7b6fef18
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7b6fef18
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7b6fef18

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 7b6fef189b7fa3090b7a10efcdf5e2427e2e0eac
Parents: b2655aa
Author: Vivek Ratnavel Subramanian <vi...@gmail.com>
Authored: Thu Nov 30 16:32:17 2017 -0800
Committer: Vivek Ratnavel Subramanian <vi...@gmail.com>
Committed: Thu Nov 30 16:32:17 2017 -0800

----------------------------------------------------------------------
 .../stackVersions/StackVersionsCreateCtrl.js    | 28 +++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/7b6fef18/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js
----------------------------------------------------------------------
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..3d93b0d 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.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() {


[08/29] ambari git commit: AMBARI-22555. Update server setup to deny GPL as default. (swagle)

Posted by rl...@apache.org.
AMBARI-22555. Update server setup to deny GPL as default. (swagle)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1a803cca
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1a803cca
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1a803cca

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 1a803ccab0eeaa9bd6cf45d1be1139b7a240df1e
Parents: 4240f84
Author: Siddharth Wagle <sw...@hortonworks.com>
Authored: Thu Nov 30 09:47:46 2017 -0800
Committer: Siddharth Wagle <sw...@hortonworks.com>
Committed: Thu Nov 30 09:47:46 2017 -0800

----------------------------------------------------------------------
 .../python/ambari_server/serverConfiguration.py    | 17 ++++++-----------
 .../src/main/python/ambari_server/serverUpgrade.py | 14 +++++++++-----
 .../stacks/HDP/2.0.6/services/stack_advisor.py     |  2 +-
 .../stacks/2.0.6/common/test_stack_advisor.py      |  4 ++--
 4 files changed, 18 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/1a803cca/ambari-server/src/main/python/ambari_server/serverConfiguration.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/ambari_server/serverConfiguration.py b/ambari-server/src/main/python/ambari_server/serverConfiguration.py
index f744fa0..d6ab453 100644
--- a/ambari-server/src/main/python/ambari_server/serverConfiguration.py
+++ b/ambari-server/src/main/python/ambari_server/serverConfiguration.py
@@ -196,14 +196,8 @@ SETUP_OR_UPGRADE_MSG = "- If this is a new setup, then run the \"ambari-server s
                        "- If this is an upgrade of an existing setup, run the \"ambari-server upgrade\" command.\n" \
                        "Refer to the Ambari documentation for more information on setup and upgrade."
 
-GPL_LICENSE_PROMPT_TEXT = """To download GPL licensed products like lzo you must accept the license terms below:
-LICENSE_LINE_1
-LICENSE_LINE_2
-LICENSE_LINE_3
-LICENSE_LINE_4
-LICENSE_LINE_5
-LICENSE_LINE_6
-Do you accept the GPL License Agreement [y/n] (y)?"""
+GPL_LICENSE_PROMPT_TEXT = """GPL License for LZO: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html
+Enable Ambari Server to download and install GPL Licensed LZO packages [y/n] (n)? """
 
 DEFAULT_DB_NAME = "ambari"
 
@@ -1151,8 +1145,9 @@ def update_ambari_env():
     return -1
 
   return 0
-  
-def write_gpl_license_accepted():
+ 
+# default should be false / not accepted 
+def write_gpl_license_accepted(text = GPL_LICENSE_PROMPT_TEXT):
   properties = get_ambari_properties()
   if properties == -1:
     err = "Error getting ambari properties"
@@ -1162,7 +1157,7 @@ def write_gpl_license_accepted():
   if GPL_LICENSE_ACCEPTED_PROPERTY in properties.keys() and properties.get_property(GPL_LICENSE_ACCEPTED_PROPERTY).lower() == "true":
     return True
 
-  result = get_YN_input(GPL_LICENSE_PROMPT_TEXT, True)
+  result = get_YN_input(text, False)
 
   properties.process_pair(GPL_LICENSE_ACCEPTED_PROPERTY, str(result).lower())
   update_properties(properties)

http://git-wip-us.apache.org/repos/asf/ambari/blob/1a803cca/ambari-server/src/main/python/ambari_server/serverUpgrade.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/ambari_server/serverUpgrade.py b/ambari-server/src/main/python/ambari_server/serverUpgrade.py
index 57a1ae0..c2b7de8 100644
--- a/ambari-server/src/main/python/ambari_server/serverUpgrade.py
+++ b/ambari-server/src/main/python/ambari_server/serverUpgrade.py
@@ -74,10 +74,14 @@ SCHEMA_UPGRADE_DEBUG = False
 
 SUSPEND_START_MODE = False
 
-INSALLED_LZO_WITHOUT_GPL_TEXT = "By saying no, Ambari will not automatically install LZO on any  new host in the cluster." + \
-"It is up to you to ensure LZO is installed and configured appropriately." + \
-"Without LZO being installed and configured data compressed with LZO will not be readable. " + \
-"Are you sure you want to proceed? [y/n] (n)?"
+INSTALLED_LZO_WITHOUT_GPL_TEXT = "By saying no, Ambari will not automatically install LZO on any new host in the cluster.  " \
+                                "It is up to you to ensure LZO is installed and configured appropriately.  " \
+                                "Without LZO being installed and configured, data compressed with LZO will not be readable.  " \
+                                "Are you sure you want to proceed? [y/n] (n)? "
+
+LZO_ENABLED_GPL_TEXT = "GPL License for LZO: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html\n" \
+                       "Your cluster is configured to use LZO which is GPL software. " \
+                       "You must agree to enable Ambari to continue downloading and installing LZO  [y/n] (n)? "
 
 def load_stack_values(version, filename):
   import xml.etree.ElementTree as ET
@@ -175,7 +179,7 @@ def check_gpl_license_approved(upgrade_response):
   if 'lzo_enabled' not in upgrade_response or upgrade_response['lzo_enabled'].lower() != "true":
     return
 
-  while not write_gpl_license_accepted() and not get_YN_input(INSALLED_LZO_WITHOUT_GPL_TEXT, False):
+  while not write_gpl_license_accepted(LZO_ENABLED_GPL_TEXT) and not get_YN_input(INSTALLED_LZO_WITHOUT_GPL_TEXT, False):
     pass
 
 #

http://git-wip-us.apache.org/repos/asf/ambari/blob/1a803cca/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
index 5584377..7e9ed44 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
@@ -382,7 +382,7 @@ class HDP206StackAdvisor(DefaultStackAdvisor):
       if not lzo_allowed and lzo_codec_class in property_value:
         validations.append({"config-name": property_name, "item": self.getNotApplicableItem(
           "Your Ambari Server has not been configured to download LZO and install it. "
-          "LZO is GPL software and requires you to accept a license prior to use. "
+          "LZO is GPL software and requires you to explicitly enable Ambari to install and download LZO. "
           "Please refer to the documentation to configure Ambari before proceeding.")})
 
   def recommendHbaseConfigurations(self, configurations, clusterData, services, hosts):

http://git-wip-us.apache.org/repos/asf/ambari/blob/1a803cca/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
index 300ffe9..f862fc6 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
@@ -2558,14 +2558,14 @@ class TestHDP206StackAdvisor(TestCase):
     services["gpl-license-accepted"] = False
     res_expected = [{'config-type': 'core-site',
                      'message': 'Your Ambari Server has not been configured to download LZO and install it. '
-                                'LZO is GPL software and requires you to accept a license prior to use. '
+                                'LZO is GPL software and requires you to explicitly enable Ambari to install and download LZO. '
                                 'Please refer to the documentation to configure Ambari before proceeding.',
                      'type': 'configuration',
                      'config-name': 'io.compression.codecs',
                      'level': 'NOT_APPLICABLE'},
                     {'config-type': 'core-site',
                      'message': 'Your Ambari Server has not been configured to download LZO and install it. '
-                                'LZO is GPL software and requires you to accept a license prior to use. '
+                                'LZO is GPL software and requires you to explicitly enable Ambari to install and download LZO. '
                                 'Please refer to the documentation to configure Ambari before proceeding.',
                      'type': 'configuration',
                      'config-name': 'io.compression.codec.lzo.class',


[10/29] ambari git commit: AMBARI-22485 : Allow Ambari to support non-kerberos SASL mechanisms for Kafka (ydavis via mradhakrishnan)

Posted by rl...@apache.org.
AMBARI-22485 : Allow Ambari to support non-kerberos SASL mechanisms for Kafka (ydavis via mradhakrishnan)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d3429491
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d3429491
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d3429491

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: d3429491a231f921ca3960ac0363c52690fb9dfa
Parents: 63a1587
Author: Madhuvanthi Radhakrishnan <mr...@hortonworks.com>
Authored: Thu Nov 30 11:24:44 2017 -0800
Committer: Madhuvanthi Radhakrishnan <mr...@hortonworks.com>
Committed: Thu Nov 30 11:24:44 2017 -0800

----------------------------------------------------------------------
 .../libraries/functions/constants.py            |  1 +
 .../KAFKA/0.8.1/configuration/kafka-env.xml     |  2 +-
 .../KAFKA/0.8.1/package/scripts/kafka.py        |  4 +-
 .../KAFKA/0.8.1/package/scripts/params.py       | 16 +++++--
 .../0.8.1/package/scripts/setup_ranger_kafka.py |  8 ++--
 .../KAFKA/0.8.1/package/scripts/upgrade.py      |  3 +-
 .../package/templates/kafka_client_jaas.conf.j2 |  3 ++
 .../0.8.1/package/templates/kafka_jaas.conf.j2  | 47 ++++++++++++++++++++
 .../KAFKA/0.9.0/configuration/kafka-broker.xml  |  2 +-
 .../HDP/2.0.6/properties/stack_features.json    |  5 +++
 10 files changed, 77 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d3429491/ambari-common/src/main/python/resource_management/libraries/functions/constants.py
----------------------------------------------------------------------
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 f46b7cf..b811861 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
@@ -120,3 +120,4 @@ class StackFeature:
   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"

http://git-wip-us.apache.org/repos/asf/ambari/blob/d3429491/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/configuration/kafka-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/configuration/kafka-env.xml b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/configuration/kafka-env.xml
index 7607c22..ea6c50c 100644
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/configuration/kafka-env.xml
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/configuration/kafka-env.xml
@@ -94,7 +94,7 @@ export JAVA_HOME={{java64_home}}
 export PATH=$PATH:$JAVA_HOME/bin
 export PID_DIR={{kafka_pid_dir}}
 export LOG_DIR={{kafka_log_dir}}
-{% if security_enabled %}
+{% if kerberos_security_enabled or kafka_other_sasl_enabled %}
 export KAFKA_KERBEROS_PARAMS="-Djavax.security.auth.useSubjectCredsOnly=false {{kafka_kerberos_params}}"
 {% else %}
 export KAFKA_KERBEROS_PARAMS={{kafka_kerberos_params}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/d3429491/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/kafka.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/kafka.py b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/kafka.py
index 3aa3473..3adea69 100644
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/kafka.py
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/kafka.py
@@ -53,7 +53,7 @@ def kafka(upgrade_type=None):
        Logger.info(format("Kafka listeners: {listeners}"))
        kafka_server_config['listeners'] = listeners       
 
-       if params.security_enabled and params.kafka_kerberos_enabled:
+       if params.kerberos_security_enabled and params.kafka_kerberos_enabled:
          Logger.info("Kafka kerberos security is enabled.")
          kafka_server_config['advertised.listeners'] = listeners
          Logger.info(format("Kafka advertised listeners: {listeners}"))
@@ -115,7 +115,7 @@ def kafka(upgrade_type=None):
              content=InlineTemplate(params.log4j_props)
          )
 
-    if params.security_enabled and params.kafka_kerberos_enabled:
+    if (params.kerberos_security_enabled and params.kafka_kerberos_enabled) or params.kafka_other_sasl_enabled:
       if params.kafka_jaas_conf_template:
         File(format("{conf_dir}/kafka_jaas.conf"),
              owner=params.kafka_user,

http://git-wip-us.apache.org/repos/asf/ambari/blob/d3429491/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/params.py b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/params.py
index a62265b..46fdfba 100644
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/params.py
@@ -157,13 +157,19 @@ if has_metric_collector:
   pass
 
 # Security-related params
-security_enabled = config['configurations']['cluster-env']['security_enabled']
+kerberos_security_enabled = config['configurations']['cluster-env']['security_enabled']
+
 kafka_kerberos_enabled = (('security.inter.broker.protocol' in config['configurations']['kafka-broker']) and
                          ((config['configurations']['kafka-broker']['security.inter.broker.protocol'] == "PLAINTEXTSASL") or
                           (config['configurations']['kafka-broker']['security.inter.broker.protocol'] == "SASL_PLAINTEXT")))
 
+kafka_other_sasl_enabled = not kerberos_security_enabled and check_stack_feature(StackFeature.KAFKA_LISTENERS, stack_version_formatted) and \
+                          check_stack_feature(StackFeature.KAFKA_EXTENDED_SASL_SUPPORT, stack_version_formatted) and \
+                          (("SASL_PLAINTEXT" in config['configurations']['kafka-broker']['listeners']) or
+                          ("PLAINTEXTSASL" in config['configurations']['kafka-broker']['listeners']) or
+                          ("SASL_SSL" in config['configurations']['kafka-broker']['listeners']))
 
-if security_enabled and stack_version_formatted != "" and 'kafka_principal_name' in config['configurations']['kafka-env'] \
+if kerberos_security_enabled and stack_version_formatted != "" and 'kafka_principal_name' in config['configurations']['kafka-env'] \
   and check_stack_feature(StackFeature.KAFKA_KERBEROS, stack_version_formatted):
     _hostname_lowercase = config['hostname'].lower()
     _kafka_principal_name = config['configurations']['kafka-env']['kafka_principal_name']
@@ -171,6 +177,8 @@ if security_enabled and stack_version_formatted != "" and 'kafka_principal_name'
     kafka_keytab_path = config['configurations']['kafka-env']['kafka_keytab']
     kafka_bare_jaas_principal = get_bare_principal(_kafka_principal_name)
     kafka_kerberos_params = "-Djava.security.auth.login.config="+ conf_dir +"/kafka_jaas.conf"
+elif kafka_other_sasl_enabled:
+    kafka_kerberos_params = "-Djava.security.auth.login.config="+ conf_dir +"/kafka_jaas.conf"
 else:
     kafka_kerberos_params = ''
     kafka_jaas_principal = None
@@ -266,7 +274,7 @@ if enable_ranger_kafka and is_supported_kafka_ranger:
   if len(custom_ranger_service_config) > 0:
     ranger_plugin_config.update(custom_ranger_service_config)
 
-  if stack_supports_ranger_kerberos and security_enabled:
+  if stack_supports_ranger_kerberos and kerberos_security_enabled:
     ranger_plugin_config['policy.download.auth.users'] = kafka_user
     ranger_plugin_config['tag.download.auth.users'] = kafka_user
     ranger_plugin_config['ambari.service.check.user'] = policy_user
@@ -327,7 +335,7 @@ HdfsResource = functools.partial(
   HdfsResource,
   user=hdfs_user,
   hdfs_resource_ignore_file = "/var/lib/ambari-agent/data/.hdfs_resource_ignore",
-  security_enabled = security_enabled,
+  security_enabled = kerberos_security_enabled,
   keytab = hdfs_user_keytab,
   kinit_path_local = kinit_path_local,
   hadoop_bin_dir = hadoop_bin_dir,

http://git-wip-us.apache.org/repos/asf/ambari/blob/d3429491/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/setup_ranger_kafka.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/setup_ranger_kafka.py b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/setup_ranger_kafka.py
index e9719aa..9aa09df 100644
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/setup_ranger_kafka.py
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/setup_ranger_kafka.py
@@ -66,10 +66,10 @@ def setup_ranger_kafka():
                         credential_file=params.credential_file, xa_audit_db_password=params.xa_audit_db_password, 
                         ssl_truststore_password=params.ssl_truststore_password, ssl_keystore_password=params.ssl_keystore_password,
                         api_version = 'v2', skip_if_rangeradmin_down= not params.retryAble,
-                        is_security_enabled = params.security_enabled,
+                        is_security_enabled = params.kerberos_security_enabled,
                         is_stack_supports_ranger_kerberos = params.stack_supports_ranger_kerberos,
-                        component_user_principal=params.kafka_jaas_principal if params.security_enabled else None,
-                        component_user_keytab=params.kafka_keytab_path if params.security_enabled else None)
+                        component_user_principal=params.kafka_jaas_principal if params.kerberos_security_enabled else None,
+                        component_user_keytab=params.kafka_keytab_path if params.kerberos_security_enabled else None)
     
     if params.enable_ranger_kafka: 
       Execute(('cp', '--remove-destination', params.setup_ranger_env_sh_source, params.setup_ranger_env_sh_target),
@@ -81,7 +81,7 @@ def setup_ranger_kafka():
         group = params.user_group,
         mode = 0755
       )
-    if params.stack_supports_core_site_for_ranger_plugin and params.enable_ranger_kafka and params.has_namenode and params.security_enabled:
+    if params.stack_supports_core_site_for_ranger_plugin and params.enable_ranger_kafka and params.has_namenode and params.kerberos_security_enabled:
       Logger.info("Stack supports core-site.xml creation for Ranger plugin, creating create core-site.xml from namenode configuraitions")
       setup_core_site_for_required_plugins(component_user=params.kafka_user,component_group=params.user_group,create_core_site_path = params.conf_dir, config = params.config)
     else:

http://git-wip-us.apache.org/repos/asf/ambari/blob/d3429491/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/upgrade.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/upgrade.py b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/upgrade.py
index e79a8ad..b327e54 100644
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/upgrade.py
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/upgrade.py
@@ -1,4 +1,3 @@
-
 #!/usr/bin/env python
 """
 Licensed to the Apache Software Foundation (ASF) under one
@@ -43,7 +42,7 @@ def run_migration(env, upgrade_type):
   if params.upgrade_direction is None:
     raise Fail('Parameter "upgrade_direction" is missing.')
 
-  if not params.security_enabled:
+  if not params.kerberos_security_enabled:
     Logger.info("Skip running the Kafka ACL migration script since cluster security is not enabled.")
     return
   

http://git-wip-us.apache.org/repos/asf/ambari/blob/d3429491/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/templates/kafka_client_jaas.conf.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/templates/kafka_client_jaas.conf.j2 b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/templates/kafka_client_jaas.conf.j2
index 7f81d85..873d030 100644
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/templates/kafka_client_jaas.conf.j2
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/templates/kafka_client_jaas.conf.j2
@@ -15,12 +15,15 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #}
+
+{% if kerberos_security_enabled %}
 KafkaClient {
    com.sun.security.auth.module.Krb5LoginModule required
    useTicketCache=true
    renewTicket=true
    serviceName="{{kafka_bare_jaas_principal}}";
 };
+{% endif %}
 Client {
    com.sun.security.auth.module.Krb5LoginModule required
    useTicketCache=true

http://git-wip-us.apache.org/repos/asf/ambari/blob/d3429491/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/templates/kafka_jaas.conf.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/templates/kafka_jaas.conf.j2 b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/templates/kafka_jaas.conf.j2
index 1d9e61d..68b5e44 100644
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/templates/kafka_jaas.conf.j2
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/templates/kafka_jaas.conf.j2
@@ -15,6 +15,51 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #}
+
+/**
+* Example of SASL/PLAIN Configuration
+*
+* KafkaServer {
+*   org.apache.kafka.common.security.plain.PlainLoginModule required
+*   username="admin"
+*   password="admin-secret"
+*   user_admin="admin-secret"
+*   user_alice="alice-secret";
+*   };
+*
+* Example of SASL/SCRAM
+*
+* KafkaServer {
+*   org.apache.kafka.common.security.scram.ScramLoginModule required
+*   username="admin"
+*   password="admin-secret"
+*   };
+*
+* Example of Enabling multiple SASL mechanisms in a broker:
+*
+*   KafkaServer {
+*
+*    com.sun.security.auth.module.Krb5LoginModule required
+*    useKeyTab=true
+*    storeKey=true
+*    keyTab="/etc/security/keytabs/kafka_server.keytab"
+*    principal="kafka/kafka1.hostname.com@EXAMPLE.COM";
+*
+*    org.apache.kafka.common.security.plain.PlainLoginModule required
+*    username="admin"
+*    password="admin-secret"
+*    user_admin="admin-secret"
+*    user_alice="alice-secret";
+*
+*    org.apache.kafka.common.security.scram.ScramLoginModule required
+*    username="scram-admin"
+*    password="scram-admin-secret";
+*    };
+*
+**/
+
+{% if kerberos_security_enabled %}
+
 KafkaServer {
    com.sun.security.auth.module.Krb5LoginModule required
    useKeyTab=true
@@ -50,3 +95,5 @@ com.sun.security.jgss.krb5.initiate {
    serviceName="{{kafka_bare_jaas_principal}}"
    principal="{{kafka_jaas_principal}}";
 };
+
+{% endif %}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/d3429491/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/kafka-broker.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/kafka-broker.xml b/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/kafka-broker.xml
index 4cd2b0d..fbc1c64 100644
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/kafka-broker.xml
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/kafka-broker.xml
@@ -17,7 +17,7 @@
  * limitations under the License.
  */
 -->
-<configuration xmlns:xi="http://www.w3.org/2001/XInclude" supports_final="true">
+<configuration xmlns:xi="http://www.w3.org/2001/XInclude">
   <property>
     <name>listeners</name>
     <value>PLAINTEXT://localhost:6667</value>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d3429491/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json b/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json
index f79cfe0..2109a5d 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json
@@ -447,6 +447,11 @@
         "name": "sam_storage_core_in_registry",
         "description": "Storage core module moved to registry",
         "min_version": "2.6.3.0"
+      },
+      {
+        "name": "kafka_extended_sasl_support",
+        "description": "Support SASL PLAIN and GSSAPI",
+        "min_version": "2.6.5.0"
       }
     ]
   }


[07/29] ambari git commit: AMBARI-22481. Make Ambari LDAP configuration API consistent with existing API (rlevas)

Posted by rl...@apache.org.
AMBARI-22481. Make Ambari LDAP configuration API consistent with existing API (rlevas)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4240f849
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4240f849
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4240f849

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 4240f8496175bf9fb369b9411e71ad1127e356ad
Parents: c3150a4
Author: Robert Levas <rl...@hortonworks.com>
Authored: Thu Nov 30 12:04:12 2017 -0500
Committer: Robert Levas <rl...@hortonworks.com>
Committed: Thu Nov 30 12:04:12 2017 -0500

----------------------------------------------------------------------
 .../server/api/handlers/CreateHandler.java      |   8 +-
 .../server/api/handlers/UpdateHandler.java      |   8 +-
 .../resources/ResourceInstanceFactoryImpl.java  |   4 +-
 ...ootServiceComponentConfigurationService.java |  15 ++
 .../api/services/ldap/AmbariConfiguration.java  |  46 ----
 .../api/services/ldap/LdapConfigOperation.java  |  43 ----
 .../services/ldap/LdapConfigurationRequest.java |  49 ----
 .../services/ldap/LdapConfigurationService.java | 185 --------------
 .../api/services/ldap/LdapRequestInfo.java      |  61 -----
 .../services/serializers/JsonSerializer.java    |  38 ++-
 .../commands/StackAdvisorCommand.java           |  14 +-
 .../AmbariServerConfigurationCategory.java      |  69 ++++++
 .../AmbariServerConfigurationHandler.java       | 110 +++++++++
 .../AmbariServerLDAPConfigurationHandler.java   | 172 +++++++++++++
 .../internal/OperationStatusMetaData.java       |  90 +++++++
 ...ootServiceComponentConfigurationHandler.java | 114 +++++++++
 ...iceComponentConfigurationHandlerFactory.java |  54 +++++
 ...eComponentConfigurationResourceProvider.java | 243 ++++++++-----------
 .../apache/ambari/server/ldap/LdapModule.java   |   4 -
 .../ldap/domain/AmbariLdapConfigKeys.java       |  83 -------
 .../ldap/domain/AmbariLdapConfiguration.java    |  85 +++----
 .../domain/AmbariLdapConfigurationFactory.java  |  34 ---
 .../domain/AmbariLdapConfigurationKeys.java     |  83 +++++++
 .../AmbariLdapConfigurationProvider.java        |  19 +-
 .../server/ldap/service/AmbariLdapFacade.java   |   4 +-
 .../ambari/server/ldap/service/LdapFacade.java  |   9 +-
 .../DefaultLdapAttributeDetectionService.java   |   8 +-
 .../ads/DefaultLdapConfigurationService.java    |   4 +-
 .../ads/detectors/GroupMemberAttrDetector.java  |   4 +-
 .../ads/detectors/GroupNameAttrDetector.java    |   7 +-
 .../ads/detectors/GroupObjectClassDetector.java |   8 +-
 .../detectors/UserGroupMemberAttrDetector.java  |   5 +-
 .../ads/detectors/UserNameAttrDetector.java     |   4 +-
 .../ads/detectors/UserObjectClassDetector.java  |   4 +-
 .../commands/StackAdvisorCommandTest.java       |   4 +-
 ...ponentConfigurationResourceProviderTest.java | 214 +++++++++++++---
 .../server/ldap/LdapModuleFunctionalTest.java   |  49 ++--
 .../TestAmbariLdapConfigurationFactory.java     |  29 ---
 .../ldap/service/AmbariLdapFacadeTest.java      |  36 ++-
 ...efaultLdapAttributeDetectionServiceTest.java |  24 +-
 .../DefaultLdapConfigurationServiceTest.java    |  31 ++-
 41 files changed, 1184 insertions(+), 891 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/main/java/org/apache/ambari/server/api/handlers/CreateHandler.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/handlers/CreateHandler.java b/ambari-server/src/main/java/org/apache/ambari/server/api/handlers/CreateHandler.java
index b614c5e..484547a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/handlers/CreateHandler.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/handlers/CreateHandler.java
@@ -24,6 +24,7 @@ import org.apache.ambari.server.api.services.Result;
 import org.apache.ambari.server.api.services.ResultImpl;
 import org.apache.ambari.server.api.services.ResultMetadata;
 import org.apache.ambari.server.api.services.ResultStatus;
+import org.apache.ambari.server.controller.internal.OperationStatusMetaData;
 import org.apache.ambari.server.controller.spi.NoSuchParentResourceException;
 import org.apache.ambari.server.controller.spi.RequestStatus;
 import org.apache.ambari.server.controller.spi.RequestStatusMetaData;
@@ -94,6 +95,11 @@ public class CreateHandler extends BaseManagementHandler {
       return null;
     }
 
-    throw new UnsupportedOperationException();
+    if (requestStatusMetaData.getClass() == OperationStatusMetaData.class) {
+      return (OperationStatusMetaData) requestStatusMetaData;
+    } else {
+      throw new IllegalArgumentException(String.format("RequestStatusDetails is of an expected type: %s",
+          requestStatusMetaData.getClass().getName()));
+    }
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/main/java/org/apache/ambari/server/api/handlers/UpdateHandler.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/handlers/UpdateHandler.java b/ambari-server/src/main/java/org/apache/ambari/server/api/handlers/UpdateHandler.java
index 2f1af51..c578cb9 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/handlers/UpdateHandler.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/handlers/UpdateHandler.java
@@ -24,6 +24,7 @@ import org.apache.ambari.server.api.services.Result;
 import org.apache.ambari.server.api.services.ResultImpl;
 import org.apache.ambari.server.api.services.ResultMetadata;
 import org.apache.ambari.server.api.services.ResultStatus;
+import org.apache.ambari.server.controller.internal.OperationStatusMetaData;
 import org.apache.ambari.server.controller.spi.NoSuchParentResourceException;
 import org.apache.ambari.server.controller.spi.NoSuchResourceException;
 import org.apache.ambari.server.controller.spi.RequestStatus;
@@ -79,6 +80,11 @@ public class UpdateHandler extends BaseManagementHandler {
       return null;
     }
 
-    throw new UnsupportedOperationException();
+    if (requestStatusMetaData.getClass() == OperationStatusMetaData.class) {
+      return (OperationStatusMetaData) requestStatusMetaData;
+    } else {
+      throw new IllegalArgumentException(String.format("RequestStatusDetails is of an expected type: %s",
+          requestStatusMetaData.getClass().getName()));
+    }
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
index fecaedc..47da19b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
@@ -26,6 +26,7 @@ import java.util.Map;
 import java.util.Set;
 
 import org.apache.ambari.server.api.query.QueryImpl;
+import org.apache.ambari.server.api.services.RootServiceComponentConfigurationService;
 import org.apache.ambari.server.controller.internal.ClusterKerberosDescriptorResourceProvider;
 import org.apache.ambari.server.controller.spi.Resource;
 import org.apache.ambari.server.controller.utilities.ClusterControllerHelper;
@@ -239,7 +240,8 @@ public class ResourceInstanceFactoryImpl implements ResourceInstanceFactory {
 
       case RootServiceComponentConfiguration:
         resourceDefinition = new SimpleResourceDefinition(Resource.Type.RootServiceComponentConfiguration,
-            "configuration", "configurations");
+            "configuration", "configurations",
+            null, RootServiceComponentConfigurationService.DIRECTIVES_MAP);
         break;
 
       case RootServiceHostComponent:

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/main/java/org/apache/ambari/server/api/services/RootServiceComponentConfigurationService.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/RootServiceComponentConfigurationService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/RootServiceComponentConfigurationService.java
index c7c37a6..a6be143 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/RootServiceComponentConfigurationService.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/RootServiceComponentConfigurationService.java
@@ -34,6 +34,7 @@ package org.apache.ambari.server.api.services;
 
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Set;
 
 import javax.ws.rs.DELETE;
 import javax.ws.rs.GET;
@@ -48,10 +49,14 @@ import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.UriInfo;
 
+import org.apache.ambari.server.api.resources.BaseResourceDefinition;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.controller.spi.Resource;
 import org.apache.http.HttpStatus;
 
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Sets;
+
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -91,6 +96,16 @@ public class RootServiceComponentConfigurationService extends BaseService {
   private static final String REQUEST_TYPE =
       "org.apache.ambari.server.api.services.RootServiceComponentConfigurationRequestSwagger";
 
+  public static final String DIRECTIVE_OPERATION = "op";
+
+  private static final Set<String> DIRECTIVES = Sets.newHashSet(DIRECTIVE_OPERATION);
+
+  public static final Map<BaseResourceDefinition.DirectiveType, Set<String>> DIRECTIVES_MAP =
+      ImmutableMap.<BaseResourceDefinition.DirectiveType, Set<String>>builder()
+          .put(BaseResourceDefinition.DirectiveType.CREATE, DIRECTIVES)
+          .put(BaseResourceDefinition.DirectiveType.UPDATE, DIRECTIVES)
+          .build();
+
   private final String serviceName;
   private final String componentName;
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/AmbariConfiguration.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/AmbariConfiguration.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/AmbariConfiguration.java
deleted file mode 100644
index 7bac65e..0000000
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/AmbariConfiguration.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ambari.server.api.services.ldap;
-
-import java.util.Map;
-
-/**
- * Domain POJO representing generic ambari configuration data.
- */
-public class AmbariConfiguration {
-
-  /**
-   * The type of the configuration,  eg.: ldap-configuration
-   */
-  private String type;
-
-  private Map<String, String> properties = null;
-
-  public String getType() {
-    return type;
-  }
-
-  public void setType(String type) {
-    this.type = type;
-  }
-
-  public Map<String, String> getProperties() {
-    return properties;
-  }
-
-  public void setProperties(Map<String, String> data) {
-    this.properties = data;
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigOperation.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigOperation.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigOperation.java
deleted file mode 100644
index 478d4ff..0000000
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigOperation.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ambari.server.api.services.ldap;
-
-/**
- * Enumeration for supported operations related to LDAP configuration.
- */
-public enum LdapConfigOperation {
-  TEST_CONNECTION("test-connection"),
-  TEST_ATTRIBUTES("test-attributes"),
-  DETECT_ATTRIBUTES("detect-attributes");
-
-  private String actionStr;
-
-  LdapConfigOperation(String actionStr) {
-    this.actionStr = actionStr;
-  }
-
-  public static LdapConfigOperation fromAction(String action) {
-    for (LdapConfigOperation val : LdapConfigOperation.values()) {
-      if (val.action().equals(action)) {
-        return val;
-      }
-    }
-    throw new IllegalStateException("Action [ " + action + " ] is not supported");
-  }
-
-  public String action() {
-    return this.actionStr;
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationRequest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationRequest.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationRequest.java
deleted file mode 100644
index 0e065e5..0000000
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationRequest.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ambari.server.api.services.ldap;
-
-
-import com.google.gson.annotations.SerializedName;
-
-/**
- * Request object wrapping information for LDAP configuration related request calls.
- */
-public class LdapConfigurationRequest {
-
-  @SerializedName("Configuration")
-  private AmbariConfiguration ambariConfiguration;
-
-  @SerializedName("RequestInfo")
-  private LdapRequestInfo requestInfo;
-
-  public LdapConfigurationRequest() {
-  }
-
-  public AmbariConfiguration getAmbariConfiguration() {
-    return ambariConfiguration;
-  }
-
-  public void setAmbariConfiguration(AmbariConfiguration ambariConfiguration) {
-    this.ambariConfiguration = ambariConfiguration;
-  }
-
-  public LdapRequestInfo getRequestInfo() {
-    return requestInfo;
-  }
-
-  public void setRequestInfo(LdapRequestInfo requestInfo) {
-    this.requestInfo = requestInfo;
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationService.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationService.java
deleted file mode 100644
index 22784cd..0000000
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationService.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ambari.server.api.services.ldap;
-
-import java.util.Set;
-
-import javax.inject.Inject;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.apache.ambari.annotations.ApiIgnore;
-import org.apache.ambari.server.StaticallyInject;
-import org.apache.ambari.server.api.services.BaseService;
-import org.apache.ambari.server.api.services.Result;
-import org.apache.ambari.server.api.services.ResultImpl;
-import org.apache.ambari.server.api.services.ResultStatus;
-import org.apache.ambari.server.controller.internal.ResourceImpl;
-import org.apache.ambari.server.controller.spi.Resource;
-import org.apache.ambari.server.ldap.domain.AmbariLdapConfiguration;
-import org.apache.ambari.server.ldap.domain.AmbariLdapConfigurationFactory;
-import org.apache.ambari.server.ldap.service.LdapFacade;
-import org.apache.ambari.server.security.authorization.AuthorizationException;
-import org.apache.ambari.server.security.authorization.AuthorizationHelper;
-import org.apache.ambari.server.security.authorization.ResourceType;
-import org.apache.ambari.server.security.authorization.RoleAuthorization;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.security.core.Authentication;
-
-import com.google.common.collect.Sets;
-
-/**
- * Endpoint designated to LDAP specific operations.
- */
-@StaticallyInject
-@Path("/ldapconfigs/")
-public class LdapConfigurationService extends BaseService {
-
-  private static final Logger LOGGER = LoggerFactory.getLogger(LdapConfigurationService.class);
-
-  @Inject
-  private static LdapFacade ldapFacade;
-
-  @Inject
-  private static AmbariLdapConfigurationFactory ambariLdapConfigurationFactory;
-
-
-  @POST
-  @ApiIgnore // until documented
-  @Path("/validate")
-  @Consumes(MediaType.APPLICATION_JSON)
-  @Produces(MediaType.APPLICATION_JSON)
-  public Response validateConfiguration(LdapConfigurationRequest ldapConfigurationRequest) {
-
-    // check if the user is authorized to perform the operation
-    authorize();
-
-    Set<String> groups = Sets.newHashSet();
-    Object responseEntity = null;
-
-    Result result = new ResultImpl(new ResultStatus(ResultStatus.STATUS.OK));
-    try {
-
-      validateRequest(ldapConfigurationRequest);
-
-      AmbariLdapConfiguration ambariLdapConfiguration = ambariLdapConfigurationFactory.createLdapConfiguration(
-        ldapConfigurationRequest.getAmbariConfiguration().getProperties());
-
-      LdapConfigOperation action = LdapConfigOperation.fromAction(ldapConfigurationRequest.getRequestInfo().getAction());
-      switch (action) {
-
-        case TEST_CONNECTION:
-
-          LOGGER.info("Testing connection to the LDAP server ...");
-          ldapFacade.checkConnection(ambariLdapConfiguration);
-
-          break;
-        case TEST_ATTRIBUTES:
-
-          LOGGER.info("Testing LDAP attributes ....");
-          groups = ldapFacade.checkLdapAttributes(ldapConfigurationRequest.getRequestInfo().getParameters(), ambariLdapConfiguration);
-          responseEntity = groups;
-
-          break;
-        case DETECT_ATTRIBUTES:
-
-          LOGGER.info("Detecting LDAP attributes ...");
-          ambariLdapConfiguration = ldapFacade.detectAttributes(ambariLdapConfiguration);
-          responseEntity = ambariLdapConfiguration;
-
-          break;
-        default:
-          LOGGER.warn("No action provided ...");
-          throw new IllegalArgumentException("No request action provided");
-      }
-
-    } catch (Exception e) {
-      result.setResultStatus(new ResultStatus(ResultStatus.STATUS.SERVER_ERROR, e));
-      responseEntity = e.getMessage();
-    }
-
-    return Response.status(result.getStatus().getStatusCode()).entity(responseEntity).build();
-  }
-
-  private void setResult(Set<String> groups, Result result) {
-    Resource resource = new ResourceImpl(Resource.Type.RootServiceComponentConfiguration);
-    resource.setProperty("groups", groups);
-    result.getResultTree().addChild(resource, "payload");
-  }
-
-  private void validateRequest(LdapConfigurationRequest ldapConfigurationRequest) {
-    String errMsg;
-
-    if (null == ldapConfigurationRequest) {
-      errMsg = "No ldap configuraiton request provided";
-      LOGGER.error(errMsg);
-      throw new IllegalArgumentException(errMsg);
-    }
-
-    if (null == ldapConfigurationRequest.getRequestInfo()) {
-      errMsg = String.format("No request information provided. Request: [%s]", ldapConfigurationRequest);
-      LOGGER.error(errMsg);
-      throw new IllegalArgumentException(errMsg);
-    }
-
-    if (null == ldapConfigurationRequest.getAmbariConfiguration()
-      || ldapConfigurationRequest.getAmbariConfiguration().getProperties() != null) {
-      errMsg = String.format("No / Invalid configuration data provided. Request: [%s]", ldapConfigurationRequest);
-      LOGGER.error(errMsg);
-      throw new IllegalArgumentException(errMsg);
-    }
-  }
-
-  private void authorize() {
-    try {
-      Authentication authentication = AuthorizationHelper.getAuthentication();
-
-      if (authentication == null || !authentication.isAuthenticated()) {
-        throw new AuthorizationException("Authentication data is not available, authorization to perform the requested operation is not granted");
-      }
-
-      if (!AuthorizationHelper.isAuthorized(authentication, ResourceType.AMBARI, null, requiredAuthorizations())) {
-        throw new AuthorizationException("The authenticated user does not have the appropriate authorizations to create the requested resource(s)");
-      }
-    } catch (AuthorizationException e) {
-      LOGGER.error("Unauthorized operation.", e);
-      throw new IllegalArgumentException("User is not authorized to perform the operation", e);
-    }
-
-  }
-
-  private Set<RoleAuthorization> requiredAuthorizations() {
-    return Sets.newHashSet(RoleAuthorization.AMBARI_MANAGE_CONFIGURATION);
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapRequestInfo.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapRequestInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapRequestInfo.java
deleted file mode 100644
index eeecfee..0000000
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapRequestInfo.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ambari.server.api.services.ldap;
-
-import java.util.Map;
-
-import org.apache.ambari.server.controller.RequestPostRequest;
-
-/**
- * Bean holding LDAP request specific request information.
- */
-public class LdapRequestInfo implements RequestPostRequest.RequestInfo {
-
-  // no-arg costructor facilitating JSON serialization
-  public LdapRequestInfo() {
-  }
-
-  private String action;
-
-  private Map<String, Object> parameters;
-
-  @Override
-  public String getAction() {
-    return action;
-  }
-
-  public void setAction(String action) {
-    this.action = action;
-  }
-
-  public void setParameters(Map<String, Object> parameters) {
-    this.parameters = parameters;
-  }
-
-  @Override
-  public String getCommand() {
-    return null;
-  }
-
-  @Override
-  public RequestPostRequest.OperationLevel getOperationLevel() {
-    return null;
-  }
-
-  @Override
-  public Map<String, Object> getParameters() {
-    return parameters;
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/main/java/org/apache/ambari/server/api/services/serializers/JsonSerializer.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/serializers/JsonSerializer.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/serializers/JsonSerializer.java
index 0604d2b..a045d74 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/serializers/JsonSerializer.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/serializers/JsonSerializer.java
@@ -31,6 +31,7 @@ import org.apache.ambari.server.api.services.ResultMetadata;
 import org.apache.ambari.server.api.services.ResultStatus;
 import org.apache.ambari.server.api.util.TreeNode;
 import org.apache.ambari.server.api.util.TreeNodeImpl;
+import org.apache.ambari.server.controller.internal.OperationStatusMetaData;
 import org.apache.ambari.server.controller.spi.Resource;
 import org.codehaus.jackson.JsonFactory;
 import org.codehaus.jackson.JsonGenerator;
@@ -112,6 +113,8 @@ public class JsonSerializer implements ResultSerializer {
 
     if (resultMetadata.getClass() == DeleteResultMetadata.class) {
       processResultMetadata((DeleteResultMetadata) resultMetadata);
+    } else if (resultMetadata.getClass() == OperationStatusMetaData.class) {
+      processResultMetadata((OperationStatusMetaData) resultMetadata);
     } else {
       throw new IllegalArgumentException("ResultDetails is not of type DeleteResultDetails, cannot parse");
     }
@@ -144,6 +147,30 @@ public class JsonSerializer implements ResultSerializer {
     m_generator.writeEndObject();
   }
 
+  private void processResultMetadata(OperationStatusMetaData metaData) throws IOException {
+    m_generator.writeStartObject();
+    m_generator.writeObjectFieldStart("operationResults");
+
+    for (OperationStatusMetaData.Result result : metaData.getResults()) {
+      m_generator.writeObjectFieldStart(result.getId());
+      m_generator.writeStringField("status", result.isSuccess() ? "success" : "error");
+
+      if (result.getMessage() != null) {
+        m_generator.writeStringField("message", result.getMessage());
+      }
+
+      if (result.getResponse() != null) {
+        m_generator.writeFieldName("response");
+        m_mapper.writeValue(m_generator, result.getResponse());
+      }
+
+      m_generator.writeEndObject();
+    }
+
+    m_generator.writeEndObject();
+    m_generator.writeEndObject();
+  }
+
   private void processNode(TreeNode<Resource> node) throws IOException {
     if (isObject(node)) {
       m_generator.writeStartObject();
@@ -158,10 +185,11 @@ public class JsonSerializer implements ResultSerializer {
     }
 
     if (isArray(node)) {
-      if (node.getName() != null)
+      if (node.getName() != null) {
         m_generator.writeArrayFieldStart(node.getName());
-      else
+      } else {
         m_generator.writeStartArray();
+      }
     }
 
     for (TreeNode<Resource> child : node.getChildren()) {
@@ -186,11 +214,11 @@ public class JsonSerializer implements ResultSerializer {
   // Determines whether or not the given node is an array
   private boolean isArray(TreeNode<Resource> node) {
     return (node.getObject() == null && node.getName() != null) ||
-            (node.getObject() == null && node.getName() == null &&
-             node.getChildren().size() > 1);
+        (node.getObject() == null && node.getName() == null &&
+            node.getChildren().size() > 1);
   }
 
-  private TreeNode<Map<String, Object>> getTreeProperties (Map<String, Map<String, Object>> propertiesMap) {
+  private TreeNode<Map<String, Object>> getTreeProperties(Map<String, Map<String, Object>> propertiesMap) {
     TreeNode<Map<String, Object>> treeProperties = new TreeNodeImpl<>(null, new LinkedHashMap<>(), null);
 
     for (Map.Entry<String, Map<String, Object>> entry : propertiesMap.entrySet()) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/commands/StackAdvisorCommand.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/commands/StackAdvisorCommand.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/commands/StackAdvisorCommand.java
index 4ec15ef..6e6b37e 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/commands/StackAdvisorCommand.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/commands/StackAdvisorCommand.java
@@ -47,6 +47,7 @@ import org.apache.ambari.server.api.services.stackadvisor.StackAdvisorResponse;
 import org.apache.ambari.server.api.services.stackadvisor.StackAdvisorRunner;
 import org.apache.ambari.server.controller.RootComponent;
 import org.apache.ambari.server.controller.RootService;
+import org.apache.ambari.server.controller.internal.AmbariServerConfigurationCategory;
 import org.apache.ambari.server.controller.internal.RootServiceComponentConfigurationResourceProvider;
 import org.apache.ambari.server.controller.spi.Resource;
 import org.apache.ambari.server.state.ServiceInfo;
@@ -78,7 +79,6 @@ public abstract class StackAdvisorCommand<T extends StackAdvisorResponse> extend
 
   private static final String GET_HOSTS_INFO_URI = "/api/v1/hosts"
       + "?fields=Hosts/*&Hosts/host_name.in(%s)";
-  static final String LDAP_CONFIGURATION_PROPERTY = "ldap-configuration";
 
   private static final String GET_SERVICES_INFO_URI = "/api/v1/stacks/%s/versions/%s/"
       + "?fields=Versions/stack_name,Versions/stack_version,Versions/parent_stack_version"
@@ -91,11 +91,11 @@ public abstract class StackAdvisorCommand<T extends StackAdvisorResponse> extend
       + "&services/StackServices/service_name.in(%s)";
 
   private static final String GET_AMBARI_LDAP_CONFIG_URI = String.format("/api/v1/services/%s/components/%s/configurations?%s=%s&fields=%s",
-    RootService.AMBARI.name(),
-    RootComponent.AMBARI_SERVER.name(),
-    RootServiceComponentConfigurationResourceProvider.CONFIGURATION_CATEGORY_PROPERTY_ID,
-    LDAP_CONFIGURATION_PROPERTY,
-    RootServiceComponentConfigurationResourceProvider.CONFIGURATION_PROPERTIES_PROPERTY_ID);
+      RootService.AMBARI.name(),
+      RootComponent.AMBARI_SERVER.name(),
+      RootServiceComponentConfigurationResourceProvider.CONFIGURATION_CATEGORY_PROPERTY_ID,
+      AmbariServerConfigurationCategory.LDAP_CONFIGURATION.getCategoryName(),
+      RootServiceComponentConfigurationResourceProvider.CONFIGURATION_PROPERTIES_PROPERTY_ID);
 
   private static final String SERVICES_PROPERTY = "services";
   private static final String SERVICES_COMPONENTS_PROPERTY = "components";
@@ -230,7 +230,7 @@ public abstract class StackAdvisorCommand<T extends StackAdvisorResponse> extend
         throw new StackAdvisorException("Unexpected JSON document encountered: missing the Configuration/properties object");
       }
 
-      root.put(LDAP_CONFIGURATION_PROPERTY, ldapConfigurationProperties);
+      root.put(AmbariServerConfigurationCategory.LDAP_CONFIGURATION.getCategoryName(), ldapConfigurationProperties);
     } else if (numConfigs > 1) {
       throw new StackAdvisorException(String.format("Multiple (%s) LDAP configs are found in the DB.", numConfigs));
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariServerConfigurationCategory.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariServerConfigurationCategory.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariServerConfigurationCategory.java
new file mode 100644
index 0000000..f4fc83f
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariServerConfigurationCategory.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.server.controller.internal;
+
+import org.apache.commons.lang.StringUtils;
+
+/**
+ * AmbariServerConfigurationCategory is an enumeration of the different Ambari server specific
+ * configuration categories.
+ */
+public enum AmbariServerConfigurationCategory {
+  LDAP_CONFIGURATION("ldap-configuration");
+
+  private final String categoryName;
+
+  AmbariServerConfigurationCategory(String categoryName) {
+    this.categoryName = categoryName;
+  }
+
+  public String getCategoryName() {
+    return categoryName;
+  }
+
+  /**
+   * Safely returns an {@link AmbariServerConfigurationCategory} given the category's descriptive name
+   *
+   * @param categoryName a descriptive name
+   * @return an {@link AmbariServerConfigurationCategory}
+   */
+  public static AmbariServerConfigurationCategory translate(String categoryName) {
+    if (!StringUtils.isEmpty(categoryName)) {
+      categoryName = categoryName.trim();
+      for (AmbariServerConfigurationCategory category : values()) {
+        if (category.getCategoryName().equals(categoryName)) {
+          return category;
+        }
+      }
+    }
+
+    throw new IllegalArgumentException(String.format("Invalid Ambari server configuration category name: %s", categoryName));
+  }
+
+  /**
+   * Safely returns the {@link AmbariServerConfigurationCategory}'s descriptive name or <code>null</code>
+   * if no {@link AmbariServerConfigurationCategory} was supplied.
+   *
+   * @param category an {@link AmbariServerConfigurationCategory}
+   * @return the descriptive name of an {@link AmbariServerConfigurationCategory}
+   */
+  public static String translate(AmbariServerConfigurationCategory category) {
+    return (category == null) ? null : category.getCategoryName();
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariServerConfigurationHandler.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariServerConfigurationHandler.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariServerConfigurationHandler.java
new file mode 100644
index 0000000..34285d6
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariServerConfigurationHandler.java
@@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.server.controller.internal;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
+import org.apache.ambari.server.StaticallyInject;
+import org.apache.ambari.server.controller.spi.NoSuchResourceException;
+import org.apache.ambari.server.controller.spi.SystemException;
+import org.apache.ambari.server.events.AmbariConfigurationChangedEvent;
+import org.apache.ambari.server.events.publishers.AmbariEventPublisher;
+import org.apache.ambari.server.orm.dao.AmbariConfigurationDAO;
+import org.apache.ambari.server.orm.entities.AmbariConfigurationEntity;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.inject.Inject;
+
+/**
+ * AmbariServerConfigurationHandler handles Ambari server specific configuration properties.
+ */
+@StaticallyInject
+class AmbariServerConfigurationHandler extends RootServiceComponentConfigurationHandler {
+  private static final Logger LOGGER = LoggerFactory.getLogger(AmbariServerConfigurationHandler.class);
+
+  @Inject
+  private static AmbariConfigurationDAO ambariConfigurationDAO;
+
+  @Inject
+  private static AmbariEventPublisher publisher;
+
+
+  @Override
+  public Map<String, Map<String, String>> getConfigurations(String categoryName)
+      throws NoSuchResourceException {
+    Map<String, Map<String, String>> configurations = null;
+
+    List<AmbariConfigurationEntity> entities = (categoryName == null)
+        ? ambariConfigurationDAO.findAll()
+        : ambariConfigurationDAO.findByCategory(categoryName);
+
+    if (entities != null) {
+      configurations = new HashMap<>();
+
+      for (AmbariConfigurationEntity entity : entities) {
+        String category = entity.getCategoryName();
+        Map<String, String> properties = configurations.get(category);
+
+        if (properties == null) {
+          properties = new TreeMap<>();
+          configurations.put(category, properties);
+        }
+
+        properties.put(entity.getPropertyName(), entity.getPropertyValue());
+      }
+    }
+
+    return configurations;
+  }
+
+  @Override
+  public void removeConfiguration(String categoryName) throws NoSuchResourceException {
+    if (null == categoryName) {
+      LOGGER.debug("No resource id provided in the request");
+    } else {
+      LOGGER.debug("Deleting Ambari configuration with id: {}", categoryName);
+      try {
+        if (ambariConfigurationDAO.removeByCategory(categoryName) > 0) {
+          publisher.publish(new AmbariConfigurationChangedEvent(categoryName));
+        }
+      } catch (IllegalStateException e) {
+        throw new NoSuchResourceException(e.getMessage());
+      }
+    }
+  }
+
+  @Override
+  public void updateCategory(String categoryName, Map<String, String> properties, boolean removePropertiesIfNotSpecified) {
+    if (ambariConfigurationDAO.reconcileCategory(categoryName, properties, removePropertiesIfNotSpecified)) {
+      // notify subscribers about the configuration changes
+      publisher.publish(new AmbariConfigurationChangedEvent(categoryName));
+    }
+  }
+
+  @Override
+  public OperationResult performOperation(String categoryName, Map<String, String> properties,
+                                          boolean mergeExistingProperties, String operation,
+                                          Map<String, Object> operationParameters) throws SystemException {
+    throw new SystemException(String.format("The requested operation is not supported for this category: %s", categoryName));
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariServerLDAPConfigurationHandler.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariServerLDAPConfigurationHandler.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariServerLDAPConfigurationHandler.java
new file mode 100644
index 0000000..6f16c49
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariServerLDAPConfigurationHandler.java
@@ -0,0 +1,172 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.server.controller.internal;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.ambari.server.StaticallyInject;
+import org.apache.ambari.server.controller.spi.NoSuchResourceException;
+import org.apache.ambari.server.controller.spi.SystemException;
+import org.apache.ambari.server.ldap.domain.AmbariLdapConfiguration;
+import org.apache.ambari.server.ldap.service.AmbariLdapException;
+import org.apache.ambari.server.ldap.service.LdapFacade;
+import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.inject.Inject;
+
+/**
+ * AmbariServerLDAPConfigurationHandler handles Ambari server LDAP-specific configuration properties.
+ */
+@StaticallyInject
+class AmbariServerLDAPConfigurationHandler extends AmbariServerConfigurationHandler {
+  private static final Logger LOGGER = LoggerFactory.getLogger(AmbariServerLDAPConfigurationHandler.class);
+
+  @Inject
+  private static LdapFacade ldapFacade;
+
+  @Override
+  public OperationResult performOperation(String categoryName, Map<String, String> properties,
+                                          boolean mergeExistingProperties, String operation, Map<String, Object> operationParameters) throws SystemException {
+
+    if (!AmbariServerConfigurationCategory.LDAP_CONFIGURATION.getCategoryName().equals(categoryName)) {
+      throw new SystemException(String.format("Unexpected category name for Ambari server LDAP properties: %s", categoryName));
+    }
+
+    OperationType operationType = OperationType.translate(operation);
+    if (operation == null) {
+      throw new SystemException("Unexpected operation for Ambari server LDAP properties");
+    }
+
+    Map<String, String> ldapConfigurationProperties = new HashMap<>();
+
+    // If we need to merge with the properties of an existing ldap-configuration property set, attempt
+    // to retrieve if. If one does not exist, that is ok.
+    if (mergeExistingProperties) {
+      try {
+        Map<String, Map<String, String>> _configurations = getConfigurations(categoryName);
+        if (_configurations != null) {
+          Map<String, String> _ldapProperties = _configurations.get(categoryName);
+
+          if (_ldapProperties != null) {
+            ldapConfigurationProperties.putAll(_ldapProperties);
+          }
+        }
+      } catch (NoSuchResourceException e) {
+        // Ignore this. There is no existing ldap-configuration category and that is ok.
+      }
+    }
+
+    if (properties != null) {
+      ldapConfigurationProperties.putAll(properties);
+    }
+
+    AmbariLdapConfiguration ambariLdapConfiguration = new AmbariLdapConfiguration(ldapConfigurationProperties);
+
+    boolean success = true;
+    String message = null;
+    Object resultData = null;
+
+    try {
+      switch (operationType) {
+        case TEST_CONNECTION:
+          LOGGER.debug("Testing connection to the LDAP server ...");
+          ldapFacade.checkConnection(ambariLdapConfiguration);
+          break;
+
+        case TEST_ATTRIBUTES:
+          LOGGER.debug("Testing LDAP attributes ....");
+          Set<String> groups = ldapFacade.checkLdapAttributes(operationParameters, ambariLdapConfiguration);
+          resultData = Collections.singletonMap("groups", groups);
+          break;
+
+        case DETECT_ATTRIBUTES:
+          LOGGER.info("Detecting LDAP attributes ...");
+          ambariLdapConfiguration = ldapFacade.detectAttributes(ambariLdapConfiguration);
+          resultData = Collections.singletonMap("attributes", ambariLdapConfiguration.toMap());
+          break;
+
+        default:
+          LOGGER.warn("No action provided ...");
+          throw new IllegalArgumentException("No request action provided");
+      }
+    } catch (AmbariLdapException e) {
+      success = false;
+      message = determineCause(e);
+      if (StringUtils.isEmpty(message)) {
+        message = "An unexpected error has occurred.";
+      }
+
+      LOGGER.warn(String.format("Failed to perform %s: %s", operationType.name(), message), e);
+    }
+
+    return new OperationResult(operationType.getOperation(), success, message, resultData);
+  }
+
+  private String determineCause(Throwable throwable) {
+    if (throwable == null) {
+      return null;
+    } else {
+      Throwable cause = throwable.getCause();
+      if ((cause == null) || (cause == throwable)) {
+        return throwable.getMessage();
+      } else {
+        String message = determineCause(cause);
+        return (message == null) ? throwable.getMessage() : message;
+      }
+    }
+  }
+
+  enum OperationType {
+    TEST_CONNECTION("test-connection"),
+    TEST_ATTRIBUTES("test-attributes"),
+    DETECT_ATTRIBUTES("detect-attributes");
+
+    private final String operation;
+
+    OperationType(String operation) {
+      this.operation = operation;
+    }
+
+    public String getOperation() {
+      return operation;
+    }
+
+    public static OperationType translate(String operation) {
+      if (!StringUtils.isEmpty(operation)) {
+        operation = operation.trim();
+        for (OperationType category : values()) {
+          if (category.getOperation().equals(operation)) {
+            return category;
+          }
+        }
+      }
+
+      throw new IllegalArgumentException(String.format("Invalid Ambari server configuration category name: %s", operation));
+    }
+
+    public static String translate(OperationType operation) {
+      return (operation == null) ? null : operation.getOperation();
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/OperationStatusMetaData.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/OperationStatusMetaData.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/OperationStatusMetaData.java
new file mode 100644
index 0000000..2467fc5
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/OperationStatusMetaData.java
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.server.controller.internal;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+
+import org.apache.ambari.server.api.services.ResultMetadata;
+import org.apache.ambari.server.controller.spi.RequestStatusMetaData;
+
+/**
+ * OperationStatusMetaData is data to return as the status of an operation invoked on a set of resources
+ * while processing a REST API request.
+ * <p>
+ * Zero or more results may be set as part of the data.
+ */
+public class OperationStatusMetaData implements RequestStatusMetaData, ResultMetadata {
+
+  private final Map<String, Result> results = new HashMap<>();
+
+  public void addResult(String id, boolean success, String message, Object response) {
+    results.put(id, new Result(id, success, message, response));
+  }
+
+  public Set<String> getResultIds() {
+    return results.keySet();
+  }
+
+  public Result getResult(String id) {
+    if (results.containsKey(id)) {
+      return results.get(id);
+    }
+
+    throw new NoSuchElementException();
+  }
+
+  public List<Result> getResults() {
+    return new ArrayList<>(results.values());
+  }
+
+  public class Result {
+    private final String id;
+    private final boolean success;
+    private final String message;
+    private final Object response;
+
+    Result(String id, boolean success, String message, Object response) {
+      this.id = id;
+      this.success = success;
+      this.message = message;
+      this.response = response;
+    }
+
+    public String getId() {
+      return id;
+    }
+
+    public boolean isSuccess() {
+      return success;
+    }
+
+    public String getMessage() {
+      return message;
+    }
+
+    public Object getResponse() {
+      return response;
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationHandler.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationHandler.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationHandler.java
new file mode 100644
index 0000000..3b58ce1
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationHandler.java
@@ -0,0 +1,114 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.server.controller.internal;
+
+import java.util.Map;
+
+import org.apache.ambari.server.controller.spi.NoSuchResourceException;
+import org.apache.ambari.server.controller.spi.SystemException;
+
+/**
+ * RootServiceComponentConfigurationHandler is an interface to be implemented to handle the different
+ * types of root-level configurations.
+ */
+abstract class RootServiceComponentConfigurationHandler {
+  /**
+   * Retrieve the request configurations.
+   *
+   * @param categoryName the category name (or <code>null</code> for all)
+   * @return a map of category names to properties (name/value pairs).
+   * @throws NoSuchResourceException if the requested data is not found
+   */
+  public abstract Map<String, Map<String, String>> getConfigurations(String categoryName) throws NoSuchResourceException;
+
+  /**
+   * Delete the requested configuration.
+   *
+   * @param categoryName the category name
+   * @throws NoSuchResourceException if the requested category does not exist
+   */
+  public abstract void removeConfiguration(String categoryName) throws NoSuchResourceException;
+
+  /**
+   * Set or update a configuration category with the specified properties.
+   * <p>
+   * If <code>removePropertiesIfNotSpecified</code> is <code>true</code>, the persisted category is to include only the specified properties.
+   * <p>
+   * If <code>removePropertiesIfNotSpecified</code> is <code>false</code>, the persisted category is to include the union of the existing and specified properties.
+   * <p>
+   * In any case, existing property values will be overwritten by the one specified in the property map.
+   *
+   * @param categoryName                   the category name
+   * @param properties                     a map of properties to set
+   * @param removePropertiesIfNotSpecified <code>true</code> to ensure the set of properties are only those that have be explicitly specified;
+   *                                       <code>false</code> to update the set of existing properties with the specified set of properties, adding missing properties but not removing any properties
+   */
+  public abstract void updateCategory(String categoryName, Map<String, String> properties, boolean removePropertiesIfNotSpecified);
+
+  /**
+   * Preform some operation on the set of data for a category.
+   * <p>
+   * If <code>mergeExistingProperties</code> is <code>false</code>, the operation is to include the union of the existing and specified properties.
+   * <p>
+   * If <code>mergeExistingProperties</code> is <code>false</code>, the operation is to include only the specified properties.
+   *
+   * @param categoryName            the category name
+   * @param properties              a map of properties to set
+   * @param mergeExistingProperties <code>true</code> to use the the set of existing properties along with the specified set of properties;
+   *                                <code>false</code>  to use set of specified properties only
+   * @param operation               the operation to perform
+   * @param operationParameters     parameters to supply the name operation
+   * @return an {@link OperationResult}
+   * @throws SystemException if an error occurs while handling the request
+   */
+  public abstract OperationResult performOperation(String categoryName, Map<String, String> properties,
+                                                   boolean mergeExistingProperties, String operation,
+                                                   Map<String, Object> operationParameters) throws SystemException;
+
+  class OperationResult {
+    private final String id;
+    private final boolean success;
+    private final String message;
+    private final Object response;
+
+    OperationResult(String id, boolean success, String message, Object response) {
+      this.id = id;
+      this.success = success;
+      this.message = message;
+      this.response = response;
+    }
+
+    public String getId() {
+      return id;
+    }
+
+    public boolean isSuccess() {
+      return success;
+    }
+
+    public String getMessage() {
+      return message;
+    }
+
+    public Object getResponse() {
+      return response;
+    }
+
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationHandlerFactory.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationHandlerFactory.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationHandlerFactory.java
new file mode 100644
index 0000000..38b5373
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationHandlerFactory.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.server.controller.internal;
+
+import org.apache.ambari.server.controller.RootComponent;
+import org.apache.ambari.server.controller.RootService;
+
+import com.google.inject.Singleton;
+
+/**
+ * RootServiceComponentConfigurationHandlerFactory produces RootServiceComponentConfigurationHandler
+ * implementations for the relevant service, component, and category.
+ */
+@Singleton
+public class RootServiceComponentConfigurationHandlerFactory {
+
+  /**
+   * Returns the internal configuration handler used to support various configuration storage facilities.
+   *
+   * @param serviceName   the service name
+   * @param componentName the component name
+   * @param categoryName  the category name
+   * @return a {@link RootServiceComponentConfigurationHandler}
+   */
+  public RootServiceComponentConfigurationHandler getInstance(String serviceName, String componentName, String categoryName) {
+    if (RootService.AMBARI.name().equals(serviceName)) {
+      if (RootComponent.AMBARI_SERVER.name().equals(componentName)) {
+        if (AmbariServerConfigurationCategory.LDAP_CONFIGURATION.getCategoryName().equals(categoryName)) {
+          return new AmbariServerLDAPConfigurationHandler();
+        } else {
+          return new AmbariServerConfigurationHandler();
+        }
+      }
+    }
+
+    return null;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationResourceProvider.java
index 7807865..b9e7d67 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationResourceProvider.java
@@ -22,14 +22,11 @@ import java.util.Collections;
 import java.util.EnumSet;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.TreeMap;
 
 import org.apache.ambari.server.AmbariException;
-import org.apache.ambari.server.controller.RootComponent;
-import org.apache.ambari.server.controller.RootService;
+import org.apache.ambari.server.api.services.RootServiceComponentConfigurationService;
 import org.apache.ambari.server.controller.spi.NoSuchParentResourceException;
 import org.apache.ambari.server.controller.spi.NoSuchResourceException;
 import org.apache.ambari.server.controller.spi.Predicate;
@@ -41,22 +38,14 @@ import org.apache.ambari.server.controller.spi.SystemException;
 import org.apache.ambari.server.controller.spi.UnsupportedPropertyException;
 import org.apache.ambari.server.controller.utilities.PredicateHelper;
 import org.apache.ambari.server.controller.utilities.PropertyHelper;
-import org.apache.ambari.server.events.AmbariConfigurationChangedEvent;
-import org.apache.ambari.server.events.publishers.AmbariEventPublisher;
-import org.apache.ambari.server.orm.dao.AmbariConfigurationDAO;
-import org.apache.ambari.server.orm.entities.AmbariConfigurationEntity;
 import org.apache.ambari.server.security.authorization.RoleAuthorization;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 import com.google.inject.Inject;
 
 public class RootServiceComponentConfigurationResourceProvider extends AbstractAuthorizedResourceProvider {
 
-  private static final Logger LOGGER = LoggerFactory.getLogger(RootServiceComponentConfigurationResourceProvider.class);
-
   static final String RESOURCE_KEY = "Configuration";
 
   public static final String CONFIGURATION_CATEGORY_PROPERTY_ID = PropertyHelper.getPropertyId(RESOURCE_KEY, "category");
@@ -89,10 +78,7 @@ public class RootServiceComponentConfigurationResourceProvider extends AbstractA
   }
 
   @Inject
-  private AmbariConfigurationDAO ambariConfigurationDAO;
-
-  @Inject
-  private AmbariEventPublisher publisher;
+  private RootServiceComponentConfigurationHandlerFactory rootServiceComponentConfigurationHandlerFactory;
 
   public RootServiceComponentConfigurationResourceProvider() {
     super(PROPERTIES, PK_PROPERTY_MAP);
@@ -113,9 +99,20 @@ public class RootServiceComponentConfigurationResourceProvider extends AbstractA
   public RequestStatus createResourcesAuthorized(Request request)
       throws SystemException, UnsupportedPropertyException, ResourceAlreadyExistsException, NoSuchParentResourceException {
 
-    createOrAddProperties(null, null, null, request.getProperties(), true);
+    OperationStatusMetaData operationStatusMetadata = null;
 
-    return getRequestStatus(null);
+    Map<String, String> requestInfoProperties = request.getRequestInfoProperties();
+    if (requestInfoProperties.containsKey(RootServiceComponentConfigurationService.DIRECTIVE_OPERATION)) {
+      String operationType = requestInfoProperties.get(RootServiceComponentConfigurationService.DIRECTIVE_OPERATION);
+      Map<String, Object> operationParameters = getOperationParameters(requestInfoProperties);
+
+      operationStatusMetadata = performOperation(null, null, null, request.getProperties(),
+          false, operationType, operationParameters);
+    } else {
+      createOrAddProperties(null, null, null, request.getProperties(), true);
+    }
+
+    return getRequestStatus(null, null, operationStatusMetadata);
   }
 
   @Override
@@ -163,7 +160,6 @@ public class RootServiceComponentConfigurationResourceProvider extends AbstractA
     });
   }
 
-
   @Override
   protected RequestStatus deleteResourcesAuthorized(Request request, Predicate predicate) throws SystemException,
       UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
@@ -172,7 +168,7 @@ public class RootServiceComponentConfigurationResourceProvider extends AbstractA
     String componentName = (String) PredicateHelper.getProperties(predicate).get(CONFIGURATION_COMPONENT_NAME_PROPERTY_ID);
     String categoryName = (String) PredicateHelper.getProperties(predicate).get(CONFIGURATION_CATEGORY_PROPERTY_ID);
 
-    ConfigurationHandler handler = getConfigurationHandler(serviceName, componentName);
+    RootServiceComponentConfigurationHandler handler = rootServiceComponentConfigurationHandlerFactory.getInstance(serviceName, componentName, categoryName);
     if (handler != null) {
       handler.removeConfiguration(categoryName);
     } else {
@@ -190,9 +186,20 @@ public class RootServiceComponentConfigurationResourceProvider extends AbstractA
     String componentName = (String) PredicateHelper.getProperties(predicate).get(CONFIGURATION_COMPONENT_NAME_PROPERTY_ID);
     String categoryName = (String) PredicateHelper.getProperties(predicate).get(CONFIGURATION_CATEGORY_PROPERTY_ID);
 
-    createOrAddProperties(serviceName, componentName, categoryName, request.getProperties(), false);
+    OperationStatusMetaData operationStatusMetadata = null;
 
-    return getRequestStatus(null);
+    Map<String, String> requestInfoProperties = request.getRequestInfoProperties();
+    if (requestInfoProperties.containsKey(RootServiceComponentConfigurationService.DIRECTIVE_OPERATION)) {
+      String operationType = requestInfoProperties.get(RootServiceComponentConfigurationService.DIRECTIVE_OPERATION);
+      Map<String, Object> operationParameters = getOperationParameters(requestInfoProperties);
+
+      operationStatusMetadata = performOperation(serviceName, componentName, categoryName, request.getProperties(),
+          true, operationType, operationParameters);
+    } else {
+      createOrAddProperties(serviceName, componentName, categoryName, request.getProperties(), false);
+    }
+
+    return getRequestStatus(null, null, operationStatusMetadata);
   }
 
   private Resource toResource(String serviceName, String componentName, String categoryName, Map<String, String> properties, Set<String> requestedIds) {
@@ -211,7 +218,7 @@ public class RootServiceComponentConfigurationResourceProvider extends AbstractA
    * value and one or more property (<code>AmbariConfiguration/properties/property.name</code>) values.
    * If a category cannot be determined from the propery set, the default category value (passed in)
    * is used.  If a default category is set, it is assumed that it was parsed from the request predicate
-   * (if availabe).
+   * (if available).
    *
    * @param defaultServiceName             the default service name to use if needed
    * @param defaultComponentName           the default component name to use if needed
@@ -229,8 +236,7 @@ public class RootServiceComponentConfigurationResourceProvider extends AbstractA
       for (Map<String, Object> resourceProperties : requestProperties) {
         RequestDetails requestDetails = parseProperties(defaultServiceName, defaultComponentName, defaultCategoryName, resourceProperties);
 
-        ConfigurationHandler handler = getConfigurationHandler(requestDetails.serviceName, requestDetails.componentName);
-
+        RootServiceComponentConfigurationHandler handler = rootServiceComponentConfigurationHandlerFactory.getInstance(requestDetails.serviceName, requestDetails.componentName, requestDetails.categoryName);
         if (handler != null) {
           handler.updateCategory(requestDetails.categoryName, requestDetails.properties, removePropertiesIfNotSpecified);
         } else {
@@ -241,6 +247,49 @@ public class RootServiceComponentConfigurationResourceProvider extends AbstractA
   }
 
   /**
+   * Performs the requested operation on the set of data for the specified configration data.
+   *
+   * @param defaultServiceName      the default service name to use if needed
+   * @param defaultComponentName    the default component name to use if needed
+   * @param defaultCategoryName     the default category to use if needed
+   * @param requestProperties       a collection of property maps parsed from the request
+   * @param mergeExistingProperties <code>true</code> to use the the set of existing properties along with the specified set of properties;
+   *                                <code>false</code>  to use set of specified properties only
+   * @param operationType           the operation to perform
+   * @param operationParameters     parameters to supply the name operation
+   * @return an {@link OperationStatusMetaData}
+   * @throws SystemException if an error occurs while performing the operation
+   */
+  private OperationStatusMetaData performOperation(String defaultServiceName, String defaultComponentName, String defaultCategoryName,
+                                                   Set<Map<String, Object>> requestProperties, boolean mergeExistingProperties,
+                                                   String operationType, Map<String, Object> operationParameters)
+      throws SystemException {
+
+    OperationStatusMetaData metaData = new OperationStatusMetaData();
+
+    // set of resource properties (each entry in the set belongs to a different resource)
+    if (requestProperties != null) {
+      for (Map<String, Object> resourceProperties : requestProperties) {
+        RequestDetails requestDetails = parseProperties(defaultServiceName, defaultComponentName, defaultCategoryName, resourceProperties);
+
+        RootServiceComponentConfigurationHandler handler = rootServiceComponentConfigurationHandlerFactory.getInstance(requestDetails.serviceName, requestDetails.componentName, requestDetails.categoryName);
+        if (handler != null) {
+          RootServiceComponentConfigurationHandler.OperationResult operationResult = handler.performOperation(requestDetails.categoryName, requestDetails.properties, mergeExistingProperties, operationType, operationParameters);
+          if (operationResult == null) {
+            throw new SystemException(String.format("An unexpected error has occurred while handling an operation for the %s component of the root service, %s", requestDetails.serviceName, requestDetails.componentName));
+          }
+
+          metaData.addResult(operationResult.getId(), operationResult.isSuccess(), operationResult.getMessage(), operationResult.getResponse());
+        } else {
+          throw new SystemException(String.format("Operations may not be performed on configurations for the %s component of the root service, %s", requestDetails.serviceName, requestDetails.componentName));
+        }
+      }
+    }
+
+    return metaData;
+  }
+
+  /**
    * Parse the property map from a request into a map of services to components to category names to maps of property names and values.
    *
    * @param defaultServiceName   the default service name to use if one is not found in the map of properties
@@ -300,7 +349,31 @@ public class RootServiceComponentConfigurationResourceProvider extends AbstractA
   }
 
   /**
-   * Retrieves the requested configration resources
+   * Creates a map of the operation parameters from the data in the request info map.
+   * <p>
+   * Operation parmaters are set under the "parameters" category.
+   *
+   * @param requestInfoProperties a map of request info properties
+   * @return a map of operation request parameters
+   */
+  private Map<String, Object> getOperationParameters(Map<String, String> requestInfoProperties) {
+    Map<String, Object> operationParameters = new HashMap<>();
+
+    for (Map.Entry<String, String> entry : requestInfoProperties.entrySet()) {
+      String propertyCategory = PropertyHelper.getPropertyCategory(entry.getKey());
+      if ((propertyCategory != null) && propertyCategory.equals("parameters")) {
+        String name = PropertyHelper.getPropertyName(entry.getKey());
+        Object value = entry.getValue();
+        operationParameters.put(name, (value == null) ? null : value.toString());
+      }
+    }
+
+    return operationParameters;
+  }
+
+
+  /**
+   * Retrieves the requested configuration resources
    *
    * @param requestedIds the requested properties ids
    * @param propertyMap  the request properties
@@ -312,11 +385,11 @@ public class RootServiceComponentConfigurationResourceProvider extends AbstractA
 
     String serviceName = getStringProperty(propertyMap, CONFIGURATION_SERVICE_NAME_PROPERTY_ID);
     String componentName = getStringProperty(propertyMap, CONFIGURATION_COMPONENT_NAME_PROPERTY_ID);
+    String categoryName = getStringProperty(propertyMap, CONFIGURATION_CATEGORY_PROPERTY_ID);
 
-    ConfigurationHandler handler = getConfigurationHandler(serviceName, componentName);
+    RootServiceComponentConfigurationHandler handler = rootServiceComponentConfigurationHandlerFactory.getInstance(serviceName, componentName, categoryName);
 
     if (handler != null) {
-      String categoryName = getStringProperty(propertyMap, CONFIGURATION_CATEGORY_PROPERTY_ID);
       Map<String, Map<String, String>> configurations = handler.getConfigurations(categoryName);
 
       if (configurations != null) {
@@ -329,24 +402,6 @@ public class RootServiceComponentConfigurationResourceProvider extends AbstractA
     return resources;
   }
 
-  /**
-   * Returns the internal configuration handler used to support various configuration storage facilites.
-   *
-   * @param serviceName   the service name
-   * @param componentName the component name
-   * @return
-   */
-  private ConfigurationHandler getConfigurationHandler(String serviceName, String componentName) {
-    if (RootService.AMBARI.name().equals(serviceName)) {
-      if (RootComponent.AMBARI_SERVER.name().equals(componentName)) {
-        return new AmbariServerConfigurationHandler();
-      }
-    }
-
-    return null;
-  }
-
-
   private String getStringProperty(Map<String, Object> propertyMap, String propertyId) {
     String value = null;
 
@@ -361,102 +416,6 @@ public class RootServiceComponentConfigurationResourceProvider extends AbstractA
   }
 
   /**
-   * ConfigurationHandler is an interface to be implemented to support the relevant types of storage
-   * used to persist root-level component configurations.
-   */
-  private abstract class ConfigurationHandler {
-    /**
-     * Retrieve the request configurations.
-     *
-     * @param categoryName the category name (or <code>null</code> for all)
-     * @return a map of category names to properties (name/value pairs).
-     * @throws NoSuchResourceException if the requested data is not found
-     */
-    public abstract Map<String, Map<String, String>> getConfigurations(String categoryName) throws NoSuchResourceException;
-
-    /**
-     * Delete the requested configuration.
-     *
-     * @param categoryName the category name
-     * @throws NoSuchResourceException if the requested category does not exist
-     */
-    public abstract void removeConfiguration(String categoryName) throws NoSuchResourceException;
-
-    /**
-     * Set or update a configuration category with the specified properties.
-     * <p>
-     * If <code>removePropertiesIfNotSpecified</code> is <code>true</code>, the persisted category is to include only the specified properties.
-     * <p>
-     * If <code>removePropertiesIfNotSpecified</code> is <code>false</code>, the persisted category is to include the union of the existing and specified properties.
-     * <p>
-     * In any case, existing property values will be overwritten by the one specified in the property map.
-     *
-     * @param categoryName                   the category name
-     * @param properties                     a map of properties to set
-     * @param removePropertiesIfNotSpecified <code>true</code> to ensure the set of properties are only those that have be explicitly specified;
-     *                                       <code>false</code> to update the set of exising properties with the specified set of properties, adding missing properties but not removing any properties
-     */
-    public abstract void updateCategory(String categoryName, Map<String, String> properties, boolean removePropertiesIfNotSpecified);
-  }
-
-  /**
-   * AmbariServerConfigurationHandler handle Ambari server specific configuration properties.
-   */
-  private class AmbariServerConfigurationHandler extends ConfigurationHandler {
-    @Override
-    public Map<String, Map<String, String>> getConfigurations(String categoryName)
-        throws NoSuchResourceException {
-      Map<String, Map<String, String>> configurations = null;
-
-      List<AmbariConfigurationEntity> entities = (categoryName == null)
-          ? ambariConfigurationDAO.findAll()
-          : ambariConfigurationDAO.findByCategory(categoryName);
-
-      if (entities != null) {
-        configurations = new HashMap<>();
-
-        for (AmbariConfigurationEntity entity : entities) {
-          String category = entity.getCategoryName();
-          Map<String, String> properties = configurations.get(category);
-
-          if (properties == null) {
-            properties = new TreeMap<>();
-            configurations.put(category, properties);
-          }
-
-          properties.put(entity.getPropertyName(), entity.getPropertyValue());
-        }
-      }
-
-      return configurations;
-    }
-
-    @Override
-    public void removeConfiguration(String categoryName) throws NoSuchResourceException {
-      if (null == categoryName) {
-        LOGGER.debug("No resource id provided in the request");
-      } else {
-        LOGGER.debug("Deleting Ambari configuration with id: {}", categoryName);
-        try {
-          if (ambariConfigurationDAO.removeByCategory(categoryName) > 0) {
-            publisher.publish(new AmbariConfigurationChangedEvent(categoryName));
-          }
-        } catch (IllegalStateException e) {
-          throw new NoSuchResourceException(e.getMessage());
-        }
-      }
-    }
-
-    @Override
-    public void updateCategory(String categoryName, Map<String, String> properties, boolean removePropertiesIfNotSpecified) {
-      if (ambariConfigurationDAO.reconcileCategory(categoryName, properties, removePropertiesIfNotSpecified)) {
-        // notify subscribers about the configuration changes
-        publisher.publish(new AmbariConfigurationChangedEvent(categoryName));
-      }
-    }
-  }
-
-  /**
    * RequestDetails is a container for details parsed from the request.
    */
   private class RequestDetails {

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapModule.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapModule.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapModule.java
index 089da1d..64e94c4 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapModule.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapModule.java
@@ -16,7 +16,6 @@
 package org.apache.ambari.server.ldap;
 
 import org.apache.ambari.server.ldap.domain.AmbariLdapConfiguration;
-import org.apache.ambari.server.ldap.domain.AmbariLdapConfigurationFactory;
 import org.apache.ambari.server.ldap.service.AmbariLdapConfigurationProvider;
 import org.apache.ambari.server.ldap.service.AmbariLdapFacade;
 import org.apache.ambari.server.ldap.service.AttributeDetector;
@@ -36,7 +35,6 @@ import org.apache.ambari.server.ldap.service.ads.detectors.UserNameAttrDetector;
 import org.apache.ambari.server.ldap.service.ads.detectors.UserObjectClassDetector;
 
 import com.google.inject.AbstractModule;
-import com.google.inject.assistedinject.FactoryModuleBuilder;
 import com.google.inject.multibindings.Multibinder;
 import com.google.inject.name.Names;
 
@@ -60,8 +58,6 @@ public class LdapModule extends AbstractModule {
 
     bind(AttributeDetectorFactory.class);
 
-    install(new FactoryModuleBuilder().build(AmbariLdapConfigurationFactory.class));
-
     // binding the set of user attributes detector
     Multibinder<AttributeDetector> userAttributeDetectorBinder = Multibinder.newSetBinder(binder(), AttributeDetector.class,
       Names.named(USER_ATTRIBUTES_DETECTORS));

http://git-wip-us.apache.org/repos/asf/ambari/blob/4240f849/ambari-server/src/main/java/org/apache/ambari/server/ldap/domain/AmbariLdapConfigKeys.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/domain/AmbariLdapConfigKeys.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/domain/AmbariLdapConfigKeys.java
deleted file mode 100644
index da655ad..0000000
--- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/domain/AmbariLdapConfigKeys.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ambari.server.ldap.domain;
-
-/**
- * Constants representing supported LDAP related property names
- * // todo extend this with validation information, description, defaults maybe
- */
-public enum AmbariLdapConfigKeys {
-
-  LDAP_ENABLED("ambari.ldap.authentication.enabled"),
-  SERVER_HOST("ambari.ldap.connectivity.server.host"),
-  SERVER_PORT("ambari.ldap.connectivity.server.port"),
-  USE_SSL("ambari.ldap.connectivity.use_ssl"),
-
-  TRUST_STORE("ambari.ldap.connectivity.trust_store"),
-  TRUST_STORE_TYPE("ambari.ldap.connectivity.trust_store.type"),
-  TRUST_STORE_PATH("ambari.ldap.connectivity.trust_store.path"),
-  TRUST_STORE_PASSWORD("ambari.ldap.connectivity.trust_store.password"),
-  ANONYMOUS_BIND("ambari.ldap.connectivity.anonymous_bind"),
-
-  BIND_DN("ambari.ldap.connectivity.bind_dn"),
-  BIND_PASSWORD("ambari.ldap.connectivity.bind_password"),
-
-  ATTR_DETECTION("ambari.ldap.attributes.detection"), // manual | auto
-
-  DN_ATTRIBUTE("ambari.ldap.attributes.dn_attr"),
-
-  USER_OBJECT_CLASS("ambari.ldap.attributes.user.object_class"),
-  USER_NAME_ATTRIBUTE("ambari.ldap.attributes.user.name_attr"),
-  USER_GROUP_MEMBER_ATTRIBUTE("ambari.ldap.attributes.user.group_member_attr"),
-  USER_SEARCH_BASE("ambari.ldap.attributes.user.search_base"),
-
-  GROUP_OBJECT_CLASS("ambari.ldap.attributes.group.object_class"),
-  GROUP_NAME_ATTRIBUTE("ambari.ldap.attributes.group.name_attr"),
-  GROUP_MEMBER_ATTRIBUTE("ambari.ldap.attributes.group.member_attr"),
-  GROUP_SEARCH_BASE("ambari.ldap.attributes.group.search_base"),
-
-  USER_SEARCH_FILTER("ambari.ldap.advanced.user_search_filter"),
-  USER_MEMBER_REPLACE_PATTERN("ambari.ldap.advanced.user_member_replace_pattern"),
-  USER_MEMBER_FILTER("ambari.ldap.advanced.user_member_filter"),
-
-  GROUP_SEARCH_FILTER("ambari.ldap.advanced.group_search_filter"),
-  GROUP_MEMBER_REPLACE_PATTERN("ambari.ldap.advanced.group_member_replace_pattern"),
-  GROUP_MEMBER_FILTER("ambari.ldap.advanced.group_member_filter"),
-
-  FORCE_LOWERCASE_USERNAMES("ambari.ldap.advanced.force_lowercase_usernames"),
-  REFERRAL_HANDLING("ambari.ldap.advanced.referrals"), // folow
-  PAGINATION_ENABLED("ambari.ldap.advanced.pagination_enabled"); // true | false
-
-  private String propertyName;
-
-  AmbariLdapConfigKeys(String propName) {
-    this.propertyName = propName;
-  }
-
-  public String key() {
-    return this.propertyName;
-  }
-
-  public static AmbariLdapConfigKeys fromKeyStr(String keyStr) {
-    for (AmbariLdapConfigKeys key : values()) {
-      if (key.key().equals(keyStr)) {
-        return key;
-      }
-    }
-
-    throw new IllegalStateException("invalid konfiguration key found!");
-
-  }
-}


[05/29] ambari git commit: AMBARI-22548 Admin View: update toggle styles. (atkach)

Posted by rl...@apache.org.
AMBARI-22548 Admin View: update toggle styles. (atkach)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c3150a46
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c3150a46
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c3150a46

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: c3150a4652d8b129383a9a49fc3fd78991b224b7
Parents: 1f7bd75
Author: Andrii Tkach <at...@apache.org>
Authored: Wed Nov 29 19:27:44 2017 +0200
Committer: Andrii Tkach <at...@apache.org>
Committed: Thu Nov 30 12:40:00 2017 +0200

----------------------------------------------------------------------
 .../ui/admin-web/app/styles/toggle-switch.css   | 72 ++++++++++++++++++++
 .../app/views/ambariViews/modals/create.html    |  3 +-
 .../app/views/authentication/main.html          |  6 +-
 .../views/loginActivities/homeDirectory.html    |  6 +-
 .../app/views/loginActivities/loginMessage.html |  6 +-
 .../userManagement/modals/groupCreate.html      |  3 +-
 .../views/userManagement/modals/userCreate.html | 11 ++-
 .../app/views/userManagement/userEdit.html      | 12 ++--
 8 files changed, 104 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c3150a46/ambari-admin/src/main/resources/ui/admin-web/app/styles/toggle-switch.css
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/styles/toggle-switch.css b/ambari-admin/src/main/resources/ui/admin-web/app/styles/toggle-switch.css
new file mode 100644
index 0000000..3e36a6c
--- /dev/null
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/styles/toggle-switch.css
@@ -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.
+ */
+
+.ats-switch {
+  border-radius: 20px;
+  height: 40px;
+  min-width: 66px;
+  width: 66px;
+  position: relative;
+  overflow: hidden;
+  border-color: #EBECF1;
+  border-width: 2px;
+}
+
+.ats-switch .knob {
+  margin-left: 34px;
+  border-radius: 20px;
+  height: 32px;
+  width: 32px;
+  margin-top: 2px;
+}
+
+.ats-switch .switch-left,
+.ats-switch .switch-right {
+  position: absolute;
+  right: -40px;
+}
+
+.ats-switch .switch-animate {
+  height: 100%;
+}
+
+.ats-switch .switch-off {
+  background-color: white;
+}
+
+.ats-switch .switch-on {
+  background-color: #1EB475;
+  left: -10%;
+}
+
+.ats-switch .switch-on .knob {
+  background-color: white;
+}
+
+.ats-switch .switch-off .knob {
+  background-color: #999;
+}
+
+.switch-option-label {
+  padding-left: 5px;
+  font-size: 14px;
+}
+
+.switch-inline-label {
+  line-height: 40px;
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c3150a46/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/modals/create.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/modals/create.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/modals/create.html
index 82f90b3..b9d50c7 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/modals/create.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/modals/create.html
@@ -17,7 +17,7 @@
 -->
 <form role="form" id="create-instance-form" name="form.instanceCreateForm" novalidate>
 <div class="modal-header">
-  <h1 class="modal-title">
+  <h1 class="modal-title col-sm-8">
     <span ng-if="!instanceClone">
       {{'views.create' | translate}}
     </span>
@@ -25,6 +25,7 @@
       {{'views.clone' | translate}}
     </span>
   </h1>
+  <a class="close" aria-hidden="true" ng-click="cancel()">&times;</a>
 </div>
 <div class="modal-body" ng-hide="isLoading">
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/c3150a46/ambari-admin/src/main/resources/ui/admin-web/app/views/authentication/main.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/authentication/main.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/authentication/main.html
index 0275a21..9e672e1 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/authentication/main.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/authentication/main.html
@@ -28,9 +28,11 @@
   <div class="form-horizontal">
     <div class="form-group col-sm-12">{{'authentication.description' | translate}}</div>
     <div class="form-group">
-      <label class="control-label col-sm-4">{{'authentication.ldap' | translate}}</label>
+      <label class="switch-inline-label col-sm-4">{{'authentication.ldap' | translate}}</label>
       <span class="col-sm-8">
-        <toggle-switch model="isLDAPEnabled" ng-disabled="isRequestRunning" on-label="{{'authentication.on' | translate}}" off-label="{{'authentication.off' | translate}}" class="switch-primary" data-off-color="danger" on-change="toggleAuthentication()"></toggle-switch>
+        <toggle-switch model="isLDAPEnabled" ng-disabled="isRequestRunning" class="switch-success" data-off-color="danger" on-change="toggleAuthentication()"></toggle-switch>
+        <span ng-if="isLDAPEnabled" class="switch-option-label">{{'authentication.on' | translate}}</span>
+        <span ng-if="!isLDAPEnabled" class="switch-option-label">{{'authentication.off' | translate}}</span>
       </span>
     </div>
   </div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/c3150a46/ambari-admin/src/main/resources/ui/admin-web/app/views/loginActivities/homeDirectory.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/loginActivities/homeDirectory.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/loginActivities/homeDirectory.html
index 913bc0f..7cf17cd 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/loginActivities/homeDirectory.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/loginActivities/homeDirectory.html
@@ -25,9 +25,11 @@
       </div>
       <fieldset>
         <div class="form-group">
-          <label class="col-sm-4 control-label">{{'common.loginActivities.homeDirectory.autoCreate' | translate}}</label>
+          <label class="col-sm-4 switch-inline-label">{{'common.loginActivities.homeDirectory.autoCreate' | translate}}</label>
           <div class="col-sm-8">
-            <toggle-switch model="autoCreate" on-label="{{'common.enabled' | translate}}" off-label="{{'common.disabled' | translate}}" class="switch-primary"></toggle-switch>
+            <toggle-switch model="autoCreate" class="switch-success"></toggle-switch>
+            <span ng-if="autoCreate" class="switch-option-label">{{'common.enabled' | translate}}</span>
+            <span ng-if="!autoCreate" class="switch-option-label">{{'common.disabled' | translate}}</span>
           </div>
           <input type="checkbox" name="autoCreate" class="hidden" ng-model="autoCreate">
         </div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/c3150a46/ambari-admin/src/main/resources/ui/admin-web/app/views/loginActivities/loginMessage.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/loginActivities/loginMessage.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/loginActivities/loginMessage.html
index e5890e5..3055ba1 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/loginActivities/loginMessage.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/loginActivities/loginMessage.html
@@ -22,9 +22,11 @@
     <div class="well">
       <fieldset>
         <div class="form-group">
-          <label class="col-sm-2 control-label">{{'common.loginActivities.status' | translate}}</label>
+          <label class="col-sm-2 switch-inline-label">{{'common.loginActivities.status' | translate}}</label>
           <div class="col-sm-10">
-            <toggle-switch ng-click="changeStatus();" model="status" on-label="{{'common.enabled' | translate}}" off-label="{{'common.disabled' | translate}}" class="switch-primary userstatus" data-off-color="disabled"></toggle-switch>
+            <toggle-switch ng-click="changeStatus();" model="status" class="switch-success" data-off-color="disabled"></toggle-switch>
+            <span ng-if="status" class="switch-option-label">{{'common.enabled' | translate}}</span>
+            <span ng-if="!status" class="switch-option-label">{{'common.disabled' | translate}}</span>
           </div>
           <input type="checkbox" name="status" class="hidden" ng-model="status">
         </div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/c3150a46/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/modals/groupCreate.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/modals/groupCreate.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/modals/groupCreate.html
index e11b478..7692a68 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
@@ -18,9 +18,10 @@
 
 <form id="create-group-form" role="form" novalidate name="form.groupCreateForm">
   <div class="modal-header">
-    <h1 class="modal-title">
+    <h1 class="modal-title col-sm-8">
       {{'groups.createLocal' | translate}}
     </h1>
+    <a class="close" aria-hidden="true" ng-click="cancel()">&times;</a>
   </div>
   <div class="modal-body">
     <div class="form-group"

http://git-wip-us.apache.org/repos/asf/ambari/blob/c3150a46/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/modals/userCreate.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/modals/userCreate.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/modals/userCreate.html
index 2a71102..b1b5876 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
@@ -18,9 +18,10 @@
 
 <form id="create-user-form" role="form" novalidate name="form.userCreateForm">
   <div class="modal-header">
-    <h1 class="modal-title">
+    <h1 class="modal-title col-sm-8">
       {{'users.create' | translate}}
     </h1>
+    <a class="close" aria-hidden="true" ng-click="cancel()">&times;</a>
   </div>
   <div class="modal-body">
     <div class="form-group"
@@ -125,7 +126,9 @@
         <i class="fa fa-question-circle" aria-hidden="true"></i>
       </label>
       <div>
-        <toggle-switch model="formData.isAdmin" on-label="{{'common.yes' | translate}}" off-label="{{'common.no' | translate}}" class="switch-primary" data-off-color="danger"></toggle-switch>
+        <toggle-switch model="formData.isAdmin" class="switch-success" data-off-color="danger"></toggle-switch>
+        <span ng-if="formData.isAdmin" class="switch-option-label">{{'common.yes' | translate}}</span>
+        <span ng-if="!formData.isAdmin" class="switch-option-label">{{'common.no' | translate}}</span>
       </div>
     </div>
 
@@ -135,7 +138,9 @@
         <i class="fa fa-question-circle" aria-hidden="true"></i>
       </label>
       <div>
-        <toggle-switch model="formData.isActive" on-label="{{'users.active' | translate}}" off-label="{{'users.inactive' | translate}}" class="switch-primary" data-off-color="danger"></toggle-switch>
+        <toggle-switch model="formData.isActive" class="switch-success" data-off-color="danger"></toggle-switch>
+        <span ng-if="formData.isActive" class="switch-option-label">{{'users.active' | translate}}</span>
+        <span ng-if="!formData.isActive" class="switch-option-label">{{'users.inactive' | translate}}</span>
       </div>
     </div>
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/c3150a46/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/userEdit.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/userEdit.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/userManagement/userEdit.html
index cc46173..8a96663 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
@@ -38,15 +38,19 @@
       </div>
     </div>
     <div class="form-group">
-      <label class="col-sm-2 ">{{'users.status' | translate}}</label>
+      <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" on-label="{{'users.active' | translate}}" off-label="{{'users.inactive' | translate}}" class="switch-primary 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>
     </div>
     <div class="form-group">
-      <label class="col-sm-2 "><span class="glyphicon glyphicon-flash"></span> {{'users.ambariAdmin' | translate}}</label>
+      <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" on-label="{{'common.yes' | translate}}" off-label="{{'common.no' | translate}}" class="switch-primary 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>
     </div>
     <div class="form-group">


[27/29] ambari git commit: AMBARI-22556 - Reduce load from STS health check (Mingjie Tang via jonathanhurley)

Posted by rl...@apache.org.
AMBARI-22556 - Reduce load from STS health check (Mingjie Tang via jonathanhurley)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/158c94ae
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/158c94ae
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/158c94ae

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 158c94ae32d31d65c2141acd4cb26ed765a181e1
Parents: 88b59a6
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Fri Dec 1 16:33:59 2017 -0500
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Fri Dec 1 16:35:13 2017 -0500

----------------------------------------------------------------------
 .../src/main/resources/common-services/SPARK/1.2.1/alerts.json     | 2 +-
 .../src/main/resources/common-services/SPARK2/2.0.0/alerts.json    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/158c94ae/ambari-server/src/main/resources/common-services/SPARK/1.2.1/alerts.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SPARK/1.2.1/alerts.json b/ambari-server/src/main/resources/common-services/SPARK/1.2.1/alerts.json
index 5035ecf..173aacd 100644
--- a/ambari-server/src/main/resources/common-services/SPARK/1.2.1/alerts.json
+++ b/ambari-server/src/main/resources/common-services/SPARK/1.2.1/alerts.json
@@ -57,7 +57,7 @@
         "name": "spark_thriftserver_status",
         "label": "Spark Thrift Server",
         "description": "This host-level alert is triggered if the Spark Thrift Server cannot be determined to be up.",
-        "interval": 1,
+        "interval": 5,
         "scope": "HOST",
         "source": {
           "type": "SCRIPT",

http://git-wip-us.apache.org/repos/asf/ambari/blob/158c94ae/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/alerts.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/alerts.json b/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/alerts.json
index 5d163ac..0bb4a8d 100755
--- a/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/alerts.json
+++ b/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/alerts.json
@@ -57,7 +57,7 @@
         "name": "spark2_thriftserver_status",
         "label": "Spark2 Thrift Server",
         "description": "This host-level alert is triggered if the Spark2 Thrift Server cannot be determined to be up.",
-        "interval": 1,
+        "interval": 5,
         "scope": "HOST",
         "source": {
           "type": "SCRIPT",


[15/29] ambari git commit: AMBARI-22485 : Allow Ambari to support non-kerberos SASL mechanisms for Kafka - Addendum, missed the new files (ydavis via mradhakrishnan)

Posted by rl...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f8227780/ambari-server/src/test/python/stacks/2.6/configs/default_kafka_plaintextsasl.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.6/configs/default_kafka_plaintextsasl.json b/ambari-server/src/test/python/stacks/2.6/configs/default_kafka_plaintextsasl.json
new file mode 100644
index 0000000..1847d4b
--- /dev/null
+++ b/ambari-server/src/test/python/stacks/2.6/configs/default_kafka_plaintextsasl.json
@@ -0,0 +1,631 @@
+{
+  "roleCommand": "SERVICE_CHECK",
+  "clusterName": "c1",
+  "hostname": "c6401.ambari.apache.org",
+  "hostLevelParams": {
+    "not_managed_hdfs_path_list": "[\"/apps/hive/warehouse\",\"/apps/falcon\",\"/mr-history/done\",\"/app-logs\",\"/tmp\"]",
+    "agent_stack_retry_count": "5",
+    "agent_stack_retry_on_unavailability": "false",
+    "jdk_location": "http://c6401.ambari.apache.org:8080/resources/",
+    "ambari_db_rca_password": "mapred",
+    "ambari_db_rca_url": "jdbc:postgresql://c6401.ambari.apache.org/ambarirca",
+    "jce_name": "UnlimitedJCEPolicyJDK7.zip",
+    "stack_version": "2.6.5.0",
+    "stack_name": "HDP",
+    "ambari_db_rca_driver": "org.postgresql.Driver",
+    "jdk_name": "jdk-7u67-linux-x64.tar.gz",
+    "ambari_db_rca_username": "mapred",
+    "java_home": "/usr/jdk64/jdk1.7.0_45",
+    "db_name": "ambari",
+    "custom_mysql_jdbc_name": "mysql-connector-java.jar"
+  },
+  "commandType": "EXECUTION_COMMAND",
+  "roleParams": {},
+  "serviceName": "SLIDER",
+  "role": "SLIDER",
+  "commandParams": {
+    "version": "2.6.5.0-1235",
+    "command_timeout": "300",
+    "service_package_folder": "OOZIE",
+    "script_type": "PYTHON",
+    "script": "scripts/service_check.py",
+    "excluded_hosts": "host1,host2"
+  },
+  "taskId": 152,
+  "public_hostname": "c6401.ambari.apache.org",
+  "configurations": {
+    "slider-client": {
+      "slider.yarn.queue": "default"
+    },
+    "sqoop-site": {
+      "atlas.cluster.name": "c1",
+      "sqoop.job.data.publish.class": "org.apache.atlas.sqoop.hook.SqoopHook"
+    },
+    "mahout-env": {
+      "mahout_user": "mahout"
+    },
+    "hbase-env": {
+      "hbase_user": "hbase"
+    },
+    "yarn-env": {
+      "yarn_user": "yarn"
+    },
+    "mahout-log4j": {
+      "content": "\n            #\n            #\n            # Licensed to the Apache Software Foundation (ASF) under one\n            # or more contributor license agreements.  See the NOTICE file\n            # distributed with this work for additional information\n            # regarding copyright ownership.  The ASF licenses this file\n            # to you under the Apache License, Version 2.0 (the\n            # \"License\"); you may not use this file except in compliance\n            # with the License.  You may obtain a copy of the License at\n            #\n            #   http://www.apache.org/licenses/LICENSE-2.0\n            #\n            # Unless required by applicable law or agreed to in writing,\n            # software distributed under the License is distributed on an\n            # \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n            # KIND, either express or implied.  See the License for the\n            # specific language governing permissions a
 nd limitations\n            # under the License.\n            #\n            #\n            #\n\n            # Set everything to be logged to the console\n            log4j.rootCategory=WARN, console\n            log4j.appender.console=org.apache.log4j.ConsoleAppender\n            log4j.appender.console.target=System.err\n            log4j.appender.console.layout=org.apache.log4j.PatternLayout\n            log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n\n\n            # Settings to quiet third party logs that are too verbose\n            log4j.logger.org.eclipse.jetty=WARN\n            log4j.logger.org.apache.spark.repl.SparkIMain$exprTyper=WARN\n            log4j.logger.org.apache.spark.repl.SparkILoop$SparkILoopInterpreter=WARN"
+    },
+    "hadoop-env": {
+      "hdfs_user": "hdfs",
+      "hdfs_tmp_dir": "/tmp"
+    },
+    "core-site": {
+      "fs.defaultFS": "hdfs://c6401.ambari.apache.org:8020"
+    },
+    "hdfs-site": {
+      "a": "b"
+    },
+    "yarn-site": {
+      "yarn.application.classpath": "/etc/hadoop/conf,/usr/lib/hadoop/*,/usr/lib/hadoop/lib/*,/usr/lib/hadoop-hdfs/*,/usr/lib/hadoop-hdfs/lib/*,/usr/lib/hadoop-yarn/*,/usr/lib/hadoop-yarn/lib/*,/usr/lib/hadoop-mapreduce/*,/usr/lib/hadoop-mapreduce/lib/*",
+      "yarn.resourcemanager.address": "c6401.ambari.apache.org:8050",
+      "yarn.resourcemanager.scheduler.address": "c6401.ambari.apache.org:8030"
+    },
+    "cluster-env": {
+      "managed_hdfs_resource_property_names": "",
+      "security_enabled": "false",
+      "ignore_groupsusers_create": "false",
+      "smokeuser": "ambari-qa",
+      "kerberos_domain": "EXAMPLE.COM",
+      "user_group": "hadoop"
+    },
+    "webhcat-site": {
+      "templeton.jar": "/usr/hdp/current/hive-webhcat/share/webhcat/svr/lib/hive-webhcat-*.jar",
+      "templeton.pig.archive": "hdfs:///hdp/apps/{{ hdp_stack_version }}/pig/pig.tar.gz",
+      "templeton.hive.archive": "hdfs:///hdp/apps/{{ hdp_stack_version }}/hive/hive.tar.gz",
+      "templeton.sqoop.archive": "hdfs:///hdp/apps/{{ hdp_stack_version }}/sqoop/sqoop.tar.gz",
+      "templeton.streaming.jar": "hdfs:///hdp/apps/{{ hdp_stack_version }}/mr/hadoop-streaming.jar"
+    },
+    "slider-log4j": {
+      "content": "log4jproperties\nline2"
+    },
+    "slider-env": {
+      "content": "envproperties\nline2"
+    },
+    "gateway-site": {
+      "java.security.auth.login.config": "/etc/knox/conf/krb5JAASLogin.conf",
+      "gateway.hadoop.kerberos.secured": "false",
+      "gateway.gateway.conf.dir": "deployments",
+      "gateway.path": "gateway",
+      "sun.security.krb5.debug": "true",
+      "java.security.krb5.conf": "/etc/knox/conf/krb5.conf",
+      "gateway.port": "8443"
+    },
+
+    "users-ldif": {
+      "content": "\n            # Licensed to the Apache Software Foundation (ASF) under one\n            # or more contributor license agreements.  See the NOTICE file\n            # distributed with this work for additional information\n            # regarding copyright ownership.  The ASF licenses this file\n            # to you under the Apache License, Version 2.0 (the\n            # \"License\"); you may not use this file except in compliance\n            # with the License.  You may obtain a copy of the License at\n            #\n            #     http://www.apache.org/licenses/LICENSE-2.0\n            #\n            # Unless required by applicable law or agreed to in writing, software\n            # distributed under the License is distributed on an \"AS IS\" BASIS,\n            # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n            # See the License for the specific language governing permissions and\n            # limitations under the Lice
 nse.\n\n            version: 1\n\n            # Please replace with site specific values\n            dn: dc=hadoop,dc=apache,dc=org\n            objectclass: organization\n            objectclass: dcObject\n            o: Hadoop\n            dc: hadoop\n\n            # Entry for a sample people container\n            # Please replace with site specific values\n            dn: ou=people,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass:organizationalUnit\n            ou: people\n\n            # Entry for a sample end user\n            # Please replace with site specific values\n            dn: uid=guest,ou=people,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass:person\n            objectclass:organizationalPerson\n            objectclass:inetOrgPerson\n            cn: Guest\n            sn: User\n            uid: guest\n            userPassword:guest-password\n\n            # entry for sample user admin\n            dn: 
 uid=admin,ou=people,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass:person\n            objectclass:organizationalPerson\n            objectclass:inetOrgPerson\n            cn: Admin\n            sn: Admin\n            uid: admin\n            userPassword:admin-password\n\n            # entry for sample user sam\n            dn: uid=sam,ou=people,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass:person\n            objectclass:organizationalPerson\n            objectclass:inetOrgPerson\n            cn: sam\n            sn: sam\n            uid: sam\n            userPassword:sam-password\n\n            # entry for sample user tom\n            dn: uid=tom,ou=people,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass:person\n            objectclass:organizationalPerson\n            objectclass:inetOrgPerson\n            cn: tom\n            sn: tom\n            uid: tom\n            userPasswor
 d:tom-password\n\n            # create FIRST Level groups branch\n            dn: ou=groups,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass:organizationalUnit\n            ou: groups\n            description: generic groups branch\n\n            # create the analyst group under groups\n            dn: cn=analyst,ou=groups,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass: groupofnames\n            cn: analyst\n            description:analyst  group\n            member: uid=sam,ou=people,dc=hadoop,dc=apache,dc=org\n            member: uid=tom,ou=people,dc=hadoop,dc=apache,dc=org\n\n\n            # create the scientist group under groups\n            dn: cn=scientist,ou=groups,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass: groupofnames\n            cn: scientist\n            description: scientist group\n            member: uid=sam,ou=people,dc=hadoop,dc=apache,dc=org"
+    },
+
+    "topology": {
+      "content": "\n        <topology>\n\n            <gateway>\n\n                <provider>\n                    <role>authentication</role>\n                    <name>ShiroProvider</name>\n                    <enabled>true</enabled>\n                    <param>\n                        <name>sessionTimeout</name>\n                        <value>30</value>\n                    </param>\n                    <param>\n                        <name>main.ldapRealm</name>\n                        <value>org.apache.hadoop.gateway.shirorealm.KnoxLdapRealm</value>\n                    </param>\n                    <param>\n                        <name>main.ldapRealm.userDnTemplate</name>\n                        <value>uid={0},ou=people,dc=hadoop,dc=apache,dc=org</value>\n                    </param>\n                    <param>\n                        <name>main.ldapRealm.contextFactory.url</name>\n                        <value>ldap://{{knox_host_name}}:33389</value>\n                 
    </param>\n                    <param>\n                        <name>main.ldapRealm.contextFactory.authenticationMechanism</name>\n                        <value>simple</value>\n                    </param>\n                    <param>\n                        <name>urls./**</name>\n                        <value>authcBasic</value>\n                    </param>\n                </provider>\n\n                <provider>\n                    <role>identity-assertion</role>\n                    <name>Default</name>\n                    <enabled>true</enabled>\n                </provider>\n\n            </gateway>\n\n            <service>\n                <role>NAMENODE</role>\n                <url>hdfs://{{namenode_host}}:{{namenode_rpc_port}}</url>\n            </service>\n\n            <service>\n                <role>JOBTRACKER</role>\n                <url>rpc://{{rm_host}}:{{jt_rpc_port}}</url>\n            </service>\n\n            <service>\n                <role>WEBHDFS</role
 >\n                <url>http://{{namenode_host}}:{{namenode_http_port}}/webhdfs</url>\n            </service>\n\n            <service>\n                <role>WEBHCAT</role>\n                <url>http://{{webhcat_server_host}}:{{templeton_port}}/templeton</url>\n            </service>\n\n            <service>\n                <role>OOZIE</role>\n                <url>http://{{oozie_server_host}}:{{oozie_server_port}}/oozie</url>\n            </service>\n\n            <service>\n                <role>WEBHBASE</role>\n                <url>http://{{hbase_master_host}}:{{hbase_master_port}}</url>\n            </service>\n\n            <service>\n                <role>HIVE</role>\n                <url>http://{{hive_server_host}}:{{hive_http_port}}/{{hive_http_path}}</url>\n            </service>\n\n            <service>\n                <role>RESOURCEMANAGER</role>\n                <url>http://{{rm_host}}:{{rm_port}}/ws</url>\n            </service>\n        </topology>"
+    },
+
+    "ldap-log4j": {
+      "content": "\n        # Licensed to the Apache Software Foundation (ASF) under one\n        # or more contributor license agreements.  See the NOTICE file\n        # distributed with this work for additional information\n        # regarding copyright ownership.  The ASF licenses this file\n        # to you under the Apache License, Version 2.0 (the\n        # \"License\"); you may not use this file except in compliance\n        # with the License.  You may obtain a copy of the License at\n        #\n        #     http://www.apache.org/licenses/LICENSE-2.0\n        #\n        # Unless required by applicable law or agreed to in writing, software\n        # distributed under the License is distributed on an \"AS IS\" BASIS,\n        # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n        # See the License for the specific language governing permissions and\n        # limitations under the License.\n        #testing\n\n        app.log.dir=${launcher.dir
 }/../logs\n        app.log.file=${launcher.name}.log\n\n        log4j.rootLogger=ERROR, drfa\n        log4j.logger.org.apache.directory.server.ldap.LdapServer=INFO\n        log4j.logger.org.apache.directory=WARN\n\n        log4j.appender.stdout=org.apache.log4j.ConsoleAppender\n        log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\n        log4j.appender.stdout.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n\n\n        log4j.appender.drfa=org.apache.log4j.DailyRollingFileAppender\n        log4j.appender.drfa.File=${app.log.dir}/${app.log.file}\n        log4j.appender.drfa.DatePattern=.yyyy-MM-dd\n        log4j.appender.drfa.layout=org.apache.log4j.PatternLayout\n        log4j.appender.drfa.layout.ConversionPattern=%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n"
+    },
+
+    "gateway-log4j": {
+      "content": "\n\n      # Licensed to the Apache Software Foundation (ASF) under one\n      # or more contributor license agreements. See the NOTICE file\n      # distributed with this work for additional information\n      # regarding copyright ownership. The ASF licenses this file\n      # to you under the Apache License, Version 2.0 (the\n      # \"License\"); you may not use this file except in compliance\n      # with the License. You may obtain a copy of the License at\n      #\n      # http://www.apache.org/licenses/LICENSE-2.0\n      #\n      # Unless required by applicable law or agreed to in writing, software\n      # distributed under the License is distributed on an \"AS IS\" BASIS,\n      # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n      # See the License for the specific language governing permissions and\n      # limitations under the License.\n\n      app.log.dir=${launcher.dir}/../logs\n      app.log.file=${launcher.name}.log\n   
    app.audit.file=${launcher.name}-audit.log\n\n      log4j.rootLogger=ERROR, drfa\n\n      log4j.logger.org.apache.hadoop.gateway=INFO\n      #log4j.logger.org.apache.hadoop.gateway=DEBUG\n\n      #log4j.logger.org.eclipse.jetty=DEBUG\n      #log4j.logger.org.apache.shiro=DEBUG\n      #log4j.logger.org.apache.http=DEBUG\n      #log4j.logger.org.apache.http.client=DEBUG\n      #log4j.logger.org.apache.http.headers=DEBUG\n      #log4j.logger.org.apache.http.wire=DEBUG\n\n      log4j.appender.stdout=org.apache.log4j.ConsoleAppender\n      log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\n      log4j.appender.stdout.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n\n\n      log4j.appender.drfa=org.apache.log4j.DailyRollingFileAppender\n      log4j.appender.drfa.File=${app.log.dir}/${app.log.file}\n      log4j.appender.drfa.DatePattern=.yyyy-MM-dd\n      log4j.appender.drfa.layout=org.apache.log4j.PatternLayout\n      log4j.appender.drfa.layout.ConversionPattern=%
 d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n\n\n      log4j.logger.audit=INFO, auditfile\n      log4j.appender.auditfile=org.apache.log4j.DailyRollingFileAppender\n      log4j.appender.auditfile.File=${app.log.dir}/${app.audit.file}\n      log4j.appender.auditfile.Append = true\n      log4j.appender.auditfile.DatePattern = '.'yyyy-MM-dd\n      log4j.appender.auditfile.layout = org.apache.hadoop.gateway.audit.log4j.layout.AuditLayout"
+    },
+    "knox-env": {
+      "knox_master_secret": "sa",
+      "knox_group": "knox",
+      "knox_pid_dir": "/var/run/knox",
+      "knox_user": "knox"
+    },
+    "kafka-env": {
+      "kafka_user_nproc_limit": "65536",
+      "content": "\n#!/bin/bash\n\n# Set KAFKA specific environment variables here.\n\n# The java implementation to use.\nexport JAVA_HOME={{java64_home}}\nexport PATH=$PATH:$JAVA_HOME/bin\nexport PID_DIR={{kafka_pid_dir}}\nexport LOG_DIR={{kafka_log_dir}}\n{% if kerberos_security_enabled or kafka_other_sasl_enabled %}\nexport KAFKA_KERBEROS_PARAMS=\"-Djavax.security.auth.useSubjectCredsOnly=false {{kafka_kerberos_params}}\"\n{% else %}\nexport KAFKA_KERBEROS_PARAMS={{kafka_kerberos_params}}\n{% endif %}\n# Add kafka sink to classpath and related depenencies\nif [ -e \"/usr/lib/ambari-metrics-kafka-sink/ambari-metrics-kafka-sink.jar\" ]; then\n  export CLASSPATH=$CLASSPATH:/usr/lib/ambari-metrics-kafka-sink/ambari-metrics-kafka-sink.jar\n  export CLASSPATH=$CLASSPATH:/usr/lib/ambari-metrics-kafka-sink/lib/*\nfi\nif [ -f /etc/kafka/conf/kafka-ranger-env.sh ]; then\n. /etc/kafka/conf/kafka-ranger-env.sh\nfi",
+      "kafka_log_dir": "/var/log/kafka",
+      "kafka_pid_dir": "/var/run/kafka",
+      "kafka_user_nofile_limit": "128000",
+      "is_supported_kafka_ranger": "true",
+      "kafka_user": "kafka"
+    },
+    "kafka-log4j": {
+      "kafka_log_maxbackupindex": "20",
+      "content": "\n#\n#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements.  See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership.  The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License.  You may obtain a copy of the License at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied.  See the License for the\n# specific language governing permissions and limitations\n# under the License.\n#\n#\n#\nkafka.logs.dir=logs\n\nlog4j.rootLogger=INFO, stdout\n\nlog4j.appender.stdout=org.apache.log4j.ConsoleAppender\nlog4j.appender.stdout.layout=org.apache.log4j
 .PatternLayout\nlog4j.appender.stdout.layout.ConversionPattern=[%d] %p %m (%c)%n\n\nlog4j.appender.kafkaAppender=org.apache.log4j.DailyRollingFileAppender\nlog4j.appender.kafkaAppender.DatePattern='.'yyyy-MM-dd-HH\nlog4j.appender.kafkaAppender.File=${kafka.logs.dir}/server.log\nlog4j.appender.kafkaAppender.layout=org.apache.log4j.PatternLayout\nlog4j.appender.kafkaAppender.layout.ConversionPattern=[%d] %p %m (%c)%n\nlog4j.appender.kafkaAppender.MaxFileSize = {{kafka_log_maxfilesize}}MB\nlog4j.appender.kafkaAppender.MaxBackupIndex = {{kafka_log_maxbackupindex}}\n\nlog4j.appender.stateChangeAppender=org.apache.log4j.DailyRollingFileAppender\nlog4j.appender.stateChangeAppender.DatePattern='.'yyyy-MM-dd-HH\nlog4j.appender.stateChangeAppender.File=${kafka.logs.dir}/state-change.log\nlog4j.appender.stateChangeAppender.layout=org.apache.log4j.PatternLayout\nlog4j.appender.stateChangeAppender.layout.ConversionPattern=[%d] %p %m (%c)%n\n\nlog4j.appender.requestAppender=org.apache.log4j.Daily
 RollingFileAppender\nlog4j.appender.requestAppender.DatePattern='.'yyyy-MM-dd-HH\nlog4j.appender.requestAppender.File=${kafka.logs.dir}/kafka-request.log\nlog4j.appender.requestAppender.layout=org.apache.log4j.PatternLayout\nlog4j.appender.requestAppender.layout.ConversionPattern=[%d] %p %m (%c)%n\n\nlog4j.appender.cleanerAppender=org.apache.log4j.DailyRollingFileAppender\nlog4j.appender.cleanerAppender.DatePattern='.'yyyy-MM-dd-HH\nlog4j.appender.cleanerAppender.File=${kafka.logs.dir}/log-cleaner.log\nlog4j.appender.cleanerAppender.layout=org.apache.log4j.PatternLayout\nlog4j.appender.cleanerAppender.layout.ConversionPattern=[%d] %p %m (%c)%n\n\nlog4j.appender.controllerAppender=org.apache.log4j.DailyRollingFileAppender\nlog4j.appender.controllerAppender.DatePattern='.'yyyy-MM-dd-HH\nlog4j.appender.controllerAppender.File=${kafka.logs.dir}/controller.log\nlog4j.appender.controllerAppender.layout=org.apache.log4j.PatternLayout\nlog4j.appender.controllerAppender.layout.ConversionPatt
 ern=[%d] %p %m (%c)%n\nlog4j.appender.controllerAppender.MaxFileSize = {{controller_log_maxfilesize}}MB\nlog4j.appender.controllerAppender.MaxBackupIndex = {{controller_log_maxbackupindex}}\n# Turn on all our debugging info\n#log4j.logger.kafka.producer.async.DefaultEventHandler=DEBUG, kafkaAppender\n#log4j.logger.kafka.client.ClientUtils=DEBUG, kafkaAppender\n#log4j.logger.kafka.perf=DEBUG, kafkaAppender\n#log4j.logger.kafka.perf.ProducerPerformance$ProducerThread=DEBUG, kafkaAppender\n#log4j.logger.org.I0Itec.zkclient.ZkClient=DEBUG\nlog4j.logger.kafka=INFO, kafkaAppender\nlog4j.logger.kafka.network.RequestChannel$=WARN, requestAppender\nlog4j.additivity.kafka.network.RequestChannel$=false\n\n#log4j.logger.kafka.network.Processor=TRACE, requestAppender\n#log4j.logger.kafka.server.KafkaApis=TRACE, requestAppender\n#log4j.additivity.kafka.server.KafkaApis=false\nlog4j.logger.kafka.request.logger=WARN, requestAppender\nlog4j.additivity.kafka.request.logger=false\n\nlog4j.logger.kafka
 .controller=TRACE, controllerAppender\nlog4j.additivity.kafka.controller=false\n\nlog4j.logger.kafka.log.LogCleaner=INFO, cleanerAppender\nlog4j.additivity.kafka.log.LogCleaner=false\n\nlog4j.logger.state.change.logger=TRACE, stateChangeAppender\nlog4j.additivity.state.change.logger=false",
+      "kafka_log_maxfilesize": "256",
+      "controller_log_maxfilesize": "256",
+      "controller_log_maxbackupindex": "20"
+    },
+    "kafka-broker": {
+      "auto.leader.rebalance.enable": "true",
+      "kafka.ganglia.metrics.port": "8671",
+      "socket.send.buffer.bytes": "102400",
+      "num.network.threads": "3",
+      "log.segment.bytes": "1073741824",
+      "kafka.ganglia.metrics.host": "localhost",
+      "kafka.timeline.metrics.maxRowCacheSize": "10000",
+      "replica.lag.time.max.ms": "10000",
+      "num.io.threads": "8",
+      "offsets.retention.minutes": "86400000",
+      "fetch.purgatory.purge.interval.requests": "10000",
+      "offsets.topic.compression.codec": "0",
+      "default.replication.factor": "1",
+      "port": "6667",
+      "num.recovery.threads.per.data.dir": "1",
+      "kafka.metrics.reporters": "org.apache.hadoop.metrics2.sink.kafka.KafkaTimelineMetricsReporter",
+      "log.retention.bytes": "-1",
+      "producer.purgatory.purge.interval.requests": "10000",
+      "replica.lag.max.messages": "4000",
+      "replica.high.watermark.checkpoint.interval.ms": "5000",
+      "zookeeper.connect": "ydavis-kafka-ambari-upgrade-1.openstacklocal:2181",
+      "controlled.shutdown.retry.backoff.ms": "5000",
+      "sasl.enabled.mechanisms": "GSSAPI",
+      "kafka.timeline.metrics.reporter.sendInterval": "5900",
+      "num.partitions": "1",
+      "offsets.topic.segment.bytes": "104857600",
+      "replica.fetch.min.bytes": "1",
+      "zookeeper.sync.time.ms": "2000",
+      "offset.metadata.max.bytes": "4096",
+      "kafka.timeline.metrics.reporter.enabled": "true",
+      "kafka.timeline.metrics.truststore.type": "{{metric_truststore_type}}",
+      "controlled.shutdown.max.retries": "3",
+      "leader.imbalance.per.broker.percentage": "10",
+      "min.insync.replicas": "1",
+      "offsets.commit.required.acks": "-1",
+      "replica.fetch.wait.max.ms": "500",
+      "controlled.shutdown.enable": "true",
+      "log.roll.hours": "168",
+      "log.cleanup.interval.mins": "10",
+      "replica.socket.receive.buffer.bytes": "65536",
+      "kafka.ganglia.metrics.reporter.enabled": "true",
+      "kafka.timeline.metrics.truststore.path": "{{metric_truststore_path}}",
+      "zookeeper.connection.timeout.ms": "25000",
+      "delete.topic.enable": "false",
+      "offsets.load.buffer.size": "5242880",
+      "num.replica.fetchers": "1",
+      "socket.request.max.bytes": "104857600",
+      "message.max.bytes": "1000000",
+      "controller.message.queue.size": "10",
+      "kafka.ganglia.metrics.group": "kafka",
+      "compression.type": "producer",
+      "queued.max.requests": "500",
+      "log.index.interval.bytes": "4096",
+      "replica.fetch.max.bytes": "1048576",
+      "offsets.topic.num.partitions": "50",
+      "socket.receive.buffer.bytes": "102400",
+      "kafka.timeline.metrics.port": "{{metric_collector_port}}",
+      "offsets.commit.timeout.ms": "5000",
+      "offsets.topic.replication.factor": "3",
+      "external.kafka.metrics.include.prefix": "kafka.network.RequestMetrics.ResponseQueueTimeMs.request.OffsetCommit.98percentile,kafka.network.RequestMetrics.ResponseQueueTimeMs.request.Offsets.95percentile,kafka.network.RequestMetrics.ResponseSendTimeMs.request.Fetch.95percentile,kafka.network.RequestMetrics.RequestsPerSec.request",
+      "offsets.retention.check.interval.ms": "600000",
+      "log.index.size.max.bytes": "10485760",
+      "log.dirs": "/kafka-logs",
+      "listeners": "PLAINTEXTSASL://localhost:6667",
+      "kafka.timeline.metrics.hosts": "{{ams_collector_hosts}}",
+      "controller.socket.timeout.ms": "30000",
+      "replica.socket.timeout.ms": "30000",
+      "zookeeper.session.timeout.ms": "30000",
+      "auto.create.topics.enable": "true",
+      "kafka.timeline.metrics.truststore.password": "{{metric_truststore_password}}",
+      "external.kafka.metrics.exclude.prefix": "kafka.network.RequestMetrics,kafka.server.DelayedOperationPurgatory,kafka.server.BrokerTopicMetrics.BytesRejectedPerSec,kafka.server.KafkaServer.ClusterId",
+      "leader.imbalance.check.interval.seconds": "300",
+      "sasl.mechanism.inter.broker.protocol": "GSSAPI",
+      "log.retention.hours": "168",
+      "kafka.timeline.metrics.protocol": "{{metric_collector_protocol}}"
+    },
+    "spark-defaults": {
+      "spark.yarn.applicationMaster.waitTries": "10",
+      "spark.history.kerberos.keytab": "none",
+      "spark.yarn.preserve.staging.files": "false",
+      "spark.yarn.submit.file.replication": "3",
+      "spark.history.kerberos.principal": "none",
+      "spark.yarn.driver.memoryOverhead": "384",
+      "spark.yarn.queue": "default",
+      "spark.yarn.containerLauncherMaxThreads": "25",
+      "spark.yarn.scheduler.heartbeat.interval-ms": "5000",
+      "spark.history.ui.port": "18080",
+      "spark.yarn.max.executor.failures": "3",
+      "spark.driver.extraJavaOptions": "",
+      "spark.history.provider": "org.apache.spark.deploy.yarn.history.YarnHistoryProvider",
+      "spark.yarn.am.extraJavaOptions": "",
+      "spark.yarn.executor.memoryOverhead": "384"
+    },
+    "spark-javaopts-properties": {
+      "content": " "
+    },
+    "spark-log4j-properties": {
+      "content": "\n# Set everything to be logged to the console\nlog4j.rootCategory=INFO, console\nlog4j.appender.console=org.apache.log4j.ConsoleAppender\nlog4j.appender.console.target=System.err\nlog4j.appender.console.layout=org.apache.log4j.PatternLayout\nlog4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n\n\n# Settings to quiet third party logs that are too verbose\nlog4j.logger.org.eclipse.jetty=WARN\nlog4j.logger.org.eclipse.jetty.util.component.AbstractLifeCycle=ERROR\nlog4j.logger.org.apache.spark.repl.SparkIMain$exprTyper=INFO\nlog4j.logger.org.apache.spark.repl.SparkILoop$SparkILoopInterpreter=INFO"
+    },
+    "spark-env": {
+      "content": "\n#!/usr/bin/env bash\n\n# This file is sourced when running various Spark programs.\n# Copy it as spark-env.sh and edit that to configure Spark for your site.\n\n# Options read in YARN client mode\n#SPARK_EXECUTOR_INSTANCES=\"2\" #Number of workers to start (Default: 2)\n#SPARK_EXECUTOR_CORES=\"1\" #Number of cores for the workers (Default: 1).\n#SPARK_EXECUTOR_MEMORY=\"1G\" #Memory per Worker (e.g. 1000M, 2G) (Default: 1G)\n#SPARK_DRIVER_MEMORY=\"512 Mb\" #Memory for Master (e.g. 1000M, 2G) (Default: 512 Mb)\n#SPARK_YARN_APP_NAME=\"spark\" #The name of your application (Default: Spark)\n#SPARK_YARN_QUEUE=\"~@~Xdefault~@~Y\" #The hadoop queue to use for allocation requests (Default: @~Xdefault~@~Y)\n#SPARK_YARN_DIST_FILES=\"\" #Comma separated list of files to be distributed with the job.\n#SPARK_YARN_DIST_ARCHIVES=\"\" #Comma separated list of archives to be distributed with the job.\n\n# Generic options for the daemons used in the standalone deploy mode\n\n# Alt
 ernate conf dir. (Default: ${SPARK_HOME}/conf)\nexport SPARK_CONF_DIR=${SPARK_HOME:-{{spark_home}}}/conf\n\n# Where log files are stored.(Default:${SPARK_HOME}/logs)\n#export SPARK_LOG_DIR=${SPARK_HOME:-{{spark_home}}}/logs\nexport SPARK_LOG_DIR={{spark_log_dir}}\n\n# Where the pid file is stored. (Default: /tmp)\nexport SPARK_PID_DIR={{spark_pid_dir}}\n\n# A string representing this instance of spark.(Default: $USER)\nSPARK_IDENT_STRING=$USER\n\n# The scheduling priority for daemons. (Default: 0)\nSPARK_NICENESS=0\n\nexport HADOOP_HOME=${HADOOP_HOME:-{{hadoop_home}}}\nexport HADOOP_CONF_DIR=${HADOOP_CONF_DIR:-{{hadoop_conf_dir}}}\n\n# The java implementation to use.\nexport JAVA_HOME={{java_home}}\n\nif [ -d \"/etc/tez/conf/\" ]; then\n  export TEZ_CONF_DIR=/etc/tez/conf\nelse\n  export TEZ_CONF_DIR=\nfi",
+      "spark_pid_dir": "/var/run/spark",
+      "spark_log_dir": "/var/log/spark",
+      "spark_group": "spark",
+      "spark_user": "spark"
+    },
+    "spark2-env": {
+      "content": "\n#!/usr/bin/env bash\n\n# This file is sourced when running various Spark programs.\n# Copy it as spark-env.sh and edit that to configure Spark for your site.\n\n# Options read in YARN client mode\n#SPARK_EXECUTOR_INSTANCES=\"2\" #Number of workers to start (Default: 2)\n#SPARK_EXECUTOR_CORES=\"1\" #Number of cores for the workers (Default: 1).\n#SPARK_EXECUTOR_MEMORY=\"1G\" #Memory per Worker (e.g. 1000M, 2G) (Default: 1G)\n#SPARK_DRIVER_MEMORY=\"512 Mb\" #Memory for Master (e.g. 1000M, 2G) (Default: 512 Mb)\n#SPARK_YARN_APP_NAME=\"spark\" #The name of your application (Default: Spark)\n#SPARK_YARN_QUEUE=\"~@~Xdefault~@~Y\" #The hadoop queue to use for allocation requests (Default: @~Xdefault~@~Y)\n#SPARK_YARN_DIST_FILES=\"\" #Comma separated list of files to be distributed with the job.\n#SPARK_YARN_DIST_ARCHIVES=\"\" #Comma separated list of archives to be distributed with the job.\n\n# Generic options for the daemons used in the standalone deploy mode\n\n# Alt
 ernate conf dir. (Default: ${SPARK_HOME}/conf)\nexport SPARK_CONF_DIR=${SPARK_HOME:-{{spark_home}}}/conf\n\n# Where log files are stored.(Default:${SPARK_HOME}/logs)\n#export SPARK_LOG_DIR=${SPARK_HOME:-{{spark_home}}}/logs\nexport SPARK_LOG_DIR={{spark_log_dir}}\n\n# Where the pid file is stored. (Default: /tmp)\nexport SPARK_PID_DIR={{spark_pid_dir}}\n\n# A string representing this instance of spark.(Default: $USER)\nSPARK_IDENT_STRING=$USER\n\n# The scheduling priority for daemons. (Default: 0)\nSPARK_NICENESS=0\n\nexport HADOOP_HOME=${HADOOP_HOME:-{{hadoop_home}}}\nexport HADOOP_CONF_DIR=${HADOOP_CONF_DIR:-{{hadoop_conf_dir}}}\n\n# The java implementation to use.\nexport JAVA_HOME={{java_home}}\n\nif [ -d \"/etc/tez/conf/\" ]; then\n  export TEZ_CONF_DIR=/etc/tez/conf\nelse\n  export TEZ_CONF_DIR=\nfi",
+      "spark_pid_dir": "/var/run/spark",
+      "spark_log_dir": "/var/log/spark",
+      "spark_group": "spark",
+      "spark_user": "spark"
+    },
+    "spark-metrics-properties": {
+      "content": "\n# syntax: [instance].sink|source.[name].[options]=[value]\n\n# This file configures Spark's internal metrics system. The metrics system is\n# divided into instances which correspond to internal components.\n# Each instance can be configured to report its metrics to one or more sinks.\n# Accepted values for [instance] are \"master\", \"worker\", \"executor\", \"driver\",\n# and \"applications\". A wild card \"*\" can be used as an instance name, in\n# which case all instances will inherit the supplied property.\n#\n# Within an instance, a \"source\" specifies a particular set of grouped metrics.\n# there are two kinds of sources:\n# 1. Spark internal sources, like MasterSource, WorkerSource, etc, which will\n# collect a Spark component's internal state. Each instance is paired with a\n# Spark source that is added automatically.\n# 2. Common sources, like JvmSource, which will collect low level state.\n# These can be added through configuration options and are then
  loaded\n# using reflection.\n#\n# A \"sink\" specifies where metrics are delivered to. Each instance can be\n# assigned one or more sinks.\n#\n# The sink|source field specifies whether the property relates to a sink or\n# source.\n#\n# The [name] field specifies the name of source or sink.\n#\n# The [options] field is the specific property of this source or sink. The\n# source or sink is responsible for parsing this property.\n#\n# Notes:\n# 1. To add a new sink, set the \"class\" option to a fully qualified class\n# name (see examples below).\n# 2. Some sinks involve a polling period. The minimum allowed polling period\n# is 1 second.\n# 3. Wild card properties can be overridden by more specific properties.\n# For example, master.sink.console.period takes precedence over\n# *.sink.console.period.\n# 4. A metrics specific configuration\n# \"spark.metrics.conf=${SPARK_HOME}/conf/metrics.properties\" should be\n# added to Java properties using -Dspark.metrics.conf=xxx if you want to\
 n# customize metrics system. You can also put the file in ${SPARK_HOME}/conf\n# and it will be loaded automatically.\n# 5. MetricsServlet is added by default as a sink in master, worker and client\n# driver, you can send http request \"/metrics/json\" to get a snapshot of all the\n# registered metrics in json format. For master, requests \"/metrics/master/json\" and\n# \"/metrics/applications/json\" can be sent seperately to get metrics snapshot of\n# instance master and applications. MetricsServlet may not be configured by self.\n#\n\n## List of available sinks and their properties.\n\n# org.apache.spark.metrics.sink.ConsoleSink\n# Name: Default: Description:\n# period 10 Poll period\n# unit seconds Units of poll period\n\n# org.apache.spark.metrics.sink.CSVSink\n# Name: Default: Description:\n# period 10 Poll period\n# unit seconds Units of poll period\n# directory /tmp Where to store CSV files\n\n# org.apache.spark.metrics.sink.GangliaSink\n# Name: Default: Description:\n# host N
 ONE Hostname or multicast group of Ganglia server\n# port NONE Port of Ganglia server(s)\n# period 10 Poll period\n# unit seconds Units of poll period\n# ttl 1 TTL of messages sent by Ganglia\n# mode multicast Ganglia network mode ('unicast' or 'multicast')\n\n# org.apache.spark.metrics.sink.JmxSink\n\n# org.apache.spark.metrics.sink.MetricsServlet\n# Name: Default: Description:\n# path VARIES* Path prefix from the web server root\n# sample false Whether to show entire set of samples for histograms ('false' or 'true')\n#\n# * Default path is /metrics/json for all instances except the master. The master has two paths:\n# /metrics/aplications/json # App information\n# /metrics/master/json # Master information\n\n# org.apache.spark.metrics.sink.GraphiteSink\n# Name: Default: Description:\n# host NONE Hostname of Graphite server\n# port NONE Port of Graphite server\n# period 10 Poll period\n# unit seconds Units of poll period\n# prefix EMPTY STRING Prefix to prepend to metric name\n\n##
  Examples\n# Enable JmxSink for all instances by class name\n#*.sink.jmx.class=org.apache.spark.metrics.sink.JmxSink\n\n# Enable ConsoleSink for all instances by class name\n#*.sink.console.class=org.apache.spark.metrics.sink.ConsoleSink\n\n# Polling period for ConsoleSink\n#*.sink.console.period=10\n\n#*.sink.console.unit=seconds\n\n# Master instance overlap polling period\n#master.sink.console.period=15\n\n#master.sink.console.unit=seconds\n\n# Enable CsvSink for all instances\n#*.sink.csv.class=org.apache.spark.metrics.sink.CsvSink\n\n# Polling period for CsvSink\n#*.sink.csv.period=1\n\n#*.sink.csv.unit=minutes\n\n# Polling directory for CsvSink\n#*.sink.csv.directory=/tmp/\n\n# Worker instance overlap polling period\n#worker.sink.csv.period=10\n\n#worker.sink.csv.unit=minutes\n\n# Enable jvm source for instance master, worker, driver and executor\n#master.source.jvm.class=org.apache.spark.metrics.source.JvmSource\n\n#worker.source.jvm.class=org.apache.spark.metrics.source.JvmSo
 urce\n\n#driver.source.jvm.class=org.apache.spark.metrics.source.JvmSource\n\n#executor.source.jvm.class=org.apache.spark.metrics.source.JvmSource"
+    },
+    "spark-metrics-properties": {
+      "content": "\n# syntax: [instance].sink|source.[name].[options]=[value]\n\n# This file configures Spark's internal metrics system. The metrics system is\n# divided into instances which correspond to internal components.\n# Each instance can be configured to report its metrics to one or more sinks.\n# Accepted values for [instance] are \"master\", \"worker\", \"executor\", \"driver\",\n# and \"applications\". A wild card \"*\" can be used as an instance name, in\n# which case all instances will inherit the supplied property.\n#\n# Within an instance, a \"source\" specifies a particular set of grouped metrics.\n# there are two kinds of sources:\n# 1. Spark internal sources, like MasterSource, WorkerSource, etc, which will\n# collect a Spark component's internal state. Each instance is paired with a\n# Spark source that is added automatically.\n# 2. Common sources, like JvmSource, which will collect low level state.\n# These can be added through configuration options and are then
  loaded\n# using reflection.\n#\n# A \"sink\" specifies where metrics are delivered to. Each instance can be\n# assigned one or more sinks.\n#\n# The sink|source field specifies whether the property relates to a sink or\n# source.\n#\n# The [name] field specifies the name of source or sink.\n#\n# The [options] field is the specific property of this source or sink. The\n# source or sink is responsible for parsing this property.\n#\n# Notes:\n# 1. To add a new sink, set the \"class\" option to a fully qualified class\n# name (see examples below).\n# 2. Some sinks involve a polling period. The minimum allowed polling period\n# is 1 second.\n# 3. Wild card properties can be overridden by more specific properties.\n# For example, master.sink.console.period takes precedence over\n# *.sink.console.period.\n# 4. A metrics specific configuration\n# \"spark.metrics.conf=${SPARK_HOME}/conf/metrics.properties\" should be\n# added to Java properties using -Dspark.metrics.conf=xxx if you want to\
 n# customize metrics system. You can also put the file in ${SPARK_HOME}/conf\n# and it will be loaded automatically.\n# 5. MetricsServlet is added by default as a sink in master, worker and client\n# driver, you can send http request \"/metrics/json\" to get a snapshot of all the\n# registered metrics in json format. For master, requests \"/metrics/master/json\" and\n# \"/metrics/applications/json\" can be sent seperately to get metrics snapshot of\n# instance master and applications. MetricsServlet may not be configured by self.\n#\n\n## List of available sinks and their properties.\n\n# org.apache.spark.metrics.sink.ConsoleSink\n# Name: Default: Description:\n# period 10 Poll period\n# unit seconds Units of poll period\n\n# org.apache.spark.metrics.sink.CSVSink\n# Name: Default: Description:\n# period 10 Poll period\n# unit seconds Units of poll period\n# directory /tmp Where to store CSV files\n\n# org.apache.spark.metrics.sink.GangliaSink\n# Name: Default: Description:\n# host N
 ONE Hostname or multicast group of Ganglia server\n# port NONE Port of Ganglia server(s)\n# period 10 Poll period\n# unit seconds Units of poll period\n# ttl 1 TTL of messages sent by Ganglia\n# mode multicast Ganglia network mode ('unicast' or 'multicast')\n\n# org.apache.spark.metrics.sink.JmxSink\n\n# org.apache.spark.metrics.sink.MetricsServlet\n# Name: Default: Description:\n# path VARIES* Path prefix from the web server root\n# sample false Whether to show entire set of samples for histograms ('false' or 'true')\n#\n# * Default path is /metrics/json for all instances except the master. The master has two paths:\n# /metrics/aplications/json # App information\n# /metrics/master/json # Master information\n\n# org.apache.spark.metrics.sink.GraphiteSink\n# Name: Default: Description:\n# host NONE Hostname of Graphite server\n# port NONE Port of Graphite server\n# period 10 Poll period\n# unit seconds Units of poll period\n# prefix EMPTY STRING Prefix to prepend to metric name\n\n##
  Examples\n# Enable JmxSink for all instances by class name\n#*.sink.jmx.class=org.apache.spark.metrics.sink.JmxSink\n\n# Enable ConsoleSink for all instances by class name\n#*.sink.console.class=org.apache.spark.metrics.sink.ConsoleSink\n\n# Polling period for ConsoleSink\n#*.sink.console.period=10\n\n#*.sink.console.unit=seconds\n\n# Master instance overlap polling period\n#master.sink.console.period=15\n\n#master.sink.console.unit=seconds\n\n# Enable CsvSink for all instances\n#*.sink.csv.class=org.apache.spark.metrics.sink.CsvSink\n\n# Polling period for CsvSink\n#*.sink.csv.period=1\n\n#*.sink.csv.unit=minutes\n\n# Polling directory for CsvSink\n#*.sink.csv.directory=/tmp/\n\n# Worker instance overlap polling period\n#worker.sink.csv.period=10\n\n#worker.sink.csv.unit=minutes\n\n# Enable jvm source for instance master, worker, driver and executor\n#master.source.jvm.class=org.apache.spark.metrics.source.JvmSource\n\n#worker.source.jvm.class=org.apache.spark.metrics.source.JvmSo
 urce\n\n#driver.source.jvm.class=org.apache.spark.metrics.source.JvmSource\n\n#executor.source.jvm.class=org.apache.spark.metrics.source.JvmSource"
+    },
+    "livy-log4j-properties": {
+      "content": "\n            # Set everything to be logged to the console\n            log4j.rootCategory=INFO, console\n            log4j.appender.console=org.apache.log4j.ConsoleAppender\n            log4j.appender.console.target=System.err\n            log4j.appender.console.layout=org.apache.log4j.PatternLayout\n            log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n\n\n            log4j.logger.org.eclipse.jetty=WARN"
+    },
+    "livy2-log4j-properties": {
+      "content": "\n            # Set everything to be logged to the console\n            log4j.rootCategory=INFO, console\n            log4j.appender.console=org.apache.log4j.ConsoleAppender\n            log4j.appender.console.target=System.err\n            log4j.appender.console.layout=org.apache.log4j.PatternLayout\n            log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n\n\n            log4j.logger.org.eclipse.jetty=WARN"
+    },
+    "livy-conf": {
+      "livy.server.port": "8998",
+      "livy.server.csrf_protection.enabled": "true",
+      "livy.environment": "production",
+      "livy.impersonation.enabled": "true",
+      "livy.server.session.timeout": "3600000"
+    },
+    "livy2-conf": {
+      "livy.server.port": "8999",
+      "livy.server.csrf_protection.enabled": "true",
+      "livy.environment": "production",
+      "livy.impersonation.enabled": "true",
+      "livy.server.session.timeout": "3600000"
+    },
+    "livy-spark-blacklist": {
+      "content": "\n            #\n            # Configuration override / blacklist. Defines a list of properties that users are not allowed\n            # to override when starting Spark sessions.\n            #\n            # This file takes a list of property names (one per line). Empty lines and lines starting with \"#\"\n            # are ignored.\n            #"
+    },
+    "livy2-spark-blacklist": {
+      "content": "\n            #\n            # Configuration override / blacklist. Defines a list of properties that users are not allowed\n            # to override when starting Spark sessions.\n            #\n            # This file takes a list of property names (one per line). Empty lines and lines starting with \"#\"\n            # are ignored.\n            #"
+    },
+    "livy-env": {
+      "livy_group": "livy",
+      "spark_home": "/usr/hdp/current/spark-client",
+      "content": "\n            #!/usr/bin/env bash\n\n            # - SPARK_HOME      Spark which you would like to use in livy\n            # - HADOOP_CONF_DIR Directory containing the Hadoop / YARN configuration to use.\n            # - LIVY_LOG_DIR    Where log files are stored.  (Default: ${LIVY_HOME}/logs)\n            # - LIVY_PID_DIR    Where the pid file is stored. (Default: /tmp)\n            # - LIVY_SERVER_JAVA_OPTS  Java Opts for running livy server (You can set jvm related setting here, like jvm memory/gc algorithm and etc.)\n        export SPARK_HOME=/usr/hdp/current/spark-client\n        export HADOOP_CONF_DIR=/etc/hadoop/conf\n        export LIVY_LOG_DIR={{livy_log_dir}}\n        export LIVY_PID_DIR={{livy_pid_dir}}\n        export LIVY_SERVER_JAVA_OPTS=\"-Xmx2g\"",
+      "livy_pid_dir": "/var/run/livy",
+      "livy_log_dir": "/var/log/livy",
+      "livy_user": "livy"
+    },
+    "livy2-env": {
+      "livy2_group": "livy",
+      "spark_home": "/usr/hdp/current/spark2-client",
+      "content": "\n            #!/usr/bin/env bash\n\n            # - SPARK_HOME      Spark which you would like to use in livy\n            # - HADOOP_CONF_DIR Directory containing the Hadoop / YARN configuration to use.\n            # - LIVY_LOG_DIR    Where log files are stored.  (Default: ${LIVY_HOME}/logs)\n            # - LIVY_PID_DIR    Where the pid file is stored. (Default: /tmp)\n            # - LIVY_SERVER_JAVA_OPTS  Java Opts for running livy server (You can set jvm related setting here, like jvm memory/gc algorithm and etc.)\n        export SPARK_HOME=/usr/hdp/current/spark2-client\n        export HADOOP_CONF_DIR=/etc/hadoop/conf\n        export LIVY_LOG_DIR={{livy_log_dir}}\n        export LIVY_PID_DIR={{livy_pid_dir}}\n        export LIVY_SERVER_JAVA_OPTS=\"-Xmx2g\"",
+      "livy2_pid_dir": "/var/run/livy2",
+      "livy2_log_dir": "/var/log/livy2",
+      "livy2_user": "livy"
+    },
+    "infra-solr-env": {
+      "infra_solr_znode": "/infra-solr",
+      "infra_solr_user": "solr",
+      "infra_solr_client_log_dir" :"/var/log/ambari-infra-solr-client"
+    },
+    "infra-solr-client-log4j" : {
+      "infra_solr_client_log_dir" : "/var/log/ambari-infra-solr-client",
+      "content" : "content"
+    },
+    "application-properties": {
+      "atlas.cluster.name" : "c2",
+      "atlas.rest.address": "http://c6401.ambari.apache.org:21000",
+      "atlas.graph.storage.backend": "berkeleyje",
+      "atlas.graph.storage.directory": "data/berkley",
+      "atlas.graph.index.search.backend": "solr5",
+      "atlas.graph.index.search.directory": "data/es",
+      "atlas.graph.index.search.elasticsearch.client-only": false,
+      "atlas.graph.index.search.elasticsearch.local-mode": true,
+      "atlas.lineage.hive.table.type.name": "Table",
+      "atlas.lineage.hive.column.type.name": "Column",
+      "atlas.lineage.hive.table.column.name": "columns",
+      "atlas.lineage.hive.process.type.name": "LoadProcess",
+      "atlas.lineage.hive.process.inputs.name": "inputTables",
+      "atlas.lineage.hive.process.outputs.name": "outputTables",
+      "atlas.enableTLS": false,
+      "atlas.authentication.method": "simple",
+      "atlas.authentication.principal": "atlas",
+      "atlas.authentication.keytab": "/etc/security/keytabs/atlas.service.keytab",
+      "atlas.http.authentication.enabled": false,
+      "atlas.http.authentication.type": "simple",
+      "atlas.http.authentication.kerberos.principal": "HTTP/_HOST@EXAMPLE.COM",
+      "atlas.http.authentication.kerberos.keytab": "/etc/security/keytabs/spnego.service.keytab",
+      "atlas.http.authentication.kerberos.name.rules": "DEFAULT",
+      "atlas.server.http.port" : "21000",
+      "atlas.notification.embedded" : false,
+      "atlas.kafka.bootstrap.servers" : "c6401.ambari.apache.org:6667",
+      "atlas.kafka.data" : "/usr/hdp/current/atlas-server/data/kafka",
+      "atlas.kafka.entities.group.id" : "entities",
+      "atlas.kafka.hook.group.id" : "atlas",
+      "atlas.kafka.zookeeper.connect" : "c6401.ambari.apache.org:2181"
+    },
+    "atlas-env": {
+      "content": "# The java implementation to use. If JAVA_HOME is not found we expect java and jar to be in path\nexport JAVA_HOME={{java64_home}}\n# any additional java opts you want to set. This will apply to both client and server operations\nexport METADATA_OPTS={{metadata_opts}}\n# metadata configuration directory\nexport METADATA_CONF={{conf_dir}}\n# Where log files are stored. Defatult is logs directory under the base install location\nexport METADATA_LOG_DIR={{log_dir}}\n# additional classpath entries\nexport METADATACPPATH={{metadata_classpath}}\n# data dir\nexport METADATA_DATA_DIR={{data_dir}}\n# Where do you want to expand the war file. By Default it is in /server/webapp dir under the base install dir.\nexport METADATA_EXPANDED_WEBAPP_DIR={{expanded_war_dir}}",
+      "metadata_user": "atlas",
+      "metadata_port": 21000,
+      "metadata_pid_dir": "/var/run/atlas",
+      "metadata_log_dir": "/var/log/atlas",
+      "metadata_data_dir": "/var/lib/atlas/data",
+      "metadata_expanded_war_dir": "/var/lib/atlas/server/webapp"
+    },
+    "atlas-log4j": {
+      "content": "<property><name>content</name><description>Custom log4j.properties</description><value></value></property>",
+      "atlas_log_level": "debug",
+      "audit_log_level": "OFF"
+    },
+    "atlas-solrconfig": {
+      "content": "<property><name>content</name><description>Custom solrconfig properties</description><value></value></property>"
+    },
+    "zeppelin-env": {
+      "zeppelin.server.kerberos.keytab": "", 
+      "shiro_ini_content": "\n[users]\n# List of users with their password allowed to access Zeppelin.\n# To use a different strategy (LDAP / Database / ...) check the shiro doc at http://shiro.apache.org/configuration.html#Configuration-INISections\n#admin = password1\n#user1 = password2, role1, role2\n#user2 = password3, role3\n#user3 = password4, role2\n\n# Sample LDAP configuration, for user Authentication, currently tested for single Realm\n[main]\n#ldapRealm = org.apache.shiro.realm.ldap.JndiLdapRealm\n#ldapRealm.userDnTemplate = uid={0},cn=users,cn=accounts,dc=hortonworks,dc=com\n#ldapRealm.contextFactory.url = ldap://ldaphost:389\n#ldapRealm.contextFactory.authenticationMechanism = SIMPLE\n#sessionManager = org.apache.shiro.web.session.mgt.DefaultWebSessionManager\n#securityManager.sessionManager = $sessionManager\n# 86,400,000 milliseconds = 24 hour\n#securityManager.sessionManager.globalSessionTimeout = 86400000\nshiro.loginUrl = /api/login\n\n[urls]\n# anon means the acce
 ss is anonymous.\n# authcBasic means Basic Auth Security\n# To enfore security, comment the line below and uncomment the next one\n/api/version = anon\n/** = anon\n#/** = authc", 
+      "zeppelin.spark.jar.dir": "/apps/zeppelin", 
+      "zeppelin.executor.mem": "512m", 
+      "zeppelin_pid_dir": "/var/run/zeppelin", 
+      "zeppelin.executor.instances": "2", 
+      "log4j_properties_content": "\nlog4j.rootLogger = INFO, dailyfile\nlog4j.appender.stdout = org.apache.log4j.ConsoleAppender\nlog4j.appender.stdout.layout = org.apache.log4j.PatternLayout\nlog4j.appender.stdout.layout.ConversionPattern=%5p [%d] ({%t} %F[%M]:%L) - %m%n\nlog4j.appender.dailyfile.DatePattern=.yyyy-MM-dd\nlog4j.appender.dailyfile.Threshold = INFO\nlog4j.appender.dailyfile = org.apache.log4j.DailyRollingFileAppender\nlog4j.appender.dailyfile.File = ${zeppelin.log.file}\nlog4j.appender.dailyfile.layout = org.apache.log4j.PatternLayout\nlog4j.appender.dailyfile.layout.ConversionPattern=%5p [%d] ({%t} %F[%M]:%L) - %m%n",
+      "zeppelin.server.kerberos.principal": "", 
+      "zeppelin_user": "zeppelin", 
+      "zeppelin_env_content": "\n# Spark master url. eg. spark://master_addr:7077. Leave empty if you want to use local mode\nexport MASTER=yarn-client\nexport SPARK_YARN_JAR={{spark_jar}}\n\n\n# Where log files are stored.  PWD by default.\nexport ZEPPELIN_LOG_DIR={{zeppelin_log_dir}}\n\n# The pid files are stored. /tmp by default.\nexport ZEPPELIN_PID_DIR={{zeppelin_pid_dir}}\n\n\nexport JAVA_HOME={{java64_home}}\n\n# Additional jvm options. for example, export ZEPPELIN_JAVA_OPTS=\"-Dspark.executor.memory=8g -Dspark.cores.max=16\"\nexport ZEPPELIN_JAVA_OPTS=\"-Dhdp.version={{full_stack_version}} -Dspark.executor.memory={{executor_mem}} -Dspark.executor.instances={{executor_instances}} -Dspark.yarn.queue={{spark_queue}}\"\n\n\n# Zeppelin jvm mem options Default -Xmx1024m -XX:MaxPermSize=512m\n# export ZEPPELIN_MEM\n\n# zeppelin interpreter process jvm mem options. Defualt = ZEPPELIN_MEM\n# export ZEPPELIN_INTP_MEM\n\n# zeppelin interpreter process jvm options. Default = ZEPPELIN_JA
 VA_OPTS\n# export ZEPPELIN_INTP_JAVA_OPTS\n\n# Where notebook saved\n# export ZEPPELIN_NOTEBOOK_DIR\n\n# Id of notebook to be displayed in homescreen. ex) 2A94M5J1Z\n# export ZEPPELIN_NOTEBOOK_HOMESCREEN\n\n# hide homescreen notebook from list when this value set to \"true\". default \"false\"\n# export ZEPPELIN_NOTEBOOK_HOMESCREEN_HIDE\n\n# Bucket where notebook saved\n# export ZEPPELIN_NOTEBOOK_S3_BUCKET\n\n# User in bucket where notebook saved. For example bucket/user/notebook/2A94M5J1Z/note.json\n# export ZEPPELIN_NOTEBOOK_S3_USER\n\n# A string representing this instance of zeppelin. $USER by default\n# export ZEPPELIN_IDENT_STRING\n\n# The scheduling priority for daemons. Defaults to 0.\n# export ZEPPELIN_NICENESS\n\n\n#### Spark interpreter configuration ####\n\n## Use provided spark installation ##\n## defining SPARK_HOME makes Zeppelin run spark interpreter process using spark-submit\n##\n# (required) When it is defined, load it instead of Zeppelin embedded Spark libraries\n
 export SPARK_HOME={{spark_home}}\n\n# (optional) extra options to pass to spark submit. eg) \"--driver-memory 512M --executor-memory 1G\".\n# export SPARK_SUBMIT_OPTIONS\n\n## Use embedded spark binaries ##\n## without SPARK_HOME defined, Zeppelin still able to run spark interpreter process using embedded spark binaries.\n## however, it is not encouraged when you can define SPARK_HOME\n##\n# Options read in YARN client mode\n# yarn-site.xml is located in configuration directory in HADOOP_CONF_DIR.\nexport HADOOP_CONF_DIR=/etc/hadoop/conf\n\n# Pyspark (supported with Spark 1.2.1 and above)\n# To configure pyspark, you need to set spark distribution's path to 'spark.home' property in Interpreter setting screen in Zeppelin GUI\n# path to the python command. must be the same path on the driver(Zeppelin) and all workers.\n# export PYSPARK_PYTHON\n\nexport PYTHONPATH=\"${SPARK_HOME}/python:${SPARK_HOME}/python/lib/py4j-0.8.2.1-src.zip\"\nexport SPARK_YARN_USER_ENV=\"PYTHONPATH=${PYTHONPAT
 H}\"\n\n## Spark interpreter options ##\n##\n# Use HiveContext instead of SQLContext if set true. true by default.\n# export ZEPPELIN_SPARK_USEHIVECONTEXT\n\n# Execute multiple SQL concurrently if set true. false by default.\n# export ZEPPELIN_SPARK_CONCURRENTSQL\n\n# Max number of SparkSQL result to display. 1000 by default.\n# export ZEPPELIN_SPARK_MAXRESULT", 
+      "zeppelin_log_dir": "/var/log/zeppelin", 
+      "zeppelin_group": "zeppelin"
+    },
+"zeppelin-config": {
+            "zeppelin.server.port": "9995",
+            "zeppelin.server.ssl.port": "9995",
+            "zeppelin.ssl.truststore.password": "change me", 
+            "zeppelin.interpreters": "org.apache.zeppelin.spark.SparkInterpreter,org.apache.zeppelin.spark.PySparkInterpreter,org.apache.zeppelin.spark.SparkSqlInterpreter,org.apache.zeppelin.spark.DepInterpreter,org.apache.zeppelin.markdown.Markdown,org.apache.zeppelin.angular.AngularInterpreter,org.apache.zeppelin.shell.ShellInterpreter,org.apache.zeppelin.jdbc.JDBCInterpreter,org.apache.zeppelin.phoenix.PhoenixInterpreter,org.apache.zeppelin.livy.LivySparkInterpreter,org.apache.zeppelin.livy.LivyPySparkInterpreter,org.apache.zeppelin.livy.LivySparkRInterpreter,org.apache.zeppelin.livy.LivySparkSQLInterpreter",
+            "zeppelin.interpreter.group.order": "spark,angular,jdbc,livy,md,sh",
+            "zeppelin.ssl.truststore.path": "conf/truststore", 
+            "zeppelin.notebook.dir": "notebook", 
+            "zeppelin.ssl.keystore.password": "change me", 
+            "zeppelin.ssl.keystore.path": "conf/keystore", 
+            "zeppelin.server.addr": "0.0.0.0", 
+            "zeppelin.ssl.client.auth": "false", 
+            "zeppelin.notebook.homescreen": " ", 
+            "zeppelin.interpreter.dir": "interpreter", 
+            "zeppelin.ssl.keystore.type": "JKS", 
+            "zeppelin.notebook.s3.user": "user", 
+            "zeppelin.ssl.key.manager.password": "change me", 
+            "zeppelin.anonymous.allowed": "true", 
+            "zeppelin.ssl.truststore.type": "JKS", 
+            "zeppelin.ssl": "false", 
+            "zeppelin.notebook.storage": "org.apache.zeppelin.notebook.repo.VFSNotebookRepo", 
+            "zeppelin.websocket.max.text.message.size": "1024000", 
+            "zeppelin.interpreter.connect.timeout": "30000", 
+            "zeppelin.notebook.s3.bucket": "zeppelin", 
+            "zeppelin.notebook.homescreen.hide": "false", 
+            "zeppelin.server.allowed.origins": "*"
+        },
+    "zoo.cfg": {
+      "clientPort": "2181"
+    },
+    "ranger-hbase-plugin-properties": {
+      "ranger-hbase-plugin-enabled":"yes"
+    },
+    "ranger-hive-plugin-properties": {
+      "ranger-hive-plugin-enabled":"yes"
+    },
+    "ranger-env": {
+      "xml_configurations_supported" : "true"
+    },
+    "tagsync-application-properties": {
+            "atlas.kafka.hook.group.id": "atlas",
+            "atlas.kafka.zookeeper.connect": "os-mv-31-dev-4.novalocal:2181",
+            "atlas.kafka.acks": "1",
+            "atlas.kafka.entities.group.id": "ranger_entities_consumer",
+            "atlas.kafka.data": "/usr/hdp/current/atlas-server/data/kafka",
+            "atlas.kafka.bootstrap.servers": "localhost:2181",
+            "atlas.notification.embedded": "false"
+    },
+    "ranger-tagsync-site": {
+            "ranger.tagsync.sink.impl.class": "org.apache.ranger.tagsync.sink.tagadmin.TagAdminRESTSink",
+            "ranger.tagsync.atlasrestsource.endpoint": "",
+            "ranger.tagsync.tagadmin.rest.ssl.config.file": "/usr/hdp/current/ranger-tagsync/conf/mytruststore.jks",
+            "ranger.tagsync.logdir": "/var/log/ranger/tagsync",
+            "ranger.tagsync.filesource.filename": "/usr/hdp/current/ranger-tagsync/conf/etc/ranger/data/tags.json",
+            "ranger.tagsync.enabled": "true",
+            "ranger.tagsync.tagadmin.rest.url": "{{ranger_external_url}}",
+            "ranger.tagsync.atlasrestsource.download.interval": "",
+            "ranger.tagsync.filesource.modtime.check.interval": "60000",
+            "ranger.tagsync.tagadmin.password": "rangertagsync",
+            "ranger.tagsync.source.impl.class": "file",
+            "ranger.tagsync.source.atlas.custom.resource.mappers": "",
+            "ranger.tagsync.tagadmin.alias": "tagsync.tagadmin",
+            "ranger.tagsync.tagadmin.keystore": "/usr/hdp/current/ranger-tagsync/conf/rangertagsync.jceks",
+            "ranger.tagsync.atlas.to.service.mapping": ""
+    },
+    "druid-env": {
+      "druid_log_dir" : "/var/log/druid",
+      "druid_pid_dir" : "/var/run/druid",
+      "content" : "#!/bin/bash\n # Set DRUID specific environment variables here.\n# The java implementation to use\nexport JAVA_HOME={{java8_home}}\nexport PATH=$PATH:$JAVA_HOME/bin\nexport DRUID_PID_DIR={{druid_pid_dir}}\nexport DRUID_LOG_DIR={{druid_log_dir}}\nexport DRUID_CONF_DIR={{druid_conf_dir}}\nexport DRUID_LIB_DIR={{druid_home}}/lib",
+      "druid.coordinator.jvm.heap.memory" : 1024,
+      "druid.coordinator.jvm.direct.memory": 2048,
+      "druid.coordinator.jvm.opts": "-Duser.timezone=UTC -Dfile.encoding=UTF-8",
+      "druid.broker.jvm.heap.memory" : 1024,
+      "druid.broker.jvm.direct.memory": 2048,
+      "druid.broker.jvm.opts": "-Duser.timezone=UTC -Dfile.encoding=UTF-8",
+      "druid.middlemanager.jvm.heap.memory" : 1024,
+      "druid.middlemanager.jvm.direct.memory": 2048,
+      "druid.middlemanager.jvm.opts": "-Duser.timezone=UTC -Dfile.encoding=UTF-8",
+      "druid.historical.jvm.heap.memory" : 1024,
+      "druid.historical.jvm.direct.memory": 2048,
+      "druid.historical.jvm.opts": "-Duser.timezone=UTC -Dfile.encoding=UTF-8",
+      "druid.overlord.jvm.heap.memory" : 1024,
+      "druid.overlord.jvm.direct.memory": 2048,
+      "druid.overlord.jvm.opts": "-Duser.timezone=UTC -Dfile.encoding=UTF-8",
+      "druid.router.jvm.heap.memory" : 1024,
+      "druid.router.jvm.direct.memory": 2048,
+      "druid.router.jvm.opts": "-Duser.timezone=UTC -Dfile.encoding=UTF-8",
+      "druid_user": "druid"
+    },
+    "druid-common" : {
+      "druid.metadata.storage.type" : "mysql",
+      "druid.metadata.storage.connector.connectURI" : "jdbc:mysql://my-db-host:3306/druid?createDatabaseIfNotExist=true",
+      "druid.metadata.storage.connector.user" : "druid",
+      "druid.metadata.storage.connector.password" : "diurd",
+      "druid.storage.type" : "hdfs",
+      "druid.storage.storageDirectory" : "/user/druid/data",
+      "druid.indexer.logs.type": "hdfs",
+      "druid.indexer.logs.directory": "/user/druid/logs",
+      "druid.extensions.pullList": "[\"custom-druid-extension\"]",
+      "druid.extensions.repositoryList": "[\"http://custom-mvn-repo/public/release\"]",
+      "druid.extensions.loadList": "[\"mysql-metadata-storage\", \"druid-datasketches\"]",
+      "druid.security.extensions.loadList": "[\"druid-kerberos\"]"
+    },
+    "druid-historical" : {
+      "druid.segmentCache.infoDir" : "/apps/druid/segmentCache/info_dir",
+      "druid.segmentCache.locations" :"[{\"path\":\"/apps/druid/segmentCache\",\"maxSize\":300000000000}]"
+    },
+    "druid-coordinator" : {
+      "druid.service" : "druid/coordinator"
+    },
+    "druid-overlord" : {
+      "druid.service" : "druid/overlord"
+    },
+    "druid-broker" : {
+      "druid.service" : "druid/broker"
+    },
+    "druid-middlemanager" : {
+      "druid.service" : "druid/middlemanager",
+      "druid.indexer.task.hadoopWorkingPath" : "/tmp/druid-indexing",
+      "druid.indexer.task.baseTaskDir" : "/apps/druid/tasks"
+    },
+    "druid-router" : {
+      "druid.service" : "druid/router"
+    },
+    "druid-log4j" : {
+      "content" : "<![CDATA[<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one\n  ~ or more contributor license agreements.  See the NOTICE file\n  ~ distributed with this work for additional information\n  ~ regarding copyright ownership.  The ASF licenses this file\n  ~ to you under the Apache License, Version 2.0 (the\n  ~ \"License\"); you may not use this file except in compliance\n  ~ with the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n    <Configuration>\n        <Appenders>\n            <Console name=\"Console\
 " target=\"SYSTEM_OUT\">\n                <PatternLayout pattern=\"%d{ISO8601} %p [%t] %c - %m%n\"/>\n            </Console>\n        </Appenders>\n        <Loggers>\n            <Logger name=\"com.metamx\" level=\"{{metamx_log_level}}\"/>\n            <Logger name=\"io.druid\" level=\"{{druid_log_level}}\"/>\n            <Root level=\"{{root_log_level}}\">\n                <AppenderRef ref=\"Console\"/>\n            </Root>\n        </Loggers>\n    </Configuration>\n      ]]>\n"
+    },
+    "druid-logrotate" : {
+      "content" : "<![CDATA[\n    {{druid_log_dir}}/*.log {\n        copytruncate\n        rotate 7\n        daily\n        nocompress\n        missingok\n        notifempty\n        create 660 druid users\n        dateext\n        dateformat -%Y-%m-%d-%s\n        }\n      ]]>\n"
+    },
+    "superset" : {
+      "SUPERSET_DATABASE_TYPE" : "sqllite"
+    }
+  },
+  "configuration_attributes": {
+    "sqoop-site": {},
+    "yarn-site": {
+      "final": {
+        "yarn.nodemanager.disk-health-checker.min-healthy-disks": "true",
+        "yarn.nodemanager.container-executor.class": "true",
+        "yarn.nodemanager.local-dirs": "true"
+      }
+    },
+    "yarn-site": {
+      "final": {
+        "is_supported_yarn_ranger": "true"
+      }
+    },
+    "hdfs-site": {
+      "final": {
+        "dfs.web.ugi": "true",
+        "dfs.support.append": "true",
+        "dfs.cluster.administrators": "true"
+      }
+    },
+    "core-site": {
+      "final": {
+        "hadoop.proxyuser.hive.groups": "true",
+        "webinterface.private.actions": "true",
+        "hadoop.proxyuser.oozie.hosts": "true"
+      }
+    },
+    "knox-env": {},
+    "gateway-site": {},
+    "users-ldif": {},
+    "kafka-env": {},
+    "kafka-log4j": {},
+    "kafka-broker": {},
+    "metadata-env": {},
+    "atlas-hbase-site": {},
+    "tagsync-application-properties": {},
+    "ranger-tagsync-site": {}
+  },
+  "configurationTags": {
+    "slider-client": {
+      "tag": "version1"
+    },
+    "slider-log4j": {
+      "tag": "version1"
+    },
+    "slider-env": {
+      "tag": "version1"
+    },
+    "core-site": {
+      "tag": "version1"
+    },
+    "hdfs-site": {
+      "tag": "version1"
+    },
+    "yarn-site": {
+      "tag": "version1"
+    },
+    "gateway-site": {
+      "tag": "version1"
+    },
+    "topology": {
+      "tag": "version1"
+    },
+    "users-ldif": {
+      "tag": "version1"
+    },
+    "kafka-env": {
+      "tag": "version1"
+    },
+    "kafka-log4j": {
+      "tag": "version1"
+    },
+    "kafka-broker": {
+      "tag": "version1"
+    },
+    "metadata-env": {
+      "tag": "version1"
+    },
+    "tagsync-application-properties": {
+      "tag": "version1"
+    },
+    "ranger-tagsync-site": {
+      "tag": "version1"
+    }
+  },
+  "commandId": "7-1",
+  "clusterHostInfo": {
+    "ambari_server_host": [
+      "c6401.ambari.apache.org"
+    ],
+    "all_ping_ports": [
+      "8670",
+      "8670"
+    ],
+    "rm_host": [
+      "c6402.ambari.apache.org"
+    ],
+    "all_hosts": [
+      "c6401.ambari.apache.org",
+      "c6402.ambari.apache.org"
+    ],
+    "knox_gateway_hosts": [
+      "jaimin-knox-1.c.pramod-thangali.internal"
+    ],
+    "kafka_broker_hosts": [
+      "c6401.ambari.apache.org"
+    ],
+    "infra_solr_hosts": [
+      "c6401.ambari.apache.org"
+    ],
+    "zookeeper_hosts": [
+      "c6401.ambari.apache.org"
+    ],
+    "ranger_tagsync_hosts": [
+      "c6401.ambari.apache.org"
+    ],
+    "atlas_server_hosts": [
+      "c6401.ambari.apache.org"
+    ],
+    "zeppelin_master_hosts": [
+      "c6401.ambari.apache.org"
+    ]
+  }
+}