You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by am...@apache.org on 2017/11/22 11:16:56 UTC

[01/50] [abbrv] ambari git commit: AMBARI-22389. Exclude test scope jars from Log Search / Log Feeder rpm/deb packages (oleewere)

Repository: ambari
Updated Branches:
  refs/heads/branch-feature-AMBARI-22008 8f2ccf949 -> bd5320232


AMBARI-22389. Exclude test scope jars from Log Search / Log Feeder rpm/deb packages (oleewere)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 444718a10479c02dc6251ab8dc56eae70723f7bb
Parents: 38476f7
Author: Oliver Szabo <ol...@gmail.com>
Authored: Thu Nov 9 14:18:46 2017 +0100
Committer: Oliver Szabo <ol...@gmail.com>
Committed: Thu Nov 9 14:19:17 2017 +0100

----------------------------------------------------------------------
 ambari-logsearch/ambari-logsearch-logfeeder/pom.xml | 2 +-
 ambari-logsearch/ambari-logsearch-server/pom.xml    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/444718a1/ambari-logsearch/ambari-logsearch-logfeeder/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/pom.xml b/ambari-logsearch/ambari-logsearch-logfeeder/pom.xml
index 6b7d94f..01710bf 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/pom.xml
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/pom.xml
@@ -240,12 +240,12 @@
 
             </goals>
             <configuration>
-              <artifactItems>*</artifactItems>
               <outputAbsoluteArtifactFilename>true</outputAbsoluteArtifactFilename>
               <outputDirectory>${basedir}/target/libs</outputDirectory>
               <overWriteReleases>false</overWriteReleases>
               <overWriteSnapshots>false</overWriteSnapshots>
               <overWriteIfNewer>true</overWriteIfNewer>
+              <includeScope>compile</includeScope>
             </configuration>
           </execution>
         </executions>

http://git-wip-us.apache.org/repos/asf/ambari/blob/444718a1/ambari-logsearch/ambari-logsearch-server/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/pom.xml b/ambari-logsearch/ambari-logsearch-server/pom.xml
index 2ad35f5..5444b00 100755
--- a/ambari-logsearch/ambari-logsearch-server/pom.xml
+++ b/ambari-logsearch/ambari-logsearch-server/pom.xml
@@ -118,13 +118,13 @@
                   <goal>copy-dependencies</goal>
                 </goals>
                 <configuration>
-                  <artifactItems>*</artifactItems>
                   <excludeArtifactIds>ambari-logsearch-web</excludeArtifactIds>
                   <outputAbsoluteArtifactFilename>true</outputAbsoluteArtifactFilename>
                   <outputDirectory>${basedir}/target/libs</outputDirectory>
                   <overWriteReleases>false</overWriteReleases>
                   <overWriteSnapshots>false</overWriteSnapshots>
                   <overWriteIfNewer>true</overWriteIfNewer>
+                  <includeScope>compile</includeScope>
                 </configuration>
               </execution>
             </executions>


[21/50] [abbrv] ambari git commit: AMBARI-22425 Ambari 3.0: Implement new design for Admin View: fix checkboxes. (atkach)

Posted by am...@apache.org.
AMBARI-22425 Ambari 3.0: Implement new design for Admin View: fix checkboxes. (atkach)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: d11faab139761a3e32da773e190951d10d1166f1
Parents: 7428e51
Author: Andrii Tkach <at...@apache.org>
Authored: Mon Nov 13 13:55:43 2017 +0200
Committer: Andrii Tkach <at...@apache.org>
Committed: Tue Nov 14 11:21:46 2017 +0200

----------------------------------------------------------------------
 .../resources/ui/admin-web/app/styles/main.css  | 15 ++++----
 .../ui/admin-web/app/styles/top-nav.css         |  3 ++
 .../admin-web/app/views/ambariViews/create.html | 20 +++++------
 .../admin-web/app/views/ambariViews/edit.html   | 37 +++++++++-----------
 .../app/views/authentication/main.html          |  8 ++---
 .../app/views/modals/AddVersionModal.html       | 14 ++++----
 .../admin-web/app/views/stackVersions/list.html | 11 ++++--
 .../views/stackVersions/stackVersionPage.html   | 27 +++++++-------
 8 files changed, 65 insertions(+), 70 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d11faab1/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css b/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
index 4224f62..9838227 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
@@ -459,6 +459,11 @@ table.no-border tr td{
   vertical-align: top;
 }
 
+.table td > .checkbox {
+  margin-bottom: 0;
+  margin-top: 0;
+}
+
 .groups-pane table ul{
   list-style-type: none;
   margin: 0;
@@ -821,15 +826,6 @@ accordion .panel-group .panel{
   padding-left: 19px;
 }
 
-.repo-version-inline {
-  left: 11%;
-}
-
-.repo-version-inline .repo-version-label {
-  text-align: left;
-
-}
-
 .repo-version-inline .dot {
   padding-right: 15px;
 }
@@ -1164,6 +1160,7 @@ thead.view-permission-header > tr > th {
 }
 
 .register-version-form .details-panel .control-label {
+  line-height: 20px;
   text-align: left;
   padding: 7px 2px;
   font-weight: normal;

http://git-wip-us.apache.org/repos/asf/ambari/blob/d11faab1/ambari-admin/src/main/resources/ui/admin-web/app/styles/top-nav.css
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/styles/top-nav.css b/ambari-admin/src/main/resources/ui/admin-web/app/styles/top-nav.css
index f93b2e6..327dc7f 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/styles/top-nav.css
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/styles/top-nav.css
@@ -37,6 +37,9 @@
   font-size: 16px;
 }
 
+#top-nav .container {
+  background: #fff;
+}
 
 /** Override bootstrap styles **/
 @media (min-width: 0) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/d11faab1/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/create.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/create.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/create.html
index 25f1487..81171c1 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/create.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/create.html
@@ -80,9 +80,8 @@
       <div class="form-group">
         <div class="col-sm-10 col-sm-offset-3">
           <div class="checkbox">
-            <label>
-              <input type="checkbox" ng-model='instance.visible' class="visibilityCheckbox"> {{'views.visible' | translate}}
-            </label>
+            <input type="checkbox" ng-model='instance.visible' id="visibility-checkbox" class="visibilityCheckbox">
+            <label for="visibility-checkbox">{{'views.visible' | translate}}</label>
           </div>
         </div>
       </div>
@@ -122,9 +121,8 @@
 
     <div class="panel-body property-form" popover="{{clusterConfigurableErrorMsg}}" popover-trigger="mouseenter">
       <div class="checkbox create-checkbox-cluster">
-        <label>
-          <input type="radio" ng-disabled="!clusterConfigurable || noLocalClusterAvailible" ng-model="instance.clusterType" ng-change="enableLocalCluster()" value="LOCAL_AMBARI" class="visibilityCheckbox"> {{'views.localCluster' | translate}}
-        </label>
+        <input type="radio" id="local-cluster" ng-disabled="!clusterConfigurable || noLocalClusterAvailible" ng-model="instance.clusterType" ng-change="enableLocalCluster()" value="LOCAL_AMBARI" class="visibilityCheckbox">
+        <label for="local-cluster">{{'views.localCluster' | translate}}</label>
       </div>
 
       <div class="form-horizontal property-form">
@@ -143,9 +141,8 @@
 
     <div class="panel-body property-form" popover="{{clusterConfigurableErrorMsg}}" popover-trigger="mouseenter">
       <div class="checkbox create-checkbox-cluster">
-        <label>
-          <input type="radio" ng-disabled="!clusterConfigurable || noRemoteClusterAvailible" ng-model="instance.clusterType" ng-change="enableLocalCluster()" value="REMOTE_AMBARI" class="visibilityCheckbox"> {{'views.remoteCluster' | translate}}
-        </label>
+        <input type="radio" id="remote-cluster" ng-disabled="!clusterConfigurable || noRemoteClusterAvailible" ng-model="instance.clusterType" ng-change="enableLocalCluster()" value="REMOTE_AMBARI" class="visibilityCheckbox">
+        <label for="remote-cluster">{{'views.remoteCluster' | translate}}</label>
       </div>
 
       <div class="form-horizontal property-form">
@@ -164,9 +161,8 @@
 
     <div class="panel-body property-form" ng-hide="!numberOfClusterConfigs">
       <div class="checkbox">
-        <label>
-          <input type="radio" ng-model="instance.clusterType" value="NONE" class="visibilityCheckbox"> {{'views.custom' | translate}}
-        </label>
+        <input type="radio" id="custom-view" ng-model="instance.clusterType" value="NONE" class="visibilityCheckbox">
+        <label for="custom-view">{{'views.custom' | translate}}</label>
       </div>
       <div class="alert alert-danger bottom-margin top-margin" ng-show='form.instanceCreateForm.generalValidationError'>
         {{form.instanceCreateForm.generalValidationError}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/d11faab1/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/edit.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/edit.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/edit.html
index f91862d..a86e285 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/edit.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/edit.html
@@ -107,9 +107,8 @@
         <div class="form-group">
           <div class="col-sm-offset-3 col-sm-10">
             <div class="checkbox">
-              <label>
-                <input type="checkbox" ng-model="settings.visible" ng-class="instancevisibility-input"> {{'views.visible' | translate}}
-              </label>
+              <input type="checkbox" class="form-control" ng-model="settings.visible" id="visible" ng-class="instancevisibility-input">
+              <label for="visible">{{'views.visible' | translate}}</label>
             </div>
           </div>
         </div>
@@ -173,9 +172,8 @@
   </div>
   <div class="panel-body property-form" popover="{{clusterConfigurableErrorMsg}}" popover-trigger="mouseenter">
     <div class="checkbox">
-      <label>
-        <input type="radio" ng-model="data.clusterType" ng-change="enableLocalCluster()" ng-disabled="!clusterConfigurable || editConfigurationDisabled || noLocalClusterAvailible" value="LOCAL_AMBARI" class="visibilityCheckbox"> {{'views.localCluster' | translate}}
-      </label>
+      <input type="radio" id="local-cluster" ng-model="data.clusterType" ng-change="enableLocalCluster()" ng-disabled="!clusterConfigurable || editConfigurationDisabled || noLocalClusterAvailible" value="LOCAL_AMBARI" class="visibilityCheckbox form-control">
+      <label for="local-cluster">{{'views.localCluster' | translate}}</label>
     </div>
     <div class="form-horizontal property-form">
       <div class="form-group">
@@ -189,9 +187,8 @@
     </div>
     <p>&nbsp</p>
       <div class="checkbox">
-        <label>
-          <input type="radio" ng-model="data.clusterType" ng-change="enableLocalCluster()" ng-disabled="!clusterConfigurable || editConfigurationDisabled || noRemoteClusterAvailible" value="REMOTE_AMBARI" class="visibilityCheckbox"> {{'views.remoteCluster' | translate}}
-        </label>
+        <input type="radio" id="remote-cluster" ng-model="data.clusterType" ng-change="enableLocalCluster()" ng-disabled="!clusterConfigurable || editConfigurationDisabled || noRemoteClusterAvailible" value="REMOTE_AMBARI" class="visibilityCheckbox form-control">
+        <label for="remote-cluster">{{'views.remoteCluster' | translate}}</label>
       </div>
       <div class="form-horizontal property-form">
         <div class="form-group">
@@ -205,15 +202,14 @@
       </div>
       <p>&nbsp</p>
     <div class="checkbox" ng-hide="isConfigurationEmpty">
-      <label>
-        <input type="radio"
-         ng-model="data.clusterType"
-         ng-disabled="editConfigurationDisabled"
-         value="NONE"
-         ng-change="disableLocalCluster()"
-         class="visibilityCheckbox">
-        {{'views.custom' | translate}}
-      </label>
+      <input type="radio"
+             id="custom-view"
+             ng-model="data.clusterType"
+             ng-disabled="editConfigurationDisabled"
+             value="NONE"
+             ng-change="disableLocalCluster()"
+             class="visibilityCheckbox">
+      <label for="custom-view">{{'views.custom' | translate}}</label>
     </div>
   </div>
   <div class="panel-body edit-view-custom-wrap">
@@ -289,9 +285,8 @@
       <div class="col-sm-offset-2 col-sm-10">
         <div class="checkbox col-sm-12" ng-repeat="key in permissionRoles">
           <div ng-init="i18nKey = 'views.clusterPermissions.' + key.split('.').join('').toLowerCase()">
-            <label>
-              <input type="checkbox" ng-model="permissionsEdit['VIEW.USER']['ROLE'][key]"> {{i18nKey | translate}}
-            </label>
+            <input ng-attr-id="{{i18nKey}}" type="checkbox" class="form-control" ng-model="permissionsEdit['VIEW.USER']['ROLE'][key]">
+            <label ng-attr-for="{{i18nKey}}">{{i18nKey | translate}}</label>
           </div>
         </div>
         <a href ng-click="checkAllRoles()">{{'common.controls.checkAll' | translate}}</a> | <a href ng-click="clearAllRoles()">{{'common.controls.clearAll' | translate}}</a>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d11faab1/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 fddedb9..0275a21 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
@@ -58,10 +58,8 @@
         </div>
       </div>
       <div class="form-group">
+        <input type="checkbox" id="ssl" ng-model="connectivity.ssl" class="col-sm-8">
         <label for="ssl" class="control-label col-sm-4">{{'authentication.connectivity.ssl' | translate}}</label>
-        <div class="col-sm-8">
-          <input type="checkbox" id="ssl" ng-model="connectivity.ssl">
-        </div>
       </div>
       <div class="form-group">
         <label for="trust-store" class="control-label col-sm-4">{{'authentication.connectivity.trustStore.label' | translate}}</label>
@@ -121,12 +119,12 @@
       <form class="form-horizontal" ng-submit="detectAttributes()">
         <div class="form-group col-sm-12">{{'authentication.attributes.detection.label' | translate}}</div>
         <div class="form-group">
+          <input type="radio" id="manual-detection" name="detection" ng-model="attributes.detection" ng-disabled="isAttributeDetectionRunning" value="manual">
           <label for="manual-detection" class="col-sm-12">
-            <input type="radio" id="manual-detection" name="detection" ng-model="attributes.detection" ng-disabled="isAttributeDetectionRunning" value="manual">
             {{'authentication.attributes.detection.options.manual' | translate}}
           </label>
+          <input type="radio" id="auto-detection" name="detection" ng-model="attributes.detection" ng-disabled="isAttributeDetectionRunning" value="auto">
           <label for="auto-detection" class="col-sm-12">
-            <input type="radio" id="auto-detection" name="detection" ng-model="attributes.detection" ng-disabled="isAttributeDetectionRunning" value="auto">
             {{'authentication.attributes.detection.options.auto' | translate}}
           </label>
         </div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d11faab1/ambari-admin/src/main/resources/ui/admin-web/app/views/modals/AddVersionModal.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/modals/AddVersionModal.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/modals/AddVersionModal.html
index 457be7b..be11e1a 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/modals/AddVersionModal.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/modals/AddVersionModal.html
@@ -20,9 +20,10 @@
 </div>
 <br>
 <div class="clearfix register-version-options" ng-click="selectedLocalOption.index=1">
-    <div class="option-radio-button">
-        <label class="option-label">
-            <input type="radio" ng-model="selectedLocalOption.index" value="1"> {{'versions.uploadFile' | translate}}
+    <div class="option-radio-button checkbox">
+        <input type="radio" id="upload-file" ng-model="selectedLocalOption.index" value="1">
+        <label for="upload-file" class="option-label">
+           {{'versions.uploadFile' | translate}}
         </label>
     </div>
     <div class="col-sm-7 choose-file-input">
@@ -31,9 +32,10 @@
     </div>
 </div>
 <div class="clearfix register-version-options bottom-margin" ng-click="selectedLocalOption.index=2">
-    <div class="option-radio-button">
-        <label class="option-label">
-            <input type="radio" ng-model="selectedLocalOption.index" value="2"> {{'versions.enterURL' | translate}}
+    <div class="option-radio-button checkbox">
+        <input type="radio" id="entire-url" ng-model="selectedLocalOption.index" value="2">
+        <label for="entire-url" class="option-label">
+             {{'versions.enterURL' | translate}}
         </label>
     </div>
     <div class="col-sm-9">

http://git-wip-us.apache.org/repos/asf/ambari/blob/d11faab1/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/list.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/list.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/list.html
index 99f9ac0..a411640 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/list.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/list.html
@@ -97,11 +97,11 @@
           <span class="label {{'status-' + repo.status}}">{{'versions.installed' | translate}}:&nbsp;{{repo.installedHosts}}/{{repo.totalHosts}}</span>
         </div>
         <div ng-show="!repo.cluster">
-          <div class="btn-group display-inline-block" dropdown is-open="viewsdropdown.isopen" ng-mouseover="viewsdropdown.isopen=true" ng-mouseout="viewsdropdown.isopen=false" ng-init="viewsdropdown.isopen=false">
+          <div class="btn-group" ng-class="{open: viewsdropdown.isopen}" ng-mouseover="viewsdropdown.isopen=true" ng-mouseout="viewsdropdown.isopen=false" ng-init="viewsdropdown.isopen=false">
             <a class="btn dropdown-toggle">
               <span>{{'versions.installOn' | translate}}</span>
             </a>
-            <ul class="dropdown-menu" ng-show="viewsdropdown.isopen">
+            <ul class="dropdown-menu">
               <li ng-repeat="cluster in dropDownClusters">
                 <a href="javascript:void(null)" ng-click="goToCluster()">
                   <span>{{cluster.Clusters.cluster_name}}</span>
@@ -111,7 +111,12 @@
           </div>
         </div>
       </td>
-      <td class="text-center"><input type="checkbox" data-ng-model="repo.hidden" data-ng-change="toggleVisibility(repo)" data-ng-disabled="!isHideCheckBoxEnabled(repo)"/></td>
+      <td class="text-center">
+        <div class="checkbox">
+          <input ng-attr-id="{{ 'hidden-' + repo.id }}" type="checkbox" class="form-control" data-ng-model="repo.hidden" data-ng-change="toggleVisibility(repo)" data-ng-disabled="!isHideCheckBoxEnabled(repo)"/>
+          <label ng-attr-for="{{ 'hidden-' + repo.id }}"><span></span></label>
+        </div>
+      </td>
     </tr>
     </tbody>
   </table>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d11faab1/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html
index 85d659d..ea30824 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html
@@ -119,14 +119,14 @@
   </div>
 
   <div id="upload-definition-file-panel" ng-if="createController">
-    <div class="col-sm-12 big-radio clearfix hide-soft" ng-class="{'disabled' : networkLost || useRedhatSatellite,'visible':stackRepoUpdateLinkExists}">
-      <input type="radio" ng-model="selectedOption.index" value="1" ng-change="togglePublicLocalOptionSelect()" ng-disabled="networkLost || useRedhatSatellite">
-      <span>{{'versions.usePublic' | translate}}</span>
+    <div class="checkbox col-sm-12 big-radio clearfix hide-soft" ng-class="{'disabled' : networkLost || useRedhatSatellite,'visible':stackRepoUpdateLinkExists}">
+      <input id="use-public" type="radio" ng-model="selectedOption.index" value="1" ng-change="togglePublicLocalOptionSelect()" ng-disabled="networkLost || useRedhatSatellite">
+      <label for="use-public">{{'versions.usePublic' | translate}}</label>
       <a id="public-disabled-link" href="javascript:void(0);" ng-if="networkLost" ng-click="showPublicRepoDisabledDialog()">{{'versions.networkIssues.networkLost'| translate}}</a>
     </div>
-    <div class="col-sm-12 big-radio clearfix">
-      <input type="radio" ng-model="selectedOption.index" value="2" ng-change="togglePublicLocalOptionSelect()">
-      {{'versions.useLocal' | translate}}
+    <div class="checkbox col-sm-12 big-radio clearfix">
+      <input id="use-local" type="radio" ng-model="selectedOption.index" value="2" ng-change="togglePublicLocalOptionSelect()">
+      <label for="use-local">{{'versions.useLocal' | translate}}</label>
     </div>
   </div>
 
@@ -204,22 +204,21 @@
             </div>
           </div>
           <div class="clearfix advanced-radio-buttons">
-            <div class="col-sm-9" id="skip-validation">
+            <div class="col-sm-9">
               <div class="checkbox">
-                <label>
-                  <input type="checkbox" ng-model="skipValidation" ng-change="clearErrors()"
-                         ng-disabled="useRedhatSatellite">
+                <input type="checkbox" id="skip-validation" ng-model="skipValidation" ng-change="clearErrors()" ng-disabled="useRedhatSatellite">
+                <label for="skip-validation">
                   <span ng-class="{'disabled' : useRedhatSatellite}">{{'versions.skipValidation' | translate}}</span>
                   <i class="fa fa-question-circle"
                      tooltip-html-unsafe="{{'versions.alerts.skipValidationWarning' | translate}}" aria-hidden="true"></i>
                 </label>
               </div>
             </div>
-            <div class="col-sm-9" id="use-redhat">
+            <div class="col-sm-9">
               <div class="checkbox">
-                <label>
-                  <input type="checkbox" ng-model="useRedhatSatellite" ng-change="clearErrors()"
-                         ng-disabled="isPublicRepoSelected()">
+                <input type="checkbox" id="use-redhat" ng-model="useRedhatSatellite" ng-change="clearErrors()"
+                       ng-disabled="isPublicRepoSelected()">
+                <label for="use-redhat">
                   <span ng-class="{'disabled' : isPublicRepoSelected()}"
                         tooltip="{{(isPublicRepoSelected())? ('versions.useRedhatSatellite.disabledMsg' | translate) : ''}}">{{'versions.useRedhatSatellite.title' | translate}}</span>
                   <i class="fa fa-question-circle"


[48/50] [abbrv] ambari git commit: AMBARI-22424. Quicklinks for OneFS (amagyar)

Posted by am...@apache.org.
AMBARI-22424. Quicklinks for OneFS (amagyar)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 6fedb9f5ee4be16d2c856f944d8b7322d348ff33
Parents: 43840c5
Author: Attila Magyar <am...@hortonworks.com>
Authored: Mon Nov 13 16:00:50 2017 +0100
Committer: Attila Magyar <am...@hortonworks.com>
Committed: Wed Nov 22 10:55:11 2017 +0100

----------------------------------------------------------------------
 .../ambari/server/state/quicklinks/Host.java    | 75 ++++++++++++++++++++
 .../ambari/server/state/quicklinks/Link.java    | 13 ++++
 .../QuickLinksConfigurationModuleTest.java      |  3 +
 .../resources/child_quicklinks_to_override.json |  4 ++
 .../app/views/common/quick_view_link_view.js    | 64 +++++++++++++----
 .../test/views/common/quick_link_view_test.js   | 15 +++-
 .../addon-services/ONEFS/1.0.0/metainfo.xml     |  7 ++
 .../ONEFS/1.0.0/quicklinks/quicklinks.json      | 31 ++++++++
 8 files changed, 197 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6fedb9f5/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinks/Host.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinks/Host.java b/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinks/Host.java
new file mode 100644
index 0000000..074d4e7
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinks/Host.java
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.server.state.quicklinks;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+/**
+ * Quick links may override host names of host components with host names that come from configuration.
+ */
+@JsonSerialize(include= JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class Host {
+  /**
+   * The property name that has the host name if the protocol is http
+   */
+  @JsonProperty("http_property")
+  private String httpProperty;
+
+  /**
+   * The property name that has the host name if the protocol is https
+   */
+  @JsonProperty("https_property")
+  private String httpsProperty;
+
+  /**
+   * The config type where the overridden host name comes from
+   */
+  @JsonProperty("site")
+  private String site;
+
+  public String getHttpProperty() {
+    return httpProperty;
+  }
+
+  public String getHttpsProperty() {
+    return httpsProperty;
+  }
+
+  public String getSite() {
+    return site;
+  }
+
+  public void mergeWithParent(Host parentHost) {
+    if(null == parentHost) {
+      return;
+    }
+    if(null == httpProperty && null != parentHost.getHttpProperty()) {
+      httpProperty = parentHost.getHttpProperty();
+    }
+    if(null == httpsProperty && null != parentHost.getHttpsProperty()) {
+      httpsProperty = parentHost.getHttpsProperty();
+    }
+    if(null == site && null != parentHost.getSite()) {
+      site = parentHost.getSite();
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/6fedb9f5/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinks/Link.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinks/Link.java b/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinks/Link.java
index 1d2e712..4e8e8a3 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinks/Link.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinks/Link.java
@@ -47,6 +47,9 @@ public class Link{
   @JsonProperty("port")
   private Port port;
 
+  @JsonProperty("host")
+  private Host host;
+
   @JsonProperty("protocol")
   private Protocol protocol;
 
@@ -100,6 +103,10 @@ public class Link{
     return port;
   }
 
+  public Host getHost() {
+    return host;
+  }
+
   public void setPort(Port port) {
     this.port = port;
   }
@@ -159,6 +166,12 @@ public class Link{
       port.mergetWithParent(parentLink.getPort());
     }
 
+    if(null == host){
+      host = parentLink.getHost();
+    } else {
+      host.mergeWithParent(parentLink.getHost());
+    }
+
     if (null == attributes && null != parentLink.attributes) {
       attributes = parentLink.attributes;
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/6fedb9f5/ambari-server/src/test/java/org/apache/ambari/server/stack/QuickLinksConfigurationModuleTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/stack/QuickLinksConfigurationModuleTest.java b/ambari-server/src/test/java/org/apache/ambari/server/stack/QuickLinksConfigurationModuleTest.java
index aac278d..040d630 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/stack/QuickLinksConfigurationModuleTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/stack/QuickLinksConfigurationModuleTest.java
@@ -33,6 +33,7 @@ import java.util.Set;
 
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.state.quicklinks.Check;
+import org.apache.ambari.server.state.quicklinks.Host;
 import org.apache.ambari.server.state.quicklinks.Link;
 import org.apache.ambari.server.state.quicklinks.Port;
 import org.apache.ambari.server.state.quicklinks.Protocol;
@@ -127,6 +128,8 @@ public class QuickLinksConfigurationModuleTest {
         hasLink = true;
         Port port = link.getPort();
         assertEquals("mapred-site", port.getSite());
+        Host host = link.getHost();
+        assertEquals("core-site", host.getSite());
       }
     }
     assertTrue(hasLink);

http://git-wip-us.apache.org/repos/asf/ambari/blob/6fedb9f5/ambari-server/src/test/resources/child_quicklinks_to_override.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/resources/child_quicklinks_to_override.json b/ambari-server/src/test/resources/child_quicklinks_to_override.json
index 4309532..0aaec1f 100644
--- a/ambari-server/src/test/resources/child_quicklinks_to_override.json
+++ b/ambari-server/src/test/resources/child_quicklinks_to_override.json
@@ -79,6 +79,10 @@
           "https_default_port": "8090",
           "regex": "\\w*:(\\d+)",
           "site": "mapred-site"
+        },
+        "host":{
+          "http_property": "fs.defaultFS",
+          "site": "core-site"
         }
       }
     ]

http://git-wip-us.apache.org/repos/asf/ambari/blob/6fedb9f5/ambari-web/app/views/common/quick_view_link_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/quick_view_link_view.js b/ambari-web/app/views/common/quick_view_link_view.js
index 5888acb..3ccc973 100644
--- a/ambari-web/app/views/common/quick_view_link_view.js
+++ b/ambari-web/app/views/common/quick_view_link_view.js
@@ -206,11 +206,8 @@ App.QuickLinksView = Em.View.extend({
       if (!Em.isEmpty(links)) {
         links.forEach(function (link) {
           if (!link.remove) {
-            var portConfig = Em.get(link, 'port');
-            var portConfigSiteProp = Em.get(portConfig, 'site');
-            if (!sites.contains(portConfigSiteProp)) {
-              sites.push(portConfigSiteProp);
-            }
+            this.addSite(link, 'host', sites);
+            this.addSite(link, 'port', sites);
           }
         }, this);
         this.set('requiredSiteNames', this.get('requiredSiteNames').pushObjects(sites).uniq());
@@ -222,6 +219,16 @@ App.QuickLinksView = Em.View.extend({
     }
   },
 
+  addSite: function(link, linkPropertyName, sites) {
+      var config = Em.get(link, linkPropertyName);
+      if (config) {
+        var siteName = Em.get(config, 'site');
+        if (!sites.contains(siteName)) {
+          sites.push(siteName);
+        }
+      }
+  },
+
   /**
    * call for public host names
    *
@@ -267,8 +274,8 @@ App.QuickLinksView = Em.View.extend({
     });
     // no need to set quicklinks if
     // 1)current service does not have quick links configured
-    // 2)No host component present for the configured quicklinks
-    if(hasQuickLinks && hasHosts) {
+    // 2)No host component present for the configured quicklinks and has no overridden hosts
+    if(hasQuickLinks && (hasHosts || this.hasOverriddenHost())) {
       this.set('showQuickLinks', true);
     } else {
       this.set('showNoLinks', true);
@@ -276,15 +283,20 @@ App.QuickLinksView = Em.View.extend({
 
     var isMultipleComponentsInLinks = componentNames.uniq().length > 1;
 
-    if (hosts.length === 0) {
+    if (hosts.length === 0 && !this.hasOverriddenHost()) {
       this.setEmptyLinks();
-    } else if (hosts.length === 1 || isMultipleComponentsInLinks) {
+    } else if (hosts.length === 1 || isMultipleComponentsInLinks || this.hasOverriddenHost()) {
       this.setSingleHostLinks(hosts, response);
     } else {
       this.setMultipleHostLinks(hosts);
     }
   },
 
+  hasOverriddenHost: function() {
+    var links = Em.get(this.getQuickLinksConfiguration(), 'links');
+    return links && links.some(function (each) { return each.host; });
+  },
+
   /**
    * Get public host name by its host name.
    *
@@ -424,10 +436,8 @@ App.QuickLinksView = Em.View.extend({
 
       var links = Em.get(quickLinksConfig, 'links');
       links.forEach(function (link) {
-        var componentName = link.component_name;
-        var hostNameForComponent = hosts.findProperty('componentName',componentName);
-        if (hostNameForComponent) {
-          var publicHostName = hostNameForComponent.publicHostName;
+        var publicHostName = this.publicHostName(link, hosts, protocol);
+        if (publicHostName) {
           if (link.protocol) {
             protocol = this.setProtocol(configProperties, link.protocol);
           }
@@ -446,6 +456,30 @@ App.QuickLinksView = Em.View.extend({
     }
   },
 
+  publicHostName: function(link, hosts, protocol) {
+    if (link.host) { // if quicklink overrides hostcomponent host name, get host from config
+      var configProperties = this.get('configProperties');
+      var hostProperty = Em.get(link.host, protocol + '_property');
+      var site = configProperties.findProperty('type', Em.get(link.host, 'site'));
+      return site && site.properties ? this.parseHostFromUri(site.properties[hostProperty]) : null;
+    } else {
+      var hostNameForComponent = hosts.findProperty('componentName', link.component_name);
+      return hostNameForComponent ? hostNameForComponent.publicHostName : null;
+    }
+  },
+
+  /**
+   * @param {string} uri
+   */
+  parseHostFromUri: function(uri) {
+    if (uri) {
+      var match = uri.match(/:\/\/([^/:]+)/i);
+      return match != null && match.length == 2 ? match[1] : uri;
+    } else {
+      return null;
+    }
+  },
+
   /**
    * set links that contain multiple hosts
    *
@@ -786,7 +820,9 @@ App.QuickLinksView = Em.View.extend({
    * @method setPort
    */
   setPort: function (portConfigs, protocol, configProperties) {
-
+    if (!portConfigs) {
+      return '';
+    }
     var defaultPort = Em.get(portConfigs, protocol + '_default_port');
     var portProperty = Em.get(portConfigs, protocol + '_property');
     var site = configProperties.findProperty('type', Em.get(portConfigs, 'site'));

http://git-wip-us.apache.org/repos/asf/ambari/blob/6fedb9f5/ambari-web/test/views/common/quick_link_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/common/quick_link_view_test.js b/ambari-web/test/views/common/quick_link_view_test.js
index 1998a9c..9adbbc8 100644
--- a/ambari-web/test/views/common/quick_link_view_test.js
+++ b/ambari-web/test/views/common/quick_link_view_test.js
@@ -195,6 +195,9 @@ describe('App.QuickViewLinks', function () {
           {
             port: {
               site: "yarn-site"
+            },
+            host: {
+              site: "yarn-env"
             }
           }
         ]
@@ -205,7 +208,7 @@ describe('App.QuickViewLinks', function () {
       quickViewLinks.set('content.serviceName', 'YARN');
       mock.returns(quickLinksConfigYARN);
       quickViewLinks.loadQuickLinksConfigSuccessCallback({items: []});
-      expect(quickViewLinks.get('requiredSiteNames')).to.be.eql(["core-site", "hdfs-site", "admin-properties", "hbase-site", "yarn-site"]);
+      expect(quickViewLinks.get('requiredSiteNames')).to.be.eql(["core-site", "hdfs-site", "admin-properties", "hbase-site", "yarn-site", "yarn-env"]);
     });
   });
 
@@ -247,8 +250,11 @@ describe('App.QuickViewLinks', function () {
   });
 
   describe("#setQuickLinksSuccessCallback()", function () {
+    var getQuickLinks;
     beforeEach(function () {
       this.mock = sinon.stub(quickViewLinks, 'getHosts');
+      getQuickLinks = sinon.stub(quickViewLinks, 'getQuickLinksConfiguration');
+      getQuickLinks.returns({});
       sinon.stub(quickViewLinks, 'setEmptyLinks');
       sinon.stub(quickViewLinks, 'setSingleHostLinks');
       sinon.stub(quickViewLinks, 'setMultipleHostLinks');
@@ -256,6 +262,7 @@ describe('App.QuickViewLinks', function () {
     });
     afterEach(function () {
       this.mock.restore();
+      getQuickLinks.restore();
       quickViewLinks.setEmptyLinks.restore();
       quickViewLinks.setSingleHostLinks.restore();
       quickViewLinks.setMultipleHostLinks.restore();
@@ -265,6 +272,12 @@ describe('App.QuickViewLinks', function () {
       quickViewLinks.setQuickLinksSuccessCallback();
       expect(quickViewLinks.setEmptyLinks.calledOnce).to.be.true;
     });
+    it("has overridden hosts", function () {
+      this.mock.returns([]);
+      getQuickLinks.returns({ links: [{ host: {site: "yarn-env"} }] });
+      quickViewLinks.setQuickLinksSuccessCallback();
+      expect(quickViewLinks.setEmptyLinks.calledOnce).to.be.false;
+    });
     it("quickLinks is not configured", function () {
       this.mock.returns([{}]);
       quickViewLinks.setQuickLinksSuccessCallback();

http://git-wip-us.apache.org/repos/asf/ambari/blob/6fedb9f5/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metainfo.xml
----------------------------------------------------------------------
diff --git a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metainfo.xml b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metainfo.xml
index 82e2022..5ba562e 100644
--- a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metainfo.xml
+++ b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metainfo.xml
@@ -86,6 +86,13 @@
         <config-type>hadoop-env</config-type>
       </configuration-dependencies>
       <restartRequiredAfterRackChange>true</restartRequiredAfterRackChange>
+
+      <quickLinksConfigurations>
+        <quickLinksConfiguration>
+          <fileName>quicklinks.json</fileName>
+          <default>true</default>
+        </quickLinksConfiguration>
+      </quickLinksConfigurations>
     </service>
   </services>
 </metainfo>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/6fedb9f5/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/quicklinks/quicklinks.json
----------------------------------------------------------------------
diff --git a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/quicklinks/quicklinks.json b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/quicklinks/quicklinks.json
new file mode 100644
index 0000000..0b9656f
--- /dev/null
+++ b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/quicklinks/quicklinks.json
@@ -0,0 +1,31 @@
+{
+  "name": "default",
+  "description": "default quick links configuration",
+  "configuration": {
+    "protocol": {
+      "type": "HTTP_ONLY"
+    },
+    "links": [
+      {
+        "component_name" : "ONEFS_CLIENT",
+        "name": "onefs_web_ui",
+        "label": "OneFS Web UI",
+        "url": "%@://%@",
+        "host": {
+          "http_property": "fs.defaultFS",
+          "site": "core-site"
+        }
+      },
+      {
+        "component_name" : "ONEFS_CLIENT",
+        "name": "onefs_hdfs_web_ui",
+        "label": "OneFS HDFS Settings",
+        "url": "%@://%@/OneFS#HDFS/Settings",
+        "host": {
+          "http_property": "fs.defaultFS",
+          "site": "core-site"
+        }
+      }
+    ]
+  }
+}
\ No newline at end of file


[40/50] [abbrv] ambari git commit: AMBARI-22460. NFSGateway start failed (aonishuk)

Posted by am...@apache.org.
AMBARI-22460. NFSGateway start failed (aonishuk)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: f087874e7b0bc1e5b5a2398c7571264aaec15fa5
Parents: 4042f9f
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Thu Nov 16 12:26:56 2017 +0200
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Thu Nov 16 12:26:56 2017 +0200

----------------------------------------------------------------------
 .../src/main/resources/stacks/HDP/2.0.6/role_command_order.json     | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f087874e/ambari-server/src/main/resources/stacks/HDP/2.0.6/role_command_order.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/role_command_order.json b/ambari-server/src/main/resources/stacks/HDP/2.0.6/role_command_order.json
index 78a31f1..3f576bf 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/role_command_order.json
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/role_command_order.json
@@ -14,6 +14,7 @@
     "HIVE_SERVER-RESTART": ["NODEMANAGER-RESTART", "MYSQL_SERVER-RESTART", "ZOOKEEPER_SERVER-RESTART"],
     "HUE_SERVER-START": ["HIVE_SERVER-START", "HCAT-START", "OOZIE_SERVER-START"],
     "FLUME_HANDLER-START": ["OOZIE_SERVER-START"],
+    "NFS_GATEWAY-START": ["NAMENODE-START"],
     "MAPREDUCE_SERVICE_CHECK-SERVICE_CHECK": ["NODEMANAGER-START", "RESOURCEMANAGER-START"],
     "OOZIE_SERVICE_CHECK-SERVICE_CHECK": ["OOZIE_SERVER-START", "MAPREDUCE2_SERVICE_CHECK-SERVICE_CHECK"],
     "HBASE_SERVICE_CHECK-SERVICE_CHECK": ["HBASE_MASTER-START", "HBASE_REGIONSERVER-START"],


[49/50] [abbrv] ambari git commit: AMBARI-22449. Improved service/component dependency support (amagyar)

Posted by am...@apache.org.
AMBARI-22449. Improved service/component dependency support (amagyar)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 91087e62d5f3105ae19662a18358e61fb0d5b771
Parents: 97cea11
Author: Attila Magyar <am...@hortonworks.com>
Authored: Thu Nov 16 15:35:41 2017 +0100
Committer: Attila Magyar <am...@hortonworks.com>
Committed: Wed Nov 22 10:55:12 2017 +0100

----------------------------------------------------------------------
 .../app/controllers/wizard/step4_controller.js  |  4 +--
 ambari-web/app/messages.js                      |  3 +-
 ambari-web/app/models/stack_service.js          | 30 +++++++++++---------
 3 files changed, 21 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/91087e62/ambari-web/app/controllers/wizard/step4_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step4_controller.js b/ambari-web/app/controllers/wizard/step4_controller.js
index d39164b..8a62f3b 100644
--- a/ambari-web/app/controllers/wizard/step4_controller.js
+++ b/ambari-web/app/controllers/wizard/step4_controller.js
@@ -480,11 +480,11 @@ App.WizardStep4Controller = Em.ArrayController.extend({
   needToAddMissingDependency: function (missingDependency, i18nSuffix, callback, id) {
     var self = this;
     var displayName = missingDependency.get('displayName');
-    if (missingDependency.hasMultipleOptions()) {
+    if (missingDependency.get('hasMultipleOptions')) {
       return this.showDependencyPopup(
         id,
         Em.I18n.t('installer.step4.' + i18nSuffix + '.popup.header').format(displayName),
-        Em.I18n.t('installer.step4.' + i18nSuffix + '.popup.body2').format(displayName, missingDependency.displayOptions()),
+        Em.I18n.t('installer.step4.' + i18nSuffix + '.popup.body.multiOptions').format(displayName, missingDependency.get('displayOptions')),
         callback
       );
     } else {

http://git-wip-us.apache.org/repos/asf/ambari/blob/91087e62/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 1afb6fe..9ca51de 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -880,7 +880,8 @@ Em.I18n.translations = {
   'installer.step4.multipleDFS.popup.body':'You selected more than one file system. We will automatically select only {0}. Is this OK?',
   'installer.step4.serviceCheck.popup.header':'{0} Needed',
   'installer.step4.serviceCheck.popup.body':'You did not select {0}, but it is needed by other services you selected. We will automatically add {1}. Is this OK?',
-  'installer.step4.serviceCheck.popup.body2':'You did not select {0}, but it is needed by other services you selected. Select a compatible service from the following list: {1}',
+  'installer.step4.serviceCheck.popup.body.multiOptions':'You did not select {0}, but it is needed by other services you selected. Select a compatible service from the following list: {1}',
+  'installer.step4.hcfs.displayName':'a Hadoop Compatible File System',
   'installer.step4.limitedFunctionality.popup.header':'Limited Functionality Warning',
   'installer.step4.ambariMetricsCheck.popup.body':'Ambari Metrics collects metrics from the cluster and makes them available to Ambari.  If you do not install Ambari Metrics service, metrics will not be accessible from Ambari.  Are you sure you want to proceed without Ambari Metrics?',
   'installer.step4.ambariInfraCheck.popup.body':'Since Ambari Infra is not selected, you must supply your own Solr to make Atlas work. Are you sure you want to proceed?',

http://git-wip-us.apache.org/repos/asf/ambari/blob/91087e62/ambari-web/app/models/stack_service.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/stack_service.js b/ambari-web/app/models/stack_service.js
index 46dfee5..a84816e 100644
--- a/ambari-web/app/models/stack_service.js
+++ b/ambari-web/app/models/stack_service.js
@@ -23,11 +23,11 @@ require('models/configs/objects/service_config_category');
 
 var Dependency = Ember.Object.extend({
   name: Ember.computed('service', function() {
-    return this.get('service').get('serviceName');
+    return this.get('service.serviceName');
   }),
 
   displayName: Ember.computed('service', function() {
-    return this.get('service').get('displayNameOnSelectServicePage');
+    return this.get('service.displayNameOnSelectServicePage');
   }),
 
   compatibleServices: function(services) {
@@ -40,8 +40,8 @@ var Dependency = Ember.Object.extend({
 });
 
 var HcfsDependency = Dependency.extend({
-  displayName: Ember.computed('service', function() {
-    return 'a Hadoop Compatible File System';
+  displayName: Ember.computed(function() {
+    return Em.I18n.t('installer.step4.hcfs.displayName');
   }),
 
   compatibleServices: function(services) {
@@ -58,17 +58,17 @@ Dependency.reopenClass({
 });
 
 var MissingDependency = Ember.Object.extend({
-  hasMultipleOptions: function() {
+  hasMultipleOptions: Ember.computed('compatibleServices', function() {
     return this.get('compatibleServices').length > 1;
-  },
+  }),
 
   selectFirstCompatible: function() {
     this.get('compatibleServices')[0].set('isSelected', true);
   },
 
-  displayOptions: function() {
+  displayOptions: Ember.computed('compatibleServices', function() {
     return this.get('compatibleServices').mapProperty('serviceName').join(', ');
-  }
+  })
 });
 
 /**
@@ -122,10 +122,14 @@ App.StackService = DS.Model.extend({
   dependentServiceNames: DS.attr('array', {defaultValue: []}),
 
   dependencies: function(availableServices) {
-    return this.get('requiredServices')
-      .map(function (serviceName) { return availableServices.findProperty('serviceName', serviceName)})
-      .filter(function (each) { return !!each })
-      .map(function (service) { return Dependency.fromService(service); });
+    var result = [];
+    this.get('requiredServices').forEach(function(serviceName) {
+      var service = availableServices.findProperty('serviceName', serviceName);
+      if (service) {
+        result.push(Dependency.fromService(service));
+      }
+    });
+    return result;
   },
 
   /**
@@ -144,7 +148,7 @@ App.StackService = DS.Model.extend({
   },
 
   _addMissingDependency: function(dependency, availableServices, missingDependencies) {
-    if(!missingDependencies.some(function(each) { return each.get('serviceName') == dependency.get('name'); })) {
+    if(!missingDependencies.someProperty('serviceName', dependency.get('name'))) {
       missingDependencies.push(MissingDependency.create({
          serviceName: dependency.get('name'),
          displayName: dependency.get('displayName'),


[23/50] [abbrv] ambari git commit: AMBARI-22426. Push down Logger instances (adoroszlai)

Posted by am...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/FlumeServiceCalculatedState.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/FlumeServiceCalculatedState.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/FlumeServiceCalculatedState.java
index ca4fe6e..0162928 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/FlumeServiceCalculatedState.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/FlumeServiceCalculatedState.java
@@ -27,6 +27,8 @@ import org.apache.ambari.server.controller.ServiceComponentHostRequest;
 import org.apache.ambari.server.controller.ServiceComponentHostResponse;
 import org.apache.ambari.server.state.Cluster;
 import org.apache.ambari.server.state.State;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Determines the service status for Flume.  Generically, this means that
@@ -40,6 +42,8 @@ import org.apache.ambari.server.state.State;
 public final class FlumeServiceCalculatedState extends DefaultServiceCalculatedState
   implements ServiceCalculatedState {
 
+  private static final Logger LOG = LoggerFactory.getLogger(FlumeServiceCalculatedState.class);
+
   @Override
   public State getState(String clusterName, String serviceName) {
     try {

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/HBaseServiceCalculatedState.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/HBaseServiceCalculatedState.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/HBaseServiceCalculatedState.java
index eac0dce..58d1687 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/HBaseServiceCalculatedState.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/HBaseServiceCalculatedState.java
@@ -32,6 +32,8 @@ import org.apache.ambari.server.state.ComponentInfo;
 import org.apache.ambari.server.state.Service;
 import org.apache.ambari.server.state.StackId;
 import org.apache.ambari.server.state.State;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Calculator of HBase service state.
@@ -40,6 +42,8 @@ import org.apache.ambari.server.state.State;
 public final class HBaseServiceCalculatedState extends DefaultServiceCalculatedState
   implements ServiceCalculatedState {
 
+  private static final Logger LOG = LoggerFactory.getLogger(HBaseServiceCalculatedState.class);
+
   @Override
   public State getState(String clusterName, String serviceName) {
     try {

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/HDFSServiceCalculatedState.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/HDFSServiceCalculatedState.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/HDFSServiceCalculatedState.java
index 7bbad2a..68cb4f1 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/HDFSServiceCalculatedState.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/HDFSServiceCalculatedState.java
@@ -32,6 +32,8 @@ import org.apache.ambari.server.state.ComponentInfo;
 import org.apache.ambari.server.state.Service;
 import org.apache.ambari.server.state.StackId;
 import org.apache.ambari.server.state.State;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Calculator of HDFS service state.
@@ -40,6 +42,8 @@ import org.apache.ambari.server.state.State;
 public final class HDFSServiceCalculatedState extends DefaultServiceCalculatedState
   implements ServiceCalculatedState {
 
+  private static final Logger LOG = LoggerFactory.getLogger(HDFSServiceCalculatedState.class);
+
   @Override
   public State getState(String clusterName, String serviceName) {
     try {

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/HiveServiceCalculatedState.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/HiveServiceCalculatedState.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/HiveServiceCalculatedState.java
index 77e44a5..353cf5f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/HiveServiceCalculatedState.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/HiveServiceCalculatedState.java
@@ -32,6 +32,8 @@ import org.apache.ambari.server.state.ComponentInfo;
 import org.apache.ambari.server.state.Service;
 import org.apache.ambari.server.state.StackId;
 import org.apache.ambari.server.state.State;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Calculator of HIVE service state.
@@ -40,6 +42,8 @@ import org.apache.ambari.server.state.State;
 public final class HiveServiceCalculatedState extends DefaultServiceCalculatedState
   implements ServiceCalculatedState {
 
+  private static final Logger LOG = LoggerFactory.getLogger(HiveServiceCalculatedState.class);
+
   @Override
   public State getState(String clusterName, String serviceName) {
     try {

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/OozieServiceCalculatedState.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/OozieServiceCalculatedState.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/OozieServiceCalculatedState.java
index 1803f70..6c55d0b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/OozieServiceCalculatedState.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/OozieServiceCalculatedState.java
@@ -32,6 +32,8 @@ import org.apache.ambari.server.state.ComponentInfo;
 import org.apache.ambari.server.state.Service;
 import org.apache.ambari.server.state.StackId;
 import org.apache.ambari.server.state.State;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Calculator of Oozie service state.
@@ -40,6 +42,8 @@ import org.apache.ambari.server.state.State;
 public final class OozieServiceCalculatedState extends DefaultServiceCalculatedState
   implements ServiceCalculatedState {
 
+  private static final Logger LOG = LoggerFactory.getLogger(DefaultServiceCalculatedState.class);
+
   @Override
   public State getState(String clusterName, String serviceName) {
     try {

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/YARNServiceCalculatedState.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/YARNServiceCalculatedState.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/YARNServiceCalculatedState.java
index 2f1619f..23f5f4c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/YARNServiceCalculatedState.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/YARNServiceCalculatedState.java
@@ -32,6 +32,8 @@ import org.apache.ambari.server.state.ComponentInfo;
 import org.apache.ambari.server.state.Service;
 import org.apache.ambari.server.state.StackId;
 import org.apache.ambari.server.state.State;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Calculator of YARN service state.
@@ -40,6 +42,8 @@ import org.apache.ambari.server.state.State;
 public final class YARNServiceCalculatedState extends DefaultServiceCalculatedState
   implements ServiceCalculatedState {
 
+  private static final Logger LOG = LoggerFactory.getLogger(YARNServiceCalculatedState.class);
+
   @Override
   public State getState(String clusterName, String serviceName) {
     try {

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapConnectionConfigService.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapConnectionConfigService.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapConnectionConfigService.java
index 9afcf51..82b527f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapConnectionConfigService.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapConnectionConfigService.java
@@ -35,7 +35,7 @@ import org.slf4j.LoggerFactory;
 @Singleton
 public class DefaultLdapConnectionConfigService implements LdapConnectionConfigService {
 
-  private static Logger LOG = LoggerFactory.getLogger(DefaultLdapConnectionConfigService.class);
+  private static final Logger LOG = LoggerFactory.getLogger(DefaultLdapConnectionConfigService.class);
 
   @Inject
   public DefaultLdapConnectionConfigService() {

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RemoteAmbariClusterEntity.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RemoteAmbariClusterEntity.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RemoteAmbariClusterEntity.java
index 4f10d6f..aad37d8 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RemoteAmbariClusterEntity.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RemoteAmbariClusterEntity.java
@@ -65,7 +65,7 @@ public class RemoteAmbariClusterEntity {
   /**
    * The logger.
    */
-  protected final static Logger LOG = LoggerFactory.getLogger(RemoteAmbariClusterEntity.class);
+  private static final Logger LOG = LoggerFactory.getLogger(RemoteAmbariClusterEntity.class);
 
   @Id
   @Column(name = "cluster_id", nullable = false)

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProvider.java
index b7ff297..b2cdb1d 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProvider.java
@@ -42,7 +42,7 @@ import com.google.inject.Inject;
  * Provides LDAP user authorization logic for Ambari Server
  */
 public class AmbariLdapAuthenticationProvider implements AuthenticationProvider {
-  Logger LOG = LoggerFactory.getLogger(AmbariLdapAuthenticationProvider.class);
+  static Logger LOG = LoggerFactory.getLogger(AmbariLdapAuthenticationProvider.class); // exposed and mutable for "test"
 
   Configuration configuration;
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/security/encryption/CredentialProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/security/encryption/CredentialProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/security/encryption/CredentialProvider.java
index 1f2f6db..ce0e843 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/security/encryption/CredentialProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/security/encryption/CredentialProvider.java
@@ -42,7 +42,7 @@ public class CredentialProvider {
       '2', '3', '4', '5', '6', '7', '8', '9'};
 
   private CredentialStore keystoreService;
-  static final Logger LOG = LoggerFactory.getLogger(CredentialProvider.class);
+  private static final Logger LOG = LoggerFactory.getLogger(CredentialProvider.class);
 
   public CredentialProvider(String masterKey, File masterKeyLocation,
                             boolean isMasterKeyPersisted, File masterKeyStoreLocation) throws AmbariException {

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KDCKerberosOperationHandler.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KDCKerberosOperationHandler.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KDCKerberosOperationHandler.java
index e5696cd..bf3ac22 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KDCKerberosOperationHandler.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KDCKerberosOperationHandler.java
@@ -42,7 +42,7 @@ import org.slf4j.LoggerFactory;
  * This implementation provides kinit functionality and keytab file caching utilities for classes.
  */
 abstract class KDCKerberosOperationHandler extends KerberosOperationHandler {
-  private static Logger LOG = LoggerFactory.getLogger(KDCKerberosOperationHandler.class);
+  private static final Logger LOG = LoggerFactory.getLogger(KDCKerberosOperationHandler.class);
 
   /**
    * The FQDN of the host where KDC administration server is

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/state/services/MetricsRetrievalService.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/services/MetricsRetrievalService.java b/ambari-server/src/main/java/org/apache/ambari/server/state/services/MetricsRetrievalService.java
index 510e706..7e5aad1 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/services/MetricsRetrievalService.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/services/MetricsRetrievalService.java
@@ -101,7 +101,7 @@ public class MetricsRetrievalService extends AbstractService {
   /**
    * Logger.
    */
-  protected final static Logger LOG = LoggerFactory.getLogger(MetricsRetrievalService.class);
+  private static final Logger LOG = LoggerFactory.getLogger(MetricsRetrievalService.class);
 
   /**
    * The timeout for exceptions which are caught and then cached to prevent log

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/state/stack/OsFamily.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/OsFamily.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/OsFamily.java
index c0483e8..b84de01 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/OsFamily.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/OsFamily.java
@@ -53,7 +53,7 @@ public class OsFamily {
     private final String OS_VERSION = "versions";
     private final String LOAD_CONFIG_MSG = "Could not load OS family definition from %s file";
     private final String FILE_NAME = "os_family.json";
-    private final Logger LOG = LoggerFactory.getLogger(OsFamily.class);
+    private static final Logger LOG = LoggerFactory.getLogger(OsFamily.class);
 
     private Map<String, JsonOsFamilyEntry> osMap = null;
     private JsonOsFamilyRoot jsonOsFamily = null;

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/topology/ClusterConfigurationRequest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/ClusterConfigurationRequest.java b/ambari-server/src/main/java/org/apache/ambari/server/topology/ClusterConfigurationRequest.java
index 7bd377f..740dd91 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/topology/ClusterConfigurationRequest.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/ClusterConfigurationRequest.java
@@ -51,7 +51,7 @@ import org.slf4j.LoggerFactory;
  */
 public class ClusterConfigurationRequest {
 
-  protected final static Logger LOG = LoggerFactory.getLogger(ClusterConfigurationRequest.class);
+  private static final Logger LOG = LoggerFactory.getLogger(ClusterConfigurationRequest.class);
 
   /**
    * a regular expression Pattern used to find "clusterHostInfo.(component_name)_host" placeholders in strings

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/topology/PersistedStateImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/PersistedStateImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/topology/PersistedStateImpl.java
index 12af131..63898ba 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/topology/PersistedStateImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/PersistedStateImpl.java
@@ -63,7 +63,7 @@ import com.google.inject.persist.Transactional;
 @Singleton
 public class PersistedStateImpl implements PersistedState {
 
-  protected final static Logger LOG = LoggerFactory.getLogger(PersistedState.class);
+  private static final Logger LOG = LoggerFactory.getLogger(PersistedState.class);
 
   @Inject
   private TopologyRequestDAO topologyRequestDAO;

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/utils/RetryHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/utils/RetryHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/utils/RetryHelper.java
index d732edf..14c276c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/utils/RetryHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/utils/RetryHelper.java
@@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory;
  * TODO injection as Guice singleon, static for now to avoid major modifications
  */
 public class RetryHelper {
-  protected final static Logger LOG = LoggerFactory.getLogger(RetryHelper.class);
+  private static final Logger LOG = LoggerFactory.getLogger(RetryHelper.class);
   private static Clusters s_clusters;
 
   private static ThreadLocal<Set<Cluster>> affectedClusters = new ThreadLocal<Set<Cluster>>(){

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/view/ViewDataMigrationUtility.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/view/ViewDataMigrationUtility.java b/ambari-server/src/main/java/org/apache/ambari/server/view/ViewDataMigrationUtility.java
index 55f85a7..9712ca4 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/view/ViewDataMigrationUtility.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/view/ViewDataMigrationUtility.java
@@ -37,7 +37,7 @@ public class ViewDataMigrationUtility {
   /**
    * The logger.
    */
-  protected final static Logger LOG = LoggerFactory.getLogger(ViewDataMigrationUtility.class);
+  private static final Logger LOG = LoggerFactory.getLogger(ViewDataMigrationUtility.class);
 
   /**
    * The View Registry.

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/view/ViewExtractor.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/view/ViewExtractor.java b/ambari-server/src/main/java/org/apache/ambari/server/view/ViewExtractor.java
index ad1cc52..d729942 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/view/ViewExtractor.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/view/ViewExtractor.java
@@ -52,7 +52,7 @@ public class ViewExtractor {
   /**
    * The logger.
    */
-  protected final static Logger LOG = LoggerFactory.getLogger(ViewExtractor.class);
+  private static final Logger LOG = LoggerFactory.getLogger(ViewExtractor.class);
 
 
   // ----- ViewExtractor -----------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java b/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java
index c50276e..f071262 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java
@@ -205,7 +205,7 @@ public class ViewRegistry {
   /**
    * The logger.
    */
-  protected final static Logger LOG = LoggerFactory.getLogger(ViewRegistry.class);
+  private static final Logger LOG = LoggerFactory.getLogger(ViewRegistry.class);
 
   /**
    * View Data Migration Utility

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/view/ViewSubResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/view/ViewSubResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/view/ViewSubResourceProvider.java
index 5cceb1e..5f6201a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/view/ViewSubResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/view/ViewSubResourceProvider.java
@@ -47,6 +47,8 @@ import org.apache.ambari.server.controller.utilities.PropertyHelper;
 import org.apache.ambari.server.orm.entities.ViewEntity;
 import org.apache.ambari.server.orm.entities.ViewInstanceEntity;
 import org.apache.ambari.view.ReadRequest;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * An SPI resource provider implementation used to adapt a
@@ -55,6 +57,8 @@ import org.apache.ambari.view.ReadRequest;
  */
 public class ViewSubResourceProvider extends AbstractResourceProvider {
 
+  private static final Logger LOG = LoggerFactory.getLogger(ViewSubResourceProvider.class);
+
   private static final String VIEW_NAME_PROPERTY_ID     = "view_name";
   private static final String VIEW_VERSION_PROPERTY_ID  = "version";
   private static final String INSTANCE_NAME_PROPERTY_ID = "instance_name";

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/view/persistence/DataStoreImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/view/persistence/DataStoreImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/view/persistence/DataStoreImpl.java
index 5d4c758..aa48315 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/view/persistence/DataStoreImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/view/persistence/DataStoreImpl.java
@@ -119,7 +119,7 @@ public class DataStoreImpl implements DataStore {
   /**
    * The logger.
    */
-  protected final static Logger LOG = LoggerFactory.getLogger(DataStoreImpl.class);
+  private static final Logger LOG = LoggerFactory.getLogger(DataStoreImpl.class);
 
   /**
    * Max length of entity string field.


[16/50] [abbrv] ambari git commit: AMBARI-22387. Create a Pre-Upgrade Check Warning About LZO. Fix import (dlysnichenko)

Posted by am...@apache.org.
AMBARI-22387. Create a Pre-Upgrade Check Warning About LZO. Fix import (dlysnichenko)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 6e706d427f1f9bcfc61f986ea1a1d5f5a28d500f
Parents: 76349ac
Author: Lisnichenko Dmitro <dl...@hortonworks.com>
Authored: Mon Nov 13 16:35:23 2017 +0200
Committer: Lisnichenko Dmitro <dl...@hortonworks.com>
Committed: Mon Nov 13 16:35:23 2017 +0200

----------------------------------------------------------------------
 .../src/main/java/org/apache/ambari/server/checks/LZOCheck.java     | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6e706d42/ambari-server/src/main/java/org/apache/ambari/server/checks/LZOCheck.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/LZOCheck.java b/ambari-server/src/main/java/org/apache/ambari/server/checks/LZOCheck.java
index 3000b79..9c0286b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/LZOCheck.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/LZOCheck.java
@@ -19,7 +19,6 @@ package org.apache.ambari.server.checks;
 
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Set;
 
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.controller.PrereqCheckRequest;


[47/50] [abbrv] ambari git commit: AMBARI-22339. Metrics for OneFS mpack (amagyar)

Posted by am...@apache.org.
AMBARI-22339. Metrics for OneFS mpack (amagyar)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 43840c594b03c9216ff983e0e11c407a9341f58f
Parents: 6f35493
Author: Attila Magyar <am...@hortonworks.com>
Authored: Mon Nov 6 10:48:44 2017 +0100
Committer: Attila Magyar <am...@hortonworks.com>
Committed: Wed Nov 22 10:55:11 2017 +0100

----------------------------------------------------------------------
 .../internal/OverriddenMetricsHostProvider.java | 101 +++++++++++++++++++
 .../internal/StackDefinedPropertyProvider.java  |   9 +-
 .../controller/metrics/MetricHostProvider.java  |   9 ++
 .../timeline/AMSComponentPropertyProvider.java  |   4 +-
 .../ambari/server/state/ConfigHelper.java       |   5 +
 .../server/state/stack/MetricDefinition.java    |   9 +-
 .../OverriddenMetricsHostProviderTest.java      |  95 +++++++++++++++++
 .../addon-services/ONEFS/1.0.0/metrics.json     |  13 ++-
 .../addon-services/ONEFS/1.0.0/widgets.json     |  65 +++---------
 9 files changed, 254 insertions(+), 56 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/43840c59/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/OverriddenMetricsHostProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/OverriddenMetricsHostProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/OverriddenMetricsHostProvider.java
new file mode 100644
index 0000000..cb59b2f
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/OverriddenMetricsHostProvider.java
@@ -0,0 +1,101 @@
+/*
+ * 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.net.URI;
+import java.util.Map;
+import java.util.Optional;
+
+import org.apache.ambari.server.AmbariException;
+import org.apache.ambari.server.controller.metrics.MetricHostProvider;
+import org.apache.ambari.server.controller.metrics.MetricsServiceProvider;
+import org.apache.ambari.server.controller.spi.SystemException;
+import org.apache.ambari.server.state.ConfigHelper;
+import org.apache.ambari.server.state.kerberos.VariableReplacementHelper;
+
+/**
+ * I'm a special {@link MetricHostProvider} that can override default component host names.
+ */
+public class OverriddenMetricsHostProvider implements MetricHostProvider {
+  private final Map<String, String> overriddenHosts;
+  private final MetricHostProvider metricHostProvider;
+  private final ConfigHelper configHelper;
+  private final VariableReplacementHelper variableReplacer = new VariableReplacementHelper();
+
+  public OverriddenMetricsHostProvider(Map<String, String> overriddenHosts, MetricHostProvider metricHostProvider, ConfigHelper configHelper) {
+    this.overriddenHosts = overriddenHosts;
+    this.metricHostProvider = metricHostProvider;
+    this.configHelper = configHelper;
+  }
+
+  @Override
+  public Optional<String> getExternalHostName(String clusterName, String componentName) {
+    return getOverriddenHost(componentName).map(host -> replaceVariables(clusterName, host));
+  }
+
+  private Optional<String> getOverriddenHost(String componentName) {
+    return Optional.ofNullable(overriddenHosts.get(componentName));
+  }
+
+  private String replaceVariables(String clusterName, String hostName) {
+    try {
+      return hostName(variableReplacer.replaceVariables(hostName, config(clusterName)));
+    } catch (AmbariException e) {
+      throw new RuntimeException(e);
+    }
+  }
+
+  private Map<String, Map<String, String>> config(String clusterName) throws AmbariException {
+    return configHelper.getEffectiveConfigProperties(clusterName, null);
+  }
+
+  private String hostName(String resolvedHost) throws AmbariException {
+    return hasScheme(resolvedHost)
+      ? URI.create(resolvedHost).getHost()
+      : URI.create("any://" + resolvedHost).getHost();
+  }
+
+  private boolean hasScheme(String host) {
+    return host.contains("://");
+  }
+
+  @Override
+  public String getHostName(String clusterName, String componentName) throws SystemException {
+    return metricHostProvider.getHostName(clusterName, componentName);
+  }
+
+  @Override
+  public String getCollectorHostName(String clusterName, MetricsServiceProvider.MetricsService service) throws SystemException {
+    return metricHostProvider.getCollectorHostName(clusterName, service);
+  }
+
+  @Override
+  public String getCollectorPort(String clusterName, MetricsServiceProvider.MetricsService service) throws SystemException {
+    return metricHostProvider.getCollectorPort(clusterName, service);
+  }
+
+  @Override
+  public boolean isCollectorHostLive(String clusterName, MetricsServiceProvider.MetricsService service) throws SystemException {
+    return metricHostProvider.isCollectorHostLive(clusterName, service);
+  }
+
+  @Override
+  public boolean isCollectorComponentLive(String clusterName, MetricsServiceProvider.MetricsService service) throws SystemException {
+    return metricHostProvider.isCollectorComponentLive(clusterName, service);
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/43840c59/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackDefinedPropertyProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackDefinedPropertyProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackDefinedPropertyProvider.java
index 8c2198b..861007b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackDefinedPropertyProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackDefinedPropertyProvider.java
@@ -47,6 +47,7 @@ import org.apache.ambari.server.controller.utilities.StreamProvider;
 import org.apache.ambari.server.security.authorization.AuthorizationException;
 import org.apache.ambari.server.state.Cluster;
 import org.apache.ambari.server.state.Clusters;
+import org.apache.ambari.server.state.ConfigHelper;
 import org.apache.ambari.server.state.Service;
 import org.apache.ambari.server.state.StackId;
 import org.apache.ambari.server.state.stack.Metric;
@@ -155,6 +156,7 @@ public class StackDefinedPropertyProvider implements PropertyProvider {
     Map<String, Map<String, PropertyInfo>> jmxMap = new HashMap<>();
 
     List<PropertyProvider> additional = new ArrayList<>();
+    Map<String, String> overriddenHosts = new HashMap<>();
 
     try {
       for (Resource r : resources) {
@@ -183,6 +185,7 @@ public class StackDefinedPropertyProvider implements PropertyProvider {
         for (MetricDefinition m : defs) {
           if (m.getType().equals("ganglia")) {
             gangliaMap.put(componentName, getPropertyInfo(m));
+            m.getOverriddenHosts().ifPresent(host -> overriddenHosts.put(componentName, host));
           } else if (m.getType().equals("jmx")) {
             jmxMap.put(componentName, getPropertyInfo(m));
           } else {
@@ -207,7 +210,7 @@ public class StackDefinedPropertyProvider implements PropertyProvider {
           MetricsPropertyProvider.createInstance(type, gangliaMap,
             streamProvider, sslConfig,
             cacheProvider,
-            metricHostProvider,
+            metricHostProvider(overriddenHosts),
             metricsServiceProvider, clusterNamePropertyId,
             hostNamePropertyId, componentNamePropertyId);
 
@@ -244,6 +247,10 @@ public class StackDefinedPropertyProvider implements PropertyProvider {
     return resources;
   }
 
+  private MetricHostProvider metricHostProvider(Map<String, String> overriddenHosts) {
+    return new OverriddenMetricsHostProvider(overriddenHosts, metricHostProvider, injector.getInstance(ConfigHelper.class));
+  }
+
   @Override
   public Set<String> checkPropertyIds(Set<String> propertyIds) {
     return Collections.emptySet();

http://git-wip-us.apache.org/repos/asf/ambari/blob/43840c59/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricHostProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricHostProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricHostProvider.java
index 28e5381..86d7114 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricHostProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricHostProvider.java
@@ -19,6 +19,8 @@ package org.apache.ambari.server.controller.metrics;
 
 import static org.apache.ambari.server.controller.metrics.MetricsServiceProvider.MetricsService;
 
+import java.util.Optional;
+
 import org.apache.ambari.server.controller.spi.SystemException;
 
 public interface MetricHostProvider {
@@ -76,4 +78,11 @@ public interface MetricHostProvider {
    * @throws SystemException if unable to get the status of metrics server component
    */
   boolean isCollectorComponentLive(String clusterName, MetricsService service) throws SystemException;
+
+  /**
+   * If a component is installed to a host that is managed outside of Ambari (for example OneFS) then this method will return the external hostname.
+   */
+  default Optional<String> getExternalHostName(String clusterName, String componentName) {
+    return Optional.empty();
+  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/43840c59/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSComponentPropertyProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSComponentPropertyProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSComponentPropertyProvider.java
index 487afde..efc0f4f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSComponentPropertyProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSComponentPropertyProvider.java
@@ -42,7 +42,9 @@ public class AMSComponentPropertyProvider extends AMSPropertyProvider {
 
   @Override
   protected String getHostName(Resource resource) {
-    return null;
+      return hostProvider
+        .getExternalHostName((String) resource.getPropertyValue(clusterNamePropertyId), (String) resource.getPropertyValue(componentNamePropertyId))
+        .orElse(null);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/ambari/blob/43840c59/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
index edeb4b7..341f651 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
@@ -298,6 +298,11 @@ public class ConfigHelper {
     return properties;
   }
 
+  public Map<String, Map<String, String>> getEffectiveConfigProperties(String clusterName, String hostName) throws AmbariException {
+    Cluster cluster = clusters.getCluster(clusterName);
+    return getEffectiveConfigProperties(cluster, getEffectiveDesiredTags(cluster, hostName));
+  }
+
   /**
    * Get all config attributes for a cluster given a set of configType to
    * versionTags map. This helper method merges all the override tags with a

http://git-wip-us.apache.org/repos/asf/ambari/blob/43840c59/ambari-server/src/main/java/org/apache/ambari/server/state/stack/MetricDefinition.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/MetricDefinition.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/MetricDefinition.java
index 635ae35..033b18b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/MetricDefinition.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/MetricDefinition.java
@@ -22,6 +22,7 @@ import static java.util.Map.Entry;
 
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Optional;
 
 import org.codehaus.jackson.annotate.JsonIgnore;
 import org.codehaus.jackson.annotate.JsonProperty;
@@ -30,6 +31,7 @@ import org.codehaus.jackson.annotate.JsonProperty;
  * Used to represent metrics for a stack component.
  */
 public class MetricDefinition {
+  private static final String OVERRIDDEN_HOST_PROP = "overridden_host";
   private String type = null;
   private Map<String, String> properties = null;
   private Map<String, Map<String, Metric>> metrics = null;
@@ -74,5 +76,10 @@ public class MetricDefinition {
     
     return sb.toString();
   }
-  
+
+  public Optional<String> getOverriddenHosts() {
+    return properties == null
+      ? Optional.empty()
+      : Optional.ofNullable(properties.get(OVERRIDDEN_HOST_PROP));
+  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/43840c59/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/OverriddenMetricsHostProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/OverriddenMetricsHostProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/OverriddenMetricsHostProviderTest.java
new file mode 100644
index 0000000..cf4b131
--- /dev/null
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/OverriddenMetricsHostProviderTest.java
@@ -0,0 +1,95 @@
+/*
+ * 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 static edu.emory.mathcs.backport.java.util.Collections.emptyMap;
+import static org.easymock.EasyMock.expect;
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+
+import org.apache.ambari.server.controller.metrics.MetricHostProvider;
+import org.apache.ambari.server.state.ConfigHelper;
+import org.easymock.EasyMockRule;
+import org.easymock.EasyMockSupport;
+import org.easymock.Mock;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+public class OverriddenMetricsHostProviderTest extends EasyMockSupport {
+  private static final String COMPONENT_WITH_OVERRIDDEN_HOST = "component1";
+  private static final String CLUSTER_1 = "cluster1";
+  private static final String COMPONENT_WITHOUT_OVERRIDDEN_HOST = "componentWithoutOverriddenHost";
+  private static final String OVERRIDEN_HOST = "overridenHost1";
+  private static final String COMPONENT_WITH_OVERRIDDEN_HOST_PLACEHOLDER = "${hdfs-site/dfs.namenode.http-address}";
+  private static final String RESOLVED_HOST = "resolved.fqdn";
+  @Rule
+  public EasyMockRule mocks = new EasyMockRule(this);
+  @Mock
+  private MetricHostProvider defaultHostProvider;
+  @Mock
+  private ConfigHelper configHelper;
+  private MetricHostProvider hostProvider;
+
+  @Before
+  public void setUp() throws Exception {
+    hostProvider = new OverriddenMetricsHostProvider(overrideHosts(), defaultHostProvider, configHelper);
+  }
+
+  @Test
+  public void testReturnsDefaultWhenNotOverridden() throws Exception {
+    replayAll();
+    assertThat(hostProvider.getExternalHostName(CLUSTER_1, COMPONENT_WITHOUT_OVERRIDDEN_HOST), is(Optional.empty()));
+    verifyAll();
+  }
+
+  @Test
+  public void testReturnOverriddenHostIfPresent() throws Exception {
+    expect(configHelper.getEffectiveConfigProperties(CLUSTER_1, null)).andReturn(emptyMap()).anyTimes();
+    replayAll();
+    assertThat(hostProvider.getExternalHostName(CLUSTER_1, COMPONENT_WITH_OVERRIDDEN_HOST), is(Optional.of(OVERRIDEN_HOST)));
+    verifyAll();
+  }
+
+  @Test
+  public void testReplacesPlaceholderInOverriddenHost() throws Exception {
+    expect(configHelper.getEffectiveConfigProperties(CLUSTER_1, null)).andReturn(config()).anyTimes();
+    replayAll();
+    assertThat(hostProvider.getExternalHostName(CLUSTER_1, COMPONENT_WITH_OVERRIDDEN_HOST_PLACEHOLDER), is(Optional.of(RESOLVED_HOST)));
+    verifyAll();
+  }
+
+  private Map<String, String> overrideHosts() {
+    return new HashMap<String, String>() {{
+      put(COMPONENT_WITH_OVERRIDDEN_HOST, OVERRIDEN_HOST);
+      put(COMPONENT_WITH_OVERRIDDEN_HOST_PLACEHOLDER, "${hdfs-site/dfs.namenode.http-address}");
+    }};
+  }
+
+  private Map<String, Map<String, String>> config() {
+    return new HashMap<String, Map<String, String>>() {{
+      put("hdfs-site", new HashMap<String, String>() {{
+        put("dfs.namenode.http-address", "http://" + RESOLVED_HOST + ":8080");
+      }});
+    }};
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/43840c59/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metrics.json
----------------------------------------------------------------------
diff --git a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metrics.json b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metrics.json
index 335bfba..30a9f5c 100644
--- a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metrics.json
+++ b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metrics.json
@@ -3,6 +3,9 @@
     "Component" : [
       {
         "type" : "ganglia",
+        "properties" : {
+          "overridden_host" : "${core-site/fs.defaultFS}"
+        },
         "metrics" : {
           "default" : {
             "metrics/load/load_five" : {
@@ -11,6 +14,12 @@
               "metric" : "load_five",
               "amsHostMetric" : true
             },
+            "metrics/cpu/cpu_num": {
+              "metric": "cpu_num",
+              "pointInTime": true,
+              "temporal": true,
+              "amsHostMetric" : true
+            },
             "metrics/jvm/JvmMetrics/GcCountConcurrentMarkSweep" : {
               "temporal" : true,
               "pointInTime" : true,
@@ -77,7 +86,7 @@
             },
             "metrics/jvm/memHeapUsedM" : {
               "temporal" : true,
-              "pointInTime" : false,
+              "pointInTime" : true,
               "metric" : "jvm.JvmMetrics.MemHeapUsedM",
               "unit" : "MB"
             },
@@ -169,7 +178,7 @@
             },
             "metrics/jvm/memHeapCommittedM" : {
               "temporal" : true,
-              "pointInTime" : false,
+              "pointInTime" : true,
               "metric" : "jvm.JvmMetrics.MemHeapCommittedM"
             },
             "metrics/disk/disk_total" : {

http://git-wip-us.apache.org/repos/asf/ambari/blob/43840c59/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/widgets.json
----------------------------------------------------------------------
diff --git a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/widgets.json b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/widgets.json
index dbde93b..fe2c52e 100644
--- a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/widgets.json
+++ b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/widgets.json
@@ -15,15 +15,13 @@
               "name": "jvm.JvmMetrics.GcCount._rate",
               "metric_path": "metrics/jvm/gcCount._rate",
               "service_name": "ONEFS",
-              "component_name": "ONEFS_CLIENT",
-              "host_component_criteria": "host_components/metrics/dfs/FSNamesystem/HAState=active"
+              "component_name": "ONEFS_CLIENT"
             },
             {
               "name": "jvm.JvmMetrics.GcCountConcurrentMarkSweep._rate",
               "metric_path": "metrics/jvm/GcCountConcurrentMarkSweep._rate",
               "service_name": "ONEFS",
-              "component_name": "ONEFS_CLIENT",
-              "host_component_criteria": "host_components/metrics/dfs/FSNamesystem/HAState=active"
+              "component_name": "ONEFS_CLIENT"
             }
           ],
           "values": [
@@ -49,10 +47,9 @@
           "metrics": [
             {
               "name": "jvm.JvmMetrics.GcTimeMillisConcurrentMarkSweep._rate",
-              "metric_path": "metrics/jvm/GcTimeMillisConcurrentMarkSweep._rate",
+              "metric_path": "metrics/jvm/JvmMetrics/GcTimeMillisConcurrentMarkSweep._rate",
               "service_name": "ONEFS",
-              "component_name": "ONEFS_CLIENT",
-              "host_component_criteria": "host_components/metrics/dfs/FSNamesystem/HAState=active"
+              "component_name": "ONEFS_CLIENT"
             }
           ],
           "values": [
@@ -77,15 +74,13 @@
               "name": "jvm.JvmMetrics.MemHeapCommittedM",
               "metric_path": "metrics/jvm/memHeapCommittedM",
               "service_name": "ONEFS",
-              "component_name": "ONEFS_CLIENT",
-              "host_component_criteria": "host_components/metrics/dfs/FSNamesystem/HAState=active"
+              "component_name": "ONEFS_CLIENT"
             },
             {
               "name": "jvm.JvmMetrics.MemHeapUsedM",
               "metric_path": "metrics/jvm/memHeapUsedM",
               "service_name": "ONEFS",
-              "component_name": "ONEFS_CLIENT",
-              "host_component_criteria": "host_components/metrics/dfs/FSNamesystem/HAState=active"
+              "component_name": "ONEFS_CLIENT"
             }
           ],
           "values": [
@@ -114,50 +109,43 @@
               "name": "cpu_system",
               "metric_path": "metrics/cpu/cpu_system",
               "service_name": "ONEFS",
-              "component_name": "ONEFS_CLIENT",
-              "host_component_criteria": "host_components/metrics/dfs/FSNamesystem/HAState=active"
+              "component_name": "ONEFS_CLIENT"
             },
             {
               "name": "cpu_user",
               "metric_path": "metrics/cpu/cpu_user",
               "service_name": "ONEFS",
-              "component_name": "ONEFS_CLIENT",
-              "host_component_criteria": "host_components/metrics/dfs/FSNamesystem/HAState=active"
+              "component_name": "ONEFS_CLIENT"
             },
             {
               "name": "cpu_nice",
               "metric_path": "metrics/cpu/cpu_nice",
               "service_name": "ONEFS",
-              "component_name": "ONEFS_CLIENT",
-              "host_component_criteria": "host_components/metrics/dfs/FSNamesystem/HAState=active"
+              "component_name": "ONEFS_CLIENT"
             },
             {
               "name": "cpu_idle",
               "metric_path": "metrics/cpu/cpu_idle",
               "service_name": "ONEFS",
-              "component_name": "ONEFS_CLIENT",
-              "host_component_criteria": "host_components/metrics/dfs/FSNamesystem/HAState=active"
+              "component_name": "ONEFS_CLIENT"
             },
             {
               "name": "cpu_wio",
               "metric_path": "metrics/cpu/cpu_wio",
               "service_name": "ONEFS",
-              "component_name": "ONEFS_CLIENT",
-              "host_component_criteria": "host_components/metrics/dfs/FSNamesystem/HAState=active"
+              "component_name": "ONEFS_CLIENT"
             },
             {
               "name": "mem_total",
               "metric_path": "metrics/memory/mem_total",
               "service_name": "ONEFS",
-              "component_name": "ONEFS_CLIENT",
-              "host_component_criteria": "host_components/metrics/dfs/FSNamesystem/HAState=active"
+              "component_name": "ONEFS_CLIENT"
             },
             {
               "name": "mem_free",
               "metric_path": "metrics/memory/mem_free",
               "service_name": "ONEFS",
-              "component_name": "ONEFS_CLIENT",
-              "host_component_criteria": "host_components/metrics/dfs/FSNamesystem/HAState=active"
+              "component_name": "ONEFS_CLIENT"
             }
           ],
           "values": [
@@ -175,33 +163,8 @@
             "time_range": "1",
             "display_unit": "%"
           }
-        },
-        {
-          "widget_name": "Under Replicated Blocks",
-          "description": "Number represents file blocks that does not meet the replication factor criteria. Its indicative of ONEFS bad health.",
-          "widget_type": "NUMBER",
-          "is_visible": true,
-          "metrics": [
-            {
-              "name": "Hadoop:service=NameNode,name=FSNamesystem.UnderReplicatedBlocks",
-              "metric_path": "metrics/dfs/FSNamesystem/UnderReplicatedBlocks",
-              "service_name": "ONEFS",
-              "component_name": "ONEFS_CLIENT",
-              "host_component_criteria": "host_components/metrics/dfs/FSNamesystem/HAState=active"
-            }
-          ],
-          "values": [
-            {
-              "name": "Under Replicated Blocks",
-              "value": "${Hadoop:service=NameNode,name=FSNamesystem.UnderReplicatedBlocks}"
-            }
-          ],
-          "properties": {
-            "warning_threshold": "0",
-            "error_threshold": "50"
-          }
         }
       ]
     }
   ]
-}
+}
\ No newline at end of file


[34/50] [abbrv] ambari git commit: AMBARI-22418. Make Ambari configuration API consistent with existing API. (rlevas)

Posted by am...@apache.org.
AMBARI-22418.  Make Ambari 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/3f2743b5
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3f2743b5
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3f2743b5

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 3f2743b58ba65c4bdc7d37df5348d17124bf305a
Parents: 2d81d49
Author: Robert Levas <rl...@hortonworks.com>
Authored: Wed Nov 15 12:11:34 2017 -0500
Committer: Robert Levas <rl...@hortonworks.com>
Committed: Wed Nov 15 12:11:34 2017 -0500

----------------------------------------------------------------------
 .../resources/ResourceInstanceFactoryImpl.java  |   9 +-
 .../RootServiceComponentResourceDefinition.java |   9 +-
 .../AmbariConfigurationRequestSwagger.java      |  37 --
 .../AmbariConfigurationResponseSwagger.java     |  40 --
 .../services/AmbariConfigurationService.java    | 193 --------
 .../server/api/services/AmbariMetaInfo.java     |   4 +-
 ...iceComponentConfigurationRequestSwagger.java |  43 ++
 ...ceComponentConfigurationResponseSwagger.java |  43 ++
 ...ootServiceComponentConfigurationService.java | 226 +++++++++
 .../server/api/services/RootServiceService.java |   7 +
 .../api/services/ldap/AmbariConfiguration.java  |   6 +-
 .../services/ldap/LdapConfigurationRequest.java |   2 +-
 .../services/ldap/LdapConfigurationService.java |   6 +-
 .../commands/StackAdvisorCommand.java           |  62 ++-
 .../server/controller/ControllerModule.java     |   4 +-
 .../controller/MaintenanceStateHelper.java      |   3 +-
 .../controller/ResourceProviderFactory.java     |   4 +-
 .../ambari/server/controller/RootComponent.java |  27 ++
 .../ambari/server/controller/RootService.java   |  36 ++
 .../controller/RootServiceResponseFactory.java  |  44 +-
 .../AbstractControllerResourceProvider.java     |   4 +-
 .../AmbariConfigurationResourceProvider.java    | 302 ------------
 ...eComponentConfigurationResourceProvider.java | 476 +++++++++++++++++++
 .../RootServiceComponentPropertyProvider.java   |   4 +-
 .../RootServiceComponentResourceProvider.java   |   4 +-
 .../ambari/server/controller/spi/Resource.java  |   6 +-
 .../listeners/alerts/AlertReceivedListener.java |  10 +-
 .../alerts/AlertStateChangedListener.java       |   6 +-
 .../ldap/domain/AmbariLdapConfiguration.java    |   6 +-
 .../domain/AmbariLdapConfigurationFactory.java  |   2 +-
 .../AmbariLdapConfigurationProvider.java        |   6 +-
 .../metadata/AmbariServiceAlertDefinitions.java |  20 +-
 .../server/orm/dao/AlertDefinitionDAO.java      |   7 +-
 .../ambari/server/orm/dao/AlertDispatchDAO.java |   4 +-
 .../server/state/alert/AlertDefinitionHash.java |   8 +-
 .../server/state/cluster/ClusterImpl.java       |   4 +-
 .../services/AmbariServerAlertService.java      |   4 +-
 .../commands/StackAdvisorCommandTest.java       |   8 +-
 .../AmbariManagementControllerTest.java         |  16 +-
 .../RootServiceResponseFactoryTest.java         |  27 +-
 ...AmbariConfigurationResourceProviderTest.java | 377 ---------------
 ...ponentConfigurationResourceProviderTest.java | 393 +++++++++++++++
 ...ootServiceComponentPropertyProviderTest.java |  15 +-
 ...ootServiceComponentResourceProviderTest.java |   9 +-
 .../server/ldap/LdapModuleFunctionalTest.java   |   4 +-
 .../TestAmbariLdapConfigurationFactory.java     |   2 +-
 .../ldap/service/AmbariLdapFacadeTest.java      |   4 +-
 ...efaultLdapAttributeDetectionServiceTest.java |   8 +-
 .../DefaultLdapConfigurationServiceTest.java    |  12 +-
 .../metadata/AgentAlertDefinitionsTest.java     |   6 +-
 .../server/orm/dao/AlertDefinitionDAOTest.java  |   7 +-
 .../state/alerts/AlertReceivedListenerTest.java |  16 +-
 .../alerts/AlertStateChangedEventTest.java      |   4 +-
 53 files changed, 1444 insertions(+), 1142 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/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 f5fb6e9..fecaedc 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
@@ -237,6 +237,11 @@ public class ResourceInstanceFactoryImpl implements ResourceInstanceFactory {
         resourceDefinition = new RootServiceComponentResourceDefinition();
         break;
 
+      case RootServiceComponentConfiguration:
+        resourceDefinition = new SimpleResourceDefinition(Resource.Type.RootServiceComponentConfiguration,
+            "configuration", "configurations");
+        break;
+
       case RootServiceHostComponent:
         resourceDefinition = new RootServiceHostComponentResourceDefinition();
         break;
@@ -471,10 +476,6 @@ public class ResourceInstanceFactoryImpl implements ResourceInstanceFactory {
       case RemoteCluster:
         resourceDefinition = new RemoteClusterResourceDefinition();
         break;
-      case AmbariConfiguration:
-        resourceDefinition = new SimpleResourceDefinition(Resource.Type.AmbariConfiguration, "ambariconfiguration", "ambariconfigurations");
-
-        break;
 
       default:
         throw new IllegalArgumentException("Unsupported resource type: " + type);

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/main/java/org/apache/ambari/server/api/resources/RootServiceComponentResourceDefinition.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/RootServiceComponentResourceDefinition.java b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/RootServiceComponentResourceDefinition.java
index e8cb570..1c036e4 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/RootServiceComponentResourceDefinition.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/RootServiceComponentResourceDefinition.java
@@ -19,6 +19,7 @@
 package org.apache.ambari.server.api.resources;
 
 import java.util.Collections;
+import java.util.HashSet;
 import java.util.Set;
 
 import org.apache.ambari.server.controller.spi.Resource;
@@ -44,10 +45,12 @@ public class RootServiceComponentResourceDefinition extends
   public String getSingularName() {
     return "component";
   }
-  
+
   @Override
   public Set<SubResourceDefinition> getSubResourceDefinitions() {
-    return Collections.singleton(new SubResourceDefinition(
-        Resource.Type.RootServiceHostComponent, Collections.singleton(Resource.Type.Host), true));
+    Set<SubResourceDefinition> definitions = new HashSet<>();
+    definitions.add(new SubResourceDefinition(Resource.Type.RootServiceHostComponent, Collections.singleton(Resource.Type.Host), true));
+    definitions.add(new SubResourceDefinition(Resource.Type.RootServiceComponentConfiguration));
+    return definitions;
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationRequestSwagger.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationRequestSwagger.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationRequestSwagger.java
deleted file mode 100644
index 2dca9f5..0000000
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationRequestSwagger.java
+++ /dev/null
@@ -1,37 +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;
-
-import java.util.Map;
-
-import org.apache.ambari.server.controller.ApiModel;
-
-import io.swagger.annotations.ApiModelProperty;
-
-/**
- * Request data model for {@link org.apache.ambari.server.api.services.AmbariConfigurationService}
- */
-public interface AmbariConfigurationRequestSwagger extends ApiModel {
-
-  @ApiModelProperty(name = "AmbariConfiguration")
-  AmbariConfigurationRequestInfo getAmbariConfiguration();
-
-  interface AmbariConfigurationRequestInfo {
-    @ApiModelProperty
-    String getCategoryName();
-
-    @ApiModelProperty
-    Map<String, Object> getProperties();
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationResponseSwagger.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationResponseSwagger.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationResponseSwagger.java
deleted file mode 100644
index c55ac1d..0000000
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationResponseSwagger.java
+++ /dev/null
@@ -1,40 +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;
-
-import java.util.Map;
-
-import org.apache.ambari.server.controller.ApiModel;
-
-import io.swagger.annotations.ApiModelProperty;
-
-/**
- * Response data model for {@link org.apache.ambari.server.api.services.AmbariConfigurationService}
- */
-public interface AmbariConfigurationResponseSwagger extends ApiModel {
-
-  @ApiModelProperty(name = "AmbariConfiguration")
-  AmbariConfigurationResponseInfo getAmbariConfigurationResponse();
-
-  interface AmbariConfigurationResponseInfo {
-    @ApiModelProperty
-    Long getId();
-
-    @ApiModelProperty
-    Map<String, Object> getData();
-
-    @ApiModelProperty
-    String getType();
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java
deleted file mode 100644
index 86ed666..0000000
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java
+++ /dev/null
@@ -1,193 +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;
-
-import java.util.Collections;
-
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriInfo;
-
-import org.apache.ambari.server.controller.spi.Resource;
-import org.apache.http.HttpStatus;
-
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-
-/**
- * Rest endpoint for managing ambari configurations. Supports CRUD operations.
- * Ambari configurations are resources that relate to the ambari server instance even before a cluster is provisioned.
- *
- * Ambari configuration resources may be shared with components and services in the cluster
- * (by recommending them as default values)
- *
- * Eg. LDAP configuration is stored as AmbariConfiguration.
- * The request payload has the form:
- *
- * <pre>
- *      {
- *        "AmbariConfiguration": {
- *          "category": "ldap-configuration",
- *          "properties": {
- *             "authentication.ldap.primaryUrl": "localhost:33389"
- *             "authentication.ldap.secondaryUrl": "localhost:333"
- *             "authentication.ldap.baseDn": "dc=ambari,dc=apache,dc=org"
- *             // ......
- *          }
- *        }
- *      }
- * </pre>
- */
-@Path("/ambariconfigs/")
-@Api(value = "Ambari Configurations", description = "Endpoint for Ambari configuration related operations")
-public class AmbariConfigurationService extends BaseService {
-
-  private static final String AMBARI_CONFIGURATION_REQUEST_TYPE =
-    "org.apache.ambari.server.api.services.AmbariConfigurationRequestSwagger";
-
-  /**
-   * Creates an ambari configuration resource.
-   *
-   * @param body    the payload in json format
-   * @param headers http headers
-   * @param uri     request uri information
-   * @return
-   */
-  @POST
-  @Produces(MediaType.TEXT_PLAIN)
-  @ApiOperation(value = "Creates an ambari configuration resource",
-    nickname = "AmbariConfigurationService#createAmbariConfiguration")
-  @ApiImplicitParams({
-    @ApiImplicitParam(dataType = AMBARI_CONFIGURATION_REQUEST_TYPE, paramType = PARAM_TYPE_BODY)
-  })
-  @ApiResponses({
-    @ApiResponse(code = HttpStatus.SC_CREATED, message = MSG_SUCCESSFUL_OPERATION),
-    @ApiResponse(code = HttpStatus.SC_ACCEPTED, message = MSG_REQUEST_ACCEPTED),
-    @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = MSG_INVALID_ARGUMENTS),
-    @ApiResponse(code = HttpStatus.SC_CONFLICT, message = MSG_RESOURCE_ALREADY_EXISTS),
-    @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = MSG_NOT_AUTHENTICATED),
-    @ApiResponse(code = HttpStatus.SC_FORBIDDEN, message = MSG_PERMISSION_DENIED),
-    @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = MSG_SERVER_ERROR),
-  })
-  public Response createAmbariConfiguration(String body, @Context HttpHeaders headers, @Context UriInfo uri) {
-    return handleRequest(headers, body, uri, Request.Type.POST, createResource(Resource.Type.AmbariConfiguration,
-      Collections.emptyMap()));
-  }
-
-  @GET
-  @Produces(MediaType.TEXT_PLAIN)
-  @ApiOperation(value = "Retrieve all ambari configuration resources",
-    nickname = "AmbariConfigurationService#getAmbariConfigurations",
-    notes = "Returns all Ambari configurations.",
-    response = AmbariConfigurationResponseSwagger.class,
-    responseContainer = RESPONSE_CONTAINER_LIST)
-  @ApiImplicitParams({
-    @ApiImplicitParam(name = QUERY_FIELDS, value = QUERY_FILTER_DESCRIPTION,
-      defaultValue = "AmbariConfiguration/properties, AmbariConfiguration/category",
-      dataType = DATA_TYPE_STRING, paramType = PARAM_TYPE_QUERY),
-    @ApiImplicitParam(name = QUERY_SORT, value = QUERY_SORT_DESCRIPTION,
-      defaultValue = "AmbariConfiguration/category",
-      dataType = DATA_TYPE_STRING, paramType = PARAM_TYPE_QUERY),
-    @ApiImplicitParam(name = QUERY_PAGE_SIZE, value = QUERY_PAGE_SIZE_DESCRIPTION, defaultValue = DEFAULT_PAGE_SIZE, dataType = DATA_TYPE_INT, paramType = PARAM_TYPE_QUERY),
-    @ApiImplicitParam(name = QUERY_FROM, value = QUERY_FROM_DESCRIPTION, defaultValue = DEFAULT_FROM, dataType = DATA_TYPE_STRING, paramType = PARAM_TYPE_QUERY),
-    @ApiImplicitParam(name = QUERY_TO, value = QUERY_TO_DESCRIPTION, dataType = DATA_TYPE_STRING, paramType = PARAM_TYPE_QUERY)
-  })
-  @ApiResponses(value = {
-    @ApiResponse(code = HttpStatus.SC_OK, message = MSG_SUCCESSFUL_OPERATION),
-    @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = MSG_SERVER_ERROR)
-  })
-  public Response getAmbariConfigurations(String body, @Context HttpHeaders headers, @Context UriInfo uri) {
-    return handleRequest(headers, body, uri, Request.Type.GET, createResource(Resource.Type.AmbariConfiguration,
-      Collections.emptyMap()));
-  }
-
-  @GET
-  @Path("{category}")
-  @Produces(MediaType.TEXT_PLAIN)
-  @ApiOperation(value = "Retrieve the details of an ambari configuration resource",
-    nickname = "AmbariConfigurationService#getAmbariConfiguration",
-    response = AmbariConfigurationResponseSwagger.class)
-  @ApiImplicitParams({
-    @ApiImplicitParam(name = QUERY_FIELDS, value = QUERY_FILTER_DESCRIPTION, defaultValue = "AmbariConfiguration/*",
-      dataType = DATA_TYPE_STRING, paramType = PARAM_TYPE_QUERY)
-  })
-  @ApiResponses(value = {
-    @ApiResponse(code = HttpStatus.SC_OK, message = MSG_SUCCESSFUL_OPERATION),
-    @ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = MSG_RESOURCE_NOT_FOUND),
-    @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = MSG_SERVER_ERROR)
-  })
-  public Response getAmbariConfiguration(String body, @Context HttpHeaders headers, @Context UriInfo uri,
-                                         @PathParam("category") String category) {
-    return handleRequest(headers, body, uri, Request.Type.GET, createResource(Resource.Type.AmbariConfiguration,
-      Collections.singletonMap(Resource.Type.AmbariConfiguration, category)));
-  }
-
-  @PUT
-  @Path("{category}")
-  @Produces(MediaType.TEXT_PLAIN)
-  @ApiOperation(value = "Updates ambari configuration resources ",
-    nickname = "AmbariConfigurationService#updateAmbariConfiguration")
-  @ApiImplicitParams({
-    @ApiImplicitParam(dataType = AMBARI_CONFIGURATION_REQUEST_TYPE, paramType = PARAM_TYPE_BODY),
-    @ApiImplicitParam(name = QUERY_FIELDS, value = QUERY_FILTER_DESCRIPTION, defaultValue = "AmbariConfiguration/*",
-      dataType = DATA_TYPE_STRING, paramType = PARAM_TYPE_QUERY)
-  })
-  @ApiResponses({
-    @ApiResponse(code = HttpStatus.SC_OK, message = MSG_SUCCESSFUL_OPERATION),
-    @ApiResponse(code = HttpStatus.SC_ACCEPTED, message = MSG_REQUEST_ACCEPTED),
-    @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = MSG_INVALID_ARGUMENTS),
-    @ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = MSG_RESOURCE_NOT_FOUND),
-    @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = MSG_NOT_AUTHENTICATED),
-    @ApiResponse(code = HttpStatus.SC_FORBIDDEN, message = MSG_PERMISSION_DENIED),
-    @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = MSG_SERVER_ERROR),
-  })
-  public Response updateAmbariConfiguration(String body, @Context HttpHeaders headers, @Context UriInfo uri,
-                                            @PathParam("category") String category) {
-    return handleRequest(headers, body, uri, Request.Type.PUT, createResource(Resource.Type.AmbariConfiguration,
-      Collections.singletonMap(Resource.Type.AmbariConfiguration, category)));
-  }
-
-  @DELETE
-  @Path("{category}")
-  @Produces(MediaType.TEXT_PLAIN)
-  @ApiOperation(value = "Deletes an ambari configuration resource",
-    nickname = "AmbariConfigurationService#deleteAmbariConfiguration")
-  @ApiResponses({
-    @ApiResponse(code = HttpStatus.SC_OK, message = MSG_SUCCESSFUL_OPERATION),
-    @ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = MSG_RESOURCE_NOT_FOUND),
-    @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = MSG_NOT_AUTHENTICATED),
-    @ApiResponse(code = HttpStatus.SC_FORBIDDEN, message = MSG_PERMISSION_DENIED),
-    @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = MSG_SERVER_ERROR),
-  })
-  public Response deleteAmbariConfiguration(String body, @Context HttpHeaders headers, @Context UriInfo uri,
-                                            @PathParam("category") String category) {
-    return handleRequest(headers, body, uri, Request.Type.DELETE, createResource(Resource.Type.AmbariConfiguration,
-      Collections.singletonMap(Resource.Type.AmbariConfiguration, category)));
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
index 46ee65a..b1eba8f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
@@ -43,7 +43,7 @@ import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.ParentObjectNotFoundException;
 import org.apache.ambari.server.StackAccessException;
 import org.apache.ambari.server.configuration.Configuration;
-import org.apache.ambari.server.controller.RootServiceResponseFactory.Services;
+import org.apache.ambari.server.controller.RootService;
 import org.apache.ambari.server.controller.utilities.PropertyHelper;
 import org.apache.ambari.server.customactions.ActionDefinition;
 import org.apache.ambari.server.customactions.ActionDefinitionManager;
@@ -1179,7 +1179,7 @@ public class AmbariMetaInfo {
         String componentName = definition.getComponentName();
 
         // the AMBARI service is special, skip it here
-        if (Services.AMBARI.name().equals(serviceName)) {
+        if (RootService.AMBARI.name().equals(serviceName)) {
           continue;
         }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/main/java/org/apache/ambari/server/api/services/RootServiceComponentConfigurationRequestSwagger.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/RootServiceComponentConfigurationRequestSwagger.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/RootServiceComponentConfigurationRequestSwagger.java
new file mode 100644
index 0000000..dffa125
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/RootServiceComponentConfigurationRequestSwagger.java
@@ -0,0 +1,43 @@
+/*
+ * 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;
+
+import java.util.Map;
+
+import org.apache.ambari.server.controller.ApiModel;
+
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * Request data model for {@link org.apache.ambari.server.api.services.RootServiceComponentConfigurationService}
+ */
+public interface RootServiceComponentConfigurationRequestSwagger extends ApiModel {
+
+  @ApiModelProperty(name = "Configuration")
+  RootServiceComponentConfigurationRequestInfo getRootServiceComponentConfigurationRequestInfo();
+
+  interface RootServiceComponentConfigurationRequestInfo {
+    @ApiModelProperty
+    String getServiceName();
+
+    @ApiModelProperty
+    String getComponentName();
+
+    @ApiModelProperty
+    String getCategoryName();
+
+    @ApiModelProperty
+    Map<String, String> getProperties();
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/main/java/org/apache/ambari/server/api/services/RootServiceComponentConfigurationResponseSwagger.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/RootServiceComponentConfigurationResponseSwagger.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/RootServiceComponentConfigurationResponseSwagger.java
new file mode 100644
index 0000000..fb3c09d
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/RootServiceComponentConfigurationResponseSwagger.java
@@ -0,0 +1,43 @@
+/*
+ * 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;
+
+import java.util.Map;
+
+import org.apache.ambari.server.controller.ApiModel;
+
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * Response data model for {@link org.apache.ambari.server.api.services.RootServiceComponentConfigurationService}
+ */
+public interface RootServiceComponentConfigurationResponseSwagger extends ApiModel {
+
+  @ApiModelProperty(name = "Configuration")
+  RootServiceComponentConfigurationResponseInfo getRootServiceComponentConfigurationResponseInfo();
+
+  interface RootServiceComponentConfigurationResponseInfo {
+    @ApiModelProperty
+    String getServiceName();
+
+    @ApiModelProperty
+    String getComponentName();
+
+    @ApiModelProperty
+    String getCategoryName();
+
+    @ApiModelProperty
+    Map<String, Object> getProperties();
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/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
new file mode 100644
index 0000000..c7c37a6
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/RootServiceComponentConfigurationService.java
@@ -0,0 +1,226 @@
+/*
+ * 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.
+ */
+
+/*
+ * 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;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.HttpHeaders;
+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.ResourceInstance;
+import org.apache.ambari.server.controller.spi.Resource;
+import org.apache.http.HttpStatus;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+
+/**
+ * Rest endpoint for managing ambari root service component configurations. Supports CRUD operations.
+ * Ambari configurations are resources that relate to the ambari server instance even before a cluster is provisioned.
+ * <p>
+ * Ambari configuration resources may be shared with components and services in the cluster
+ * (by recommending them as default values)
+ * <p>
+ * Eg. LDAP configuration is stored as Configuration.
+ * The request payload has the form:
+ * <p>
+ * <pre>
+ *      {
+ *        "Configuration": {
+ *          "service_name": "AMBARI",
+ *          "component_name": "AMBARI_SERVER",
+ *          "category": "ldap-configuration",
+ *          "properties": {
+ *             "authentication.ldap.primaryUrl": "localhost:33389"
+ *             "authentication.ldap.secondaryUrl": "localhost:333"
+ *             "authentication.ldap.baseDn": "dc=ambari,dc=apache,dc=org"
+ *             // ......
+ *          }
+ *        }
+ *      }
+ * </pre>
+ */
+@Api(value = "Root Service Configurations", description = "Endpoint for Ambari root service component configuration related operations")
+public class RootServiceComponentConfigurationService extends BaseService {
+
+  private static final String REQUEST_TYPE =
+      "org.apache.ambari.server.api.services.RootServiceComponentConfigurationRequestSwagger";
+
+  private final String serviceName;
+  private final String componentName;
+
+  public RootServiceComponentConfigurationService(String serviceName, String componentName) {
+    this.serviceName = serviceName;
+    this.componentName = componentName;
+  }
+
+  /**
+   * Creates a root service component configuration resource.
+   *
+   * @param body    the payload in json format
+   * @param headers http headers
+   * @param uri     request uri information
+   * @return
+   */
+  @POST
+  @Produces(MediaType.TEXT_PLAIN)
+  @ApiOperation(value = "Creates a root service component configuration resource",
+      nickname = "RootServiceComponentConfigurationService#createConfiguration")
+  @ApiImplicitParams({
+      @ApiImplicitParam(dataType = REQUEST_TYPE, paramType = PARAM_TYPE_BODY)
+  })
+  @ApiResponses({
+      @ApiResponse(code = HttpStatus.SC_CREATED, message = MSG_SUCCESSFUL_OPERATION),
+      @ApiResponse(code = HttpStatus.SC_ACCEPTED, message = MSG_REQUEST_ACCEPTED),
+      @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = MSG_INVALID_ARGUMENTS),
+      @ApiResponse(code = HttpStatus.SC_CONFLICT, message = MSG_RESOURCE_ALREADY_EXISTS),
+      @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = MSG_NOT_AUTHENTICATED),
+      @ApiResponse(code = HttpStatus.SC_FORBIDDEN, message = MSG_PERMISSION_DENIED),
+      @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = MSG_SERVER_ERROR),
+  })
+  public Response createConfiguration(String body, @Context HttpHeaders headers, @Context UriInfo uri) {
+    return handleRequest(headers, body, uri, Request.Type.POST, createResource(null));
+  }
+
+  @GET
+  @Produces(MediaType.TEXT_PLAIN)
+  @ApiOperation(value = "Retrieve all root service component configuration resources",
+      nickname = "RootServiceComponentConfigurationService#getConfigurations",
+      notes = "Returns all root service component configurations.",
+      response = RootServiceComponentConfigurationResponseSwagger.class,
+      responseContainer = RESPONSE_CONTAINER_LIST)
+  @ApiImplicitParams({
+      @ApiImplicitParam(name = QUERY_FIELDS, value = QUERY_FILTER_DESCRIPTION,
+          defaultValue = "Configuration/properties, Configuration/category, Configuration/component_name, Configuration/service_name",
+          dataType = DATA_TYPE_STRING, paramType = PARAM_TYPE_QUERY),
+      @ApiImplicitParam(name = QUERY_SORT, value = QUERY_SORT_DESCRIPTION,
+          defaultValue = "Configuration/category",
+          dataType = DATA_TYPE_STRING, paramType = PARAM_TYPE_QUERY),
+      @ApiImplicitParam(name = QUERY_PAGE_SIZE, value = QUERY_PAGE_SIZE_DESCRIPTION, defaultValue = DEFAULT_PAGE_SIZE, dataType = DATA_TYPE_INT, paramType = PARAM_TYPE_QUERY),
+      @ApiImplicitParam(name = QUERY_FROM, value = QUERY_FROM_DESCRIPTION, defaultValue = DEFAULT_FROM, dataType = DATA_TYPE_STRING, paramType = PARAM_TYPE_QUERY),
+      @ApiImplicitParam(name = QUERY_TO, value = QUERY_TO_DESCRIPTION, dataType = DATA_TYPE_STRING, paramType = PARAM_TYPE_QUERY)
+  })
+  @ApiResponses(value = {
+      @ApiResponse(code = HttpStatus.SC_OK, message = MSG_SUCCESSFUL_OPERATION),
+      @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = MSG_SERVER_ERROR)
+  })
+  public Response getConfigurations(String body, @Context HttpHeaders headers, @Context UriInfo uri) {
+    return handleRequest(headers, body, uri, Request.Type.GET, createResource(null));
+  }
+
+  @GET
+  @Path("{category}")
+  @Produces(MediaType.TEXT_PLAIN)
+  @ApiOperation(value = "Retrieve the details of a root service component configuration resource",
+      nickname = "RootServiceComponentConfigurationService#getConfiguration",
+      response = RootServiceComponentConfigurationResponseSwagger.class)
+  @ApiImplicitParams({
+      @ApiImplicitParam(name = QUERY_FIELDS, value = QUERY_FILTER_DESCRIPTION, defaultValue = "Configuration/*",
+          dataType = DATA_TYPE_STRING, paramType = PARAM_TYPE_QUERY)
+  })
+  @ApiResponses(value = {
+      @ApiResponse(code = HttpStatus.SC_OK, message = MSG_SUCCESSFUL_OPERATION),
+      @ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = MSG_RESOURCE_NOT_FOUND),
+      @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = MSG_SERVER_ERROR)
+  })
+  public Response getConfiguration(String body, @Context HttpHeaders headers, @Context UriInfo uri,
+                                   @PathParam("category") String category) {
+    return handleRequest(headers, body, uri, Request.Type.GET, createResource(category));
+  }
+
+  @PUT
+  @Path("{category}")
+  @Produces(MediaType.TEXT_PLAIN)
+  @ApiOperation(value = "Updates root service component configuration resources ",
+      nickname = "RootServiceComponentConfigurationService#updateConfiguration")
+  @ApiImplicitParams({
+      @ApiImplicitParam(dataType = REQUEST_TYPE, paramType = PARAM_TYPE_BODY),
+      @ApiImplicitParam(name = QUERY_FIELDS, value = QUERY_FILTER_DESCRIPTION, defaultValue = "Configuration/*",
+          dataType = DATA_TYPE_STRING, paramType = PARAM_TYPE_QUERY)
+  })
+  @ApiResponses({
+      @ApiResponse(code = HttpStatus.SC_OK, message = MSG_SUCCESSFUL_OPERATION),
+      @ApiResponse(code = HttpStatus.SC_ACCEPTED, message = MSG_REQUEST_ACCEPTED),
+      @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = MSG_INVALID_ARGUMENTS),
+      @ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = MSG_RESOURCE_NOT_FOUND),
+      @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = MSG_NOT_AUTHENTICATED),
+      @ApiResponse(code = HttpStatus.SC_FORBIDDEN, message = MSG_PERMISSION_DENIED),
+      @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = MSG_SERVER_ERROR),
+  })
+  public Response updateConfiguration(String body, @Context HttpHeaders headers, @Context UriInfo uri,
+                                      @PathParam("category") String category) {
+    return handleRequest(headers, body, uri, Request.Type.PUT, createResource(category));
+  }
+
+  @DELETE
+  @Path("{category}")
+  @Produces(MediaType.TEXT_PLAIN)
+  @ApiOperation(value = "Deletes a root service component configuration resource",
+      nickname = "RootServiceComponentConfigurationService#deleteConfiguration")
+  @ApiResponses({
+      @ApiResponse(code = HttpStatus.SC_OK, message = MSG_SUCCESSFUL_OPERATION),
+      @ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = MSG_RESOURCE_NOT_FOUND),
+      @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = MSG_NOT_AUTHENTICATED),
+      @ApiResponse(code = HttpStatus.SC_FORBIDDEN, message = MSG_PERMISSION_DENIED),
+      @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = MSG_SERVER_ERROR),
+  })
+  public Response deleteConfiguration(String body, @Context HttpHeaders headers, @Context UriInfo uri,
+                                      @PathParam("category") String category) {
+    return handleRequest(headers, body, uri, Request.Type.DELETE, createResource(category));
+  }
+
+  ResourceInstance createResource(String categoryName) {
+    Map<Resource.Type, String> mapIds = new HashMap<>();
+    mapIds.put(Resource.Type.RootService, serviceName);
+    mapIds.put(Resource.Type.RootServiceComponent, componentName);
+    mapIds.put(Resource.Type.RootServiceComponentConfiguration, categoryName);
+
+    return createResource(Resource.Type.RootServiceComponentConfiguration, mapIds);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/main/java/org/apache/ambari/server/api/services/RootServiceService.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/RootServiceService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/RootServiceService.java
index 5afb7dc..1ab2797 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/RootServiceService.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/RootServiceService.java
@@ -297,6 +297,13 @@ public class RootServiceService extends BaseService {
     return handleRequest(headers, body, ui, Request.Type.GET, resource);
   }
 
+  @Path("{serviceName}/components/{componentName}/configurations")
+  public RootServiceComponentConfigurationService getAmbariServerConfigurationHandler(@Context javax.ws.rs.core.Request request,
+                                                                                      @PathParam("serviceName") String serviceName,
+                                                                                      @PathParam("componentName") String componentName) {
+    return new RootServiceComponentConfigurationService(serviceName, componentName);
+  }
+
   protected ResourceInstance createServiceResource(String serviceName) {
     Map<Resource.Type, String> mapIds = Collections.singletonMap(Resource.Type.RootService, serviceName);
     return createResource(Resource.Type.RootService, mapIds);

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/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
index e9f0b1e..7bac65e 100644
--- 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
@@ -26,7 +26,7 @@ public class AmbariConfiguration {
    */
   private String type;
 
-  private Map<String, Object> properties = null;
+  private Map<String, String> properties = null;
 
   public String getType() {
     return type;
@@ -36,11 +36,11 @@ public class AmbariConfiguration {
     this.type = type;
   }
 
-  public Map<String, Object> getProperties() {
+  public Map<String, String> getProperties() {
     return properties;
   }
 
-  public void setProperties(Map<String, Object> data) {
+  public void setProperties(Map<String, String> data) {
     this.properties = data;
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/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
index 2e478c4..0e065e5 100644
--- 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
@@ -22,7 +22,7 @@ import com.google.gson.annotations.SerializedName;
  */
 public class LdapConfigurationRequest {
 
-  @SerializedName("AmbariConfiguration")
+  @SerializedName("Configuration")
   private AmbariConfiguration ambariConfiguration;
 
   @SerializedName("RequestInfo")

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/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
index 00c13f6..22784cd 100644
--- 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
@@ -40,7 +40,7 @@ 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.AmbariConfigurationService;
+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;
@@ -64,7 +64,7 @@ import com.google.common.collect.Sets;
  */
 @StaticallyInject
 @Path("/ldapconfigs/")
-public class LdapConfigurationService extends AmbariConfigurationService {
+public class LdapConfigurationService extends BaseService {
 
   private static final Logger LOGGER = LoggerFactory.getLogger(LdapConfigurationService.class);
 
@@ -133,7 +133,7 @@ public class LdapConfigurationService extends AmbariConfigurationService {
   }
 
   private void setResult(Set<String> groups, Result result) {
-    Resource resource = new ResourceImpl(Resource.Type.AmbariConfiguration);
+    Resource resource = new ResourceImpl(Resource.Type.RootServiceComponentConfiguration);
     resource.setProperty("groups", groups);
     result.getResultTree().addChild(resource, "payload");
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/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 91edf86..17591ec 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
@@ -45,6 +45,8 @@ import org.apache.ambari.server.api.services.stackadvisor.StackAdvisorException;
 import org.apache.ambari.server.api.services.stackadvisor.StackAdvisorRequest;
 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.spi.Resource;
 import org.apache.ambari.server.state.ServiceInfo;
 import org.apache.ambari.server.utils.DateUtils;
@@ -84,7 +86,9 @@ public abstract class StackAdvisorCommand<T extends StackAdvisorResponse> extend
       + ",services/configurations/dependencies/StackConfigurationDependency/dependency_name"
       + ",services/configurations/dependencies/StackConfigurationDependency/dependency_type,services/configurations/StackConfigurations/type"
       + "&services/StackServices/service_name.in(%s)";
-  private static final String GET_LDAP_CONFIG_URI = "/api/v1/configurations?AmbariConfiguration/type=ldap&fields=AmbariConfiguration/*";
+  private static final String GET_AMBARI_LDAP_CONFIG_URI = "/api/v1/services/AMBARI/components/AMBARI_SERVER/configurations" +
+      "?Configuration/category=ldap-configuration" +
+      "&fields=Configuration/properties";
   private static final String SERVICES_PROPERTY = "services";
   private static final String SERVICES_COMPONENTS_PROPERTY = "components";
   private static final String CONFIG_GROUPS_PROPERTY = "config-groups";
@@ -96,7 +100,7 @@ public abstract class StackAdvisorCommand<T extends StackAdvisorResponse> extend
   private static final String CHANGED_CONFIGURATIONS_PROPERTY = "changed-configurations";
   private static final String USER_CONTEXT_PROPERTY = "user-context";
   private static final String AMBARI_SERVER_CONFIGURATIONS_PROPERTY = "ambari-server-properties";
-  protected static final String LDAP_CONFIGURATION_PROPERTY = "ldap-configuration";
+  static final String LDAP_CONFIGURATION_PROPERTY = "ldap-configuration";
 
   private File recommendationsDir;
   private String recommendationsArtifactsLifetime;
@@ -176,17 +180,18 @@ public abstract class StackAdvisorCommand<T extends StackAdvisorResponse> extend
 
   /**
    * Retrieves the LDAP configuration if exists and adds it to services.json
+   *
    * @param root The JSON document that will become service.json when passed to the stack advisor engine
    * @throws StackAdvisorException
    * @throws IOException
    */
-  protected void populateLdapConfiguration(ObjectNode root) throws StackAdvisorException, IOException {
-    Response response = handleRequest(null, null, new LocalUriInfo(GET_LDAP_CONFIG_URI), Request.Type.GET,
+   void populateLdapConfiguration(ObjectNode root) throws StackAdvisorException, IOException {
+    Response response = handleRequest(null, null, new LocalUriInfo(GET_AMBARI_LDAP_CONFIG_URI), Request.Type.GET,
         createConfigResource());
 
     if (response.getStatus() != Status.OK.getStatusCode()) {
       String message = String.format(
-          "Error occured during retrieving ldap configuration, status=%s, response=%s",
+          "Error occurred during retrieving ldap configuration, status=%s, response=%s",
           response.getStatus(), (String) response.getEntity());
       LOG.warn(message);
       throw new StackAdvisorException(message);
@@ -198,25 +203,28 @@ public abstract class StackAdvisorCommand<T extends StackAdvisorResponse> extend
     }
 
     JsonNode ldapConfigRoot = mapper.readTree(ldapConfigJSON);
-    ArrayNode ldapConfigs = ((ArrayNode)ldapConfigRoot.get("items"));
+    ArrayNode ldapConfigs = ((ArrayNode) ldapConfigRoot.get("items"));
     int numConfigs = ldapConfigs.size();
-    // Zero or one config may exist
-    switch (numConfigs) {
-      case 0:
-        LOG.debug("No LDAP config is stored in the DB");
-        break;
-      case 1:
-        ArrayNode ldapConfigData = (ArrayNode)ldapConfigs.get(0).get("AmbariConfiguration").get("data");
-        if (ldapConfigData.size() == 0) {
-          throw new StackAdvisorException("No configuration data for LDAP configuration.");
-        }
-        if (ldapConfigData.size() > 1) {
-          throw new StackAdvisorException("Ambigous configuration data for LDAP configuration.");
-        }
-        root.put(LDAP_CONFIGURATION_PROPERTY, ldapConfigData.get(0));
-        break;
-      default:
-        throw new StackAdvisorException(String.format("Multiple (%s) LDAP configs are found in the DB.", numConfigs));
+
+    if (numConfigs == 1) {
+      JsonNode ldapConfigItem = ldapConfigs.get(0);
+      if (ldapConfigItem == null) {
+        throw new StackAdvisorException("Unexpected JSON document encountered: missing data");
+      }
+
+      JsonNode ldapConfiguration = ldapConfigItem.get("Configuration");
+      if (ldapConfiguration == null) {
+        throw new StackAdvisorException("Unexpected JSON document encountered: missing the Configuration object");
+      }
+
+      JsonNode ldapConfigurationProperties = ldapConfiguration.get("properties");
+      if (ldapConfigurationProperties == null) {
+        throw new StackAdvisorException("Unexpected JSON document encountered: missing the Configuration/properties object");
+      }
+
+      root.put(LDAP_CONFIGURATION_PROPERTY, ldapConfigurationProperties);
+    } else if (numConfigs > 1) {
+      throw new StackAdvisorException(String.format("Multiple (%s) LDAP configs are found in the DB.", numConfigs));
     }
   }
 
@@ -486,8 +494,12 @@ public abstract class StackAdvisorCommand<T extends StackAdvisorResponse> extend
     return createResource(Resource.Type.Host, mapIds);
   }
 
-  protected ResourceInstance createConfigResource() {
-    return createResource(Resource.Type.AmbariConfiguration, new HashMap<>());
+  private ResourceInstance createConfigResource() {
+    Map<Resource.Type, String> mapIds = new HashMap<>();
+    mapIds.put(Resource.Type.RootService, RootService.AMBARI.name());
+    mapIds.put(Resource.Type.RootServiceComponent, RootComponent.AMBARI_SERVER.name());
+
+    return createResource(Resource.Type.RootServiceComponentConfiguration, mapIds);
   }
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
index 1425e1b..ed7513f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
@@ -63,7 +63,6 @@ import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.configuration.Configuration.ConnectionPoolType;
 import org.apache.ambari.server.configuration.Configuration.DatabaseType;
 import org.apache.ambari.server.controller.internal.AlertTargetResourceProvider;
-import org.apache.ambari.server.controller.internal.AmbariConfigurationResourceProvider;
 import org.apache.ambari.server.controller.internal.ClusterStackVersionResourceProvider;
 import org.apache.ambari.server.controller.internal.ComponentResourceProvider;
 import org.apache.ambari.server.controller.internal.CredentialResourceProvider;
@@ -73,6 +72,7 @@ import org.apache.ambari.server.controller.internal.HostResourceProvider;
 import org.apache.ambari.server.controller.internal.KerberosDescriptorResourceProvider;
 import org.apache.ambari.server.controller.internal.MemberResourceProvider;
 import org.apache.ambari.server.controller.internal.RepositoryVersionResourceProvider;
+import org.apache.ambari.server.controller.internal.RootServiceComponentConfigurationResourceProvider;
 import org.apache.ambari.server.controller.internal.ServiceResourceProvider;
 import org.apache.ambari.server.controller.internal.UpgradeResourceProvider;
 import org.apache.ambari.server.controller.internal.ViewInstanceResourceProvider;
@@ -471,10 +471,10 @@ public class ControllerModule extends AbstractModule {
         .implement(ResourceProvider.class, Names.named("credential"), CredentialResourceProvider.class)
         .implement(ResourceProvider.class, Names.named("kerberosDescriptor"), KerberosDescriptorResourceProvider.class)
         .implement(ResourceProvider.class, Names.named("upgrade"), UpgradeResourceProvider.class)
-        .implement(ResourceProvider.class, Names.named("ambariConfiguration"), AmbariConfigurationResourceProvider.class)
         .implement(ResourceProvider.class, Names.named("clusterStackVersion"), ClusterStackVersionResourceProvider.class)
         .implement(ResourceProvider.class, Names.named("alertTarget"), AlertTargetResourceProvider.class)
         .implement(ResourceProvider.class, Names.named("viewInstance"), ViewInstanceResourceProvider.class)
+        .implement(ResourceProvider.class, Names.named("rootServiceHostComponentConfiguration"), RootServiceComponentConfigurationResourceProvider.class)
         .build(ResourceProviderFactory.class));
 
     install(new FactoryModuleBuilder().implement(

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/main/java/org/apache/ambari/server/controller/MaintenanceStateHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/MaintenanceStateHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/MaintenanceStateHelper.java
index d9a585f..1ffe841 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/MaintenanceStateHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/MaintenanceStateHelper.java
@@ -24,7 +24,6 @@ import java.util.Set;
 
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.HostNotFoundException;
-import org.apache.ambari.server.controller.RootServiceResponseFactory.Services;
 import org.apache.ambari.server.controller.internal.RequestOperationLevel;
 import org.apache.ambari.server.controller.internal.RequestResourceFilter;
 import org.apache.ambari.server.controller.spi.Resource;
@@ -265,7 +264,7 @@ public class MaintenanceStateHelper {
     }
 
     // the AMBARI service is not a real service; it's never in MM
-    if( StringUtils.equals(Services.AMBARI.name(), serviceName)){
+    if( StringUtils.equals(RootService.AMBARI.name(), serviceName)){
       return MaintenanceState.OFF;
     }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/main/java/org/apache/ambari/server/controller/ResourceProviderFactory.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/ResourceProviderFactory.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/ResourceProviderFactory.java
index 711ae10..f6ca16b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/ResourceProviderFactory.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/ResourceProviderFactory.java
@@ -68,8 +68,8 @@ public interface ResourceProviderFactory {
   @Named("upgrade")
   UpgradeResourceProvider getUpgradeResourceProvider(AmbariManagementController managementController);
 
-  @Named("ambariConfiguration")
-  ResourceProvider getAmbariConfigurationResourceProvider();
+  @Named("rootServiceHostComponentConfiguration")
+  ResourceProvider getRootServiceHostComponentConfigurationResourceProvider();
 
   @Named("clusterStackVersion")
   ClusterStackVersionResourceProvider getClusterStackVersionResourceProvider(AmbariManagementController managementController);

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/main/java/org/apache/ambari/server/controller/RootComponent.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/RootComponent.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/RootComponent.java
new file mode 100644
index 0000000..74cdfcf
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/RootComponent.java
@@ -0,0 +1,27 @@
+/*
+ * 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;
+
+/**
+ * RootComponent is an enumeration of root-level components.
+ */
+public enum RootComponent {
+  AMBARI_SERVER,
+  AMBARI_AGENT
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/main/java/org/apache/ambari/server/controller/RootService.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/RootService.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/RootService.java
new file mode 100644
index 0000000..22f571d
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/RootService.java
@@ -0,0 +1,36 @@
+/*
+ * 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;
+
+/**
+ * RootService is an enumeration of root-level services.
+ */
+public enum RootService {
+  AMBARI(RootComponent.values());
+
+  private final RootComponent[] components;
+
+  RootService(RootComponent[] components) {
+    this.components = components;
+  }
+
+  public RootComponent[] getComponents() {
+    return components;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/main/java/org/apache/ambari/server/controller/RootServiceResponseFactory.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/RootServiceResponseFactory.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/RootServiceResponseFactory.java
index ad9ed20..63d41fd 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/RootServiceResponseFactory.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/RootServiceResponseFactory.java
@@ -62,9 +62,9 @@ public class RootServiceResponseFactory extends
       serviceName = request.getServiceName();
 
     if (serviceName != null) {
-      Services service;
+      RootService service;
       try {
-        service = Services.valueOf(serviceName);
+        service = RootService.valueOf(serviceName);
       }
       catch (IllegalArgumentException ex) {
         throw new ObjectNotFoundException("Root service name: " + serviceName);
@@ -74,7 +74,7 @@ public class RootServiceResponseFactory extends
     } else {
       response = new HashSet<>();
       
-      for (Services service: Services.values())    
+      for (RootService service: RootService.values())
         response.add(new RootServiceResponse(service.toString()));
     }    
     return response;
@@ -87,10 +87,10 @@ public class RootServiceResponseFactory extends
 
     String serviceName = request.getServiceName();
     String componentName = request.getComponentName();
-    Services service;
+    RootService service;
 
     try {
-      service = Services.valueOf(serviceName);
+      service = RootService.valueOf(serviceName);
     }
     catch (IllegalArgumentException ex) {
       throw new ObjectNotFoundException("Root service name: " + serviceName);
@@ -100,9 +100,9 @@ public class RootServiceResponseFactory extends
     }
     
     if (componentName != null) {
-      Components component;
+      RootComponent component;
       try {
-        component = Components.valueOf(componentName);
+        component = RootComponent.valueOf(componentName);
         if (!ArrayUtils.contains(service.getComponents(), component))
           throw new ObjectNotFoundException("No component name: " + componentName + "in service: " + serviceName);
       }
@@ -114,7 +114,7 @@ public class RootServiceResponseFactory extends
                                        getComponentProperties(componentName)));
     } else {
     
-      for (Components component: service.getComponents())    
+      for (RootComponent component: service.getComponents())
         response.add(new RootServiceComponentResponse(serviceName, component.toString(),
                      getComponentVersion(component.name(), null),
                      getComponentProperties(component.name())));
@@ -123,7 +123,7 @@ public class RootServiceResponseFactory extends
   }
 
   private String getComponentVersion(String componentName, HostResponse host) {
-    Components component = Components.valueOf(componentName);
+    RootComponent component = RootComponent.valueOf(componentName);
     String componentVersion;
       
     switch (component) {
@@ -150,10 +150,10 @@ public class RootServiceResponseFactory extends
     
     Map<String, String> response;
     Set<String> propertiesToHideInResponse;
-    Components component = null;
+    RootComponent component = null;
 
     if (componentName != null) {
-      component = Components.valueOf(componentName);
+      component = RootComponent.valueOf(componentName);
       
       switch (component) {
       case AMBARI_SERVER:
@@ -176,24 +176,6 @@ public class RootServiceResponseFactory extends
     return response;
   }
 
-  
-  public enum Services {
-    AMBARI(Components.values());
-    private Components[] components;
-
-    Services(Components[] components) {
-      this.components = components;
-    }
-
-    public Components[] getComponents() {
-      return components;
-    }
-  }
-  
-  public enum Components {
-    AMBARI_SERVER, AMBARI_AGENT
-  }
-
   @Override
   public Set<RootServiceHostComponentResponse> getRootServiceHostComponent(RootServiceHostComponentRequest request, Set<HostResponse> hosts) throws AmbariException {
     Set<RootServiceHostComponentResponse> response = new HashSet<>();
@@ -208,7 +190,7 @@ public class RootServiceResponseFactory extends
       Set<HostResponse> filteredHosts = new HashSet<>(hosts);
       
       //Make some filtering of hosts if need
-      if (component.getComponentName().equals(Components.AMBARI_SERVER.name())) {
+      if (component.getComponentName().equals(RootComponent.AMBARI_SERVER.name())) {
         CollectionUtils.filter(filteredHosts, new Predicate() {
           @Override
           public boolean evaluate(Object arg0) {
@@ -220,7 +202,7 @@ public class RootServiceResponseFactory extends
       
       for (HostResponse host : filteredHosts) {
         String state;
-        if (component.getComponentName().equals(Components.AMBARI_SERVER.name())) {
+        if (component.getComponentName().equals(RootComponent.AMBARI_SERVER.name())) {
           state = RUNNING_STATE;
         } else {
           state = host.getHostState().toString();

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProvider.java
index 1dc0841..cc2548c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProvider.java
@@ -206,6 +206,8 @@ public abstract class AbstractControllerResourceProvider extends AbstractAuthori
         return new RootServiceResourceProvider(propertyIds, keyPropertyIds, managementController);
       case RootServiceComponent:
         return new RootServiceComponentResourceProvider(propertyIds, keyPropertyIds, managementController);
+      case RootServiceComponentConfiguration:
+        return resourceProviderFactory.getRootServiceHostComponentConfigurationResourceProvider();
       case RootServiceHostComponent:
         return new RootServiceHostComponentResourceProvider(propertyIds, keyPropertyIds, managementController);
       case ConfigGroup:
@@ -254,8 +256,6 @@ public abstract class AbstractControllerResourceProvider extends AbstractAuthori
         return new ClusterKerberosDescriptorResourceProvider(managementController);
       case LoggingQuery:
         return new LoggingResourceProvider(propertyIds, keyPropertyIds, managementController);
-      case AmbariConfiguration:
-        return resourceProviderFactory.getAmbariConfigurationResourceProvider();
       case AlertTarget:
         return resourceProviderFactory.getAlertTargetResourceProvider();
       case ViewInstance:

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProvider.java
deleted file mode 100644
index a24400d..0000000
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProvider.java
+++ /dev/null
@@ -1,302 +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.controller.internal;
-
-import java.util.Arrays;
-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.spi.NoSuchParentResourceException;
-import org.apache.ambari.server.controller.spi.NoSuchResourceException;
-import org.apache.ambari.server.controller.spi.Predicate;
-import org.apache.ambari.server.controller.spi.Request;
-import org.apache.ambari.server.controller.spi.RequestStatus;
-import org.apache.ambari.server.controller.spi.Resource;
-import org.apache.ambari.server.controller.spi.ResourceAlreadyExistsException;
-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;
-
-/**
- * Resource provider for AmbariConfiguration resources.
- */
-public class AmbariConfigurationResourceProvider extends AbstractAuthorizedResourceProvider {
-
-  private static final Logger LOGGER = LoggerFactory.getLogger(AmbariConfigurationResourceProvider.class);
-
-  static final String AMBARI_CONFIGURATION_CATEGORY_PROPERTY_ID = PropertyHelper.getPropertyId("AmbariConfiguration", "category");
-  static final String AMBARI_CONFIGURATION_PROPERTIES_PROPERTY_ID = PropertyHelper.getPropertyId("AmbariConfiguration", "properties");
-
-  private static final Set<String> PROPERTIES = Collections.unmodifiableSet(
-      new HashSet<>(Arrays.asList(
-          AMBARI_CONFIGURATION_CATEGORY_PROPERTY_ID,
-          AMBARI_CONFIGURATION_PROPERTIES_PROPERTY_ID)
-      )
-  );
-
-  private static final Map<Resource.Type, String> PK_PROPERTY_MAP = Collections.unmodifiableMap(
-      Collections.singletonMap(Resource.Type.AmbariConfiguration, AMBARI_CONFIGURATION_CATEGORY_PROPERTY_ID)
-  );
-
-  private static final Set<String> PK_PROPERTY_IDS = Collections.unmodifiableSet(
-      new HashSet<>(PK_PROPERTY_MAP.values())
-  );
-
-  @Inject
-  private AmbariConfigurationDAO ambariConfigurationDAO;
-
-  @Inject
-  private AmbariEventPublisher publisher;
-
-  public AmbariConfigurationResourceProvider() {
-    super(PROPERTIES, PK_PROPERTY_MAP);
-
-    Set<RoleAuthorization> authorizations = EnumSet.of(RoleAuthorization.AMBARI_MANAGE_CONFIGURATION);
-    setRequiredCreateAuthorizations(authorizations);
-    setRequiredDeleteAuthorizations(authorizations);
-    setRequiredUpdateAuthorizations(authorizations);
-    setRequiredGetAuthorizations(authorizations);
-  }
-
-  @Override
-  protected Set<String> getPKPropertyIds() {
-    return PK_PROPERTY_IDS;
-  }
-
-  @Override
-  public RequestStatus createResourcesAuthorized(Request request)
-      throws SystemException, UnsupportedPropertyException, ResourceAlreadyExistsException, NoSuchParentResourceException {
-
-    createOrAddProperties(null, request.getProperties(), true);
-
-    return getRequestStatus(null);
-  }
-
-  @Override
-  protected Set<Resource> getResourcesAuthorized(Request request, Predicate predicate) throws SystemException,
-      UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
-
-    return getResources(new Command<Set<Resource>>() {
-      @Override
-      public Set<Resource> invoke() throws AmbariException {
-        Set<Resource> resources = new HashSet<>();
-        Set<String> requestedIds = getRequestPropertyIds(request, predicate);
-
-        if (CollectionUtils.isEmpty(requestedIds)) {
-          requestedIds = PROPERTIES;
-        }
-
-        if (predicate == null) {
-          Set<Resource> _resources = getAmbariConfigurationResources(requestedIds, null);
-          if (!CollectionUtils.isEmpty(_resources)) {
-            resources.addAll(_resources);
-          }
-        } else {
-          for (Map<String, Object> propertyMap : getPropertyMaps(predicate)) {
-            Set<Resource> _resources = getAmbariConfigurationResources(requestedIds, propertyMap);
-            if (!CollectionUtils.isEmpty(_resources)) {
-              resources.addAll(_resources);
-            }
-          }
-        }
-
-        return resources;
-      }
-    });
-  }
-
-
-  @Override
-  protected RequestStatus deleteResourcesAuthorized(Request request, Predicate predicate) throws SystemException,
-      UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
-
-    String categoryName = (String) PredicateHelper.getProperties(predicate).get(AMBARI_CONFIGURATION_CATEGORY_PROPERTY_ID);
-
-    if (null == categoryName) {
-      LOGGER.debug("No resource id provided in the request");
-    } else {
-      LOGGER.debug("Deleting Ambari configuration with id: {}", categoryName);
-      try {
-        ambariConfigurationDAO.removeByCategory(categoryName);
-      } catch (IllegalStateException e) {
-        throw new NoSuchResourceException(e.getMessage());
-      }
-    }
-
-    // notify subscribers about the configuration changes
-    publisher.publish(new AmbariConfigurationChangedEvent(categoryName));
-    return getRequestStatus(null);
-  }
-
-  @Override
-  protected RequestStatus updateResourcesAuthorized(Request request, Predicate predicate)
-      throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
-
-    String categoryName = (String) PredicateHelper.getProperties(predicate).get(AMBARI_CONFIGURATION_CATEGORY_PROPERTY_ID);
-    createOrAddProperties(categoryName, request.getProperties(), false);
-
-    return getRequestStatus(null);
-  }
-
-  /**
-   * Retrieves groups of properties from the request data and create or updates them as needed.
-   * <p>
-   * Each group of properties is expected to have a category (<code>AmbariConfiguration/category</code>)
-   * 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).
-   *
-   * @param defaultCategoryName            the default category to use if needed
-   * @param requestProperties              a collection of property maps parsed from the request
-   * @param removePropertiesIfNotSpecified <code>true</code> to remove existing properties that have not been specifed in the request; <code>false</code> append or update the existing set of properties with values from the request
-   * @throws SystemException if an error occurs saving the configuration data
-   */
-  private void createOrAddProperties(String defaultCategoryName, Set<Map<String, Object>> requestProperties, boolean removePropertiesIfNotSpecified)
-      throws SystemException {
-    // set of resource properties (each entry in the set belongs to a different resource)
-    if (requestProperties != null) {
-      for (Map<String, Object> resourceProperties : requestProperties) {
-        Map<String, Map<String, String>> entityMap = parseProperties(defaultCategoryName, resourceProperties);
-
-        if (entityMap != null) {
-          for (Map.Entry<String, Map<String, String>> entry : entityMap.entrySet()) {
-            String categoryName = entry.getKey();
-
-            if (ambariConfigurationDAO.reconcileCategory(categoryName, entry.getValue(), removePropertiesIfNotSpecified)) {
-              // notify subscribers about the configuration changes
-              publisher.publish(new AmbariConfigurationChangedEvent(categoryName));
-            }
-          }
-        }
-      }
-    }
-  }
-
-  private Resource toResource(String categoryName, Map<String, String> properties, Set<String> requestedIds) {
-    Resource resource = new ResourceImpl(Resource.Type.AmbariConfiguration);
-    setResourceProperty(resource, AMBARI_CONFIGURATION_CATEGORY_PROPERTY_ID, categoryName, requestedIds);
-    setResourceProperty(resource, AMBARI_CONFIGURATION_PROPERTIES_PROPERTY_ID, properties, requestedIds);
-    return resource;
-  }
-
-  /**
-   * Parse the property map from a request into a map of category names to maps of property names and values.
-   *
-   * @param defaultCategoryName the default category name to use if one is not found in the map of properties
-   * @param resourceProperties  a map of properties from a request item
-   * @return a map of category names to maps of name/value pairs
-   * @throws SystemException if an issue with the data is determined
-   */
-  private Map<String, Map<String, String>> parseProperties(String defaultCategoryName, Map<String, Object> resourceProperties) throws SystemException {
-    String categoryName = null;
-    Map<String, String> properties = new HashMap<>();
-
-    for (Map.Entry<String, Object> entry : resourceProperties.entrySet()) {
-      String propertyName = entry.getKey();
-
-      if (AMBARI_CONFIGURATION_CATEGORY_PROPERTY_ID.equals(propertyName)) {
-        if (entry.getValue() instanceof String) {
-          categoryName = (String) entry.getValue();
-        }
-      } else {
-        String propertyCategory = PropertyHelper.getPropertyCategory(entry.getKey());
-        if ((propertyCategory != null) && propertyCategory.equals(AMBARI_CONFIGURATION_PROPERTIES_PROPERTY_ID)) {
-          String name = PropertyHelper.getPropertyName(entry.getKey());
-          Object value = entry.getValue();
-          properties.put(name, (value == null) ? null : value.toString());
-        }
-      }
-    }
-
-    if (categoryName == null) {
-      categoryName = defaultCategoryName;
-    }
-
-    if (StringUtils.isEmpty(categoryName)) {
-      throw new SystemException("The configuration type must be set");
-    }
-
-    if (properties.isEmpty()) {
-      throw new SystemException("The configuration properties must be set");
-    }
-
-    return Collections.singletonMap(categoryName, properties);
-  }
-
-  private Set<Resource> getAmbariConfigurationResources(Set<String> requestedIds, Map<String, Object> propertyMap) {
-    Set<Resource> resources = new HashSet<>();
-
-    String categoryName = getStringProperty(propertyMap, AMBARI_CONFIGURATION_CATEGORY_PROPERTY_ID);
-
-    List<AmbariConfigurationEntity> entities = (categoryName == null)
-        ? ambariConfigurationDAO.findAll()
-        : ambariConfigurationDAO.findByCategory(categoryName);
-
-    if (entities != null) {
-      Map<String, Map<String, String>> 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());
-      }
-
-      for (Map.Entry<String, Map<String, String>> entry : configurations.entrySet()) {
-        resources.add(toResource(entry.getKey(), entry.getValue(), requestedIds));
-      }
-    }
-
-    return resources;
-  }
-
-  private String getStringProperty(Map<String, Object> propertyMap, String propertyId) {
-    String value = null;
-
-    if (propertyMap != null) {
-      Object o = propertyMap.get(propertyId);
-      if (o instanceof String) {
-        value = (String) o;
-      }
-    }
-
-    return value;
-  }
-}


[07/50] [abbrv] ambari git commit: AMBARI-22303. Spark history server is stopped (with umask 027 and custom spark log/pid dir) (aonishuk)

Posted by am...@apache.org.
AMBARI-22303. Spark history server is stopped (with umask 027 and custom spark log/pid dir) (aonishuk)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 46ad6c6878b00f7791845ecf7c2b3fef7244faad
Parents: feccebc
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Fri Nov 10 12:53:06 2017 +0200
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Fri Nov 10 12:53:06 2017 +0200

----------------------------------------------------------------------
 .../SPARK/1.2.1/package/scripts/setup_spark.py          |  3 ++-
 .../SPARK2/2.0.0/package/scripts/setup_spark.py         |  3 ++-
 .../python/stacks/2.2/SPARK/test_job_history_server.py  | 12 ++++++++----
 .../test/python/stacks/2.2/SPARK/test_spark_client.py   | 12 ++++++++----
 .../python/stacks/2.3/SPARK/test_spark_thrift_server.py |  6 ++++--
 5 files changed, 24 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/46ad6c68/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/setup_spark.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/setup_spark.py b/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/setup_spark.py
index 53c8f9e..6a29efb 100644
--- a/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/setup_spark.py
+++ b/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/setup_spark.py
@@ -52,7 +52,8 @@ def setup_spark(env, type, upgrade_type=None, action=None, config_dir=None):
             owner=params.spark_user,
             group=params.user_group,
             mode=0775,
-            create_parents = True
+            create_parents = True,
+            cd_access = 'a',
   )
   if type == 'server' and action == 'config':
     params.HdfsResource(params.spark_hdfs_user_dir,

http://git-wip-us.apache.org/repos/asf/ambari/blob/46ad6c68/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/setup_spark.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/setup_spark.py b/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/setup_spark.py
index a7b8459..792b2a1 100755
--- a/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/setup_spark.py
+++ b/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/setup_spark.py
@@ -42,7 +42,8 @@ def setup_spark(env, type, upgrade_type = None, action = None):
             owner=params.spark_user,
             group=params.user_group,
             mode=0775,
-            create_parents = True
+            create_parents = True,
+            cd_access = 'a',
   )
   if type == 'server' and action == 'config':
     params.HdfsResource(params.spark_hdfs_user_dir,

http://git-wip-us.apache.org/repos/asf/ambari/blob/46ad6c68/ambari-server/src/test/python/stacks/2.2/SPARK/test_job_history_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.2/SPARK/test_job_history_server.py b/ambari-server/src/test/python/stacks/2.2/SPARK/test_job_history_server.py
index 922ace2..8801746 100644
--- a/ambari-server/src/test/python/stacks/2.2/SPARK/test_job_history_server.py
+++ b/ambari-server/src/test/python/stacks/2.2/SPARK/test_job_history_server.py
@@ -165,13 +165,15 @@ class TestJobHistoryServer(RMFTestCase):
         owner = 'spark',
         group = 'hadoop',
         create_parents = True,
-        mode = 0775
+        mode = 0775,
+        cd_access = 'a',
     )
     self.assertResourceCalled('Directory', '/var/log/spark',
         owner = 'spark',
         group = 'hadoop',
         create_parents = True,
-        mode = 0775
+        mode = 0775,
+        cd_access = 'a',
     )
     self.assertResourceCalled('HdfsResource', '/user/spark',
         immutable_paths = self.DEFAULT_IMMUTABLE_PATHS,
@@ -246,13 +248,15 @@ class TestJobHistoryServer(RMFTestCase):
         owner = 'spark',
         group = 'hadoop',
         create_parents = True,
-        mode = 0775
+        mode = 0775,
+        cd_access = 'a',
     )
     self.assertResourceCalled('Directory', '/var/log/spark',
         owner = 'spark',
         group = 'hadoop',
         create_parents = True,
-        mode = 0775
+        mode = 0775,
+        cd_access = 'a',
     )
     self.assertResourceCalled('HdfsResource', '/user/spark',
         immutable_paths = self.DEFAULT_IMMUTABLE_PATHS,

http://git-wip-us.apache.org/repos/asf/ambari/blob/46ad6c68/ambari-server/src/test/python/stacks/2.2/SPARK/test_spark_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.2/SPARK/test_spark_client.py b/ambari-server/src/test/python/stacks/2.2/SPARK/test_spark_client.py
index b4535cd..e15d5a4 100644
--- a/ambari-server/src/test/python/stacks/2.2/SPARK/test_spark_client.py
+++ b/ambari-server/src/test/python/stacks/2.2/SPARK/test_spark_client.py
@@ -58,13 +58,15 @@ class TestSparkClient(RMFTestCase):
         owner = 'spark',
         group = 'hadoop',
         create_parents = True,
-        mode = 0775
+        mode = 0775,
+        cd_access = 'a',
     )
     self.assertResourceCalled('Directory', '/var/log/spark',
         owner = 'spark',
         group = 'hadoop',
         create_parents = True,
-        mode = 0775
+        mode = 0775,
+        cd_access = 'a',
     )
     self.assertResourceCalled('PropertiesFile', '/usr/hdp/current/spark-client/conf/spark-defaults.conf',
         owner = 'spark',
@@ -108,13 +110,15 @@ class TestSparkClient(RMFTestCase):
         owner = 'spark',
         group = 'hadoop',
         create_parents = True,
-        mode = 0775
+        mode = 0775,
+        cd_access = 'a',
     )
     self.assertResourceCalled('Directory', '/var/log/spark',
         owner = 'spark',
         group = 'hadoop',
         create_parents = True,
-        mode = 0775
+        mode = 0775,
+        cd_access = 'a',
     )
     self.assertResourceCalled('PropertiesFile', '/usr/hdp/current/spark-client/conf/spark-defaults.conf',
         owner = 'spark',

http://git-wip-us.apache.org/repos/asf/ambari/blob/46ad6c68/ambari-server/src/test/python/stacks/2.3/SPARK/test_spark_thrift_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.3/SPARK/test_spark_thrift_server.py b/ambari-server/src/test/python/stacks/2.3/SPARK/test_spark_thrift_server.py
index fbe5403..78d45cf 100644
--- a/ambari-server/src/test/python/stacks/2.3/SPARK/test_spark_thrift_server.py
+++ b/ambari-server/src/test/python/stacks/2.3/SPARK/test_spark_thrift_server.py
@@ -85,13 +85,15 @@ class TestSparkThriftServer(RMFTestCase):
         owner = 'spark',
         group = 'hadoop',
         create_parents = True,
-        mode = 0775
+        mode = 0775,
+        cd_access = 'a',
     )
     self.assertResourceCalled('Directory', '/var/log/spark',
         owner = 'spark',
         group = 'hadoop',
         create_parents = True,
-        mode = 0775
+        mode = 0775,
+        cd_access = 'a',
     )
     self.assertResourceCalled('HdfsResource', '/user/spark',
         immutable_paths = self.DEFAULT_IMMUTABLE_PATHS,


[11/50] [abbrv] ambari git commit: AMBARI-22411. Restart all required services failed when running cluster with several patch upgrades applied (ncole)

Posted by am...@apache.org.
AMBARI-22411. Restart all required services failed when running cluster with several patch upgrades applied (ncole)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 068d82f700432cf5cfa75d20924443e998d8fe87
Parents: ec02a14
Author: Nate Cole <nc...@hortonworks.com>
Authored: Fri Nov 10 11:23:13 2017 -0500
Committer: Nate Cole <nc...@hortonworks.com>
Committed: Fri Nov 10 12:00:14 2017 -0500

----------------------------------------------------------------------
 .../AmbariCustomCommandExecutionHelper.java     | 23 ++++----
 .../AmbariManagementControllerImpl.java         | 60 +++-----------------
 .../internal/UpgradeResourceProvider.java       |  8 +--
 .../HDP/2.0.6/properties/stack_packages.json    |  3 +-
 .../AmbariManagementControllerImplTest.java     |  2 +-
 5 files changed, 25 insertions(+), 71 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/068d82f7/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
index e8febbb..dc6bbb7 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
@@ -1425,27 +1425,23 @@ public class AmbariCustomCommandExecutionHelper {
    *
    * @param actionExecContext  the context
    * @param cluster            the cluster for the command
+   * @param stackId            the stack id used to load service metainfo.
    *
    * @return a wrapper of the important JSON structures to add to a stage
    */
   public ExecuteCommandJson getCommandJson(ActionExecutionContext actionExecContext,
-      Cluster cluster, RepositoryVersionEntity repositoryVersion, String requestContext) throws AmbariException {
+      Cluster cluster, StackId stackId, String requestContext) throws AmbariException {
 
     Map<String, String> commandParamsStage = StageUtils.getCommandParamsStage(actionExecContext, requestContext);
     Map<String, String> hostParamsStage = new HashMap<>();
     Map<String, Set<String>> clusterHostInfo;
     String clusterHostInfoJson = "{}";
 
-    StackId stackId = null;
-    if (null != repositoryVersion) {
-      stackId = repositoryVersion.getStackId();
-    }
-
     if (null != cluster) {
       clusterHostInfo = StageUtils.getClusterHostInfo(cluster);
 
       // Important, because this runs during Stack Uprade, it needs to use the effective Stack Id.
-      hostParamsStage = createDefaultHostParams(cluster, repositoryVersion);
+      hostParamsStage = createDefaultHostParams(cluster, stackId);
 
       String componentName = null;
       String serviceName = null;
@@ -1454,7 +1450,7 @@ public class AmbariCustomCommandExecutionHelper {
         serviceName = actionExecContext.getOperationLevel().getServiceName();
       }
 
-      if (serviceName != null && componentName != null && null != stackId) {
+      if (serviceName != null && componentName != null) {
         Service service = cluster.getService(serviceName);
         ServiceComponent component = service.getServiceComponent(componentName);
         stackId = component.getDesiredStackId();
@@ -1473,6 +1469,10 @@ public class AmbariCustomCommandExecutionHelper {
 
       clusterHostInfoJson = StageUtils.getGson().toJson(clusterHostInfo);
 
+      if (null == stackId && null != cluster) {
+        stackId = cluster.getDesiredStackVersion();
+      }
+
       //Propogate HCFS service type info to command params
       if (null != stackId) {
         Map<String, ServiceInfo> serviceInfos = ambariMetaInfo.getServices(stackId.getStackName(),
@@ -1497,11 +1497,10 @@ public class AmbariCustomCommandExecutionHelper {
         hostParamsStageJson);
   }
 
-  Map<String, String> createDefaultHostParams(Cluster cluster, RepositoryVersionEntity repositoryVersion) throws AmbariException {
-    return createDefaultHostParams(cluster, repositoryVersion.getStackId());
-  }
-
   Map<String, String> createDefaultHostParams(Cluster cluster, StackId stackId) throws AmbariException {
+    if (null == stackId) {
+      stackId = cluster.getDesiredStackVersion();
+    }
 
     TreeMap<String, String> hostLevelParams = new TreeMap<>();
     StageUtils.useStackJdkIfExists(hostLevelParams, configs);

http://git-wip-us.apache.org/repos/asf/ambari/blob/068d82f7/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 380e1b4..4c00f1f 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
@@ -68,6 +68,8 @@ import java.util.concurrent.TimeUnit;
 
 import javax.persistence.RollbackException;
 
+import org.apache.ambari.annotations.Experimental;
+import org.apache.ambari.annotations.ExperimentalFeature;
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.ClusterNotFoundException;
 import org.apache.ambari.server.DuplicateResourceException;
@@ -2838,7 +2840,7 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
             if (StringUtils.isBlank(stage.getHostParamsStage())) {
               RepositoryVersionEntity repositoryVersion = serviceComponent.getDesiredRepositoryVersion();
               stage.setHostParamsStage(StageUtils.getGson().toJson(
-                  customCommandExecutionHelper.createDefaultHostParams(cluster, repositoryVersion)));
+                  customCommandExecutionHelper.createDefaultHostParams(cluster, repositoryVersion.getStackId())));
             }
 
 
@@ -3186,7 +3188,7 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
 
 
     Map<String, String> hostParamsCmd = customCommandExecutionHelper.createDefaultHostParams(
-        cluster, scHost.getServiceComponent().getDesiredRepositoryVersion());
+        cluster, scHost.getServiceComponent().getDesiredStackId());
 
     Stage stage = createNewStage(0, cluster, 1, "", clusterHostInfoJson, "{}", "");
 
@@ -4154,56 +4156,10 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
         actionManager,
         actionRequest);
 
-    RepositoryVersionEntity desiredRepositoryVersion = null;
-
-    RequestOperationLevel operationLevel = actionExecContext.getOperationLevel();
-    if (null != operationLevel && StringUtils.isNotBlank(operationLevel.getServiceName())) {
-      Service service = cluster.getService(operationLevel.getServiceName());
-      if (null != service) {
-        desiredRepositoryVersion = service.getDesiredRepositoryVersion();
-      }
-    }
-
-    if (null == desiredRepositoryVersion && CollectionUtils.isNotEmpty(actionExecContext.getResourceFilters())) {
-      Set<RepositoryVersionEntity> versions = new HashSet<>();
-
-      for (RequestResourceFilter filter : actionExecContext.getResourceFilters()) {
-        RepositoryVersionEntity repoVersion = null;
-
-        if (StringUtils.isNotBlank(filter.getServiceName())) {
-          Service service = cluster.getService(filter.getServiceName());
-
-          if (StringUtils.isNotBlank(filter.getComponentName())) {
-            ServiceComponent serviceComponent = service.getServiceComponent(filter.getComponentName());
-
-            repoVersion = serviceComponent.getDesiredRepositoryVersion();
-          }
-
-          if (null == repoVersion) {
-            repoVersion = service.getDesiredRepositoryVersion();
-          }
-        }
-
-        if (null != repoVersion) {
-          versions.add(repoVersion);
-        }
-      }
-
-      if (1 == versions.size()) {
-        desiredRepositoryVersion = versions.iterator().next();
-      } else if (versions.size() > 1) {
-        Set<String> errors = new HashSet<>();
-        for (RepositoryVersionEntity version : versions) {
-          errors.add(String.format("%s/%s", version.getStackId(), version.getVersion()));
-        }
-        throw new IllegalArgumentException(String.format("More than one repository is resolved with this Action: %s",
-            StringUtils.join(errors, ';')));
-      }
-    }
-
-
-    ExecuteCommandJson jsons = customCommandExecutionHelper.getCommandJson(actionExecContext,
-        cluster, desiredRepositoryVersion, requestContext);
+    @Experimental(feature=ExperimentalFeature.MULTI_SERVICE,
+        comment = "This must change with Multi-Service since the cluster won't have a desired stack version")
+    ExecuteCommandJson jsons = customCommandExecutionHelper.getCommandJson(actionExecContext, cluster,
+        null == cluster ? null : cluster.getDesiredStackVersion(), requestContext);
 
     String commandParamsForStage = jsons.getCommandParamsForStage();
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/068d82f7/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
index 14b1b86..d4111d6 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
@@ -1073,7 +1073,7 @@ public class UpgradeResourceProvider extends AbstractControllerResourceProvider
     actionContext.setAutoSkipFailures(context.isComponentFailureAutoSkipped());
 
     ExecuteCommandJson jsons = s_commandExecutionHelper.get().getCommandJson(actionContext,
-        cluster, effectiveRepositoryVersion, null);
+        cluster, effectiveRepositoryVersion.getStackId(), null);
 
     Stage stage = s_stageFactory.get().createNew(request.getId().longValue(), "/tmp/ambari",
         cluster.getClusterName(), cluster.getClusterId(), entity.getText(), jsons.getCommandParamsForStage(),
@@ -1155,7 +1155,7 @@ public class UpgradeResourceProvider extends AbstractControllerResourceProvider
     actionContext.setMaintenanceModeHostExcluded(true);
 
     ExecuteCommandJson jsons = s_commandExecutionHelper.get().getCommandJson(actionContext,
-        cluster, effectiveRepositoryVersion, null);
+        cluster, effectiveRepositoryVersion.getStackId(), null);
 
     Stage stage = s_stageFactory.get().createNew(request.getId().longValue(), "/tmp/ambari",
         cluster.getClusterName(), cluster.getClusterId(), entity.getText(), jsons.getCommandParamsForStage(),
@@ -1220,7 +1220,7 @@ public class UpgradeResourceProvider extends AbstractControllerResourceProvider
     actionContext.setMaintenanceModeHostExcluded(true);
 
     ExecuteCommandJson jsons = s_commandExecutionHelper.get().getCommandJson(actionContext,
-        cluster, effectiveRepositoryVersion, null);
+        cluster, effectiveRepositoryVersion.getStackId(), null);
 
     Stage stage = s_stageFactory.get().createNew(request.getId().longValue(), "/tmp/ambari",
         cluster.getClusterName(), cluster.getClusterId(), entity.getText(), jsons.getCommandParamsForStage(),
@@ -1361,7 +1361,7 @@ public class UpgradeResourceProvider extends AbstractControllerResourceProvider
     actionContext.setMaintenanceModeHostExcluded(true);
 
     ExecuteCommandJson jsons = s_commandExecutionHelper.get().getCommandJson(actionContext,
-        cluster, context.getRepositoryVersion(), null);
+        cluster, context.getRepositoryVersion().getStackId(), null);
 
     Stage stage = s_stageFactory.get().createNew(request.getId().longValue(), "/tmp/ambari",
         cluster.getClusterName(), cluster.getClusterId(), stageText, jsons.getCommandParamsForStage(),

http://git-wip-us.apache.org/repos/asf/ambari/blob/068d82f7/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_packages.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_packages.json b/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_packages.json
index 23c6d32..68e6bf8 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_packages.json
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_packages.json
@@ -1277,8 +1277,7 @@
       }
     },
     "upgrade-dependencies" : {
-      "YARN": ["TEZ"],
-      "TEZ": ["YARN"],
+      "HIVE": ["TEZ"],
       "MAHOUT": ["MAPREDUCE2"]
     }    
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/068d82f7/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 9547271..94c5ebe 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
@@ -2138,7 +2138,7 @@ public class AmbariManagementControllerImplTest {
     f.setAccessible(true);
     f.set(helper, gson);
 
-    Map<String, String> defaultHostParams = helper.createDefaultHostParams(cluster, repositoryVersionEntity);
+    Map<String, String> defaultHostParams = helper.createDefaultHostParams(cluster, repositoryVersionEntity.getStackId());
 
     assertEquals(15, defaultHostParams.size());
     assertEquals(MYSQL_JAR, defaultHostParams.get(DB_DRIVER_FILENAME));


[04/50] [abbrv] ambari git commit: AMBARI-22400 Ambari 3.0: Implement new design for Admin View: Cluster Information page. (atkach)

Posted by am...@apache.org.
AMBARI-22400 Ambari 3.0: Implement new design for Admin View: Cluster Information page. (atkach)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 430dcbf1224996c76276a8c40fb58eb54addd10a
Parents: e968b12
Author: Andrii Tkach <at...@apache.org>
Authored: Thu Nov 9 16:13:29 2017 +0200
Committer: Andrii Tkach <at...@apache.org>
Committed: Thu Nov 9 16:53:02 2017 +0200

----------------------------------------------------------------------
 .../main/resources/ui/admin-web/app/index.html  |   3 +-
 .../app/scripts/controllers/AppCtrl.js          |   2 +-
 .../controllers/ClusterInformationCtrl.js       |  65 +++++++++++
 .../controllers/clusters/ExportBlueprintCtrl.js |  58 ----------
 .../app/scripts/controllers/mainCtrl.js         |  27 -----
 .../ui/admin-web/app/scripts/i18n.config.js     |  13 +--
 .../ui/admin-web/app/scripts/routes.js          |  59 +++++-----
 .../app/styles/cluster-information.css          |  59 ++++++++++
 .../resources/ui/admin-web/app/styles/main.css  |  98 -----------------
 .../admin-web/app/views/clusterInformation.html |  66 ++++++++++++
 .../app/views/clusters/exportBlueprint.html     |  40 -------
 .../ui/admin-web/app/views/groups/list.html     |   3 +-
 .../resources/ui/admin-web/app/views/main.html  | 107 -------------------
 .../app/views/remoteClusters/list.html          |   3 +-
 .../ui/admin-web/app/views/sideNav.html         |  19 ++--
 .../admin-web/app/views/stackVersions/list.html |   3 +-
 .../ui/admin-web/app/views/users/list.html      |   3 +-
 .../test/unit/services/Utility_test.js          |   2 +-
 18 files changed, 240 insertions(+), 390 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/430dcbf1/ambari-admin/src/main/resources/ui/admin-web/app/index.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/index.html b/ambari-admin/src/main/resources/ui/admin-web/app/index.html
index 41cc60f..2b350f0 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/index.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/index.html
@@ -121,7 +121,7 @@
 <script src="scripts/app.js"></script>
 <script src="scripts/routes.js"></script>
 <script src="scripts/i18n.config.js"></script>
-<script src="scripts/controllers/mainCtrl.js"></script>
+<script src="scripts/controllers/ClusterInformationCtrl.js"></script>
 <script src="scripts/controllers/AppCtrl.js"></script>
 <script src="scripts/controllers/SideNavCtrl.js"></script>
 <script src="scripts/controllers/authentication/AuthenticationMainCtrl.js"></script>
@@ -142,7 +142,6 @@
 <script src="scripts/controllers/ambariViews/CloneViewInstanceCtrl.js"></script>
 <script src="scripts/controllers/clusters/ClustersManageAccessCtrl.js"></script>
 <script src="scripts/controllers/clusters/UserAccessListCtrl.js"></script>
-<script src="scripts/controllers/clusters/ExportBlueprintCtrl.js"></script>
 <script src="scripts/controllers/stackVersions/StackVersionsCreateCtrl.js"></script>
 <script src="scripts/controllers/stackVersions/StackVersionsListCtrl.js"></script>
 <script src="scripts/controllers/stackVersions/StackVersionsEditCtrl.js"></script>

http://git-wip-us.apache.org/repos/asf/ambari/blob/430dcbf1/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/AppCtrl.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/AppCtrl.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/AppCtrl.js
index 4ac5b38..eb9a9b0 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/AppCtrl.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/AppCtrl.js
@@ -31,7 +31,7 @@ angular.module('ambariAdminConsole')
     return $route.current;
   }, function (value) {
     var breadcrumbs = [$t('common.admin')];
-    if (value && value.$$route.label) {
+    if (value && value.$$route && value.$$route.label) {
       breadcrumbs.push(value.$$route.label);
     }
     $scope.breadcrumbs = breadcrumbs;

http://git-wip-us.apache.org/repos/asf/ambari/blob/430dcbf1/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ClusterInformationCtrl.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ClusterInformationCtrl.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ClusterInformationCtrl.js
new file mode 100644
index 0000000..60a610c
--- /dev/null
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ClusterInformationCtrl.js
@@ -0,0 +1,65 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+'use strict';
+
+angular.module('ambariAdminConsole')
+.controller('ClusterInformationCtrl', ['$scope', '$http', '$location', 'Cluster', '$routeParams', '$translate', '$rootScope',
+function($scope, $http, $location, Cluster, $routeParams, $translate, $rootScope) {
+  var $t = $translate.instant;
+  $scope.isDataLoaded = false;
+
+  $scope.$watch(function() {
+    return $rootScope.cluster;
+  }, function() {
+    $scope.cluster = $rootScope.cluster;
+    if ($scope.cluster) {
+      $scope.getBlueprint();
+    }
+  }, true);
+
+  $scope.getBlueprint = function () {
+    Cluster.getBlueprint({
+      clusterName: $scope.cluster.Clusters.cluster_name
+    }).then(function (data) {
+      console.debug($t('exportBlueprint.dataLoaded'), data);
+      $scope.isDataLoaded = true;
+      var response = JSON.stringify(data, null, 4),
+        lt = /&lt;/g,
+        gt = /&gt;/g,
+        ap = /&#39;/g,
+        ic = /&#34;/g;
+      $scope.blueprint = response ? response.toString().replace(lt, "<").replace(gt, ">").replace(ap, "'").replace(ic, '"') : "";
+    });
+  };
+
+  $scope.downloadBlueprint = function () {
+    if (window.navigator.msSaveOrOpenBlob) {
+      var blob = new Blob([decodeURIComponent(encodeURI($scope.blueprint))], {
+        type: "text/csv;charset=utf-8;"
+      });
+      navigator.msSaveBlob(blob, 'blueprint.json');
+    } else {
+      var a = document.createElement('a');
+      a.href = 'data:attachment/csv;charset=utf-8,' + encodeURI($scope.blueprint);
+      a.target = '_blank';
+      a.download = 'blueprint.json';
+      document.body.appendChild(a);
+      a.click();
+    }
+  };
+}]);

http://git-wip-us.apache.org/repos/asf/ambari/blob/430dcbf1/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/clusters/ExportBlueprintCtrl.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/clusters/ExportBlueprintCtrl.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/clusters/ExportBlueprintCtrl.js
deleted file mode 100644
index 6b74b40..0000000
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/clusters/ExportBlueprintCtrl.js
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-'use strict';
-
-angular.module('ambariAdminConsole')
-.controller('ExportBlueprintCtrl', ['$scope', '$http', '$location', 'Cluster', '$routeParams', '$translate', function($scope, $http, $location, Cluster, $routeParams, $translate) {
-  var $t = $translate.instant;
-  $scope.identity = angular.identity;
-
-  $scope.isDataLoaded = false;
-  $scope.clusterName = $routeParams.id;
-
-  $scope.getBlueprint = function() {
-    Cluster.getBlueprint({
-      clusterName: $scope.clusterName
-    }).then(function(data) {
-      console.debug($t('exportBlueprint.dataLoaded'), data);
-      $scope.isDataLoaded = true;
-      var response = JSON.stringify(data, null, 4),
-        lt = /&lt;/g,
-        gt = /&gt;/g,
-        ap = /&#39;/g,
-        ic = /&#34;/g;
-      $scope.blueprint = response ? response.toString().replace(lt, "<").replace(gt, ">").replace(ap, "'").replace(ic, '"') : "";
-    });
-  };
-
-  $scope.downloadBlueprint = function() {
-    if (window.navigator.msSaveOrOpenBlob) {
-      var blob = new Blob([decodeURIComponent(encodeURI($scope.blueprint))], {
-        type: "text/csv;charset=utf-8;"
-      });
-      navigator.msSaveBlob(blob, 'blueprint.json');
-    } else {
-      var a = document.createElement('a');
-      a.href = 'data:attachment/csv;charset=utf-8,' + encodeURI($scope.blueprint);
-      a.target = '_blank';
-      a.download = 'blueprint.json';
-      document.body.appendChild(a);
-      a.click();
-    }
-  };
-}]);

http://git-wip-us.apache.org/repos/asf/ambari/blob/430dcbf1/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/mainCtrl.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/mainCtrl.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/mainCtrl.js
deleted file mode 100644
index 30f7568..0000000
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/mainCtrl.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-'use strict';
-
-angular.module('ambariAdminConsole')
-.controller('MainCtrl',['$scope','$rootScope', function($scope, $rootScope) {
-  $scope.$watch(function() {
-    return $rootScope.cluster;
-  }, function() {
-    $scope.cluster = $rootScope.cluster;
-  }, true);
-}]);

http://git-wip-us.apache.org/repos/asf/ambari/blob/430dcbf1/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js
index 73ab064..4ef3ee9 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js
@@ -41,7 +41,6 @@ angular.module('ambariAdminConsole')
     'common.dashboard': 'Dashboard',
     'common.goToDashboard': 'Go to Dashboard',
     'common.exportBlueprint': 'Export Blueprint',
-    'common.blueprint': 'Blueprint',
     'common.download': 'Download',
     'common.noClusters': 'No Clusters',
     'common.noViews': 'No Views',
@@ -168,23 +167,12 @@ angular.module('ambariAdminConsole')
 
     'main.title': 'Welcome to Apache Ambari',
     'main.noClusterDescription': 'Provision a cluster, manage who can access the cluster, and customize views for Ambari users.',
-    'main.hasClusterDescription': 'Monitor your cluster resources, manage who can access the cluster, and customize views for Ambari users.',
     'main.autoLogOut': 'Automatic Logout',
 
-    'main.operateCluster.title': 'Operate Your Cluster',
-    'main.operateCluster.description': 'Manage the configuration of your cluster and monitor the health of your services',
-    'main.operateCluster.manageRoles': 'Manage Roles',
-
     'main.createCluster.title': 'Create a Cluster',
     'main.createCluster.description': 'Use the Install Wizard to select services and configure your cluster',
     'main.createCluster.launchInstallWizard': 'Launch Install Wizard',
 
-    'main.manageUsersAndGroups.title': 'Manage Users + Groups',
-    'main.manageUsersAndGroups.description': 'Manage the users and groups that can access Ambari',
-
-    'main.deployViews.title': 'Deploy Views',
-    'main.deployViews.description': 'Create view instances and grant permissions',
-
     'main.controls.remainLoggedIn': 'Remain Logged In',
     'main.controls.logOut': 'Log Out Now',
 
@@ -284,6 +272,7 @@ angular.module('ambariAdminConsole')
     'clusters.assignRoles': 'Assign roles to these {{term}}',
 
     'clusters.alerts.cannotLoadClusterData': 'Cannot load cluster data',
+    'clusters.devBlueprint': 'Dev Blueprint',
 
     'groups.createLocal': 'Add Groups',
     'groups.name': 'Group name',

http://git-wip-us.apache.org/repos/asf/ambari/blob/430dcbf1/ambari-admin/src/main/resources/ui/admin-web/app/scripts/routes.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/routes.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/routes.js
index 2cb077a..486e598 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/routes.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/routes.js
@@ -19,12 +19,6 @@
 
 angular.module('ambariAdminConsole')
 .constant('ROUTES', {
-  root: {
-    url: '/',
-    templateUrl: 'views/main.html',
-    controller: 'MainCtrl',
-    label: 'Welcome'
-  },
   authentication: {
     main: {
       url: '/authentication',
@@ -33,7 +27,7 @@ angular.module('ambariAdminConsole')
     }
   },
   loginActivities: {
-    loginMessage:{
+    loginMessage: {
       url: '/loginMessage',
       templateUrl: 'views/loginActivities/main.html',
       controller: 'LoginActivitiesMainCtrl'
@@ -109,19 +103,19 @@ angular.module('ambariAdminConsole')
       controller: 'ViewsEditCtrl',
       label: 'Views'
     },
-    createViewUrl:{
+    createViewUrl: {
       url: '/urls/new',
       templateUrl: 'views/urls/create.html',
       controller: 'ViewUrlCtrl',
       label: 'Views'
     },
-    linkViewUrl:{
+    linkViewUrl: {
       url: '/urls/link/:viewName/:viewVersion/:viewInstanceName',
       templateUrl: 'views/urls/create.html',
       controller: 'ViewUrlCtrl',
       label: 'Views'
     },
-    editViewUrl:{
+    editViewUrl: {
       url: '/urls/edit/:urlName',
       templateUrl: 'views/urls/edit.html',
       controller: 'ViewUrlEditCtrl',
@@ -133,19 +127,19 @@ angular.module('ambariAdminConsole')
       url: '/stackVersions',
       templateUrl: 'views/stackVersions/list.html',
       controller: 'StackVersionsListCtrl',
-      label: 'Cluster Information'
+      label: 'Versions'
     },
     create: {
       url: '/stackVersions/create',
       templateUrl: 'views/stackVersions/stackVersionPage.html',
       controller: 'StackVersionsCreateCtrl',
-      label: 'Cluster Information'
+      label: 'Versions'
     },
     edit: {
       url: '/stackVersions/:stackName/:versionId/edit',
       templateUrl: 'views/stackVersions/stackVersionPage.html',
       controller: 'StackVersionsEditCtrl',
-      label: 'Cluster Information'
+      label: 'Versions'
     }
   },
   remoteClusters: {
@@ -161,12 +155,12 @@ angular.module('ambariAdminConsole')
       controller: 'RemoteClustersCreateCtrl',
       label: 'Remote Clusters'
     },
-     edit: {
-     url: '/remoteClusters/:clusterName/edit',
-     templateUrl: 'views/remoteClusters/editRemoteClusterPage.html',
-     controller: 'RemoteClustersEditCtrl',
-       label: 'Remote Clusters'
-     }
+    edit: {
+      url: '/remoteClusters/:clusterName/edit',
+      templateUrl: 'views/remoteClusters/editRemoteClusterPage.html',
+      controller: 'RemoteClustersEditCtrl',
+      label: 'Remote Clusters'
+    }
   },
   clusters: {
     manageAccess: {
@@ -180,31 +174,36 @@ angular.module('ambariAdminConsole')
       templateUrl: 'views/clusters/userAccessList.html',
       controller: 'UserAccessListCtrl'
     },
-    exportBlueprint: {
-      url: '/clusters/:id/exportBlueprint',
-      templateUrl: 'views/clusters/exportBlueprint.html',
-      controller: 'ExportBlueprintCtrl'
+    clusterInformation: {
+      url: '/clusterInformation',
+      templateUrl: 'views/clusterInformation.html',
+      controller: 'ClusterInformationCtrl',
+      label: 'Cluster Information'
     }
   },
-  dashboard:{
+  dashboard: {
     url: '/dashboard',
-    controller: ['$window', function($window) {
+    controller: ['$window', function ($window) {
       $window.location.replace('/#/main/dashboard');
     }],
     template: ''
   }
 })
-.config(['$routeProvider', '$locationProvider', 'ROUTES', function($routeProvider, $locationProvider, ROUTES) {
-  var createRoute = function(routeObj) {
-    if(routeObj.url){
+.config(['$routeProvider', '$locationProvider', 'ROUTES', function ($routeProvider, $locationProvider, ROUTES) {
+  var createRoute = function (routeObj) {
+    if (routeObj.url) {
       $routeProvider.when(routeObj.url, routeObj);
     } else {
       angular.forEach(routeObj, createRoute);
     }
   };
+  var rootUrl = ROUTES['clusters']['clusterInformation'].url;
   angular.forEach(ROUTES, createRoute);
+  $routeProvider.otherwise({
+    redirectTo: rootUrl
+  });
 }])
-.run(['$rootScope', 'ROUTES', 'Settings', function($rootScope, ROUTES, Settings) {
+.run(['$rootScope', 'ROUTES', 'Settings', function ($rootScope, ROUTES, Settings) {
   // Make routes available in every template and controller
   $rootScope.ROUTES = ROUTES;
   $rootScope.$on('$locationChangeStart', function (e, nextUrl) {
@@ -226,7 +225,7 @@ angular.module('ambariAdminConsole')
    * @param {string} url
    * @returns {string}
    */
-  $rootScope.fromSiteRoot = function(url) {
+  $rootScope.fromSiteRoot = function (url) {
     var path = url[0] === '/' ? url.substring(1) : url;
     return Settings.siteRoot + path;
   };

http://git-wip-us.apache.org/repos/asf/ambari/blob/430dcbf1/ambari-admin/src/main/resources/ui/admin-web/app/styles/cluster-information.css
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/styles/cluster-information.css b/ambari-admin/src/main/resources/ui/admin-web/app/styles/cluster-information.css
new file mode 100644
index 0000000..63f4150
--- /dev/null
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/styles/cluster-information.css
@@ -0,0 +1,59 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#cluster-information .cluster-name label {
+  font-weight: normal;
+}
+
+#cluster-information .dev-blueprint {
+  line-height: 35px;
+}
+
+#cluster-information .dev-blueprint span {
+  vertical-align: text-top;
+}
+
+#cluster-information .cluster-name label {
+  font-weight: normal;
+}
+
+#cluster-information .dev-blueprint {
+  line-height: 35px;
+}
+
+#cluster-information .dev-blueprint span {
+  vertical-align: text-top;
+}
+
+
+#cluster-information .welcome-header {
+  margin: -15px;
+  padding: 15px 15px 40px 15px;
+  background-color: #f0f0f0;
+  text-align: center;
+}
+
+#cluster-information .create-cluster-section {
+  text-align: center;
+  padding: 30px;
+}
+
+#cluster-information .fa-cloud {
+  font-size: 150px;
+  color: #f0f0f0;
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/430dcbf1/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css b/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
index bd06bc0..4224f62 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
@@ -123,14 +123,6 @@
   transition: none;
 }
 
-.cluster-installation-progress-label{
-  display: block;
-  color: #888;
-  text-align: center;
-  padding: 10px 0;
-  cursor: default;
-}
-
 .add-item-input span{
   display: block;
   outline: none;
@@ -236,96 +228,6 @@
 .paginator{
   margin: 0;
 }
-.mainpage .panel-body{
-  padding: 20px;
-  height: 620px;
-}
-.mainpage h1{
-  font-size: 24px;
-  margin-top: 10px;
-}
-.mainpage .panel-body #main-operations-boxes {
-  padding: 10px;
-}
-.mainpage .panel-body #main-operations-boxes .thumbnail{
-  display: block;
-  height: 230px;
-  padding: 8px;
-  background-color: #eeeeee;
-  margin-bottom: 20px;
-  margin-left: 20px;
-  margin-right: 10px;
-  border: none;
-  border-radius: 0;
-}
-.mainpage .panel-body #main-operations-boxes .thumbnail .title,
-.mainpage .panel-body #main-operations-boxes .thumbnail .description,
-.mainpage .panel-body #main-operations-boxes .thumbnail .buttons {
-  text-align: center;
-  line-height: 1.5;
-}
-.mainpage .panel-body #main-operations-boxes .thumbnail .buttons .btn{
-  width: 200px;
-  margin: 5px;
-}
-.mainpage .panel-body #main-operations-boxes .thumbnail .buttons .btn.userslist-button,
-.mainpage .panel-body #main-operations-boxes .thumbnail .buttons .btn.groupslist-button {
-  width: 100px;
-}
-.mainpage .panel-body #main-operations-boxes .thumbnail .glyphicon {
-  font-size: 50px;
-  text-align: center;
-  display: block;
-  line-height: 1.5;
-}
-.mainpage .panel-body #main-operations-boxes .col-sm-5 {
-  width: 43.5%;
-}
-
-.views-list-table .panel{
-  border-radius: 0;
-  border: none;
-  margin-top: 0;
-}
-.views-list-table h4{
-  font-size: 14px;
-}
-.views-list-table .panel-group .panel + .panel{
-  margin-top: 0;
-}
-.views-list-table .panel-group .panel .panel-heading{
-  border-radius: 0;
-  border-top: 1px solid #ddd;
-}
-.views-list-table .panel-group .panel .panel-heading{
-  background: #f9f9f9;
-}
-.views-list-table .panel-group .panel:nth-child(even) .panel-heading{
-  background: none;
-}
-.views-list-table .panel-group .panel .panel-heading .panel-title{
-  font-size: 14px;
-  font-weight: normal;
-  cursor: pointer;
-}
-.views-list-table .panel-group .panel .panel-body{
-  padding-top: 0;
-  padding-bottom: 0;
-}
-.views-list-table .panel-group .panel .panel-body table tr:first-child td{
-  border-top: none;
-}
-.views-list-table .glyphicon.glyphicon-chevron-right{
-  -webkit-transition: all 0.3s;
-  -o-transition: all 0.3s;
-  transition: all 0.3s;
-}
-.views-list-table .glyphicon.glyphicon-chevron-right.opened{
-  -webkit-transform: rotateZ(90deg);
-  -ms-transform: rotateZ(90deg);
-  -o-transform: rotateZ(90deg);
-  transform: rotateZ(90deg);
-}
 
 a.gotoinstance{
   font-size: 12px;

http://git-wip-us.apache.org/repos/asf/ambari/blob/430dcbf1/ambari-admin/src/main/resources/ui/admin-web/app/views/clusterInformation.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/clusterInformation.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/clusterInformation.html
new file mode 100644
index 0000000..6334d06
--- /dev/null
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/clusterInformation.html
@@ -0,0 +1,66 @@
+<!--
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+-->
+
+<div id="cluster-information">
+  <div ng-show="cluster.Clusters.provisioning_state !== 'INSTALLED'">
+    <div class="welcome-header">
+      <h1>{{'main.title' | translate}}</h1>
+      <span>{{'main.noClusterDescription' | translate}}</span>
+    </div>
+    <div class="create-cluster-section">
+      <h2>{{'main.createCluster.title' | translate}}</h2>
+      <div>
+        <span>
+          {{'main.createCluster.description' | translate}}
+        </span>
+      </div>
+      <div><i class="fa fa-cloud" aria-hidden="true"></i></div>
+      <div>
+        <a href="{{fromSiteRoot('/#/installer/step0')}}" class="btn btn-primary">
+          {{'main.createCluster.launchInstallWizard' | translate}}
+        </a>
+      </div>
+    </div>
+  </div>
+
+  <div ng-show="cluster.Clusters.provisioning_state === 'INSTALLED'">
+    <div class="row">
+      <div class="form-group col-xs-3 cluster-name">
+        <label for="clusterName">{{'views.clusterName' | translate}}*</label>
+        <input type="text" class="form-control" id="clusterName" ng-model="cluster.Clusters.cluster_name">
+      </div>
+    </div>
+    <div>
+      <div class="row dev-blueprint">
+        <div class="col-sm-11"><span>{{'clusters.devBlueprint' | translate}}</span></div>
+        <div class="col-sm-1">
+          <div class="btn btn-default pull-right" ng-click="downloadBlueprint()">{{"common.download" | translate}}
+          </div>
+        </div>
+      </div>
+      <textarea type="text"
+                rows="20"
+                class="form-control"
+                name="blueprint_text"
+                ng-model="blueprint"
+                ng-disabled="true"
+                ng-readonly="true">
+      </textarea>
+    </div>
+  </div>
+</div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/430dcbf1/ambari-admin/src/main/resources/ui/admin-web/app/views/clusters/exportBlueprint.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/clusters/exportBlueprint.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/clusters/exportBlueprint.html
deleted file mode 100644
index 6ccbffe..0000000
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/clusters/exportBlueprint.html
+++ /dev/null
@@ -1,40 +0,0 @@
-<!--
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
--->
-<div class="cluster-manage-access-pane" data-ng-init="getBlueprint()" ng-controller="ExportBlueprintCtrl">
-  <div class="clearfix">
-    <ol class="breadcrumb pull-left">
-      <li class="active">{{clusterName}} {{'common.blueprint' | translate}}</li>
-    </ol>
-    <div class="pull-right top-margin-4">
-      <div class="pull-right top-margin-4">
-        <div class="btn btn-default" ng-click="downloadBlueprint()">{{"common.download" | translate}}</div>
-      </div>
-    </div>
-  </div>
-  <hr>
-  <div>
-    <textarea type="text"
-               rows="20"
-               class="form-control"
-               name="blueprint_text"
-               ng-model="blueprint"
-               ng-disabled="true"
-               ng-readonly="true">
-    </textarea>
-  </div>
-</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/430dcbf1/ambari-admin/src/main/resources/ui/admin-web/app/views/groups/list.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/groups/list.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/groups/list.html
index 5271ceb..b39f55d 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/groups/list.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/groups/list.html
@@ -26,7 +26,6 @@
       </link-to>
     </div>
   </div>
-  <hr>
   <table class="table table-striped table-hover col-sm-12">
     <thead>
       <tr>
@@ -63,7 +62,7 @@
   <div ng-if="isLoading" class="spinner-container">
     <i class="fa fa-2x fa-spinner fa-spin" aria-hidden="true"></i>
   </div>
-  <div class="alert alert-info col-sm-12" ng-show="!groups.length && !isLoading">
+  <div class="alert empty-table-alert col-sm-12" ng-show="!groups.length && !isLoading">
     {{'common.alerts.nothingToDisplay' | translate: '{term: constants.groups}'}}
   </div>
   <div class="col-sm-12 table-bar">

http://git-wip-us.apache.org/repos/asf/ambari/blob/430dcbf1/ambari-admin/src/main/resources/ui/admin-web/app/views/main.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/main.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/main.html
deleted file mode 100644
index 3c382af..0000000
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/main.html
+++ /dev/null
@@ -1,107 +0,0 @@
-<!--
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
--->
-<div class="panel panel-default mainpage">
-  <div class="panel-body">
-    <h1>{{'main.title' | translate}}</h1>
-
-    <div id="main-operations-boxes" class="row thumbnails">
-      <p ng-hide="cluster">{{'main.noClusterDescription' | translate}}</p>
-
-      <p ng-show="cluster">{{'main.hasClusterDescription' | translate}}</p>
-
-      <!--Clusters-->
-      <div ng-show="cluster" class="col-sm-11 thumbnail">
-        <h4 class="title">{{'main.operateCluster.title' | translate}}</h4>
-
-        <div class="description">{{'main.operateCluster.description' | translate}}</div>
-        <div class="glyphicon glyphicon-cloud"></div>
-        <div class="buttons">
-        <span ng-class="{active: isActive('clusters.manageAccess')}">
-          <a ng-show="cluster.Clusters.provisioning_state != 'INSTALLED'" href
-                  class="btn btn-primary permission-button"
-                  ng-disabled="cluster.Clusters.provisioning_state != 'INSTALLED' ">
-            {{'main.operateCluster.manageRoles' | translate}}
-          </a>
-          <a ng-show="cluster.Clusters.provisioning_state == 'INSTALLED'"
-                  href="#/clusters/{{cluster.Clusters.cluster_name}}/userAccessList"
-                  class="btn btn-primary permission-button"
-                  ng-disabled="cluster.Clusters.provisioning_state != 'INSTALLED' ">
-            {{'main.operateCluster.manageRoles' | translate}}
-          </a>
-        </span>
-        <span>
-          <a ng-show="cluster.Clusters.provisioning_state != 'INSTALLED'" href
-                  class="btn btn-primary go-dashboard-button"
-                  ng-disabled="cluster.Clusters.provisioning_state != 'INSTALLED' ">
-            {{'common.goToDashboard' | translate}}
-          </a>
-          <a ng-show="cluster.Clusters.provisioning_state == 'INSTALLED'"
-                  href="{{fromSiteRoot('/#/main/dashboard/metrics')}}" class="btn btn-primary go-dashboard-button"
-                  ng-disabled="cluster.Clusters.provisioning_state != 'INSTALLED' ">
-            {{'common.goToDashboard' | translate}}
-          </a>
-        </span>
-        </div>
-      </div>
-      <div ng-hide="cluster" class="col-sm-11 thumbnail">
-        <h4 class="title">{{'main.createCluster.title' | translate}}</h4>
-
-        <div class="description">{{'main.createCluster.description' | translate}}</div>
-        <div class="glyphicon glyphicon-cloud"></div>
-        <div class="buttons">
-          <a href="{{fromSiteRoot('/#/installer/step0')}}" class="btn btn-primary create-cluster-button">
-            {{'main.createCluster.launchInstallWizard' | translate}}
-          </a>
-        </div>
-      </div>
-
-      <!--Manage Users and groups-->
-      <div class="col-sm-5 thumbnail">
-        <h4 class="title">{{'main.manageUsersAndGroups.title' | translate}}</h4>
-
-        <div class="description">{{'main.manageUsersAndGroups.description' | translate}}</div>
-        <div class="glyphicon glyphicon-user"></div>
-        <div class="buttons">
-          <span ng-class="{active: isActive('users.list')}">
-            <link-to route="users.list" class="btn btn-primary userslist-button">
-            {{'common.users' | translate}}
-            </link-to>
-          </span>
-          <span ng-class="{active: isActive('groups.list')}">
-            <link-to route="groups.list" class="btn btn-primary groupslist-button">
-            {{'common.groups' | translate}}
-            </link-to>
-          </span>
-        </div>
-      </div>
-
-      <!--Deploy Views-->
-      <div class="col-sm-5 thumbnail">
-        <h4 class="title">{{'main.deployViews.title' | translate}}</h4>
-
-        <div class="description">{{'main.deployViews.description' | translate}}</div>
-        <div class="glyphicon glyphicon-th"></div>
-        <div ng-class="{active: isActive('views.list')}" class="buttons">
-          <link-to route="views.list" class="btn btn-primary viewslist-button">
-            {{'common.views' | translate}}
-          </link-to>
-        </div>
-      </div>
-    </div>
-  </div>
-</div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/430dcbf1/ambari-admin/src/main/resources/ui/admin-web/app/views/remoteClusters/list.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/remoteClusters/list.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/remoteClusters/list.html
index e3e11d5..8bb6632 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/remoteClusters/list.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/remoteClusters/list.html
@@ -27,7 +27,6 @@
       </a>
     </div>
   </div>
-  <hr>
   <table class="table table-striped table-hover">
     <thead>
       <tr>
@@ -62,7 +61,7 @@
   <div ng-if="isLoading" class="spinner-container">
     <i class="fa fa-2x fa-spinner fa-spin" aria-hidden="true"></i>
   </div>
-  <div class="alert alert-info col-sm-12" ng-show="!remoteClusters.length && !isLoading">
+  <div class="alert empty-table-alert col-sm-12" ng-show="!remoteClusters.length && !isLoading">
     {{'common.alerts.noRemoteClusterDisplay' | translate}}
   </div>
   <div class="col-sm-12 table-bar">

http://git-wip-us.apache.org/repos/asf/ambari/blob/430dcbf1/ambari-admin/src/main/resources/ui/admin-web/app/views/sideNav.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/sideNav.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/sideNav.html
index 09b4cd9..97dc5d3 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/sideNav.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/sideNav.html
@@ -33,36 +33,43 @@
       </li>
     </ul>
     <ul class="nav side-nav-menu nav-pills nav-stacked">
-      <li class="mainmenu-li active">
+      <li class="mainmenu-li active" ng-show="cluster.Clusters.provisioning_state === 'INSTALLED'">
         <a title="{{'common.dashboard' | translate}}" rel="tooltip" data-placement="right" href="{{fromSiteRoot('/#/dashboard')}}" class="gotodashboard">
           <i class="navigation-icon fa fa-tachometer" aria-hidden="true"></i>
           <span class="navigation-menu-item">{{'common.dashboard' | translate}}</span>
         </a>
       </li>
-      <li class="mainmenu-li dropdown has-sub-menu" ng-show="cluster.Clusters.provisioning_state === 'INSTALLED' ">
+      <li class="mainmenu-li dropdown has-sub-menu">
         <a title="{{'common.clusterManagement' | translate}}" data-toggle="collapse-sub-menu" rel="tooltip" data-placement="right">
           <span class="toggle-icon glyphicon glyphicon-menu-down pull-right"></span>
           <i class="navigation-icon fa fa-cloud" aria-hidden="true"></i>
           <span class="navigation-menu-item">{{'common.clusterManagement' | translate}}</span>
         </a>
         <ul class="sub-menu nav nav-pills nav-stacked">
+          <li class="submenu-li" ng-class="{active: isActive('clusters.clusterInformation')}">
+            <a href="#/clusterInformation" class="clusterInformation">
+              {{'common.clusterInformation' | translate}}
+            </a>
+          </li>
           <li class="submenu-li"  ng-class="{active: isActive('stackVersions.list')}" ng-show="cluster && totalRepos > 0">
-            <a href="#/stackVersions">{{'common.clusterInformation' | translate}}</a>
+            <a href="#/stackVersions">{{'common.versions' | translate}}</a>
           </li>
           <li class="submenu-li" ng-class="{active: isActive('remoteClusters.list')}">
             <a href="#/remoteClusters">{{'common.remoteClusters' | translate}}</a>
           </li>
         </ul>
       </li>
-      <li class="mainmenu-li dropdown has-sub-menu" ng-show="cluster.Clusters.provisioning_state === 'INSTALLED' ">
+      <li class="mainmenu-li dropdown has-sub-menu">
         <a title="{{'common.userManagement' | translate}}" rel="tooltip" data-placement="right" data-toggle="collapse-sub-menu">
           <span class="toggle-icon glyphicon glyphicon-menu-down pull-right"></span>
           <i class="navigation-icon fa fa-users" aria-hidden="true"></i>
           <span class="navigation-menu-item">{{'common.userManagement' | translate}}</span>
         </a>
         <ul class="sub-menu nav nav-pills nav-stacked">
-          <li class="submenu-li" ng-class="{active: isActive('clusters.manageAccess') || isActive('clusters.userAccessList')}">
-            <a href="#/clusters/{{cluster.Clusters.cluster_name}}/manageAccess" class="roles">Roles</a>
+          <li class="submenu-li"
+              ng-class="{active: isActive('clusters.manageAccess') || isActive('clusters.userAccessList')}"
+              ng-show="cluster.Clusters.provisioning_state === 'INSTALLED'">
+            <a href="#/clusters/{{cluster.Clusters.cluster_name}}/manageAccess" class="roles">{{'common.roles' | translate}}</a>
           </li>
           <li class="submenu-li" ng-class="{active: isActive('users.list')}">
             <link-to route="users.list" class="userslist-link">{{'common.users' | translate}}</link-to>

http://git-wip-us.apache.org/repos/asf/ambari/blob/430dcbf1/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/list.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/list.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/list.html
index f6b6ee9..99f9ac0 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/list.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/list.html
@@ -27,7 +27,6 @@
       </a>
     </div>
   </div>
-  <hr/>
   <table class="table table-striped table-hover">
     <thead>
     <tr>
@@ -119,7 +118,7 @@
   <div ng-if="isLoading" class="spinner-container">
     <i class="fa fa-2x fa-spinner fa-spin" aria-hidden="true"></i>
   </div>
-  <div class="alert alert-info col-sm-12" ng-show="!repos.length && !isLoading">
+  <div class="alert empty-table-alert col-sm-12" ng-show="!repos.length && !isLoading">
     {{'common.alerts.nothingToDisplay' | translate: '{term: getConstant("common.version")}'}}
   </div>
   <div class="col-sm-12 table-bar">

http://git-wip-us.apache.org/repos/asf/ambari/blob/430dcbf1/ambari-admin/src/main/resources/ui/admin-web/app/views/users/list.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/users/list.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/users/list.html
index 7b8e12a..12227c3 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/users/list.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/users/list.html
@@ -27,7 +27,6 @@
       </link-to>
     </div>
   </div>
-  <hr>
   <table class="table table-striped table-hover">
     <thead>
       <tr>
@@ -80,7 +79,7 @@
   <div ng-if="isLoading" class="spinner-container">
     <i class="fa fa-2x fa-spinner fa-spin" aria-hidden="true"></i>
   </div>
-  <div class="alert alert-info col-sm-12" ng-show="!users.length && !isLoading">
+  <div class="alert empty-table-alert col-sm-12" ng-show="!users.length && !isLoading">
     {{'common.alerts.nothingToDisplay' | translate: '{term: constants.users}'}}
   </div>
   <div class="col-sm-12 table-bar">

http://git-wip-us.apache.org/repos/asf/ambari/blob/430dcbf1/ambari-admin/src/main/resources/ui/admin-web/test/unit/services/Utility_test.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/test/unit/services/Utility_test.js b/ambari-admin/src/main/resources/ui/admin-web/test/unit/services/Utility_test.js
index d17747b..1b76dcf 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/test/unit/services/Utility_test.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/test/unit/services/Utility_test.js
@@ -54,7 +54,7 @@ describe('Utility Service', function () {
       httpBackend.whenGET(/\/api\/v1\/views.+/).respond(200, {
         items: []
       });
-      httpBackend.whenGET("views/main.html").respond(200, {});
+      httpBackend.whenGET("views/clusterInformation.html").respond(200, {});
     });
   });
 


[30/50] [abbrv] ambari git commit: AMBARI-22450. Log Search: reference Log Feeder IDE/maven dev setup in README.md (oleewere)

Posted by am...@apache.org.
AMBARI-22450. Log Search: reference Log Feeder IDE/maven dev setup in README.md (oleewere)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 1a99da4470d3ce1d928ab56f1a4c2845f940ef53
Parents: a4e7bf3
Author: Oliver Szabo <ol...@gmail.com>
Authored: Wed Nov 15 12:54:25 2017 +0100
Committer: Oliver Szabo <ol...@gmail.com>
Committed: Wed Nov 15 16:13:53 2017 +0100

----------------------------------------------------------------------
 ambari-logsearch/README.md | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/1a99da44/ambari-logsearch/README.md
----------------------------------------------------------------------
diff --git a/ambari-logsearch/README.md b/ambari-logsearch/README.md
index 33952a2..2a124d1 100644
--- a/ambari-logsearch/README.md
+++ b/ambari-logsearch/README.md
@@ -34,6 +34,7 @@ In case if you started the containers separately and if you would like to access
 ### Run applications from IDE / maven
 
 - [Start Log Search locally](ambari-logsearch-server/README.md)
+- [Start Log Feeder locally](ambari-logsearch-logfeeder/README.md)
 
 ## Package build process
 


[06/50] [abbrv] ambari git commit: AMBARI-22386 - Patch Upgrades Broken For Clients Due To Versioned LD Library (jonathanhurley)

Posted by am...@apache.org.
AMBARI-22386 - Patch Upgrades Broken For Clients Due To Versioned LD Library (jonathanhurley)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: feccebcb9b4cf56d8ea0cc021d5250a711f37596
Parents: c693de3
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Wed Nov 8 16:20:30 2017 -0500
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Thu Nov 9 16:36:49 2017 -0500

----------------------------------------------------------------------
 .../TEZ/0.9.0.3.0/configuration/tez-site.xml    |  2 +-
 .../configuration-mapred/mapred-site.xml        |  2 +-
 .../configuration-mapred/mapred-site.xml        |  2 +-
 .../2.2/services/TEZ/configuration/tez-site.xml |  4 ++--
 .../YARN/configuration-mapred/mapred-site.xml   |  2 +-
 .../resources/stacks/HDP/2.6/repos/repoinfo.xml |  2 +-
 .../stacks/HDP/2.6/upgrades/config-upgrade.xml  | 23 ++++++++++++++++++++
 .../HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml |  9 ++++++++
 .../stacks/HDP/2.6/upgrades/upgrade-2.6.xml     |  4 ++++
 .../YARN/configuration-mapred/mapred-site.xml   |  2 +-
 10 files changed, 44 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/feccebcb/ambari-server/src/main/resources/common-services/TEZ/0.9.0.3.0/configuration/tez-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/TEZ/0.9.0.3.0/configuration/tez-site.xml b/ambari-server/src/main/resources/common-services/TEZ/0.9.0.3.0/configuration/tez-site.xml
index 5c17044..58558af 100644
--- a/ambari-server/src/main/resources/common-services/TEZ/0.9.0.3.0/configuration/tez-site.xml
+++ b/ambari-server/src/main/resources/common-services/TEZ/0.9.0.3.0/configuration/tez-site.xml
@@ -78,7 +78,7 @@
   </property>
   <property>
     <name>tez.am.launch.env</name>
-    <value>LD_LIBRARY_PATH=/usr/hdp/${hdp.version}/hadoop/lib/native:/usr/hdp/${hdp.version}/hadoop/lib/native/Linux-{{architecture}}-64</value>
+    <value>LD_LIBRARY_PATH=./tezlib/lib/native:/usr/hdp/${hdp.version}/hadoop/lib/native:/usr/hdp/${hdp.version}/hadoop/lib/native/Linux-{{architecture}}-64</value>
     <description>
         Additional execution environment entries for tez. This is not an additive property. You must preserve the original value if
         you want to have access to native libraries.

http://git-wip-us.apache.org/repos/asf/ambari/blob/feccebcb/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/configuration-mapred/mapred-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/configuration-mapred/mapred-site.xml b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/configuration-mapred/mapred-site.xml
index a7d8cd6..3438c45 100644
--- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/configuration-mapred/mapred-site.xml
+++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/configuration-mapred/mapred-site.xml
@@ -438,7 +438,7 @@
   </property>
   <property>
     <name>mapreduce.admin.user.env</name>
-    <value>LD_LIBRARY_PATH={{hadoop_lib_home}}/native/Linux-{{architecture}}-64</value>
+    <value>LD_LIBRARY_PATH=./mr-framework/hadoop/lib/native:{{hadoop_lib_home}}/native/Linux-{{architecture}}-64</value>
     <description>
       Additional execution environment entries for map and reduce task processes.
       This is not an additive property. You must preserve the original value if

http://git-wip-us.apache.org/repos/asf/ambari/blob/feccebcb/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/configuration-mapred/mapred-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/configuration-mapred/mapred-site.xml b/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/configuration-mapred/mapred-site.xml
index 705763f..882cf83 100644
--- a/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/configuration-mapred/mapred-site.xml
+++ b/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/configuration-mapred/mapred-site.xml
@@ -438,7 +438,7 @@
   </property>
   <property>
     <name>mapreduce.admin.user.env</name>
-    <value>LD_LIBRARY_PATH=/usr/lib/hadoop/lib/native:/usr/lib/hadoop/lib/native/Linux-amd64-64</value>
+    <value>LD_LIBRARY_PATH=./mr-framework/hadoop/lib/native:/usr/lib/hadoop/lib/native:/usr/lib/hadoop/lib/native/Linux-amd64-64</value>
     <description>
       Additional execution environment entries for map and reduce task processes.
       This is not an additive property. You must preserve the original value if

http://git-wip-us.apache.org/repos/asf/ambari/blob/feccebcb/ambari-server/src/main/resources/stacks/HDP/2.2/services/TEZ/configuration/tez-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/TEZ/configuration/tez-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/TEZ/configuration/tez-site.xml
index 1427a6f..4ffb7a4 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/TEZ/configuration/tez-site.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/TEZ/configuration/tez-site.xml
@@ -78,7 +78,7 @@
   </property>
   <property>
     <name>tez.am.launch.env</name>
-    <value>LD_LIBRARY_PATH=/usr/hdp/${hdp.version}/hadoop/lib/native:/usr/hdp/${hdp.version}/hadoop/lib/native/Linux-{{architecture}}-64</value>
+    <value>LD_LIBRARY_PATH=./tezlib/lib/native:/usr/hdp/${hdp.version}/hadoop/lib/native:/usr/hdp/${hdp.version}/hadoop/lib/native/Linux-{{architecture}}-64</value>
     <description>
         Additional execution environment entries for tez. This is not an additive property. You must preserve the original value if
         you want to have access to native libraries.
@@ -124,7 +124,7 @@
   </property>
   <property>
     <name>tez.task.launch.env</name>
-    <value>LD_LIBRARY_PATH=/usr/hdp/${hdp.version}/hadoop/lib/native:/usr/hdp/${hdp.version}/hadoop/lib/native/Linux-{{architecture}}-64</value>
+    <value>LD_LIBRARY_PATH=./tezlib/lib/native:/usr/hdp/${hdp.version}/hadoop/lib/native:/usr/hdp/${hdp.version}/hadoop/lib/native/Linux-{{architecture}}-64</value>
     <description>
       Additional execution environment entries for tez. This is not an additive property. You must preserve the original value if
       you want to have access to native libraries.

http://git-wip-us.apache.org/repos/asf/ambari/blob/feccebcb/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/configuration-mapred/mapred-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/configuration-mapred/mapred-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/configuration-mapred/mapred-site.xml
index 4ad08ce..084e912 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/configuration-mapred/mapred-site.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/configuration-mapred/mapred-site.xml
@@ -20,7 +20,7 @@
 <configuration xmlns:xi="http://www.w3.org/2001/XInclude" supports_final="true">
   <property>
     <name>mapreduce.admin.user.env</name>
-    <value>LD_LIBRARY_PATH=/usr/hdp/${hdp.version}/hadoop/lib/native:/usr/hdp/${hdp.version}/hadoop/lib/native/Linux-{{architecture}}-64</value>
+    <value>LD_LIBRARY_PATH=./mr-framework/hadoop/lib/native:/usr/hdp/${hdp.version}/hadoop/lib/native:/usr/hdp/${hdp.version}/hadoop/lib/native/Linux-{{architecture}}-64</value>
     <description>
       Additional execution environment entries for map and reduce task processes.
       This is not an additive property. You must preserve the original value if

http://git-wip-us.apache.org/repos/asf/ambari/blob/feccebcb/ambari-server/src/main/resources/stacks/HDP/2.6/repos/repoinfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/repos/repoinfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/repos/repoinfo.xml
index ff132aa..eb0b0ef 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.6/repos/repoinfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/repos/repoinfo.xml
@@ -33,7 +33,7 @@
   </os>
   <os family="redhat-ppc7">
     <repo>
-      <baseurl>http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.0.3</baseurl>
+      <baseurl>http://public-repo-1.hortonworks.com/HDP/centos7-ppc/2.x/updates/2.6.0.3</baseurl>
       <repoid>HDP-2.6</repoid>
       <reponame>HDP</reponame>
       <unique>true</unique>

http://git-wip-us.apache.org/repos/asf/ambari/blob/feccebcb/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/config-upgrade.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/config-upgrade.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/config-upgrade.xml
index 63624d6..45b1707 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/config-upgrade.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/config-upgrade.xml
@@ -258,5 +258,28 @@
       </component>
     </service>
 
+    <service name="TEZ">
+      <component name="TEZ_CLIENT">
+        <changes>
+          <definition xsi:type="configure" id="hdp_2_6_tez_tarball_ld_library">
+            <type>tez-site</type>
+            <set key="tez.am.launch.env" value="LD_LIBRARY_PATH=./tezlib/lib/native:/usr/hdp/${hdp.version}/hadoop/lib/native:/usr/hdp/${hdp.version}/hadoop/lib/native/Linux-{{architecture}}-64"/>
+            <set key="tez.task.launch.env" value="LD_LIBRARY_PATH=./tezlib/lib/native:/usr/hdp/${hdp.version}/hadoop/lib/native:/usr/hdp/${hdp.version}/hadoop/lib/native/Linux-{{architecture}}-64"/>
+          </definition>
+        </changes>
+      </component>
+    </service>
+
+    <service name="MAPREDUCE2">
+      <component name="MAPREDUCE2_CLIENT">
+        <changes>
+          <definition xsi:type="configure" id="hdp_2_6_mapreduce_tarball_ld_library">
+            <type>mapred-site</type>
+            <set key="mapreduce.admin.user.env" value="LD_LIBRARY_PATH=./mr-framework/hadoop/lib/native:{{hadoop_lib_home}}/native/Linux-{{architecture}}-64"/>
+          </definition>
+        </changes>
+      </component>
+    </service>
+
   </services>
 </upgrade-config-changes>

http://git-wip-us.apache.org/repos/asf/ambari/blob/feccebcb/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 c9e90a9..ae2a855 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
@@ -409,6 +409,15 @@
         </task>
       </execute-stage>
 
+      <!-- TEZ -->
+      <execute-stage service="TEZ" component="TEZ_CLIENT" title="Updating LD Library Classpath for Tarball" >
+        <task xsi:type="configure" id="hdp_2_6_tez_tarball_ld_library" supports-patch="true"/>
+      </execute-stage>
+      
+      <!-- MapR -->
+      <execute-stage service="MAPREDUCE2" component="MAPREDUCE2_CLIENT" title="Updating LD Library Classpath for Tarball">
+        <task xsi:type="configure" id="hdp_2_6_mapreduce_tarball_ld_library" supports-patch="true"/>
+      </execute-stage>
     </group>
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/feccebcb/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 176143c..37847a2 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
@@ -675,6 +675,8 @@
           <task xsi:type="server_action" class="org.apache.ambari.server.serveraction.upgrades.FixLzoCodecPath">
             <summary>Verifying LZO codec path for mapreduce</summary>
           </task>
+          
+          <task xsi:type="configure" id="hdp_2_6_mapreduce_tarball_ld_library" supports-patch="true"/>
         </pre-upgrade>
 
         <pre-downgrade copy-upgrade="true" />
@@ -757,6 +759,8 @@
           <task xsi:type="server_action" class="org.apache.ambari.server.serveraction.upgrades.FixLzoCodecPath">
             <summary>Verifying LZO codec path for Tez</summary>
           </task>
+          
+          <task xsi:type="configure" id="hdp_2_6_tez_tarball_ld_library" supports-patch="true"/>
         </pre-upgrade>
 
         <pre-downgrade copy-upgrade="true" />

http://git-wip-us.apache.org/repos/asf/ambari/blob/feccebcb/ambari-server/src/main/resources/stacks/HDP/3.0/services/YARN/configuration-mapred/mapred-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/3.0/services/YARN/configuration-mapred/mapred-site.xml b/ambari-server/src/main/resources/stacks/HDP/3.0/services/YARN/configuration-mapred/mapred-site.xml
index 6ce4d72..489754f 100644
--- a/ambari-server/src/main/resources/stacks/HDP/3.0/services/YARN/configuration-mapred/mapred-site.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/3.0/services/YARN/configuration-mapred/mapred-site.xml
@@ -31,7 +31,7 @@
   <!-- These configs were inherited from HDP 2.2 -->
   <property>
     <name>mapreduce.admin.user.env</name>
-    <value>LD_LIBRARY_PATH=/usr/hdp/${hdp.version}/hadoop/lib/native:/usr/hdp/${hdp.version}/hadoop/lib/native/Linux-{{architecture}}-64</value>
+    <value>LD_LIBRARY_PATH=./mr-framework/hadoop/lib/native:/usr/hdp/${hdp.version}/hadoop/lib/native:/usr/hdp/${hdp.version}/hadoop/lib/native/Linux-{{architecture}}-64</value>
     <description>
       Additional execution environment entries for map and reduce task processes.
       This is not an additive property. You must preserve the original value if


[17/50] [abbrv] ambari git commit: AMBARI-22390. Implement many-to-many relation between keytabs and principals (echekanskiy)

Posted by am...@apache.org.
AMBARI-22390. Implement many-to-many relation between keytabs and principals (echekanskiy)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 18e549034e893aac4ade80e49bda70604d5147f3
Parents: 6e706d4
Author: Eugene Chekanskiy <ec...@hortonworks.com>
Authored: Mon Nov 13 17:01:16 2017 +0200
Committer: Eugene Chekanskiy <ec...@hortonworks.com>
Committed: Mon Nov 13 17:01:29 2017 +0200

----------------------------------------------------------------------
 .../server/controller/KerberosHelperImpl.java   | 59 ++++++++++++++------
 .../AbstractPrepareKerberosServerAction.java    | 23 +++-----
 .../kerberos/CreatePrincipalsServerAction.java  |  6 +-
 .../kerberos/KerberosServerAction.java          | 21 +++++++
 .../stageutils/ResolvedKerberosKeytab.java      | 16 +++---
 5 files changed, 82 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/18e54903/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
index f913831..474c335 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
@@ -1546,19 +1546,21 @@ public class KerberosHelperImpl implements KerberosHelper {
                 keytabFileOwnerAccess,
                 keytabFileGroupName,
                 keytabFileGroupAccess,
-                Sets.newHashSet(Pair.of(hostId, evaluatedPrincipal)),
+                Sets.newHashSet(Pair.of(hostId, Pair.of(evaluatedPrincipal, principalType))),
                 serviceName.equalsIgnoreCase("AMBARI"),
                 componentName.equalsIgnoreCase("AMBARI_SERVER_SELF")
             );
             if (resolvedKeytabs.containsKey(keytabFilePath)) {
               ResolvedKerberosKeytab sameKeytab = resolvedKeytabs.get(keytabFilePath);
               // validating owner and group
-              String warnTemplate = "Keytab '{}' on host '{}' have different {}, originally set to '{}' and '{}:{}' has '{}', using '{}'";
+              boolean differentOwners = false;
+              String warnTemplate = "Keytab '{}' on host '{}' has different {}, originally set to '{}' and '{}:{}' has '{}', using '{}'";
               if (!resolvedKeytab.getOwnerName().equals(sameKeytab.getOwnerName())) {
                 LOG.warn(warnTemplate,
                     keytabFilePath, hostname, "owners", sameKeytab.getOwnerName(),
                     serviceName, componentName, resolvedKeytab.getOwnerName(),
                     sameKeytab.getOwnerName());
+                differentOwners = true;
               }
               if (!resolvedKeytab.getOwnerAccess().equals(sameKeytab.getOwnerAccess())) {
                 LOG.warn(warnTemplate,
@@ -1570,16 +1572,39 @@ public class KerberosHelperImpl implements KerberosHelper {
               // TODO with different owners, so make sure that keytabs are accessible through group acls
               // TODO this includes same group name and group 'r' mode
               if (!resolvedKeytab.getGroupName().equals(sameKeytab.getGroupName())) {
-                LOG.warn(warnTemplate,
-                    keytabFilePath, hostname, "groups", sameKeytab.getGroupName(),
-                    serviceName, componentName, resolvedKeytab.getGroupName(),
-                    sameKeytab.getGroupName());
+                if(differentOwners) {
+                  LOG.error(warnTemplate,
+                      keytabFilePath, hostname, "groups", sameKeytab.getGroupName(),
+                      serviceName, componentName, resolvedKeytab.getGroupName(),
+                      sameKeytab.getGroupName());
+                } else {
+                  LOG.warn(warnTemplate,
+                      keytabFilePath, hostname, "groups", sameKeytab.getGroupName(),
+                      serviceName, componentName, resolvedKeytab.getGroupName(),
+                      sameKeytab.getGroupName());
+                }
               }
               if (!resolvedKeytab.getGroupAccess().equals(sameKeytab.getGroupAccess())) {
-                LOG.warn(warnTemplate,
-                    keytabFilePath, hostname, "group access", sameKeytab.getGroupAccess(),
-                    serviceName, componentName, resolvedKeytab.getGroupAccess(),
-                    sameKeytab.getGroupAccess());
+                if(differentOwners) {
+                  if (!sameKeytab.getGroupAccess().contains("r")) {
+                    LOG.error("Keytab '{}' on host '{}' referenced by multiple identities which have different owners," +
+                        "but 'r' attribute missing for group. Make sure all users (that need this keytab) are in '{}' +" +
+                        "group and keytab can be read by this group",
+                        keytabFilePath,
+                        hostname,
+                        sameKeytab.getGroupName()
+                    );
+                  }
+                  LOG.error(warnTemplate,
+                      keytabFilePath, hostname, "group access", sameKeytab.getGroupAccess(),
+                      serviceName, componentName, resolvedKeytab.getGroupAccess(),
+                      sameKeytab.getGroupAccess());
+                } else {
+                  LOG.warn(warnTemplate,
+                      keytabFilePath, hostname, "group access", sameKeytab.getGroupAccess(),
+                      serviceName, componentName, resolvedKeytab.getGroupAccess(),
+                      sameKeytab.getGroupAccess());
+                }
               }
               // end validating
               // merge principal to keytab
@@ -1877,15 +1902,17 @@ public class KerberosHelperImpl implements KerberosHelper {
     if (kerberosKeytabDAO.find(resolvedKerberosKeytab.getFile()) == null) {
       kerberosKeytabDAO.create(resolvedKerberosKeytab.getFile());
     }
-    for (Pair<Long, String> principalPair : resolvedKerberosKeytab.getMappedPrincipals()) {
-      String principal = principalPair.getRight();
+    for (Pair<Long, Pair<String, String>> principalPair : resolvedKerberosKeytab.getMappedPrincipals()) {
+      Pair<String, String> principal = principalPair.getRight();
+      String principalName = principal.getLeft();
+      String principalType = principal.getRight();
       Long hostId = principalPair.getLeft();
-      if (!kerberosPrincipalDAO.exists(principal)) {
-        kerberosPrincipalDAO.create(principal, false);
+      if (!kerberosPrincipalDAO.exists(principalName)) {
+        kerberosPrincipalDAO.create(principalName, "service".equalsIgnoreCase(principalType));
       }
       if (hostId != null) {
-        if(!kerberosPrincipalHostDAO.exists(principal, hostId, resolvedKerberosKeytab.getFile())) {
-          kerberosPrincipalHostDAO.create(principal, hostId, resolvedKerberosKeytab.getFile());
+        if(!kerberosPrincipalHostDAO.exists(principalName, hostId, resolvedKerberosKeytab.getFile())) {
+          kerberosPrincipalHostDAO.create(principalName, hostId, resolvedKerberosKeytab.getFile());
         }
       }
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/18e54903/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/AbstractPrepareKerberosServerAction.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/AbstractPrepareKerberosServerAction.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/AbstractPrepareKerberosServerAction.java
index 1dc8ca8..4008620 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/AbstractPrepareKerberosServerAction.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/AbstractPrepareKerberosServerAction.java
@@ -196,7 +196,7 @@ public abstract class AbstractPrepareKerberosServerAction extends KerberosServer
 
               List<KerberosIdentityDescriptor> componentIdentities = Collections.singletonList(identity);
               kerberosHelper.addIdentities(kerberosIdentityDataFileWriter, componentIdentities,
-                  identityFilter, StageUtils.getHostName(), ambariServerHostID(), "AMBARI",componentName, kerberosConfigurations, currentConfigurations,
+                  identityFilter, StageUtils.getHostName(), ambariServerHostID(), "AMBARI", componentName, kerberosConfigurations, currentConfigurations,
                   resolvedKeytabs, realm);
               propertiesToIgnore = gatherPropertiesToIgnore(componentIdentities, propertiesToIgnore);
             }
@@ -236,19 +236,9 @@ public abstract class AbstractPrepareKerberosServerAction extends KerberosServer
   protected Map<String, ? extends Collection<String>> getServiceComponentFilter() {
     String serializedValue = getCommandParameterValue(SERVICE_COMPONENT_FILTER);
 
-    if(serializedValue != null) {
-      Type type = new TypeToken<Map<String, ? extends Collection<String>>>() {}.getType();
-      return StageUtils.getGson().fromJson(serializedValue, type);
-    } else {
-      return null;
-    }
-  }
-
-  protected Set<String> getHostFilter() {
-    String serializedValue = getCommandParameterValue(HOST_FILTER);
-
-    if(serializedValue != null) {
-      Type type = new TypeToken<Set<String>>() {}.getType();
+    if (serializedValue != null) {
+      Type type = new TypeToken<Map<String, ? extends Collection<String>>>() {
+      }.getType();
       return StageUtils.getGson().fromJson(serializedValue, type);
     } else {
       return null;
@@ -258,8 +248,9 @@ public abstract class AbstractPrepareKerberosServerAction extends KerberosServer
   protected Collection<String> getIdentityFilter() {
     String serializedValue = getCommandParameterValue(IDENTITY_FILTER);
 
-    if(serializedValue != null) {
-      Type type = new TypeToken<Collection<String>>() {}.getType();
+    if (serializedValue != null) {
+      Type type = new TypeToken<Collection<String>>() {
+      }.getType();
       return StageUtils.getGson().fromJson(serializedValue, type);
     } else {
       return null;

http://git-wip-us.apache.org/repos/asf/ambari/blob/18e54903/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/CreatePrincipalsServerAction.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/CreatePrincipalsServerAction.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/CreatePrincipalsServerAction.java
index 59d5327..0c90659 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/CreatePrincipalsServerAction.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/CreatePrincipalsServerAction.java
@@ -135,10 +135,11 @@ public class CreatePrincipalsServerAction extends KerberosServerAction {
       KerberosPrincipalEntity kerberosPrincipalEntity = kerberosPrincipalDAO.find(evaluatedPrincipal);
 
       boolean regenerateKeytabs = getOperationType(getCommandParameters()) == OperationType.RECREATE_ALL;
-
+      boolean servicePrincipal = "service".equalsIgnoreCase(identityRecord.get(KerberosIdentityDataFileReader.PRINCIPAL_TYPE));
       if (regenerateKeytabs) {
         // force recreation of principal due to keytab regeneration
-        processPrincipal = true;
+        // regenerate only service principals if request filtered by hosts
+        processPrincipal = !hasHostFilters() || servicePrincipal;
       } else if (kerberosPrincipalEntity == null) {
         // This principal has not been processed before, process it.
         processPrincipal = true;
@@ -156,7 +157,6 @@ public class CreatePrincipalsServerAction extends KerberosServerAction {
         String password = principalPasswordMap.get(evaluatedPrincipal);
 
         if (password == null) {
-          boolean servicePrincipal = "service".equalsIgnoreCase(identityRecord.get(KerberosIdentityDataFileReader.PRINCIPAL_TYPE));
           CreatePrincipalResult result = createPrincipal(evaluatedPrincipal, servicePrincipal, kerberosConfiguration, operationHandler, regenerateKeytabs, actionLog);
           if (result == null) {
             commandReport = createCommandReport(1, HostRoleStatus.FAILED, "{}", actionLog.getStdOut(), actionLog.getStdErr());

http://git-wip-us.apache.org/repos/asf/ambari/blob/18e54903/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KerberosServerAction.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KerberosServerAction.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KerberosServerAction.java
index 3491f18..ff5f5ce 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KerberosServerAction.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KerberosServerAction.java
@@ -22,8 +22,10 @@ import static org.apache.ambari.server.serveraction.kerberos.KerberosIdentityDat
 
 import java.io.File;
 import java.io.IOException;
+import java.lang.reflect.Type;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Set;
 
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.actionmanager.HostRoleStatus;
@@ -42,6 +44,7 @@ import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.reflect.TypeToken;
 import com.google.inject.Inject;
 
 /**
@@ -579,6 +582,24 @@ public abstract class KerberosServerAction extends AbstractServerAction {
     }
   }
 
+
+  protected Set<String> getHostFilter() {
+    String serializedValue = getCommandParameterValue(HOST_FILTER);
+
+    if (serializedValue != null) {
+      Type type = new TypeToken<Set<String>>() {
+      }.getType();
+      return StageUtils.getGson().fromJson(serializedValue, type);
+    } else {
+      return null;
+    }
+  }
+
+  protected boolean hasHostFilters() {
+    Set<String> hostFilers = getHostFilter();
+    return hostFilers != null && hostFilers.size() > 0;
+  }
+
   protected Long ambariServerHostID(){
     String ambariServerHostName = StageUtils.getHostName();
     HostEntity ambariServerHostEntity = hostDAO.findByName(ambariServerHostName);

http://git-wip-us.apache.org/repos/asf/ambari/blob/18e54903/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/stageutils/ResolvedKerberosKeytab.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/stageutils/ResolvedKerberosKeytab.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/stageutils/ResolvedKerberosKeytab.java
index f66d273..17e484a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/stageutils/ResolvedKerberosKeytab.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/stageutils/ResolvedKerberosKeytab.java
@@ -40,7 +40,7 @@ public class ResolvedKerberosKeytab {
   private String groupName = null;
   private String groupAccess = null;
   private String file = null;
-  private Set<Pair<Long, String>> mappedPrincipals = null;
+  private Set<Pair<Long, Pair<String, String>>> mappedPrincipals = null;
   private boolean isAmbariServerKeytab = false;
   private boolean mustWriteAmbariJaasFile = false;
 
@@ -50,7 +50,7 @@ public class ResolvedKerberosKeytab {
       String ownerAccess,
       String groupName,
       String groupAccess,
-      Set<Pair<Long, String>> mappedPrincipals,
+      Set<Pair<Long, Pair<String, String>>> mappedPrincipals,
       boolean isAmbariServerKeytab,
       boolean writeAmbariJaasFile
   ) {
@@ -177,7 +177,7 @@ public class ResolvedKerberosKeytab {
    *
    * @return a Set with mappedPrincipals associated with given keytab
    */
-  public Set<Pair<Long, String>> getMappedPrincipals() {
+  public Set<Pair<Long, Pair<String, String>>> getMappedPrincipals() {
     return mappedPrincipals;
   }
 
@@ -186,7 +186,7 @@ public class ResolvedKerberosKeytab {
    *
    * @param mappedPrincipals a Map with host-to-principal mapping associated with given keytab
    */
-  public void setMappedPrincipals(Set<Pair<Long, String>> mappedPrincipals) {
+  public void setMappedPrincipals(Set<Pair<Long, Pair<String, String>>> mappedPrincipals) {
     this.mappedPrincipals = mappedPrincipals;
   }
 
@@ -197,7 +197,7 @@ public class ResolvedKerberosKeytab {
    */
   public Set<Long> getHosts() {
     ImmutableSet.Builder<Long> builder = ImmutableSet.builder();
-    for (Pair<Long, String> principal : getMappedPrincipals()) {
+    for (Pair<Long, Pair<String, String>> principal : getMappedPrincipals()) {
       if (principal.getLeft() != null) {
         builder.add(principal.getLeft());
       }
@@ -210,9 +210,9 @@ public class ResolvedKerberosKeytab {
    *
    * @return a Set of principals
    */
-  public Set<String> getPrincipals() {
-    ImmutableSet.Builder<String> builder = ImmutableSet.builder();
-    for (Pair<Long, String> principal : getMappedPrincipals()) {
+  public Set<Pair<String, String>> getPrincipals() {
+    ImmutableSet.Builder<Pair<String, String>> builder = ImmutableSet.builder();
+    for (Pair<Long, Pair<String, String>> principal : getMappedPrincipals()) {
       builder.add(principal.getRight());
     }
     return builder.build();


[25/50] [abbrv] ambari git commit: AMBARI-22438 Disable plugins for yum on yum list command (dgrinenko)

Posted by am...@apache.org.
AMBARI-22438 Disable plugins for yum on yum list command (dgrinenko)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 3297dfa6542f9cffef2ae36ef0e777fe4c3e829c
Parents: ed7e121
Author: Dmytro Grinenko <ha...@apache.org>
Authored: Tue Nov 14 20:12:47 2017 +0200
Committer: Dmytro Grinenko <ha...@apache.org>
Committed: Tue Nov 14 20:12:47 2017 +0200

----------------------------------------------------------------------
 .../python/resource_management/core/providers/package/yumrpm.py  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/3297dfa6/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 9117510..8426479 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
@@ -46,8 +46,8 @@ REMOVE_WITHOUT_DEPENDENCIES_CMD = ['rpm', '-e', '--nodeps']
 
 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"]
-ALL_AVAILABLE_PACKAGES_CMD = [AMBARI_SUDO_BINARY, "yum", "list", "available"]
+ALL_INSTALLED_PACKAGES_CMD = [AMBARI_SUDO_BINARY, "yum", "list", "installed", "--noplugins"]
+ALL_AVAILABLE_PACKAGES_CMD = [AMBARI_SUDO_BINARY, "yum", "list", "available", "--noplugins"]
 VERIFY_DEPENDENCY_CMD = ['/usr/bin/yum', '-d', '0', '-e', '0', 'check', 'dependencies']
 
 # base command output sample:


[46/50] [abbrv] ambari git commit: AMBARI-22449. Improved service/component dependency support (amagyar)

Posted by am...@apache.org.
AMBARI-22449. Improved service/component dependency support (amagyar)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 97cea11f3d378fa4f53de9d2b403bb384b0698b9
Parents: 6fedb9f
Author: Attila Magyar <am...@hortonworks.com>
Authored: Thu Nov 16 12:27:13 2017 +0100
Committer: Attila Magyar <am...@hortonworks.com>
Committed: Wed Nov 22 10:55:11 2017 +0100

----------------------------------------------------------------------
 .../app/controllers/wizard/step4_controller.js  | 115 ++++++++++---------
 ambari-web/app/messages.js                      |   3 +-
 ambari-web/app/models/stack_service.js          |  82 +++++++++++++
 .../test/controllers/wizard/step4_test.js       |  16 +--
 4 files changed, 155 insertions(+), 61 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/97cea11f/ambari-web/app/controllers/wizard/step4_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step4_controller.js b/ambari-web/app/controllers/wizard/step4_controller.js
index d82bf34..d39164b 100644
--- a/ambari-web/app/controllers/wizard/step4_controller.js
+++ b/ambari-web/app/controllers/wizard/step4_controller.js
@@ -386,61 +386,29 @@ App.WizardStep4Controller = Em.ArrayController.extend({
    */
   serviceDependencyValidation: function(callback) {
     var selectedServices = this.filterProperty('isSelected', true);
+    var availableServices = this.get('content');
     var missingDependencies = [];
-    var missingDependenciesDisplayName = [];
     selectedServices.forEach(function(service) {
-      var requiredServices = service.get('requiredServices');
-      if (!!requiredServices && requiredServices.length) {
-        requiredServices.forEach(function(_requiredService){
-          var requiredService = this.findProperty('serviceName', _requiredService);
-          if (requiredService) {
-            if(requiredService.get('isSelected') === false) {
-               if(missingDependencies.indexOf(_requiredService) === -1) {
-                 missingDependencies.push(_requiredService);
-                 missingDependenciesDisplayName.push(requiredService.get('displayNameOnSelectServicePage'));
-               }
-            }
-            else {
-               //required service is selected, remove the service error from errorObject array
-               var serviceName = requiredService.get('serviceName');
-               var serviceError = this.get('errorStack').filterProperty('id',"serviceCheck_"+serviceName);
-               if(serviceError) {
-                  this.get('errorStack').removeObject(serviceError[0]);
-               }
-            }
-          }
-        },this);
-      }
-    },this);
+      service.collectMissingDependencies(selectedServices, availableServices, missingDependencies);
+    });
+    this.cleanExistingServiceCheckErrors();
+    this.addServiceCheckErrors(missingDependencies, callback);
+  },
 
-    //create a copy of the errorStack, reset it
-    //and add the dependencies in the correct order
-    var errorStackCopy = this.get('errorStack');
-    this.set('errorStack', []);
+  cleanExistingServiceCheckErrors() {
+    var existingServiceCheckErrors = this.get('errorStack').filter(function (error) {
+      return error.id.startsWith('serviceCheck_');
+    });
+    this.get('errorStack').removeObjects(existingServiceCheckErrors);
+  },
 
-    if (missingDependencies.length > 0) {
-      for(var i = 0; i < missingDependencies.length; i++) {
-        this.addValidationError({
-          id: 'serviceCheck_' + missingDependencies[i],
-          callback: this.needToAddServicePopup,
-          callbackParams: [{serviceName: missingDependencies[i], selected: true}, 'serviceCheck', missingDependenciesDisplayName[i], callback]
-        });
-      }
-    }
-
-    //iterate through the errorStackCopy array and add to errorStack array, the error objects that have no matching entry in the errorStack 
-    //and that are not related to serviceChecks since serviceCheck errors have already been added when iterating through the missing dependencies list
-    //Only add Ranger, Ambari Metrics, Spark and file system service validation errors if they exist in the errorStackCopy array
-    var ctr = 0;
-    while(ctr < errorStackCopy.length) {
-      //no matching entry in errorStack array
-      if (!this.get('errorStack').someProperty('id', errorStackCopy[ctr].id)) {
-        //not serviceCheck error
-        if(!errorStackCopy[ctr].id.startsWith('serviceCheck_')) {
-          this.get('errorStack').push(this.createError(errorStackCopy[ctr]));
-        }
-      }
-      ctr++;
+  addServiceCheckErrors(missingDependencies, callback) {
+    for(var i = 0; i < missingDependencies.length; i++) {
+      this.addValidationError({
+        id: 'serviceCheck_' + missingDependencies[i].get('serviceName'),
+        callback: this.needToAddMissingDependency,
+        callbackParams: [missingDependencies[i], 'serviceCheck', callback]
+      });
     }
   },
 
@@ -486,7 +454,7 @@ App.WizardStep4Controller = Em.ArrayController.extend({
     return App.ModalPopup.show({
       'data-qa': 'need-add-service-confirmation-modal',
       header: Em.I18n.t('installer.step4.' + i18nSuffix + '.popup.header').format(serviceName),
-      body: Em.I18n.t('installer.step4.' + i18nSuffix + '.popup.body').format(serviceName),
+      body: Em.I18n.t('installer.step4.' + i18nSuffix + '.popup.body').format(serviceName, serviceName),
       onPrimary: function () {
         Em.makeArray(services).forEach(function (service) {
           self.findProperty('serviceName', service.serviceName).set('isSelected', service.selected);
@@ -509,6 +477,49 @@ App.WizardStep4Controller = Em.ArrayController.extend({
     });
   },
 
+  needToAddMissingDependency: function (missingDependency, i18nSuffix, callback, id) {
+    var self = this;
+    var displayName = missingDependency.get('displayName');
+    if (missingDependency.hasMultipleOptions()) {
+      return this.showDependencyPopup(
+        id,
+        Em.I18n.t('installer.step4.' + i18nSuffix + '.popup.header').format(displayName),
+        Em.I18n.t('installer.step4.' + i18nSuffix + '.popup.body2').format(displayName, missingDependency.displayOptions()),
+        callback
+      );
+    } else {
+      return this.showDependencyPopup(
+        id,
+        Em.I18n.t('installer.step4.' + i18nSuffix + '.popup.header').format(displayName),
+        Em.I18n.t('installer.step4.' + i18nSuffix + '.popup.body').format(displayName, missingDependency.get('serviceName')),
+        callback,
+        function () {
+          missingDependency.selectFirstCompatible();
+          self.onPrimaryPopupCallback(callback, id);
+          this.hide();
+        }
+      );
+    }
+  },
+
+  showDependencyPopup: function(id, header, body, callback, primaryAction) {
+    return App.ModalPopup.show({
+        'data-qa': 'need-add-service-confirmation-modal',
+        header: header,
+        body: body,
+        onPrimary: primaryAction || function() { this.onClose(); },
+        onSecondary: function() {
+          this.onClose();
+        },
+        onClose: function() {
+          if (callback) {
+            callback(id);
+          }
+          this._super();
+        }
+      });
+  },
+
   /**
    * Show popup with info about not selected service
    * @param {function} callback

http://git-wip-us.apache.org/repos/asf/ambari/blob/97cea11f/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 390f803..1afb6fe 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -879,7 +879,8 @@ Em.I18n.translations = {
   'installer.step4.multipleDFS.popup.header':'Multiple File Systems Selected',
   'installer.step4.multipleDFS.popup.body':'You selected more than one file system. We will automatically select only {0}. Is this OK?',
   'installer.step4.serviceCheck.popup.header':'{0} Needed',
-  'installer.step4.serviceCheck.popup.body':'You did not select {0}, but it is needed by other services you selected. We will automatically add {0}. Is this OK?',
+  'installer.step4.serviceCheck.popup.body':'You did not select {0}, but it is needed by other services you selected. We will automatically add {1}. Is this OK?',
+  'installer.step4.serviceCheck.popup.body2':'You did not select {0}, but it is needed by other services you selected. Select a compatible service from the following list: {1}',
   'installer.step4.limitedFunctionality.popup.header':'Limited Functionality Warning',
   'installer.step4.ambariMetricsCheck.popup.body':'Ambari Metrics collects metrics from the cluster and makes them available to Ambari.  If you do not install Ambari Metrics service, metrics will not be accessible from Ambari.  Are you sure you want to proceed without Ambari Metrics?',
   'installer.step4.ambariInfraCheck.popup.body':'Since Ambari Infra is not selected, you must supply your own Solr to make Atlas work. Are you sure you want to proceed?',

http://git-wip-us.apache.org/repos/asf/ambari/blob/97cea11f/ambari-web/app/models/stack_service.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/stack_service.js b/ambari-web/app/models/stack_service.js
index 241f6ab..46dfee5 100644
--- a/ambari-web/app/models/stack_service.js
+++ b/ambari-web/app/models/stack_service.js
@@ -21,6 +21,56 @@ var stringUtils = require('utils/string_utils');
 require('utils/helper');
 require('models/configs/objects/service_config_category');
 
+var Dependency = Ember.Object.extend({
+  name: Ember.computed('service', function() {
+    return this.get('service').get('serviceName');
+  }),
+
+  displayName: Ember.computed('service', function() {
+    return this.get('service').get('displayNameOnSelectServicePage');
+  }),
+
+  compatibleServices: function(services) {
+    return services.filterProperty('serviceName', this.get('name'));
+  },
+
+  isMissing: function(selectedServices) {
+    return Em.isEmpty(this.compatibleServices(selectedServices));
+  }
+});
+
+var HcfsDependency = Dependency.extend({
+  displayName: Ember.computed('service', function() {
+    return 'a Hadoop Compatible File System';
+  }),
+
+  compatibleServices: function(services) {
+    return services.filterProperty("isDFS", true);
+  }
+});
+
+Dependency.reopenClass({
+  fromService: function(service) {
+    return service.get('isDFS')
+      ? HcfsDependency.create({service: service})
+      : Dependency.create({service: service});
+  }
+});
+
+var MissingDependency = Ember.Object.extend({
+  hasMultipleOptions: function() {
+    return this.get('compatibleServices').length > 1;
+  },
+
+  selectFirstCompatible: function() {
+    this.get('compatibleServices')[0].set('isSelected', true);
+  },
+
+  displayOptions: function() {
+    return this.get('compatibleServices').mapProperty('serviceName').join(', ');
+  }
+});
+
 /**
  * This model loads all services supported by the stack
  * The model maps to the  http://hostname:8080/api/v1/stacks/HDP/versions/${versionNumber}/services?fields=StackServices/*,serviceComponents/*
@@ -71,6 +121,38 @@ App.StackService = DS.Model.extend({
    */
   dependentServiceNames: DS.attr('array', {defaultValue: []}),
 
+  dependencies: function(availableServices) {
+    return this.get('requiredServices')
+      .map(function (serviceName) { return availableServices.findProperty('serviceName', serviceName)})
+      .filter(function (each) { return !!each })
+      .map(function (service) { return Dependency.fromService(service); });
+  },
+
+  /**
+   * Add dependencies which are not already included in selectedServices to the given missingDependencies collection
+  */
+  collectMissingDependencies: function(selectedServices, availableServices, missingDependencies) {
+    this._missingDependencies(selectedServices, availableServices).forEach(function (dependency) {
+      this._addMissingDependency(dependency, availableServices, missingDependencies);
+    }.bind(this));
+  },
+
+  _missingDependencies: function(selectedServices, availableServices) {
+    return this.dependencies(availableServices).filter(function(dependency) {
+      return dependency.isMissing(selectedServices);
+    });
+  },
+
+  _addMissingDependency: function(dependency, availableServices, missingDependencies) {
+    if(!missingDependencies.some(function(each) { return each.get('serviceName') == dependency.get('name'); })) {
+      missingDependencies.push(MissingDependency.create({
+         serviceName: dependency.get('name'),
+         displayName: dependency.get('displayName'),
+         compatibleServices: dependency.compatibleServices(availableServices)
+      }));
+    }
+  },
+
   // Is the service a distributed filesystem
   isDFS: function () {
     return this.get('serviceType') === 'HCFS' || ['HDFS', 'GLUSTERFS'].contains(this.get('serviceName'));

http://git-wip-us.apache.org/repos/asf/ambari/blob/97cea11f/ambari-web/test/controllers/wizard/step4_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step4_test.js b/ambari-web/test/controllers/wizard/step4_test.js
index 0fad0c1..1cd4863 100644
--- a/ambari-web/test/controllers/wizard/step4_test.js
+++ b/ambari-web/test/controllers/wizard/step4_test.js
@@ -32,7 +32,7 @@ describe('App.WizardStep4Controller', function () {
   beforeEach(function() {
     controller = App.WizardStep4Controller.create();
     services.forEach(function(serviceName) {
-      controller.pushObject(Ember.Object.create({
+      controller.pushObject(App.StackService.createRecord({
         'serviceName':serviceName, 'isSelected': true, 'isHiddenOnSelectServicePage': false, 'isInstalled': false, 'isDisabled': 'HDFS' === serviceName, isDFS: 'HDFS' === serviceName
       }));
     });
@@ -43,7 +43,7 @@ describe('App.WizardStep4Controller', function () {
     modelSetup.setupStackServiceComponent();
     if (selectedServiceNames.contains('GLUSTERFS')) allServices.push('GLUSTERFS');
     allServices = allServices.map(function(serviceName) {
-      return [Ember.Object.create({
+      return [App.StackService.createRecord({
         'serviceName': serviceName,
         'isSelected': false,
         'canBeSelected': true,
@@ -51,7 +51,7 @@ describe('App.WizardStep4Controller', function () {
         isPrimaryDFS: serviceName === 'HDFS',
         isDFS: ['HDFS','GLUSTERFS'].contains(serviceName),
         isMonitoringService: ['GANGLIA'].contains(serviceName),
-        requiredServices: App.StackService.find(serviceName).get('requiredServices'),
+        requiredServices: App.StackService.find(serviceName).get('requiredServices') || [],
         displayNameOnSelectServicePage: App.format.role(serviceName, true),
         coSelectedServices: function() {
           return App.StackService.coSelected[this.get('serviceName')] || [];
@@ -167,7 +167,7 @@ describe('App.WizardStep4Controller', function () {
         beforeEach(function () {
           controller.clear();
           Object.keys(testCase.condition).forEach(function (id) {
-            controller.pushObject(Ember.Object.create({
+            controller.pushObject(App.StackService.createRecord({
               serviceName: id,
               isSelected: testCase.condition[id],
               canBeSelected: true,
@@ -1006,7 +1006,7 @@ describe('App.WizardStep4Controller', function () {
     });
 
     it('serviceValidation should not be called when service not selected', function() {
-      controller.pushObject(Em.Object.create({
+      controller.pushObject(App.StackService.createRecord({
         serviceName: 'S1',
         isSelected: false
       }));
@@ -1016,7 +1016,7 @@ describe('App.WizardStep4Controller', function () {
 
     it('serviceValidation should not be called when dependent service does not exist', function() {
       controller.pushObjects([
-        Em.Object.create({
+        App.StackService.createRecord({
           serviceName: 'S1',
           isSelected: true
         })
@@ -1027,7 +1027,7 @@ describe('App.WizardStep4Controller', function () {
 
     it('serviceValidation should not be called when dependent service is selected', function() {
       controller.pushObjects([
-        Em.Object.create({
+        App.StackService.createRecord({
           serviceName: 'S1',
           isSelected: true
         }),
@@ -1042,7 +1042,7 @@ describe('App.WizardStep4Controller', function () {
 
     it('serviceValidation should be called when dependent service is not selected', function() {
       controller.pushObjects([
-        Em.Object.create({
+        App.StackService.createRecord({
           serviceName: 'S1',
           isSelected: true
         }),


[45/50] [abbrv] ambari git commit: AMBARI-22319. Allow the same config type to belong to multiple services (amagyar)

Posted by am...@apache.org.
AMBARI-22319. Allow the same config type to belong to multiple services (amagyar)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 6f354930ddd05795019694518a342f1d30090d11
Parents: b8f75de
Author: Attila Magyar <am...@hortonworks.com>
Authored: Mon Oct 30 11:34:27 2017 +0100
Committer: Attila Magyar <am...@hortonworks.com>
Committed: Wed Nov 22 10:55:11 2017 +0100

----------------------------------------------------------------------
 .../AmbariManagementControllerImpl.java         |  8 +-
 .../server/controller/internal/Stack.java       | 14 ++++
 .../ambari/server/state/ConfigHelper.java       |  2 +-
 .../server/state/cluster/ClusterImpl.java       | 79 +++++++-------------
 .../ambari/server/topology/AmbariContext.java   |  7 +-
 .../server/state/cluster/ClusterTest.java       |  4 +
 .../server/topology/AmbariContextTest.java      |  5 +-
 7 files changed, 58 insertions(+), 61 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6f354930/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 4c00f1f..1fd410f 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
@@ -797,14 +797,8 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
 
     // If the config type is for a service, then allow a user with SERVICE_MODIFY_CONFIGS to
     // update, else ensure the user has CLUSTER_MODIFY_CONFIGS
-    String service = null;
+    String service = cluster.getServiceByConfigType(configType);
 
-    try {
-      service = cluster.getServiceForConfigTypes(Collections.singleton(configType));
-    } catch (IllegalArgumentException e) {
-      // Ignore this since we may have hit a config type that spans multiple services. This may
-      // happen in unit test cases but should not happen with later versions of stacks.
-    }
 
     // Get the changes so that the user's intention can be determined. For example, maybe
     // the user wants to change the run-as user for a service or maybe the the cluster-wide

http://git-wip-us.apache.org/repos/asf/ambari/blob/6f354930/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/Stack.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/Stack.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/Stack.java
index f8feef2..912d9be 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/Stack.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/Stack.java
@@ -18,10 +18,12 @@
 
 package org.apache.ambari.server.controller.internal;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
@@ -494,6 +496,18 @@ public class Stack {
         "Specified configuration type is not associated with any service: " + config);
   }
 
+  public List<String> getServicesForConfigType(String config) {
+    List<String> serviceNames = new ArrayList<>();
+    for (Map.Entry<String, Map<String, Map<String, ConfigProperty>>> entry : serviceConfigurations.entrySet()) {
+      Map<String, Map<String, ConfigProperty>> typeMap = entry.getValue();
+      String serviceName = entry.getKey();
+      if (typeMap.containsKey(config) && !getExcludedConfigurationTypes(serviceName).contains(config)) {
+        serviceNames.add(serviceName);
+      }
+    }
+    return serviceNames;
+  }
+
   /**
    * Return the dependencies specified for the given component.
    *

http://git-wip-us.apache.org/repos/asf/ambari/blob/6f354930/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
index eade914..edeb4b7 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
@@ -1123,7 +1123,7 @@ public class ConfigHelper {
 
       if (null != baseConfig) {
         try {
-          String service = cluster.getServiceForConfigTypes(Collections.singleton(type));
+          String service = cluster.getServiceByConfigType(type);
           if (!serviceMapped.containsKey(service)) {
             serviceMapped.put(service, new HashSet<>());
           }

http://git-wip-us.apache.org/repos/asf/ambari/blob/6f354930/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
index 8f5e4f4..e6d42ce 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
@@ -18,6 +18,8 @@
 
 package org.apache.ambari.server.state.cluster;
 
+import static java.util.stream.Collectors.toList;
+
 import java.text.MessageFormat;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -29,13 +31,13 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
+import java.util.Objects;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.ConcurrentSkipListMap;
 import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.locks.ReadWriteLock;
-import java.util.stream.Collectors;
 
 import javax.annotation.Nullable;
 import javax.persistence.EntityManager;
@@ -1135,7 +1137,7 @@ public class ClusterImpl implements Cluster {
     return clusterDAO.getLatestConfigurationsWithTypes(clusterId, getDesiredStackVersion(), types)
       .stream()
       .map(clusterConfigEntity -> configFactory.createExisting(this, clusterConfigEntity))
-      .collect(Collectors.toList());
+      .collect(toList());
   }
 
   @Override
@@ -1571,37 +1573,35 @@ public class ClusterImpl implements Cluster {
 
   @Override
   public String getServiceForConfigTypes(Collection<String> configTypes) {
-    //debug
-    LOG.info("Looking for service for config types {}", configTypes);
-    String serviceName = null;
-    for (String configType : configTypes) {
-      for (Entry<String, String> entry : serviceConfigTypes.entries()) {
-        if (StringUtils.equals(entry.getValue(), configType)) {
-          if (serviceName != null) {
-            if (entry.getKey()!=null && !StringUtils.equals(serviceName, entry.getKey())) {
-              throw new IllegalArgumentException(String.format("Config type %s belongs to %s service, " +
-                "but also qualified for %s", configType, serviceName, entry.getKey()));
-            }
-          } else {
-            serviceName = entry.getKey();
-          }
-        }
-      }
+    List<String> serviceNames = configTypes.stream()
+      .map(this::getServiceByConfigType)
+      .filter(Objects::nonNull)
+      .collect(toList());
+    boolean allTheSame = new HashSet<>(serviceNames).size() <= 1;
+    if (!allTheSame) {
+      throw new IllegalArgumentException(String.format(
+        "Config types: %s should belong to a single installed service. But they belong to: %s", configTypes, serviceNames));
     }
-    LOG.info("Service {} returning", serviceName);
-    return serviceName;
+    return serviceNames.isEmpty() ? null : serviceNames.get(0);
+  }
+
+  public List<String> serviceNameByConfigType(String configType) {
+    return serviceConfigTypes.entries().stream()
+      .filter(entry -> StringUtils.equals(entry.getValue(), configType))
+      .map(entry -> entry.getKey())
+      .collect(toList());
   }
 
   @Override
   public String getServiceByConfigType(String configType) {
-    for (Entry<String, String> entry : serviceConfigTypes.entries()) {
-      String serviceName = entry.getKey();
-      String type = entry.getValue();
-      if (StringUtils.equals(type, configType)) {
-        return serviceName;
-      }
-    }
-    return null;
+    return serviceNameByConfigType(configType).stream()
+      .filter(this::isServiceInstalled)
+      .findFirst()
+      .orElse(null);
+  }
+
+  private boolean isServiceInstalled(String serviceName) {
+    return services.get(serviceName) != null;
   }
 
   @Override
@@ -1884,28 +1884,7 @@ public class ClusterImpl implements Cluster {
 
   @Transactional
   ServiceConfigVersionResponse applyConfigs(Set<Config> configs, String user, String serviceConfigVersionNote) {
-
-    String serviceName = null;
-    for (Config config : configs) {
-      for (Entry<String, String> entry : serviceConfigTypes.entries()) {
-        if (StringUtils.equals(entry.getValue(), config.getType())) {
-          if (serviceName == null) {
-            serviceName = entry.getKey();
-            break;
-          } else if (!serviceName.equals(entry.getKey())) {
-            String error = String.format("Updating configs for multiple services by a " +
-                "single API request isn't supported. Conflicting services %s and %s for %s",
-                                         serviceName, entry.getKey(), config.getType());
-            IllegalArgumentException exception = new IllegalArgumentException(error);
-            LOG.error(error + ", config version not created for {}", serviceName);
-            throw exception;
-          } else {
-            break;
-          }
-        }
-      }
-    }
-
+    String serviceName = getServiceForConfigTypes(configs.stream().map(Config::getType).collect(toList()));
     // update the selected flag for every config type
     ClusterEntity clusterEntity = getClusterEntity();
     Collection<ClusterConfigEntity> clusterConfigs = clusterEntity.getClusterConfigEntities();

http://git-wip-us.apache.org/repos/asf/ambari/blob/6f354930/ambari-server/src/main/java/org/apache/ambari/server/topology/AmbariContext.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/AmbariContext.java b/ambari-server/src/main/java/org/apache/ambari/server/topology/AmbariContext.java
index eb39562..b09c778 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/topology/AmbariContext.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/AmbariContext.java
@@ -731,7 +731,12 @@ public class AmbariContext {
     // iterate over topo host group configs which were defined in
     for (Map.Entry<String, Map<String, String>> entry : userProvidedGroupProperties.entrySet()) {
       String type = entry.getKey();
-      String service = stack.getServiceForConfigType(type);
+      List<String> services = stack.getServicesForConfigType(type);
+      String service = services.stream()
+        .filter(each -> topology.getBlueprint().getServices().contains(each))
+        .findFirst()
+        .orElseThrow(() -> new IllegalArgumentException("Specified configuration type is not associated with any service: " + type));
+
       Config config = configFactory.createReadOnly(type, groupName, entry.getValue(), null);
       //todo: attributes
       Map<String, Config> serviceConfigs = groupConfigs.get(service);

http://git-wip-us.apache.org/repos/asf/ambari/blob/6f354930/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java
index 4b09c6d..8b37f72 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java
@@ -1203,6 +1203,7 @@ public class ClusterTest {
   @Test
   public void testServiceConfigVersions() throws Exception {
     createDefaultCluster();
+    c1.addService("HDFS", helper.getOrCreateRepositoryVersion(new StackId("HDP", "0.1"), "0.1"));
 
     Config config1 = configFactory.createNew(c1, "hdfs-site", "version1",
       new HashMap<String, String>() {{ put("a", "b"); }}, new HashMap<>());
@@ -1261,6 +1262,7 @@ public class ClusterTest {
   @Test
   public void testSingleServiceVersionForMultipleConfigs() throws Exception {
     createDefaultCluster();
+    c1.addService("HDFS", helper.getOrCreateRepositoryVersion(new StackId("HDP", "0.1"), "0.1"));
 
     Config config1 = configFactory.createNew(c1, "hdfs-site", "version1",
       new HashMap<String, String>() {{ put("a", "b"); }}, new HashMap<>());
@@ -1383,6 +1385,7 @@ public class ClusterTest {
   public void testAllServiceConfigVersionsWithConfigGroups() throws Exception {
     // Given
     createDefaultCluster();
+    c1.addService("HDFS", helper.getOrCreateRepositoryVersion(new StackId("HDP", "0.1"), "0.1"));
 
     Config hdfsSiteConfigV1 = configFactory.createNew(c1, "hdfs-site", "version1",
         ImmutableMap.of("p1", "v1"), ImmutableMap.of());
@@ -1442,6 +1445,7 @@ public class ClusterTest {
   public void testAllServiceConfigVersionsWithDeletedConfigGroups() throws Exception {
     // Given
     createDefaultCluster();
+    c1.addService("HDFS", helper.getOrCreateRepositoryVersion(new StackId("HDP", "0.1"), "0.1"));
 
     Config hdfsSiteConfigV1 = configFactory.createNew(c1, "hdfs-site", "version1",
         ImmutableMap.of("p1", "v1"), ImmutableMap.of());

http://git-wip-us.apache.org/repos/asf/ambari/blob/6f354930/ambari-server/src/test/java/org/apache/ambari/server/topology/AmbariContextTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/topology/AmbariContextTest.java b/ambari-server/src/test/java/org/apache/ambari/server/topology/AmbariContextTest.java
index 0deeae9..5128c65 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/topology/AmbariContextTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/topology/AmbariContextTest.java
@@ -18,6 +18,7 @@
 
 package org.apache.ambari.server.topology;
 
+import static java.util.Collections.singletonList;
 import static org.easymock.EasyMock.anyObject;
 import static org.easymock.EasyMock.capture;
 import static org.easymock.EasyMock.createMock;
@@ -215,7 +216,7 @@ public class AmbariContextTest {
     expect(repositoryVersion.getType()).andReturn(RepositoryType.STANDARD).atLeastOnce();
 
     expect(repositoryVersionDAO.findByStack(EasyMock.anyObject(StackId.class))).andReturn(
-        Collections.singletonList(repositoryVersion)).atLeastOnce();
+        singletonList(repositoryVersion)).atLeastOnce();
     replay(repositoryVersionDAO, repositoryVersion);
 
     context.configFactory = configFactory;
@@ -240,7 +241,7 @@ public class AmbariContextTest {
     expect(stack.getVersion()).andReturn(STACK_VERSION).anyTimes();
 
     for (Map.Entry<String, String> entry : configTypeServiceMapping.entrySet()) {
-      expect(stack.getServiceForConfigType(entry.getKey())).andReturn(entry.getValue()).anyTimes();
+      expect(stack.getServicesForConfigType(entry.getKey())).andReturn(singletonList(entry.getValue())).anyTimes();
     }
 
     expect(controller.getClusters()).andReturn(clusters).anyTimes();


[27/50] [abbrv] ambari git commit: Revert "AMBARI-22383. Remove Auto-Installation of LZO Libraries (ncole)"

Posted by am...@apache.org.
Revert "AMBARI-22383. Remove Auto-Installation of LZO Libraries (ncole)"

This reverts commit 5adcea78792cf227f15e7c08f5bb3fe2c48883d3.


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: ba00ed956706cc80deff58f22799ed54a8bcadd8
Parents: 869e1aa
Author: Nate Cole <nc...@hortonworks.com>
Authored: Tue Nov 14 18:39:14 2017 -0500
Committer: Nate Cole <nc...@hortonworks.com>
Committed: Tue Nov 14 18:39:14 2017 -0500

----------------------------------------------------------------------
 .../libraries/functions/__init__.py             |  1 +
 .../libraries/functions/get_lzo_packages.py     | 50 ++++++++++++++++++++
 .../libraries/functions/package_conditions.py   |  8 +++-
 .../DRUID/0.10.1/package/scripts/druid.py       |  3 +-
 .../DRUID/0.10.1/package/scripts/params.py      |  3 +-
 .../common-services/HDFS/2.1.0.2.0/metainfo.xml | 30 ++++++++++++
 .../HDFS/2.1.0.2.0/package/scripts/datanode.py  |  1 +
 .../HDFS/2.1.0.2.0/package/scripts/hdfs.py      |  7 +++
 .../2.1.0.2.0/package/scripts/hdfs_client.py    |  1 +
 .../2.1.0.2.0/package/scripts/install_params.py |  1 -
 .../2.1.0.2.0/package/scripts/journalnode.py    |  1 +
 .../HDFS/2.1.0.2.0/package/scripts/namenode.py  |  1 +
 .../common-services/HDFS/3.0.0.3.0/metainfo.xml | 30 ++++++++++++
 .../HDFS/3.0.0.3.0/package/scripts/hdfs.py      |  7 +++
 .../OOZIE/4.0.0.2.0/package/scripts/oozie.py    |  6 ++-
 .../package/scripts/oozie_server_upgrade.py     |  7 +--
 .../4.0.0.2.0/package/scripts/params_linux.py   |  1 -
 .../OOZIE/4.2.0.3.0/package/scripts/oozie.py    |  4 ++
 .../package/scripts/oozie_server_upgrade.py     |  5 --
 .../TEZ/0.4.0.2.1/package/scripts/tez_client.py | 32 +++++++++++++
 .../TEZ/0.9.0.3.0/package/scripts/tez_client.py | 26 ++++++++++
 .../custom_actions/scripts/remove_bits.py       |  2 +-
 .../BIGTOP/0.8/services/HDFS/metainfo.xml       | 16 +++++++
 .../0.8/services/HDFS/package/scripts/params.py |  6 ++-
 .../stacks/HDP/2.2/services/HDFS/metainfo.xml   | 35 ++++++++++++++
 .../2.3.GlusterFS/services/HDFS/metainfo.xml    | 10 ++++
 .../stacks/HDP/2.3/services/HDFS/metainfo.xml   | 30 ++++++++++++
 .../stacks/HDP/3.0/services/HDFS/metainfo.xml   | 30 ++++++++++++
 .../python/custom_actions/TestRemoveBits.py     |  5 +-
 29 files changed, 339 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ba00ed95/ambari-common/src/main/python/resource_management/libraries/functions/__init__.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/__init__.py b/ambari-common/src/main/python/resource_management/libraries/functions/__init__.py
index 1e388ac..f144b2d 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/__init__.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/__init__.py
@@ -39,6 +39,7 @@ from resource_management.libraries.functions.version import *
 from resource_management.libraries.functions.format_jvm_option import *
 from resource_management.libraries.functions.constants import *
 from resource_management.libraries.functions.get_stack_version import *
+from resource_management.libraries.functions.get_lzo_packages import *
 from resource_management.libraries.functions.setup_ranger_plugin import *
 from resource_management.libraries.functions.curl_krb_request import *
 from resource_management.libraries.functions.get_bare_principal import *

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba00ed95/ambari-common/src/main/python/resource_management/libraries/functions/get_lzo_packages.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/get_lzo_packages.py b/ambari-common/src/main/python/resource_management/libraries/functions/get_lzo_packages.py
new file mode 100644
index 0000000..cfbb7d8
--- /dev/null
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/get_lzo_packages.py
@@ -0,0 +1,50 @@
+#!/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.
+
+Ambari Agent
+
+"""
+__all__ = ["get_lzo_packages"]
+
+from ambari_commons.os_check import OSCheck
+from resource_management.libraries.functions.stack_features import check_stack_feature
+from resource_management.libraries.functions import StackFeature
+from resource_management.libraries.script.script import Script
+
+# TODO: Make list of lzo packages stack driven
+def get_lzo_packages(stack_version_unformatted):
+  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"]
+  elif OSCheck.is_redhat_family() or OSCheck.is_suse_family():
+    lzo_packages += ["lzo", "hadoop-lzo-native"]
+  elif OSCheck.is_ubuntu_family():
+    lzo_packages += ["liblzo2-2"]
+
+  if stack_version_unformatted and check_stack_feature(StackFeature.ROLLING_UPGRADE, stack_version_unformatted):
+    if OSCheck.is_ubuntu_family():
+      lzo_packages += [script_instance.format_package_name("hadooplzo-${stack_version}") ,
+                       script_instance.format_package_name("hadooplzo-${stack_version}-native")]
+    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

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba00ed95/ambari-common/src/main/python/resource_management/libraries/functions/package_conditions.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/package_conditions.py b/ambari-common/src/main/python/resource_management/libraries/functions/package_conditions.py
index ded63cf..31e78b9 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/package_conditions.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/package_conditions.py
@@ -19,7 +19,7 @@ limitations under the License.
 Ambari Agent
 
 """
-__all__ = ["should_install_phoenix", "should_install_ams_collector", "should_install_ams_grafana",
+__all__ = ["is_lzo_enabled", "should_install_phoenix", "should_install_ams_collector", "should_install_ams_grafana",
            "should_install_mysql", "should_install_ranger_tagsync"]
 
 import os
@@ -44,6 +44,12 @@ def _has_local_components(config, components, indicator_function = any):
 def _has_applicable_local_component(config, components):
   return _has_local_components(config, components, any)
 
+def should_install_lzo():
+  config = Script.get_config()
+  io_compression_codecs = default("/configurations/core-site/io.compression.codecs", None)
+  lzo_enabled = io_compression_codecs is not None and "com.hadoop.compression.lzo" in io_compression_codecs.lower()
+  return lzo_enabled
+
 def should_install_phoenix():
   phoenix_hosts = default('/clusterHostInfo/phoenix_query_server_hosts', [])
   phoenix_enabled = default('/configurations/hbase-env/phoenix_sql_enabled', False)

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba00ed95/ambari-server/src/main/resources/common-services/DRUID/0.10.1/package/scripts/druid.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/DRUID/0.10.1/package/scripts/druid.py b/ambari-server/src/main/resources/common-services/DRUID/0.10.1/package/scripts/druid.py
index bb872b9..ec98c3c 100644
--- a/ambari-server/src/main/resources/common-services/DRUID/0.10.1/package/scripts/druid.py
+++ b/ambari-server/src/main/resources/common-services/DRUID/0.10.1/package/scripts/druid.py
@@ -115,7 +115,8 @@ def druid(upgrade_type=None, nodeType=None):
          )
     Logger.info(format("Created druid-{node_type_lowercase} jvm.config"))
     # Handling hadoop Lzo jars if enable and node type is hadoop related eg Overlords and MMs
-    if ['middleManager', 'overlord'].__contains__(node_type_lowercase) and params.lzo_enabled:
+    if ['middleManager', 'overlord'].__contains__(node_type_lowercase) and params.lzo_enabled and len(
+            params.lzo_packages) > 0:
         try:
             Logger.info(
                 format(

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba00ed95/ambari-server/src/main/resources/common-services/DRUID/0.10.1/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/DRUID/0.10.1/package/scripts/params.py b/ambari-server/src/main/resources/common-services/DRUID/0.10.1/package/scripts/params.py
index 141250d..fd1cde6 100644
--- a/ambari-server/src/main/resources/common-services/DRUID/0.10.1/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/DRUID/0.10.1/package/scripts/params.py
@@ -18,6 +18,7 @@ limitations under the License.
 
 """
 from ambari_commons import OSCheck
+from resource_management.libraries.functions.get_lzo_packages import get_lzo_packages
 from resource_management.libraries.functions import conf_select
 from resource_management.libraries.functions import stack_select
 from resource_management.libraries.resources.hdfs_resource import HdfsResource
@@ -195,5 +196,5 @@ if has_metric_collector:
 stack_version_unformatted = str(config['hostLevelParams']['stack_version'])
 io_compression_codecs = default("/configurations/core-site/io.compression.codecs", None)
 lzo_enabled = io_compression_codecs is not None and "com.hadoop.compression.lzo" in io_compression_codecs.lower()
-
+lzo_packages = get_lzo_packages(stack_version_unformatted)
 hadoop_lib_home = stack_root + '/' + stack_version + '/hadoop/lib'

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba00ed95/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/metainfo.xml b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/metainfo.xml
index 6bbb583..9979de4 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/metainfo.xml
+++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/metainfo.xml
@@ -244,6 +244,11 @@
             <package>
               <name>hadoop</name>
             </package>
+            <package>
+              <name>hadoop-lzo</name>
+              <skipUpgrade>true</skipUpgrade>
+              <condition>should_install_lzo</condition>
+            </package>
           </packages>
         </osSpecific>
         
@@ -260,6 +265,16 @@
               <name>snappy-devel</name>
             </package>
             <package>
+              <name>lzo</name>
+              <skipUpgrade>true</skipUpgrade>
+              <condition>should_install_lzo</condition>
+            </package>
+            <package>
+              <name>hadoop-lzo-native</name>
+              <skipUpgrade>true</skipUpgrade>
+              <condition>should_install_lzo</condition>
+            </package>
+            <package>
               <name>hadoop-libhdfs</name>
             </package>
             <package>
@@ -281,6 +296,16 @@
               <name>snappy-devel</name>
             </package>
             <package>
+              <name>liblzo2-2</name>
+              <skipUpgrade>true</skipUpgrade>
+              <condition>should_install_lzo</condition>
+            </package>
+            <package>
+              <name>hadoop-lzo-native</name>
+              <skipUpgrade>true</skipUpgrade>
+              <condition>should_install_lzo</condition>
+            </package>
+            <package>
               <name>hadoop-libhdfs</name>
             </package>
           </packages>
@@ -299,6 +324,11 @@
               <name>libsnappy-dev</name>
             </package>
             <package>
+              <name>liblzo2-2</name>
+              <skipUpgrade>true</skipUpgrade>
+              <condition>should_install_lzo</condition>
+            </package>
+            <package>
               <name>hadoop-hdfs</name>
             </package>
             <package>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba00ed95/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/datanode.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/datanode.py b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/datanode.py
index a8b0f48..c0abb15 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/datanode.py
+++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/datanode.py
@@ -165,6 +165,7 @@ class DataNodeDefault(DataNode):
 @OsFamilyImpl(os_family=OSConst.WINSRV_FAMILY)
 class DataNodeWindows(DataNode):
   def install(self, env):
+    import install_params
     self.install_packages(env)
 
 if __name__ == "__main__":

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba00ed95/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs.py b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs.py
index 1d7fe53..4022986 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs.py
+++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs.py
@@ -26,6 +26,7 @@ from resource_management.core.source import Template
 from resource_management.core.resources.service import ServiceConfig
 from resource_management.libraries.resources.xml_config import XmlConfig
 
+from resource_management.libraries.functions.get_lzo_packages import get_lzo_packages
 from resource_management.core.exceptions import Fail
 from resource_management.core.logger import Logger
 from resource_management.libraries.functions.format import format
@@ -142,6 +143,12 @@ def hdfs(name=None):
        content=Template("slaves.j2")
   )
   
+  if params.lzo_enabled:
+    lzo_packages = get_lzo_packages(params.stack_version_unformatted)
+    Package(lzo_packages,
+            retry_on_repo_unavailability=params.agent_stack_retry_on_unavailability,
+            retry_count=params.agent_stack_retry_count)
+      
 def install_snappy():
   import params
   Directory([params.so_target_dir_x86, params.so_target_dir_x64],

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba00ed95/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_client.py b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_client.py
index a802e08..f2e96c3 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_client.py
+++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_client.py
@@ -70,6 +70,7 @@ class HdfsClientDefault(HdfsClient):
 @OsFamilyImpl(os_family=OSConst.WINSRV_FAMILY)
 class HdfsClientWindows(HdfsClient):
   def install(self, env):
+    import install_params
     self.install_packages(env)
     self.configure(env)
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba00ed95/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/install_params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/install_params.py b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/install_params.py
index 72850b3..235f231 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/install_params.py
+++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/install_params.py
@@ -18,7 +18,6 @@ limitations under the License.
 """
 from ambari_commons import OSCheck
 
-exclude_packages = []
 # These parameters are supposed to be referenced at installation time, before the Hadoop environment variables have been set
 if OSCheck.is_windows_family():
   exclude_packages = []

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba00ed95/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/journalnode.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/journalnode.py b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/journalnode.py
index eaa21e9..75b2eeb 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/journalnode.py
+++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/journalnode.py
@@ -116,6 +116,7 @@ class JournalNodeDefault(JournalNode):
 @OsFamilyImpl(os_family=OSConst.WINSRV_FAMILY)
 class JournalNodeWindows(JournalNode):
   def install(self, env):
+    import install_params
     self.install_packages(env)
 
   def start(self, env):

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba00ed95/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/namenode.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/namenode.py b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/namenode.py
index 5f4152d..291da05 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/namenode.py
+++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/namenode.py
@@ -327,6 +327,7 @@ class NameNodeDefault(NameNode):
 @OsFamilyImpl(os_family=OSConst.WINSRV_FAMILY)
 class NameNodeWindows(NameNode):
   def install(self, env):
+    import install_params
     self.install_packages(env)
     #TODO we need this for HA because of manual steps
     self.configure(env)

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba00ed95/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/metainfo.xml b/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/metainfo.xml
index 0c629f3..e6d1166 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/metainfo.xml
+++ b/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/metainfo.xml
@@ -270,6 +270,11 @@
             <package>
               <name>hadoop</name>
             </package>
+            <package>
+              <name>hadoop-lzo</name>
+              <skipUpgrade>true</skipUpgrade>
+              <condition>should_install_lzo</condition>
+            </package>
           </packages>
         </osSpecific>
         
@@ -286,6 +291,16 @@
               <name>snappy-devel</name>
             </package>
             <package>
+              <name>lzo</name>
+              <skipUpgrade>true</skipUpgrade>
+              <condition>should_install_lzo</condition>
+            </package>
+            <package>
+              <name>hadoop-lzo-native</name>
+              <skipUpgrade>true</skipUpgrade>
+              <condition>should_install_lzo</condition>
+            </package>
+            <package>
               <name>hadoop-libhdfs</name>
             </package>
           </packages>
@@ -304,6 +319,16 @@
               <name>snappy-devel</name>
             </package>
             <package>
+              <name>liblzo2-2</name>
+              <skipUpgrade>true</skipUpgrade>
+              <condition>should_install_lzo</condition>
+            </package>
+            <package>
+              <name>hadoop-lzo-native</name>
+              <skipUpgrade>true</skipUpgrade>
+              <condition>should_install_lzo</condition>
+            </package>
+            <package>
               <name>hadoop-libhdfs</name>
             </package>
           </packages>
@@ -322,6 +347,11 @@
               <name>libsnappy-dev</name>
             </package>
             <package>
+              <name>liblzo2-2</name>
+              <skipUpgrade>true</skipUpgrade>
+              <condition>should_install_lzo</condition>
+            </package>
+            <package>
               <name>hadoop-hdfs</name>
             </package>
             <package>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba00ed95/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/package/scripts/hdfs.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/package/scripts/hdfs.py b/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/package/scripts/hdfs.py
index 89f9a1c..4022986 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/package/scripts/hdfs.py
+++ b/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/package/scripts/hdfs.py
@@ -26,6 +26,7 @@ from resource_management.core.source import Template
 from resource_management.core.resources.service import ServiceConfig
 from resource_management.libraries.resources.xml_config import XmlConfig
 
+from resource_management.libraries.functions.get_lzo_packages import get_lzo_packages
 from resource_management.core.exceptions import Fail
 from resource_management.core.logger import Logger
 from resource_management.libraries.functions.format import format
@@ -141,6 +142,12 @@ def hdfs(name=None):
        owner=tc_owner,
        content=Template("slaves.j2")
   )
+  
+  if params.lzo_enabled:
+    lzo_packages = get_lzo_packages(params.stack_version_unformatted)
+    Package(lzo_packages,
+            retry_on_repo_unavailability=params.agent_stack_retry_on_unavailability,
+            retry_count=params.agent_stack_retry_count)
       
 def install_snappy():
   import params

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba00ed95/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
index cd94244..f215a1e 100644
--- a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
+++ b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
@@ -37,6 +37,7 @@ from resource_management.libraries.functions.copy_tarball import get_current_ver
 from resource_management.libraries.resources.xml_config import XmlConfig
 from resource_management.libraries.script.script import Script
 from resource_management.libraries.functions.security_commons import update_credential_provider_path
+from resource_management.libraries.functions.get_lzo_packages import get_lzo_packages
 from resource_management.core.resources.packaging import Package
 from resource_management.core.shell import as_user, as_sudo, call, checked_call
 from resource_management.core.exceptions import Fail
@@ -305,8 +306,11 @@ def oozie_server_specific(upgrade_type):
     Execute(format('{sudo} chown {oozie_user}:{user_group} {oozie_libext_dir}/falcon-oozie-el-extension-*.jar'),
       not_if  = no_op_test)
 
-  # just copying files is ok - we're not making assumptions about installing LZO here
   if params.lzo_enabled:
+    all_lzo_packages = get_lzo_packages(params.stack_version_unformatted)
+    Package(all_lzo_packages,
+            retry_on_repo_unavailability=params.agent_stack_retry_on_unavailability,
+            retry_count=params.agent_stack_retry_count)
     Execute(format('{sudo} cp {hadoop_lib_home}/hadoop-lzo*.jar {oozie_lib_dir}'),
       not_if  = no_op_test,
     )

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba00ed95/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 c9c07d1..23b39ef 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
@@ -61,15 +61,10 @@ class OozieUpgrade(Script):
     # <stack-selector-tool> set hadoop-client has not run yet, therefore we cannot use
     # <stack-root>/current/hadoop-client ; we must use params.version directly
     # however, this only works when upgrading beyond 2.2.0.0; don't do this
-    # for downgrade to 2.2.0.0 since hadoop-lzo will not be present.
-    #
+    # for downgrade to 2.2.0.0 since hadoop-lzo will not be present
     # This can also be called during a Downgrade.
-    #
     # When a version is Installed, it is responsible for downloading the hadoop-lzo packages
     # if lzo is enabled.
-    #
-    # This block is just copying around files - there is no assumption about installation
-    #
     if params.lzo_enabled and (params.upgrade_direction == Direction.UPGRADE or target_version_needs_compression_libraries):
       hadoop_lzo_pattern = 'hadoop-lzo*.jar'
       hadoop_client_new_lib_dir = format("{stack_root}/{version}/hadoop/lib")

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba00ed95/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params_linux.py
index 40901b6..a0f0672 100644
--- a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params_linux.py
@@ -387,4 +387,3 @@ is_webhdfs_enabled = config['configurations']['hdfs-site']['dfs.webhdfs.enabled'
 # The logic for LZO also exists in HDFS' params.py
 io_compression_codecs = default("/configurations/core-site/io.compression.codecs", None)
 lzo_enabled = io_compression_codecs is not None and "com.hadoop.compression.lzo" in io_compression_codecs.lower()
-

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba00ed95/ambari-server/src/main/resources/common-services/OOZIE/4.2.0.3.0/package/scripts/oozie.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.2.0.3.0/package/scripts/oozie.py b/ambari-server/src/main/resources/common-services/OOZIE/4.2.0.3.0/package/scripts/oozie.py
index 19912fd..0771e93 100644
--- a/ambari-server/src/main/resources/common-services/OOZIE/4.2.0.3.0/package/scripts/oozie.py
+++ b/ambari-server/src/main/resources/common-services/OOZIE/4.2.0.3.0/package/scripts/oozie.py
@@ -276,6 +276,10 @@ def oozie_server_specific():
       not_if  = no_op_test)
 
   if params.lzo_enabled:
+    all_lzo_packages = get_lzo_packages(params.stack_version_unformatted)
+    Package(all_lzo_packages,
+            retry_on_repo_unavailability=params.agent_stack_retry_on_unavailability,
+            retry_count=params.agent_stack_retry_count)
     Execute(format('{sudo} cp {hadoop_lib_home}/hadoop-lzo*.jar {oozie_lib_dir}'),
       not_if  = no_op_test,
     )

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba00ed95/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 4fc1a42..402c7cb 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
@@ -62,14 +62,9 @@ class OozieUpgrade(Script):
     # <stack-root>/current/hadoop-client ; we must use params.version directly
     # however, this only works when upgrading beyond 2.2.0.0; don't do this
     # for downgrade to 2.2.0.0 since hadoop-lzo will not be present
-    #
     # This can also be called during a Downgrade.
-    #
     # When a version is Installed, it is responsible for downloading the hadoop-lzo packages
     # if lzo is enabled.
-    #
-    # This block is just copying around files - there is no assumption about installation
-    #
     if params.lzo_enabled and (params.upgrade_direction == Direction.UPGRADE or target_version_needs_compression_libraries):
       hadoop_lzo_pattern = 'hadoop-lzo*.jar'
       hadoop_client_new_lib_dir = format("{stack_root}/{version}/hadoop/lib")

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba00ed95/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/tez_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/tez_client.py b/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/tez_client.py
index dcf3e24..ed3f5fd 100644
--- a/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/tez_client.py
+++ b/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/tez_client.py
@@ -19,15 +19,22 @@ Ambari Agent
 
 """
 import os
+import urlparse
 
 from ambari_commons import OSConst
+from ambari_commons.inet_utils import download_file
 from ambari_commons.os_family_impl import OsFamilyImpl
+from ambari_commons.os_utils import copy_file, extract_path_component
 
 from resource_management.core.exceptions import ClientComponentHasNoStatus
+from resource_management.core.source import InlineTemplate
 from resource_management.libraries.functions import stack_select
 from resource_management.libraries.functions import StackFeature
 from resource_management.libraries.functions.stack_features import check_stack_feature
+from resource_management.libraries.functions.get_stack_version import get_stack_version
 from resource_management.libraries.script.script import Script
+from resource_management.libraries.functions.default import default
+from resource_management.core.logger import Logger
 
 from tez import tez
 
@@ -89,8 +96,33 @@ class TezClientWindows(TezClient):
       self.install_packages(env)
       params.refresh_tez_state_dependent_params()
     env.set_params(params)
+    self._install_lzo_support_if_needed(params)
     self.configure(env, config_dir=params.tez_conf_dir)
 
+  def _install_lzo_support_if_needed(self, params):
+    hadoop_classpath_prefix = self._expand_hadoop_classpath_prefix(params.hadoop_classpath_prefix_template, params.config['configurations']['tez-site'])
+
+    hadoop_lzo_dest_path = extract_path_component(hadoop_classpath_prefix, "hadoop-lzo-")
+    if hadoop_lzo_dest_path:
+      hadoop_lzo_file = os.path.split(hadoop_lzo_dest_path)[1]
+
+      config = Script.get_config()
+      file_url = urlparse.urljoin(config['hostLevelParams']['jdk_location'], hadoop_lzo_file)
+      hadoop_lzo_dl_path = os.path.join(config["hostLevelParams"]["agentCacheDir"], hadoop_lzo_file)
+      download_file(file_url, hadoop_lzo_dl_path)
+      #This is for protection against configuration changes. It will infect every new destination with the lzo jar,
+      # but since the classpath points to the jar directly we're getting away with it.
+      if not os.path.exists(hadoop_lzo_dest_path):
+        copy_file(hadoop_lzo_dl_path, hadoop_lzo_dest_path)
+
+  def _expand_hadoop_classpath_prefix(self, hadoop_classpath_prefix_template, configurations):
+    import resource_management
+
+    hadoop_classpath_prefix_obj = InlineTemplate(hadoop_classpath_prefix_template, configurations_dict=configurations,
+                                                 extra_imports=[resource_management, resource_management.core,
+                                                                resource_management.core.source])
+    hadoop_classpath_prefix = hadoop_classpath_prefix_obj.get_content()
+    return hadoop_classpath_prefix
 
 if __name__ == "__main__":
   TezClient().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba00ed95/ambari-server/src/main/resources/common-services/TEZ/0.9.0.3.0/package/scripts/tez_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/TEZ/0.9.0.3.0/package/scripts/tez_client.py b/ambari-server/src/main/resources/common-services/TEZ/0.9.0.3.0/package/scripts/tez_client.py
index 0dfab4f..b42d14e 100644
--- a/ambari-server/src/main/resources/common-services/TEZ/0.9.0.3.0/package/scripts/tez_client.py
+++ b/ambari-server/src/main/resources/common-services/TEZ/0.9.0.3.0/package/scripts/tez_client.py
@@ -98,7 +98,33 @@ class TezClientWindows(TezClient):
       self.install_packages(env)
       params.refresh_tez_state_dependent_params()
     env.set_params(params)
+    self._install_lzo_support_if_needed(params)
     self.configure(env, config_dir=params.tez_conf_dir)
 
+  def _install_lzo_support_if_needed(self, params):
+    hadoop_classpath_prefix = self._expand_hadoop_classpath_prefix(params.hadoop_classpath_prefix_template, params.config['configurations']['tez-site'])
+
+    hadoop_lzo_dest_path = extract_path_component(hadoop_classpath_prefix, "hadoop-lzo-")
+    if hadoop_lzo_dest_path:
+      hadoop_lzo_file = os.path.split(hadoop_lzo_dest_path)[1]
+
+      config = Script.get_config()
+      file_url = urlparse.urljoin(config['hostLevelParams']['jdk_location'], hadoop_lzo_file)
+      hadoop_lzo_dl_path = os.path.join(config["hostLevelParams"]["agentCacheDir"], hadoop_lzo_file)
+      download_file(file_url, hadoop_lzo_dl_path)
+      #This is for protection against configuration changes. It will infect every new destination with the lzo jar,
+      # but since the classpath points to the jar directly we're getting away with it.
+      if not os.path.exists(hadoop_lzo_dest_path):
+        copy_file(hadoop_lzo_dl_path, hadoop_lzo_dest_path)
+
+  def _expand_hadoop_classpath_prefix(self, hadoop_classpath_prefix_template, configurations):
+    import resource_management
+
+    hadoop_classpath_prefix_obj = InlineTemplate(hadoop_classpath_prefix_template, configurations_dict=configurations,
+                                                 extra_imports=[resource_management, resource_management.core,
+                                                                resource_management.core.source])
+    hadoop_classpath_prefix = hadoop_classpath_prefix_obj.get_content()
+    return hadoop_classpath_prefix
+
 if __name__ == "__main__":
   TezClient().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba00ed95/ambari-server/src/main/resources/custom_actions/scripts/remove_bits.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/custom_actions/scripts/remove_bits.py b/ambari-server/src/main/resources/custom_actions/scripts/remove_bits.py
index 078cf32..0be9a34 100644
--- a/ambari-server/src/main/resources/custom_actions/scripts/remove_bits.py
+++ b/ambari-server/src/main/resources/custom_actions/scripts/remove_bits.py
@@ -43,7 +43,7 @@ class RemoveBits(Script):
     Logger.info("Attempting to remove bits for HDP 2.1")
     config = Script.get_config()
 
-    packages_to_remove = ["zookeeper", "hadoop", "hadoop-hdfs", "hadoop-libhdfs", "hadoop-yarn", "hadoop-client", "hadoop-mapreduce", "hive", "hive-hcatalog", "hive-jdbc", "hive-webhcat", "hcatalog", "webhcat-tar-hive", "webhcat-tar-pig", "oozie", "oozie-client", "pig", "sqoop", "tez" "falcon", "storm", "flume", "hbase", "phoenix"]
+    packages_to_remove = ["zookeeper", "hadoop", "hadoop-lzo", "hadoop-hdfs", "hadoop-libhdfs", "hadoop-yarn", "hadoop-client", "hadoop-mapreduce", "hive", "hive-hcatalog", "hive-jdbc", "hive-webhcat", "hcatalog", "webhcat-tar-hive", "webhcat-tar-pig", "oozie", "oozie-client", "pig", "sqoop", "tez" "falcon", "storm", "flume", "hbase", "phoenix"]
     packages_to_remove.reverse()
     Logger.info("Packages to remove: {0}".format(" ".join(packages_to_remove)))
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba00ed95/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/metainfo.xml b/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/metainfo.xml
index f473598..8500839 100644
--- a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/metainfo.xml
@@ -180,6 +180,10 @@
             <package>
               <name>hadoop</name>
             </package>
+            <package>
+              <name>hadoop-lzo</name>
+              <skipUpgrade>true</skipUpgrade>
+            </package>
           </packages>
         </osSpecific>
         
@@ -193,6 +197,14 @@
               <name>snappy-devel</name>
             </package>
             <package>
+              <name>lzo</name>
+              <skipUpgrade>true</skipUpgrade>
+            </package>
+            <package>
+              <name>hadoop-lzo-native</name>
+              <skipUpgrade>true</skipUpgrade>
+            </package>
+            <package>
               <name>hadoop-libhdfs</name>
             </package>
           </packages>
@@ -208,6 +220,10 @@
               <name>libsnappy-dev</name>
             </package>
             <package>
+              <name>liblzo2-2</name>
+              <skipUpgrade>true</skipUpgrade>
+            </package>
+            <package>
               <name>hadoop-hdfs</name>
             </package>
             <package>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba00ed95/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/package/scripts/params.py b/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/package/scripts/params.py
index f16242c..3a711c7 100644
--- a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/package/scripts/params.py
+++ b/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/package/scripts/params.py
@@ -209,7 +209,11 @@ HdfsDirectory = functools.partial(
   bin_dir = hadoop_bin_dir
 )
 
-exclude_packages = []
+io_compression_codecs = config['configurations']['core-site']['io.compression.codecs']
+if not "com.hadoop.compression.lzo" in io_compression_codecs:
+  exclude_packages = ["lzo", "hadoop-lzo", "hadoop-lzo-native", "liblzo2-2"]
+else:
+  exclude_packages = []
 name_node_params = default("/commandParams/namenode", None)
 
 #hadoop params

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba00ed95/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/metainfo.xml
index d7221b9..8c2ec8b 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/metainfo.xml
@@ -40,6 +40,19 @@
               <name>snappy-devel</name>
             </package>
             <package>
+              <name>lzo</name>
+              <skipUpgrade>true</skipUpgrade>
+              <condition>should_install_lzo</condition>
+            </package>
+            <package>
+              <name>hadooplzo_${stack_version}</name>
+              <condition>should_install_lzo</condition>
+            </package>
+            <package>
+              <name>hadooplzo_${stack_version}-native</name>
+              <condition>should_install_lzo</condition>
+            </package>
+            <package>
               <name>hadoop_${stack_version}-libhdfs</name>
             </package>
             <package>
@@ -64,6 +77,19 @@
               <name>snappy-devel</name>
             </package>
             <package>
+              <name>liblzo2-2</name>
+              <skipUpgrade>true</skipUpgrade>
+              <condition>should_install_lzo</condition>
+            </package>
+            <package>
+              <name>hadooplzo_${stack_version}</name>
+              <condition>should_install_lzo</condition>
+            </package>
+            <package>
+              <name>hadooplzo_${stack_version}-native</name>
+              <condition>should_install_lzo</condition>
+            </package>
+            <package>
               <name>hadoop_${stack_version}-libhdfs</name>
             </package>
           </packages>
@@ -97,6 +123,15 @@
               <name>libsnappy-dev</name>
             </package>
             <package>
+              <name>hadooplzo-${stack_version}</name>
+              <condition>should_install_lzo</condition>
+            </package>
+            <package>
+              <name>liblzo2-2</name>
+              <skipUpgrade>true</skipUpgrade>
+              <condition>should_install_lzo</condition>
+            </package>
+            <package>
               <name>libhdfs0-${stack_version}</name>
             </package>
           </packages>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba00ed95/ambari-server/src/main/resources/stacks/HDP/2.3.GlusterFS/services/HDFS/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.GlusterFS/services/HDFS/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.3.GlusterFS/services/HDFS/metainfo.xml
index 6a9fab61..15fe931 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3.GlusterFS/services/HDFS/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.GlusterFS/services/HDFS/metainfo.xml
@@ -36,6 +36,13 @@
               <name>snappy-devel</name>
             </package>
             <package>
+              <name>lzo</name>
+              <skipUpgrade>true</skipUpgrade>
+            </package>
+            <package>
+              <name>hadooplzo_2_3_*</name>
+            </package>
+            <package>
               <name>hadoop_2_3_*-libhdfs</name>
             </package>
           </packages>
@@ -69,6 +76,9 @@
               <name>libsnappy-dev</name>
             </package>
             <package>
+              <name>hadooplzo-2-3-.*</name>
+            </package>
+            <package>
               <name>libhdfs0-2-3-.*</name>
             </package>
           </packages>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba00ed95/ambari-server/src/main/resources/stacks/HDP/2.3/services/HDFS/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HDFS/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HDFS/metainfo.xml
index 86531cc..ccf9a4e 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HDFS/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HDFS/metainfo.xml
@@ -72,6 +72,19 @@
               <name>snappy-devel</name>
             </package>
             <package>
+              <name>lzo</name>
+              <skipUpgrade>true</skipUpgrade>
+              <condition>should_install_lzo</condition>
+            </package>
+            <package>
+              <name>hadooplzo_${stack_version}</name>
+              <condition>should_install_lzo</condition>
+            </package>
+            <package>
+              <name>hadooplzo_${stack_version}-native</name>
+              <condition>should_install_lzo</condition>
+            </package>
+            <package>
               <name>hadoop_${stack_version}-libhdfs</name>
             </package>
             <package>
@@ -96,6 +109,19 @@
               <name>snappy-devel</name>
             </package>
             <package>
+              <name>liblzo2-2</name>
+              <skipUpgrade>true</skipUpgrade>
+              <condition>should_install_lzo</condition>
+            </package>
+            <package>
+              <name>hadooplzo_${stack_version}</name>
+              <condition>should_install_lzo</condition>
+            </package>
+            <package>
+              <name>hadooplzo_${stack_version}-native</name>
+              <condition>should_install_lzo</condition>
+            </package>
+            <package>
               <name>hadoop_${stack_version}-libhdfs</name>
             </package>
           </packages>
@@ -129,6 +155,10 @@
               <name>libsnappy-dev</name>
             </package>
             <package>
+              <name>hadooplzo-${stack_version}</name>
+              <condition>should_install_lzo</condition>
+            </package>
+            <package>
               <name>libhdfs0-${stack_version}</name>
             </package>
           </packages>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba00ed95/ambari-server/src/main/resources/stacks/HDP/3.0/services/HDFS/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/3.0/services/HDFS/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/3.0/services/HDFS/metainfo.xml
index 775508e..95a5f84 100644
--- a/ambari-server/src/main/resources/stacks/HDP/3.0/services/HDFS/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/3.0/services/HDFS/metainfo.xml
@@ -50,6 +50,19 @@
               <name>snappy-devel</name>
             </package>
             <package>
+              <name>lzo</name>
+              <skipUpgrade>true</skipUpgrade>
+              <condition>should_install_lzo</condition>
+            </package>
+            <package>
+              <name>hadooplzo_${stack_version}</name>
+              <condition>should_install_lzo</condition>
+            </package>
+            <package>
+              <name>hadooplzo_${stack_version}-native</name>
+              <condition>should_install_lzo</condition>
+            </package>
+            <package>
               <name>hadoop_${stack_version}-libhdfs</name>
             </package>
           </packages>
@@ -71,6 +84,19 @@
               <name>snappy-devel</name>
             </package>
             <package>
+              <name>liblzo2-2</name>
+              <skipUpgrade>true</skipUpgrade>
+              <condition>should_install_lzo</condition>
+            </package>
+            <package>
+              <name>hadooplzo_${stack_version}</name>
+              <condition>should_install_lzo</condition>
+            </package>
+            <package>
+              <name>hadooplzo_${stack_version}-native</name>
+              <condition>should_install_lzo</condition>
+            </package>
+            <package>
               <name>hadoop_${stack_version}-libhdfs</name>
             </package>
           </packages>
@@ -104,6 +130,10 @@
               <name>libsnappy-dev</name>
             </package>
             <package>
+              <name>hadooplzo-${stack_version}</name>
+              <condition>should_install_lzo</condition>
+            </package>
+            <package>
               <name>libhdfs0-${stack_version}</name>
             </package>
           </packages>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba00ed95/ambari-server/src/test/python/custom_actions/TestRemoveBits.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/custom_actions/TestRemoveBits.py b/ambari-server/src/test/python/custom_actions/TestRemoveBits.py
index 8217ca0..6537152 100644
--- a/ambari-server/src/test/python/custom_actions/TestRemoveBits.py
+++ b/ambari-server/src/test/python/custom_actions/TestRemoveBits.py
@@ -105,10 +105,13 @@ class TestRemoveBits(RMFTestCase):
     self.assertResourceCalled('Package', 'hadoop-hdfs',
                               action = ['remove'],
                               )
+    self.assertResourceCalled('Package', 'hadoop-lzo',
+                              action = ['remove'],
+                              )
     self.assertResourceCalled('Package', 'hadoop',
                               action = ['remove'],
                               )
     self.assertResourceCalled('Package', 'zookeeper',
                               action = ['remove'],
                               )
-    self.assertNoMoreResources()
+    self.assertNoMoreResources()
\ No newline at end of file


[44/50] [abbrv] ambari git commit: AMBARI-22115. Alerts for OneFS mpack (amagyar)

Posted by am...@apache.org.
AMBARI-22115. Alerts for OneFS mpack (amagyar)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: b8f75de52e2bdeb43190052e9c56e3e72604ff4a
Parents: ae45a55
Author: Attila Magyar <am...@hortonworks.com>
Authored: Thu Oct 26 11:49:18 2017 +0200
Committer: Attila Magyar <am...@hortonworks.com>
Committed: Wed Nov 22 10:55:11 2017 +0100

----------------------------------------------------------------------
 .../server/controller/jmx/JMXMetricHolder.java  |  55 +++-
 .../ambari/server/state/alert/Reporting.java    |   9 +-
 .../controller/jmx/JMXMetricHolderTest.java     |  14 +
 .../addon-services/ONEFS/1.0.0/alerts.json      | 112 ++++++--
 .../ONEFS/1.0.0/configuration/hadoop-env.xml    |  18 ++
 .../addon-services/ONEFS/1.0.0/metainfo.xml     |   1 +
 .../addon-services/ONEFS/1.0.0/metrics.json     | 256 +++++++++++++++----
 .../ONEFS/1.0.0/package/scripts/params_linux.py |   2 +-
 .../addon-services/ONEFS/1.0.0/widgets.json     | 191 +++++++++++++-
 9 files changed, 565 insertions(+), 93 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b8f75de5/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXMetricHolder.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXMetricHolder.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXMetricHolder.java
index f6ae54f..53227e5 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXMetricHolder.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXMetricHolder.java
@@ -22,8 +22,11 @@ import static java.util.stream.Collectors.toList;
 
 import java.util.List;
 import java.util.Map;
-import java.util.Objects;
 import java.util.Optional;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.annotation.Nullable;
 
 /**
  *
@@ -61,17 +64,51 @@ public final class JMXMetricHolder {
       .collect(toList());
   }
 
-  public Optional<Object> find(String property) {
-    String propertyName = property.split("/")[0];
-    String propertyValue = property.split("/")[1];
+  public Optional<Object> find(String pattern) {
+    JmxPattern jmxPattern = JmxPattern.parse(pattern);
     return beans.stream()
-      .filter(each -> propertyName.equals(name(each)))
-      .map(each -> each.get(propertyValue))
-      .filter(Objects::nonNull)
+      .map(jmxPattern::extract)
+      .filter(Optional::isPresent)
+      .map(Optional::get)
       .findFirst();
   }
 
-  private String name(Map<String, Object> bean) {
-    return bean.containsKey(NAME_KEY) ? (String) bean.get(NAME_KEY) : null;
+  private static class JmxPattern {
+    private static final Pattern PATTERN = Pattern.compile("(.*?)\\[(\\S+?)\\]");
+    private final String beanName;
+    private final String propertyName;
+    private final @Nullable String key;
+
+    public static JmxPattern parse(String property) {
+      String beanName = property.split("/")[0];
+      String propertyName = property.split("/")[1];
+      String key = null;
+      Matcher matcher = PATTERN.matcher(propertyName);
+      if (matcher.matches()) {
+        propertyName = matcher.group(1);
+        key = matcher.group(2);
+      }
+      return new JmxPattern(beanName, propertyName, key);
+    }
+
+    private JmxPattern(String beanName, String propertyName, String key) {
+      this.beanName = beanName;
+      this.propertyName = propertyName;
+      this.key = key;
+    }
+
+    public Optional<Object> extract(Map<String, Object> bean) {
+      return beanName.equals(name(bean))
+        ? Optional.ofNullable(lookupByKey(bean.get(propertyName)))
+        : Optional.empty();
+    }
+
+    public Object lookupByKey(Object bean) {
+      return key != null && bean instanceof Map ? ((Map) bean).get(key) : bean;
+    }
+
+    private String name(Map<String, Object> bean) {
+      return bean.containsKey(NAME_KEY) ? (String) bean.get(NAME_KEY) : null;
+    }
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/b8f75de5/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
index a7e11e1..66d09a5 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
@@ -17,9 +17,8 @@
  */
 package org.apache.ambari.server.state.alert;
 
-import static org.apache.ambari.server.state.alert.Reporting.ReportingType.PERCENT;
-
 import java.text.MessageFormat;
+import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.ambari.server.alerts.Threshold;
@@ -208,7 +207,7 @@ public class Reporting {
   }
 
   public AlertState state(double value) {
-    return getThreshold().state(PERCENT == getType() ? value * 100 : value);
+    return getThreshold().state(value);
   }
 
   private Threshold getThreshold() {
@@ -216,7 +215,9 @@ public class Reporting {
   }
 
   public String formatMessage(double value, List<Object> args) {
-    return MessageFormat.format(message(value), args.toArray());
+    List<Object> copy = new ArrayList<>(args);
+    copy.add(value);
+    return MessageFormat.format(message(value), copy.toArray());
   }
 
   private String message(double value) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/b8f75de5/ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXMetricHolderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXMetricHolderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXMetricHolderTest.java
index 61d5bae..99eb961 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXMetricHolderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXMetricHolderTest.java
@@ -42,6 +42,13 @@ public class JMXMetricHolderTest {
       new HashMap<String, Object>() {{
         put("name", "bean2");
         put("value", "val2");
+      }},
+      new HashMap<String, Object>() {{
+        put("name", "nested");
+        put("value", new HashMap<String, Object>() {{
+          put("key1", "nested-val1");
+          put("key2", "nested-val2");
+        }});
       }}
     ));
   }
@@ -58,4 +65,11 @@ public class JMXMetricHolderTest {
     List<Object> result = metrics.findAll(asList("bean1/value", "bean2/value", "bean3/notfound"));
     assertThat(result, hasItems("val1", "val2"));
   }
+
+
+  @Test
+  public void testFindNestedBean() throws Exception {
+    List<Object> result = metrics.findAll(asList("nested/value[key1]", "nested/value[key2]"));
+    assertThat(result, hasItems("nested-val1", "nested-val2"));
+  }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/b8f75de5/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/alerts.json
----------------------------------------------------------------------
diff --git a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/alerts.json b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/alerts.json
index 5718721..c84a5be 100644
--- a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/alerts.json
+++ b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/alerts.json
@@ -2,10 +2,10 @@
   "ONEFS":{
     "service": [
       {
-        "name": "onefs_namenode_cpu",
-        "label": "OneFS NameNode Host CPU Utilization",
-        "description": "This host-level alert is triggered if CPU utilization of the NameNode exceeds certain warning and critical thresholds. It checks the NameNode JMX Servlet for the SystemCPULoad property. The threshold values are in percent.",
-        "interval": 1,
+        "name": "namenode_onefs_capacity_utilization",
+        "label": "OneFS Capacity Utilization",
+        "description": "This service-level alert is triggered if the OneFS capacity utilization exceeds the configured warning and critical thresholds. It checks the OneFS NameNode for the CapacityUsed and CapacityRemaining properties. The threshold values are in percent.",
+        "interval": 2,
         "scope": "HOST",
         "enabled": true,
         "source": {
@@ -20,26 +20,102 @@
           },
           "reporting": {
             "ok": {
-              "text": "{1} CPU, load {0,number,percent}"
+              "text": "Capacity Used:[{2,number,#.##}%, {0}], Capacity Remaining:[{1}]"
             },
             "warning": {
-              "text": "{1} CPU, load {0,number,percent}",
-              "value": 5
+              "text": "Capacity Used:[{2,number,#.##}%, {0}], Capacity Remaining:[{1}]",
+              "value": 75
             },
             "critical": {
-              "text": "{1} CPU, load {0,number,percent}",
-              "value": 20
+              "text": "Capacity Used:[{2,number,#.##}%, {0}], Capacity Remaining:[{1}]",
+              "value": 80
+            }
+          },
+          "jmx": {
+            "property_list": [
+              "Hadoop:service=NameNode,name=FSNamesystem/CapacityUsed",
+              "Hadoop:service=NameNode,name=FSNamesystem/CapacityRemaining"
+            ],
+            "value": "new Double({0})/({0} + {1}) * 100.0"
+          }
+        }
+      },
+      {
+        "name": "namenode_onefs_blocks_health",
+        "label": "OneFS NameNode Blocks Health",
+        "description": "This service-level alert is triggered if the number of corrupt or missing blocks exceeds the configured critical threshold. The threshold values are in blocks.",
+        "interval": 2,
+        "scope": "HOST",
+        "enabled": true,
+        "source": {
+          "type": "SERVER",
+          "class": "org.apache.ambari.server.alerts.JmxServerSideAlert",
+          "uri": {
+            "http": "${hdfs-site/dfs.namenode.http-address}",
+            "https": "${hdfs-site/dfs.namenode.https-address}",
+            "https_property": "${hdfs-site/dfs.http.policy}",
+            "https_property_value": "HTTPS_ONLY",
+            "connection_timeout": 5.0
+          },
+          "reporting": {
+            "ok": {
+              "text": "Missing Blocks:[{0}]"
+            },
+            "warning": {
+              "text": "Missing Blocks:[{0}]",
+              "value": 1
+            },
+            "critical": {
+              "text": "Missing Blocks:[{0}]",
+              "value": 1
+            }
+          },
+          "jmx": {
+            "property_list": [
+              "Hadoop:service=NameNode,name=FSNamesystem/MissingBlocks"
+            ],
+            "value": "{0}"
+          }
+        }
+      },
+      {
+        "name": "onefs_heap_usage",
+        "label": "OneFS Heap Usage",
+        "description": "This host-level alert is triggered if heap usage goes past thresholds on the DataNode. The threshold values are in percent.",
+        "interval": 2,
+        "scope": "HOST",
+        "enabled": true,
+        "source": {
+          "type": "SERVER",
+          "class": "org.apache.ambari.server.alerts.JmxServerSideAlert",
+          "uri": {
+            "http": "${hdfs-site/dfs.namenode.http-address}",
+            "https": "${hdfs-site/dfs.namenode.https-address}",
+            "https_property": "${hdfs-site/dfs.http.policy}",
+            "https_property_value": "HTTPS_ONLY",
+            "connection_timeout": 5.0
+          },
+          "reporting": {
+            "ok": {
+              "text": "Used Heap:[{2,number,#.##}%, {0} B], Max Heap: {1} B"
+            },
+            "warning": {
+              "text": "Used Heap:[{2,number,#.##}%, {0} B], Max Heap: {1} B",
+              "value": 80
             },
-            "units" : "%",
-            "type": "PERCENT"
-           },
-           "jmx": {
-             "property_list": [
-              "java.lang:type=OperatingSystem/SystemCpuLoad",
-              "java.lang:type=OperatingSystem/AvailableProcessors"
-             ]
-           }
+            "critical": {
+              "text": "Used Heap:[{2,number,#.##}%, {0} B], Max Heap: {1} B",
+              "value": 90
+            }
+          },
+          "jmx": {
+            "property_list": [
+              "java.lang:type=Memory/HeapMemoryUsage[used]",
+              "java.lang:type=Memory/HeapMemoryUsage[max]"
+            ],
+            "value": "100.0 - (new Double({1} - {0})/{1} * 100.0)"
           }
+        }
       }
     ]
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/b8f75de5/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/configuration/hadoop-env.xml
----------------------------------------------------------------------
diff --git a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/configuration/hadoop-env.xml b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/configuration/hadoop-env.xml
index bb671cc..5558f59 100644
--- a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/configuration/hadoop-env.xml
+++ b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/configuration/hadoop-env.xml
@@ -193,6 +193,24 @@
     <value-attributes>
       <type>user</type>
       <overridable>false</overridable>
+      <user-groups>
+        <property>
+          <type>hadoop-env</type>
+          <name>hdfs_group</name>
+        </property>
+      </user-groups>
+    </value-attributes>
+    <on-ambari-upgrade add="true"/>
+  </property>
+  <property>
+    <name>hdfs_group</name>
+    <display-name>HDFS User Group</display-name>
+    <value>hdfs_group</value>
+    <property-type>GROUP</property-type>
+    <description>HDFS user group.</description>
+    <value-attributes>
+      <type>user</type>
+      <overridable>false</overridable>
     </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>

http://git-wip-us.apache.org/repos/asf/ambari/blob/b8f75de5/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metainfo.xml
----------------------------------------------------------------------
diff --git a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metainfo.xml b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metainfo.xml
index f20bcf8..82e2022 100644
--- a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metainfo.xml
+++ b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metainfo.xml
@@ -27,6 +27,7 @@
       <components>
        <component>
           <name>ONEFS_CLIENT</name>
+          <timelineAppid>NAMENODE</timelineAppid>
           <displayName>OneFS Client</displayName>
           <category>CLIENT</category>
           <componentType>HCFS_CLIENT</componentType>

http://git-wip-us.apache.org/repos/asf/ambari/blob/b8f75de5/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metrics.json
----------------------------------------------------------------------
diff --git a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metrics.json b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metrics.json
index cd705eb..335bfba 100644
--- a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metrics.json
+++ b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metrics.json
@@ -1,55 +1,211 @@
 {
-  "ONEFS_CLIENT": {
-    "Component": [
+  "ONEFS_CLIENT" : {
+    "Component" : [
       {
-        "type": "ganglia",
-        "metrics": {
-          "default": {
-            "metrics/onefs/demo/counter": {
-              "metric": "onefs.demo.counter",
-              "pointInTime": true,
-              "temporal": true
-            }
-          }
-        }
-      },
-      {
-        "type": "jmx",
-        "properties": {
-          "url_config_type": "hdfs-site",
-          "url_property_name": "dfs.namenode.http-address"
-        },
-        "metrics": {
-          "default": {
-            "metrics/dfs/namenode/Used": {
-              "metric": "Hadoop:service=NameNode,name=NameNodeInfo.Used",
-              "pointInTime": true,
-              "temporal": false
-            },
-            "metrics/jvm/memHeapUsedM": {
-              "metric": "jvm.JvmMetrics.MemHeapUsedM",
-              "pointInTime": true,
-              "temporal": true
-            },
-            "metrics/jvm/HeapMemoryMax": {
-              "metric": "java.lang:type=Memory.HeapMemoryUsage[max]",
-              "pointInTime": true,
-              "temporal": false
-            },
-            "metrics/jvm/HeapMemoryUsed": {
-              "metric": "java.lang:type=Memory.HeapMemoryUsage[used]",
-              "pointInTime": true,
-              "temporal": false
-            },
-            "metrics/jvm/NonHeapMemoryMax": {
-              "metric": "java.lang:type=Memory.NonHeapMemoryUsage[max]",
-              "pointInTime": true,
-              "temporal": false
-            },
-            "metrics/jvm/NonHeapMemoryUsed": {
-              "metric": "java.lang:type=Memory.NonHeapMemoryUsage[used]",
-              "pointInTime": true,
-              "temporal": false
+        "type" : "ganglia",
+        "metrics" : {
+          "default" : {
+            "metrics/load/load_five" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "load_five",
+              "amsHostMetric" : true
+            },
+            "metrics/jvm/JvmMetrics/GcCountConcurrentMarkSweep" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "jvm.JvmMetrics.GcCountConcurrentMarkSweep"
+            },
+            "metrics/cpu/cpu_nice" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "cpu_nice",
+              "amsHostMetric" : true
+            },
+            "metrics/rpc/NumOpenConnections" : {
+              "temporal" : true,
+              "pointInTime" : false,
+              "metric" : "rpc.rpc.NumOpenConnections"
+            },
+            "metrics/network/bytes_in" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "bytes_in",
+              "amsHostMetric" : true
+            },
+            "metrics/cpu/cpu_wio" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "cpu_wio",
+              "amsHostMetric" : true
+            },
+            "metrics/process/proc_run" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "proc_run",
+              "amsHostMetric" : true
+            },
+            "metrics/memory/mem_cached" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "mem_cached",
+              "amsHostMetric" : true
+            },
+            "metrics/disk/write_bytes" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "write_bytes",
+              "amsHostMetric" : true
+            },
+            "metrics/network/bytes_out" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "bytes_out",
+              "amsHostMetric" : true
+            },
+            "metrics/cpu/cpu_idle" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "cpu_idle",
+              "amsHostMetric" : true
+            },
+            "metrics/memory/mem_total" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "mem_total",
+              "amsHostMetric" : true
+            },
+            "metrics/jvm/memHeapUsedM" : {
+              "temporal" : true,
+              "pointInTime" : false,
+              "metric" : "jvm.JvmMetrics.MemHeapUsedM",
+              "unit" : "MB"
+            },
+            "metrics/memory/mem_shared" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "mem_shared",
+              "amsHostMetric" : true
+            },
+            "metrics/disk/write_count" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "write_count",
+              "amsHostMetric" : true
+            },
+            "metrics/network/pkts_in" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "pkts_in",
+              "amsHostMetric" : true
+            },
+            "metrics/network/pkts_out" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "pkts_out",
+              "amsHostMetric" : true
+            },
+            "metrics/load/load_one" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "load_one",
+              "amsHostMetric" : true
+            },
+            "metrics/rpc/RpcProcessingTime_avg_time" : {
+              "temporal" : true,
+              "pointInTime" : false,
+              "metric" : "rpc.rpc.RpcProcessingTimeAvgTime"
+            },
+            "metrics/jvm/JvmMetrics/GcTimeMillisConcurrentMarkSweep" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "jvm.JvmMetrics.GcTimeMillisConcurrentMarkSweep"
+            },
+            "metrics/memory/swap_total" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "swap_total",
+              "amsHostMetric" : true
+            },
+            "metrics/disk/read_bytes" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "read_bytes",
+              "amsHostMetric" : true
+            },
+            "metrics/jvm/gcTimeMillis" : {
+              "temporal" : true,
+              "pointInTime" : false,
+              "metric" : "jvm.JvmMetrics.GcTimeMillis"
+            },
+            "metrics/jvm/gcCount" : {
+              "temporal" : true,
+              "pointInTime" : false,
+              "metric" : "jvm.JvmMetrics.GcCount"
+            },
+            "metrics/memory/swap_free" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "swap_free",
+              "amsHostMetric" : true
+            },
+            "metrics/process/proc_total" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "proc_total",
+              "amsHostMetric" : true
+            },
+            "metrics/load/load_fifteen" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "load_fifteen",
+              "amsHostMetric" : true
+            },
+            "metrics/cpu/cpu_user" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "cpu_user",
+              "amsHostMetric" : true
+            },
+            "metrics/jvm/memHeapCommittedM" : {
+              "temporal" : true,
+              "pointInTime" : false,
+              "metric" : "jvm.JvmMetrics.MemHeapCommittedM"
+            },
+            "metrics/disk/disk_total" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "disk_total",
+              "amsHostMetric" : true
+            },
+            "metrics/disk/disk_free" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "disk_free",
+              "amsHostMetric" : true
+            },
+            "metrics/disk/read_count" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "read_count",
+              "amsHostMetric" : true
+            },
+            "metrics/memory/mem_free" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "mem_free",
+              "amsHostMetric" : true
+            },
+            "metrics/rpc/RpcQueueTime_avg_time" : {
+              "temporal" : true,
+              "pointInTime" : false,
+              "metric" : "rpc.rpc.RpcQueueTimeAvgTime"
+            },
+            "metrics/cpu/cpu_system" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "cpu_system",
+              "amsHostMetric" : true
             }
           }
         }

http://git-wip-us.apache.org/repos/asf/ambari/blob/b8f75de5/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/params_linux.py b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/params_linux.py
index 72e0ae9..b823fc5 100644
--- a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/params_linux.py
+++ b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/params_linux.py
@@ -30,7 +30,7 @@ from resource_management.libraries.functions import stack_select
 config = Script.get_config()
 
 hostname = config["hostname"]
-hadoop_conf_dir = conf_select.get_hadoop_conf_dir(force_latest_on_upgrade=True)
+hadoop_conf_dir = conf_select.get_hadoop_conf_dir()
 hdfs_user = config['configurations']['hadoop-env']['hdfs_user']
 user_group = config['configurations']['cluster-env']['user_group']
 hdfs_tmp_dir = config['configurations']['hadoop-env']['hdfs_tmp_dir']

http://git-wip-us.apache.org/repos/asf/ambari/blob/b8f75de5/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/widgets.json
----------------------------------------------------------------------
diff --git a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/widgets.json b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/widgets.json
index 23da1d6..dbde93b 100644
--- a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/widgets.json
+++ b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/widgets.json
@@ -1,29 +1,173 @@
 {
   "layouts": [
     {
-      "layout_name": "default_onefs_layout",
+      "layout_name": "default_onefs_dashboard",
       "display_name": "Standard ONEFS Dashboard",
       "section_name": "ONEFS_SUMMARY",
       "widgetLayoutInfo": [
         {
-          "widget_name": "OneFS metrics demo",
-          "description": "Test widget",
-          "default_section_name": "ONEFS_SUMMARY",
+          "widget_name": "NameNode GC count",
+          "description": "Count of total garbage collections and count of major type garbage collections of the JVM.",
           "widget_type": "GRAPH",
           "is_visible": true,
-          "scope" : "SERVICE",
           "metrics": [
             {
-              "name": "counter",
-              "metric_path": "metrics/onefs/demo/counter",
+              "name": "jvm.JvmMetrics.GcCount._rate",
+              "metric_path": "metrics/jvm/gcCount._rate",
               "service_name": "ONEFS",
-              "component_name": "ONEFS_CLUSTER"
+              "component_name": "ONEFS_CLIENT",
+              "host_component_criteria": "host_components/metrics/dfs/FSNamesystem/HAState=active"
+            },
+            {
+              "name": "jvm.JvmMetrics.GcCountConcurrentMarkSweep._rate",
+              "metric_path": "metrics/jvm/GcCountConcurrentMarkSweep._rate",
+              "service_name": "ONEFS",
+              "component_name": "ONEFS_CLIENT",
+              "host_component_criteria": "host_components/metrics/dfs/FSNamesystem/HAState=active"
+            }
+          ],
+          "values": [
+            {
+              "name": "GC total count",
+              "value": "${jvm.JvmMetrics.GcCount._rate}"
+            },
+            {
+              "name": "GC count of type major collection",
+              "value": "${jvm.JvmMetrics.GcCountConcurrentMarkSweep._rate}"
+            }
+          ],
+          "properties": {
+            "graph_type": "LINE",
+            "time_range": "1"
+          }
+        },
+        {
+          "widget_name": "NameNode GC time",
+          "description": "Total time taken by major type garbage collections in milliseconds.",
+          "widget_type": "GRAPH",
+          "is_visible": true,
+          "metrics": [
+            {
+              "name": "jvm.JvmMetrics.GcTimeMillisConcurrentMarkSweep._rate",
+              "metric_path": "metrics/jvm/GcTimeMillisConcurrentMarkSweep._rate",
+              "service_name": "ONEFS",
+              "component_name": "ONEFS_CLIENT",
+              "host_component_criteria": "host_components/metrics/dfs/FSNamesystem/HAState=active"
             }
           ],
           "values": [
             {
-              "name": "demo value",
-              "values" : "${counter}"
+              "name": "GC time in major collection",
+              "value": "${jvm.JvmMetrics.GcTimeMillisConcurrentMarkSweep._rate}"
+            }
+          ],
+          "properties": {
+            "display_unit": "ms",
+            "graph_type": "LINE",
+            "time_range": "1"
+          }
+        },
+        {
+          "widget_name": "NameNode Heap",
+          "description": "Heap memory committed and Heap memory used with respect to time.",
+          "widget_type": "GRAPH",
+          "is_visible": true,
+          "metrics": [
+            {
+              "name": "jvm.JvmMetrics.MemHeapCommittedM",
+              "metric_path": "metrics/jvm/memHeapCommittedM",
+              "service_name": "ONEFS",
+              "component_name": "ONEFS_CLIENT",
+              "host_component_criteria": "host_components/metrics/dfs/FSNamesystem/HAState=active"
+            },
+            {
+              "name": "jvm.JvmMetrics.MemHeapUsedM",
+              "metric_path": "metrics/jvm/memHeapUsedM",
+              "service_name": "ONEFS",
+              "component_name": "ONEFS_CLIENT",
+              "host_component_criteria": "host_components/metrics/dfs/FSNamesystem/HAState=active"
+            }
+          ],
+          "values": [
+            {
+              "name": "JVM heap committed",
+              "value": "${jvm.JvmMetrics.MemHeapCommittedM}"
+            },
+            {
+              "name": "JVM heap used",
+              "value": "${jvm.JvmMetrics.MemHeapUsedM}"
+            }
+          ],
+          "properties": {
+            "display_unit": "MB",
+            "graph_type": "LINE",
+            "time_range": "1"
+          }
+        },
+        {
+          "widget_name": "NameNode Host Load",
+          "description": "Percentage of CPU and Memory resources being consumed on NameNode host.",
+          "widget_type": "GRAPH",
+          "is_visible": true,
+          "metrics": [
+            {
+              "name": "cpu_system",
+              "metric_path": "metrics/cpu/cpu_system",
+              "service_name": "ONEFS",
+              "component_name": "ONEFS_CLIENT",
+              "host_component_criteria": "host_components/metrics/dfs/FSNamesystem/HAState=active"
+            },
+            {
+              "name": "cpu_user",
+              "metric_path": "metrics/cpu/cpu_user",
+              "service_name": "ONEFS",
+              "component_name": "ONEFS_CLIENT",
+              "host_component_criteria": "host_components/metrics/dfs/FSNamesystem/HAState=active"
+            },
+            {
+              "name": "cpu_nice",
+              "metric_path": "metrics/cpu/cpu_nice",
+              "service_name": "ONEFS",
+              "component_name": "ONEFS_CLIENT",
+              "host_component_criteria": "host_components/metrics/dfs/FSNamesystem/HAState=active"
+            },
+            {
+              "name": "cpu_idle",
+              "metric_path": "metrics/cpu/cpu_idle",
+              "service_name": "ONEFS",
+              "component_name": "ONEFS_CLIENT",
+              "host_component_criteria": "host_components/metrics/dfs/FSNamesystem/HAState=active"
+            },
+            {
+              "name": "cpu_wio",
+              "metric_path": "metrics/cpu/cpu_wio",
+              "service_name": "ONEFS",
+              "component_name": "ONEFS_CLIENT",
+              "host_component_criteria": "host_components/metrics/dfs/FSNamesystem/HAState=active"
+            },
+            {
+              "name": "mem_total",
+              "metric_path": "metrics/memory/mem_total",
+              "service_name": "ONEFS",
+              "component_name": "ONEFS_CLIENT",
+              "host_component_criteria": "host_components/metrics/dfs/FSNamesystem/HAState=active"
+            },
+            {
+              "name": "mem_free",
+              "metric_path": "metrics/memory/mem_free",
+              "service_name": "ONEFS",
+              "component_name": "ONEFS_CLIENT",
+              "host_component_criteria": "host_components/metrics/dfs/FSNamesystem/HAState=active"
+            }
+          ],
+          "values": [
+            {
+              "name": "CPU utilization",
+              "value": "${((cpu_system + cpu_user + cpu_nice)/(cpu_system + cpu_user + cpu_nice + cpu_idle + cpu_wio)) * 100}"
+            },
+            {
+              "name": "Memory utilization",
+              "value": "${((mem_total - mem_free)/mem_total) * 100}"
             }
           ],
           "properties": {
@@ -31,8 +175,33 @@
             "time_range": "1",
             "display_unit": "%"
           }
+        },
+        {
+          "widget_name": "Under Replicated Blocks",
+          "description": "Number represents file blocks that does not meet the replication factor criteria. Its indicative of ONEFS bad health.",
+          "widget_type": "NUMBER",
+          "is_visible": true,
+          "metrics": [
+            {
+              "name": "Hadoop:service=NameNode,name=FSNamesystem.UnderReplicatedBlocks",
+              "metric_path": "metrics/dfs/FSNamesystem/UnderReplicatedBlocks",
+              "service_name": "ONEFS",
+              "component_name": "ONEFS_CLIENT",
+              "host_component_criteria": "host_components/metrics/dfs/FSNamesystem/HAState=active"
+            }
+          ],
+          "values": [
+            {
+              "name": "Under Replicated Blocks",
+              "value": "${Hadoop:service=NameNode,name=FSNamesystem.UnderReplicatedBlocks}"
+            }
+          ],
+          "properties": {
+            "warning_threshold": "0",
+            "error_threshold": "50"
+          }
         }
       ]
     }
   ]
-}
\ No newline at end of file
+}


[12/50] [abbrv] ambari git commit: AMBARI-22416 Log Search UI: fixes for filtering form. (ababiichuk)

Posted by am...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/services/filtering.service.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/services/filtering.service.spec.ts b/ambari-logsearch/ambari-logsearch-web/src/app/services/filtering.service.spec.ts
deleted file mode 100644
index 2b3e326..0000000
--- a/ambari-logsearch/ambari-logsearch-web/src/app/services/filtering.service.spec.ts
+++ /dev/null
@@ -1,97 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import {TestBed, inject} from '@angular/core/testing';
-import {StoreModule} from '@ngrx/store';
-import {AppSettingsService, appSettings} from '@app/services/storage/app-settings.service';
-import {AppStateService, appState} from '@app/services/storage/app-state.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 {UtilsService} from '@app/services/utils.service';
-import {HttpClientService} from '@app/services/http-client.service';
-import {ListItem} from '@app/classes/list-item';
-import {Node} from '@app/classes/models/node';
-
-import {FilteringService} from './filtering.service';
-
-describe('FilteringService', () => {
-  beforeEach(() => {
-    const httpClient = {
-      get: () => {
-        return {
-          subscribe: () => {
-          }
-        }
-      }
-    };
-    TestBed.configureTestingModule({
-      imports: [
-        StoreModule.provideStore({
-          appSettings,
-          appState,
-          clusters,
-          components,
-          hosts
-        })
-      ],
-      providers: [
-        FilteringService,
-        AppSettingsService,
-        AppStateService,
-        ClustersService,
-        ComponentsService,
-        HostsService,
-        UtilsService,
-        {
-          provide: HttpClientService,
-          useValue: httpClient
-        }
-      ]
-    });
-  });
-
-  it('should create service', inject([FilteringService], (service: FilteringService) => {
-    expect(service).toBeTruthy();
-  }));
-
-  describe('#getListItemFromString()', () => {
-    it('should convert string to ListItem', inject([FilteringService], (service: FilteringService) => {
-      const getListItemFromString: (name: string) => ListItem = service['getListItemFromString'];
-      expect(getListItemFromString('customName')).toEqual({
-        label: 'customName',
-        value: 'customName'
-      });
-    }));
-  });
-
-  describe('#getListItemFromNode()', () => {
-    it('should convert Node to ListItem', inject([FilteringService], (service: FilteringService) => {
-      const getListItemFromNode: (node: Node) => ListItem = service['getListItemFromNode'];
-      expect(getListItemFromNode({
-        name: 'customName',
-        value: '1',
-        isParent: true,
-        isRoot: true
-      })).toEqual({
-        label: 'customName (1)',
-        value: 'customName'
-      });
-    }));
-  });
-});

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/services/filtering.service.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/services/filtering.service.ts b/ambari-logsearch/ambari-logsearch-web/src/app/services/filtering.service.ts
deleted file mode 100644
index 85dc408..0000000
--- a/ambari-logsearch/ambari-logsearch-web/src/app/services/filtering.service.ts
+++ /dev/null
@@ -1,253 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import {Injectable, Input} from '@angular/core';
-import {FormGroup} from '@angular/forms';
-import {Response} from '@angular/http';
-import {Subject} from 'rxjs/Subject';
-import {Observable} from 'rxjs/Observable';
-import 'rxjs/add/observable/timer';
-import 'rxjs/add/operator/takeUntil';
-import * as moment from 'moment-timezone';
-import {ListItem} from '@app/classes/list-item';
-import {FilterCondition, filters} from '@app/classes/filtering';
-import {Node} from '@app/classes/models/node';
-import {AppSettingsService} from '@app/services/storage/app-settings.service';
-import {ClustersService} from '@app/services/storage/clusters.service';
-import {ComponentsService} from '@app/services/storage/components.service';
-import {HostsService} from '@app/services/storage/hosts.service';
-import {AppStateService} from '@app/services/storage/app-state.service';
-import {HttpClientService} from '@app/services/http-client.service';
-
-@Injectable()
-export class FilteringService {
-
-  constructor(private httpClient: HttpClientService, private appSettings: AppSettingsService, private clustersStorage: ClustersService, private componentsStorage: ComponentsService, private hostsStorage: HostsService, private appState: AppStateService) {
-    this.loadClusters();
-    this.loadComponents();
-    this.loadHosts();
-    appSettings.getParameter('timeZone').subscribe(value => this.timeZone = value || this.defaultTimeZone);
-    clustersStorage.getAll().subscribe((clusters: string[]): void => {
-      this.filters.clusters.options = [...this.filters.clusters.options, ...clusters.map(this.getListItemFromString)];
-    });
-    componentsStorage.getAll().subscribe((components: Node[]): void => {
-     this.filters.components.options = [...this.filters.components.options, ...components.map(this.getListItemFromNode)];
-    });
-    hostsStorage.getAll().subscribe((hosts: Node[]): void => {
-      this.filters.hosts.options = [...this.filters.hosts.options, ...hosts.map(this.getListItemFromNode)];
-    });
-    appState.getParameter('activeFiltersForm').subscribe((form: FormGroup) => this.activeFiltersForm = form);
-  }
-
-  /**
-   * Get instance for dropdown list from string
-   * @param name {string}
-   * @returns {ListItem}
-   */
-  private getListItemFromString(name: string): ListItem {
-    return {
-      label: name,
-      value: name
-    };
-  }
-
-  /**
-   * Get instance for dropdown list from Node object
-   * @param node {Node}
-   * @returns {ListItem}
-   */
-  private getListItemFromNode(node: Node): ListItem {
-    return {
-      label: `${node.name} (${node.value})`,
-      value: node.name
-    };
-  }
-
-  private readonly defaultTimeZone = moment.tz.guess();
-
-  timeZone: string = this.defaultTimeZone;
-
-  /**
-   * A configurable property to indicate the maximum capture time in milliseconds.
-   * @type {number}
-   * @default 600000 (10 minutes)
-   */
-  @Input()
-  maximumCaptureTimeLimit: number = 600000;
-
-  filters: {[key: string]: FilterCondition} = Object.assign({}, filters);
-
-  activeFiltersForm: FormGroup;
-
-  queryParameterNameChange: Subject<any> = new Subject();
-
-  queryParameterAdd: Subject<any> = new Subject();
-
-  private stopTimer: Subject<any> = new Subject();
-
-  private stopAutoRefreshCountdown: Subject<any> = new Subject();
-
-  captureSeconds: number = 0;
-
-  private readonly autoRefreshInterval: number = 30000;
-
-  autoRefreshRemainingSeconds: number = 0;
-
-  private startCaptureTime: number;
-
-  private stopCaptureTime: number;
-
-  startCaptureTimer(): void {
-    this.startCaptureTime = new Date().valueOf();
-    const maxCaptureTimeInSeconds = this.maximumCaptureTimeLimit / 1000;
-    Observable.timer(0, 1000).takeUntil(this.stopTimer).subscribe((seconds: number): void => {
-      this.captureSeconds = seconds;
-      if (this.captureSeconds >= maxCaptureTimeInSeconds) {
-        this.stopCaptureTimer();
-      }
-    });
-  }
-
-  stopCaptureTimer(): void {
-    const autoRefreshIntervalSeconds = this.autoRefreshInterval / 1000;
-    this.stopCaptureTime = new Date().valueOf();
-    this.captureSeconds = 0;
-    this.stopTimer.next();
-    this.setCustomTimeRange(this.startCaptureTime, this.stopCaptureTime);
-    Observable.timer(0, 1000).takeUntil(this.stopAutoRefreshCountdown).subscribe((seconds: number): void => {
-      this.autoRefreshRemainingSeconds = autoRefreshIntervalSeconds - seconds;
-      if (!this.autoRefreshRemainingSeconds) {
-        this.stopAutoRefreshCountdown.next();
-        this.setCustomTimeRange(this.startCaptureTime, this.stopCaptureTime);
-      }
-    });
-  }
-
-  loadClusters(): void {
-    this.httpClient.get('clusters').subscribe((response: Response): void => {
-      const clusterNames = response.json();
-      if (clusterNames) {
-        this.clustersStorage.addInstances(clusterNames);
-      }
-    });
-  }
-
-  loadComponents(): void {
-    this.httpClient.get('components').subscribe((response: Response): void => {
-      const jsonResponse = response.json(),
-        components = jsonResponse && jsonResponse.vNodeList.map((item): Node => Object.assign(item, {
-            value: item.logLevelCount.reduce((currentValue: number, currentItem): number => {
-              return currentValue + Number(currentItem.value);
-            }, 0)
-          }));
-      if (components) {
-        this.componentsStorage.addInstances(components);
-      }
-    });
-  }
-
-  loadHosts(): void {
-    this.httpClient.get('hosts').subscribe((response: Response): void => {
-      const jsonResponse = response.json(),
-        hosts = jsonResponse && jsonResponse.vNodeList;
-      if (hosts) {
-        this.hostsStorage.addInstances(hosts);
-      }
-    });
-  }
-
-  setCustomTimeRange(startTime: number, endTime: number): void {
-    this.activeFiltersForm.controls.timeRange.setValue({
-      type: 'CUSTOM',
-      start: moment(startTime),
-      end: moment(endTime)
-    });
-  }
-
-  private getStartTime = (value: any, current: string): string => {
-    let time;
-    if (value) {
-      const endTime = moment(moment(current).valueOf());
-      switch (value.type) {
-        case 'LAST':
-          time = endTime.subtract(value.interval, value.unit);
-          break;
-        case 'CURRENT':
-          time = moment().tz(this.timeZone).startOf(value.unit);
-          break;
-        case 'PAST':
-          time = endTime.startOf(value.unit);
-          break;
-        case 'CUSTOM':
-          time = value.start;
-          break;
-        default:
-          break;
-      }
-    }
-    return time ? time.toISOString() : '';
-  };
-
-  private getEndTime = (value: any): string => {
-    let time;
-    if (value) {
-      switch (value.type) {
-        case 'LAST':
-          time = moment();
-          break;
-        case 'CURRENT':
-          time = moment().tz(this.timeZone).endOf(value.unit);
-          break;
-        case 'PAST':
-          time = moment().tz(this.timeZone).startOf(value.unit).millisecond(-1);
-          break;
-        case 'CUSTOM':
-          time = value.end;
-          break;
-        default:
-          break;
-      }
-    }
-    return time ? time.toISOString() : '';
-  };
-
-  private getQuery(isExclude: boolean): (value: any[]) => string {
-    return (value: any[]): string => {
-      let parameters;
-      if (value && value.length) {
-        parameters = value.filter(item => item.isExclude === isExclude).map(parameter => {
-          return {
-            [parameter.name]: parameter.value.replace(/\s/g, '+')
-          };
-        });
-      }
-      return parameters && parameters.length ? JSON.stringify(parameters) : '';
-    }
-  }
-
-  readonly valueGetters = {
-    to: this.getEndTime,
-    from: this.getStartTime,
-    sortType: value => value && value.type,
-    sortBy: value => value && value.key,
-    page: value => value == null ? value : value.toString(),
-    includeQuery: this.getQuery(false),
-    excludeQuery: this.getQuery(true)
-  };
-
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/services/logs-container.service.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/services/logs-container.service.spec.ts b/ambari-logsearch/ambari-logsearch-web/src/app/services/logs-container.service.spec.ts
index ee0e1e7..47cb25d 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/services/logs-container.service.spec.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/services/logs-container.service.spec.ts
@@ -31,7 +31,8 @@ import {HostsService, hosts} from '@app/services/storage/hosts.service';
 import {ServiceLogsTruncatedService, serviceLogsTruncated} from '@app/services/storage/service-logs-truncated.service';
 import {TabsService, tabs} from '@app/services/storage/tabs.service';
 import {HttpClientService} from '@app/services/http-client.service';
-import {FilteringService} from '@app/services/filtering.service';
+import {ListItem} from '@app/classes/list-item';
+import {NodeItem} from '@app/classes/models/node-item';
 
 import {LogsContainerService} from './logs-container.service';
 
@@ -79,8 +80,7 @@ describe('LogsContainerService', () => {
         {
           provide: HttpClientService,
           useValue: httpClient
-        },
-        FilteringService
+        }
       ]
     });
   });
@@ -88,4 +88,29 @@ describe('LogsContainerService', () => {
   it('should create service', inject([LogsContainerService], (service: LogsContainerService) => {
     expect(service).toBeTruthy();
   }));
+
+  describe('#getListItemFromString()', () => {
+    it('should convert string to ListItem', inject([LogsContainerService], (service: LogsContainerService) => {
+      const getListItemFromString: (name: string) => ListItem = service['getListItemFromString'];
+      expect(getListItemFromString('customName')).toEqual({
+        label: 'customName',
+        value: 'customName'
+      });
+    }));
+  });
+
+  describe('#getListItemFromNode()', () => {
+    it('should convert NodeItem to ListItem', inject([LogsContainerService], (service: LogsContainerService) => {
+      const getListItemFromNode: (node: NodeItem) => ListItem = service['getListItemFromNode'];
+      expect(getListItemFromNode({
+        name: 'customName',
+        value: '1',
+        isParent: true,
+        isRoot: true
+      })).toEqual({
+        label: 'customName (1)',
+        value: 'customName'
+      });
+    }));
+  });
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/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 e187b00..f45887b 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
@@ -17,9 +17,14 @@
  */
 
 import {Injectable} from '@angular/core';
+import {FormGroup, FormControl} from '@angular/forms';
 import {Response} from '@angular/http';
+import {Subject} from 'rxjs/Subject';
+import {Observable} from 'rxjs/Observable';
+import 'rxjs/add/observable/timer';
+import 'rxjs/add/operator/takeUntil';
+import * as moment from 'moment-timezone';
 import {HttpClientService} from '@app/services/http-client.service';
-import {FilteringService} from '@app/services/filtering.service';
 import {AuditLogsService} from '@app/services/storage/audit-logs.service';
 import {AuditLogsFieldsService} from '@app/services/storage/audit-logs-fields.service';
 import {ServiceLogsService} from '@app/services/storage/service-logs.service';
@@ -27,30 +32,411 @@ import {ServiceLogsFieldsService} from '@app/services/storage/service-logs-field
 import {ServiceLogsHistogramDataService} from '@app/services/storage/service-logs-histogram-data.service';
 import {ServiceLogsTruncatedService} from '@app/services/storage/service-logs-truncated.service';
 import {AppStateService} from '@app/services/storage/app-state.service';
+import {AppSettingsService} from '@app/services/storage/app-settings.service';
 import {TabsService} from '@app/services/storage/tabs.service';
+import {ClustersService} from '@app/services/storage/clusters.service';
+import {ComponentsService} from '@app/services/storage/components.service';
+import {HostsService} from '@app/services/storage/hosts.service';
 import {ActiveServiceLogEntry} from '@app/classes/active-service-log-entry';
+import {FilterCondition, TimeUnitListItem, SortingListItem} from '@app/classes/filtering';
+import {ListItem} from '@app/classes/list-item';
 import {Tab} from '@app/classes/models/tab';
 import {AuditLogField} from '@app/classes/models/audit-log-field';
 import {ServiceLogField} from '@app/classes/models/service-log-field';
 import {BarGraph} from '@app/classes/models/bar-graph';
+import {NodeItem} from '@app/classes/models/node-item';
 
 @Injectable()
 export class LogsContainerService {
 
-  constructor(private httpClient: HttpClientService, private auditLogsStorage: AuditLogsService, private auditLogsFieldsStorage: AuditLogsFieldsService, private serviceLogsStorage: ServiceLogsService, private serviceLogsFieldsStorage: ServiceLogsFieldsService, private serviceLogsHistogramStorage: ServiceLogsHistogramDataService, private serviceLogsTruncatedStorage: ServiceLogsTruncatedService, private appState: AppStateService, private tabsStorage: TabsService, private filtering: FilteringService) {
+  constructor(
+    private httpClient: HttpClientService, private auditLogsStorage: AuditLogsService,
+    private auditLogsFieldsStorage: AuditLogsFieldsService, private serviceLogsStorage: ServiceLogsService,
+    private serviceLogsFieldsStorage: ServiceLogsFieldsService,
+    private serviceLogsHistogramStorage: ServiceLogsHistogramDataService,
+    private serviceLogsTruncatedStorage: ServiceLogsTruncatedService, private appState: AppStateService,
+    private appSettings: AppSettingsService, private tabsStorage: TabsService, private clustersStorage: ClustersService,
+    private componentsStorage: ComponentsService, private hostsStorage: HostsService
+  ) {
+    const formItems = Object.keys(this.filters).reduce((currentObject: any, key: string): {[key: string]: FormControl} => {
+      let formControl = new FormControl(),
+        item = {
+          [key]: formControl
+        };
+      formControl.setValue(this.filters[key].defaultSelection);
+      return Object.assign(currentObject, item);
+    }, {});
+    this.filtersForm = new FormGroup(formItems);
+    this.loadClusters();
+    this.loadComponents();
+    this.loadHosts();
     appState.getParameter('activeLog').subscribe((value: ActiveServiceLogEntry | null) => this.activeLog = value);
-    appState.getParameter('isServiceLogsFileView').subscribe((value: boolean): void => {
-      const activeLog = this.activeLog,
-        filtersForm = this.filtering.activeFiltersForm;
-      if (value && activeLog) {
-        filtersForm.controls.hosts.setValue(activeLog.host_name);
-        filtersForm.controls.components.setValue(activeLog.component_name);
-      }
-      this.isServiceLogsFileView = value;
-    });
+    appState.getParameter('isServiceLogsFileView').subscribe((value: boolean) => this.isServiceLogsFileView = value);
     appState.getParameter('activeLogsType').subscribe((value: string) => this.activeLogsType = value);
+    appSettings.getParameter('timeZone').subscribe((value: string) => this.timeZone = value || this.defaultTimeZone);
+    tabsStorage.mapCollection((tab: Tab): Tab => {
+      let currentAppState = tab.appState || {};
+      const appState = Object.assign({}, currentAppState, {
+        activeFilters: this.getFiltersData(tab.type)
+      });
+      return Object.assign({}, tab, {
+        appState
+      });
+    });
+    appState.getParameter('activeFilters').subscribe((filters: object): void => {
+      this.filtersFormChange.next();
+      if (filters) {
+        const controls = this.filtersForm.controls;
+        Object.keys(controls).forEach((key: string): void => {
+          controls[key].setValue(filters.hasOwnProperty(key) ? filters[key] : null);
+        });
+      }
+      this.loadLogs();
+      this.filtersForm.valueChanges.takeUntil(this.filtersFormChange).subscribe((value: object): void => {
+        this.tabsStorage.mapCollection((tab: Tab): Tab => {
+          const currentAppState = tab.appState || {},
+            appState = Object.assign({}, currentAppState, tab.isActive ? {
+              activeFilters: value
+            } : null);
+          return Object.assign({}, tab, {
+            appState
+          });
+        });
+        this.loadLogs();
+      });
+    });
   }
 
+  private readonly paginationOptions: string[] = ['10', '25', '50', '100'];
+
+  filters: {[key: string]: FilterCondition} = {
+    clusters: {
+      label: 'filter.clusters',
+      options: [],
+      defaultSelection: []
+    },
+    timeRange: {
+      options: [
+        [
+          {
+            label: 'filter.timeRange.7d',
+            value: {
+              type: 'LAST',
+              unit: 'd',
+              interval: 7
+            }
+          },
+          {
+            label: 'filter.timeRange.30d',
+            value: {
+              type: 'LAST',
+              unit: 'd',
+              interval: 30
+            }
+          },
+          {
+            label: 'filter.timeRange.60d',
+            value: {
+              type: 'LAST',
+              unit: 'd',
+              interval: 60
+            }
+          },
+          {
+            label: 'filter.timeRange.90d',
+            value: {
+              type: 'LAST',
+              unit: 'd',
+              interval: 90
+            }
+          },
+          {
+            label: 'filter.timeRange.6m',
+            value: {
+              type: 'LAST',
+              unit: 'M',
+              interval: 6
+            }
+          },
+          {
+            label: 'filter.timeRange.1y',
+            value: {
+              type: 'LAST',
+              unit: 'y',
+              interval: 1
+            }
+          },
+          {
+            label: 'filter.timeRange.2y',
+            value: {
+              type: 'LAST',
+              unit: 'y',
+              interval: 2
+            }
+          },
+          {
+            label: 'filter.timeRange.5y',
+            value: {
+              type: 'LAST',
+              unit: 'y',
+              interval: 5
+            }
+          }
+        ],
+        [
+          {
+            label: 'filter.timeRange.yesterday',
+            value: {
+              type: 'PAST',
+              unit: 'd'
+            }
+          },
+          // TODO implement time range calculation
+          /*
+           {
+           label: 'filter.timeRange.beforeYesterday',
+           value: {
+           type: 'PAST',
+           unit: 'd'
+           }
+           },
+           {
+           label: 'filter.timeRange.thisDayLastWeek',
+           value: {
+           type: 'PAST',
+           unit: 'd'
+           }
+           },
+           */
+          {
+            label: 'filter.timeRange.previousWeek',
+            value: {
+              type: 'PAST',
+              unit: 'w'
+            }
+          },
+          {
+            label: 'filter.timeRange.previousMonth',
+            value: {
+              type: 'PAST',
+              unit: 'M'
+            }
+          },
+          {
+            label: 'filter.timeRange.previousYear',
+            value: {
+              type: 'PAST',
+              unit: 'y'
+            }
+          }
+        ],
+        [
+          {
+            label: 'filter.timeRange.today',
+            value: {
+              type: 'CURRENT',
+              unit: 'd'
+            }
+          },
+          {
+            label: 'filter.timeRange.thisWeek',
+            value: {
+              type: 'CURRENT',
+              unit: 'w'
+            }
+          },
+          {
+            label: 'filter.timeRange.thisMonth',
+            value: {
+              type: 'CURRENT',
+              unit: 'M'
+            }
+          },
+          {
+            label: 'filter.timeRange.thisYear',
+            value: {
+              type: 'CURRENT',
+              unit: 'y'
+            }
+          }
+        ],
+        [
+          {
+            label: 'filter.timeRange.5min',
+            value: {
+              type: 'LAST',
+              unit: 'm',
+              interval: 5
+            }
+          },
+          {
+            label: 'filter.timeRange.15min',
+            value: {
+              type: 'LAST',
+              unit: 'm',
+              interval: 15
+            }
+          },
+          {
+            label: 'filter.timeRange.30min',
+            value: {
+              type: 'LAST',
+              unit: 'm',
+              interval: 30
+            }
+          },
+          {
+            label: 'filter.timeRange.1hr',
+            value: {
+              type: 'LAST',
+              unit: 'h',
+              interval: 1
+            }
+          },
+          {
+            label: 'filter.timeRange.3hr',
+            value: {
+              type: 'LAST',
+              unit: 'h',
+              interval: 3
+            }
+          },
+          {
+            label: 'filter.timeRange.6hr',
+            value: {
+              type: 'LAST',
+              unit: 'h',
+              interval: 6
+            }
+          },
+          {
+            label: 'filter.timeRange.12hr',
+            value: {
+              type: 'LAST',
+              unit: 'h',
+              interval: 12
+            }
+          },
+          {
+            label: 'filter.timeRange.24hr',
+            value: {
+              type: 'LAST',
+              unit: 'h',
+              interval: 24
+            }
+          },
+        ]
+      ],
+      defaultSelection: {
+        value: {
+          type: 'LAST',
+          unit: 'h',
+          interval: 1
+        },
+        label: 'filter.timeRange.1hr'
+      }
+    },
+    components: {
+      label: 'filter.components',
+      iconClass: 'fa fa-cubes',
+      options: [],
+      defaultSelection: []
+    },
+    levels: {
+      label: 'filter.levels',
+      iconClass: 'fa fa-sort-amount-asc',
+      options: [
+        {
+          label: 'levels.fatal',
+          value: 'FATAL'
+        },
+        {
+          label: 'levels.error',
+          value: 'ERROR'
+        },
+        {
+          label: 'levels.warn',
+          value: 'WARN'
+        },
+        {
+          label: 'levels.info',
+          value: 'INFO'
+        },
+        {
+          label: 'levels.debug',
+          value: 'DEBUG'
+        },
+        {
+          label: 'levels.trace',
+          value: 'TRACE'
+        },
+        {
+          label: 'levels.unknown',
+          value: 'UNKNOWN'
+        }
+      ],
+      defaultSelection: []
+    },
+    hosts: {
+      label: 'filter.hosts',
+      iconClass: 'fa fa-server',
+      options: [],
+      defaultSelection: []
+    },
+    sorting: {
+      label: 'sorting.title',
+      options: [
+        {
+          label: 'sorting.time.asc',
+          value: {
+            key: 'logtime',
+            type: 'asc'
+          }
+        },
+        {
+          label: 'sorting.time.desc',
+          value: {
+            key: 'logtime',
+            type: 'desc'
+          }
+        }
+      ],
+      defaultSelection: [
+        {
+          label: 'sorting.time.desc',
+          value: {
+            key: 'logtime',
+            type: 'desc'
+          }
+        }
+      ]
+    },
+    pageSize: {
+      label: 'pagination.title',
+      options: this.paginationOptions.map((option: string): ListItem => {
+        return {
+          label: option,
+          value: option
+        }
+      }),
+      defaultSelection: [
+        {
+          label: '10',
+          value: '10'
+        }
+      ]
+    },
+    page: {
+      defaultSelection: 0
+    },
+    query: {}
+  };
+
+  readonly filtersFormItemsMap: {[key: string]: string[]} = {
+    serviceLogs: ['clusters', 'timeRange', 'components', 'levels', 'hosts', 'sorting', 'pageSize', 'page', 'query'],
+    auditLogs: ['clusters', 'timeRange', 'sorting', 'pageSize', 'page', 'query'] // TODO add all the required fields
+  };
+
   readonly colors = {
     WARN: '#FF8916',
     ERROR: '#E81D1D',
@@ -93,14 +479,71 @@ export class LogsContainerService {
     }
   };
 
+  private readonly defaultTimeZone = moment.tz.guess();
+
+  timeZone: string = this.defaultTimeZone;
+
   totalCount: number = 0;
 
+  /**
+   * A configurable property to indicate the maximum capture time in milliseconds.
+   * @type {number}
+   * @default 600000 (10 minutes)
+   */
+  private readonly maximumCaptureTimeLimit: number = 600000;
+
   isServiceLogsFileView: boolean = false;
 
+  filtersForm: FormGroup;
+
   activeLog: ActiveServiceLogEntry | null = null;
 
   activeLogsType: string;
 
+  private filtersFormChange: Subject<any> = new Subject();
+
+  /**
+   * Get instance for dropdown list from string
+   * @param name {string}
+   * @returns {ListItem}
+   */
+  private getListItemFromString(name: string): ListItem {
+    return {
+      label: name,
+      value: name
+    };
+  }
+
+  /**
+   * Get instance for dropdown list from NodeItem object
+   * @param node {NodeItem}
+   * @returns {ListItem}
+   */
+  private getListItemFromNode(node: NodeItem): ListItem {
+    return {
+      label: `${node.name} (${node.value})`,
+      value: node.name
+    };
+  }
+
+  queryParameterNameChange: Subject<any> = new Subject();
+
+  queryParameterAdd: Subject<any> = new Subject();
+
+  private stopTimer: Subject<any> = new Subject();
+
+  private stopAutoRefreshCountdown: Subject<any> = new Subject();
+
+  captureSeconds: number = 0;
+
+  private readonly autoRefreshInterval: number = 30000;
+
+  autoRefreshRemainingSeconds: number = 0;
+
+  private startCaptureTime: number;
+
+  private stopCaptureTime: number;
+
   loadLogs = (logsType: string = this.activeLogsType): void => {
     this.httpClient.get(logsType, this.getParams('listFilters')).subscribe((response: Response): void => {
       const jsonResponse = response.json(),
@@ -128,7 +571,7 @@ export class LogsContainerService {
         }
       });
     }
-  }
+  };
 
   loadLogContext(id: string, hostName: string, componentName: string, scrollType: 'before' | 'after' | '' = ''): void {
     const params = {
@@ -161,22 +604,18 @@ export class LogsContainerService {
     });
   }
 
-  private getParams(filtersMapName: string): any {
+  private getParams(filtersMapName: string): {[key: string]: string} {
     let params = {};
     Object.keys(this[filtersMapName]).forEach((key: string): void => {
-      const inputValue = this.filtering.activeFiltersForm.getRawValue()[key],
+      const inputValue = this.filtersForm.getRawValue()[key],
         paramNames = this[filtersMapName][key];
-      paramNames.forEach(paramName => {
+      paramNames.forEach((paramName: string): void => {
         let value;
-        const valueGetter = this.filtering.valueGetters[paramName];
-        if (valueGetter) {
-          if (paramName === 'from') {
-            value = valueGetter(inputValue, params['to']);
-          } else {
-            value = valueGetter(inputValue);
-          }
+        const valueGetter = this.valueGetters[paramName] || this.defaultValueGetter;
+        if (paramName === 'from') {
+          value = valueGetter(inputValue, params['to']);
         } else {
-          value = inputValue;
+          value = valueGetter(inputValue);
         }
         if (value != null && value !== '') {
           params[paramName] = value;
@@ -222,12 +661,197 @@ export class LogsContainerService {
     return Object.keys(keysObject).map((key: string): {fieldClass} => new fieldClass(key));
   }
 
+  private getStartTime = (selection: TimeUnitListItem, current: string): string => {
+    let time;
+    const value = selection && selection.value;
+    if (value) {
+      const endTime = moment(moment(current).valueOf());
+      switch (value.type) {
+        case 'LAST':
+          time = endTime.subtract(value.interval, value.unit);
+          break;
+        case 'CURRENT':
+          time = moment().tz(this.timeZone).startOf(value.unit);
+          break;
+        case 'PAST':
+          time = endTime.startOf(value.unit);
+          break;
+        case 'CUSTOM':
+          time = value.start;
+          break;
+        default:
+          break;
+      }
+    }
+    return time ? time.toISOString() : '';
+  };
+
+  private getEndTime = (selection: TimeUnitListItem): string => {
+    let time;
+    const value = selection && selection.value;
+    if (value) {
+      switch (value.type) {
+        case 'LAST':
+          time = moment();
+          break;
+        case 'CURRENT':
+          time = moment().tz(this.timeZone).endOf(value.unit);
+          break;
+        case 'PAST':
+          time = moment().tz(this.timeZone).startOf(value.unit).millisecond(-1);
+          break;
+        case 'CUSTOM':
+          time = value.end;
+          break;
+        default:
+          break;
+      }
+    }
+    return time ? time.toISOString() : '';
+  };
+
+  private getQuery(isExclude: boolean): (value: any[]) => string {
+    return (value: any[]): string => {
+      let parameters;
+      if (value && value.length) {
+        parameters = value.filter(item => item.isExclude === isExclude).map(parameter => {
+          return {
+            [parameter.name]: parameter.value.replace(/\s/g, '+')
+          };
+        });
+      }
+      return parameters && parameters.length ? JSON.stringify(parameters) : '';
+    }
+  }
+
+  private getSortType(selection: SortingListItem[] = []): 'asc' | 'desc' {
+    return selection[0] && selection[0].value ? selection[0].value.type : 'desc';
+  }
+
+  private getSortKey(selection: SortingListItem[] = []): string {
+    return selection[0] && selection[0].value ? selection[0].value.key : '';
+  }
+
+  private getPage(value: number | undefined): string | undefined {
+    return typeof value === 'undefined' ? value : value.toString();
+  }
+
+  private defaultValueGetter(selection: ListItem | ListItem[] | null): string {
+    if (Array.isArray(selection)) {
+      return selection.map((item: ListItem): any => item.value).join(',');
+    } else if (selection) {
+      return selection.value;
+    } else {
+      return '';
+    }
+  }
+
+  private readonly valueGetters = {
+    to: this.getEndTime,
+    from: this.getStartTime,
+    sortType: this.getSortType,
+    sortBy: this.getSortKey,
+    page: this.getPage,
+    includeQuery: this.getQuery(false),
+    excludeQuery: this.getQuery(true)
+  };
+
   switchTab(activeTab: Tab): void {
+    this.tabsStorage.mapCollection((tab: Tab): Tab => {
+      return Object.assign({}, tab, {
+        isActive: tab.id === activeTab.id
+      });
+    });
     this.appState.setParameters(activeTab.appState);
-    this.tabsStorage.mapCollection((tab: Tab): Tab => Object.assign({}, tab, {
-      isActive: tab.id === activeTab.id
-    }));
-    this.loadLogs();
+  }
+
+  startCaptureTimer(): void {
+    this.startCaptureTime = new Date().valueOf();
+    const maxCaptureTimeInSeconds = this.maximumCaptureTimeLimit / 1000;
+    Observable.timer(0, 1000).takeUntil(this.stopTimer).subscribe((seconds: number): void => {
+      this.captureSeconds = seconds;
+      if (this.captureSeconds >= maxCaptureTimeInSeconds) {
+        this.stopCaptureTimer();
+      }
+    });
+  }
+
+  stopCaptureTimer(): void {
+    const autoRefreshIntervalSeconds = this.autoRefreshInterval / 1000;
+    this.stopCaptureTime = new Date().valueOf();
+    this.captureSeconds = 0;
+    this.stopTimer.next();
+    this.setCustomTimeRange(this.startCaptureTime, this.stopCaptureTime);
+    Observable.timer(0, 1000).takeUntil(this.stopAutoRefreshCountdown).subscribe((seconds: number): void => {
+      this.autoRefreshRemainingSeconds = autoRefreshIntervalSeconds - seconds;
+      if (!this.autoRefreshRemainingSeconds) {
+        this.stopAutoRefreshCountdown.next();
+        this.setCustomTimeRange(this.startCaptureTime, this.stopCaptureTime);
+      }
+    });
+  }
+
+  loadClusters(): Observable<Response> {
+    const request = this.httpClient.get('clusters');
+    request.subscribe((response: Response): void => {
+      const clusterNames = response.json();
+      if (clusterNames) {
+        this.filters.clusters.options.push(...clusterNames.map(this.getListItemFromString));
+        this.clustersStorage.addInstances(clusterNames);
+      }
+    });
+    return request;
+  }
+
+  loadComponents(): Observable<Response> {
+    const request = this.httpClient.get('components');
+    request.subscribe((response: Response): void => {
+      const jsonResponse = response.json(),
+        components = jsonResponse && jsonResponse.vNodeList.map((item): NodeItem => Object.assign(item, {
+            value: item.logLevelCount.reduce((currentValue: number, currentItem): number => {
+              return currentValue + Number(currentItem.value);
+            }, 0)
+          }));
+      if (components) {
+        this.filters.components.options.push(...components.map(this.getListItemFromNode));
+        this.componentsStorage.addInstances(components);
+      }
+    });
+    return request;
+  }
+
+  loadHosts(): Observable<Response> {
+    const request = this.httpClient.get('hosts');
+    request.subscribe((response: Response): void => {
+      const jsonResponse = response.json(),
+        hosts = jsonResponse && jsonResponse.vNodeList;
+      if (hosts) {
+        this.filters.hosts.options.push(...hosts.map(this.getListItemFromNode));
+        this.hostsStorage.addInstances(hosts);
+      }
+    });
+    return request;
+  }
+
+  setCustomTimeRange(startTime: number, endTime: number): void {
+    this.filtersForm.controls.timeRange.setValue({
+      label: 'filter.timeRange.custom',
+      value: {
+        type: 'CUSTOM',
+        start: moment(startTime),
+        end: moment(endTime)
+      }
+    });
+  }
+
+  getFiltersData(listType: string): object {
+    const itemsList = this.filtersFormItemsMap[listType],
+      keys = Object.keys(this.filters).filter((key: string): boolean => itemsList.indexOf(key) > -1);
+    return keys.reduce((currentObject: object, key: string): object => {
+      return Object.assign(currentObject, {
+        [key]: this.filters[key].defaultSelection
+      });
+    }, {});
   }
 
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/services/utils.service.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/services/utils.service.spec.ts b/ambari-logsearch/ambari-logsearch-web/src/app/services/utils.service.spec.ts
index a4a0cf8..23d3726 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/services/utils.service.spec.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/services/utils.service.spec.ts
@@ -31,56 +31,273 @@ describe('UtilsService', () => {
     expect(service).toBeTruthy();
   }));
 
-  describe('#updateMultiSelectValue()', () => {
+  describe('#isEqual()', () => {
     const cases = [
       {
-        currentValue: '',
-        value: 'v0',
-        isChecked: true,
-        result: 'v0',
-        title: 'check; no checked items before'
+        valueA: 1,
+        valueB: 1,
+        result: true,
+        title: 'same numbers'
       },
       {
-        currentValue: 'v1,v2',
-        value: 'v3',
-        isChecked: true,
-        result: 'v1,v2,v3',
-        title: 'check'
+        valueA: 1,
+        valueB: 2,
+        result: false,
+        title: 'different numbers'
       },
       {
-        currentValue: 'v4,v5',
-        value: 'v4',
-        isChecked: false,
-        result: 'v5',
-        title: 'uncheck'
+        valueA: 'a',
+        valueB: 'a',
+        result: true,
+        title: 'same strings'
       },
       {
-        currentValue: 'v6,v7',
-        value: 'v6',
-        isChecked: true,
-        result: 'v6,v7',
-        title: 'avoid repeating check action'
+        valueA: 'a',
+        valueB: 'b',
+        result: false,
+        title: 'different strings'
       },
       {
-        currentValue: 'v8,v9',
-        value: 'v10',
-        isChecked: false,
-        result: 'v8,v9',
-        title: 'avoid repeating uncheck action'
+        valueA: '1',
+        valueB: 1,
+        result: false,
+        title: 'different types'
       },
       {
-        currentValue: 'v11',
-        value: 'v11',
-        isChecked: false,
-        result: '',
-        title: 'uncheck last item'
+        valueA: true,
+        valueB: true,
+        result: true,
+        title: 'same booleans'
+      },
+      {
+        valueA: false,
+        valueB: true,
+        result: false,
+        title: 'different booleans'
+      },
+      {
+        valueA: {},
+        valueB: {},
+        result: true,
+        title: 'empty objects'
+      },
+      {
+        valueA: {
+          p0: 'v0'
+        },
+        valueB: {
+          p0: 'v0'
+        },
+        result: true,
+        title: 'same objects'
+      },
+      {
+        valueA: {
+          p0: 'v0'
+        },
+        valueB: {
+          p0: 'v1'
+        },
+        result: false,
+        title: 'different objects'
+      },
+      {
+        valueA: {
+          p0: {
+            p1: 'v1'
+          }
+        },
+        valueB: {
+          p0: {
+            p1: 'v1'
+          }
+        },
+        result: true,
+        title: 'same objects in depth'
+      },
+      {
+        valueA: {
+          p0: {
+            p1: 'v1'
+          }
+        },
+        valueB: {
+          p0: {
+            p1: 'v2'
+          }
+        },
+        result: false,
+        title: 'different objects in depth'
+      },
+      {
+        valueA: [],
+        valueB: [],
+        result: true,
+        title: 'empty arrays'
+      },
+      {
+        valueA: [1, 'a'],
+        valueB: [1, 'a'],
+        result: true,
+        title: 'same arrays'
+      },
+      {
+        valueA: [1, 'a'],
+        valueB: [1, 'b'],
+        result: false,
+        title: 'different arrays'
+      },
+      {
+        valueA: [1, 1],
+        valueB: [1, 1, 1],
+        result: false,
+        title: 'arrays of different length'
+      },
+      {
+        valueA: [{}],
+        valueB: [{}],
+        result: true,
+        title: 'arrays of empty objects'
+      },
+      {
+        valueA: [
+          {
+            p0: 'v0'
+          }
+        ],
+        valueB: [
+          {
+            p0: 'v0'
+          }
+        ],
+        result: true,
+        title: 'arrays of same objects'
+      },
+      {
+        valueA: [
+          {
+            p0: 'v0'
+          }
+        ],
+        valueB: [
+          {
+            p0: 'v1'
+          }
+        ],
+        result: false,
+        title: 'arrays of different objects'
+      },
+      {
+        valueA: function() {},
+        valueB: function() {},
+        result: true,
+        title: 'same functions'
+      },
+      {
+        valueA: function(a) {
+          return a;
+        },
+        valueB: function(b) {
+          return !b;
+        },
+        result: false,
+        title: 'different functions'
+      },
+      {
+        valueA: new Date(1),
+        valueB: new Date(1),
+        result: true,
+        title: 'same dates'
+      },
+      {
+        valueA: new Date(1),
+        valueB: new Date(2),
+        result: false,
+        title: 'different dates'
+      },
+      {
+        valueA: new RegExp('a'),
+        valueB: new RegExp('a'),
+        result: true,
+        title: 'same regexps'
+      },
+      {
+        valueA: new RegExp('a', 'i'),
+        valueB: new RegExp('a', 'g'),
+        result: false,
+        title: 'same regexps with different flags'
+      },
+      {
+        valueA: new RegExp('a'),
+        valueB: new RegExp('b'),
+        result: false,
+        title: 'different regexps'
+      },
+      {
+        valueA: new Number(1),
+        valueB: new Number(1),
+        result: true,
+        title: 'same number objects'
+      },
+      {
+        valueA: new Number(1),
+        valueB: new Number(2),
+        result: false,
+        title: 'different number objects'
+      },
+      {
+        valueA: new String('a'),
+        valueB: new String('a'),
+        result: true,
+        title: 'same string objects'
+      },
+      {
+        valueA: new String('a'),
+        valueB: new String('b'),
+        result: false,
+        title: 'different string objects'
+      },
+      {
+        valueA: new Boolean(true),
+        valueB: new Boolean(true),
+        result: true,
+        title: 'same boolean objects'
+      },
+      {
+        valueA: new Boolean(true),
+        valueB: new Boolean(false),
+        result: false,
+        title: 'different boolean objects'
+      },
+      {
+        valueA: null,
+        valueB: null,
+        result: true,
+        title: 'null values'
+      },
+      {
+        valueA: undefined,
+        valueB: undefined,
+        result: true,
+        title: 'undefined values'
+      },
+      {
+        valueA: undefined,
+        valueB: null,
+        result: false,
+        title: 'undefined vs null'
       }
     ];
 
     cases.forEach(test => {
-      it(test.title, inject([UtilsService], (service: UtilsService) => {
-        expect(service.updateMultiSelectValue(test.currentValue, test.value, test.isChecked)).toEqual(test.result);
-      }));
+      describe(test.title, () => {
+        it('equality', inject([UtilsService], (service: UtilsService) => {
+          expect(service.isEqual(test.valueA, test.valueB)).toEqual(test.result);
+        }));
+        it('symmetry', inject([UtilsService], (service: UtilsService) => {
+          expect(service.isEqual(test.valueA, test.valueB)).toEqual(service.isEqual(test.valueB, test.valueA));
+        }));
+      });
     });
   });
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/services/utils.service.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/services/utils.service.ts b/ambari-logsearch/ambari-logsearch-web/src/app/services/utils.service.ts
index 3448dd4..175b585 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/services/utils.service.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/services/utils.service.ts
@@ -22,27 +22,56 @@ import * as moment from 'moment-timezone';
 @Injectable()
 export class UtilsService {
 
-  valueHasChanged(currentValue: any, newValue: any): boolean {
-    if (newValue == null) {
+  /**
+   * Comparison of two instances of any data type be value instead of reference
+   * @param valueA
+   * @param valueB
+   * @returns {boolean}
+   */
+  isEqual = (valueA: any, valueB: any): boolean => {
+    if (valueA === valueB) {
+      return true;
+    }
+    if (valueA instanceof Date && valueB instanceof Date) {
+      return valueA.valueOf() === valueB.valueOf();
+    }
+    if ((typeof valueA === 'function' && typeof valueB === 'function') ||
+      (valueA instanceof RegExp && valueB instanceof RegExp) ||
+      (valueA instanceof String && valueB instanceof String) ||
+      (valueA instanceof Number && valueB instanceof Number) ||
+      (valueA instanceof Boolean && valueB instanceof Boolean)) {
+      return valueA.toString() === valueB.toString();
+    }
+    if (!(valueA instanceof Object) || !(valueB instanceof Object)) {
       return false;
     }
-    if (typeof newValue === 'object') {
-      return JSON.stringify(currentValue) !== JSON.stringify(newValue);
-    } else {
-      return currentValue !== newValue;
+    if (valueA.constructor !== valueB.constructor) {
+      return false;
     }
-  }
-
-  updateMultiSelectValue(currentValue: string, value: string, isChecked: boolean): string {
-    let valuesArray = currentValue ? currentValue.split(',') : [],
-      valuePosition = valuesArray.indexOf(value);
-    if (isChecked && valuePosition === -1) {
-      valuesArray.push(value);
-    } else if (!isChecked && valuePosition > -1) {
-      valuesArray.splice(valuePosition, 1);
-    }
-    return valuesArray.join(',');
-  }
+    if (valueA.isPrototypeOf(valueB) || valueB.isPrototypeOf(valueA)) {
+      return false;
+    }
+    for (const key in valueA) {
+      if (!valueA.hasOwnProperty(key)) {
+        continue;
+      }
+      if (!valueB.hasOwnProperty(key)) {
+        return false;
+      }
+      if (valueA[key] === valueB[key]) {
+        continue;
+      }
+      if (typeof valueA[key] !== 'object' || !this.isEqual(valueA[key], valueB[key])) {
+        return false;
+      }
+    }
+    for (const key in valueB) {
+      if (valueB.hasOwnProperty(key) && !valueA.hasOwnProperty(key)) {
+        return false;
+      }
+    }
+    return true;
+  };
 
   isEnterPressed(event: KeyboardEvent): boolean {
     return event.keyCode === 13;


[32/50] [abbrv] ambari git commit: AMBARI-22418. Make Ambari configuration API consistent with existing API. (rlevas)

Posted by am...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/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
new file mode 100644
index 0000000..5016160
--- /dev/null
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationResourceProviderTest.java
@@ -0,0 +1,393 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.server.controller.internal;
+
+import static org.apache.ambari.server.controller.internal.RootServiceComponentConfigurationResourceProvider.CONFIGURATION_CATEGORY_PROPERTY_ID;
+import static org.apache.ambari.server.controller.internal.RootServiceComponentConfigurationResourceProvider.CONFIGURATION_COMPONENT_NAME_PROPERTY_ID;
+import static org.apache.ambari.server.controller.internal.RootServiceComponentConfigurationResourceProvider.CONFIGURATION_PROPERTIES_PROPERTY_ID;
+import static org.apache.ambari.server.controller.internal.RootServiceComponentConfigurationResourceProvider.CONFIGURATION_SERVICE_NAME_PROPERTY_ID;
+import static org.easymock.EasyMock.anyObject;
+import static org.easymock.EasyMock.capture;
+import static org.easymock.EasyMock.eq;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.expectLastCall;
+import static org.easymock.EasyMock.newCapture;
+
+import java.util.ArrayList;
+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 javax.persistence.EntityManager;
+
+import org.apache.ambari.server.controller.RootComponent;
+import org.apache.ambari.server.controller.RootService;
+import org.apache.ambari.server.controller.predicate.AndPredicate;
+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.utilities.PredicateBuilder;
+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.TestAuthenticationFactory;
+import org.apache.ambari.server.security.authorization.AuthorizationException;
+import org.easymock.Capture;
+import org.easymock.EasyMockSupport;
+import org.junit.After;
+import org.junit.Test;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.core.context.SecurityContextHolder;
+
+import com.google.inject.AbstractModule;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+
+import junit.framework.Assert;
+
+public class RootServiceComponentConfigurationResourceProviderTest extends EasyMockSupport {
+
+  private static final String CATEGORY_NAME_1 = "test-category-1";
+  private static final String CATEGORY_NAME_2 = "test-category-2";
+
+  @After
+  public void clearAuthentication() {
+    SecurityContextHolder.getContext().setAuthentication(null);
+  }
+
+  @Test
+  public void testCreateResources_Administrator() throws Exception {
+    testCreateResources(TestAuthenticationFactory.createAdministrator());
+  }
+
+  @Test(expected = AuthorizationException.class)
+  public void testCreateResources_ClusterAdministrator() throws Exception {
+    testCreateResources(TestAuthenticationFactory.createClusterAdministrator());
+  }
+
+  @Test(expected = AuthorizationException.class)
+  public void testCreateResources_ClusterOperator() throws Exception {
+    testCreateResources(TestAuthenticationFactory.createClusterOperator());
+  }
+
+  @Test(expected = AuthorizationException.class)
+  public void testCreateResources_ServiceAdministrator() throws Exception {
+    testCreateResources(TestAuthenticationFactory.createServiceAdministrator());
+  }
+
+  @Test(expected = AuthorizationException.class)
+  public void testCreateResources_ServiceOperator() throws Exception {
+    testCreateResources(TestAuthenticationFactory.createServiceOperator());
+  }
+
+  private void testCreateResources(Authentication authentication) throws Exception {
+    Injector injector = createInjector();
+
+    ResourceProvider resourceProvider = injector.getInstance(RootServiceComponentConfigurationResourceProvider.class);
+
+    Set<Map<String, Object>> propertySets = new HashSet<>();
+
+    Map<String, String> properties1 = new HashMap<>();
+    properties1.put("property1a", "value1");
+    properties1.put("property2a", "value2");
+    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));
+
+    Request request = createMock(Request.class);
+    expect(request.getProperties()).andReturn(propertySets).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();
+
+    AmbariEventPublisher publisher = injector.getInstance(AmbariEventPublisher.class);
+    publisher.publish(anyObject(AmbariConfigurationChangedEvent.class));
+    expectLastCall().times(2);
+
+    replayAll();
+
+    SecurityContextHolder.getContext().setAuthentication(authentication);
+
+    resourceProvider.createResources(request);
+
+    verifyAll();
+
+    validateCapturedProperties(properties1, capturedProperties1);
+    validateCapturedProperties(properties2, capturedProperties2);
+  }
+
+  @Test
+  public void testDeleteResources_Administrator() throws Exception {
+    testDeleteResources(TestAuthenticationFactory.createAdministrator());
+  }
+
+  @Test(expected = AuthorizationException.class)
+  public void testDeleteResources_ClusterAdministrator() throws Exception {
+    testDeleteResources(TestAuthenticationFactory.createClusterAdministrator());
+  }
+
+  @Test(expected = AuthorizationException.class)
+  public void testDeleteResources_ClusterOperator() throws Exception {
+    testDeleteResources(TestAuthenticationFactory.createClusterOperator());
+  }
+
+  @Test(expected = AuthorizationException.class)
+  public void testDeleteResources_ServiceAdministrator() throws Exception {
+    testDeleteResources(TestAuthenticationFactory.createServiceAdministrator());
+  }
+
+  @Test(expected = AuthorizationException.class)
+  public void testDeleteResources_ServiceOperator() throws Exception {
+    testDeleteResources(TestAuthenticationFactory.createServiceOperator());
+  }
+
+  private void testDeleteResources(Authentication authentication) throws Exception {
+    Injector injector = createInjector();
+
+    ResourceProvider resourceProvider = injector.getInstance(RootServiceComponentConfigurationResourceProvider.class);
+
+    Predicate predicate = createPredicate(RootService.AMBARI.name(), RootComponent.AMBARI_SERVER.name(), CATEGORY_NAME_1);
+
+    Request request = createMock(Request.class);
+
+    AmbariConfigurationDAO dao = injector.getInstance(AmbariConfigurationDAO.class);
+    expect(dao.removeByCategory(CATEGORY_NAME_1)).andReturn(1).once();
+
+    AmbariEventPublisher publisher = injector.getInstance(AmbariEventPublisher.class);
+    publisher.publish(anyObject(AmbariConfigurationChangedEvent.class));
+    expectLastCall().once();
+
+    replayAll();
+
+    SecurityContextHolder.getContext().setAuthentication(authentication);
+
+    resourceProvider.deleteResources(request, predicate);
+
+    verifyAll();
+  }
+
+  @Test
+  public void testGetResources_Administrator() throws Exception {
+    testGetResources(TestAuthenticationFactory.createAdministrator());
+  }
+
+  @Test(expected = AuthorizationException.class)
+  public void testGetResources_ClusterAdministrator() throws Exception {
+    testGetResources(TestAuthenticationFactory.createClusterAdministrator());
+  }
+
+  @Test(expected = AuthorizationException.class)
+  public void testGetResources_ClusterOperator() throws Exception {
+    testGetResources(TestAuthenticationFactory.createClusterOperator());
+  }
+
+  @Test(expected = AuthorizationException.class)
+  public void testGetResources_ServiceAdministrator() throws Exception {
+    testGetResources(TestAuthenticationFactory.createServiceAdministrator());
+  }
+
+  @Test(expected = AuthorizationException.class)
+  public void testGetResources_ServiceOperator() throws Exception {
+    testGetResources(TestAuthenticationFactory.createServiceOperator());
+  }
+
+  private void testGetResources(Authentication authentication) throws Exception {
+    Injector injector = createInjector();
+
+    ResourceProvider resourceProvider = injector.getInstance(RootServiceComponentConfigurationResourceProvider.class);
+
+    Predicate predicate = createPredicate(RootService.AMBARI.name(), RootComponent.AMBARI_SERVER.name(), CATEGORY_NAME_1);
+
+    Request request = createMock(Request.class);
+    expect(request.getPropertyIds()).andReturn(null).anyTimes();
+
+    Map<String, String> properties = new HashMap<>();
+    properties.put("property1a", "value1");
+    properties.put("property2a", "value2");
+
+    AmbariConfigurationDAO dao = injector.getInstance(AmbariConfigurationDAO.class);
+    expect(dao.findByCategory(CATEGORY_NAME_1)).andReturn(createEntities(CATEGORY_NAME_1, properties)).once();
+
+    replayAll();
+
+    SecurityContextHolder.getContext().setAuthentication(authentication);
+
+    Set<Resource> response = resourceProvider.getResources(request, predicate);
+
+    verifyAll();
+
+    Assert.assertNotNull(response);
+    Assert.assertEquals(1, response.size());
+
+    Resource resource = response.iterator().next();
+    Assert.assertEquals(Resource.Type.RootServiceComponentConfiguration, resource.getType());
+
+    Map<String, Map<String, Object>> propertiesMap = resource.getPropertiesMap();
+    Assert.assertEquals(2, propertiesMap.size());
+
+    Assert.assertEquals(CATEGORY_NAME_1, propertiesMap.get(RootServiceComponentConfigurationResourceProvider.RESOURCE_KEY).get("category"));
+
+    Map<String, Object> retrievedProperties = propertiesMap.get(RootServiceComponentConfigurationResourceProvider.RESOURCE_KEY + "/properties");
+    Assert.assertEquals(2, retrievedProperties.size());
+
+    for (Map.Entry<String, String> entry : properties.entrySet()) {
+      Assert.assertEquals(entry.getValue(), retrievedProperties.get(entry.getKey()));
+    }
+  }
+
+  @Test
+  public void testUpdateResources_Administrator() throws Exception {
+    testUpdateResources(TestAuthenticationFactory.createAdministrator());
+  }
+
+  @Test(expected = AuthorizationException.class)
+  public void testUpdateResources_ClusterAdministrator() throws Exception {
+    testUpdateResources(TestAuthenticationFactory.createClusterAdministrator());
+  }
+
+  @Test(expected = AuthorizationException.class)
+  public void testUpdateResources_ClusterOperator() throws Exception {
+    testUpdateResources(TestAuthenticationFactory.createClusterOperator());
+  }
+
+  @Test(expected = AuthorizationException.class)
+  public void testUpdateResources_ServiceAdministrator() throws Exception {
+    testUpdateResources(TestAuthenticationFactory.createServiceAdministrator());
+  }
+
+  @Test(expected = AuthorizationException.class)
+  public void testUpdateResources_ServiceOperator() throws Exception {
+    testUpdateResources(TestAuthenticationFactory.createServiceOperator());
+  }
+
+  private void testUpdateResources(Authentication authentication) throws Exception {
+    Injector injector = createInjector();
+
+    ResourceProvider resourceProvider = injector.getInstance(RootServiceComponentConfigurationResourceProvider.class);
+
+    Predicate predicate = createPredicate(RootService.AMBARI.name(), RootComponent.AMBARI_SERVER.name(), CATEGORY_NAME_1);
+
+    Set<Map<String, Object>> propertySets = new HashSet<>();
+
+    Map<String, String> properties1 = new HashMap<>();
+    properties1.put("property1a", "value1");
+    properties1.put("property2a", "value2");
+    propertySets.add(toRequestProperties(CATEGORY_NAME_1, properties1));
+
+    Request request = createMock(Request.class);
+    expect(request.getProperties()).andReturn(propertySets).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();
+
+    AmbariEventPublisher publisher = injector.getInstance(AmbariEventPublisher.class);
+    publisher.publish(anyObject(AmbariConfigurationChangedEvent.class));
+    expectLastCall().times(1);
+
+    replayAll();
+
+    SecurityContextHolder.getContext().setAuthentication(authentication);
+
+    resourceProvider.updateResources(request, predicate);
+
+    verifyAll();
+
+    validateCapturedProperties(properties1, capturedProperties1);
+  }
+
+  private Predicate createPredicate(String serviceName, String componentName, String categoryName) {
+    Predicate predicateService = new PredicateBuilder()
+        .property(CONFIGURATION_SERVICE_NAME_PROPERTY_ID)
+        .equals(serviceName)
+        .toPredicate();
+    Predicate predicateComponent = new PredicateBuilder()
+        .property(CONFIGURATION_COMPONENT_NAME_PROPERTY_ID)
+        .equals(componentName)
+        .toPredicate();
+    Predicate predicateCategory = new PredicateBuilder()
+        .property(CONFIGURATION_CATEGORY_PROPERTY_ID)
+        .equals(categoryName)
+        .toPredicate();
+    return new AndPredicate(predicateService, predicateComponent, predicateCategory);
+  }
+
+  private List<AmbariConfigurationEntity> createEntities(String categoryName, Map<String, String> properties) {
+    List<AmbariConfigurationEntity> entities = new ArrayList<>();
+
+    for (Map.Entry<String, String> property : properties.entrySet()) {
+      AmbariConfigurationEntity entity = new AmbariConfigurationEntity();
+      entity.setCategoryName(categoryName);
+      entity.setPropertyName(property.getKey());
+      entity.setPropertyValue(property.getValue());
+      entities.add(entity);
+    }
+
+    return entities;
+  }
+
+  private Map<String, Object> toRequestProperties(String categoryName1, Map<String, String> properties) {
+    Map<String, Object> requestProperties = new HashMap<>();
+    requestProperties.put(CONFIGURATION_SERVICE_NAME_PROPERTY_ID, "AMBARI");
+    requestProperties.put(CONFIGURATION_COMPONENT_NAME_PROPERTY_ID, "AMBARI_SERVER");
+    requestProperties.put(CONFIGURATION_CATEGORY_PROPERTY_ID, categoryName1);
+    for (Map.Entry<String, String> entry : properties.entrySet()) {
+      requestProperties.put(CONFIGURATION_PROPERTIES_PROPERTY_ID + "/" + entry.getKey(), entry.getValue());
+    }
+    return requestProperties;
+  }
+
+  private void validateCapturedProperties(Map<String, String> expectedProperties, Capture<Map<String, String>> capturedProperties) {
+    Assert.assertTrue(capturedProperties.hasCaptured());
+
+    Map<String, String> properties = capturedProperties.getValue();
+    Assert.assertNotNull(properties);
+
+    // Convert the Map to a TreeMap to help with comparisons
+    expectedProperties = new TreeMap<>(expectedProperties);
+    properties = new TreeMap<>(properties);
+    Assert.assertEquals(expectedProperties, properties);
+  }
+
+  private Injector createInjector() throws Exception {
+    return Guice.createInjector(new AbstractModule() {
+      @Override
+      protected void configure() {
+        bind(EntityManager.class).toInstance(createNiceMock(EntityManager.class));
+        bind(AmbariConfigurationDAO.class).toInstance(createMock(AmbariConfigurationDAO.class));
+        bind(AmbariEventPublisher.class).toInstance(createMock(AmbariEventPublisher.class));
+      }
+    });
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RootServiceComponentPropertyProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RootServiceComponentPropertyProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RootServiceComponentPropertyProviderTest.java
index a202516..d3f9bd1 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RootServiceComponentPropertyProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RootServiceComponentPropertyProviderTest.java
@@ -24,7 +24,8 @@ import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
 
-import org.apache.ambari.server.controller.RootServiceResponseFactory;
+import org.apache.ambari.server.controller.RootComponent;
+import org.apache.ambari.server.controller.RootService;
 import org.apache.ambari.server.controller.spi.Request;
 import org.apache.ambari.server.controller.spi.Resource;
 import org.apache.ambari.server.controller.utilities.PropertyHelper;
@@ -34,27 +35,27 @@ import org.junit.Test;
 public class RootServiceComponentPropertyProviderTest {
   @Test
   public void testPopulateResources_AmbariServer_None() throws Exception {
-    testPopulateResources(RootServiceResponseFactory.Components.AMBARI_SERVER.name(), false, false, false, false);
+    testPopulateResources(RootComponent.AMBARI_SERVER.name(), false, false, false, false);
   }
 
   @Test
   public void testPopulateResources_AmbariServer_CiphersAndJCEPolicy() throws Exception {
-    testPopulateResources(RootServiceResponseFactory.Components.AMBARI_SERVER.name(), true, true, true, true);
+    testPopulateResources(RootComponent.AMBARI_SERVER.name(), true, true, true, true);
   }
 
   @Test
   public void testPopulateResources_AmbariServer_JCEPolicy() throws Exception {
-    testPopulateResources(RootServiceResponseFactory.Components.AMBARI_SERVER.name(), false, true, false, true);
+    testPopulateResources(RootComponent.AMBARI_SERVER.name(), false, true, false, true);
   }
 
   @Test
   public void testPopulateResources_AmbariServer_Ciphers() throws Exception {
-    testPopulateResources(RootServiceResponseFactory.Components.AMBARI_SERVER.name(), true, false, true, false);
+    testPopulateResources(RootComponent.AMBARI_SERVER.name(), true, false, true, false);
   }
 
   @Test
   public void testPopulateResources_AmbariAgent_CiphersAndJCEPolicy() throws Exception {
-    testPopulateResources(RootServiceResponseFactory.Components.AMBARI_AGENT.name(), true, true, false, false);
+    testPopulateResources(RootComponent.AMBARI_AGENT.name(), true, true, false, false);
   }
 
   public void testPopulateResources(String componentName,
@@ -64,7 +65,7 @@ public class RootServiceComponentPropertyProviderTest {
     Resource resource = new ResourceImpl(Resource.Type.RootService);
 
     resource.setProperty(RootServiceComponentResourceProvider.COMPONENT_NAME_PROPERTY_ID, componentName);
-    resource.setProperty(RootServiceComponentResourceProvider.SERVICE_NAME_PROPERTY_ID, RootServiceResponseFactory.Services.AMBARI.name());
+    resource.setProperty(RootServiceComponentResourceProvider.SERVICE_NAME_PROPERTY_ID, RootService.AMBARI.name());
 
     HashSet<String> requestIds = new HashSet<>();
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RootServiceComponentResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RootServiceComponentResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RootServiceComponentResourceProviderTest.java
index 222340b..4316647 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RootServiceComponentResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RootServiceComponentResourceProviderTest.java
@@ -29,8 +29,9 @@ import java.util.Map;
 import java.util.Set;
 
 import org.apache.ambari.server.controller.AmbariManagementController;
+import org.apache.ambari.server.controller.RootComponent;
+import org.apache.ambari.server.controller.RootService;
 import org.apache.ambari.server.controller.RootServiceComponentResponse;
-import org.apache.ambari.server.controller.RootServiceResponseFactory;
 import org.apache.ambari.server.controller.spi.Predicate;
 import org.apache.ambari.server.controller.spi.Request;
 import org.apache.ambari.server.controller.spi.Resource;
@@ -50,12 +51,12 @@ public class RootServiceComponentResourceProviderTest {
     AmbariManagementController managementController = createMock(AmbariManagementController.class);
 
     Set<RootServiceComponentResponse> allResponse = new HashSet<>();
-    String serviceName = RootServiceResponseFactory.Services.AMBARI.name();
+    String serviceName = RootService.AMBARI.name();
     Map<String, String> emptyMap = Collections.emptyMap();
     allResponse.add(new RootServiceComponentResponse(serviceName, "component1", "1.1.1", emptyMap));
     allResponse.add(new RootServiceComponentResponse(serviceName, "component2", "1.1.1", emptyMap));
     allResponse.add(new RootServiceComponentResponse(serviceName, "component3", "1.1.1", emptyMap));
-    allResponse.add(new RootServiceComponentResponse(serviceName, RootServiceResponseFactory.Components.AMBARI_SERVER.name(), "1.1.1", emptyMap));
+    allResponse.add(new RootServiceComponentResponse(serviceName, RootComponent.AMBARI_SERVER.name(), "1.1.1", emptyMap));
 
     Set<RootServiceComponentResponse> nameResponse = new HashSet<>();
     nameResponse.add(new RootServiceComponentResponse(serviceName, "component4", "1.1.1", emptyMap));
@@ -92,7 +93,7 @@ public class RootServiceComponentResourceProviderTest {
       String componentName = (String) resource.getPropertyValue(RootServiceComponentResourceProvider.COMPONENT_NAME_PROPERTY_ID);
       String componentVersion = (String) resource.getPropertyValue(RootServiceComponentResourceProvider.COMPONENT_VERSION_PROPERTY_ID);
       Long server_clock = (Long) resource.getPropertyValue(RootServiceComponentResourceProvider.SERVER_CLOCK_PROPERTY_ID);
-      if (componentName.equals(RootServiceResponseFactory.Components.AMBARI_SERVER.name())){
+      if (componentName.equals(RootComponent.AMBARI_SERVER.name())){
         Assert.assertNotNull(server_clock);
       } else {
         Assert.assertNull(server_clock);

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/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 30f5e22..3917cdf 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
@@ -125,8 +125,8 @@ public class LdapModuleFunctionalTest {
     return ldapPropsMap;
   }
 
-  private static Map<String, Object> getADProps() {
-    Map<String, Object> ldapPropsMap = Maps.newHashMap();
+  private static Map<String, String> getADProps() {
+    Map<String, String> ldapPropsMap = Maps.newHashMap();
 
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/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
index aa26498..1082250 100644
--- 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
@@ -23,7 +23,7 @@ import java.util.Map;
 public class TestAmbariLdapConfigurationFactory implements AmbariLdapConfigurationFactory {
 
   @Override
-  public AmbariLdapConfiguration createLdapConfiguration(Map<String, Object> configuration) {
+  public AmbariLdapConfiguration createLdapConfiguration(Map<String, String> configuration) {
     return new AmbariLdapConfiguration(configuration);
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/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 db0e5a9..97ce30e 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
@@ -163,12 +163,12 @@ public class AmbariLdapFacadeTest extends EasyMockSupport {
   public void testShouldLdapAttributeDetectionDelegateToTheRightServiceCalls() throws Exception {
 
     // configuration map with user attributes detected
-    Map<String, Object> userConfigMap = Maps.newHashMap();
+    Map<String, String> userConfigMap = Maps.newHashMap();
     userConfigMap.put(AmbariLdapConfigKeys.USER_NAME_ATTRIBUTE.key(), "uid");
     AmbariLdapConfiguration userAttrDecoratedConfig = ambariLdapConfigurationFactory.createLdapConfiguration(userConfigMap);
 
     // configuration map with user+group attributes detected
-    Map<String, Object> groupConfigMap = Maps.newHashMap(userConfigMap);
+    Map<String, String> groupConfigMap = Maps.newHashMap(userConfigMap);
     groupConfigMap.put(AmbariLdapConfigKeys.GROUP_NAME_ATTRIBUTE.key(), "dn");
     AmbariLdapConfiguration groupAttrDecoratedConfig = ambariLdapConfigurationFactory.createLdapConfiguration(groupConfigMap);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/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 09dea1c..a44bf7c 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
@@ -78,7 +78,7 @@ public class DefaultLdapAttributeDetectionServiceTest extends EasyMockSupport {
   @SuppressWarnings("unchecked")
   public void shouldLdapUserAttributeDetection() throws Exception {
     // GIVEN
-    Map<String, Object> configMap = Maps.newHashMap();
+    Map<String, String> configMap = Maps.newHashMap();
     configMap.put(AmbariLdapConfigKeys.USER_SEARCH_BASE.key(), "dc=example,dc=com");
     AmbariLdapConfiguration ldapConfiguration = ldapConfigurationFactory.createLdapConfiguration(configMap);
 
@@ -109,7 +109,7 @@ public class DefaultLdapAttributeDetectionServiceTest extends EasyMockSupport {
   @Test(expected = AmbariLdapException.class)
   public void testShouldUserAttributeDetectionFailWhenLdapOerationFails() throws Exception {
     // GIVEN
-    Map<String, Object> configMap = Maps.newHashMap();
+    Map<String, String> configMap = Maps.newHashMap();
     configMap.put(AmbariLdapConfigKeys.USER_SEARCH_BASE.key(), "dc=example,dc=com");
     AmbariLdapConfiguration ldapConfiguration = ldapConfigurationFactory.createLdapConfiguration(configMap);
 
@@ -129,7 +129,7 @@ public class DefaultLdapAttributeDetectionServiceTest extends EasyMockSupport {
   @SuppressWarnings("unchecked")
   public void shouldLdapGroupAttributeDetection() throws Exception {
     // GIVEN
-    Map<String, Object> configMap = Maps.newHashMap();
+    Map<String, String> configMap = Maps.newHashMap();
     configMap.put(AmbariLdapConfigKeys.GROUP_SEARCH_BASE.key(), "dc=example,dc=com");
     AmbariLdapConfiguration ldapConfiguration = ldapConfigurationFactory.createLdapConfiguration(configMap);
 
@@ -160,7 +160,7 @@ public class DefaultLdapAttributeDetectionServiceTest extends EasyMockSupport {
   @Test(expected = AmbariLdapException.class)
   public void testShouldGroupAttributeDetectionFailWhenLdapOerationFails() throws Exception {
     // GIVEN
-    Map<String, Object> configMap = Maps.newHashMap();
+    Map<String, String> configMap = Maps.newHashMap();
     configMap.put(AmbariLdapConfigKeys.GROUP_SEARCH_BASE.key(), "dc=example,dc=com");
     AmbariLdapConfiguration ldapConfiguration = ldapConfigurationFactory.createLdapConfiguration(configMap);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/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 4d6d2a6..ec78e56 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
@@ -102,7 +102,7 @@ public class DefaultLdapConfigurationServiceTest extends EasyMockSupport {
   @Test
   public void testShouldUserAttributeConfigurationCheckSucceedWhenUserDnIsFound() throws Exception {
     // GIVEN
-    Map<String, Object> configMap = Maps.newHashMap();
+    Map<String, String> configMap = Maps.newHashMap();
     configMap.put(AmbariLdapConfigKeys.USER_OBJECT_CLASS.key(), "person");
     configMap.put(AmbariLdapConfigKeys.USER_NAME_ATTRIBUTE.key(), "uid");
 
@@ -126,7 +126,7 @@ public class DefaultLdapConfigurationServiceTest extends EasyMockSupport {
   @Test(expected = AmbariLdapException.class)
   public void testShouldUserAttributeConfigurationCheckFailWhenNoUsersFound() throws Exception {
     // GIVEN
-    Map<String, Object> configMap = Maps.newHashMap();
+    Map<String, String> configMap = Maps.newHashMap();
     configMap.put(AmbariLdapConfigKeys.USER_OBJECT_CLASS.key(), "posixAccount");
     configMap.put(AmbariLdapConfigKeys.USER_NAME_ATTRIBUTE.key(), "dn");
 
@@ -155,7 +155,7 @@ public class DefaultLdapConfigurationServiceTest extends EasyMockSupport {
   public void testShouldGroupAttributeConfigurationCheckSucceedWhenGroupForUserDnIsFound() throws Exception {
     // GIVEN
 
-    Map<String, Object> configMap = groupConfigObjectMap();
+    Map<String, String> configMap = groupConfigObjectMap();
 
     SearchRequest sr = new SearchRequestImpl();
 
@@ -184,7 +184,7 @@ public class DefaultLdapConfigurationServiceTest extends EasyMockSupport {
   public void testShouldGroupAttributeConfigurationCheckFailWhenNoGroupsForUserDnFound() throws Exception {
     // GIVEN
 
-    Map<String, Object> configMap = groupConfigObjectMap();
+    Map<String, String> configMap = groupConfigObjectMap();
 
     SearchRequest sr = new SearchRequestImpl();
 
@@ -208,8 +208,8 @@ public class DefaultLdapConfigurationServiceTest extends EasyMockSupport {
 
   }
 
-  private Map<String, Object> groupConfigObjectMap() {
-    Map<String, Object> configMap = Maps.newHashMap();
+  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");

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/test/java/org/apache/ambari/server/metadata/AgentAlertDefinitionsTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/metadata/AgentAlertDefinitionsTest.java b/ambari-server/src/test/java/org/apache/ambari/server/metadata/AgentAlertDefinitionsTest.java
index adaf236..cb234ea 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/metadata/AgentAlertDefinitionsTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/metadata/AgentAlertDefinitionsTest.java
@@ -22,7 +22,7 @@ import java.util.List;
 import javax.persistence.EntityManager;
 
 import org.apache.ambari.server.H2DatabaseCleaner;
-import org.apache.ambari.server.controller.RootServiceResponseFactory.Components;
+import org.apache.ambari.server.controller.RootComponent;
 import org.apache.ambari.server.orm.GuiceJpaInitializer;
 import org.apache.ambari.server.orm.InMemoryDefaultTestModule;
 import org.apache.ambari.server.state.alert.AlertDefinition;
@@ -63,7 +63,7 @@ public class AgentAlertDefinitionsTest {
     Assert.assertEquals(3, definitions.size());
 
     for( AlertDefinition definition : definitions){
-      Assert.assertEquals(Components.AMBARI_AGENT.name(),
+      Assert.assertEquals(RootComponent.AMBARI_AGENT.name(),
           definition.getComponentName());
 
       Assert.assertEquals("AMBARI", definition.getServiceName());
@@ -80,7 +80,7 @@ public class AgentAlertDefinitionsTest {
     Assert.assertEquals(4, definitions.size());
 
     for (AlertDefinition definition : definitions) {
-      Assert.assertEquals(Components.AMBARI_SERVER.name(),
+      Assert.assertEquals(RootComponent.AMBARI_SERVER.name(),
           definition.getComponentName());
 
       Assert.assertEquals("AMBARI", definition.getServiceName());

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AlertDefinitionDAOTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AlertDefinitionDAOTest.java b/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AlertDefinitionDAOTest.java
index d559e0c..9ebc2e5 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AlertDefinitionDAOTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AlertDefinitionDAOTest.java
@@ -31,7 +31,8 @@ import java.util.TimeZone;
 import java.util.UUID;
 
 import org.apache.ambari.server.H2DatabaseCleaner;
-import org.apache.ambari.server.controller.RootServiceResponseFactory;
+import org.apache.ambari.server.controller.RootComponent;
+import org.apache.ambari.server.controller.RootService;
 import org.apache.ambari.server.orm.GuiceJpaInitializer;
 import org.apache.ambari.server.orm.InMemoryDefaultTestModule;
 import org.apache.ambari.server.orm.OrmTestHelper;
@@ -148,8 +149,8 @@ public class AlertDefinitionDAOTest {
     for (; i < 15; i++) {
       AlertDefinitionEntity definition = new AlertDefinitionEntity();
       definition.setDefinitionName("Alert Definition " + i);
-      definition.setServiceName(RootServiceResponseFactory.Services.AMBARI.name());
-      definition.setComponentName(RootServiceResponseFactory.Components.AMBARI_AGENT.name());
+      definition.setServiceName(RootService.AMBARI.name());
+      definition.setComponentName(RootComponent.AMBARI_AGENT.name());
       definition.setClusterId(clusterId);
       definition.setHash(UUID.randomUUID().toString());
       definition.setScheduleInterval(60);

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertReceivedListenerTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertReceivedListenerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertReceivedListenerTest.java
index 3ec6943..3056dd1 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertReceivedListenerTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertReceivedListenerTest.java
@@ -30,8 +30,8 @@ import javax.persistence.EntityManager;
 
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.H2DatabaseCleaner;
-import org.apache.ambari.server.controller.RootServiceResponseFactory.Components;
-import org.apache.ambari.server.controller.RootServiceResponseFactory.Services;
+import org.apache.ambari.server.controller.RootComponent;
+import org.apache.ambari.server.controller.RootService;
 import org.apache.ambari.server.events.AlertReceivedEvent;
 import org.apache.ambari.server.events.AlertStateChangeEvent;
 import org.apache.ambari.server.events.listeners.alerts.AlertReceivedListener;
@@ -335,8 +335,8 @@ public class AlertReceivedListenerTest {
   @Test
   public void testAgentAlertFromInvalidHost() {
     String definitionName = ALERT_DEFINITION + "1";
-    String serviceName = Services.AMBARI.name();
-    String componentName = Components.AMBARI_AGENT.name();
+    String serviceName = RootService.AMBARI.name();
+    String componentName = RootComponent.AMBARI_AGENT.name();
 
     Alert alert = new Alert(definitionName, null, serviceName, componentName, HOST1,
         AlertState.OK);
@@ -374,8 +374,8 @@ public class AlertReceivedListenerTest {
   @Test
   public void testAmbariServerValidAlerts() {
     String definitionName = ALERT_DEFINITION + "1";
-    String serviceName = Services.AMBARI.name();
-    String componentName = Components.AMBARI_SERVER.name();
+    String serviceName = RootService.AMBARI.name();
+    String componentName = RootComponent.AMBARI_SERVER.name();
 
     Alert alert = new Alert(definitionName, null, serviceName, componentName, HOST1,
         AlertState.OK);
@@ -415,8 +415,8 @@ public class AlertReceivedListenerTest {
   @Test
   public void testMissingClusterAndInvalidHost() {
     String definitionName = ALERT_DEFINITION + "1";
-    String serviceName = Services.AMBARI.name();
-    String componentName = Components.AMBARI_AGENT.name();
+    String serviceName = RootService.AMBARI.name();
+    String componentName = RootComponent.AMBARI_AGENT.name();
 
     Alert alert1 = new Alert(definitionName, null, serviceName, componentName, HOST1,
         AlertState.OK);

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertStateChangedEventTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertStateChangedEventTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertStateChangedEventTest.java
index bc8222c..c3db717 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertStateChangedEventTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertStateChangedEventTest.java
@@ -24,7 +24,7 @@ import java.util.List;
 import java.util.Set;
 
 import org.apache.ambari.server.H2DatabaseCleaner;
-import org.apache.ambari.server.controller.RootServiceResponseFactory.Services;
+import org.apache.ambari.server.controller.RootService;
 import org.apache.ambari.server.events.AggregateAlertRecalculateEvent;
 import org.apache.ambari.server.events.AlertEvent;
 import org.apache.ambari.server.events.AlertStateChangeEvent;
@@ -501,7 +501,7 @@ public class AlertStateChangedEventTest extends EasyMockSupport {
     // create the definition for the AMBARI service
     AlertDefinitionEntity definition = createNiceMock(AlertDefinitionEntity.class);
     EasyMock.expect(definition.getDefinitionId()).andReturn(1L).anyTimes();
-    EasyMock.expect(definition.getServiceName()).andReturn(Services.AMBARI.name()).anyTimes();
+    EasyMock.expect(definition.getServiceName()).andReturn(RootService.AMBARI.name()).anyTimes();
     EasyMock.expect(definition.getLabel()).andReturn("ambari-foo-alert").anyTimes();
     EasyMock.expect(definition.getDescription()).andReturn("Ambari Foo Alert").anyTimes();
 


[22/50] [abbrv] ambari git commit: AMBARI-22439 Host check operation is being performed on all hosts during host add should not get stuck. (atkach)

Posted by am...@apache.org.
AMBARI-22439 Host check operation is being performed on all hosts during host add should not get stuck. (atkach)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: d0ef1449af23e22ee6b95726ce4ca0b1f3544cc4
Parents: d11faab
Author: Andrii Tkach <at...@apache.org>
Authored: Tue Nov 14 18:11:56 2017 +0200
Committer: Andrii Tkach <at...@apache.org>
Committed: Tue Nov 14 18:11:56 2017 +0200

----------------------------------------------------------------------
 ambari-web/app/mixins/main/host/details/actions/check_host.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d0ef1449/ambari-web/app/mixins/main/host/details/actions/check_host.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/main/host/details/actions/check_host.js b/ambari-web/app/mixins/main/host/details/actions/check_host.js
index 2e2e021..66baf5a 100644
--- a/ambari-web/app/mixins/main/host/details/actions/check_host.js
+++ b/ambari-web/app/mixins/main/host/details/actions/check_host.js
@@ -111,6 +111,8 @@ App.CheckHostMixin = Em.Mixin.create({
    */
   warningsTimeInterval: 60000,
 
+  finishStates: ["FAILED", "COMPLETED", "TIMEDOUT", "ABORTED"],
+
   /**
    * disables host check on Add host wizard as per the experimental flag
    */
@@ -206,7 +208,7 @@ App.CheckHostMixin = Em.Mixin.create({
       //if resolution host check has corrupted data then skip it
       return this.getGeneralHostCheck();
     }
-    if (["FAILED", "COMPLETED", "TIMEDOUT"].contains(data.Requests.request_status)) {
+    if (this.get('finishStates').contains(data.Requests.request_status)) {
       if (data.Requests.inputs.indexOf("last_agent_env_check") != -1) {
         this.set('stopChecking', true);
         this.set('hostsPackagesData', data.tasks.map(function (task) {
@@ -369,7 +371,7 @@ App.CheckHostMixin = Em.Mixin.create({
     data.tasks.forEach(function (task) {
       var name = Em.I18n.t('installer.step3.hostWarningsPopup.resolution.validation.error');
       var hostInfo = this.get("hostCheckWarnings").findProperty('name', name);
-      if (["FAILED", "COMPLETED", "TIMEDOUT"].contains(task.Tasks.status)) {
+      if (this.get('finishStates').contains(task.Tasks.status)) {
         if (task.Tasks.status === "COMPLETED" && !!Em.get(task, "Tasks.structured_out.host_resolution_check.failed_count")) {
           var targetHostName = Em.get(task, "Tasks.host_name");
           var relatedHostNames = Em.get(task, "Tasks.structured_out.host_resolution_check.hosts_with_failures") || [];


[31/50] [abbrv] ambari git commit: AMBARI-22455 Ambari Logsearch Web unit tests are sometimes failing. (ababiichuk)

Posted by am...@apache.org.
AMBARI-22455 Ambari Logsearch Web unit tests are sometimes failing. (ababiichuk)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 2d81d49fb3cc5fefbed079e7994cea7b41c5a125
Parents: 1a99da4
Author: ababiichuk <ab...@hortonworks.com>
Authored: Wed Nov 15 17:37:19 2017 +0200
Committer: ababiichuk <ab...@hortonworks.com>
Committed: Wed Nov 15 18:16:16 2017 +0200

----------------------------------------------------------------------
 .../src/app/services/auth.service.spec.ts       | 123 ++++++++++---------
 1 file changed, 62 insertions(+), 61 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2d81d49f/ambari-logsearch/ambari-logsearch-web/src/app/services/auth.service.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/services/auth.service.spec.ts b/ambari-logsearch/ambari-logsearch-web/src/app/services/auth.service.spec.ts
index a465c10..fd5a83e 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/services/auth.service.spec.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/services/auth.service.spec.ts
@@ -16,9 +16,12 @@
  * limitations under the License.
  */
 
-import {TestBed, inject} from '@angular/core/testing';
+import {TestBed, inject, async} from '@angular/core/testing';
 import {HttpModule} from '@angular/http';
 import {Observable} from 'rxjs/Observable';
+import 'rxjs/add/operator/first';
+import 'rxjs/add/operator/last';
+import 'rxjs/add/operator/take';
 import {StoreModule} from '@ngrx/store';
 import {AppStateService, appState} from '@app/services/storage/app-state.service';
 import {AuthService} from '@app/services/auth.service';
@@ -26,49 +29,37 @@ import {HttpClientService} from '@app/services/http-client.service';
 
 describe('AuthService', () => {
 
-  let successResponse = {
-    type: 'default',
-    ok: true,
-    url: '/',
-    status: 200,
-    statusText: 'OK',
-    bytesLoaded: 100,
-    totalBytes: 100,
-    headers: null
-  };
-  let errorResponse = {
-    type: 'error',
-    ok: false,
-    url: '/',
-    status: 401,
-    statusText: 'ERROR',
-    bytesLoaded: 100,
-    totalBytes: 100,
-    headers: null
+  const successResponse = {
+      type: 'default',
+      ok: true,
+      url: '/',
+      status: 200,
+      statusText: 'OK',
+      bytesLoaded: 100,
+      totalBytes: 100,
+      headers: null
+    },
+    errorResponse = {
+      type: 'error',
+      ok: false,
+      url: '/',
+      status: 401,
+      statusText: 'ERROR',
+      bytesLoaded: 100,
+      totalBytes: 100,
+      headers: null
+    };
+
+  // Note: We add delay to help the isLoginInProgress test case.
+  let httpServiceStub = {
+    isError: false,
+    postFormData: function () {
+      const isError = this.isError;
+      return Observable.create(observer => observer.next(isError ? errorResponse : successResponse)).delay(1000);
+    }
   };
-  let currentResponse = successResponse;
-  let httpServiceStub;
-  let authService: AuthService;
 
   beforeEach(() => {
-    // Note: We add delay to help the isLoginInProgress test case.
-    httpServiceStub = {
-      postFormData: function () {
-        return Observable.create(observer => {
-          observer.next(currentResponse);
-        }).delay(1000);
-      },
-      post: function () {
-        return Observable.create(observer => {
-          observer.next(currentResponse);
-        }).delay(1000);
-      },
-      get: function () {
-        return Observable.create(observer => {
-          observer.next(currentResponse);
-        }).delay(1000);
-      }
-    };
     TestBed.configureTestingModule({
       imports: [
         HttpModule,
@@ -82,51 +73,61 @@ describe('AuthService', () => {
         {provide: HttpClientService, useValue: httpServiceStub}
       ]
     });
-    authService = TestBed.get(AuthService);
   });
 
   it('should create service', inject([AuthService], (service: AuthService) => {
     expect(service).toBeTruthy();
   }));
 
-  it('should set the isAuthorized state to true in appState when the login is success', inject(
-    [AppStateService],
-    (appStateService: AppStateService) => {
-      currentResponse = successResponse;
+  it('should set the isAuthorized state to true in appState when the login is success', async(inject(
+    [AuthService, AppStateService, HttpClientService],
+    (authService: AuthService, appStateService: AppStateService, httpClientService) => {
+      httpClientService.isError = false;
       authService.login('test', 'test')
         .subscribe(() => {
-          appStateService.getParameter('isAuthorized').subscribe((value) => {
+          appStateService.getParameter('isAuthorized').subscribe((value: Boolean): void => {
             expect(value).toBe(true);
           });
-        }, (value) => {
+        }, value => {
           throw value;
         });
     }
-  ));
+  )));
 
 
-  it('should set the isAuthorized state to false in appState when the login is failed', inject(
-    [AppStateService],
-    (appStateService: AppStateService) => {
-      currentResponse = errorResponse;
+  it('should set the isAuthorized state to false in appState when the login is failed', async(inject(
+    [AuthService, AppStateService, HttpClientService],
+    (authService: AuthService, appStateService: AppStateService, httpClientService) => {
+      httpClientService.isError = true;
       authService.login('test', 'test')
         .subscribe(() => {
-          appStateService.getParameter('isAuthorized').subscribe((value) => {
+          appStateService.getParameter('isAuthorized').subscribe((value: Boolean): void => {
             expect(value).toBe(false);
           });
         });
     }
-  ));
+  )));
 
-  it('should set the isLoginInProgress state to true when the login started.', inject(
-    [AppStateService],
-    (appStateService: AppStateService) => {
-      currentResponse = successResponse;
+  it('should set the isLoginInProgress state to true when the login started', async(inject(
+    [AuthService, AppStateService, HttpClientService],
+    (authService: AuthService, appStateService: AppStateService, httpClientService) => {
+      httpClientService.isError = false;
       authService.login('test', 'test');
-      appStateService.getParameter('isLoginInProgress').subscribe((value) => {
+      appStateService.getParameter('isLoginInProgress').first().subscribe((value: Boolean): void => {
         expect(value).toBe(true);
       });
     }
-  ));
+  )));
+
+  it('should set the isLoginInProgress state to true after the login is success', async(inject(
+    [AuthService, AppStateService, HttpClientService],
+    (authService: AuthService, appStateService: AppStateService, httpClientService) => {
+      httpClientService.isError = false;
+      authService.login('test', 'test');
+      appStateService.getParameter('isLoginInProgress').take(2).last().subscribe((value: Boolean): void => {
+        expect(value).toBe(false);
+      });
+    }
+  )));
 
 });


[15/50] [abbrv] ambari git commit: AMBARI-22387. Create a Pre-Upgrade Check Warning About LZO (dlysnichenko)

Posted by am...@apache.org.
AMBARI-22387. Create a Pre-Upgrade Check Warning About LZO (dlysnichenko)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 76349ac20d8955b3f25383b6f4f209a690b38bef
Parents: 5122671
Author: Lisnichenko Dmitro <dl...@hortonworks.com>
Authored: Mon Nov 13 13:29:52 2017 +0200
Committer: Lisnichenko Dmitro <dl...@hortonworks.com>
Committed: Mon Nov 13 13:30:26 2017 +0200

----------------------------------------------------------------------
 .../ambari/server/checks/CheckDescription.java  |   9 ++
 .../apache/ambari/server/checks/LZOCheck.java   |  77 ++++++++++
 .../HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml |   1 +
 .../stacks/HDP/2.3/upgrades/upgrade-2.6.xml     |   1 +
 .../HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml |   1 +
 .../stacks/HDP/2.4/upgrades/upgrade-2.6.xml     |   1 +
 .../HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml |   1 +
 .../stacks/HDP/2.5/upgrades/upgrade-2.6.xml     |   1 +
 .../HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml |   1 +
 .../stacks/HDP/2.6/upgrades/upgrade-2.6.xml     |   1 +
 .../ambari/server/checks/LZOCheckTest.java      | 145 +++++++++++++++++++
 11 files changed, 239 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/76349ac2/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java b/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
index 3caac14..20bb1b0 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
@@ -327,6 +327,15 @@ public class CheckDescription {
         "As Ranger is SSL enabled, Ranger SSL configurations will need to be changed from default value of /etc/ranger/*/conf folder to /etc/ranger/security. " +
         "Since the certificates/keystores/truststores in this path may affect the upgrade/downgrade process, it is recommended to manually move the certificates/keystores/truststores out of the conf folders and change the appropriate config values before proceeding.").build());
 
+  public static CheckDescription LZO_CONFIG_CHECK = new CheckDescription("LZO_CONFIG_CHECK",
+      PrereqCheckType.CLUSTER,
+      "LZO Codec Check",
+      new ImmutableMap.Builder<String, String>()
+          .put(AbstractCheckDescriptor.DEFAULT,
+              "You have LZO codec enabled in the core-site config of your cluster. LZO is no longer installed automatically. " +
+                  "If any hosts require LZO, it should be installed before starting the upgrade. " +
+                  "Consult Ambari documentation for instructions on how to do this.").build());
+
   public static CheckDescription JAVA_VERSION = new CheckDescription("JAVA_VERSION",
       PrereqCheckType.CLUSTER,
       "Verify Java version requirement",

http://git-wip-us.apache.org/repos/asf/ambari/blob/76349ac2/ambari-server/src/main/java/org/apache/ambari/server/checks/LZOCheck.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/LZOCheck.java b/ambari-server/src/main/java/org/apache/ambari/server/checks/LZOCheck.java
new file mode 100644
index 0000000..3000b79
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/LZOCheck.java
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ambari.server.checks;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.ambari.server.AmbariException;
+import org.apache.ambari.server.controller.PrereqCheckRequest;
+import org.apache.ambari.server.state.stack.PrereqCheckStatus;
+import org.apache.ambari.server.state.stack.PrerequisiteCheck;
+import org.apache.commons.lang.StringUtils;
+
+import com.google.inject.Singleton;
+
+/**
+ * The {@link LZOCheck}
+ * is used to check that the LZO codec enabled in the core-site config fnd warning if any hosts require LZO, it should be installed before starting the upgrade.
+ */
+@Singleton
+@UpgradeCheck(group = UpgradeCheckGroup.INFORMATIONAL_WARNING)
+public class LZOCheck extends AbstractCheckDescriptor {
+
+  final static String IO_COMPRESSION_CODECS = "io.compression.codecs";
+  final static String LZO_ENABLE_KEY = "io.compression.codec.lzo.class";
+  final static String LZO_ENABLE_VALUE = "com.hadoop.compression.lzo.LzoCodec";
+
+  /**
+   * Constructor.
+   */
+  public LZOCheck() {
+    super(CheckDescription.LZO_CONFIG_CHECK);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public void perform(PrerequisiteCheck prerequisiteCheck, PrereqCheckRequest request) throws AmbariException {
+    List<String> errorMessages = new ArrayList<>();
+    PrereqCheckStatus checkStatus = PrereqCheckStatus.WARNING;
+
+    String codecs = getProperty(request, "core-site", IO_COMPRESSION_CODECS);
+    if (codecs!= null && codecs.contains(LZO_ENABLE_VALUE)) {
+      errorMessages.add(getFailReason(IO_COMPRESSION_CODECS, prerequisiteCheck, request));
+    }
+    String classValue = getProperty(request, "core-site", LZO_ENABLE_KEY);
+
+    if (LZO_ENABLE_VALUE.equals(classValue)) {
+      errorMessages.add(getFailReason(LZO_ENABLE_KEY, prerequisiteCheck, request));
+    }
+
+    if (!errorMessages.isEmpty()) {
+      prerequisiteCheck.setFailReason(StringUtils.join(errorMessages, "You have LZO codec enabled in the core-site config of your cluster. LZO is no longer installed automatically. " +
+          "If any hosts require LZO, it should be installed before starting the upgrade. " +
+          "Consult Ambari documentation for instructions on how to do this."));
+      prerequisiteCheck.getFailedOn().add("LZO");
+      prerequisiteCheck.setStatus(checkStatus);
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/76349ac2/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml
index 907626d..bb22c1e 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml
@@ -24,6 +24,7 @@
     <check>org.apache.ambari.server.checks.RangerAuditDbCheck</check>
     <check>org.apache.ambari.server.checks.ServicePresenceCheck</check>
     <check>org.apache.ambari.server.checks.RangerSSLConfigCheck</check>
+    <check>org.apache.ambari.server.checks.LZOCheck</check>
     <configuration>
       <!-- Configuration properties for all pre-reqs including required pre-reqs -->
       <check-properties name="org.apache.ambari.server.checks.HiveDynamicServiceDiscoveryCheck">

http://git-wip-us.apache.org/repos/asf/ambari/blob/76349ac2/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.6.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.6.xml
index 567e6e1..faf8cbc 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.6.xml
@@ -36,6 +36,7 @@
     <check>org.apache.ambari.server.checks.ServicePresenceCheck</check>
     <check>org.apache.ambari.server.checks.RangerAuditDbCheck</check>
     <check>org.apache.ambari.server.checks.RangerSSLConfigCheck</check>
+    <check>org.apache.ambari.server.checks.LZOCheck</check>
 
     <!-- Specific to HDP 2.5, Storm is not rolling -->
     <check>org.apache.ambari.server.checks.StormShutdownWarning</check>

http://git-wip-us.apache.org/repos/asf/ambari/blob/76349ac2/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml
index faf5b76..97824f2 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml
@@ -24,6 +24,7 @@
     <check>org.apache.ambari.server.checks.RangerAuditDbCheck</check>
     <check>org.apache.ambari.server.checks.ServicePresenceCheck</check>
     <check>org.apache.ambari.server.checks.RangerSSLConfigCheck</check>
+    <check>org.apache.ambari.server.checks.LZOCheck</check>
 
     <configuration>
       <!-- Configuration properties for all pre-reqs including required pre-reqs -->

http://git-wip-us.apache.org/repos/asf/ambari/blob/76349ac2/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.6.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.6.xml
index 572a259..9e56d97 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.6.xml
@@ -37,6 +37,7 @@
     <check>org.apache.ambari.server.checks.ServicePresenceCheck</check>
     <check>org.apache.ambari.server.checks.RangerAuditDbCheck</check>
     <check>org.apache.ambari.server.checks.RangerSSLConfigCheck</check>
+    <check>org.apache.ambari.server.checks.LZOCheck</check>
 
     <!-- Specific to HDP 2.5, Storm is not rolling -->
     <check>org.apache.ambari.server.checks.StormShutdownWarning</check>

http://git-wip-us.apache.org/repos/asf/ambari/blob/76349ac2/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml
index 8012c90..ace9542 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml
@@ -22,6 +22,7 @@
   <type>NON_ROLLING</type>
   <prerequisite-checks>
     <check>org.apache.ambari.server.checks.RangerSSLConfigCheck</check>
+    <check>org.apache.ambari.server.checks.LZOCheck</check>
     <configuration>
       <!-- Configuration properties for all pre-reqs including required pre-reqs -->
       <check-properties name="org.apache.ambari.server.checks.HiveDynamicServiceDiscoveryCheck">

http://git-wip-us.apache.org/repos/asf/ambari/blob/76349ac2/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml
index 7c43948..df11ae1 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml
@@ -35,6 +35,7 @@
     <check>org.apache.ambari.server.checks.YarnTimelineServerStatePreservingCheck</check>
     <check>org.apache.ambari.server.checks.RangerSSLConfigCheck</check>
     <check>org.apache.ambari.server.checks.DruidHighAvailabilityCheck</check>
+    <check>org.apache.ambari.server.checks.LZOCheck</check>
 
     <configuration>
       <!-- Configuration properties for all pre-reqs including required pre-reqs -->

http://git-wip-us.apache.org/repos/asf/ambari/blob/76349ac2/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 ae2a855..0355362 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
@@ -21,6 +21,7 @@
   <target-stack>HDP-2.6</target-stack>
   <type>NON_ROLLING</type>
   <prerequisite-checks>
+    <check>org.apache.ambari.server.checks.LZOCheck</check>
     <configuration>
       <!-- Configuration properties for all pre-reqs including required pre-reqs -->
       <check-properties name="org.apache.ambari.server.checks.HiveDynamicServiceDiscoveryCheck">

http://git-wip-us.apache.org/repos/asf/ambari/blob/76349ac2/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 37847a2..5aa2d20 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
@@ -34,6 +34,7 @@
     <check>org.apache.ambari.server.checks.YarnRMHighAvailabilityCheck</check>
     <check>org.apache.ambari.server.checks.YarnTimelineServerStatePreservingCheck</check>
     <check>org.apache.ambari.server.checks.DruidHighAvailabilityCheck</check>
+    <check>org.apache.ambari.server.checks.LZOCheck</check>
 
     <configuration>
       <!-- Configuration properties for all pre-reqs including required pre-reqs -->

http://git-wip-us.apache.org/repos/asf/ambari/blob/76349ac2/ambari-server/src/test/java/org/apache/ambari/server/checks/LZOCheckTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/checks/LZOCheckTest.java b/ambari-server/src/test/java/org/apache/ambari/server/checks/LZOCheckTest.java
new file mode 100644
index 0000000..e50e936
--- /dev/null
+++ b/ambari-server/src/test/java/org/apache/ambari/server/checks/LZOCheckTest.java
@@ -0,0 +1,145 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ambari.server.checks;
+
+    import java.util.HashMap;
+    import java.util.Map;
+
+    import org.apache.ambari.server.configuration.Configuration;
+    import org.apache.ambari.server.controller.PrereqCheckRequest;
+    import org.apache.ambari.server.orm.entities.RepositoryVersionEntity;
+    import org.apache.ambari.server.state.Cluster;
+    import org.apache.ambari.server.state.Clusters;
+    import org.apache.ambari.server.state.Config;
+    import org.apache.ambari.server.state.DesiredConfig;
+    import org.apache.ambari.server.state.RepositoryType;
+    import org.apache.ambari.server.state.Service;
+    import org.apache.ambari.server.state.repository.ClusterVersionSummary;
+    import org.apache.ambari.server.state.repository.VersionDefinitionXml;
+    import org.apache.ambari.server.state.stack.PrereqCheckStatus;
+    import org.apache.ambari.server.state.stack.PrerequisiteCheck;
+    import org.junit.Assert;
+    import org.junit.Before;
+    import org.junit.Test;
+    import org.junit.runner.RunWith;
+    import org.mockito.Mock;
+    import org.mockito.Mockito;
+    import org.mockito.runners.MockitoJUnitRunner;
+
+    import com.google.inject.Provider;
+
+
+/* Test for LZOCheck */
+@RunWith(MockitoJUnitRunner.class)
+public class LZOCheckTest {
+
+  private final Clusters clusters = Mockito.mock(Clusters.class);
+  private final LZOCheck lZOCheck = new LZOCheck();
+
+  @Mock
+  private ClusterVersionSummary m_clusterVersionSummary;
+
+  @Mock
+  private VersionDefinitionXml m_vdfXml;
+
+  @Mock
+  private RepositoryVersionEntity m_repositoryVersion;
+
+  final Map<String, Service> m_services = new HashMap<>();
+
+  @Before
+  public void setup() throws Exception {
+    lZOCheck.clustersProvider = new Provider<Clusters>() {
+      @Override
+      public Clusters get() {
+        return clusters;
+      }
+    };
+    Configuration config = Mockito.mock(Configuration.class);
+    lZOCheck.config = config;
+
+    m_services.clear();
+
+    Mockito.when(m_repositoryVersion.getType()).thenReturn(RepositoryType.STANDARD);
+    Mockito.when(m_repositoryVersion.getRepositoryXml()).thenReturn(m_vdfXml);
+    Mockito.when(m_vdfXml.getClusterSummary(Mockito.any(Cluster.class))).thenReturn(m_clusterVersionSummary);
+    Mockito.when(m_clusterVersionSummary.getAvailableServiceNames()).thenReturn(m_services.keySet());
+  }
+
+  @Test
+  public void testIsApplicable() throws Exception {
+    final Cluster cluster = Mockito.mock(Cluster.class);
+
+    Mockito.when(cluster.getServices()).thenReturn(m_services);
+    Mockito.when(cluster.getClusterId()).thenReturn(1L);
+    Mockito.when(clusters.getCluster("cluster")).thenReturn(cluster);
+
+    PrereqCheckRequest request = new PrereqCheckRequest("cluster");
+    request.setTargetRepositoryVersion(m_repositoryVersion);
+
+    Assert.assertTrue(lZOCheck.isApplicable(request));
+  }
+
+  @Test
+  public void testPerform() throws Exception {
+    final Cluster cluster = Mockito.mock(Cluster.class);
+    final Map<String, Service> services = new HashMap<>();
+    final Service service = Mockito.mock(Service.class);
+
+    Mockito.when(cluster.getServices()).thenReturn(services);
+    Mockito.when(cluster.getClusterId()).thenReturn(1L);
+    Mockito.when(clusters.getCluster("cluster")).thenReturn(cluster);
+
+    final DesiredConfig desiredConfig = Mockito.mock(DesiredConfig.class);
+    Mockito.when(desiredConfig.getTag()).thenReturn("tag");
+    Map<String, DesiredConfig> configMap = new HashMap<>();
+    configMap.put("core-site", desiredConfig);
+
+    Mockito.when(cluster.getDesiredConfigs()).thenReturn(configMap);
+    final Config config = Mockito.mock(Config.class);
+    Mockito.when(cluster.getConfig(Mockito.anyString(), Mockito.anyString())).thenReturn(config);
+    final Map<String, String> properties = new HashMap<>();
+    Mockito.when(config.getProperties()).thenReturn(properties);
+
+    PrerequisiteCheck check = new PrerequisiteCheck(null, null);
+    lZOCheck.perform(check, new PrereqCheckRequest("cluster"));
+    Assert.assertEquals(PrereqCheckStatus.PASS, check.getStatus());
+
+
+    properties.put(LZOCheck.IO_COMPRESSION_CODECS,"test," + LZOCheck.LZO_ENABLE_VALUE);
+    check = new PrerequisiteCheck(null, null);
+    lZOCheck.perform(check, new PrereqCheckRequest("cluster"));
+    Assert.assertEquals(PrereqCheckStatus.WARNING, check.getStatus());
+
+    properties.put(LZOCheck.IO_COMPRESSION_CODECS,"test");
+    check = new PrerequisiteCheck(null, null);
+    lZOCheck.perform(check, new PrereqCheckRequest("cluster"));
+    Assert.assertEquals(PrereqCheckStatus.PASS, check.getStatus());
+
+    properties.put(LZOCheck.LZO_ENABLE_KEY, LZOCheck.LZO_ENABLE_VALUE);
+    check = new PrerequisiteCheck(null, null);
+    lZOCheck.perform(check, new PrereqCheckRequest("cluster"));
+    Assert.assertEquals(PrereqCheckStatus.WARNING, check.getStatus());
+
+    properties.put(LZOCheck.LZO_ENABLE_KEY, LZOCheck.LZO_ENABLE_VALUE);
+    properties.put(LZOCheck.IO_COMPRESSION_CODECS,"test," + LZOCheck.LZO_ENABLE_VALUE);
+    check = new PrerequisiteCheck(null, null);
+    lZOCheck.perform(check, new PrereqCheckRequest("cluster"));
+    Assert.assertEquals(PrereqCheckStatus.WARNING, check.getStatus());
+  }
+}


[26/50] [abbrv] ambari git commit: AMBARI-22321 : Changed ambari version from 2.6.0.0 to 2.6.3.0. Addendum patch (mradhakrishnan on behalf of ydavis)

Posted by am...@apache.org.
AMBARI-22321 : Changed ambari version from 2.6.0.0 to 2.6.3.0. Addendum patch (mradhakrishnan on behalf of ydavis)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 869e1aaeaaf8a03a374bfe8d7fd992e1a048aaad
Parents: 3297dfa
Author: Madhuvanthi Radhakrishnan <mr...@hortonworks.com>
Authored: Tue Nov 14 11:57:05 2017 -0800
Committer: Madhuvanthi Radhakrishnan <mr...@hortonworks.com>
Committed: Tue Nov 14 11:57:05 2017 -0800

----------------------------------------------------------------------
 .../HDP/2.0.6/properties/stack_features.json       | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/869e1aae/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 702fb13..f79cfe0 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
@@ -429,9 +429,24 @@
         "min_version": "2.6.0.0"
       },
       {
+        "name": "registry_remove_rootpath",
+        "description": "Registry remove root path setting",
+        "min_version": "2.6.3.0"
+      },
+      {
+        "name": "registry_allowed_resources_support",
+        "description": "Registry allowed resources",
+        "min_version": "2.6.3.0"
+      },
+      {
+        "name": "registry_rewriteuri_filter_support",
+        "description": "Registry RewriteUri servlet filter",
+        "min_version": "2.6.3.0"
+      },
+      {
         "name": "sam_storage_core_in_registry",
         "description": "Storage core module moved to registry",
-        "min_version": "2.6.0.0"
+        "min_version": "2.6.3.0"
       }
     ]
   }


[35/50] [abbrv] ambari git commit: AMBARI-22448. Oozie Jobs on Hive Fail With Missing Tarball (ncole)

Posted by am...@apache.org.
AMBARI-22448. Oozie Jobs on Hive Fail With Missing Tarball (ncole)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 99152d3257a0eb4180283fa882f8283a3eaba196
Parents: 3f2743b
Author: Nate Cole <nc...@hortonworks.com>
Authored: Wed Nov 15 12:52:50 2017 -0500
Committer: Nate Cole <nc...@hortonworks.com>
Committed: Wed Nov 15 12:52:50 2017 -0500

----------------------------------------------------------------------
 .../resources/stacks/HDP/2.0.6/properties/stack_packages.json  | 3 ++-
 .../resources/stacks/HDP/3.0/properties/stack_packages.json    | 6 +++---
 2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/99152d32/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_packages.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_packages.json b/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_packages.json
index 68e6bf8..245449c 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_packages.json
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_packages.json
@@ -1278,7 +1278,8 @@
     },
     "upgrade-dependencies" : {
       "HIVE": ["TEZ"],
-      "MAHOUT": ["MAPREDUCE2"]
+      "MAHOUT": ["MAPREDUCE2"],
+      "OOZIE": ["MAPREDUCE2"]
     }    
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/99152d32/ambari-server/src/main/resources/stacks/HDP/3.0/properties/stack_packages.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/3.0/properties/stack_packages.json b/ambari-server/src/main/resources/stacks/HDP/3.0/properties/stack_packages.json
index d8cd015..5603c0c 100644
--- a/ambari-server/src/main/resources/stacks/HDP/3.0/properties/stack_packages.json
+++ b/ambari-server/src/main/resources/stacks/HDP/3.0/properties/stack_packages.json
@@ -1154,9 +1154,9 @@
       }
     },
     "upgrade-dependencies" : {
-      "YARN": ["TEZ"],
-      "TEZ": ["YARN"],
-      "MAHOUT": ["MAPREDUCE2"]
+      "HIVE": ["TEZ"],
+      "MAHOUT": ["MAPREDUCE2"],
+      "OOZIE": ["MAPREDUCE2"]
     }    
   }
 }


[42/50] [abbrv] ambari git commit: AMBARI-22115. Alerts for OneFS mpack (amagyar)

Posted by am...@apache.org.
AMBARI-22115. Alerts for OneFS mpack (amagyar)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 362b4f0044eb901fd6470579d54212aec0f7c903
Parents: 2a1c2e4
Author: Attila Magyar <am...@hortonworks.com>
Authored: Thu Oct 12 15:21:13 2017 +0200
Committer: Attila Magyar <am...@hortonworks.com>
Committed: Wed Nov 22 10:50:40 2017 +0100

----------------------------------------------------------------------
 ambari-server/docs/configuration/index.md       |   1 +
 .../server/alerts/JmxServerSideAlert.java       | 104 +++++++++++++++++++
 .../apache/ambari/server/alerts/Threshold.java  |  73 +++++++++++++
 .../server/configuration/Configuration.java     |  11 ++
 .../server/controller/ControllerModule.java     |   1 +
 .../server/controller/jmx/JMXMetricHolder.java  |  27 +++++
 .../org/apache/ambari/server/state/Alert.java   |   1 +
 .../ambari/server/state/alert/AlertUri.java     |  41 ++++++++
 .../ambari/server/state/alert/MetricSource.java |   7 ++
 .../ambari/server/state/alert/Reporting.java    |  43 ++++++++
 .../ambari/server/state/alert/ServerSource.java |  15 +++
 .../services/AmbariServerAlertService.java      |   7 +-
 .../ambari/server/alerts/ThresholdTest.java     |  90 ++++++++++++++++
 .../controller/jmx/JMXMetricHolderTest.java     |  61 +++++++++++
 .../ambari/server/state/alert/AlertUriTest.java |  60 +++++++++++
 15 files changed, 541 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/362b4f00/ambari-server/docs/configuration/index.md
----------------------------------------------------------------------
diff --git a/ambari-server/docs/configuration/index.md b/ambari-server/docs/configuration/index.md
index 9dbe9c4..8f1531b 100644
--- a/ambari-server/docs/configuration/index.md
+++ b/ambari-server/docs/configuration/index.md
@@ -57,6 +57,7 @@ The following are the properties which can be used to configure Ambari.
 | alerts.execution.scheduler.threadpool.size.core | The core number of threads used to process incoming alert events. The value should be increased as the size of the cluster increases. |`2` | 
 | alerts.execution.scheduler.threadpool.size.max | The number of threads used to handle alerts received from the Ambari Agents. The value should be increased as the size of the cluster increases. |`2` | 
 | alerts.execution.scheduler.threadpool.worker.size | The number of queued alerts allowed before discarding old alerts which have not been handled. The value should be increased as the size of the cluster increases. |`2000` | 
+| alerts.server.side.scheduler.threadpool.size.core | The core pool size of the executor service that runs server side alerts. |`4` | 
 | alerts.snmp.dispatcher.udp.port | The UDP port to use when binding the SNMP dispatcher on Ambari Server startup. If no port is specified, then a random port will be used. | | 
 | alerts.template.file | The full path to the XML file that describes the different alert templates. | | 
 | ambari.display.url | The URL to use when creating messages which should include the Ambari Server URL.<br/><br/>The following are examples of valid values:<ul><li>`http://ambari.apache.org:8080`</ul> | | 

http://git-wip-us.apache.org/repos/asf/ambari/blob/362b4f00/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java b/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
new file mode 100644
index 0000000..a4b86f8
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
@@ -0,0 +1,104 @@
+/*
+ * 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.alerts;
+
+import static java.util.Collections.emptyList;
+import static java.util.Collections.singletonList;
+
+import java.net.URI;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.ambari.server.AmbariException;
+import org.apache.ambari.server.configuration.ComponentSSLConfiguration;
+import org.apache.ambari.server.controller.internal.URLStreamProvider;
+import org.apache.ambari.server.controller.jmx.JMXMetricHolder;
+import org.apache.ambari.server.orm.entities.AlertDefinitionEntity;
+import org.apache.ambari.server.state.Alert;
+import org.apache.ambari.server.state.Cluster;
+import org.apache.ambari.server.state.ConfigHelper;
+import org.apache.ambari.server.state.alert.AlertDefinition;
+import org.apache.ambari.server.state.alert.AlertDefinitionFactory;
+import org.apache.ambari.server.state.alert.MetricSource;
+import org.apache.ambari.server.state.alert.Reporting;
+import org.apache.ambari.server.state.alert.ServerSource;
+import org.apache.ambari.server.state.services.MetricsRetrievalService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.inject.Inject;
+
+/**
+ * I represent a "SERVER" {@link org.apache.ambari.server.state.alert.SourceType} alert
+ * which can pull JMX metrics from a remote cluster.
+ */
+public class JmxServerSideAlert extends AlertRunnable {
+  private final static Logger LOG = LoggerFactory.getLogger(JmxServerSideAlert.class);
+  @Inject
+  private AlertDefinitionFactory definitionFactory;
+  @Inject
+  private MetricsRetrievalService metricsRetrievalService;
+  @Inject
+  private ConfigHelper configHelper;
+
+  public JmxServerSideAlert(String definitionName) {
+    super(definitionName);
+  }
+
+  @Override
+  List<Alert> execute(Cluster cluster, AlertDefinitionEntity entity) throws AmbariException {
+    AlertDefinition alertDef = definitionFactory.coerce(entity);
+    ServerSource serverSource = (ServerSource) alertDef.getSource();
+    URI jmxUrl = jmxUrl(cluster, serverSource);
+    JMXMetricHolder metricHolder = jmxMetric(serverSource, jmxUrl);
+    return metricHolder == null
+      ? emptyList()
+      : alerts(alertDef, serverSource.getJmxInfo(), metricHolder, serverSource.getReporting());
+  }
+
+  private URI jmxUrl(Cluster cluster, ServerSource serverSource) throws AmbariException {
+    return serverSource.getUri().resolve(config(cluster)).resolve(serverSource.getJmxInfo().getUrlSuffix());
+  }
+
+  private Map<String, Map<String, String>> config(Cluster cluster) throws AmbariException {
+    return configHelper.getEffectiveConfigProperties(cluster, configHelper.getEffectiveDesiredTags(cluster, null));
+  }
+
+  private JMXMetricHolder jmxMetric(ServerSource serverSource, URI jmxUri) {
+    URLStreamProvider streamProvider = new URLStreamProvider(
+      serverSource.getUri().getConnectionTimeoutMsec(),
+      serverSource.getUri().getReadTimeoutMsec(),
+      ComponentSSLConfiguration.instance());
+    metricsRetrievalService.submitRequest(MetricsRetrievalService.MetricSourceType.JMX, streamProvider, jmxUri.toString());
+    return metricsRetrievalService.getCachedJMXMetric(jmxUri.toString());
+  }
+
+  private List<Alert> alerts(AlertDefinition alertDef, MetricSource.JmxInfo jmxInfo, JMXMetricHolder jmxMetricHolder, Reporting reporting) throws AmbariException {
+    List<Object> metrics = jmxMetricHolder.findAll(jmxInfo.getPropertyList());
+    if (metrics.isEmpty()) {
+      return emptyList();
+    }
+    if (metrics.get(0) instanceof Number) {
+      Alert alert = reporting.alert(((Number) metrics.get(0)).doubleValue(), metrics, alertDef);
+      return singletonList(alert);
+    } else {
+      LOG.info("Unsupported metrics value: {} when running alert: {}", metrics.get(0), alertDef);
+      return emptyList();
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/362b4f00/ambari-server/src/main/java/org/apache/ambari/server/alerts/Threshold.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/alerts/Threshold.java b/ambari-server/src/main/java/org/apache/ambari/server/alerts/Threshold.java
new file mode 100644
index 0000000..ae33eeb
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/alerts/Threshold.java
@@ -0,0 +1,73 @@
+/*
+ * 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.alerts;
+
+import javax.annotation.Nullable;
+
+import org.apache.ambari.server.state.AlertState;
+
+/**
+ * I'm a 3 level threshold where each level corresponds to ok, warn and critical levels.
+ * The levels are either increasing or decreasing numerical sequences.
+ * My main responsibility is to map incoming values to {@link AlertState} based on the threshold levels.
+ */
+public class Threshold {
+  private final Double okValue;
+  private final double warnValue;
+  private final double critValue;
+
+  public Threshold(@Nullable Double okValue, double warnValue, double critValue) {
+    this.okValue = okValue;
+    this.warnValue = warnValue;
+    this.critValue = critValue;
+  }
+
+  public AlertState state(double value) {
+    return directionUp() ? stateWhenDirectionUp(value) : stateWhenDirectionDown(value);
+  }
+
+  private boolean directionUp() {
+    return critValue >= warnValue;
+  }
+
+  private AlertState stateWhenDirectionUp(double value) {
+    if (value >= critValue) {
+      return AlertState.CRITICAL;
+    }
+    if (value >= warnValue) {
+      return AlertState.WARNING;
+    }
+    if (okValue == null || value >= okValue) {
+      return AlertState.OK;
+    }
+    return AlertState.UNKNOWN;
+  }
+
+  private AlertState stateWhenDirectionDown(double value) {
+    if (value <= critValue) {
+      return AlertState.CRITICAL;
+    }
+    if (value <= warnValue) {
+      return AlertState.WARNING;
+    }
+    if (okValue == null || value <= okValue) {
+      return AlertState.OK;
+    }
+    return AlertState.UNKNOWN;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/362b4f00/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
index 3b2baad..78b6480 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
@@ -2768,6 +2768,13 @@ public class Configuration {
   public static final ConfigurationProperty<String> DISPATCH_PROPERTY_SCRIPT_DIRECTORY = new ConfigurationProperty<>(
           "notification.dispatch.alert.script.directory",AmbariPath.getPath("/var/lib/ambari-server/resources/scripts"));
 
+  /**
+   * The core pool size of the executor service that runs server side alerts.
+   */
+  @Markdown(description = "The core pool size of the executor service that runs server side alerts.")
+  public static final ConfigurationProperty<Integer> SERVER_SIDE_ALERTS_CORE_POOL_SIZE = new ConfigurationProperty<>(
+          "alerts.server.side.scheduler.threadpool.size.core", 4);
+
 
   private static final Logger LOG = LoggerFactory.getLogger(
     Configuration.class);
@@ -6206,4 +6213,8 @@ public class Configuration {
   public String getAutoGroupCreation() {
     return getProperty(AUTO_GROUP_CREATION);
   }
+
+  public int getAlertServiceCorePoolSize() {
+    return Integer.parseInt(getProperty(SERVER_SIDE_ALERTS_CORE_POOL_SIZE));
+  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/362b4f00/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
index ed7513f..2938b26 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
@@ -359,6 +359,7 @@ public class ControllerModule extends AbstractModule {
     // So it's an "additional time", given to stage to finish execution before
     // it is considered as timed out
     bindConstant().annotatedWith(Names.named("actionTimeout")).to(600000L);
+    bindConstant().annotatedWith(Names.named("alertServiceCorePoolSize")).to(configuration.getAlertServiceCorePoolSize());
 
     bindConstant().annotatedWith(Names.named("dbInitNeeded")).to(dbInitNeeded);
     bindConstant().annotatedWith(Names.named("statusCheckInterval")).to(5000L);

http://git-wip-us.apache.org/repos/asf/ambari/blob/362b4f00/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXMetricHolder.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXMetricHolder.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXMetricHolder.java
index 81d72fb..f6ae54f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXMetricHolder.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXMetricHolder.java
@@ -18,13 +18,18 @@
 
 package org.apache.ambari.server.controller.jmx;
 
+import static java.util.stream.Collectors.toList;
+
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
 
 /**
  *
  */
 public final class JMXMetricHolder {
+  private static final String NAME_KEY = "name";
 
   private List<Map<String, Object>> beans;
 
@@ -47,4 +52,26 @@ public final class JMXMetricHolder {
     }
     return stringBuilder.toString();
   }
+
+  public List<Object> findAll(List<String> properties) {
+    return properties.stream()
+      .map(this::find)
+      .filter(Optional::isPresent)
+      .map(Optional::get)
+      .collect(toList());
+  }
+
+  public Optional<Object> find(String property) {
+    String propertyName = property.split("/")[0];
+    String propertyValue = property.split("/")[1];
+    return beans.stream()
+      .filter(each -> propertyName.equals(name(each)))
+      .map(each -> each.get(propertyValue))
+      .filter(Objects::nonNull)
+      .findFirst();
+  }
+
+  private String name(Map<String, Object> bean) {
+    return bean.containsKey(NAME_KEY) ? (String) bean.get(NAME_KEY) : null;
+  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/362b4f00/ambari-server/src/main/java/org/apache/ambari/server/state/Alert.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/Alert.java b/ambari-server/src/main/java/org/apache/ambari/server/state/Alert.java
index 5d2ecc6..49bd5d2 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/Alert.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/Alert.java
@@ -56,6 +56,7 @@ public class Alert {
     component = componentName;
     this.hostName = hostName;
     state = alertState;
+    timestamp = System.currentTimeMillis();
   }
 
   public Alert() {

http://git-wip-us.apache.org/repos/asf/ambari/blob/362b4f00/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java
index 93801d5..b3ef2de 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java
@@ -17,8 +17,13 @@
  */
 package org.apache.ambari.server.state.alert;
 
+import java.net.URI;
+import java.util.Map;
 import java.util.Set;
 
+import org.apache.ambari.server.AmbariException;
+import org.apache.ambari.server.state.kerberos.VariableReplacementHelper;
+
 import com.google.gson.annotations.SerializedName;
 
 /**
@@ -87,6 +92,13 @@ public class AlertUri {
   @SerializedName("connection_timeout")
   private float m_connectionTimeout = 5.0f;
 
+
+  /**
+   * An optional read timeout value for connections.
+   */
+  @SerializedName("read_timeout")
+  private float readTimeout = 15.0f;
+
   /**
    * If present, then the component supports HA mode and the properties
    * contained within need to be checked to see if an HA URI is required to be
@@ -117,6 +129,18 @@ public class AlertUri {
     m_httpUri = httpUri;
   }
 
+  public void setHttpsUri(String httpsUri) {
+    this.m_httpsUri = httpsUri;
+  }
+
+  public void setHttpsPropertyValue(String m_httpsPropertyValue) {
+    this.m_httpsPropertyValue = m_httpsPropertyValue;
+  }
+
+  public void setHttpsProperty(String m_httpsProperty) {
+    this.m_httpsProperty = m_httpsProperty;
+  }
+
   /**
    * Gets the default port to use on the host running the alert if none of the
    * http properties are available.
@@ -276,6 +300,23 @@ public class AlertUri {
     }
   }
 
+  public URI resolve(Map<String, Map<String, String>> config) throws AmbariException {
+    VariableReplacementHelper variableReplacer = new VariableReplacementHelper();
+    String httpsProperty = variableReplacer.replaceVariables(m_httpsProperty, config);
+    String httpsPropertyValue = variableReplacer.replaceVariables(m_httpsPropertyValue, config);
+    return httpsProperty == null || !httpsProperty.equals(httpsPropertyValue)
+      ? URI.create(String.format("http://%s", variableReplacer.replaceVariables(m_httpUri, config)))
+      : URI.create(String.format("https://%s", variableReplacer.replaceVariables(m_httpsUri, config)));
+  }
+
+  public int getConnectionTimeoutMsec() {
+    return (int) m_connectionTimeout * 1000;
+  }
+
+  public int getReadTimeoutMsec() {
+    return (int) readTimeout * 1000;
+  }
+
   /**
    * {@inheritDoc}
    */

http://git-wip-us.apache.org/repos/asf/ambari/blob/362b4f00/ambari-server/src/main/java/org/apache/ambari/server/state/alert/MetricSource.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/MetricSource.java b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/MetricSource.java
index 11eee05..d7283fe 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/MetricSource.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/MetricSource.java
@@ -129,6 +129,9 @@ public class MetricSource extends Source {
 
     private String value;
 
+    @SerializedName("url_suffix")
+    private String urlSuffix = "/jmx";
+
     public List<String> getPropertyList() {
       return propertyList;
     }
@@ -152,5 +155,9 @@ public class MetricSource extends Source {
       return list1.equals(list2);
 
     }
+
+    public String getUrlSuffix() {
+      return urlSuffix;
+    }
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/362b4f00/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
index 4aeba45..51d074e 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
@@ -17,6 +17,15 @@
  */
 package org.apache.ambari.server.state.alert;
 
+import static org.apache.ambari.server.state.alert.Reporting.ReportingType.PERCENT;
+
+import java.text.MessageFormat;
+import java.util.List;
+
+import org.apache.ambari.server.alerts.Threshold;
+import org.apache.ambari.server.state.Alert;
+import org.apache.ambari.server.state.AlertState;
+
 import com.google.gson.annotations.SerializedName;
 
 /**
@@ -200,6 +209,40 @@ public class Reporting {
   }
 
   /**
+   * Map the incoming value to {@link AlertState} and generate an alert with that state.
+   */
+  public Alert alert(double value, List<Object> args, AlertDefinition alertDef) {
+    Alert alert = new Alert(alertDef.getName(), null, alertDef.getServiceName(), alertDef.getComponentName(), null, state(value));
+    alert.setText(MessageFormat.format(message(value), args.toArray()));
+    return alert;
+  }
+
+  private AlertState state(double value) {
+    return getThreshold().state(PERCENT == getType() ? value * 100 : value);
+  }
+
+  private Threshold getThreshold() {
+    return new Threshold(getOk().getValue(), getWarning().getValue(), getCritical().getValue());
+  }
+
+  private String message(double value) {
+    switch (state(value)) {
+      case OK:
+        return getOk().getText();
+      case WARNING:
+        return getWarning().getText();
+      case CRITICAL:
+        return getCritical().getText();
+      case UNKNOWN:
+        return "Unknown";
+      case SKIPPED:
+        return "Skipped";
+      default:
+        throw new IllegalStateException("Invalid alert state: " + state(value));
+    }
+  }
+
+  /**
    * The {@link ReportTemplate} class is used to pair a label and threshhold
    * value.
    * <p/>

http://git-wip-us.apache.org/repos/asf/ambari/blob/362b4f00/ambari-server/src/main/java/org/apache/ambari/server/state/alert/ServerSource.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/ServerSource.java b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/ServerSource.java
index c58867a..765bdea 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/ServerSource.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/ServerSource.java
@@ -28,6 +28,13 @@ public class ServerSource extends ParameterizedSource {
   @SerializedName("class")
   private String m_class;
 
+  @SerializedName("uri")
+  private AlertUri uri = null;
+
+  @SerializedName("jmx")
+  private MetricSource.JmxInfo jmxInfo = null;
+
+
   /**
    * Gets the fully qualified classname specified in the source.
    */
@@ -35,6 +42,14 @@ public class ServerSource extends ParameterizedSource {
     return m_class;
   }
 
+  public MetricSource.JmxInfo getJmxInfo() {
+    return jmxInfo;
+  }
+
+  public AlertUri getUri() {
+    return uri;
+  }
+
   /**
    * {@inheritDoc}
    */

http://git-wip-us.apache.org/repos/asf/ambari/blob/362b4f00/ambari-server/src/main/java/org/apache/ambari/server/state/services/AmbariServerAlertService.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/services/AmbariServerAlertService.java b/ambari-server/src/main/java/org/apache/ambari/server/state/services/AmbariServerAlertService.java
index 305f693..6cce1b2 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/services/AmbariServerAlertService.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/services/AmbariServerAlertService.java
@@ -45,6 +45,7 @@ import com.google.common.util.concurrent.AbstractScheduledService;
 import com.google.inject.Inject;
 import com.google.inject.Injector;
 import com.google.inject.Provider;
+import com.google.inject.name.Named;
 
 /**
  * The {@link AmbariServerAlertService} is used to manage the dynamically loaded
@@ -87,7 +88,7 @@ public class AmbariServerAlertService extends AbstractScheduledService {
   /**
    * The executor to use to run all {@link Runnable} alert classes.
    */
-  private final ScheduledExecutorService m_scheduledExecutorService = Executors.newScheduledThreadPool(3);
+  private ScheduledExecutorService m_scheduledExecutorService;
 
   /**
    * A map of all of the definition names to {@link ScheduledFuture}s.
@@ -101,6 +102,10 @@ public class AmbariServerAlertService extends AbstractScheduledService {
   public AmbariServerAlertService() {
   }
 
+  @Inject
+  public void initExecutor(@Named("alertServiceCorePoolSize") int alertServiceCorePoolSize) {
+    this.m_scheduledExecutorService = Executors.newScheduledThreadPool(alertServiceCorePoolSize);
+  }
   /**
    * {@inheritDoc}
    */

http://git-wip-us.apache.org/repos/asf/ambari/blob/362b4f00/ambari-server/src/test/java/org/apache/ambari/server/alerts/ThresholdTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/alerts/ThresholdTest.java b/ambari-server/src/test/java/org/apache/ambari/server/alerts/ThresholdTest.java
new file mode 100644
index 0000000..07bfa03
--- /dev/null
+++ b/ambari-server/src/test/java/org/apache/ambari/server/alerts/ThresholdTest.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.alerts;
+
+import static org.apache.ambari.server.state.AlertState.CRITICAL;
+import static org.apache.ambari.server.state.AlertState.OK;
+import static org.apache.ambari.server.state.AlertState.UNKNOWN;
+import static org.apache.ambari.server.state.AlertState.WARNING;
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+import org.apache.ambari.server.state.AlertState;
+import org.junit.Test;
+
+public class ThresholdTest {
+  @Test
+  public void testBetweenOkAndWarnIsOk_dirUp() throws Exception {
+    Threshold threshold = new Threshold(10.0, 20.0, 30.0);
+    assertState(threshold, OK, 10, 15, 19);
+  }
+
+  @Test
+  public void testBetweenWarnAndCritIsWarn_dirUp() throws Exception {
+    Threshold threshold = new Threshold(10.0, 20.0, 30.0);
+    assertState(threshold, WARNING, 20, 25, 29);
+  }
+
+  @Test
+  public void testAboveCritIsCrit_dirUp() throws Exception {
+    Threshold threshold = new Threshold(10.0, 20.0, 30.0);
+    assertState(threshold, CRITICAL, 30, 40, 99999);
+  }
+
+  @Test
+  public void testBelowOkIsUnknown_dirUp() throws Exception {
+    Threshold threshold = new Threshold(10.0, 20, 30);
+    assertState(threshold, UNKNOWN, 9, 2, -99999);
+  }
+
+  @Test
+  public void testBelowCritIsCrit_dirDown() throws Exception {
+    Threshold threshold = new Threshold(40.0, 30.0, 20.0);
+    assertState(threshold, CRITICAL, 20, 15, 2, -99999);
+  }
+
+  @Test
+  public void testBetweenWarnAndCritIsWarn_dirDown() throws Exception {
+    Threshold threshold = new Threshold(40.0, 30.0, 20.0);
+    assertState(threshold, WARNING, 30, 25, 21);
+  }
+
+  @Test
+  public void testBetweenOkAndWarnIsOk_dirDown() throws Exception {
+    Threshold threshold = new Threshold(40.0, 30.0, 20.0);
+    assertState(threshold, OK, 40, 35, 31);
+  }
+
+  @Test
+  public void testAboveOkIsUnknown_dirDown() throws Exception {
+    Threshold threshold = new Threshold(40.0, 30.0, 20.0);
+    assertState(threshold, UNKNOWN, 41, 50, 9999);
+  }
+
+  @Test
+  public void testOkIsOptional() throws Exception {
+    Threshold threshold = new Threshold(null, 20.0, 30.0);
+    assertState(threshold, OK, 10, 15, 19);
+  }
+
+  private void assertState(Threshold threshold, AlertState expectedState, int... values) {
+    for (int value: values) {
+      assertThat(expectedState, is(threshold.state(value)));
+    }
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/362b4f00/ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXMetricHolderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXMetricHolderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXMetricHolderTest.java
new file mode 100644
index 0000000..61d5bae
--- /dev/null
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXMetricHolderTest.java
@@ -0,0 +1,61 @@
+/*
+ * 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.jmx;
+
+import static java.util.Arrays.asList;
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+import static org.junit.internal.matchers.IsCollectionContaining.hasItems;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Optional;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class JMXMetricHolderTest {
+  private JMXMetricHolder metrics = new JMXMetricHolder();
+
+  @Before
+  public void setUp() {
+    metrics.setBeans(asList(
+      new HashMap<String, Object>() {{
+        put("name", "bean1");
+        put("value", "val1");
+      }},
+      new HashMap<String, Object>() {{
+        put("name", "bean2");
+        put("value", "val2");
+      }}
+    ));
+  }
+
+  @Test
+  public void testFindSingleBeanByName() throws Exception {
+    assertThat(metrics.find("bean1/value"), is(Optional.of("val1")));
+    assertThat(metrics.find("bean2/value"), is(Optional.of("val2")));
+    assertThat(metrics.find("bean3/notfound"), is(Optional.empty()));
+  }
+
+  @Test
+  public void testFindMultipleBeansByName() throws Exception {
+    List<Object> result = metrics.findAll(asList("bean1/value", "bean2/value", "bean3/notfound"));
+    assertThat(result, hasItems("val1", "val2"));
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/362b4f00/ambari-server/src/test/java/org/apache/ambari/server/state/alert/AlertUriTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/alert/AlertUriTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/alert/AlertUriTest.java
new file mode 100644
index 0000000..295e364
--- /dev/null
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/alert/AlertUriTest.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ambari.server.state.alert;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.ambari.server.AmbariException;
+import org.junit.Test;
+
+public class AlertUriTest {
+  @Test
+  public void testChoosesHttpByDefault() throws Exception {
+    AlertUri uri = new AlertUri();
+    uri.setHttpUri("${config1/http-host}/path");
+    assertThat(resolved(uri), is("http://http-host/path"));
+  }
+
+  @Test
+  public void testChoosesHttpsBasedOnProperties() throws Exception {
+    AlertUri uri = new AlertUri();
+    uri.setHttpUri("${config1/http-host}/path");
+    uri.setHttpsUri("${config1/https-host}/path");
+    uri.setHttpsProperty("${config1/use-http}");
+    uri.setHttpsPropertyValue("YES");
+    assertThat(resolved(uri), is("https://https-host/path"));
+  }
+
+  private Map<String, Map<String, String>> config() {
+    return new HashMap<String, Map<String, String>>() {{
+        put("config1", new HashMap<String, String>() {{
+          put("http-host", "http-host");
+          put("https-host", "https-host");
+          put("use-http", "YES");
+        }});
+      }};
+  }
+
+  private String resolved(AlertUri uri) throws AmbariException {
+    return uri.resolve(config()).toString();
+  }
+}
\ No newline at end of file


[36/50] [abbrv] ambari git commit: AMBARI-22444 - Add Native Libraries To Tez Tarball (jonathanhurley)

Posted by am...@apache.org.
AMBARI-22444 - Add Native Libraries To Tez Tarball (jonathanhurley)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: c67a3246e2121c6977094e10cdb1414f45cf1482
Parents: 99152d3
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Tue Nov 14 16:19:30 2017 -0500
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Wed Nov 15 15:30:36 2017 -0500

----------------------------------------------------------------------
 .../libraries/functions/copy_tarball.py         | 82 +++++++++++++++++---
 .../libraries/functions/tar_archive.py          |  6 +-
 .../stacks/2.1/FALCON/test_falcon_server.py     |  6 +-
 3 files changed, 80 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c67a3246/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py b/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py
index 219430a..f62aa3d 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py
@@ -23,18 +23,74 @@ __all__ = ["copy_to_hdfs", "get_sysprep_skip_copy_tarballs_hdfs"]
 import os
 import tempfile
 import re
+import tarfile
+from contextlib import closing
 
 from resource_management.libraries.script.script import Script
 from resource_management.libraries.resources.hdfs_resource import HdfsResource
 from resource_management.libraries.functions.default import default
 from resource_management.core import shell
+from resource_management.core import sudo
 from resource_management.core.logger import Logger
+from resource_management.core.exceptions import Fail
+from resource_management.core.resources.system import Execute
 from resource_management.libraries.functions import stack_tools, stack_features, stack_select
+from resource_management.libraries.functions import tar_archive
 
 STACK_NAME_PATTERN = "{{ stack_name }}"
 STACK_ROOT_PATTERN = "{{ stack_root }}"
 STACK_VERSION_PATTERN = "{{ stack_version }}"
 
+def _prepare_tez_tarball():
+  """
+  Prepares the Tez tarball by adding the Hadoop native libraries found in the mapreduce tarball.
+  :return:  the full path of the newly created tez tarball to use
+  """
+  import tempfile
+
+  Logger.info("Preparing the Tez tarball...")
+
+  # get the mapreduce tarball which matches the version of tez
+  # tez installs the mapreduce tar, so it should always be present
+  _, mapreduce_source_file, _, _ = get_tarball_paths("mapreduce")
+  _, tez_source_file, _, _ = get_tarball_paths("tez")
+
+  temp_dir = Script.get_tmp_dir()
+
+  mapreduce_temp_dir = tempfile.mkdtemp(prefix="mapreduce-tarball-", dir=temp_dir)
+  tez_temp_dir = tempfile.mkdtemp(prefix="tez-tarball-", dir=temp_dir)
+
+  Logger.info("Extracting {0} to {1}".format(mapreduce_source_file, mapreduce_temp_dir))
+  tar_archive.extract_archive(mapreduce_source_file, mapreduce_temp_dir)
+
+  Logger.info("Extracting {0} to {1}".format(tez_source_file, tez_temp_dir))
+  tar_archive.untar_archive(tez_source_file, tez_temp_dir)
+
+  hadoop_lib_native_dir = os.path.join(mapreduce_temp_dir, "hadoop", "lib", "native")
+  tez_lib_dir = os.path.join(tez_temp_dir, "lib")
+
+  if not os.path.exists(hadoop_lib_native_dir):
+    raise Fail("Unable to seed the Tez tarball with native libraries since the source Hadoop native lib directory {0} does not exist".format(hadoop_lib_native_dir))
+
+  if not os.path.exists(tez_lib_dir):
+    raise Fail("Unable to seed the Tez tarball with native libraries since the target Tez lib directory {0} does not exist".format(tez_lib_dir))
+
+  Execute(("cp", "-a", hadoop_lib_native_dir, tez_lib_dir), sudo = True)
+
+  tez_tarball_with_native_lib = os.path.join(os.path.dirname(tez_source_file), "tez-native.tar.gz")
+  Logger.info("Creating a new Tez tarball at {0}".format(tez_tarball_with_native_lib))
+
+  # tar up Tez, making sure to specify nothing for the arcname so that it does not include an absolute path
+  with closing(tarfile.open(tez_tarball_with_native_lib, "w:gz")) as new_tez_tarball:
+    new_tez_tarball.add(tez_temp_dir, arcname=os.path.sep)
+
+  # cleanup
+  sudo.rmtree(mapreduce_temp_dir)
+  sudo.rmtree(tez_temp_dir)
+
+  return tez_tarball_with_native_lib
+
+
 # TODO, in the future, each stack can define its own mapping of tarballs
 # inside the stack definition directory in some sort of xml file.
 # PLEASE DO NOT put this in cluster-env since it becomes much harder to change,
@@ -50,7 +106,8 @@ TARBALL_MAP = {
   "tez": {
     "dirs": ("{0}/{1}/tez/lib/tez.tar.gz".format(STACK_ROOT_PATTERN, STACK_VERSION_PATTERN),
            "/{0}/apps/{1}/tez/tez.tar.gz".format(STACK_NAME_PATTERN, STACK_VERSION_PATTERN)),
-    "service": "TEZ"
+    "service": "TEZ",
+    "prepare_function": _prepare_tez_tarball
   },
 
   "tez_hive2": {
@@ -132,29 +189,29 @@ def get_tarball_paths(name, use_upgrading_version_during_upgrade=True, custom_so
   :param use_upgrading_version_during_upgrade:
   :param custom_source_file: If specified, use this source path instead of the default one from the map.
   :param custom_dest_file: If specified, use this destination path instead of the default one from the map.
-  :return: A tuple of (success status, source path, destination path)
+  :return: A tuple of (success status, source path, destination path, optional preparation function which is invoked to setup the tarball)
   """
   stack_name = Script.get_stack_name()
 
   if not stack_name:
     Logger.error("Cannot copy {0} tarball to HDFS because stack name could not be determined.".format(str(name)))
-    return (False, None, None)
+    return False, None, None
 
   if name is None or name.lower() not in TARBALL_MAP:
     Logger.error("Cannot copy tarball to HDFS because {0} is not supported in stack {1} for this operation.".format(str(name), str(stack_name)))
-    return (False, None, None)
+    return False, None, None
 
   service = TARBALL_MAP[name.lower()]['service']
 
   stack_version = get_current_version(service=service, use_upgrading_version_during_upgrade=use_upgrading_version_during_upgrade)
   if not stack_version:
     Logger.error("Cannot copy {0} tarball to HDFS because stack version could be be determined.".format(str(name)))
-    return (False, None, None)
+    return False, None, None
 
   stack_root = Script.get_stack_root()
   if not stack_root:
     Logger.error("Cannot copy {0} tarball to HDFS because stack root could be be determined.".format(str(name)))
-    return (False, None, None)
+    return False, None, None
 
   (source_file, dest_file) = TARBALL_MAP[name.lower()]['dirs']
 
@@ -173,7 +230,11 @@ def get_tarball_paths(name, use_upgrading_version_during_upgrade=True, custom_so
   source_file = source_file.replace(STACK_VERSION_PATTERN, stack_version)
   dest_file = dest_file.replace(STACK_VERSION_PATTERN, stack_version)
 
-  return (True, source_file, dest_file)
+  prepare_function = None
+  if "prepare_function" in TARBALL_MAP[name.lower()]:
+    prepare_function = TARBALL_MAP[name.lower()]['prepare_function']
+
+  return True, source_file, dest_file, prepare_function
 
 
 def get_current_version(service=None, use_upgrading_version_during_upgrade=True):
@@ -272,8 +333,8 @@ def copy_to_hdfs(name, user_group, owner, file_mode=0444, custom_source_file=Non
   import params
 
   Logger.info("Called copy_to_hdfs tarball: {0}".format(name))
-  (success, source_file, dest_file) = get_tarball_paths(name, use_upgrading_version_during_upgrade,
-                                                         custom_source_file, custom_dest_file)
+  (success, source_file, dest_file, prepare_function) = get_tarball_paths(name, use_upgrading_version_during_upgrade,
+                                                                          custom_source_file, custom_dest_file)
 
   if not success:
     Logger.error("Could not copy tarball {0} due to a missing or incorrect parameter.".format(str(name)))
@@ -311,6 +372,9 @@ def copy_to_hdfs(name, user_group, owner, file_mode=0444, custom_source_file=Non
   # The logic above cannot be used until fast-hdfs-resource.jar supports the mv command, or it switches
   # to WebHDFS.
 
+  # if there is a function which is needed to prepare the tarball, then invoke it first
+  if prepare_function is not None:
+    source_file = prepare_function()
 
   # If the directory already exists, it is a NO-OP
   dest_dir = os.path.dirname(dest_file)

http://git-wip-us.apache.org/repos/asf/ambari/blob/c67a3246/ambari-common/src/main/python/resource_management/libraries/functions/tar_archive.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/tar_archive.py b/ambari-common/src/main/python/resource_management/libraries/functions/tar_archive.py
index e6d8924..7976587 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/tar_archive.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/tar_archive.py
@@ -46,11 +46,13 @@ def archive_directory_dereference(archive, directory):
     try_sleep = 1,
   )
 
-def untar_archive(archive, directory):
+def untar_archive(archive, directory, silent=True):
   """
   :param directory:   can be a symlink and is followed
   """
-  Execute(('tar','-xvf',archive,'-C',directory+"/"),
+  options = "-xf" if silent else "-xvf"
+
+  Execute(('tar',options,archive,'-C',directory+"/"),
     sudo = True,
     tries = 3,
     try_sleep = 1,

http://git-wip-us.apache.org/repos/asf/ambari/blob/c67a3246/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py b/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py
index 8c48347..e15cfdb 100644
--- a/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py
+++ b/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py
@@ -248,7 +248,7 @@ class TestFalconServer(RMFTestCase):
         sudo = True,
     )
     self.assertResourceCalled('Execute', ('tar',
-     '-xvf',
+     '-xf',
      '/tmp/falcon-upgrade-backup/falcon-local-backup.tar',
      '-C',
      u'/hadoop/falcon/'),
@@ -433,7 +433,7 @@ class TestFalconServer(RMFTestCase):
     self.assertResourceCalled('Execute',
                               ('ambari-python-wrap', '/usr/bin/hdp-select', 'set', 'falcon-server', version), sudo=True,)
     self.assertResourceCalled('Execute', ('tar',
-                                          '-xvf',
+                                          '-xf',
                                           '/tmp/falcon-upgrade-backup/falcon-local-backup.tar',
                                           '-C',
                                           u'/hadoop/falcon/'),
@@ -473,7 +473,7 @@ class TestFalconServer(RMFTestCase):
                               ('ambari-python-wrap', '/usr/bin/hdp-select', 'set', 'falcon-server', version), sudo=True,)
 
     self.assertResourceCalled('Execute', ('tar',
-     '-xvf',
+     '-xf',
      '/tmp/falcon-upgrade-backup/falcon-local-backup.tar',
      '-C',
      u'/hadoop/falcon/'),


[28/50] [abbrv] ambari git commit: AMBARI-22443. Log Feeder: do not try to connect AMS, when it is disabled (oleewere)

Posted by am...@apache.org.
AMBARI-22443. Log Feeder: do not try to connect AMS, when it is disabled (oleewere)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 2b917f491f5577a85ec88380d7f3f93397cececf
Parents: ba00ed9
Author: Oliver Szabo <ol...@gmail.com>
Authored: Tue Nov 14 19:15:57 2017 +0100
Committer: Oliver Szabo <ol...@gmail.com>
Committed: Wed Nov 15 11:43:00 2017 +0100

----------------------------------------------------------------------
 .../ambari/logfeeder/metrics/LogFeederAMSClient.java      |  3 +++
 .../apache/ambari/logfeeder/metrics/MetricsManager.java   |  8 +++++++-
 .../ambari/logfeeder/metrics/MetricsManagerTest.java      | 10 ++++++----
 3 files changed, 16 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2b917f49/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/metrics/LogFeederAMSClient.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/metrics/LogFeederAMSClient.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/metrics/LogFeederAMSClient.java
index f446446..c832358 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/metrics/LogFeederAMSClient.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/metrics/LogFeederAMSClient.java
@@ -64,6 +64,9 @@ public class LogFeederAMSClient extends AbstractTimelineMetricsSink {
 
   @Override
   public String getCollectorUri(String host) {
+    if (collectorProtocol == null || host == null || collectorPort == null || collectorPath == null) {
+      return null;
+    }
     return String.format("%s://%s:%s%s", collectorProtocol, host, collectorPort, collectorPath);
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/2b917f49/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/metrics/MetricsManager.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/metrics/MetricsManager.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/metrics/MetricsManager.java
index 1094852..6e8ac04 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/metrics/MetricsManager.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/metrics/MetricsManager.java
@@ -45,7 +45,9 @@ public class MetricsManager {
 
   public void init() {
     LOG.info("Initializing MetricsManager()");
-    amsClient = new LogFeederAMSClient();
+    if (amsClient == null) {
+      amsClient = new LogFeederAMSClient();
+    }
 
     if (amsClient.getCollectorUri(null) != null) {
       if (LogFeederUtil.hostName == null) {
@@ -144,4 +146,8 @@ public class MetricsManager {
           (currMS - lastPublishTimeMS) / 1000 + " seconds ago, intervalConfigured=" + publishIntervalMS / 1000);
     }
   }
+
+  public void setAmsClient(LogFeederAMSClient amsClient) {
+    this.amsClient = amsClient;
+  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/2b917f49/ambari-logsearch/ambari-logsearch-logfeeder/src/test/java/org/apache/ambari/logfeeder/metrics/MetricsManagerTest.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/test/java/org/apache/ambari/logfeeder/metrics/MetricsManagerTest.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/test/java/org/apache/ambari/logfeeder/metrics/MetricsManagerTest.java
index 24042a7..f74a80e 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/test/java/org/apache/ambari/logfeeder/metrics/MetricsManagerTest.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/test/java/org/apache/ambari/logfeeder/metrics/MetricsManagerTest.java
@@ -50,18 +50,20 @@ public class MetricsManagerTest {
   @Before
   public void init() throws Exception {
     manager = new MetricsManager();
-    manager.init();
-    
+
     mockClient = strictMock(LogFeederAMSClient.class);
     Field f = MetricsManager.class.getDeclaredField("amsClient");
     f.setAccessible(true);
     f.set(manager, mockClient);
-    
+
+    EasyMock.expect(mockClient.getCollectorUri(null)).andReturn("null://null:null/null").anyTimes();
     capture = EasyMock.newCapture(CaptureType.FIRST);
     mockClient.emitMetrics(EasyMock.capture(capture));
     EasyMock.expectLastCall().andReturn(true).once();
-    
+
     replay(mockClient);
+    manager.setAmsClient(mockClient);
+    manager.init();
   }
   
   @Test


[39/50] [abbrv] ambari git commit: AMBARI-22260. Update Spark2 log4j default settings to latest. (sai.sai.shao via sshridhar).

Posted by am...@apache.org.
AMBARI-22260. Update Spark2 log4j default settings to latest. (sai.sai.shao via sshridhar).


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 4042f9fde14548be77a5ed5daf45364df307c08a
Parents: 0936f46
Author: Swapan Shridhar <ss...@hortonworks.com>
Authored: Wed Nov 15 16:21:31 2017 -0800
Committer: Swapan Shridhar <ss...@hortonworks.com>
Committed: Wed Nov 15 16:21:31 2017 -0800

----------------------------------------------------------------------
 .../stacks/HDP/2.5/upgrades/config-upgrade.xml  | 23 ++++++++
 .../HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml | 23 +++++---
 .../stacks/HDP/2.5/upgrades/upgrade-2.6.xml     | 45 +++++++++-------
 .../configuration/spark2-log4j-properties.xml   | 56 ++++++++++++++++++++
 4 files changed, 122 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4042f9fd/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml
index b1e5f91..8c2c860 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml
@@ -104,14 +104,37 @@
     </service>
 
     <service name="SPARK2">
+      <component name="SPARK2_JOBHISTORYSERVER">
+        <changes>
+          <definition xsi:type="configure" id="hdp_2_5_0_0_spark2_jobhistoryserver_log4j">
+            <type>spark2-log4j-properties</type>
+            <replace key="content" find="log4j.logger.org.eclipse.jetty=WARN" replace-with="log4j.logger.org.spark_project.jetty=WARN"/>
+            <replace key="content" find="log4j.logger.org.eclipse.jetty.util.component.AbstractLifeCycle=ERROR" replace-with="log4j.logger.org.spark_project.jetty.util.component.AbstractLifeCycle=ERROR"/>
+          </definition>
+        </changes>
+      </component>
       <component name="SPARK2_CLIENT">
         <changes>
+          <definition xsi:type="configure" id="hdp_2_5_0_0_spark2_client_log4j">
+            <type>spark2-log4j-properties</type>
+            <replace key="content" find="log4j.logger.org.eclipse.jetty=WARN" replace-with="log4j.logger.org.spark_project.jetty=WARN"/>
+            <replace key="content" find="log4j.logger.org.eclipse.jetty.util.component.AbstractLifeCycle=ERROR" replace-with="log4j.logger.org.spark_project.jetty.util.component.AbstractLifeCycle=ERROR"/>
+          </definition>
           <definition xsi:type="configure" id="hdp_2_5_0_0_spark2_yarn_queue">
             <type>spark2-defaults</type>
             <set key="spark.yarn.queue" value="default" if-type="spark-defaults" if-key="spark.yarn.queue" if-key-state="absent"/>
           </definition>
         </changes>
       </component>
+      <component name="SPARK2_THRIFTSERVER">
+        <changes>
+          <definition xsi:type="configure" id="hdp_2_5_0_0_spark2_thriftserver_log4j">
+            <type>spark2-log4j-properties</type>
+            <replace key="content" find="log4j.logger.org.eclipse.jetty=WARN" replace-with="log4j.logger.org.spark_project.jetty=WARN"/>
+            <replace key="content" find="log4j.logger.org.eclipse.jetty.util.component.AbstractLifeCycle=ERROR" replace-with="log4j.logger.org.spark_project.jetty.util.component.AbstractLifeCycle=ERROR"/>
+          </definition>
+        </changes>
+      </component>
     </service>
 
     <service name="TEZ">

http://git-wip-us.apache.org/repos/asf/ambari/blob/4042f9fd/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml
index ace9542..9caa850 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml
@@ -77,7 +77,7 @@
       <service name="FLUME">
         <component>FLUME_HANDLER</component>
       </service>
-      
+
       <service name="ACCUMULO">
         <component>ACCUMULO_TRACER</component>
         <component>ACCUMULO_GC</component>
@@ -355,7 +355,7 @@
         <task xsi:type="server_action" class="org.apache.ambari.server.serveraction.upgrades.FixCapacitySchedulerOrderingPolicy">
           <summary>Validate Root Queue Ordering Policy</summary>
         </task>
-      </execute-stage> 
+      </execute-stage>
 
       <!--TEZ-->
       <execute-stage service="TEZ" component="TEZ_CLIENT" title="Verify LZO codec path for Tez">
@@ -679,6 +679,15 @@
           <summary>Add queue customization property</summary>
         </task>
       </execute-stage>
+      <execute-stage service="SPARK2" component="SPARK2_THRIFTSERVER" title="Apply config changes for Spark2 ThriftServer log4j">
+        <task xsi:type="configure" id="hdp_2_5_0_0_spark2_thriftserver_log4j"/>
+      </execute-stage>
+      <execute-stage service="SPARK2" component="SPARK2_JOBHISTORYSERVER" title="Apply config changes for Spark2 Job HistoryServer log4j">
+        <task xsi:type="configure" id="hdp_2_5_0_0_spark2_jobhistoryserver_log4j"/>
+      </execute-stage>
+      <execute-stage service="SPARK2" component="SPARK2_CLIENT" title="Apply config changes for Spark2 Client log4j">
+        <task xsi:type="configure" id="hdp_2_5_0_0_spark2_client_log4j"/>
+      </execute-stage>
     </group>
 
     <!--
@@ -720,7 +729,7 @@
         </task>
       </execute-stage>
     </group>
-    
+
     <!-- Now, restart all of the services. -->
     <group xsi:type="restart" name="ZOOKEEPER" title="ZooKeeper">
       <service-check>false</service-check>
@@ -1083,7 +1092,7 @@
         <component>FLUME_HANDLER</component>
       </service>
     </group>
-    
+
     <group xsi:type="restart" name="ACCUMULO" title="Accumulo">
       <service-check>false</service-check>
       <skippable>true</skippable>
@@ -1112,7 +1121,7 @@
 
     <group xsi:type="cluster" name="FINALIZE_PRE_CHECK" title="Finalize {{direction.text.proper}} Pre-Check">
       <direction>UPGRADE</direction>
-      
+
       <execute-stage title="Check Component Versions">
         <task xsi:type="server_action" class="org.apache.ambari.server.serveraction.upgrades.ComponentVersionCheckAction" />
       </execute-stage>
@@ -1192,7 +1201,7 @@
             <function>setup_ranger_java_patches</function>
           </task>
         </pre-upgrade>
-        
+
         <pre-downgrade copy-upgrade="true" />
 
         <upgrade>
@@ -1215,7 +1224,7 @@
             <function>configure_atlas_user_for_tagsync</function>
           </task>
         </pre-upgrade>
-        
+
         <pre-downgrade copy-upgrade="true" />
 
         <upgrade>

http://git-wip-us.apache.org/repos/asf/ambari/blob/4042f9fd/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml
index df11ae1..4fc9b42 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml
@@ -183,7 +183,7 @@
         <component>HBASE_MASTER</component>
       </service>
     </group>
-    
+
     <group name="SERVICE_CHECK_1" title="All Service Checks" xsi:type="service-check">
       <direction>UPGRADE</direction>
       <skippable>true</skippable>
@@ -199,7 +199,7 @@
         <service>LOGSEARCH</service>
       </exclude>
     </group>
-    
+
     <group name="CORE_SLAVES" title="Core Slaves" xsi:type="colocated">
       <service-check>false</service-check>
       <skippable>true</skippable>
@@ -207,7 +207,7 @@
         <component>DATANODE</component>
         <component>NFS_GATEWAY</component>
       </service>
-      
+
       <service name="HBASE">
         <component>HBASE_REGIONSERVER</component>
         <component>PHOENIX_QUERY_SERVER</component>
@@ -223,7 +223,7 @@
         <message>The initial batch of {{components}} hosts have been {{direction.past}}. You are advised to check the hosts and perform cluster/workload-specific tests against your cluster to ensure proper operation before proceeding with {{direction.text}} of the remaining services.</message>
       </batch>
     </group>
-    
+
     <group name="SERVICE_CHECK_2" title="All Service Checks" xsi:type="service-check">
       <direction>UPGRADE</direction>
       <skippable>true</skippable>
@@ -458,7 +458,7 @@
 
     <group xsi:type="cluster" name="FINALIZE_PRE_CHECK" title="Finalize {{direction.text.proper}} Pre-Check">
       <direction>UPGRADE</direction>
-      
+
       <execute-stage title="Check Component Versions">
         <task xsi:type="server_action" class="org.apache.ambari.server.serveraction.upgrades.ComponentVersionCheckAction" />
       </execute-stage>
@@ -467,7 +467,7 @@
     <group xsi:type="cluster" name="POST_CLUSTER" title="Finalize {{direction.text.proper}}">
       <skippable>true</skippable>
       <supports-auto-skip-failure>false</supports-auto-skip-failure>
-      
+
       <execute-stage title="Confirm Finalize">
         <direction>UPGRADE</direction>
         <task xsi:type="manual">
@@ -491,7 +491,7 @@
           <function>finalize_rolling_upgrade</function>
         </task>
       </execute-stage>
-      
+
       <execute-stage title="Save Cluster State">
         <task xsi:type="server_action" class="org.apache.ambari.server.serveraction.upgrades.FinalizeUpgradeAction">
         </task>
@@ -577,7 +577,7 @@
             <function>configure_atlas_user_for_tagsync</function>
           </task>
         </pre-upgrade>
-        
+
         <pre-downgrade copy-upgrade="true" />
 
         <upgrade>
@@ -668,7 +668,7 @@
         </upgrade>
       </component>
     </service>
-    
+
     <service name="SLIDER">
       <component name="SLIDER">
         <upgrade>
@@ -691,7 +691,7 @@
           </task>
           <task xsi:type="configure" id="hdp_2_6_0_0_mapreduce_job_queuename"/>
         </pre-upgrade>
-        
+
         <pre-downgrade copy-upgrade="true" />
 
         <upgrade>
@@ -722,11 +722,11 @@
           <task xsi:type="configure" id="yarn_site_retained_log_count" />
           <task xsi:type="configure" id="hdp_2_6_0_0_service_check_queue_name"/>
           <task xsi:type="configure" id="hdp_2_6_0_0_ats_scan_interval_default"/>
-          
+
           <task xsi:type="server_action" class="org.apache.ambari.server.serveraction.upgrades.FixCapacitySchedulerOrderingPolicy">
             <summary>Validate Root Queue Ordering Policy</summary>
           </task>
-          
+
         </pre-upgrade>
         <pre-downgrade />
         <upgrade>
@@ -785,9 +785,9 @@
           </task>
           <task xsi:type="configure" id="hdp_2_5_0_0_tez_queue_name"/>
         </pre-upgrade>
-        
+
         <pre-downgrade copy-upgrade="true" />
-        
+
         <upgrade>
           <task xsi:type="restart-task" />
         </upgrade>
@@ -865,9 +865,9 @@
           <task xsi:type="configure" id="hdp_2_6_maint_llap_config"/>
           <task xsi:type="configure" id="llap_update_tez_shuffle_ssl_enable"/>
         </pre-upgrade>
-        
+
         <pre-downgrade />
-      
+
         <upgrade>
           <task xsi:type="restart-task" />
         </upgrade>
@@ -913,9 +913,9 @@
           <task xsi:type="configure" id="hdp_2_5_0_0_rename_spark_livy_configs" />
           <task xsi:type="configure" id="hdp_2_5_0_0_add_spark_conf_dir_livy_configs" />
         </pre-upgrade>
-        
+
         <pre-downgrade />
-        
+
         <upgrade>
           <task xsi:type="restart-task" />
         </upgrade>
@@ -933,11 +933,19 @@
 
     <service name="SPARK2">
       <component name="SPARK2_JOBHISTORYSERVER">
+        <pre-upgrade>
+          <task xsi:type="configure" id="hdp_2_5_0_0_spark2_jobhistoryserver_log4j"/>
+        </pre-upgrade>
+        <pre-downgrade />
         <upgrade>
           <task xsi:type="restart-task" />
         </upgrade>
       </component>
       <component name="SPARK2_THRIFTSERVER">
+        <pre-upgrade>
+          <task xsi:type="configure" id="hdp_2_5_0_0_spark2_thriftserver_log4j"/>
+        </pre-upgrade>
+        <pre-downgrade />
         <upgrade>
           <task xsi:type="restart-task" />
         </upgrade>
@@ -945,6 +953,7 @@
       <component name="SPARK2_CLIENT">
         <pre-upgrade>
           <task xsi:type="configure" id="hdp_2_5_0_0_spark2_yarn_queue"/>
+          <task xsi:type="configure" id="hdp_2_5_0_0_spark2_client_log4j"/>
         </pre-upgrade>
         <pre-downgrade/>
         <upgrade>

http://git-wip-us.apache.org/repos/asf/ambari/blob/4042f9fd/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK2/configuration/spark2-log4j-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK2/configuration/spark2-log4j-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK2/configuration/spark2-log4j-properties.xml
new file mode 100644
index 0000000..d7479f4
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK2/configuration/spark2-log4j-properties.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+<configuration supports_final="false" supports_adding_forbidden="true">
+  <property>
+    <name>content</name>
+    <description>Spark2-log4j-Properties</description>
+    <value>
+# Set everything to be logged to the console
+log4j.rootCategory=INFO, console
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+log4j.appender.console.target=System.err
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n
+
+# Set the default spark-shell log level to WARN. When running the spark-shell, the
+# log level for this class is used to overwrite the root logger's log level, so that
+# the user can have different defaults for the shell and regular Spark apps.
+log4j.logger.org.apache.spark.repl.Main=WARN
+
+# Settings to quiet third party logs that are too verbose
+log4j.logger.org.spark_project.jetty=WARN
+log4j.logger.org.spark_project.jetty.util.component.AbstractLifeCycle=ERROR
+log4j.logger.org.apache.spark.repl.SparkIMain$exprTyper=INFO
+log4j.logger.org.apache.spark.repl.SparkILoop$SparkILoopInterpreter=INFO
+log4j.logger.org.apache.parquet=ERROR
+log4j.logger.parquet=ERROR
+
+# SPARK-9183: Settings to avoid annoying messages when looking up nonexistent UDFs in SparkSQL with Hive support
+log4j.logger.org.apache.hadoop.hive.metastore.RetryingHMSHandler=FATAL
+log4j.logger.org.apache.hadoop.hive.ql.exec.FunctionRegistry=ERROR
+    </value>
+    <value-attributes>
+      <type>content</type>
+      <show-property-name>false</show-property-name>
+    </value-attributes>
+    <on-ambari-upgrade add="true"/>
+  </property>
+</configuration>


[37/50] [abbrv] ambari git commit: AMBARI-22445. Warn the user appropriately for default MySQL server install for Hive (vsubramanian)

Posted by am...@apache.org.
AMBARI-22445. Warn the user appropriately for default MySQL server install for Hive (vsubramanian)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 8fe6ac4bd03739202a35f8862270be7dcec95421
Parents: c67a324
Author: Vivek Ratnavel Subramanian <vi...@gmail.com>
Authored: Wed Nov 15 14:28:22 2017 -0800
Committer: Vivek Ratnavel Subramanian <vi...@gmail.com>
Committed: Wed Nov 15 14:28:22 2017 -0800

----------------------------------------------------------------------
 ambari-web/app/views/common/controls_view.js       | 9 +++++++--
 ambari-web/test/views/common/controls_view_test.js | 2 +-
 2 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8fe6ac4b/ambari-web/app/views/common/controls_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/controls_view.js b/ambari-web/app/views/common/controls_view.js
index 530b60a..63d08ce 100644
--- a/ambari-web/app/views/common/controls_view.js
+++ b/ambari-web/app/views/common/controls_view.js
@@ -543,8 +543,8 @@ App.ServiceConfigRadioButtons = Ember.View.extend(App.ServiceConfigCalculateId,
         if ((App.get('isHadoopWindowsStack') && this.get('inMSSQLWithIA')) || this.get('serviceConfig.name') === 'DB_FLAVOR') {
           this.onOptionsChange();
         }
-        this.handleDBConnectionProperty();
       }
+      this.handleDBConnectionProperty();
     }
   },
 
@@ -748,6 +748,11 @@ App.ServiceConfigRadioButtons = Ember.View.extend(App.ServiceConfigCalculateId,
       // check for all db types when installing Ranger - not only for existing ones
       checkDatabase = true;
     }
+    // Hive specific
+    if (this.get('serviceConfig.serviceName') === 'HIVE') {
+      // check for all db types when installing Hive - not only for existing ones
+      checkDatabase = true;
+    }
     if (propertyAppendTo1) {
       propertyAppendTo1.set('additionalView', null);
     }
@@ -757,7 +762,7 @@ App.ServiceConfigRadioButtons = Ember.View.extend(App.ServiceConfigCalculateId,
     var shouldAdditionalViewsBeSet = currentDB && checkDatabase && handledProperties.contains(this.get('serviceConfig.name')),
       driver = this.getDefaultPropertyValue('sql_jar_connector') ? this.getDefaultPropertyValue('sql_jar_connector').split("/").pop() : 'driver.jar',
       dbType = this.getDefaultPropertyValue('db_type'),
-      additionalView1 = shouldAdditionalViewsBeSet ? App.CheckDBConnectionView.extend({databaseName: dbType}) : null,
+      additionalView1 = shouldAdditionalViewsBeSet && !this.get('isNewDb') ? App.CheckDBConnectionView.extend({databaseName: dbType}) : null,
       additionalView2 = shouldAdditionalViewsBeSet ? Ember.View.extend({
         template: Ember.Handlebars.compile('<div class="alert alert-warning">{{{view.message}}}</div>'),
         message: function() {

http://git-wip-us.apache.org/repos/asf/ambari/blob/8fe6ac4b/ambari-web/test/views/common/controls_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/common/controls_view_test.js b/ambari-web/test/views/common/controls_view_test.js
index 17dd6e1..76742fa 100644
--- a/ambari-web/test/views/common/controls_view_test.js
+++ b/ambari-web/test/views/common/controls_view_test.js
@@ -59,7 +59,7 @@ describe('App.ServiceConfigRadioButtons', function () {
           propertyAppendTo1: 'javax.jdo.option.ConnectionURL',
           propertyAppendTo2: 'hive_database',
           isAdditionalView1Null: true,
-          isAdditionalView2Null: true,
+          isAdditionalView2Null: false,
           title: 'Hive, embedded database'
         },
         {


[10/50] [abbrv] ambari git commit: AMBARI-22415. Blueprint deploys failing with missing smoke user keytab file (echekanskiy)

Posted by am...@apache.org.
AMBARI-22415. Blueprint deploys failing with missing smoke user keytab file (echekanskiy)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: ec02a14c02529ec7fec647e6fed7c8c401f10e6d
Parents: 22b2d55
Author: Eugene Chekanskiy <ec...@gmail.com>
Authored: Fri Nov 10 17:17:34 2017 +0200
Committer: Eugene Chekanskiy <ec...@gmail.com>
Committed: Fri Nov 10 18:29:43 2017 +0200

----------------------------------------------------------------------
 .../kerberos/CreateKeytabFilesServerAction.java             | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ec02a14c/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/CreateKeytabFilesServerAction.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/CreateKeytabFilesServerAction.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/CreateKeytabFilesServerAction.java
index aa65e61..5ec4c10 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/CreateKeytabFilesServerAction.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/CreateKeytabFilesServerAction.java
@@ -218,17 +218,18 @@ public class CreateKeytabFilesServerAction extends KerberosServerAction {
                 }
 
                 boolean regenerateKeytabs = getOperationType(getCommandParameters()) == OperationType.RECREATE_ALL;
+
+                KerberosPrincipalEntity principalEntity = kerberosPrincipalDAO.find(evaluatedPrincipal);
+                String cachedKeytabPath = (principalEntity == null) ? null : principalEntity.getCachedKeytabPath();
+
                 if (password == null) {
                   if (!regenerateKeytabs && (hostName.equalsIgnoreCase(KerberosHelper.AMBARI_SERVER_HOST_NAME) || kerberosPrincipalHostDAO
-                      .exists(evaluatedPrincipal, hostEntity.getHostId(), keytabFilePath))) {
+                      .exists(evaluatedPrincipal, hostEntity.getHostId(), keytabFilePath)) && cachedKeytabPath == null) {
                     // There is nothing to do for this since it must already exist and we don't want to
                     // regenerate the keytab
                     message = String.format("Skipping keytab file for %s, missing password indicates nothing to do", evaluatedPrincipal);
                     LOG.debug(message);
                   } else {
-                    KerberosPrincipalEntity principalEntity = kerberosPrincipalDAO.find(evaluatedPrincipal);
-                    String cachedKeytabPath = (principalEntity == null) ? null : principalEntity.getCachedKeytabPath();
-
                     if (cachedKeytabPath == null) {
                       message = String.format("Failed to create keytab for %s, missing cached file", evaluatedPrincipal);
                       actionLog.writeStdErr(message);


[19/50] [abbrv] ambari git commit: AMBARI-22347. Simplify Ambari configuration tables from AMBARI-21307 (rlevas)

Posted by am...@apache.org.
AMBARI-22347.  Simplify Ambari configuration tables from AMBARI-21307 (rlevas)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 4fa9ac5505d6604f1d74def8fc1ea6eeb3ea3fda
Parents: 18e5490
Author: Robert Levas <rl...@hortonworks.com>
Authored: Mon Nov 13 13:11:42 2017 -0500
Committer: Robert Levas <rl...@hortonworks.com>
Committed: Mon Nov 13 13:12:11 2017 -0500

----------------------------------------------------------------------
 .../AmbariConfigurationRequestSwagger.java      |  14 +-
 .../services/AmbariConfigurationService.java    |  46 +-
 .../api/services/ldap/AmbariConfiguration.java  |  51 +--
 .../services/ldap/LdapConfigurationService.java |   4 +-
 .../AmbariConfigurationResourceProvider.java    | 370 +++++++---------
 .../events/AmbariConfigurationChangedEvent.java |  36 ++
 .../ambari/server/events/AmbariEvent.java       |   4 +-
 .../events/AmbariLdapConfigChangedEvent.java    |  37 --
 .../ldap/domain/AmbariLdapConfiguration.java    |  20 +-
 .../AmbariLdapConfigurationProvider.java        |  57 ++-
 .../ads/LdapConnectionTemplateFactory.java      |   4 +-
 .../server/orm/dao/AmbariConfigurationDAO.java  | 146 ++++--
 .../orm/entities/AmbariConfigurationEntity.java |  94 ++--
 .../entities/AmbariConfigurationEntityPK.java   |  88 ++++
 .../orm/entities/ConfigurationBaseEntity.java   | 159 -------
 .../server/upgrade/SchemaUpgradeHelper.java     |   3 +-
 .../server/upgrade/UpgradeCatalog300.java       |  21 +-
 .../main/resources/Ambari-DDL-Derby-CREATE.sql  |  21 +-
 .../main/resources/Ambari-DDL-MySQL-CREATE.sql  |  20 +-
 .../main/resources/Ambari-DDL-Oracle-CREATE.sql |  20 +-
 .../resources/Ambari-DDL-Postgres-CREATE.sql    |  19 +-
 .../resources/Ambari-DDL-SQLAnywhere-CREATE.sql |  20 +-
 .../resources/Ambari-DDL-SQLServer-CREATE.sql   |  19 +-
 .../src/main/resources/META-INF/persistence.xml |   1 -
 ...AmbariConfigurationResourceProviderTest.java | 444 ++++++++++++-------
 .../orm/dao/AmbariConfigurationDAOTest.java     | 298 +++++++++++++
 .../server/upgrade/UpgradeCatalog300Test.java   |  43 ++
 27 files changed, 1223 insertions(+), 836 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4fa9ac55/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationRequestSwagger.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationRequestSwagger.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationRequestSwagger.java
index 5e8094e..2dca9f5 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationRequestSwagger.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationRequestSwagger.java
@@ -29,19 +29,9 @@ public interface AmbariConfigurationRequestSwagger extends ApiModel {
 
   interface AmbariConfigurationRequestInfo {
     @ApiModelProperty
-    Long getId();
+    String getCategoryName();
 
     @ApiModelProperty
-    Map<String, Object> getData();
-
-    @ApiModelProperty
-    String getType();
-
-    @ApiModelProperty
-    Long getVersion();
-
-    @ApiModelProperty(name = "version_tag")
-    String getVersionTag();
+    Map<String, Object> getProperties();
   }
-
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/4fa9ac55/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java
index 38ae766..86ed666 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java
@@ -46,21 +46,21 @@ import io.swagger.annotations.ApiResponses;
  * Ambari configuration resources may be shared with components and services in the cluster
  * (by recommending them as default values)
  *
- * Eg. LDAP configuration is stored as ambariconfiguration.
+ * Eg. LDAP configuration is stored as AmbariConfiguration.
  * The request payload has the form:
  *
  * <pre>
  *      {
  *        "AmbariConfiguration": {
- *            "type": "ldap-configuration",
- *            "data": [
- *                {
- *                 "authentication.ldap.primaryUrl": "localhost:33389"
- *                 "authentication.ldap.secondaryUrl": "localhost:333"
- *                 "authentication.ldap.baseDn": "dc=ambari,dc=apache,dc=org"
- *                 // ......
- *         ]
- *     }
+ *          "category": "ldap-configuration",
+ *          "properties": {
+ *             "authentication.ldap.primaryUrl": "localhost:33389"
+ *             "authentication.ldap.secondaryUrl": "localhost:333"
+ *             "authentication.ldap.baseDn": "dc=ambari,dc=apache,dc=org"
+ *             // ......
+ *          }
+ *        }
+ *      }
  * </pre>
  */
 @Path("/ambariconfigs/")
@@ -96,7 +96,7 @@ public class AmbariConfigurationService extends BaseService {
   })
   public Response createAmbariConfiguration(String body, @Context HttpHeaders headers, @Context UriInfo uri) {
     return handleRequest(headers, body, uri, Request.Type.POST, createResource(Resource.Type.AmbariConfiguration,
-      Collections.EMPTY_MAP));
+      Collections.emptyMap()));
   }
 
   @GET
@@ -108,10 +108,10 @@ public class AmbariConfigurationService extends BaseService {
     responseContainer = RESPONSE_CONTAINER_LIST)
   @ApiImplicitParams({
     @ApiImplicitParam(name = QUERY_FIELDS, value = QUERY_FILTER_DESCRIPTION,
-      defaultValue = "AmbariConfiguration/data, AmbariConfiguration/id, AmbariConfiguration/type",
+      defaultValue = "AmbariConfiguration/properties, AmbariConfiguration/category",
       dataType = DATA_TYPE_STRING, paramType = PARAM_TYPE_QUERY),
     @ApiImplicitParam(name = QUERY_SORT, value = QUERY_SORT_DESCRIPTION,
-      defaultValue = "AmbariConfiguration/id",
+      defaultValue = "AmbariConfiguration/category",
       dataType = DATA_TYPE_STRING, paramType = PARAM_TYPE_QUERY),
     @ApiImplicitParam(name = QUERY_PAGE_SIZE, value = QUERY_PAGE_SIZE_DESCRIPTION, defaultValue = DEFAULT_PAGE_SIZE, dataType = DATA_TYPE_INT, paramType = PARAM_TYPE_QUERY),
     @ApiImplicitParam(name = QUERY_FROM, value = QUERY_FROM_DESCRIPTION, defaultValue = DEFAULT_FROM, dataType = DATA_TYPE_STRING, paramType = PARAM_TYPE_QUERY),
@@ -123,11 +123,11 @@ public class AmbariConfigurationService extends BaseService {
   })
   public Response getAmbariConfigurations(String body, @Context HttpHeaders headers, @Context UriInfo uri) {
     return handleRequest(headers, body, uri, Request.Type.GET, createResource(Resource.Type.AmbariConfiguration,
-      Collections.EMPTY_MAP));
+      Collections.emptyMap()));
   }
 
   @GET
-  @Path("{configurationId}")
+  @Path("{category}")
   @Produces(MediaType.TEXT_PLAIN)
   @ApiOperation(value = "Retrieve the details of an ambari configuration resource",
     nickname = "AmbariConfigurationService#getAmbariConfiguration",
@@ -142,13 +142,13 @@ public class AmbariConfigurationService extends BaseService {
     @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = MSG_SERVER_ERROR)
   })
   public Response getAmbariConfiguration(String body, @Context HttpHeaders headers, @Context UriInfo uri,
-                                         @PathParam("configurationId") String configurationId) {
+                                         @PathParam("category") String category) {
     return handleRequest(headers, body, uri, Request.Type.GET, createResource(Resource.Type.AmbariConfiguration,
-      Collections.singletonMap(Resource.Type.AmbariConfiguration, configurationId)));
+      Collections.singletonMap(Resource.Type.AmbariConfiguration, category)));
   }
 
   @PUT
-  @Path("{configurationId}")
+  @Path("{category}")
   @Produces(MediaType.TEXT_PLAIN)
   @ApiOperation(value = "Updates ambari configuration resources ",
     nickname = "AmbariConfigurationService#updateAmbariConfiguration")
@@ -167,13 +167,13 @@ public class AmbariConfigurationService extends BaseService {
     @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = MSG_SERVER_ERROR),
   })
   public Response updateAmbariConfiguration(String body, @Context HttpHeaders headers, @Context UriInfo uri,
-                                            @PathParam("configurationId") String configurationId) {
+                                            @PathParam("category") String category) {
     return handleRequest(headers, body, uri, Request.Type.PUT, createResource(Resource.Type.AmbariConfiguration,
-      Collections.singletonMap(Resource.Type.AmbariConfiguration, configurationId)));
+      Collections.singletonMap(Resource.Type.AmbariConfiguration, category)));
   }
 
   @DELETE
-  @Path("{configurationId}")
+  @Path("{category}")
   @Produces(MediaType.TEXT_PLAIN)
   @ApiOperation(value = "Deletes an ambari configuration resource",
     nickname = "AmbariConfigurationService#deleteAmbariConfiguration")
@@ -185,9 +185,9 @@ public class AmbariConfigurationService extends BaseService {
     @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = MSG_SERVER_ERROR),
   })
   public Response deleteAmbariConfiguration(String body, @Context HttpHeaders headers, @Context UriInfo uri,
-                                            @PathParam("configurationId") String configurationId) {
+                                            @PathParam("category") String category) {
     return handleRequest(headers, body, uri, Request.Type.DELETE, createResource(Resource.Type.AmbariConfiguration,
-      Collections.singletonMap(Resource.Type.AmbariConfiguration, configurationId)));
+      Collections.singletonMap(Resource.Type.AmbariConfiguration, category)));
   }
 
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/4fa9ac55/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
index b5cc921..e9f0b1e 100644
--- 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
@@ -14,9 +14,7 @@
 
 package org.apache.ambari.server.api.services.ldap;
 
-import java.util.Collections;
 import java.util.Map;
-import java.util.Set;
 
 /**
  * Domain POJO representing generic ambari configuration data.
@@ -28,22 +26,7 @@ public class AmbariConfiguration {
    */
   private String type;
 
-  /**
-   * Version tag
-   */
-  private String versionTag;
-
-  /**
-   * Version number
-   */
-  private Integer version;
-
-  /**
-   * Created timestamp
-   */
-  private long createdTs;
-
-  private Set<Map<String, Object>> data = Collections.emptySet();
+  private Map<String, Object> properties = null;
 
   public String getType() {
     return type;
@@ -53,35 +36,11 @@ public class AmbariConfiguration {
     this.type = type;
   }
 
-  public Set<Map<String, Object>> getData() {
-    return data;
-  }
-
-  public void setData(Set<Map<String, Object>> data) {
-    this.data = data;
-  }
-
-  public String getVersionTag() {
-    return versionTag;
-  }
-
-  public void setVersionTag(String versionTag) {
-    this.versionTag = versionTag;
-  }
-
-  public Integer getVersion() {
-    return version;
-  }
-
-  public void setVersion(Integer version) {
-    this.version = version;
-  }
-
-  public long getCreatedTs() {
-    return createdTs;
+  public Map<String, Object> getProperties() {
+    return properties;
   }
 
-  public void setCreatedTs(long createdTs) {
-    this.createdTs = createdTs;
+  public void setProperties(Map<String, Object> data) {
+    this.properties = data;
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/4fa9ac55/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
index 13f8835..00c13f6 100644
--- 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
@@ -94,7 +94,7 @@ public class LdapConfigurationService extends AmbariConfigurationService {
       validateRequest(ldapConfigurationRequest);
 
       AmbariLdapConfiguration ambariLdapConfiguration = ambariLdapConfigurationFactory.createLdapConfiguration(
-        ldapConfigurationRequest.getAmbariConfiguration().getData().iterator().next());
+        ldapConfigurationRequest.getAmbariConfiguration().getProperties());
 
       LdapConfigOperation action = LdapConfigOperation.fromAction(ldapConfigurationRequest.getRequestInfo().getAction());
       switch (action) {
@@ -154,7 +154,7 @@ public class LdapConfigurationService extends AmbariConfigurationService {
     }
 
     if (null == ldapConfigurationRequest.getAmbariConfiguration()
-      || ldapConfigurationRequest.getAmbariConfiguration().getData().size() != 1) {
+      || ldapConfigurationRequest.getAmbariConfiguration().getProperties() != null) {
       errMsg = String.format("No / Invalid configuration data provided. Request: [%s]", ldapConfigurationRequest);
       LOGGER.error(errMsg);
       throw new IllegalArgumentException(errMsg);

http://git-wip-us.apache.org/repos/asf/ambari/blob/4fa9ac55/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProvider.java
index 4f4cc70..a24400d 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProvider.java
@@ -14,15 +14,15 @@
 
 package org.apache.ambari.server.controller.internal;
 
-import java.util.Calendar;
+import java.util.Arrays;
 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 javax.inject.Inject;
+import java.util.TreeMap;
 
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.controller.spi.NoSuchParentResourceException;
@@ -35,20 +35,18 @@ import org.apache.ambari.server.controller.spi.ResourceAlreadyExistsException;
 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.events.AmbariEvent;
-import org.apache.ambari.server.events.AmbariLdapConfigChangedEvent;
+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.orm.entities.ConfigurationBaseEntity;
 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.common.collect.Sets;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.google.inject.assistedinject.AssistedInject;
+import com.google.inject.Inject;
 
 /**
  * Resource provider for AmbariConfiguration resources.
@@ -56,62 +54,24 @@ import com.google.inject.assistedinject.AssistedInject;
 public class AmbariConfigurationResourceProvider extends AbstractAuthorizedResourceProvider {
 
   private static final Logger LOGGER = LoggerFactory.getLogger(AmbariConfigurationResourceProvider.class);
-  private static final String DEFAULT_VERSION_TAG = "Default version";
-  private static final Integer DEFAULT_VERSION = 1;
-
-  /**
-   * Resource property id constants.
-   */
-  public enum ResourcePropertyId {
-
-    ID("AmbariConfiguration/id"),
-    TYPE("AmbariConfiguration/type"),
-    VERSION("AmbariConfiguration/version"),
-    VERSION_TAG("AmbariConfiguration/version_tag"),
-    DATA("AmbariConfiguration/data");
-
-    private String propertyId;
-
-    ResourcePropertyId(String propertyId) {
-      this.propertyId = propertyId;
-    }
-
-    String getPropertyId() {
-      return this.propertyId;
-    }
 
-    public static ResourcePropertyId fromString(String propertyIdStr) {
-      ResourcePropertyId propertyIdFromStr = null;
+  static final String AMBARI_CONFIGURATION_CATEGORY_PROPERTY_ID = PropertyHelper.getPropertyId("AmbariConfiguration", "category");
+  static final String AMBARI_CONFIGURATION_PROPERTIES_PROPERTY_ID = PropertyHelper.getPropertyId("AmbariConfiguration", "properties");
 
-      for (ResourcePropertyId id : ResourcePropertyId.values()) {
-        if (id.getPropertyId().equals(propertyIdStr)) {
-          propertyIdFromStr = id;
-          break;
-        }
-      }
-
-      if (propertyIdFromStr == null) {
-        throw new IllegalArgumentException("Unsupported property type: " + propertyIdStr);
-      }
-
-      return propertyIdFromStr;
-
-    }
-  }
+  private static final Set<String> PROPERTIES = Collections.unmodifiableSet(
+      new HashSet<>(Arrays.asList(
+          AMBARI_CONFIGURATION_CATEGORY_PROPERTY_ID,
+          AMBARI_CONFIGURATION_PROPERTIES_PROPERTY_ID)
+      )
+  );
 
-  private static Set<String> PROPERTIES = Sets.newHashSet(
-    ResourcePropertyId.ID.getPropertyId(),
-    ResourcePropertyId.TYPE.getPropertyId(),
-    ResourcePropertyId.VERSION.getPropertyId(),
-    ResourcePropertyId.VERSION_TAG.getPropertyId(),
-    ResourcePropertyId.DATA.getPropertyId());
-
-  private static Map<Resource.Type, String> PK_PROPERTY_MAP = Collections.unmodifiableMap(
-    new HashMap<Resource.Type, String>() {{
-      put(Resource.Type.AmbariConfiguration, ResourcePropertyId.ID.getPropertyId());
-    }}
+  private static final Map<Resource.Type, String> PK_PROPERTY_MAP = Collections.unmodifiableMap(
+      Collections.singletonMap(Resource.Type.AmbariConfiguration, AMBARI_CONFIGURATION_CATEGORY_PROPERTY_ID)
   );
 
+  private static final Set<String> PK_PROPERTY_IDS = Collections.unmodifiableSet(
+      new HashSet<>(PK_PROPERTY_MAP.values())
+  );
 
   @Inject
   private AmbariConfigurationDAO ambariConfigurationDAO;
@@ -119,210 +79,224 @@ public class AmbariConfigurationResourceProvider extends AbstractAuthorizedResou
   @Inject
   private AmbariEventPublisher publisher;
 
-
-  private Gson gson;
-
-  @AssistedInject
   public AmbariConfigurationResourceProvider() {
     super(PROPERTIES, PK_PROPERTY_MAP);
-    setRequiredCreateAuthorizations(EnumSet.of(RoleAuthorization.AMBARI_MANAGE_CONFIGURATION));
-    setRequiredDeleteAuthorizations(EnumSet.of(RoleAuthorization.AMBARI_MANAGE_CONFIGURATION));
 
-    gson = new GsonBuilder().create();
+    Set<RoleAuthorization> authorizations = EnumSet.of(RoleAuthorization.AMBARI_MANAGE_CONFIGURATION);
+    setRequiredCreateAuthorizations(authorizations);
+    setRequiredDeleteAuthorizations(authorizations);
+    setRequiredUpdateAuthorizations(authorizations);
+    setRequiredGetAuthorizations(authorizations);
   }
 
   @Override
   protected Set<String> getPKPropertyIds() {
-    return Sets.newHashSet(ResourcePropertyId.ID.getPropertyId());
+    return PK_PROPERTY_IDS;
   }
 
   @Override
-  public RequestStatus createResourcesAuthorized(Request request) throws SystemException, UnsupportedPropertyException,
-    ResourceAlreadyExistsException, NoSuchParentResourceException {
-
-    LOGGER.info("Creating new ambari configuration resource ...");
-    AmbariConfigurationEntity ambariConfigurationEntity = null;
-    try {
-      ambariConfigurationEntity = getEntityFromRequest(request);
-    } catch (AmbariException e) {
-      throw new NoSuchParentResourceException(e.getMessage());
-    }
-
-    LOGGER.info("Persisting new ambari configuration: {} ", ambariConfigurationEntity);
-
-    try {
-      ambariConfigurationDAO.create(ambariConfigurationEntity);
-    } catch (Exception e) {
-      LOGGER.error("Failed to create resource", e);
-      throw new ResourceAlreadyExistsException(e.getMessage());
-    }
+  public RequestStatus createResourcesAuthorized(Request request)
+      throws SystemException, UnsupportedPropertyException, ResourceAlreadyExistsException, NoSuchParentResourceException {
 
-    // todo filter by configuration type
-    // notify subscribers about the configuration changes
-    publisher.publish(new AmbariLdapConfigChangedEvent(AmbariEvent.AmbariEventType.LDAP_CONFIG_CHANGED,
-      ambariConfigurationEntity.getId()));
+    createOrAddProperties(null, request.getProperties(), true);
 
     return getRequestStatus(null);
   }
 
-
   @Override
   protected Set<Resource> getResourcesAuthorized(Request request, Predicate predicate) throws SystemException,
-    UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
-    Set<Resource> resources = Sets.newHashSet();
+      UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
 
-    // retrieves allconfigurations, filtering is done at a higher level
-    List<AmbariConfigurationEntity> ambariConfigurationEntities = ambariConfigurationDAO.findAll();
-    for (AmbariConfigurationEntity ambariConfigurationEntity : ambariConfigurationEntities) {
-      try {
-        resources.add(toResource(ambariConfigurationEntity, getPropertyIds()));
-      } catch (AmbariException e) {
-        LOGGER.error("Error while retrieving ambari configuration", e);
+    return getResources(new Command<Set<Resource>>() {
+      @Override
+      public Set<Resource> invoke() throws AmbariException {
+        Set<Resource> resources = new HashSet<>();
+        Set<String> requestedIds = getRequestPropertyIds(request, predicate);
+
+        if (CollectionUtils.isEmpty(requestedIds)) {
+          requestedIds = PROPERTIES;
+        }
+
+        if (predicate == null) {
+          Set<Resource> _resources = getAmbariConfigurationResources(requestedIds, null);
+          if (!CollectionUtils.isEmpty(_resources)) {
+            resources.addAll(_resources);
+          }
+        } else {
+          for (Map<String, Object> propertyMap : getPropertyMaps(predicate)) {
+            Set<Resource> _resources = getAmbariConfigurationResources(requestedIds, propertyMap);
+            if (!CollectionUtils.isEmpty(_resources)) {
+              resources.addAll(_resources);
+            }
+          }
+        }
+
+        return resources;
       }
-    }
-    return resources;
+    });
   }
 
+
   @Override
   protected RequestStatus deleteResourcesAuthorized(Request request, Predicate predicate) throws SystemException,
-    UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
+      UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
 
-    Long idFromRequest = Long.valueOf((String) PredicateHelper.getProperties(predicate).get(ResourcePropertyId.ID.getPropertyId()));
+    String categoryName = (String) PredicateHelper.getProperties(predicate).get(AMBARI_CONFIGURATION_CATEGORY_PROPERTY_ID);
 
-    if (null == idFromRequest) {
+    if (null == categoryName) {
       LOGGER.debug("No resource id provided in the request");
     } else {
-      LOGGER.debug("Deleting amari configuration with id: {}", idFromRequest);
+      LOGGER.debug("Deleting Ambari configuration with id: {}", categoryName);
       try {
-        ambariConfigurationDAO.removeByPK(idFromRequest);
+        ambariConfigurationDAO.removeByCategory(categoryName);
       } catch (IllegalStateException e) {
         throw new NoSuchResourceException(e.getMessage());
       }
-
     }
 
     // notify subscribers about the configuration changes
-    publisher.publish(new AmbariLdapConfigChangedEvent(AmbariEvent.AmbariEventType.LDAP_CONFIG_CHANGED, idFromRequest));
-
-
+    publisher.publish(new AmbariConfigurationChangedEvent(categoryName));
     return getRequestStatus(null);
-
   }
 
   @Override
-  protected RequestStatus updateResourcesAuthorized(Request request, Predicate predicate) throws SystemException,
-    UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
-    Long idFromRequest = Long.valueOf((String) PredicateHelper.getProperties(predicate).get(ResourcePropertyId.ID.getPropertyId()));
-
-    AmbariConfigurationEntity persistedEntity = ambariConfigurationDAO.findByPK(idFromRequest);
-    if (persistedEntity == null) {
-      String errorMsg = String.format("Entity with primary key [ %s ] not found in the database.", idFromRequest);
-      LOGGER.error(errorMsg);
-      throw new NoSuchResourceException(errorMsg);
-    }
+  protected RequestStatus updateResourcesAuthorized(Request request, Predicate predicate)
+      throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
 
-    try {
-
-      AmbariConfigurationEntity entityFromRequest = getEntityFromRequest(request);
-      persistedEntity.getConfigurationBaseEntity().setVersionTag(entityFromRequest.getConfigurationBaseEntity().getVersionTag());
-      persistedEntity.getConfigurationBaseEntity().setVersion(entityFromRequest.getConfigurationBaseEntity().getVersion());
-      persistedEntity.getConfigurationBaseEntity().setType(entityFromRequest.getConfigurationBaseEntity().getType());
-      persistedEntity.getConfigurationBaseEntity().setConfigurationData(entityFromRequest.getConfigurationBaseEntity().getConfigurationData());
-      persistedEntity.getConfigurationBaseEntity().setConfigurationAttributes(entityFromRequest.getConfigurationBaseEntity().getConfigurationAttributes());
+    String categoryName = (String) PredicateHelper.getProperties(predicate).get(AMBARI_CONFIGURATION_CATEGORY_PROPERTY_ID);
+    createOrAddProperties(categoryName, request.getProperties(), false);
 
+    return getRequestStatus(null);
+  }
 
-      ambariConfigurationDAO.update(persistedEntity);
-    } catch (AmbariException e) {
-      throw new NoSuchParentResourceException(e.getMessage());
+  /**
+   * Retrieves groups of properties from the request data and create or updates them as needed.
+   * <p>
+   * Each group of properties is expected to have a category (<code>AmbariConfiguration/category</code>)
+   * 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).
+   *
+   * @param defaultCategoryName            the default category to use if needed
+   * @param requestProperties              a collection of property maps parsed from the request
+   * @param removePropertiesIfNotSpecified <code>true</code> to remove existing properties that have not been specifed in the request; <code>false</code> append or update the existing set of properties with values from the request
+   * @throws SystemException if an error occurs saving the configuration data
+   */
+  private void createOrAddProperties(String defaultCategoryName, Set<Map<String, Object>> requestProperties, boolean removePropertiesIfNotSpecified)
+      throws SystemException {
+    // set of resource properties (each entry in the set belongs to a different resource)
+    if (requestProperties != null) {
+      for (Map<String, Object> resourceProperties : requestProperties) {
+        Map<String, Map<String, String>> entityMap = parseProperties(defaultCategoryName, resourceProperties);
+
+        if (entityMap != null) {
+          for (Map.Entry<String, Map<String, String>> entry : entityMap.entrySet()) {
+            String categoryName = entry.getKey();
+
+            if (ambariConfigurationDAO.reconcileCategory(categoryName, entry.getValue(), removePropertiesIfNotSpecified)) {
+              // notify subscribers about the configuration changes
+              publisher.publish(new AmbariConfigurationChangedEvent(categoryName));
+            }
+          }
+        }
+      }
     }
+  }
 
-    publisher.publish(new AmbariLdapConfigChangedEvent(AmbariEvent.AmbariEventType.LDAP_CONFIG_CHANGED,
-      persistedEntity.getId()));
-
+  private Resource toResource(String categoryName, Map<String, String> properties, Set<String> requestedIds) {
+    Resource resource = new ResourceImpl(Resource.Type.AmbariConfiguration);
+    setResourceProperty(resource, AMBARI_CONFIGURATION_CATEGORY_PROPERTY_ID, categoryName, requestedIds);
+    setResourceProperty(resource, AMBARI_CONFIGURATION_PROPERTIES_PROPERTY_ID, properties, requestedIds);
+    return resource;
+  }
 
-    return getRequestStatus(null);
+  /**
+   * Parse the property map from a request into a map of category names to maps of property names and values.
+   *
+   * @param defaultCategoryName the default category name to use if one is not found in the map of properties
+   * @param resourceProperties  a map of properties from a request item
+   * @return a map of category names to maps of name/value pairs
+   * @throws SystemException if an issue with the data is determined
+   */
+  private Map<String, Map<String, String>> parseProperties(String defaultCategoryName, Map<String, Object> resourceProperties) throws SystemException {
+    String categoryName = null;
+    Map<String, String> properties = new HashMap<>();
 
-  }
+    for (Map.Entry<String, Object> entry : resourceProperties.entrySet()) {
+      String propertyName = entry.getKey();
 
-  private Resource toResource(AmbariConfigurationEntity entity, Set<String> requestedIds) throws AmbariException {
+      if (AMBARI_CONFIGURATION_CATEGORY_PROPERTY_ID.equals(propertyName)) {
+        if (entry.getValue() instanceof String) {
+          categoryName = (String) entry.getValue();
+        }
+      } else {
+        String propertyCategory = PropertyHelper.getPropertyCategory(entry.getKey());
+        if ((propertyCategory != null) && propertyCategory.equals(AMBARI_CONFIGURATION_PROPERTIES_PROPERTY_ID)) {
+          String name = PropertyHelper.getPropertyName(entry.getKey());
+          Object value = entry.getValue();
+          properties.put(name, (value == null) ? null : value.toString());
+        }
+      }
+    }
 
-    if (null == entity) {
-      throw new IllegalArgumentException("Null entity can't be transformed into a resource");
+    if (categoryName == null) {
+      categoryName = defaultCategoryName;
     }
 
-    if (null == entity.getConfigurationBaseEntity()) {
-      throw new IllegalArgumentException("Invalid configuration entity can't be transformed into a resource");
+    if (StringUtils.isEmpty(categoryName)) {
+      throw new SystemException("The configuration type must be set");
     }
-    Resource resource = new ResourceImpl(Resource.Type.AmbariConfiguration);
-    Set<Map<String, String>> configurationSet = gson.fromJson(entity.getConfigurationBaseEntity().getConfigurationData(), Set.class);
 
-    setResourceProperty(resource, ResourcePropertyId.ID.getPropertyId(), entity.getId(), requestedIds);
-    setResourceProperty(resource, ResourcePropertyId.TYPE.getPropertyId(), entity.getConfigurationBaseEntity().getType(), requestedIds);
-    setResourceProperty(resource, ResourcePropertyId.DATA.getPropertyId(), configurationSet, requestedIds);
-    setResourceProperty(resource, ResourcePropertyId.VERSION.getPropertyId(), entity.getConfigurationBaseEntity().getVersion(), requestedIds);
-    setResourceProperty(resource, ResourcePropertyId.VERSION_TAG.getPropertyId(), entity.getConfigurationBaseEntity().getVersionTag(), requestedIds);
+    if (properties.isEmpty()) {
+      throw new SystemException("The configuration properties must be set");
+    }
 
-    return resource;
+    return Collections.singletonMap(categoryName, properties);
   }
 
-  private AmbariConfigurationEntity getEntityFromRequest(Request request) throws AmbariException {
+  private Set<Resource> getAmbariConfigurationResources(Set<String> requestedIds, Map<String, Object> propertyMap) {
+    Set<Resource> resources = new HashSet<>();
 
-    AmbariConfigurationEntity ambariConfigurationEntity = new AmbariConfigurationEntity();
-    ambariConfigurationEntity.setConfigurationBaseEntity(new ConfigurationBaseEntity());
+    String categoryName = getStringProperty(propertyMap, AMBARI_CONFIGURATION_CATEGORY_PROPERTY_ID);
 
-    // set of resource properties (eache entry in the set belongs to a different resource)
-    Set<Map<String, Object>> resourcePropertiesSet = request.getProperties();
+    List<AmbariConfigurationEntity> entities = (categoryName == null)
+        ? ambariConfigurationDAO.findAll()
+        : ambariConfigurationDAO.findByCategory(categoryName);
 
-    if (resourcePropertiesSet.size() != 1) {
-      throw new AmbariException("There must be only one resource specified in the request");
-    }
+    if (entities != null) {
+      Map<String, Map<String, String>> configurations = new HashMap<>();
 
-    // the configuration type must be set
-    if (getValueFromResourceProperties(ResourcePropertyId.TYPE, resourcePropertiesSet.iterator().next()) == null) {
-      throw new AmbariException("The configuration type must be set");
-    }
+      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);
+        }
 
-    for (ResourcePropertyId resourcePropertyId : ResourcePropertyId.values()) {
-      Object requestValue = getValueFromResourceProperties(resourcePropertyId, resourcePropertiesSet.iterator().next());
+        properties.put(entity.getPropertyName(), entity.getPropertyValue());
+      }
 
-      switch (resourcePropertyId) {
-        case DATA:
-          if (requestValue == null) {
-            throw new IllegalArgumentException("No configuration data is provided in the request");
-          }
-          ambariConfigurationEntity.getConfigurationBaseEntity().setConfigurationData(gson.toJson(requestValue));
-          break;
-        case TYPE:
-          ambariConfigurationEntity.getConfigurationBaseEntity().setType((String) requestValue);
-          break;
-        case VERSION:
-          Integer version = (requestValue == null) ? DEFAULT_VERSION : Integer.valueOf((String) requestValue);
-          ambariConfigurationEntity.getConfigurationBaseEntity().setVersion((version));
-          break;
-        case VERSION_TAG:
-          String versionTag = requestValue == null ? DEFAULT_VERSION_TAG : (String) requestValue;
-          ambariConfigurationEntity.getConfigurationBaseEntity().setVersionTag(versionTag);
-          break;
-        default:
-          LOGGER.debug("Ignored property in the request: {}", resourcePropertyId);
-          break;
+      for (Map.Entry<String, Map<String, String>> entry : configurations.entrySet()) {
+        resources.add(toResource(entry.getKey(), entry.getValue(), requestedIds));
       }
     }
-    ambariConfigurationEntity.getConfigurationBaseEntity().setCreateTimestamp(Calendar.getInstance().getTimeInMillis());
-    return ambariConfigurationEntity;
 
+    return resources;
   }
 
-  private Object getValueFromResourceProperties(ResourcePropertyId resourcePropertyIdEnum, Map<String, Object> resourceProperties) {
-    LOGGER.debug("Locating resource property [{}] in the resource properties map ...", resourcePropertyIdEnum);
-    Object requestValue = null;
+  private String getStringProperty(Map<String, Object> propertyMap, String propertyId) {
+    String value = null;
 
-    if (resourceProperties.containsKey(resourcePropertyIdEnum.getPropertyId())) {
-      requestValue = resourceProperties.get(resourcePropertyIdEnum.getPropertyId());
-      LOGGER.debug("Found resource property {} in the resource properties map, value: {}", resourcePropertyIdEnum, requestValue);
+    if (propertyMap != null) {
+      Object o = propertyMap.get(propertyId);
+      if (o instanceof String) {
+        value = (String) o;
+      }
     }
-    return requestValue;
-  }
 
+    return value;
+  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/4fa9ac55/ambari-server/src/main/java/org/apache/ambari/server/events/AmbariConfigurationChangedEvent.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/events/AmbariConfigurationChangedEvent.java b/ambari-server/src/main/java/org/apache/ambari/server/events/AmbariConfigurationChangedEvent.java
new file mode 100644
index 0000000..69a15b4
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/events/AmbariConfigurationChangedEvent.java
@@ -0,0 +1,36 @@
+/*
+ * 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.events;
+
+/**
+ * Event signaling the creation or changing of an Ambari configuration entry.
+ */
+public class AmbariConfigurationChangedEvent extends AmbariEvent {
+
+  private final String categoryName;
+
+  /**
+   * Constructor.
+   *
+   */
+  public AmbariConfigurationChangedEvent(String categoryName) {
+    super(AmbariEventType.AMBARI_CONFIGURATION_CHANGED);
+    this.categoryName = categoryName;
+  }
+
+  public String getCategoryName() {
+    return categoryName;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/4fa9ac55/ambari-server/src/main/java/org/apache/ambari/server/events/AmbariEvent.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/events/AmbariEvent.java b/ambari-server/src/main/java/org/apache/ambari/server/events/AmbariEvent.java
index 0f9ff52..0ece73b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/events/AmbariEvent.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/events/AmbariEvent.java
@@ -143,9 +143,9 @@ public abstract class AmbariEvent {
     USER_CREATED,
 
     /**
-     * LDAP config changed event;
+     * Ambari configuration changed event;
      */
-    LDAP_CONFIG_CHANGED;
+    AMBARI_CONFIGURATION_CHANGED;
 
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/4fa9ac55/ambari-server/src/main/java/org/apache/ambari/server/events/AmbariLdapConfigChangedEvent.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/events/AmbariLdapConfigChangedEvent.java b/ambari-server/src/main/java/org/apache/ambari/server/events/AmbariLdapConfigChangedEvent.java
deleted file mode 100644
index 48799d7..0000000
--- a/ambari-server/src/main/java/org/apache/ambari/server/events/AmbariLdapConfigChangedEvent.java
+++ /dev/null
@@ -1,37 +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.events;
-
-/**
- * Event signaling the creation or changing of an LDAP configuration entry.
- */
-public class AmbariLdapConfigChangedEvent extends AmbariEvent {
-
-  private Long configurationId;
-
-  /**
-   * Constructor.
-   *
-   * @param eventType the type of event (not {@code null}).
-   */
-  public AmbariLdapConfigChangedEvent(AmbariEventType eventType, Long configurationId) {
-    super(eventType);
-    this.configurationId = configurationId;
-  }
-
-  public Long getConfigurationId() {
-    return configurationId;
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/4fa9ac55/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 8b26cd3..0c1ec0a 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
@@ -19,8 +19,8 @@ import java.util.Map;
 
 import javax.inject.Inject;
 
-import org.apache.commons.lang3.builder.EqualsBuilder;
-import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -179,21 +179,25 @@ public class AmbariLdapConfiguration {
 
   @Override
   public boolean equals(Object o) {
-    if (this == o) return true;
+    if (this == o) {
+      return true;
+    }
 
-    if (o == null || getClass() != o.getClass()) return false;
+    if (o == null || getClass() != o.getClass()) {
+      return false;
+    }
 
     AmbariLdapConfiguration that = (AmbariLdapConfiguration) o;
 
     return new EqualsBuilder()
-      .append(configurationMap, that.configurationMap)
-      .isEquals();
+        .append(configurationMap, that.configurationMap)
+        .isEquals();
   }
 
   @Override
   public int hashCode() {
     return new HashCodeBuilder(17, 37)
-      .append(configurationMap)
-      .toHashCode();
+        .append(configurationMap)
+        .toHashCode();
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/4fa9ac55/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 c88d420..b32d1ed 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
@@ -14,14 +14,11 @@
 
 package org.apache.ambari.server.ldap.service;
 
+import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
-import java.util.Set;
 
-import javax.inject.Inject;
-import javax.inject.Provider;
-import javax.inject.Singleton;
-
-import org.apache.ambari.server.events.AmbariLdapConfigChangedEvent;
+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;
@@ -32,8 +29,9 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.google.common.eventbus.Subscribe;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+import com.google.inject.Singleton;
 
 /**
  * Provider implementation for LDAP configurations.
@@ -41,7 +39,7 @@ import com.google.gson.GsonBuilder;
  * It's responsible for managing LDAP configurations in the application.
  * Whenever requested, this provider returns an AmbariLdapConfiguration which is always in sync with the persisted LDAP
  * configuration resource.
- *
+ * <p>
  * The provider receives notifications on CRUD operations related to the persisted resource and reloads the cached
  * configuration instance accordingly.
  */
@@ -60,8 +58,6 @@ public class AmbariLdapConfigurationProvider implements Provider<AmbariLdapConfi
   @Inject
   private AmbariLdapConfigurationFactory ldapConfigurationFactory;
 
-  private Gson gson = new GsonBuilder().create();
-
   @Inject
   public AmbariLdapConfigurationProvider() {
   }
@@ -73,48 +69,45 @@ public class AmbariLdapConfigurationProvider implements Provider<AmbariLdapConfi
 
   @Override
   public AmbariLdapConfiguration get() {
-    return instance != null ? instance : loadInstance(null);
+    return instance != null ? instance : loadInstance();
   }
 
   /**
    * Loads the AmbariLdapConfiguration from the database.
    *
-   * @param configurationId the configuration id
    * @return the AmbariLdapConfiguration instance
    */
-  private AmbariLdapConfiguration loadInstance(Long configurationId) {
-    AmbariConfigurationEntity configEntity = null;
+  private AmbariLdapConfiguration loadInstance() {
+    List<AmbariConfigurationEntity> configEntities;
 
     LOGGER.info("Loading LDAP configuration ...");
-    if (null == configurationId) {
+    configEntities = ambariConfigurationDAOProvider.get().findByCategory("ldap-configuration");
 
-      LOGGER.debug("Initial loading of the ldap configuration ...");
-      configEntity = ambariConfigurationDAOProvider.get().getLdapConfiguration();
+    if (configEntities != null) {
+      Map<String, Object> properties = toProperties(configEntities);
+      instance = ldapConfigurationFactory.createLdapConfiguration(properties);
+    }
 
-    } else {
+    LOGGER.info("Loaded LDAP configuration instance: [ {} ]", instance);
 
-      LOGGER.debug("Reloading configuration based on the provied id: {}", configurationId);
-      configEntity = ambariConfigurationDAOProvider.get().findByPK(configurationId);
+    return instance;
+  }
 
-    }
+  private Map<String, Object> toProperties(List<AmbariConfigurationEntity> configEntities) {
+    Map<String, Object> map = new HashMap<>();
 
-    if (configEntity != null) {
-      Set propertyMaps = gson.fromJson(configEntity.getConfigurationBaseEntity().getConfigurationData(), Set.class);
-      instance = ldapConfigurationFactory.createLdapConfiguration((Map<String, Object>) propertyMaps.iterator().next());
+    for (AmbariConfigurationEntity entity : configEntities) {
+      map.put(entity.getPropertyName(), entity.getPropertyValue());
     }
 
-    LOGGER.info("Loaded LDAP configuration instance: [ {} ]", instance);
-
-    return instance;
+    return map;
   }
 
   // On changing the configuration, the provider gets updated with the fresh value
   @Subscribe
-  public void ambariLdapConfigChanged(AmbariLdapConfigChangedEvent event) {
+  public void ambariLdapConfigChanged(AmbariConfigurationChangedEvent event) {
     LOGGER.info("LDAP config changed event received: {}", event);
-    loadInstance(event.getConfigurationId());
+    loadInstance();
     LOGGER.info("Refreshed LDAP config instance.");
   }
-
-
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/4fa9ac55/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/LdapConnectionTemplateFactory.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/LdapConnectionTemplateFactory.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/LdapConnectionTemplateFactory.java
index 8467af0..5e4e0ca 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/LdapConnectionTemplateFactory.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/LdapConnectionTemplateFactory.java
@@ -18,7 +18,7 @@ import javax.inject.Inject;
 import javax.inject.Provider;
 import javax.inject.Singleton;
 
-import org.apache.ambari.server.events.AmbariLdapConfigChangedEvent;
+import org.apache.ambari.server.events.AmbariConfigurationChangedEvent;
 import org.apache.ambari.server.ldap.domain.AmbariLdapConfiguration;
 import org.apache.ambari.server.ldap.service.AmbariLdapException;
 import org.apache.ambari.server.ldap.service.LdapConnectionConfigService;
@@ -103,7 +103,7 @@ public class LdapConnectionTemplateFactory {
    * @throws AmbariLdapException
    */
   @Subscribe
-  public void onConfigChange(AmbariLdapConfigChangedEvent event) throws AmbariLdapException {
+  public void onConfigChange(AmbariConfigurationChangedEvent event) throws AmbariLdapException {
     ldapConnectionTemplateInstance = create(ambariLdapConfigurationProvider.get());
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/4fa9ac55/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AmbariConfigurationDAO.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AmbariConfigurationDAO.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AmbariConfigurationDAO.java
index 83293ef..e4446d7 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AmbariConfigurationDAO.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AmbariConfigurationDAO.java
@@ -14,13 +14,20 @@
 
 package org.apache.ambari.server.orm.dao;
 
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 import javax.inject.Inject;
 import javax.inject.Singleton;
 import javax.persistence.EntityExistsException;
 import javax.persistence.EntityNotFoundException;
 import javax.persistence.TypedQuery;
 
+import org.apache.ambari.server.orm.RequiresSession;
 import org.apache.ambari.server.orm.entities.AmbariConfigurationEntity;
+import org.apache.ambari.server.orm.entities.AmbariConfigurationEntityPK;
+import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -32,7 +39,7 @@ import com.google.inject.persist.Transactional;
  */
 
 @Singleton
-public class AmbariConfigurationDAO extends CrudDAO<AmbariConfigurationEntity, Long> {
+public class AmbariConfigurationDAO extends CrudDAO<AmbariConfigurationEntity, AmbariConfigurationEntityPK> {
 
   private static final Logger LOGGER = LoggerFactory.getLogger(AmbariConfigurationDAO.class);
 
@@ -41,49 +48,132 @@ public class AmbariConfigurationDAO extends CrudDAO<AmbariConfigurationEntity, L
     super(AmbariConfigurationEntity.class);
   }
 
+  /**
+   * Returns the Ambari configuration properties with the requested category name from the database.
+   *
+   * @param categoryName the configuration category name
+   * @return the configuration entity
+   */
+  @RequiresSession
+  public List<AmbariConfigurationEntity> findByCategory(String categoryName) {
+    TypedQuery<AmbariConfigurationEntity> query = entityManagerProvider.get().createNamedQuery(
+        "AmbariConfigurationEntity.findByCategory", AmbariConfigurationEntity.class);
+    query.setParameter("categoryName", categoryName);
+    return daoUtils.selectList(query);
+  }
+
+  /**
+   * Removes the Ambari configuration properties with the requested category name from the database.
+   *
+   * @param categoryName the configuration category name
+   * @return the number of items removed
+   */
+  @Transactional
+  public int removeByCategory(String categoryName) {
+    TypedQuery<AmbariConfigurationEntity> query = entityManagerProvider.get().createNamedQuery(
+        "AmbariConfigurationEntity.deleteByCategory", AmbariConfigurationEntity.class);
+    query.setParameter("categoryName", categoryName);
+    return query.executeUpdate();
+  }
+
   @Transactional
   public void create(AmbariConfigurationEntity entity) {
-    // make  sure only one LDAP config entry exists
-    if ("ldap-configuration".equals(entity.getConfigurationBaseEntity().getType())) {
-      AmbariConfigurationEntity ldapConfigEntity = getLdapConfiguration();
-      if (ldapConfigEntity != null) {
-        LOGGER.error("Only one LDAP configuration entry can exist!");
-        throw new EntityExistsException("LDAP configuration entity already exists!");
-      }
+    // make sure only one entry exists per configuration type...
+    AmbariConfigurationEntity foundEntity = findByPK(new AmbariConfigurationEntityPK(entity.getCategoryName(), entity.getPropertyName()));
+    if (foundEntity != null) {
+      String message = String.format("Only one configuration entry can exist for the category %s and name %s", entity.getCategoryName(), entity.getPropertyName());
+      LOGGER.error(message);
+      throw new EntityExistsException(message);
     }
+
     super.create(entity);
   }
 
+  @Override
+  public AmbariConfigurationEntity merge(AmbariConfigurationEntity entity) {
+    AmbariConfigurationEntity foundEntity = findByPK(new AmbariConfigurationEntityPK(entity.getCategoryName(), entity.getPropertyName()));
+    if (foundEntity == null) {
+      String message = String.format("The configuration entry for the category %s and name %s does not exist", entity.getCategoryName(), entity.getPropertyName());
+      LOGGER.debug(message);
+      throw new EntityNotFoundException(message);
+    }
 
-  @Transactional
-  public void update(AmbariConfigurationEntity entity) {
-    if (entity.getId() == null || findByPK(entity.getId()) == null) {
-      String msg = String.format("The entity with id [ %s ] is not found", entity.getId());
-      LOGGER.debug(msg);
-      throw new EntityNotFoundException(msg);
+    AmbariConfigurationEntity updatedEntity = entity;
+
+    if (!StringUtils.equals(foundEntity.getPropertyValue(), entity.getPropertyValue())) {
+      // updating the existing entity
+      updatedEntity = super.merge(entity);
+      entityManagerProvider.get().flush();
     }
 
-    // updating the existing entity
-    super.merge(entity);
-    entityManagerProvider.get().flush();
+    return updatedEntity;
   }
 
   /**
-   * Returns the LDAP configuration from the database.
+   * Reconciles the properties associted with an Ambari confgiration category (for example, ldap-configuration)
+   * using persisted properties and the supplied properties.
+   * <p>
+   * if <code>removeIfNotProvided</code> is <code>true</code>, only properties that exist in the new set of
+   * properties will be persisted; others will be removed.
+   * <p>
+   * If <code>removeIfNotProvided</code> is <code>false</code>, then the new properties will be used
+   * to update or append to the set of persisted properties.
    *
-   * @return the configuration entity
+   * @param categoryName        the category name for the set of properties
+   * @param properties          a map of name to value pairs
+   * @param removeIfNotProvided <code>true</code> to explicitly set the set of properties for the category; <code>false</code> to upadate the set of properties for the category
+   * @return <code>true</code> if changes were made; <code>false</code> if not changes were made.
    */
   @Transactional
-  public AmbariConfigurationEntity getLdapConfiguration() {
-    LOGGER.info("Looking up the LDAP configuration ....");
-    AmbariConfigurationEntity ldapConfigEntity = null;
+  public boolean reconcileCategory(String categoryName, Map<String, String> properties, boolean removeIfNotProvided) {
+    boolean changesDetected = false;
+    List<AmbariConfigurationEntity> existingEntities = findByCategory(categoryName);
+    Map<String, String> propertiesToProcess = new HashMap<>();
 
-    TypedQuery<AmbariConfigurationEntity> query = entityManagerProvider.get().createNamedQuery(
-      "AmbariConfigurationEntity.findByType", AmbariConfigurationEntity.class);
-    query.setParameter("typeName", "ldap-configuration");
+    if (properties != null) {
+      propertiesToProcess.putAll(properties);
+    }
+
+    if (existingEntities != null) {
+      for (AmbariConfigurationEntity entity : existingEntities) {
+        String propertyName = entity.getPropertyName();
+
+        if (propertiesToProcess.containsKey(propertyName)) {
+          String newPropertyValue = propertiesToProcess.get(propertyName);
+          if (!StringUtils.equals(newPropertyValue, entity.getPropertyValue())) {
+            // Update the entry...
+            entity.setPropertyValue(newPropertyValue);
+            merge(entity);
+            changesDetected = true;
+          }
+        } else if (removeIfNotProvided) {
+          // Remove the entry since it is not in the new set of properties...
+          remove(entity);
+          changesDetected = true;
+        }
+
+        // If already processed, remove it so we know no to add it later...
+        propertiesToProcess.remove(propertyName);
+      }
+    }
+
+    // Add the new entries...
+    if (!propertiesToProcess.isEmpty()) {
+      for (Map.Entry<String, String> property : propertiesToProcess.entrySet()) {
+        AmbariConfigurationEntity entity = new AmbariConfigurationEntity();
+        entity.setCategoryName(categoryName);
+        entity.setPropertyName(property.getKey());
+        entity.setPropertyValue(property.getValue());
+        create(entity);
+      }
+
+      changesDetected = true;
+    }
+
+    if (changesDetected) {
+      entityManagerProvider.get().flush();
+    }
 
-    ldapConfigEntity = daoUtils.selectSingle(query);
-    LOGGER.info("Returned entity: {} ", ldapConfigEntity);
-    return ldapConfigEntity;
+    return changesDetected;
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/4fa9ac55/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AmbariConfigurationEntity.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AmbariConfigurationEntity.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AmbariConfigurationEntity.java
index c9f4695..8cd6751 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AmbariConfigurationEntity.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AmbariConfigurationEntity.java
@@ -14,57 +14,99 @@
 
 package org.apache.ambari.server.orm.entities;
 
-import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.MapsId;
+import javax.persistence.IdClass;
 import javax.persistence.NamedQueries;
 import javax.persistence.NamedQuery;
-import javax.persistence.OneToOne;
 import javax.persistence.Table;
 
-@Entity
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+
 @Table(name = "ambari_configuration")
 @NamedQueries({
-  @NamedQuery(
-    name = "AmbariConfigurationEntity.findByType",
-    query = "select ace from AmbariConfigurationEntity ace where ace.configurationBaseEntity.type = :typeName")
+    @NamedQuery(
+        name = "AmbariConfigurationEntity.findByCategory",
+        query = "select ace from AmbariConfigurationEntity ace where ace.categoryName = :categoryName"),
+    @NamedQuery(
+        name = "AmbariConfigurationEntity.deleteByCategory",
+        query = "delete from AmbariConfigurationEntity ace where ace.categoryName = :categoryName")
 })
-
+@IdClass(AmbariConfigurationEntityPK.class)
+@Entity
 public class AmbariConfigurationEntity {
 
   @Id
-  @Column(name = "id")
-  private Long id;
+  @Column(name = "category_name")
+  private String categoryName;
+
+  @Id
+  @Column(name = "property_name")
+  private String propertyName;
+
+  @Column(name = "property_value")
+  private String propertyValue;
 
-  @OneToOne(cascade = CascadeType.ALL)
-  @MapsId
-  @JoinColumn(name = "id")
-  private ConfigurationBaseEntity configurationBaseEntity;
+  public String getCategoryName() {
+    return categoryName;
+  }
+
+  public void setCategoryName(String category) {
+    this.categoryName = category;
+  }
 
-  public Long getId() {
-    return id;
+  public String getPropertyName() {
+    return propertyName;
   }
 
-  public void setId(Long id) {
-    this.id = id;
+  public void setPropertyName(String propertyName) {
+    this.propertyName = propertyName;
   }
 
-  public ConfigurationBaseEntity getConfigurationBaseEntity() {
-    return configurationBaseEntity;
+  public String getPropertyValue() {
+    return propertyValue;
   }
 
-  public void setConfigurationBaseEntity(ConfigurationBaseEntity configurationBaseEntity) {
-    this.configurationBaseEntity = configurationBaseEntity;
+  public void setPropertyValue(String propertyValue) {
+    this.propertyValue = propertyValue;
   }
 
   @Override
   public String toString() {
     return "AmbariConfigurationEntity{" +
-      "id=" + id +
-      ", configurationBaseEntity=" + configurationBaseEntity +
-      '}';
+        ", category=" + categoryName +
+        ", name=" + propertyName +
+        ", value=" + propertyValue +
+        '}';
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) {
+      return true;
+    }
+
+    if (o == null || getClass() != o.getClass()) {
+      return false;
+    }
+
+    AmbariConfigurationEntity that = (AmbariConfigurationEntity) o;
+
+    return new EqualsBuilder()
+        .append(categoryName, that.categoryName)
+        .append(propertyName, that.propertyName)
+        .append(propertyValue, that.propertyValue)
+        .isEquals();
+  }
+
+  @Override
+  public int hashCode() {
+    return new HashCodeBuilder(17, 37)
+        .append(categoryName)
+        .append(propertyName)
+        .append(propertyValue)
+        .toHashCode();
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/4fa9ac55/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AmbariConfigurationEntityPK.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AmbariConfigurationEntityPK.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AmbariConfigurationEntityPK.java
new file mode 100644
index 0000000..3674e12
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AmbariConfigurationEntityPK.java
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.server.orm.entities;
+
+import java.io.Serializable;
+
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+
+/**
+ * Composite primary key for {@link AmbariConfigurationEntity}.
+ */
+public class AmbariConfigurationEntityPK implements Serializable {
+
+  private String categoryName;
+  private String propertyName;
+
+  /**
+   * Constructor.
+   *
+   * @param categoryName configuration category name
+   * @param propertyName configuration property name
+   */
+  public AmbariConfigurationEntityPK(String categoryName, String propertyName) {
+    this.categoryName = categoryName;
+    this.propertyName = propertyName;
+  }
+
+  /**
+   * Get the configuration category name.
+   *
+   * @return category name
+   */
+  public String getCategoryName() {
+    return categoryName;
+  }
+
+  /**
+   * Get the property name.
+   *
+   * @return property name
+   */
+  public String getPropertyName() {
+    return propertyName;
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) {
+      return true;
+    }
+
+    if (o == null || getClass() != o.getClass()) {
+      return false;
+    }
+
+    AmbariConfigurationEntityPK that = (AmbariConfigurationEntityPK) o;
+
+    return new EqualsBuilder()
+        .append(categoryName, that.categoryName)
+        .append(propertyName, that.propertyName)
+        .isEquals();
+  }
+
+  @Override
+  public int hashCode() {
+    return new HashCodeBuilder(17, 37)
+        .append(categoryName)
+        .append(propertyName)
+        .toHashCode();
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/4fa9ac55/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ConfigurationBaseEntity.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ConfigurationBaseEntity.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ConfigurationBaseEntity.java
deleted file mode 100644
index 9ad30d7..0000000
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ConfigurationBaseEntity.java
+++ /dev/null
@@ -1,159 +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.orm.entities;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import javax.persistence.TableGenerator;
-
-import org.apache.commons.lang3.builder.EqualsBuilder;
-import org.apache.commons.lang3.builder.HashCodeBuilder;
-
-@Table(name = "configuration_base")
-@TableGenerator(
-  name = "configuration_id_generator",
-  table = "ambari_sequences",
-  pkColumnName = "sequence_name",
-  valueColumnName = "sequence_value",
-  pkColumnValue = "configuration_id_seq",
-  initialValue = 1
-)
-@Entity
-public class ConfigurationBaseEntity {
-
-  @Id
-  @Column(name = "id")
-  @GeneratedValue(strategy = GenerationType.TABLE, generator = "configuration_id_generator")
-  private Long id;
-
-  @Column(name = "version")
-  private Integer version;
-
-  @Column(name = "version_tag")
-  private String versionTag;
-
-  @Column(name = "type")
-  private String type;
-
-  @Column(name = "data")
-  private String configurationData;
-
-  @Column(name = "attributes")
-  private String configurationAttributes;
-
-  @Column(name = "create_timestamp")
-  private Long createTimestamp;
-
-  public Long getId() {
-    return id;
-  }
-
-  public Integer getVersion() {
-    return version;
-  }
-
-  public void setVersion(Integer version) {
-    this.version = version;
-  }
-
-  public String getVersionTag() {
-    return versionTag;
-  }
-
-  public void setVersionTag(String versionTag) {
-    this.versionTag = versionTag;
-  }
-
-  public String getType() {
-    return type;
-  }
-
-  public void setType(String type) {
-    this.type = type;
-  }
-
-  public String getConfigurationData() {
-    return configurationData;
-  }
-
-  public void setConfigurationData(String configurationData) {
-    this.configurationData = configurationData;
-  }
-
-  public String getConfigurationAttributes() {
-    return configurationAttributes;
-  }
-
-  public void setConfigurationAttributes(String configurationAttributes) {
-    this.configurationAttributes = configurationAttributes;
-  }
-
-  public Long getCreateTimestamp() {
-    return createTimestamp;
-  }
-
-  public void setCreateTimestamp(Long createTimestamp) {
-    this.createTimestamp = createTimestamp;
-  }
-
-  @Override
-  public String toString() {
-    return "ConfigurationBaseEntity{" +
-      "id=" + id +
-      ", version=" + version +
-      ", versionTag='" + versionTag + '\'' +
-      ", type='" + type + '\'' +
-      ", configurationData='" + configurationData + '\'' +
-      ", configurationAttributes='" + configurationAttributes + '\'' +
-      ", createTimestamp=" + createTimestamp +
-      '}';
-  }
-
-  @Override
-  public boolean equals(Object o) {
-    if (this == o) return true;
-
-    if (o == null || getClass() != o.getClass()) return false;
-
-    ConfigurationBaseEntity that = (ConfigurationBaseEntity) o;
-
-    return new EqualsBuilder()
-      .append(id, that.id)
-      .append(version, that.version)
-      .append(versionTag, that.versionTag)
-      .append(type, that.type)
-      .append(configurationData, that.configurationData)
-      .append(configurationAttributes, that.configurationAttributes)
-      .append(createTimestamp, that.createTimestamp)
-      .isEquals();
-  }
-
-  @Override
-  public int hashCode() {
-    return new HashCodeBuilder(17, 37)
-      .append(id)
-      .append(version)
-      .append(versionTag)
-      .append(type)
-      .append(configurationData)
-      .append(configurationAttributes)
-      .append(createTimestamp)
-      .toHashCode();
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/4fa9ac55/ambari-server/src/main/java/org/apache/ambari/server/upgrade/SchemaUpgradeHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/SchemaUpgradeHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/SchemaUpgradeHelper.java
index 8812ef5..9c77129 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/SchemaUpgradeHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/SchemaUpgradeHelper.java
@@ -34,6 +34,7 @@ import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.audit.AuditLoggerModule;
 import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.controller.ControllerModule;
+import org.apache.ambari.server.ldap.LdapModule;
 import org.apache.ambari.server.orm.DBAccessor;
 import org.apache.ambari.server.utils.EventBusSynchronizer;
 import org.apache.ambari.server.utils.VersionUtils;
@@ -373,7 +374,7 @@ public class SchemaUpgradeHelper {
         System.exit(1);
       }
 
-      Injector injector = Guice.createInjector(new UpgradeHelperModule(), new AuditLoggerModule());
+      Injector injector = Guice.createInjector(new UpgradeHelperModule(), new AuditLoggerModule(), new LdapModule());
       SchemaUpgradeHelper schemaUpgradeHelper = injector.getInstance(SchemaUpgradeHelper.class);
 
       //Fail if MySQL database has tables with MyISAM engine

http://git-wip-us.apache.org/repos/asf/ambari/blob/4fa9ac55/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog300.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog300.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog300.java
index d3e924e..2de6095 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog300.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog300.java
@@ -66,21 +66,21 @@ public class UpgradeCatalog300 extends AbstractUpgradeCatalog {
   protected static final String STAGE_DISPLAY_STATUS_COLUMN = "display_status";
   protected static final String REQUEST_TABLE = "request";
   protected static final String REQUEST_DISPLAY_STATUS_COLUMN = "display_status";
-  protected static final String CLUSTER_CONFIG_TABLE = "clusterconfig";
-  protected static final String CLUSTER_CONFIG_SELECTED_COLUMN = "selected";
-  protected static final String CLUSTER_CONFIG_SELECTED_TIMESTAMP_COLUMN = "selected_timestamp";
   protected static final String HOST_ROLE_COMMAND_TABLE = "host_role_command";
   protected static final String HRC_OPS_DISPLAY_NAME_COLUMN = "ops_display_name";
-  protected static final String COMPONENT_TABLE = "servicecomponentdesiredstate";
   protected static final String COMPONENT_DESIRED_STATE_TABLE = "hostcomponentdesiredstate";
   protected static final String COMPONENT_STATE_TABLE = "hostcomponentstate";
   protected static final String SERVICE_DESIRED_STATE_TABLE = "servicedesiredstate";
   protected static final String SECURITY_STATE_COLUMN = "security_state";
 
+  protected static final String AMBARI_CONFIGURATION_TABLE = "ambari_configuration";
+  protected static final String AMBARI_CONFIGURATION_CATEGORY_NAME_COLUMN = "category_name";
+  protected static final String AMBARI_CONFIGURATION_PROPERTY_NAME_COLUMN = "property_name";
+  protected static final String AMBARI_CONFIGURATION_PROPERTY_VALUE_COLUMN = "property_value";
+
   @Inject
   DaoUtils daoUtils;
 
-
   // ----- Constructors ------------------------------------------------------
 
   /**
@@ -123,6 +123,7 @@ public class UpgradeCatalog300 extends AbstractUpgradeCatalog {
     updateStageTable();
     addOpsDisplayNameColumnToHostRoleCommand();
     removeSecurityState();
+    addAmbariConfigurationTable();
   }
 
   protected void updateStageTable() throws SQLException {
@@ -134,6 +135,16 @@ public class UpgradeCatalog300 extends AbstractUpgradeCatalog {
         new DBAccessor.DBColumnInfo(REQUEST_DISPLAY_STATUS_COLUMN, String.class, 255, HostRoleStatus.PENDING, false));
   }
 
+  protected void addAmbariConfigurationTable() throws SQLException {
+    List<DBAccessor.DBColumnInfo> columns = new ArrayList<>();
+    columns.add(new DBAccessor.DBColumnInfo(AMBARI_CONFIGURATION_CATEGORY_NAME_COLUMN, String.class, 100, null, false));
+    columns.add(new DBAccessor.DBColumnInfo(AMBARI_CONFIGURATION_PROPERTY_NAME_COLUMN, String.class, 100, null, false));
+    columns.add(new DBAccessor.DBColumnInfo(AMBARI_CONFIGURATION_PROPERTY_VALUE_COLUMN, String.class, 255, null, true));
+
+    dbAccessor.createTable(AMBARI_CONFIGURATION_TABLE, columns);
+    dbAccessor.addPKConstraint(AMBARI_CONFIGURATION_TABLE, "PK_ambari_configuration", AMBARI_CONFIGURATION_CATEGORY_NAME_COLUMN, AMBARI_CONFIGURATION_PROPERTY_NAME_COLUMN);
+  }
+
   /**
    * {@inheritDoc}
    */

http://git-wip-us.apache.org/repos/asf/ambari/blob/4fa9ac55/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql
index 7d63494..7045240 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql
@@ -84,22 +84,11 @@ CREATE TABLE clusterconfig (
   CONSTRAINT UQ_config_type_tag UNIQUE (version_tag, type_name, cluster_id),
   CONSTRAINT UQ_config_type_version UNIQUE (cluster_id, type_name, version));
 
-CREATE TABLE configuration_base (
-  id BIGINT NOT NULL,
-  version_tag VARCHAR(255) NOT NULL,
-  version BIGINT NOT NULL,
-  type VARCHAR(255) NOT NULL,
-  data VARCHAR(3000) NOT NULL,
-  attributes VARCHAR(3000),
-  create_timestamp BIGINT NOT NULL,
-  CONSTRAINT PK_configuration_base PRIMARY KEY (id)
-);
-
 CREATE TABLE ambari_configuration (
-  id BIGINT NOT NULL,
-  CONSTRAINT PK_ambari_configuration PRIMARY KEY (id),
-  CONSTRAINT FK_ambari_conf_conf_base FOREIGN KEY (id) REFERENCES configuration_base (id)
-);
+  category_name VARCHAR(100) NOT NULL,
+  property_name VARCHAR(100) NOT NULL,
+  property_value VARCHAR(255) NOT NULL,
+  CONSTRAINT PK_ambari_configuration PRIMARY KEY (category_name, property_name));
 
 CREATE TABLE serviceconfig (
   service_config_id BIGINT NOT NULL,
@@ -1175,8 +1164,6 @@ INSERT INTO ambari_sequences (sequence_name, sequence_value)
   union all
   select 'servicecomponent_version_id_seq', 0 FROM SYSIBM.SYSDUMMY1
   union all
-  select 'configuration_id_seq', 0 FROM SYSIBM.SYSDUMMY1
-  union all
   select 'hostcomponentdesiredstate_id_seq', 0 FROM SYSIBM.SYSDUMMY1;
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/4fa9ac55/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
index af17353..c950c7e 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
@@ -104,22 +104,11 @@ CREATE TABLE clusterconfig (
   CONSTRAINT UQ_config_type_tag UNIQUE (cluster_id, type_name, version_tag),
   CONSTRAINT UQ_config_type_version UNIQUE (cluster_id, type_name, version));
 
-CREATE TABLE configuration_base (
-  id BIGINT NOT NULL,
-  version_tag VARCHAR(100) NOT NULL,
-  version BIGINT NOT NULL,
-  type VARCHAR(100) NOT NULL,
-  data LONGTEXT NOT NULL,
-  attributes LONGTEXT,
-  create_timestamp BIGINT NOT NULL,
-  CONSTRAINT PK_configuration_base PRIMARY KEY (id)
-);
-
 CREATE TABLE ambari_configuration (
-  id BIGINT NOT NULL,
-  CONSTRAINT PK_ambari_configuration PRIMARY KEY (id),
-  CONSTRAINT FK_ambari_conf_conf_base FOREIGN KEY (id) REFERENCES configuration_base (id)
-);
+  category_name VARCHAR(100) NOT NULL,
+  property_name VARCHAR(100) NOT NULL,
+  property_value VARCHAR(255) NOT NULL,
+  CONSTRAINT PK_ambari_configuration PRIMARY KEY (category_name, property_name));
 
 CREATE TABLE serviceconfig (
   service_config_id BIGINT NOT NULL,
@@ -1137,7 +1126,6 @@ INSERT INTO ambari_sequences(sequence_name, sequence_value) VALUES
   ('remote_cluster_id_seq', 0),
   ('remote_cluster_service_id_seq', 0),
   ('servicecomponent_version_id_seq', 0),
-  ('configuration_id_seq', 0),
   ('hostcomponentdesiredstate_id_seq', 0);
 
 INSERT INTO adminresourcetype (resource_type_id, resource_type_name) VALUES

http://git-wip-us.apache.org/repos/asf/ambari/blob/4fa9ac55/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
index 89c7971..537ae19 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
@@ -84,22 +84,11 @@ CREATE TABLE clusterconfig (
   CONSTRAINT UQ_config_type_tag UNIQUE (cluster_id, type_name, version_tag),
   CONSTRAINT UQ_config_type_version UNIQUE (cluster_id, type_name, version));
 
-CREATE TABLE configuration_base (
-  id NUMBER(19) NOT NULL,
-  version_tag VARCHAR(255) NOT NULL,
-  version NUMBER(19) NOT NULL,
-  type VARCHAR(255) NOT NULL,
-  data CLOB NOT NULL,
-  attributes CLOB,
-  create_timestamp NUMBER(19) NOT NULL,
-  CONSTRAINT PK_configuration_base PRIMARY KEY (id)
-);
-
 CREATE TABLE ambari_configuration (
-  id NUMBER(19) NOT NULL,
-  CONSTRAINT PK_ambari_configuration PRIMARY KEY (id),
-  CONSTRAINT FK_ambari_conf_conf_base FOREIGN KEY (id) REFERENCES configuration_base (id)
-);
+  category_name VARCHAR2(100) NOT NULL,
+  property_name VARCHAR2(100) NOT NULL,
+  property_value VARCHAR2(255) NOT NULL,
+  CONSTRAINT PK_ambari_configuration PRIMARY KEY (category_name, property_name));
 
 CREATE TABLE serviceconfig (
   service_config_id NUMBER(19) NOT NULL,
@@ -1116,7 +1105,6 @@ INSERT INTO ambari_sequences(sequence_name, sequence_value) values ('ambari_oper
 INSERT INTO ambari_sequences(sequence_name, sequence_value) values ('remote_cluster_id_seq', 0);
 INSERT INTO ambari_sequences(sequence_name, sequence_value) values ('remote_cluster_service_id_seq', 0);
 INSERT INTO ambari_sequences(sequence_name, sequence_value) values ('servicecomponent_version_id_seq', 0);
-INSERT INTO ambari_sequences(sequence_name, sequence_value) values ('configuration_id_seq', 0);
 INSERT INTO ambari_sequences(sequence_name, sequence_value) values ('hostcomponentdesiredstate_id_seq', 0);
 
 INSERT INTO metainfo("metainfo_key", "metainfo_value") values ('version', '${ambariSchemaVersion}');

http://git-wip-us.apache.org/repos/asf/ambari/blob/4fa9ac55/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
index 3d2bd3a..b4952c2 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
@@ -66,21 +66,11 @@ CREATE TABLE clusters (
   CONSTRAINT FK_clusters_resource_id FOREIGN KEY (resource_id) REFERENCES adminresource (resource_id)
 );
 
-CREATE TABLE configuration_base (
-  id BIGINT NOT NULL,
-  version_tag VARCHAR(255) NOT NULL,
-  version BIGINT NOT NULL,
-  type VARCHAR(255) NOT NULL,
-  data TEXT NOT NULL,
-  attributes TEXT,
-  create_timestamp BIGINT NOT NULL,
-  CONSTRAINT PK_configuration_base PRIMARY KEY (id)
-);
-
 CREATE TABLE ambari_configuration (
-  id BIGINT NOT NULL,
-  CONSTRAINT PK_ambari_configuration PRIMARY KEY (id),
-  CONSTRAINT FK_ambari_conf_conf_base FOREIGN KEY (id) REFERENCES configuration_base (id)
+  category_name VARCHAR(100) NOT NULL,
+  property_name VARCHAR(100) NOT NULL,
+  property_value VARCHAR(255) NOT NULL,
+  CONSTRAINT PK_ambari_configuration PRIMARY KEY (category_name, property_name)
 );
 
 CREATE TABLE clusterconfig (
@@ -1116,7 +1106,6 @@ INSERT INTO ambari_sequences (sequence_name, sequence_value) VALUES
   ('remote_cluster_id_seq', 0),
   ('remote_cluster_service_id_seq', 0),
   ('servicecomponent_version_id_seq', 0),
-  ('configuration_id_seq', 0),
   ('hostcomponentdesiredstate_id_seq', 0);
 
 INSERT INTO adminresourcetype (resource_type_id, resource_type_name) VALUES

http://git-wip-us.apache.org/repos/asf/ambari/blob/4fa9ac55/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql
index 55a6c61..4fb0d09 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql
@@ -83,22 +83,11 @@ CREATE TABLE clusterconfig (
   CONSTRAINT UQ_config_type_tag UNIQUE (cluster_id, type_name, version_tag),
   CONSTRAINT UQ_config_type_version UNIQUE (cluster_id, type_name, version));
 
-CREATE TABLE configuration_base (
-  id NUMERIC(19) NOT NULL,
-  version_tag VARCHAR(255) NOT NULL,
-  version NUMERIC(19) NOT NULL,
-  type VARCHAR(255) NOT NULL,
-  data TEXT NOT NULL,
-  attributes TEXT,
-  create_timestamp NUMERIC(19) NOT NULL,
-  CONSTRAINT PK_configuration_base PRIMARY KEY (id)
-);
-
 CREATE TABLE ambari_configuration (
-  id NUMERIC(19) NOT NULL,
-  CONSTRAINT PK_ambari_configuration PRIMARY KEY (id),
-  CONSTRAINT FK_ambari_conf_conf_base FOREIGN KEY (id) REFERENCES configuration_base (id)
-);
+  category_name VARCHAR(100) NOT NULL,
+  property_name VARCHAR(100) NOT NULL,
+  property_value VARCHAR(255) NOT NULL,
+  CONSTRAINT PK_ambari_configuration PRIMARY KEY (category_name, property_name));
 
 CREATE TABLE serviceconfig (
   service_config_id NUMERIC(19) NOT NULL,
@@ -1115,7 +1104,6 @@ INSERT INTO ambari_sequences(sequence_name, sequence_value) values ('remote_clus
 INSERT INTO ambari_sequences(sequence_name, sequence_value) values ('remote_cluster_service_id_seq', 0);
 INSERT INTO ambari_sequences(sequence_name, sequence_value) values ('servicecomponent_version_id_seq', 0);
 INSERT INTO ambari_sequences(sequence_name, sequence_value) values ('hostcomponentdesiredstate_id_seq', 0);
-INSERT INTO ambari_sequences(sequence_name, sequence_value) values ('configuration_id_seq', 0);
 
 insert into adminresourcetype (resource_type_id, resource_type_name)
   select 1, 'AMBARI'

http://git-wip-us.apache.org/repos/asf/ambari/blob/4fa9ac55/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
index e5e8af5..8a88aba 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
@@ -97,21 +97,11 @@ CREATE TABLE clusterconfig (
   CONSTRAINT UQ_config_type_tag UNIQUE (cluster_id, type_name, version_tag),
   CONSTRAINT UQ_config_type_version UNIQUE (cluster_id, type_name, version));
 
-CREATE TABLE configuration_base (
-  id BIGINT NOT NULL,
-  version_tag VARCHAR(255) NOT NULL,
-  version BIGINT NOT NULL,
-  type VARCHAR(255) NOT NULL,
-  data VARCHAR(MAX) NOT NULL,
-  attributes VARCHAR(MAX),
-  create_timestamp BIGINT NOT NULL,
-  CONSTRAINT PK_configuration_base PRIMARY KEY (id)
-);
-
 CREATE TABLE ambari_configuration (
-  id BIGINT NOT NULL,
-  CONSTRAINT PK_ambari_configuration PRIMARY KEY (id),
-  CONSTRAINT FK_ambari_conf_conf_base FOREIGN KEY (id) REFERENCES configuration_base (id)
+  category_name VARCHAR(100) NOT NULL,
+  property_name VARCHAR(100) NOT NULL,
+  property_value VARCHAR(255) NOT NULL,
+  CONSTRAINT PK_ambari_configuration PRIMARY KEY (category_name, property_name)
 );
 
 CREATE TABLE serviceconfig (
@@ -1140,7 +1130,6 @@ BEGIN TRANSACTION
     ('remote_cluster_id_seq', 0),
     ('remote_cluster_service_id_seq', 0),
     ('servicecomponent_version_id_seq', 0),
-    ('configuration_id_seq', 0),
     ('hostcomponentdesiredstate_id_seq', 0);
 
   insert into adminresourcetype (resource_type_id, resource_type_name)

http://git-wip-us.apache.org/repos/asf/ambari/blob/4fa9ac55/ambari-server/src/main/resources/META-INF/persistence.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/META-INF/persistence.xml b/ambari-server/src/main/resources/META-INF/persistence.xml
index 67eef70..686c831 100644
--- a/ambari-server/src/main/resources/META-INF/persistence.xml
+++ b/ambari-server/src/main/resources/META-INF/persistence.xml
@@ -97,7 +97,6 @@
     <class>org.apache.ambari.server.orm.entities.KerberosDescriptorEntity</class>
     <class>org.apache.ambari.server.orm.entities.RemoteAmbariClusterEntity</class>
     <class>org.apache.ambari.server.orm.entities.RemoteAmbariClusterServiceEntity</class>
-    <class>org.apache.ambari.server.orm.entities.ConfigurationBaseEntity</class>
     <class>org.apache.ambari.server.orm.entities.AmbariConfigurationEntity</class>
 
     <properties>


[03/50] [abbrv] ambari git commit: AMBARI-22398. Upstart is not able to stop the ambari-agent (aonishuk)

Posted by am...@apache.org.
AMBARI-22398. Upstart is not able to stop the ambari-agent (aonishuk)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: e968b12186848edd7b4e8b7103e8283b61f59c50
Parents: 780e91e
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Thu Nov 9 16:37:58 2017 +0200
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Thu Nov 9 16:37:58 2017 +0200

----------------------------------------------------------------------
 ambari-agent/src/main/python/ambari_agent/AmbariAgent.py | 3 ---
 1 file changed, 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e968b121/ambari-agent/src/main/python/ambari_agent/AmbariAgent.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/AmbariAgent.py b/ambari-agent/src/main/python/ambari_agent/AmbariAgent.py
index 28b9528..aeb200c 100644
--- a/ambari-agent/src/main/python/ambari_agent/AmbariAgent.py
+++ b/ambari-agent/src/main/python/ambari_agent/AmbariAgent.py
@@ -49,9 +49,6 @@ def main():
 
   mergedArgs = [PYTHON, AGENT_SCRIPT] + args
 
-  # Become a parent for all subprocesses
-  os.setpgrp()
-
   try:
     while status == AGENT_AUTO_RESTART_EXIT_CODE:
       mainProcess = subprocess.Popen(mergedArgs)


[20/50] [abbrv] ambari git commit: AMBARI-22429 Log Search UI: implement logout. (Istvan Tobias via ababiichuk)

Posted by am...@apache.org.
AMBARI-22429 Log Search UI: implement logout. (Istvan Tobias via ababiichuk)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 7428e51d8e3759edf5248762f0a257a46cc053a5
Parents: 4fa9ac5
Author: Istvan Tobias <to...@gmail.com>
Authored: Tue Nov 14 00:31:01 2017 +0200
Committer: ababiichuk <ab...@hortonworks.com>
Committed: Tue Nov 14 00:31:01 2017 +0200

----------------------------------------------------------------------
 .../ambari-logsearch-web/src/app/app.module.ts  |   4 +-
 .../src/app/components/app.component.spec.ts    |   4 +-
 .../dropdown-button.component.spec.ts           |   4 +-
 .../dropdown-list.component.spec.ts             |   4 +-
 .../filter-button.component.spec.ts             |   4 +-
 .../filter-dropdown.component.spec.ts           |   4 +-
 .../login-form/login-form.component.spec.ts     |   7 +-
 .../login-form/login-form.component.ts          |  34 +++--
 .../menu-button/menu-button.component.spec.ts   |   4 +-
 .../timezone-picker.component.spec.ts           |   4 +-
 .../components/top-menu/top-menu.component.ts   |   3 +-
 .../ambari-logsearch-web/src/app/mock-data.ts   |   3 +-
 .../src/app/services/auth.service.spec.ts       | 132 +++++++++++++++++++
 .../src/app/services/auth.service.ts            | 123 +++++++++++++++++
 .../services/component-actions.service.spec.ts  |   4 +-
 .../app/services/component-actions.service.ts   |  20 ++-
 .../src/assets/i18n/en.json                     |   1 +
 17 files changed, 328 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/7428e51d/ambari-logsearch/ambari-logsearch-web/src/app/app.module.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/app.module.ts b/ambari-logsearch/ambari-logsearch-web/src/app/app.module.ts
index 37f3a49..805f8e2 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/app.module.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/app.module.ts
@@ -53,6 +53,7 @@ import {ComponentsService} from '@app/services/storage/components.service';
 import {ServiceLogsFieldsService} from '@app/services/storage/service-logs-fields.service';
 import {AuditLogsFieldsService} from '@app/services/storage/audit-logs-fields.service';
 import {TabsService} from '@app/services/storage/tabs.service';
+import {AuthService} from '@app/services/auth.service';
 import {reducer} from '@app/services/storage/reducers.service';
 
 import {AppComponent} from '@app/components/app.component';
@@ -185,7 +186,8 @@ export function getXHRBackend(injector: Injector, browser: BrowserXhr, xsrf: XSR
       provide: XHRBackend,
       useFactory: getXHRBackend,
       deps: [Injector, BrowserXhr, XSRFStrategy, ResponseOptions]
-    }
+    },
+    AuthService
   ],
   bootstrap: [AppComponent],
   entryComponents: [NodeBarComponent],

http://git-wip-us.apache.org/repos/asf/ambari/blob/7428e51d/ambari-logsearch/ambari-logsearch-web/src/app/components/app.component.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/app.component.spec.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/app.component.spec.ts
index 490e058..bae05ce 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/app.component.spec.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/app.component.spec.ts
@@ -53,9 +53,9 @@ describe('AppComponent', () => {
     }).compileComponents();
   }));
 
-  it('should create the app', async(() => {
+  it('should create the app', () => {
     const fixture = TestBed.createComponent(AppComponent);
     const app = fixture.debugElement.componentInstance;
     expect(app).toBeTruthy();
-  }));
+  });
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/7428e51d/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-button/dropdown-button.component.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-button/dropdown-button.component.spec.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-button/dropdown-button.component.spec.ts
index bd41c04..fc42e3c 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-button/dropdown-button.component.spec.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-button/dropdown-button.component.spec.ts
@@ -36,6 +36,7 @@ import {UtilsService} from '@app/services/utils.service';
 import {ComponentActionsService} from '@app/services/component-actions.service';
 import {HttpClientService} from '@app/services/http-client.service';
 import {LogsContainerService} from '@app/services/logs-container.service';
+import {AuthService} from '@app/services/auth.service';
 
 import {DropdownButtonComponent} from './dropdown-button.component';
 
@@ -90,7 +91,8 @@ describe('DropdownButtonComponent', () => {
           provide: HttpClientService,
           useValue: httpClient
         },
-        LogsContainerService
+        LogsContainerService,
+        AuthService
       ],
       schemas: [NO_ERRORS_SCHEMA]
     })

http://git-wip-us.apache.org/repos/asf/ambari/blob/7428e51d/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-list/dropdown-list.component.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-list/dropdown-list.component.spec.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-list/dropdown-list.component.spec.ts
index ac2fa84..63824cb 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-list/dropdown-list.component.spec.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-list/dropdown-list.component.spec.ts
@@ -36,6 +36,7 @@ import {ComponentGeneratorService} from '@app/services/component-generator.servi
 import {LogsContainerService} from '@app/services/logs-container.service';
 import {HttpClientService} from '@app/services/http-client.service';
 import {ComponentActionsService} from '@app/services/component-actions.service';
+import {AuthService} from '@app/services/auth.service';
 
 import {DropdownListComponent} from './dropdown-list.component';
 
@@ -91,7 +92,8 @@ describe('DropdownListComponent', () => {
         ClustersService,
         ComponentsService,
         ServiceLogsTruncatedService,
-        TabsService
+        TabsService,
+        AuthService
       ]
     })
     .compileComponents();

http://git-wip-us.apache.org/repos/asf/ambari/blob/7428e51d/ambari-logsearch/ambari-logsearch-web/src/app/components/filter-button/filter-button.component.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/filter-button/filter-button.component.spec.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/filter-button/filter-button.component.spec.ts
index f9ae154..6a9aca5 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/filter-button/filter-button.component.spec.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/filter-button/filter-button.component.spec.ts
@@ -36,6 +36,7 @@ import {ComponentActionsService} from '@app/services/component-actions.service';
 import {UtilsService} from '@app/services/utils.service';
 import {HttpClientService} from '@app/services/http-client.service';
 import {LogsContainerService} from '@app/services/logs-container.service';
+import {AuthService} from '@app/services/auth.service';
 
 import {FilterButtonComponent} from './filter-button.component';
 
@@ -90,7 +91,8 @@ describe('FilterButtonComponent', () => {
           provide: HttpClientService,
           useValue: httpClient
         },
-        LogsContainerService
+        LogsContainerService,
+        AuthService
       ],
       schemas: [NO_ERRORS_SCHEMA]
     })

http://git-wip-us.apache.org/repos/asf/ambari/blob/7428e51d/ambari-logsearch/ambari-logsearch-web/src/app/components/filter-dropdown/filter-dropdown.component.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/filter-dropdown/filter-dropdown.component.spec.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/filter-dropdown/filter-dropdown.component.spec.ts
index f9192f4..8293ba0 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/filter-dropdown/filter-dropdown.component.spec.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/filter-dropdown/filter-dropdown.component.spec.ts
@@ -35,6 +35,7 @@ import {UtilsService} from '@app/services/utils.service';
 import {ComponentActionsService} from '@app/services/component-actions.service';
 import {LogsContainerService} from '@app/services/logs-container.service';
 import {HttpClientService} from '@app/services/http-client.service';
+import {AuthService} from '@app/services/auth.service';
 
 import {FilterDropdownComponent} from './filter-dropdown.component';
 
@@ -109,7 +110,8 @@ describe('FilterDropdownComponent', () => {
         {
           provide: HttpClientService,
           useValue: httpClient
-        }
+        },
+        AuthService
       ],
       schemas: [NO_ERRORS_SCHEMA]
     })

http://git-wip-us.apache.org/repos/asf/ambari/blob/7428e51d/ambari-logsearch/ambari-logsearch-web/src/app/components/login-form/login-form.component.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/login-form/login-form.component.spec.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/login-form/login-form.component.spec.ts
index fb5c2a0..ac9f3a8 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/login-form/login-form.component.spec.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/login-form/login-form.component.spec.ts
@@ -22,6 +22,7 @@ import {TranslationModules} from '@app/test-config.spec';
 import {StoreModule} from '@ngrx/store';
 import {AppStateService, appState} from '@app/services/storage/app-state.service';
 import {HttpClientService} from '@app/services/http-client.service';
+import {AuthService} from '@app/services/auth.service';
 
 import {LoginFormComponent} from './login-form.component';
 
@@ -58,7 +59,8 @@ describe('LoginFormComponent', () => {
         {
           provide: HttpClientService,
           useValue: httpClient
-        }
+        },
+        AuthService
       ]
     })
     .compileComponents();
@@ -101,9 +103,6 @@ describe('LoginFormComponent', () => {
           expect(component.isLoginAlertDisplayed).toEqual(test.isLoginAlertDisplayed);
         });
 
-        it('isLoginInProgress', () => {
-          expect(component.isLoginInProgress).toEqual(false);
-        });
       });
     });
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/7428e51d/ambari-logsearch/ambari-logsearch-web/src/app/components/login-form/login-form.component.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/login-form/login-form.component.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/login-form/login-form.component.ts
index 2bc45404..39a4975 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/login-form/login-form.component.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/login-form/login-form.component.ts
@@ -17,9 +17,10 @@
  */
 
 import {Component} from '@angular/core';
+import {Response} from '@angular/http';
 import 'rxjs/add/operator/finally';
-import {HttpClientService} from '@app/services/http-client.service';
 import {AppStateService} from '@app/services/storage/app-state.service';
+import {AuthService} from '@app/services/auth.service';
 
 @Component({
   selector: 'login-form',
@@ -28,7 +29,7 @@ import {AppStateService} from '@app/services/storage/app-state.service';
 })
 export class LoginFormComponent {
 
-  constructor(private httpClient: HttpClientService, private appState: AppStateService) {
+  constructor(private authService: AuthService, private appState: AppStateService) {
     appState.getParameter('isLoginInProgress').subscribe(value => this.isLoginInProgress = value);
   }
 
@@ -40,20 +41,25 @@ export class LoginFormComponent {
 
   isLoginInProgress: boolean;
 
-  private setIsAuthorized(value: boolean): void {
-    this.appState.setParameters({
-      isAuthorized: value,
-      isLoginInProgress: false
-    });
-    this.isLoginAlertDisplayed = !value;
-  }
+  /**
+   * Handling the response from the login action. Actually the goal only to show or hide the login error alert.
+   * When it gets error response it shows.
+   * @param {Response} resp
+   */
+  private onLoginError = (resp: Response): void => {
+    this.isLoginAlertDisplayed = true;
+  };
+  /**
+   * Handling the response from the login action. Actually the goal only to show or hide the login error alert.
+   * When it gets success response it hides.
+   * @param {Response} resp
+   */
+  private onLoginSuccess = (resp: Response): void => {
+    this.isLoginAlertDisplayed = false;
+  };
 
   login() {
-    this.appState.setParameter('isLoginInProgress', true);
-    this.httpClient.postFormData('login', {
-      username: this.username,
-      password: this.password
-    }).subscribe(() => this.setIsAuthorized(true), () => this.setIsAuthorized(false));
+    this.authService.login(this.username,this.password).subscribe(this.onLoginSuccess, this.onLoginError);
   }
 
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/7428e51d/ambari-logsearch/ambari-logsearch-web/src/app/components/menu-button/menu-button.component.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/menu-button/menu-button.component.spec.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/menu-button/menu-button.component.spec.ts
index 71bbf67..3836e7a 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/menu-button/menu-button.component.spec.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/menu-button/menu-button.component.spec.ts
@@ -35,6 +35,7 @@ import {TabsService, tabs} from '@app/services/storage/tabs.service';
 import {ComponentActionsService} from '@app/services/component-actions.service';
 import {HttpClientService} from '@app/services/http-client.service';
 import {LogsContainerService} from '@app/services/logs-container.service';
+import {AuthService} from '@app/services/auth.service';
 
 import {MenuButtonComponent} from './menu-button.component';
 
@@ -88,7 +89,8 @@ describe('MenuButtonComponent', () => {
           provide: HttpClientService,
           useValue: httpClient
         },
-        LogsContainerService
+        LogsContainerService,
+        AuthService
       ],
       schemas: [NO_ERRORS_SCHEMA]
     })

http://git-wip-us.apache.org/repos/asf/ambari/blob/7428e51d/ambari-logsearch/ambari-logsearch-web/src/app/components/timezone-picker/timezone-picker.component.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/timezone-picker/timezone-picker.component.spec.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/timezone-picker/timezone-picker.component.spec.ts
index 0e4c8a8..ab56589 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/timezone-picker/timezone-picker.component.spec.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/timezone-picker/timezone-picker.component.spec.ts
@@ -34,6 +34,7 @@ import {TabsService, tabs} from '@app/services/storage/tabs.service';
 import {ComponentActionsService} from '@app/services/component-actions.service';
 import {HttpClientService} from '@app/services/http-client.service';
 import {LogsContainerService} from '@app/services/logs-container.service';
+import {AuthService} from '@app/services/auth.service';
 import {TimeZoneAbbrPipe} from '@app/pipes/timezone-abbr.pipe';
 import {ModalComponent} from '@app/components/modal/modal.component';
 
@@ -93,7 +94,8 @@ describe('TimeZonePickerComponent', () => {
           provide: HttpClientService,
           useValue: httpClient
         },
-        LogsContainerService
+        LogsContainerService,
+        AuthService
       ],
     })
     .compileComponents();

http://git-wip-us.apache.org/repos/asf/ambari/blob/7428e51d/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 05c1a62..91f27e8 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
@@ -36,7 +36,8 @@ export class TopMenuComponent {
           label: 'Options'
         },
         {
-          label: 'Logout'
+          label: 'authorization.logout',
+          action: 'logout'
         }
       ]
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/7428e51d/ambari-logsearch/ambari-logsearch-web/src/app/mock-data.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/mock-data.ts b/ambari-logsearch/ambari-logsearch-web/src/app/mock-data.ts
index 4325f5b..147efef 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/mock-data.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/mock-data.ts
@@ -20,6 +20,7 @@ import * as moment from 'moment';
 
 export const mockData = {
   login: {},
+  logout: {},
   api: {
     v1: {
       audit: {
@@ -1064,4 +1065,4 @@ export const mockData = {
       }
     }
   }
-};
\ No newline at end of file
+};

http://git-wip-us.apache.org/repos/asf/ambari/blob/7428e51d/ambari-logsearch/ambari-logsearch-web/src/app/services/auth.service.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/services/auth.service.spec.ts b/ambari-logsearch/ambari-logsearch-web/src/app/services/auth.service.spec.ts
new file mode 100644
index 0000000..a465c10
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/services/auth.service.spec.ts
@@ -0,0 +1,132 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import {TestBed, inject} from '@angular/core/testing';
+import {HttpModule} from '@angular/http';
+import {Observable} from 'rxjs/Observable';
+import {StoreModule} from '@ngrx/store';
+import {AppStateService, appState} from '@app/services/storage/app-state.service';
+import {AuthService} from '@app/services/auth.service';
+import {HttpClientService} from '@app/services/http-client.service';
+
+describe('AuthService', () => {
+
+  let successResponse = {
+    type: 'default',
+    ok: true,
+    url: '/',
+    status: 200,
+    statusText: 'OK',
+    bytesLoaded: 100,
+    totalBytes: 100,
+    headers: null
+  };
+  let errorResponse = {
+    type: 'error',
+    ok: false,
+    url: '/',
+    status: 401,
+    statusText: 'ERROR',
+    bytesLoaded: 100,
+    totalBytes: 100,
+    headers: null
+  };
+  let currentResponse = successResponse;
+  let httpServiceStub;
+  let authService: AuthService;
+
+  beforeEach(() => {
+    // Note: We add delay to help the isLoginInProgress test case.
+    httpServiceStub = {
+      postFormData: function () {
+        return Observable.create(observer => {
+          observer.next(currentResponse);
+        }).delay(1000);
+      },
+      post: function () {
+        return Observable.create(observer => {
+          observer.next(currentResponse);
+        }).delay(1000);
+      },
+      get: function () {
+        return Observable.create(observer => {
+          observer.next(currentResponse);
+        }).delay(1000);
+      }
+    };
+    TestBed.configureTestingModule({
+      imports: [
+        HttpModule,
+        StoreModule.provideStore({
+          appState
+        })
+      ],
+      providers: [
+        AuthService,
+        AppStateService,
+        {provide: HttpClientService, useValue: httpServiceStub}
+      ]
+    });
+    authService = TestBed.get(AuthService);
+  });
+
+  it('should create service', inject([AuthService], (service: AuthService) => {
+    expect(service).toBeTruthy();
+  }));
+
+  it('should set the isAuthorized state to true in appState when the login is success', inject(
+    [AppStateService],
+    (appStateService: AppStateService) => {
+      currentResponse = successResponse;
+      authService.login('test', 'test')
+        .subscribe(() => {
+          appStateService.getParameter('isAuthorized').subscribe((value) => {
+            expect(value).toBe(true);
+          });
+        }, (value) => {
+          throw value;
+        });
+    }
+  ));
+
+
+  it('should set the isAuthorized state to false in appState when the login is failed', inject(
+    [AppStateService],
+    (appStateService: AppStateService) => {
+      currentResponse = errorResponse;
+      authService.login('test', 'test')
+        .subscribe(() => {
+          appStateService.getParameter('isAuthorized').subscribe((value) => {
+            expect(value).toBe(false);
+          });
+        });
+    }
+  ));
+
+  it('should set the isLoginInProgress state to true when the login started.', inject(
+    [AppStateService],
+    (appStateService: AppStateService) => {
+      currentResponse = successResponse;
+      authService.login('test', 'test');
+      appStateService.getParameter('isLoginInProgress').subscribe((value) => {
+        expect(value).toBe(true);
+      });
+    }
+  ));
+
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/7428e51d/ambari-logsearch/ambari-logsearch-web/src/app/services/auth.service.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/services/auth.service.ts b/ambari-logsearch/ambari-logsearch-web/src/app/services/auth.service.ts
new file mode 100644
index 0000000..8785ce2
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/services/auth.service.ts
@@ -0,0 +1,123 @@
+/**
+ * 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 {Injectable} from '@angular/core';
+import {Response} from '@angular/http';
+
+import {Observable} from 'rxjs/Observable';
+
+import {HttpClientService} from '@app/services/http-client.service';
+import {AppStateService} from '@app/services/storage/app-state.service';
+
+/**
+ * This service meant to be a single place where the authorization should happen.
+ */
+@Injectable()
+export class AuthService {
+
+  constructor(private httpClient: HttpClientService, private appState: AppStateService) {}
+
+  /**
+   * The single entry point to request a login action.
+   * @param {string} username
+   * @param {string} password
+   * @returns {Observable<Response>}
+   */
+  login(username: string, password: string): Observable<Response> {
+    this.setLoginInProgressAppState(true);
+    let obs = this.httpClient.postFormData('login', {
+      username: username,
+      password: password
+    });
+    obs.subscribe(
+      (resp: Response) => this.onLoginResponse(resp),
+      (resp: Response) => this.onLoginError(resp)
+    );
+    return obs;
+  }
+
+  /**
+   * The single unique entry point to request a logout action
+   * @returns {Observable<boolean | Error>}
+   */
+  logout(): Observable<Response> {
+    let obs = this.httpClient.get('logout');
+    obs.subscribe(
+      (resp: Response) => this.onLogoutResponse(resp),
+      (resp: Response) => this.onLogoutError(resp)
+    );
+    return obs;
+  }
+
+  /**
+   * Set the isLoginInProgress state in AppState. The reason behind create a function for this is that we set this app
+   * state from two different places so let's do always the same way.
+   * @param {boolean} state the new value of the isLoginInProgress app state.
+   */
+  private setLoginInProgressAppState(state: boolean) {
+    this.appState.setParameter('isLoginInProgress', state);
+  }
+
+  /**
+   * Set the isAuthorized state in AppState. The reason behind create a function for this is that we set this app
+   * state from two different places so let's do always the same way.
+   * @param {boolean} state The new value of the isAuthorized app state.
+   */
+  private setAuthorizedAppState(state: boolean) {
+    this.appState.setParameter('isAuthorized', state);
+  }
+
+  /**
+   * Handling the login success response. The goal is to set the authorized property of the appState.
+   * @param resp
+   */
+  private onLoginResponse(resp: Response): void {
+    if (resp && resp.ok) {
+      this.setLoginInProgressAppState(false);
+      this.setAuthorizedAppState(resp.ok);
+    }
+  }
+
+  /**
+   * Handling the login error response. The goal is to set the authorized property correctly of the appState.
+   * @ToDo decide if we should have a loginError app state.
+   * @param {Reponse} resp
+   */
+  private onLoginError(resp: Response): void {
+    this.setLoginInProgressAppState(false);
+    this.setAuthorizedAppState(false);
+  }
+
+  /**
+   * Handling the logout success response. The goal is to set the authorized property of the appState.
+   * @param {Response} resp
+   */
+  private onLogoutResponse(resp: Response): void {
+    if (resp && resp.ok) {
+      this.setAuthorizedAppState(false);
+    }
+  }
+
+  /**
+   * Handling the logout error response.
+   * @ToDo decide if we should create a logoutError app state or not
+   * @param {Response} resp
+   */
+  private onLogoutError(resp: Response): void {}
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/7428e51d/ambari-logsearch/ambari-logsearch-web/src/app/services/component-actions.service.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/services/component-actions.service.spec.ts b/ambari-logsearch/ambari-logsearch-web/src/app/services/component-actions.service.spec.ts
index 6f54e65..6d43ff1 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/services/component-actions.service.spec.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/services/component-actions.service.spec.ts
@@ -32,6 +32,7 @@ import {ServiceLogsTruncatedService, serviceLogsTruncated} from '@app/services/s
 import {TabsService, tabs} from '@app/services/storage/tabs.service';
 import {HttpClientService} from '@app/services/http-client.service';
 import {LogsContainerService} from '@app/services/logs-container.service';
+import {AuthService} from '@app/services/auth.service';
 
 import {ComponentActionsService} from './component-actions.service';
 
@@ -81,7 +82,8 @@ describe('ComponentActionsService', () => {
           provide: HttpClientService,
           useValue: httpClient
         },
-        LogsContainerService
+        LogsContainerService,
+        AuthService
       ]
     });
   });

http://git-wip-us.apache.org/repos/asf/ambari/blob/7428e51d/ambari-logsearch/ambari-logsearch-web/src/app/services/component-actions.service.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/services/component-actions.service.ts b/ambari-logsearch/ambari-logsearch-web/src/app/services/component-actions.service.ts
index 73fc94c..e796183 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/services/component-actions.service.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/services/component-actions.service.ts
@@ -21,6 +21,7 @@ import {AppSettingsService} from '@app/services/storage/app-settings.service';
 import {TabsService} from '@app/services/storage/tabs.service';
 import {CollectionModelService} from '@app/classes/models/store';
 import {LogsContainerService} from '@app/services/logs-container.service';
+import {AuthService} from '@app/services/auth.service';
 import {ServiceLog} from '@app/classes/models/service-log';
 import {ListItem} from '@app/classes/list-item';
 
@@ -29,7 +30,8 @@ export class ComponentActionsService {
 
   constructor(
     private appSettings: AppSettingsService, private tabsStorage: TabsService,
-    private logsContainer: LogsContainerService
+    private logsContainer: LogsContainerService,
+    private authService: AuthService
   ) {
   }
 
@@ -134,4 +136,20 @@ export class ComponentActionsService {
     isExclude: true
   });
 
+  /**
+   * Request a login action from the AuthService
+   * @param {string} username
+   * @param {string} password
+   */
+  login(username: string, password: string): void {
+    this.authService.login(username, password);
+  }
+
+  /**
+   * Request a logout action from AuthService
+   */
+  logout(): void {
+    this.authService.logout();
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/7428e51d/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 16b4b32..b214a4f 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/assets/i18n/en.json
+++ b/ambari-logsearch/ambari-logsearch-web/src/assets/i18n/en.json
@@ -10,6 +10,7 @@
   "modal.apply": "Apply",
   "modal.close": "Close",
 
+  "authorization.logout": "Logout",
   "authorization.name": "Username",
   "authorization.password": "Password",
   "authorization.signIn": "Sign In",


[13/50] [abbrv] ambari git commit: AMBARI-22416 Log Search UI: fixes for filtering form. (ababiichuk)

Posted by am...@apache.org.
AMBARI-22416 Log Search UI: fixes for filtering form. (ababiichuk)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 7c4a7e4c52e00282e5b8b901cef14c143fd3da2b
Parents: 068d82f
Author: ababiichuk <ab...@hortonworks.com>
Authored: Fri Nov 10 18:16:45 2017 +0200
Committer: ababiichuk <ab...@hortonworks.com>
Committed: Fri Nov 10 23:53:24 2017 +0200

----------------------------------------------------------------------
 .../ambari-logsearch-web/src/app/app.module.ts  |   2 -
 .../src/app/classes/filtering.ts                | 355 +---------
 .../src/app/classes/models/app-state.ts         |   6 +-
 .../src/app/classes/models/node-item.ts         |  30 +
 .../src/app/classes/models/node.ts              |  30 -
 .../src/app/classes/models/store.ts             |   6 +-
 .../src/app/classes/models/tab.ts               |  12 +-
 .../src/app/components/app.component.ts         |   6 +-
 .../dropdown-button.component.html              |   4 +-
 .../dropdown-button.component.spec.ts           |   2 -
 .../dropdown-button.component.ts                |  55 +-
 .../dropdown-list/dropdown-list.component.html  |   2 +-
 .../dropdown-list.component.spec.ts             |   6 +-
 .../filter-button.component.spec.ts             |   2 -
 .../filter-button/filter-button.component.ts    |  35 +-
 .../filter-dropdown.component.spec.ts           |  14 +-
 .../filter-dropdown.component.ts                |  22 +-
 .../filters-panel/filters-panel.component.html  |   6 +-
 .../filters-panel.component.spec.ts             |   6 +-
 .../filters-panel/filters-panel.component.ts    |  18 +-
 .../log-context/log-context.component.spec.ts   |   4 +-
 .../logs-container.component.spec.ts            |   2 -
 .../logs-container/logs-container.component.ts  |  26 +-
 .../logs-list/logs-list.component.html          |   3 +-
 .../logs-list/logs-list.component.spec.ts       |  21 +-
 .../components/logs-list/logs-list.component.ts |  10 +-
 .../menu-button/menu-button.component.spec.ts   |   2 -
 .../menu-button/menu-button.component.ts        |   4 +-
 .../pagination-controls.component.ts            |   7 +-
 .../pagination/pagination.component.html        |   2 +-
 .../pagination/pagination.component.spec.ts     |   9 +-
 .../pagination/pagination.component.ts          |  10 +-
 .../search-box/search-box.component.ts          |  12 +-
 .../time-range-picker.component.html            |   3 +-
 .../time-range-picker.component.spec.ts         |  29 +-
 .../time-range-picker.component.ts              |  47 +-
 .../timezone-picker.component.spec.ts           |   2 -
 .../services/component-actions.service.spec.ts  |   2 -
 .../app/services/component-actions.service.ts   |  24 +-
 .../component-generator.service.spec.ts         |   2 -
 .../src/app/services/filtering.service.spec.ts  |  97 ---
 .../src/app/services/filtering.service.ts       | 253 -------
 .../app/services/logs-container.service.spec.ts |  31 +-
 .../src/app/services/logs-container.service.ts  | 678 ++++++++++++++++++-
 .../src/app/services/utils.service.spec.ts      | 285 +++++++-
 .../src/app/services/utils.service.ts           |  65 +-
 46 files changed, 1257 insertions(+), 992 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/app.module.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/app.module.ts b/ambari-logsearch/ambari-logsearch-web/src/app/app.module.ts
index 56562df..37f3a49 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/app.module.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/app.module.ts
@@ -34,7 +34,6 @@ import {environment} from '@envs/environment';
 import {mockApiDataService} from '@app/services/mock-api-data.service'
 import {HttpClientService} from '@app/services/http-client.service';
 import {ComponentActionsService} from '@app/services/component-actions.service';
-import {FilteringService} from '@app/services/filtering.service';
 import {UtilsService} from '@app/services/utils.service';
 import {LogsContainerService} from '@app/services/logs-container.service';
 import {ComponentGeneratorService} from '@app/services/component-generator.service';
@@ -164,7 +163,6 @@ export function getXHRBackend(injector: Injector, browser: BrowserXhr, xsrf: XSR
   providers: [
     HttpClientService,
     ComponentActionsService,
-    FilteringService,
     UtilsService,
     LogsContainerService,
     ComponentGeneratorService,

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/classes/filtering.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/classes/filtering.ts b/ambari-logsearch/ambari-logsearch-web/src/app/classes/filtering.ts
index dde144b..2a7205f 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/classes/filtering.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/classes/filtering.ts
@@ -16,354 +16,37 @@
  * limitations under the License.
  */
 
-import {FormGroup, FormControl} from '@angular/forms';
+import {Moment, unitOfTime} from 'moment';
 import {ListItem} from '@app/classes/list-item';
 
 export interface TimeUnit {
   type: 'CURRENT' | 'LAST' | 'PAST';
-  unit: 'ms' | 's' | 'm' | 'h' | 'd' | 'w' | 'M' | 'Y';
+  unit: unitOfTime.DurationConstructor;
   interval?: number;
 }
 
+export interface CustomTimeRange {
+  type: 'CUSTOM';
+  start?: Moment;
+  end?: Moment;
+}
+
+export interface SortingConditions {
+  key: string;
+  type: 'asc' | 'desc';
+}
+
 export interface TimeUnitListItem extends ListItem {
-  value: TimeUnit;
+  value: TimeUnit | CustomTimeRange;
+}
+
+export interface SortingListItem extends ListItem {
+  value: SortingConditions;
 }
 
 export interface FilterCondition {
   label?: string;
   options?: (ListItem | TimeUnitListItem[])[];
-  defaultValue?: string | number | {[key: string]: any};
-  defaultLabel?: string;
+  defaultSelection?: ListItem | ListItem[] | number;
   iconClass?: string;
 }
-
-const paginationOptions: string[] = ['10', '25', '50', '100'];
-
-export const filters: {[key: string]: FilterCondition} = {
-  clusters: {
-    label: 'filter.clusters',
-    options: [],
-    defaultValue: ''
-  },
-  timeRange: {
-    options: [
-      [
-        {
-          label: 'filter.timeRange.7d',
-          value: {
-            type: 'LAST',
-            unit: 'd',
-            interval: 7
-          }
-        },
-        {
-          label: 'filter.timeRange.30d',
-          value: {
-            type: 'LAST',
-            unit: 'd',
-            interval: 30
-          }
-        },
-        {
-          label: 'filter.timeRange.60d',
-          value: {
-            type: 'LAST',
-            unit: 'd',
-            interval: 60
-          }
-        },
-        {
-          label: 'filter.timeRange.90d',
-          value: {
-            type: 'LAST',
-            unit: 'd',
-            interval: 90
-          }
-        },
-        {
-          label: 'filter.timeRange.6m',
-          value: {
-            type: 'LAST',
-            unit: 'M',
-            interval: 6
-          }
-        },
-        {
-          label: 'filter.timeRange.1y',
-          value: {
-            type: 'LAST',
-            unit: 'Y',
-            interval: 1
-          }
-        },
-        {
-          label: 'filter.timeRange.2y',
-          value: {
-            type: 'LAST',
-            unit: 'Y',
-            interval: 2
-          }
-        },
-        {
-          label: 'filter.timeRange.5y',
-          value: {
-            type: 'LAST',
-            unit: 'Y',
-            interval: 5
-          }
-        }
-      ],
-      [
-        {
-          label: 'filter.timeRange.yesterday',
-          value: {
-            type: 'PAST',
-            unit: 'd'
-          }
-        },
-        // TODO implement time range calculation
-        /*
-         {
-         label: 'filter.timeRange.beforeYesterday',
-         value: {
-         type: 'PAST',
-         unit: 'd'
-         }
-         },
-         {
-         label: 'filter.timeRange.thisDayLastWeek',
-         value: {
-         type: 'PAST',
-         unit: 'd'
-         }
-         },
-         */
-        {
-          label: 'filter.timeRange.previousWeek',
-          value: {
-            type: 'PAST',
-            unit: 'w'
-          }
-        },
-        {
-          label: 'filter.timeRange.previousMonth',
-          value: {
-            type: 'PAST',
-            unit: 'M'
-          }
-        },
-        {
-          label: 'filter.timeRange.previousYear',
-          value: {
-            type: 'PAST',
-            unit: 'Y'
-          }
-        }
-      ],
-      [
-        {
-          label: 'filter.timeRange.today',
-          value: {
-            type: 'CURRENT',
-            unit: 'd'
-          }
-        },
-        {
-          label: 'filter.timeRange.thisWeek',
-          value: {
-            type: 'CURRENT',
-            unit: 'w'
-          }
-        },
-        {
-          label: 'filter.timeRange.thisMonth',
-          value: {
-            type: 'CURRENT',
-            unit: 'M'
-          }
-        },
-        {
-          label: 'filter.timeRange.thisYear',
-          value: {
-            type: 'CURRENT',
-            unit: 'Y'
-          }
-        }
-      ],
-      [
-        {
-          label: 'filter.timeRange.5min',
-          value: {
-            type: 'LAST',
-            unit: 'm',
-            interval: 5
-          }
-        },
-        {
-          label: 'filter.timeRange.15min',
-          value: {
-            type: 'LAST',
-            unit: 'm',
-            interval: 15
-          }
-        },
-        {
-          label: 'filter.timeRange.30min',
-          value: {
-            type: 'LAST',
-            unit: 'm',
-            interval: 30
-          }
-        },
-        {
-          label: 'filter.timeRange.1hr',
-          value: {
-            type: 'LAST',
-            unit: 'h',
-            interval: 1
-          }
-        },
-        {
-          label: 'filter.timeRange.3hr',
-          value: {
-            type: 'LAST',
-            unit: 'h',
-            interval: 3
-          }
-        },
-        {
-          label: 'filter.timeRange.6hr',
-          value: {
-            type: 'LAST',
-            unit: 'h',
-            interval: 6
-          }
-        },
-        {
-          label: 'filter.timeRange.12hr',
-          value: {
-            type: 'LAST',
-            unit: 'h',
-            interval: 12
-          }
-        },
-        {
-          label: 'filter.timeRange.24hr',
-          value: {
-            type: 'LAST',
-            unit: 'h',
-            interval: 24
-          }
-        },
-      ]
-    ],
-    defaultValue: {
-      type: 'LAST',
-      unit: 'h',
-      interval: 1
-    },
-    defaultLabel: 'filter.timeRange.1hr'
-  },
-  components: {
-    label: 'filter.components',
-    iconClass: 'fa fa-cubes',
-    options: [],
-    defaultValue: ''
-  },
-  levels: {
-    label: 'filter.levels',
-    iconClass: 'fa fa-sort-amount-asc',
-    options: [
-      {
-        label: 'levels.fatal',
-        value: 'FATAL'
-      },
-      {
-        label: 'levels.error',
-        value: 'ERROR'
-      },
-      {
-        label: 'levels.warn',
-        value: 'WARN'
-      },
-      {
-        label: 'levels.info',
-        value: 'INFO'
-      },
-      {
-        label: 'levels.debug',
-        value: 'DEBUG'
-      },
-      {
-        label: 'levels.trace',
-        value: 'TRACE'
-      },
-      {
-        label: 'levels.unknown',
-        value: 'UNKNOWN'
-      }
-    ],
-    defaultValue: ''
-  },
-  hosts: {
-    label: 'filter.hosts',
-    iconClass: 'fa fa-server',
-    options: [],
-    defaultValue: ''
-  },
-  sorting: {
-    label: 'sorting.title',
-    options: [
-      {
-        label: 'sorting.time.asc',
-        value: {
-          key: 'logtime',
-          type: 'asc'
-        }
-      },
-      {
-        label: 'sorting.time.desc',
-        value: {
-          key: 'logtime',
-          type: 'desc'
-        }
-      }
-    ],
-    defaultValue: '',
-    defaultLabel: ''
-  },
-  pageSize: {
-    label: 'pagination.title',
-    options: paginationOptions.map((option: string): ListItem => {
-      return {
-        label: option,
-        value: option
-      }
-    }),
-    defaultValue: '10',
-    defaultLabel: '10'
-  },
-  page: {
-    defaultValue: 0
-  },
-  query: {}
-};
-
-export const filtersFormItemsMap: {[key: string]: string[]} = {
-  serviceLogs: ['clusters', 'timeRange', 'components', 'levels', 'hosts', 'sorting', 'pageSize', 'page', 'query'],
-  auditLogs: ['clusters', 'timeRange', 'sorting', 'pageSize', 'page', 'query'] // TODO add all the required fields
-};
-
-export const getFiltersForm = (listType: string): FormGroup => {
-  const itemsList = filtersFormItemsMap[listType],
-    keys = Object.keys(filters).filter((key: string): boolean => itemsList.indexOf(key) > -1),
-    items = keys.reduce((currentObject: any, key: string): any => {
-      let formControl = new FormControl(),
-        item = {
-          [key]: formControl
-        };
-      formControl.setValue(filters[key].defaultValue);
-      return Object.assign(currentObject, item);
-    }, {});
-  return new FormGroup(items);
-};

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/classes/models/app-state.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/classes/models/app-state.ts b/ambari-logsearch/ambari-logsearch-web/src/app/classes/models/app-state.ts
index 2c5c083..afed497 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/classes/models/app-state.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/classes/models/app-state.ts
@@ -16,9 +16,7 @@
  * limitations under the License.
  */
 
-import {FormGroup} from '@angular/forms';
 import {ActiveServiceLogEntry} from '@app/classes/active-service-log-entry';
-import {Tab, initialTabs} from '@app/classes/models/tab';
 
 export interface AppState {
   isAuthorized: boolean;
@@ -28,7 +26,7 @@ export interface AppState {
   isServiceLogsFileView: boolean;
   isServiceLogContextView: boolean;
   activeLog: ActiveServiceLogEntry | null;
-  activeFiltersForm: FormGroup;
+  activeFilters: object;
 }
 
 export const initialState: AppState = {
@@ -39,5 +37,5 @@ export const initialState: AppState = {
   isServiceLogsFileView: false,
   isServiceLogContextView: false,
   activeLog: null,
-  activeFiltersForm: initialTabs.find((tab: Tab): boolean => tab.isActive).appState.activeFiltersForm
+  activeFilters: null
 };

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/classes/models/node-item.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/classes/models/node-item.ts b/ambari-logsearch/ambari-logsearch-web/src/app/classes/models/node-item.ts
new file mode 100644
index 0000000..ef5f772
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/classes/models/node-item.ts
@@ -0,0 +1,30 @@
+/**
+ * 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 {CommonEntry} from '@app/classes/models/common-entry';
+
+export interface NodeItem {
+  name: string;
+  type?: string;
+  value: string;
+  isParent: boolean;
+  isRoot: boolean;
+  childs?: NodeItem[];
+  logLevelCount?: CommonEntry[];
+  vNodeList?: CommonEntry[];
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/classes/models/node.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/classes/models/node.ts b/ambari-logsearch/ambari-logsearch-web/src/app/classes/models/node.ts
deleted file mode 100644
index a14e51a..0000000
--- a/ambari-logsearch/ambari-logsearch-web/src/app/classes/models/node.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import {CommonEntry} from '@app/classes/models/common-entry';
-
-export interface Node {
-  name: string;
-  type?: string;
-  value: string;
-  isParent: boolean;
-  isRoot: boolean;
-  childs?: Node[];
-  logLevelCount?: CommonEntry[];
-  vNodeList?: CommonEntry[];
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/classes/models/store.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/classes/models/store.ts b/ambari-logsearch/ambari-logsearch-web/src/app/classes/models/store.ts
index d912b35..f996d92 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/classes/models/store.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/classes/models/store.ts
@@ -24,7 +24,7 @@ import {AuditLog} from '@app/classes/models/audit-log';
 import {ServiceLog} from '@app/classes/models/service-log';
 import {BarGraph} from '@app/classes/models/bar-graph';
 import {Graph} from '@app/classes/models/graph';
-import {Node} from '@app/classes/models/node';
+import {NodeItem} from '@app/classes/models/node-item';
 import {UserConfig} from '@app/classes/models/user-config';
 import {Filter} from '@app/classes/models/filter';
 import {AuditLogField} from '@app/classes/models/audit-log-field';
@@ -50,11 +50,11 @@ export interface AppStore {
   serviceLogsHistogramData: BarGraph[];
   serviceLogsTruncated: ServiceLog[];
   graphs: Graph[];
-  hosts: Node[];
+  hosts: NodeItem[];
   userConfigs: UserConfig[];
   filters: Filter[];
   clusters: string[];
-  components: Node[];
+  components: NodeItem[];
   serviceLogsFields: ServiceLogField[];
   auditLogsFields: AuditLogField[];
   tabs: Tab[];

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/classes/models/tab.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/classes/models/tab.ts b/ambari-logsearch/ambari-logsearch-web/src/app/classes/models/tab.ts
index bb8028a..05ea59d 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/classes/models/tab.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/classes/models/tab.ts
@@ -16,15 +16,13 @@
  * limitations under the License.
  */
 
-import {getFiltersForm} from '@app/classes/filtering';
-
 export interface Tab {
   id: string;
   type: string;
-  isActive: boolean;
+  isActive?: boolean;
   isCloseable?: boolean;
   label: string;
-  appState: any;
+  appState?: object;
 }
 
 export const initialTabs: Tab[] = [
@@ -35,8 +33,7 @@ export const initialTabs: Tab[] = [
     label: 'common.serviceLogs',
     appState: {
       activeLogsType: 'serviceLogs',
-      isServiceLogsFileView: false,
-      activeFiltersForm: getFiltersForm('serviceLogs')
+      isServiceLogsFileView: false
     }
   },
   {
@@ -46,8 +43,7 @@ export const initialTabs: Tab[] = [
     label: 'common.auditLogs',
     appState: {
       activeLogsType: 'auditLogs',
-      isServiceLogsFileView: false,
-      activeFiltersForm: getFiltersForm('auditLogs')
+      isServiceLogsFileView: false
     }
   }
 ];

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/components/app.component.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/app.component.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/app.component.ts
index 4de47ea..038dd2a 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/app.component.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/app.component.ts
@@ -30,12 +30,12 @@ import {HttpClientService} from '@app/services/http-client.service';
 export class AppComponent {
 
   constructor(private httpClient: HttpClientService, private translate: TranslateService, private appState: AppStateService) {
-    appState.getParameter('isAuthorized').subscribe(value => this.isAuthorized = value);
+    appState.getParameter('isAuthorized').subscribe((value: boolean) => this.isAuthorized = value);
     appState.setParameter('isInitialLoading', true);
-    this.httpClient.get('status').subscribe(() => this.appState.setParameters({
+    httpClient.get('status').subscribe(() => appState.setParameters({
       isAuthorized: true,
       isInitialLoading: false
-    }), () => this.appState.setParameter('isInitialLoading', false));
+    }), () => appState.setParameter('isInitialLoading', false));
     translate.setDefaultLang('en');
     translate.use('en');
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/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 798a609..b5f1e56 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
@@ -22,10 +22,10 @@
       <span *ngIf="iconClass" [ngClass]="iconClass"></span>
       <span *ngIf="label">{{label | translate}}</span>
     </span>
-    <span *ngIf="showSelectedValue && !isMultipleChoice">{{selectedLabel | translate}}</span>
+    <span *ngIf="showSelectedValue && !isMultipleChoice && selection.length">{{selection[0].label | translate}}</span>
     <span *ngIf="!hideCaret" class="caret"></span>
   </button>
   <ul data-component="dropdown-list" [ngClass]="{'dropdown-menu': true, 'dropdown-menu-right': isRightAlign}"
-      [items]="options" [isMultipleChoice]="isMultipleChoice" (selectedItemChange)="updateValue($event)"
+      [items]="options" [isMultipleChoice]="isMultipleChoice" (selectedItemChange)="updateSelection($event)"
       [actionArguments]="additionalArgs"></ul>
 </div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-button/dropdown-button.component.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-button/dropdown-button.component.spec.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-button/dropdown-button.component.spec.ts
index f11ca09..bd41c04 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-button/dropdown-button.component.spec.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-button/dropdown-button.component.spec.ts
@@ -32,7 +32,6 @@ import {ServiceLogsFieldsService, serviceLogsFields} from '@app/services/storage
 import {ServiceLogsHistogramDataService, serviceLogsHistogramData} from '@app/services/storage/service-logs-histogram-data.service';
 import {ServiceLogsTruncatedService, serviceLogsTruncated} from '@app/services/storage/service-logs-truncated.service';
 import {TabsService, tabs} from '@app/services/storage/tabs.service';
-import {FilteringService} from '@app/services/filtering.service';
 import {UtilsService} from '@app/services/utils.service';
 import {ComponentActionsService} from '@app/services/component-actions.service';
 import {HttpClientService} from '@app/services/http-client.service';
@@ -85,7 +84,6 @@ describe('DropdownButtonComponent', () => {
         ServiceLogsHistogramDataService,
         ServiceLogsTruncatedService,
         TabsService,
-        FilteringService,
         UtilsService,
         ComponentActionsService,
         {

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/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 0bf4422..148e1b4 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
@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-import {Component, OnInit, Input} from '@angular/core';
+import {Component, Input} from '@angular/core';
 import {ListItem} from '@app/classes/list-item';
 import {ComponentActionsService} from '@app/services/component-actions.service';
 import {UtilsService} from '@app/services/utils.service';
@@ -26,14 +26,10 @@ import {UtilsService} from '@app/services/utils.service';
   templateUrl: './dropdown-button.component.html',
   styleUrls: ['./dropdown-button.component.less']
 })
-export class DropdownButtonComponent implements OnInit {
+export class DropdownButtonComponent {
 
   constructor(protected actions: ComponentActionsService, protected utils: UtilsService) {
   }
-
-  ngOnInit() {
-    this.selectedLabel = this.defaultLabel;
-  }
   
   @Input()
   label?: string;
@@ -48,13 +44,7 @@ export class DropdownButtonComponent implements OnInit {
   showSelectedValue: boolean = true;
 
   @Input()
-  options?: ListItem[];
-
-  @Input()
-  defaultValue?: string;
-
-  @Input()
-  defaultLabel?: string;
+  options: ListItem[] = [];
 
   @Input()
   action?: string;
@@ -71,36 +61,33 @@ export class DropdownButtonComponent implements OnInit {
   @Input()
   isDropup: boolean = false;
 
-  protected selectedValue?: any;
-
-  selectedLabel: string;
+  protected selectedItems?: ListItem[] = [];
 
-  get value(): any {
-    return this.selectedValue;
+  get selection(): ListItem[] {
+    return this.selectedItems;
   }
 
-  set value(value: any) {
-    this.selectedValue = value;
+  set selection(items: ListItem[]) {
+    this.selectedItems = items;
   }
 
-  updateValue(eventOptions: ListItem): void {
-    const value = eventOptions && eventOptions.value,
-      action = this.action && this.actions[this.action];
+  updateSelection(item: ListItem): void {
+    const action = this.action && this.actions[this.action];
     if (this.isMultipleChoice) {
-      this.value = this.utils.updateMultiSelectValue(this.value, value, eventOptions.isChecked);
-      this.options.find(item => item.value === value).isChecked = eventOptions.isChecked;
+      this.options.find((option: ListItem): boolean => {
+        return this.utils.isEqual(option.value, item.value);
+      }).isChecked = item.isChecked;
+      const checkedItems = this.options.filter((option: ListItem): boolean => option.isChecked);
+      this.selection = checkedItems;
       if (action) {
-        action(this.options.filter(item => item.isChecked).map(item => item.value), ...this.additionalArgs);
+        action(checkedItems.map((option: ListItem): any => option.value), ...this.additionalArgs);
       }
-    } else {
-      if (this.utils.valueHasChanged(this.value, value)) {
-        this.value = value;
-        this.selectedLabel = eventOptions.label;
-        if (action) {
-          action(this.value, ...this.additionalArgs);
-        }
+    } else if (!this.utils.isEqual(this.selection[0], item)) {
+      this.selection = [item];
+      if (action) {
+        action(item.value, ...this.additionalArgs);
       }
     }
   }
-  
+
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-list/dropdown-list.component.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-list/dropdown-list.component.html b/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-list/dropdown-list.component.html
index 5de78ad..df564e5 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-list/dropdown-list.component.html
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-list/dropdown-list.component.html
@@ -17,7 +17,7 @@
 
 <li *ngFor="let item of items">
   <label class="list-item-label" *ngIf="isMultipleChoice">
-    <input type="checkbox" [attr.id]="item.id || item.value" [attr.checked]="item.isChecked ? 'checked' : null"
+    <input type="checkbox" [attr.id]="item.id || item.value" [(ngModel)]="item.isChecked"
            (change)="changeSelectedItem({value: item.value, isChecked: $event.currentTarget.checked})">
     <label [attr.for]="item.id || item.value" class="label-container">
       <span *ngIf="item.iconClass" [ngClass]="item.iconClass"></span>

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-list/dropdown-list.component.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-list/dropdown-list.component.spec.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-list/dropdown-list.component.spec.ts
index 5455e67..ac2fa84 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-list/dropdown-list.component.spec.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-list/dropdown-list.component.spec.ts
@@ -17,6 +17,7 @@
  */
 
 import {async, ComponentFixture, TestBed} from '@angular/core/testing';
+import {FormsModule} from '@angular/forms';
 import {StoreModule} from '@ngrx/store';
 import {TranslationModules} from '@app/test-config.spec';
 import {HostsService, hosts} from '@app/services/storage/hosts.service';
@@ -34,7 +35,6 @@ import {TabsService, tabs} from '@app/services/storage/tabs.service';
 import {ComponentGeneratorService} from '@app/services/component-generator.service';
 import {LogsContainerService} from '@app/services/logs-container.service';
 import {HttpClientService} from '@app/services/http-client.service';
-import {FilteringService} from '@app/services/filtering.service';
 import {ComponentActionsService} from '@app/services/component-actions.service';
 
 import {DropdownListComponent} from './dropdown-list.component';
@@ -69,7 +69,8 @@ describe('DropdownListComponent', () => {
           components,
           serviceLogsTruncated,
           tabs
-        })
+        }),
+        FormsModule
       ],
       providers: [
         ComponentGeneratorService,
@@ -78,7 +79,6 @@ describe('DropdownListComponent', () => {
           provide: HttpClientService,
           useValue: httpClient
         },
-        FilteringService,
         ComponentActionsService,
         HostsService,
         AuditLogsService,

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/components/filter-button/filter-button.component.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/filter-button/filter-button.component.spec.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/filter-button/filter-button.component.spec.ts
index 3e40455..f9ae154 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/filter-button/filter-button.component.spec.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/filter-button/filter-button.component.spec.ts
@@ -33,7 +33,6 @@ import {ServiceLogsHistogramDataService, serviceLogsHistogramData} from '@app/se
 import {ServiceLogsTruncatedService, serviceLogsTruncated} from '@app/services/storage/service-logs-truncated.service';
 import {TabsService, tabs} from '@app/services/storage/tabs.service';
 import {ComponentActionsService} from '@app/services/component-actions.service';
-import {FilteringService} from '@app/services/filtering.service';
 import {UtilsService} from '@app/services/utils.service';
 import {HttpClientService} from '@app/services/http-client.service';
 import {LogsContainerService} from '@app/services/logs-container.service';
@@ -86,7 +85,6 @@ describe('FilterButtonComponent', () => {
         ServiceLogsTruncatedService,
         TabsService,
         ComponentActionsService,
-        FilteringService,
         UtilsService,
         {
           provide: HttpClientService,

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/components/filter-button/filter-button.component.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/filter-button/filter-button.component.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/filter-button/filter-button.component.ts
index 2c8ecd7..2dcecd1 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/filter-button/filter-button.component.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/filter-button/filter-button.component.ts
@@ -41,34 +41,35 @@ export class FilterButtonComponent extends MenuButtonComponent implements Contro
     super(actions);
   }
 
-  @Input()
-  defaultValue?: string;
-
-  private selectedValue: any;
+  private selectedItems: ListItem[] = [];
 
   private onChange: (fn: any) => void;
 
-  get value(): any {
-    return this.selectedValue;
+  get selection(): ListItem[] {
+    return this.selectedItems;
   }
 
-  set value(newValue: any) {
-    this.selectedValue = newValue;
-    this.onChange(newValue);
+  set selection(items: ListItem[]) {
+    this.selectedItems = items;
+    if (this.onChange) {
+      this.onChange(items);
+    }
   }
 
-  updateValue(options: ListItem): void {
-    const value = options && options.value;
+  updateSelection(item: ListItem): void {
     if (this.isMultipleChoice) {
-      this.value = this.utils.updateMultiSelectValue(this.value, value, options.isChecked);
-    } else {
-      if (this.utils.valueHasChanged(this.selectedValue, value)) {
-        this.value = value;
-      }
+      this.subItems.find((option: ListItem): boolean => {
+        return this.utils.isEqual(option.value, item.value);
+      }).isChecked = item.isChecked;
+      const checkedItems = this.subItems.filter((option: ListItem): boolean => option.isChecked);
+      this.selection = checkedItems;
+    } else if (!this.utils.isEqual(this.selection[0], item)) {
+      this.selection = [item];
     }
   }
 
-  writeValue() {
+  writeValue(items: ListItem[]) {
+    this.selection = items;
   }
 
   registerOnChange(callback: any): void {

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/components/filter-dropdown/filter-dropdown.component.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/filter-dropdown/filter-dropdown.component.spec.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/filter-dropdown/filter-dropdown.component.spec.ts
index c294e8e..f9192f4 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/filter-dropdown/filter-dropdown.component.spec.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/filter-dropdown/filter-dropdown.component.spec.ts
@@ -28,7 +28,9 @@ import {ServiceLogsFieldsService, serviceLogsFields} from '@app/services/storage
 import {ServiceLogsHistogramDataService, serviceLogsHistogramData} from '@app/services/storage/service-logs-histogram-data.service';
 import {ServiceLogsTruncatedService, serviceLogsTruncated} from '@app/services/storage/service-logs-truncated.service';
 import {TabsService, tabs} from '@app/services/storage/tabs.service';
-import {FilteringService} from '@app/services/filtering.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 {UtilsService} from '@app/services/utils.service';
 import {ComponentActionsService} from '@app/services/component-actions.service';
 import {LogsContainerService} from '@app/services/logs-container.service';
@@ -77,7 +79,10 @@ describe('FilterDropdownComponent', () => {
           serviceLogsFields,
           serviceLogsHistogramData,
           serviceLogsTruncated,
-          tabs
+          tabs,
+          clusters,
+          components,
+          hosts
         }),
         ...TranslationModules
       ],
@@ -91,8 +96,11 @@ describe('FilterDropdownComponent', () => {
         ServiceLogsHistogramDataService,
         ServiceLogsTruncatedService,
         TabsService,
+        ClustersService,
+        ComponentsService,
+        HostsService,
         {
-          provide: FilteringService,
+          provide: LogsContainerService,
           useValue: filtering
         },
         UtilsService,

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/components/filter-dropdown/filter-dropdown.component.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/filter-dropdown/filter-dropdown.component.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/filter-dropdown/filter-dropdown.component.ts
index 9e5a6f1..d677d81 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/filter-dropdown/filter-dropdown.component.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/filter-dropdown/filter-dropdown.component.ts
@@ -20,6 +20,7 @@ import {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';
 import {ComponentActionsService} from '@app/services/component-actions.service';
 import {UtilsService} from '@app/services/utils.service';
 import {DropdownButtonComponent} from '@app/components/dropdown-button/dropdown-button.component';
+import {ListItem} from '@app/classes/list-item';
 
 @Component({
   selector: 'filter-dropdown',
@@ -41,16 +42,25 @@ export class FilterDropdownComponent extends DropdownButtonComponent implements
 
   private onChange: (fn: any) => void;
 
-  get value(): any {
-    return this.selectedValue;
+  get selection(): ListItem[] {
+    return this.selectedItems;
   }
 
-  set value(newValue: any) {
-    this.selectedValue = newValue;
-    this.onChange(newValue);
+  set selection(items: ListItem[]) {
+    this.selectedItems = items;
+    if (this.isMultipleChoice) {
+      this.options.forEach((option: ListItem): void => {
+        const selectionItem = items.find((item: ListItem): boolean => this.utils.isEqual(item.value, option.value));
+        option.isChecked = Boolean(selectionItem);
+      });
+    }
+    if (this.onChange) {
+      this.onChange(items);
+    }
   }
 
-  writeValue() {
+  writeValue(items: ListItem[]) {
+    this.selection = items;
   }
 
   registerOnChange(callback: any): void {

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/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 fa739a4..2d327a6 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,13 +17,13 @@
 
 <form [formGroup]="filtersForm">
   <div class="form-inline filter-input-container col-md-8">
-    <filter-dropdown [label]="filters.clusters.label" formControlName="clusters" [options]="filters.clusters.options"
-                     [defaultLabel]="filters.clusters.defaultLabel" [isMultipleChoice]="true"
+    <filter-dropdown *ngIf="isFilterConditionDisplayed('clusters')" [label]="filters.clusters.label"
+                     formControlName="clusters" [options]="filters.clusters.options" [isMultipleChoice]="true"
                      class="filter-input"></filter-dropdown>
     <search-box formControlName="query" [items]="searchBoxItemsTranslated" class="filter-input"
                 [parameterNameChangeSubject]="queryParameterNameChange"
                 [parameterAddSubject]="queryParameterAdd"></search-box>
-    <time-range-picker formControlName="timeRange" [defaultLabel]="filters.timeRange.defaultLabel"
+    <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">

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/components/filters-panel/filters-panel.component.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/filters-panel/filters-panel.component.spec.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/filters-panel/filters-panel.component.spec.ts
index 0bb0204..1f7e8db 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/filters-panel/filters-panel.component.spec.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/filters-panel/filters-panel.component.spec.ts
@@ -18,6 +18,7 @@
 
 import {NO_ERRORS_SCHEMA} from '@angular/core';
 import {async, ComponentFixture, TestBed} from '@angular/core/testing';
+import {FormGroup, FormControl} from '@angular/forms';
 import {TranslationModules} from '@app/test-config.spec';
 import {StoreModule} from '@ngrx/store';
 import {AppSettingsService, appSettings} from '@app/services/storage/app-settings.service';
@@ -32,7 +33,6 @@ import {ServiceLogsHistogramDataService, serviceLogsHistogramData} from '@app/se
 import {AppStateService, appState} from '@app/services/storage/app-state.service';
 import {ServiceLogsTruncatedService, serviceLogsTruncated} from '@app/services/storage/service-logs-truncated.service';
 import {TabsService, tabs} from '@app/services/storage/tabs.service';
-import {FilteringService} from '@app/services/filtering.service';
 import {HttpClientService} from '@app/services/http-client.service';
 import {UtilsService} from '@app/services/utils.service';
 import {LogsContainerService} from '@app/services/logs-container.service';
@@ -88,7 +88,6 @@ describe('FiltersPanelComponent', () => {
         AppStateService,
         ServiceLogsTruncatedService,
         TabsService,
-        FilteringService,
         LogsContainerService,
         {
           provide: HttpClientService,
@@ -104,6 +103,9 @@ describe('FiltersPanelComponent', () => {
   beforeEach(() => {
     fixture = TestBed.createComponent(FiltersPanelComponent);
     component = fixture.componentInstance;
+    component.filtersForm = new FormGroup({
+      control: new FormControl()
+    });
     fixture.detectChanges();
   });
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/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 9601a0e..3314252 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
@@ -21,10 +21,8 @@ import {FormGroup} from '@angular/forms';
 import {Subject} from 'rxjs/Subject';
 import {TranslateService} from '@ngx-translate/core';
 import {ListItem} from '@app/classes/list-item';
-import {filtersFormItemsMap} from '@app/classes/filtering';
 import {CommonEntry} from '@app/classes/models/common-entry';
 import {LogField} from '@app/classes/models/log-field';
-import {FilteringService} from '@app/services/filtering.service';
 import {LogsContainerService} from '@app/services/logs-container.service';
 import {AppStateService} from '@app/services/storage/app-state.service';
 
@@ -35,7 +33,10 @@ import {AppStateService} from '@app/services/storage/app-state.service';
 })
 export class FiltersPanelComponent {
 
-  constructor(private translate: TranslateService, private filtering: FilteringService, private logsContainer: LogsContainerService, private appState: AppStateService) {
+  constructor(
+    private translate: TranslateService, private logsContainer: LogsContainerService,
+    private appState: AppStateService
+  ) {
     appState.getParameter('activeLogsType').subscribe(value => {
       this.logsType = value;
       logsContainer.logsTypeMap[value].fieldsModel.getAll().subscribe((fields: LogField[]): void => {
@@ -80,23 +81,24 @@ export class FiltersPanelComponent {
   searchBoxItemsTranslated: CommonEntry[] = [];
 
   get filters(): any {
-    return this.filtering.filters;
+    return this.logsContainer.filters;
   }
 
   get queryParameterNameChange(): Subject<any> {
-    return this.filtering.queryParameterNameChange;
+    return this.logsContainer.queryParameterNameChange;
   }
 
   get queryParameterAdd(): Subject<any> {
-    return this.filtering.queryParameterAdd;
+    return this.logsContainer.queryParameterAdd;
   }
 
   get captureSeconds(): number {
-    return this.filtering.captureSeconds;
+    return this.logsContainer.captureSeconds;
   }
 
   isFilterConditionDisplayed(key: string): boolean {
-    return filtersFormItemsMap[this.logsType].indexOf(key) > -1;
+    return this.logsContainer.filtersFormItemsMap[this.logsType].indexOf(key) > -1
+      && Boolean(this.filtersForm.controls[key]);
   }
 
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/components/log-context/log-context.component.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/log-context/log-context.component.spec.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/log-context/log-context.component.spec.ts
index 4e9bdc9..7bd87ad 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/log-context/log-context.component.spec.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/log-context/log-context.component.spec.ts
@@ -34,7 +34,6 @@ import {TranslationModules} from '@app/test-config.spec';
 import {ModalComponent} from '@app/components/modal/modal.component';
 import {LogsContainerService} from '@app/services/logs-container.service';
 import {HttpClientService} from '@app/services/http-client.service';
-import {FilteringService} from '@app/services/filtering.service';
 
 import {LogContextComponent} from './log-context.component';
 
@@ -90,8 +89,7 @@ describe('LogContextComponent', () => {
         {
           provide: HttpClientService,
           useValue: httpClient
-        },
-        FilteringService
+        }
       ],
       schemas: [CUSTOM_ELEMENTS_SCHEMA]
     })

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/components/logs-container/logs-container.component.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/logs-container/logs-container.component.spec.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/logs-container/logs-container.component.spec.ts
index 0a9418f..2bb8731 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/logs-container/logs-container.component.spec.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/logs-container/logs-container.component.spec.ts
@@ -33,7 +33,6 @@ import {HostsService, hosts} from '@app/services/storage/hosts.service';
 import {ServiceLogsTruncatedService, serviceLogsTruncated} from '@app/services/storage/service-logs-truncated.service';
 import {TabsService, tabs} from '@app/services/storage/tabs.service';
 import {HttpClientService} from '@app/services/http-client.service';
-import {FilteringService} from '@app/services/filtering.service';
 import {UtilsService} from '@app/services/utils.service';
 import {LogsContainerService} from '@app/services/logs-container.service';
 import {TabsComponent} from '@app/components/tabs/tabs.component';
@@ -92,7 +91,6 @@ describe('LogsContainerComponent', () => {
         HostsService,
         ServiceLogsTruncatedService,
         TabsService,
-        FilteringService,
         UtilsService,
         LogsContainerService
       ],

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/components/logs-container/logs-container.component.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/logs-container/logs-container.component.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/logs-container/logs-container.component.ts
index 21949f1..f8acd50 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/logs-container/logs-container.component.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/logs-container/logs-container.component.ts
@@ -22,7 +22,6 @@ import {Observable} from 'rxjs/Observable';
 import {Subject} from 'rxjs/Subject';
 import 'rxjs/add/operator/map';
 import 'rxjs/add/operator/takeUntil';
-import {FilteringService} from '@app/services/filtering.service';
 import {LogsContainerService} from '@app/services/logs-container.service';
 import {ServiceLogsHistogramDataService} from '@app/services/storage/service-logs-histogram-data.service';
 import {AppStateService} from '@app/services/storage/app-state.service';
@@ -43,9 +42,11 @@ import {ListItem} from '@app/classes/list-item';
 })
 export class LogsContainerComponent {
 
-  constructor(private serviceLogsHistogramStorage: ServiceLogsHistogramDataService, private appState: AppStateService, private tabsStorage: TabsService, private filtering: FilteringService, private logsContainer: LogsContainerService) {
+  constructor(
+    private serviceLogsHistogramStorage: ServiceLogsHistogramDataService, private appState: AppStateService,
+    private tabsStorage: TabsService, private logsContainer: LogsContainerService
+  ) {
     this.logsContainer.loadColumnsNames();
-    this.logsTypeChange.first().subscribe(() => this.logsContainer.loadLogs());
     appState.getParameter('activeLogsType').subscribe((value: string): void => {
       this.logsType = value;
       this.logsTypeChange.next();
@@ -75,11 +76,6 @@ export class LogsContainerComponent {
         this.displayedColumns = columns.filter((column: LogField): boolean => column.isAvailable && column.isDisplayed);
       });
     });
-    appState.getParameter('activeFiltersForm').subscribe((form: FormGroup): void => {
-      this.filtersFormChange.next();
-      form.valueChanges.takeUntil(this.filtersFormChange).subscribe(() => this.logsContainer.loadLogs());
-      this.filtersForm = form;
-    });
     serviceLogsHistogramStorage.getAll().subscribe((data: BarGraph[]): void => {
       this.histogramData = this.logsContainer.getHistogramData(data);
     });
@@ -88,12 +84,12 @@ export class LogsContainerComponent {
 
   tabs: Observable<Tab[]> = this.tabsStorage.getAll();
 
-  filtersForm: FormGroup;
+  get filtersForm(): FormGroup {
+    return this.logsContainer.filtersForm;
+  };
 
   private logsType: string;
 
-  private filtersFormChange: Subject<any> = new Subject();
-
   private logsTypeChange: Subject<any> = new Subject();
 
   get logsTypeMapObject(): any {
@@ -117,10 +113,10 @@ export class LogsContainerComponent {
   };
 
   get autoRefreshRemainingSeconds(): number {
-    return this.filtering.autoRefreshRemainingSeconds;
+    return this.logsContainer.autoRefreshRemainingSeconds;
   }
 
-  get autoRefreshMessageParams(): any {
+  get autoRefreshMessageParams(): object {
     return {
       remainingSeconds: this.autoRefreshRemainingSeconds
     };
@@ -133,7 +129,7 @@ export class LogsContainerComponent {
   get totalEventsFoundMessageParams(): object {
     return {
       totalCount: this.totalCount
-    }
+    };
   }
 
   isServiceLogContextView: boolean = false;
@@ -147,7 +143,7 @@ export class LogsContainerComponent {
   }
 
   setCustomTimeRange(startTime: number, endTime: number): void {
-    this.filtering.setCustomTimeRange(startTime, endTime);
+    this.logsContainer.setCustomTimeRange(startTime, endTime);
   }
 
   onSwitchTab(activeTab: Tab): void {

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/components/logs-list/logs-list.component.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/logs-list/logs-list.component.html b/ambari-logsearch/ambari-logsearch-web/src/app/components/logs-list/logs-list.component.html
index 10f4af1..7de0b96 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/logs-list/logs-list.component.html
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/logs-list/logs-list.component.html
@@ -17,8 +17,7 @@
 
 <form *ngIf="logs && logs.length" [formGroup]="filtersForm" class="row pull-right">
   <filter-dropdown [label]="filters.sorting.label" formControlName="sorting" [options]="filters.sorting.options"
-                   [defaultLabel]="filters.sorting.defaultLabel" [isRightAlign]="true"
-                   class="col-md-12"></filter-dropdown>
+                   [isRightAlign]="true" class="col-md-12"></filter-dropdown>
 </form>
 <div class="panel panel-default">
  <div class="panel-body">

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/components/logs-list/logs-list.component.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/logs-list/logs-list.component.spec.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/logs-list/logs-list.component.spec.ts
index 8ee4ca3..21c4f02 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/logs-list/logs-list.component.spec.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/logs-list/logs-list.component.spec.ts
@@ -28,8 +28,13 @@ import {AppStateService, appState} from '@app/services/storage/app-state.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 {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 {TabsService, tabs} from '@app/services/storage/tabs.service';
 import {HttpClientService} from '@app/services/http-client.service';
-import {FilteringService} from '@app/services/filtering.service';
+import {LogsContainerService} from '@app/services/logs-container.service';
 import {UtilsService} from '@app/services/utils.service';
 
 import {LogsListComponent} from './logs-list.component';
@@ -57,7 +62,12 @@ describe('LogsListComponent', () => {
           appState,
           clusters,
           components,
-          hosts
+          hosts,
+          auditLogsFields,
+          serviceLogsFields,
+          serviceLogsHistogramData,
+          serviceLogsTruncated,
+          tabs
         }),
         MomentModule,
         MomentTimezoneModule,
@@ -75,7 +85,12 @@ describe('LogsListComponent', () => {
         ClustersService,
         ComponentsService,
         HostsService,
-        FilteringService,
+        AuditLogsFieldsService,
+        ServiceLogsFieldsService,
+        ServiceLogsHistogramDataService,
+        ServiceLogsTruncatedService,
+        TabsService,
+        LogsContainerService,
         UtilsService
       ],
       schemas: [NO_ERRORS_SCHEMA]

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/components/logs-list/logs-list.component.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/logs-list/logs-list.component.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/logs-list/logs-list.component.ts
index 017bc82..3a56fca 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/logs-list/logs-list.component.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/logs-list/logs-list.component.ts
@@ -18,7 +18,7 @@
 import {Component, AfterViewInit, Input, ViewChild, ElementRef} from '@angular/core';
 import {FormGroup} from '@angular/forms';
 import 'rxjs/add/operator/map';
-import {FilteringService} from '@app/services/filtering.service';
+import {LogsContainerService} from '@app/services/logs-container.service';
 import {UtilsService} from '@app/services/utils.service';
 import {AuditLog} from '@app/classes/models/audit-log';
 import {ServiceLog} from '@app/classes/models/service-log';
@@ -31,7 +31,7 @@ import {LogField} from '@app/classes/models/log-field';
 })
 export class LogsListComponent implements AfterViewInit {
 
-  constructor(private filtering: FilteringService, private utils: UtilsService) {
+  constructor(private logsContainer: LogsContainerService, private utils: UtilsService) {
   }
 
   ngAfterViewInit() {
@@ -104,11 +104,11 @@ export class LogsListComponent implements AfterViewInit {
   readonly timeFormat: string = 'h:mm:ss A';
 
   get timeZone(): string {
-    return this.filtering.timeZone;
+    return this.logsContainer.timeZone;
   }
 
   get filters(): any {
-    return this.filtering.filters;
+    return this.logsContainer.filters;
   }
 
   isDifferentDates(dateA, dateB): boolean {
@@ -135,7 +135,7 @@ export class LogsListComponent implements AfterViewInit {
   }
 
   updateQuery(event: any) {
-    this.filtering.queryParameterAdd.next({
+    this.logsContainer.queryParameterAdd.next({
       name: this.messageFilterParameterName,
       value: this.selectedText,
       isExclude: event.value

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/components/menu-button/menu-button.component.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/menu-button/menu-button.component.spec.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/menu-button/menu-button.component.spec.ts
index 261e213..71bbf67 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/menu-button/menu-button.component.spec.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/menu-button/menu-button.component.spec.ts
@@ -33,7 +33,6 @@ import {ServiceLogsHistogramDataService, serviceLogsHistogramData} from '@app/se
 import {ServiceLogsTruncatedService, serviceLogsTruncated} from '@app/services/storage/service-logs-truncated.service';
 import {TabsService, tabs} from '@app/services/storage/tabs.service';
 import {ComponentActionsService} from '@app/services/component-actions.service';
-import {FilteringService} from '@app/services/filtering.service';
 import {HttpClientService} from '@app/services/http-client.service';
 import {LogsContainerService} from '@app/services/logs-container.service';
 
@@ -85,7 +84,6 @@ describe('MenuButtonComponent', () => {
         ServiceLogsTruncatedService,
         TabsService,
         ComponentActionsService,
-        FilteringService,
         {
           provide: HttpClientService,
           useValue: httpClient

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/components/menu-button/menu-button.component.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/menu-button/menu-button.component.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/menu-button/menu-button.component.ts
index 5932e1b..ca89935 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/menu-button/menu-button.component.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/menu-button/menu-button.component.ts
@@ -202,11 +202,11 @@ export class MenuButtonComponent {
    * @param {ListItem} options The selected item(s) from the dropdown list.
    */
   onDropdownItemChange(options: ListItem) {
-    this.updateValue(options);
+    this.updateSelection(options);
     !this.isMultipleChoice && this.closeDropdown();
   }
 
-  updateValue(options: ListItem) {
+  updateSelection(options: ListItem) {
     // TODO implement value change behaviour
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/components/pagination-controls/pagination-controls.component.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/pagination-controls/pagination-controls.component.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/pagination-controls/pagination-controls.component.ts
index 81676a9..5f85da7 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/pagination-controls/pagination-controls.component.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/pagination-controls/pagination-controls.component.ts
@@ -54,7 +54,9 @@ export class PaginationControlsComponent implements ControlValueAccessor {
     if (this.isValidValue(newValue)) { // this is the last validation check
       this.currentPage = newValue;
       this.currentPageChange.emit(newValue);
-      this.onChange(newValue);
+      if (this.onChange) {
+        this.onChange(newValue);
+      }
     } else {
       throw new Error(`Invalid value ${newValue}. The currentPage should be between 0 and ${this.pagesCount}.`);
     }
@@ -121,7 +123,8 @@ export class PaginationControlsComponent implements ControlValueAccessor {
     return this.pagesCount > 0 && this.value > 0;
   }
 
-  writeValue() {
+  writeValue(value: number) {
+    this.value = value;
   }
 
   registerOnChange(callback: any): void {

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/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 679a7e5..4be0a47 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
@@ -17,7 +17,7 @@
 
 <form class="pagination-form" [formGroup]="filtersForm">
   <filter-dropdown [label]="filterInstance.label" formControlName="pageSize" [options]="filterInstance.options"
-                   [defaultLabel]="filterInstance.defaultLabel" [isRightAlign]="true" isDropup="true"></filter-dropdown>
+                   [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/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/components/pagination/pagination.component.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/pagination/pagination.component.spec.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/pagination/pagination.component.spec.ts
index ff8675d..c820027 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/pagination/pagination.component.spec.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/pagination/pagination.component.spec.ts
@@ -39,7 +39,14 @@ describe('PaginationComponent', () => {
   beforeEach(() => {
     fixture = TestBed.createComponent(PaginationComponent);
     component = fixture.componentInstance;
-    component.filterInstance = {};
+    component.filterInstance = {
+      defaultSelection: [
+        {
+          label: '10',
+          value: '10'
+        }
+      ]
+    };
     component.filtersForm = new FormGroup({
       pageSize: new FormControl()
     });

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/components/pagination/pagination.component.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/pagination/pagination.component.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/pagination/pagination.component.ts
index cc5589f..890c2ee 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/pagination/pagination.component.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/pagination/pagination.component.ts
@@ -18,6 +18,8 @@
 
 import {Component, OnInit, Input} from '@angular/core';
 import {FormGroup} from '@angular/forms';
+import {ListItem} from '@app/classes/list-item';
+import {FilterCondition} from '@app/classes/filtering';
 
 @Component({
   selector: 'pagination',
@@ -27,9 +29,9 @@ import {FormGroup} from '@angular/forms';
 export class PaginationComponent implements OnInit {
 
   ngOnInit() {
-    this.setPageSizeFromString(this.filterInstance.defaultValue);
-    this.filtersForm.controls.pageSize.valueChanges.subscribe((value: string): void => {
-      this.setPageSizeFromString(value);
+    this.setPageSizeFromString(this.filterInstance.defaultSelection[0].value);
+    this.filtersForm.controls.pageSize.valueChanges.subscribe((selection: ListItem): void => {
+      this.setPageSizeFromString(selection[0].value);
     });
   }
 
@@ -37,7 +39,7 @@ export class PaginationComponent implements OnInit {
   filtersForm: FormGroup;
 
   @Input()
-  filterInstance: any;
+  filterInstance: FilterCondition;
 
   @Input()
   currentCount?: number;

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/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 5520310..18ff715 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
@@ -159,7 +159,7 @@ export class SearchBoxComponent implements OnInit, OnDestroy, ControlValueAccess
     this.isValueInput = true;
     this.currentValue = '';
     setTimeout(() => this.valueInput.focus(), 0);
-  }
+  };
 
   onParameterValueChange(event: KeyboardEvent): void {
     if (this.utils.isEnterPressed(event) && this.currentValue) {
@@ -187,7 +187,7 @@ export class SearchBoxComponent implements OnInit, OnDestroy, ControlValueAccess
       isExclude: options.isExclude
     });
     this.updateValue();
-  }
+  };
 
   removeParameter(event: MouseEvent, id: number): void {
     this.parameters = this.parameters.filter(parameter => parameter.id !== id);
@@ -196,10 +196,14 @@ export class SearchBoxComponent implements OnInit, OnDestroy, ControlValueAccess
   }
 
   updateValue() {
-    this.onChange(this.parameters);
+    if (this.onChange) {
+      this.onChange(this.parameters);
+    }
   }
 
-  writeValue() {
+  writeValue(parameters: any [] = []) {
+    this.parameters = parameters;
+    this.updateValue();
   }
 
   registerOnChange(callback: any): void {

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/components/time-range-picker/time-range-picker.component.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/time-range-picker/time-range-picker.component.html b/ambari-logsearch/ambari-logsearch-web/src/app/components/time-range-picker/time-range-picker.component.html
index 973db61..621f995 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/time-range-picker/time-range-picker.component.html
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/time-range-picker/time-range-picker.component.html
@@ -16,7 +16,8 @@
 -->
 
 <button class="btn btn-link dropdown-toggle" data-toggle="dropdown">
-  {{selectedLabel | translate}} <span class="caret"></span>
+  <span *ngIf="selection">{{selection.label | translate}}</span>
+  <span class="caret"></span>
 </button>
 <div class="dropdown-menu row col-md-12">
   <div class="col-md-4" (click)="$event.stopPropagation()">

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/components/time-range-picker/time-range-picker.component.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/time-range-picker/time-range-picker.component.spec.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/time-range-picker/time-range-picker.component.spec.ts
index 7612cc3..43e4bd5 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/time-range-picker/time-range-picker.component.spec.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/time-range-picker/time-range-picker.component.spec.ts
@@ -25,8 +25,15 @@ import {AppStateService, appState} from '@app/services/storage/app-state.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 {AuditLogsService, auditLogs} from '@app/services/storage/audit-logs.service';
+import {AuditLogsFieldsService, auditLogsFields} from '@app/services/storage/audit-logs-fields.service';
+import {ServiceLogsService, serviceLogs} from '@app/services/storage/service-logs.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 {TabsService, tabs} from '@app/services/storage/tabs.service';
 import {HttpClientService} from '@app/services/http-client.service';
-import {FilteringService} from '@app/services/filtering.service';
+import {LogsContainerService} from '@app/services/logs-container.service';
 
 import {TimeRangePickerComponent} from './time-range-picker.component';
 
@@ -51,7 +58,14 @@ describe('TimeRangePickerComponent', () => {
           appState,
           clusters,
           components,
-          hosts
+          hosts,
+          auditLogs,
+          auditLogsFields,
+          serviceLogs,
+          serviceLogsFields,
+          serviceLogsHistogramData,
+          serviceLogsTruncated,
+          tabs
         }),
         ...TranslationModules
       ],
@@ -60,12 +74,19 @@ describe('TimeRangePickerComponent', () => {
           provide: HttpClientService,
           useValue: httpClient
         },
-        FilteringService,
+        LogsContainerService,
         AppSettingsService,
         AppStateService,
         ClustersService,
         ComponentsService,
-        HostsService
+        HostsService,
+        AuditLogsService,
+        AuditLogsFieldsService,
+        ServiceLogsService,
+        ServiceLogsFieldsService,
+        ServiceLogsHistogramDataService,
+        ServiceLogsTruncatedService,
+        TabsService
       ],
       schemas: [CUSTOM_ELEMENTS_SCHEMA]
     })

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/components/time-range-picker/time-range-picker.component.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/time-range-picker/time-range-picker.component.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/time-range-picker/time-range-picker.component.ts
index af4933a..cacabc3 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/time-range-picker/time-range-picker.component.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/time-range-picker/time-range-picker.component.ts
@@ -16,10 +16,10 @@
  * limitations under the License.
  */
 
-import {Component, OnInit, Input, forwardRef} from '@angular/core';
+import {Component, forwardRef} from '@angular/core';
 import {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';
 import {Moment} from 'moment';
-import {FilteringService} from '@app/services/filtering.service';
+import {LogsContainerService} from '@app/services/logs-container.service';
 import {ListItem} from '@app/classes/list-item';
 import {TimeUnitListItem} from '@app/classes/filtering';
 
@@ -35,20 +35,11 @@ import {TimeUnitListItem} from '@app/classes/filtering';
     }
   ]
 })
-export class TimeRangePickerComponent implements OnInit, ControlValueAccessor {
+export class TimeRangePickerComponent implements ControlValueAccessor {
 
-  constructor(private filtering: FilteringService) {
+  constructor(private logsContainer: LogsContainerService) {
   }
 
-  ngOnInit() {
-    this.selectedLabel = this.defaultLabel;
-  }
-
-  @Input()
-  defaultLabel?: string;
-
-  selectedLabel: string;
-
   startTime: Moment;
 
   endTime: Moment;
@@ -56,18 +47,20 @@ export class TimeRangePickerComponent implements OnInit, ControlValueAccessor {
   private onChange: (fn: any) => void;
 
   get quickRanges(): (ListItem | TimeUnitListItem[])[] {
-    return this.filtering.filters.timeRange.options;
+    return this.logsContainer.filters.timeRange.options;
   }
 
-  private timeRange?: any;
+  private timeRange?: TimeUnitListItem;
 
-  get value(): any {
+  get selection(): TimeUnitListItem {
     return this.timeRange;
   }
 
-  set value(newValue: any) {
+  set selection(newValue: TimeUnitListItem) {
     this.timeRange = newValue;
-    this.onChange(newValue);
+    if (this.onChange) {
+      this.onChange(newValue);
+    }
   }
 
   setStartTime(timeObject: Moment): void {
@@ -79,20 +72,22 @@ export class TimeRangePickerComponent implements OnInit, ControlValueAccessor {
   }
 
   setTimeRange(value: any, label: string) {
-    this.value = value;
-    this.selectedLabel = label;
+    this.selection = {label, value};
   }
 
   setCustomTimeRange() {
-    this.value = {
-      type: 'CUSTOM',
-      start: this.startTime,
-      end: this.endTime
+    this.selection = {
+      label: 'filter.timeRange.custom',
+      value: {
+        type: 'CUSTOM',
+        start: this.startTime,
+        end: this.endTime
+      }
     };
-    this.selectedLabel = 'filter.timeRange.custom';
   }
 
-  writeValue() {
+  writeValue(selection: TimeUnitListItem) {
+    this.selection = selection;
   }
 
   registerOnChange(callback: any): void {

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/components/timezone-picker/timezone-picker.component.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/timezone-picker/timezone-picker.component.spec.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/timezone-picker/timezone-picker.component.spec.ts
index 53afc47..0e4c8a8 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/timezone-picker/timezone-picker.component.spec.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/timezone-picker/timezone-picker.component.spec.ts
@@ -32,7 +32,6 @@ import {ServiceLogsHistogramDataService, serviceLogsHistogramData} from '@app/se
 import {ServiceLogsTruncatedService, serviceLogsTruncated} from '@app/services/storage/service-logs-truncated.service';
 import {TabsService, tabs} from '@app/services/storage/tabs.service';
 import {ComponentActionsService} from '@app/services/component-actions.service';
-import {FilteringService} from '@app/services/filtering.service';
 import {HttpClientService} from '@app/services/http-client.service';
 import {LogsContainerService} from '@app/services/logs-container.service';
 import {TimeZoneAbbrPipe} from '@app/pipes/timezone-abbr.pipe';
@@ -90,7 +89,6 @@ describe('TimeZonePickerComponent', () => {
         ServiceLogsTruncatedService,
         TabsService,
         ComponentActionsService,
-        FilteringService,
         {
           provide: HttpClientService,
           useValue: httpClient

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/services/component-actions.service.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/services/component-actions.service.spec.ts b/ambari-logsearch/ambari-logsearch-web/src/app/services/component-actions.service.spec.ts
index e6a02c0..6f54e65 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/services/component-actions.service.spec.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/services/component-actions.service.spec.ts
@@ -30,7 +30,6 @@ import {ServiceLogsFieldsService, serviceLogsFields} from '@app/services/storage
 import {ServiceLogsHistogramDataService, serviceLogsHistogramData} from '@app/services/storage/service-logs-histogram-data.service';
 import {ServiceLogsTruncatedService, serviceLogsTruncated} from '@app/services/storage/service-logs-truncated.service';
 import {TabsService, tabs} from '@app/services/storage/tabs.service';
-import {FilteringService} from '@app/services/filtering.service';
 import {HttpClientService} from '@app/services/http-client.service';
 import {LogsContainerService} from '@app/services/logs-container.service';
 
@@ -78,7 +77,6 @@ describe('ComponentActionsService', () => {
         ServiceLogsHistogramDataService,
         ServiceLogsTruncatedService,
         TabsService,
-        FilteringService,
         {
           provide: HttpClientService,
           useValue: httpClient

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/services/component-actions.service.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/services/component-actions.service.ts b/ambari-logsearch/ambari-logsearch-web/src/app/services/component-actions.service.ts
index c483cd8..73fc94c 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/services/component-actions.service.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/services/component-actions.service.ts
@@ -20,15 +20,17 @@ import {Injectable} from '@angular/core';
 import {AppSettingsService} from '@app/services/storage/app-settings.service';
 import {TabsService} from '@app/services/storage/tabs.service';
 import {CollectionModelService} from '@app/classes/models/store';
-import {FilteringService} from '@app/services/filtering.service';
 import {LogsContainerService} from '@app/services/logs-container.service';
 import {ServiceLog} from '@app/classes/models/service-log';
-import {getFiltersForm} from '@app/classes/filtering';
+import {ListItem} from '@app/classes/list-item';
 
 @Injectable()
 export class ComponentActionsService {
 
-  constructor(private appSettings: AppSettingsService, private tabsStorage: TabsService, private filtering: FilteringService, private logsContainer: LogsContainerService) {
+  constructor(
+    private appSettings: AppSettingsService, private tabsStorage: TabsService,
+    private logsContainer: LogsContainerService
+  ) {
   }
 
   //TODO implement actions
@@ -81,7 +83,6 @@ export class ComponentActionsService {
     const tab = {
       id: log.id,
       type: 'serviceLogs',
-      isActive: true,
       isCloseable: true,
       label: `${log.host} >> ${log.type}`,
       appState: {
@@ -92,7 +93,14 @@ export class ComponentActionsService {
           host_name: log.host,
           component_name: log.type
         },
-        activeFiltersForm: getFiltersForm('serviceLogs')
+        activeFilters: Object.assign(this.logsContainer.getFiltersData('serviceLogs'), {
+          components: this.logsContainer.filters.components.options.find((option: ListItem): boolean => {
+            return option.value === log.type;
+          }),
+          hosts: this.logsContainer.filters.hosts.options.find((option: ListItem): boolean => {
+            return option.value === log.host;
+          })
+        })
       }
     };
     this.tabsStorage.addInstance(tab);
@@ -104,11 +112,11 @@ export class ComponentActionsService {
   }
 
   startCapture(): void {
-    this.filtering.startCaptureTimer();
+    this.logsContainer.startCaptureTimer();
   }
 
   stopCapture(): void {
-    this.filtering.stopCaptureTimer();
+    this.logsContainer.stopCaptureTimer();
   }
 
   setTimeZone(timeZone: string): void {
@@ -121,7 +129,7 @@ export class ComponentActionsService {
     }));
   }
 
-  proceedWithExclude = (item: string): void => this.filtering.queryParameterNameChange.next({
+  proceedWithExclude = (item: string): void => this.logsContainer.queryParameterNameChange.next({
     item: item,
     isExclude: true
   });

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/services/component-generator.service.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/services/component-generator.service.spec.ts b/ambari-logsearch/ambari-logsearch-web/src/app/services/component-generator.service.spec.ts
index 5dc38b4..a161190 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/services/component-generator.service.spec.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/services/component-generator.service.spec.ts
@@ -32,7 +32,6 @@ import {ServiceLogsTruncatedService, serviceLogsTruncated} from '@app/services/s
 import {TabsService, tabs} from '@app/services/storage/tabs.service';
 import {LogsContainerService} from '@app/services/logs-container.service';
 import {HttpClientService} from '@app/services/http-client.service';
-import {FilteringService} from '@app/services/filtering.service';
 
 import {ComponentGeneratorService} from './component-generator.service';
 
@@ -70,7 +69,6 @@ describe('ComponentGeneratorService', () => {
           provide: HttpClientService,
           useValue: httpClient
         },
-        FilteringService,
         HostsService,
         AuditLogsService,
         ServiceLogsService,


[33/50] [abbrv] ambari git commit: AMBARI-22418. Make Ambari configuration API consistent with existing API. (rlevas)

Posted by am...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/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
new file mode 100644
index 0000000..ea9cf4f
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationResourceProvider.java
@@ -0,0 +1,476 @@
+/*
+ * 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.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.controller.spi.NoSuchParentResourceException;
+import org.apache.ambari.server.controller.spi.NoSuchResourceException;
+import org.apache.ambari.server.controller.spi.Predicate;
+import org.apache.ambari.server.controller.spi.Request;
+import org.apache.ambari.server.controller.spi.RequestStatus;
+import org.apache.ambari.server.controller.spi.Resource;
+import org.apache.ambari.server.controller.spi.ResourceAlreadyExistsException;
+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";
+
+  static final String CONFIGURATION_CATEGORY_PROPERTY_ID = PropertyHelper.getPropertyId(RESOURCE_KEY, "category");
+  static final String CONFIGURATION_PROPERTIES_PROPERTY_ID = PropertyHelper.getPropertyId(RESOURCE_KEY, "properties");
+  static final String CONFIGURATION_COMPONENT_NAME_PROPERTY_ID = PropertyHelper.getPropertyId(RESOURCE_KEY, "component_name");
+  static final String CONFIGURATION_SERVICE_NAME_PROPERTY_ID = PropertyHelper.getPropertyId(RESOURCE_KEY, "service_name");
+
+  private static final Set<String> PROPERTIES;
+
+  private static final Map<Resource.Type, String> PK_PROPERTY_MAP;
+
+  private static final Set<String> PK_PROPERTY_IDS;
+
+  static {
+    Set<String> set = new HashSet<>();
+    set.add(CONFIGURATION_SERVICE_NAME_PROPERTY_ID);
+    set.add(CONFIGURATION_COMPONENT_NAME_PROPERTY_ID);
+    set.add(CONFIGURATION_CATEGORY_PROPERTY_ID);
+    set.add(CONFIGURATION_PROPERTIES_PROPERTY_ID);
+
+    PROPERTIES = Collections.unmodifiableSet(set);
+
+    Map<Resource.Type, String> map = new HashMap<>();
+    map.put(Resource.Type.RootService, CONFIGURATION_SERVICE_NAME_PROPERTY_ID);
+    map.put(Resource.Type.RootServiceComponent, CONFIGURATION_COMPONENT_NAME_PROPERTY_ID);
+    map.put(Resource.Type.RootServiceComponentConfiguration, CONFIGURATION_CATEGORY_PROPERTY_ID);
+
+    PK_PROPERTY_MAP = Collections.unmodifiableMap(map);
+    PK_PROPERTY_IDS = Collections.unmodifiableSet(new HashSet<>(PK_PROPERTY_MAP.values()));
+  }
+
+  @Inject
+  private AmbariConfigurationDAO ambariConfigurationDAO;
+
+  @Inject
+  private AmbariEventPublisher publisher;
+
+  public RootServiceComponentConfigurationResourceProvider() {
+    super(PROPERTIES, PK_PROPERTY_MAP);
+
+    Set<RoleAuthorization> authorizations = EnumSet.of(RoleAuthorization.AMBARI_MANAGE_CONFIGURATION);
+    setRequiredCreateAuthorizations(authorizations);
+    setRequiredDeleteAuthorizations(authorizations);
+    setRequiredUpdateAuthorizations(authorizations);
+    setRequiredGetAuthorizations(authorizations);
+  }
+
+  @Override
+  protected Set<String> getPKPropertyIds() {
+    return PK_PROPERTY_IDS;
+  }
+
+  @Override
+  public RequestStatus createResourcesAuthorized(Request request)
+      throws SystemException, UnsupportedPropertyException, ResourceAlreadyExistsException, NoSuchParentResourceException {
+
+    createOrAddProperties(null, null, null, request.getProperties(), true);
+
+    return getRequestStatus(null);
+  }
+
+  @Override
+  protected Set<Resource> getResourcesAuthorized(Request request, Predicate predicate) throws SystemException,
+      UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
+
+    return getResources(new Command<Set<Resource>>() {
+      @Override
+      public Set<Resource> invoke() throws AmbariException {
+        Set<Resource> resources = new HashSet<>();
+        Set<String> requestedIds = getRequestPropertyIds(request, predicate);
+
+        if (CollectionUtils.isEmpty(requestedIds)) {
+          requestedIds = PROPERTIES;
+        }
+
+        if (predicate == null) {
+          Set<Resource> _resources;
+          try {
+            _resources = getConfigurationResources(requestedIds, null);
+          } catch (NoSuchResourceException e) {
+            throw new AmbariException(e.getMessage(), e);
+          }
+
+          if (!CollectionUtils.isEmpty(_resources)) {
+            resources.addAll(_resources);
+          }
+        } else {
+          for (Map<String, Object> propertyMap : getPropertyMaps(predicate)) {
+            Set<Resource> _resources;
+            try {
+              _resources = getConfigurationResources(requestedIds, propertyMap);
+            } catch (NoSuchResourceException e) {
+              throw new AmbariException(e.getMessage(), e);
+            }
+
+            if (!CollectionUtils.isEmpty(_resources)) {
+              resources.addAll(_resources);
+            }
+          }
+        }
+
+        return resources;
+      }
+    });
+  }
+
+
+  @Override
+  protected RequestStatus deleteResourcesAuthorized(Request request, Predicate predicate) throws SystemException,
+      UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
+
+    String serviceName = (String) PredicateHelper.getProperties(predicate).get(CONFIGURATION_SERVICE_NAME_PROPERTY_ID);
+    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);
+    if (handler != null) {
+      handler.removeConfiguration(categoryName);
+    } else {
+      throw new SystemException(String.format("Configurations may not be updated for the %s component of the root service %s", componentName, serviceName));
+    }
+
+    return getRequestStatus(null);
+  }
+
+  @Override
+  protected RequestStatus updateResourcesAuthorized(Request request, Predicate predicate)
+      throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
+
+    String serviceName = (String) PredicateHelper.getProperties(predicate).get(CONFIGURATION_SERVICE_NAME_PROPERTY_ID);
+    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);
+
+    return getRequestStatus(null);
+  }
+
+  private Resource toResource(String serviceName, String componentName, String categoryName, Map<String, String> properties, Set<String> requestedIds) {
+    Resource resource = new ResourceImpl(Resource.Type.RootServiceComponentConfiguration);
+    setResourceProperty(resource, CONFIGURATION_SERVICE_NAME_PROPERTY_ID, serviceName, requestedIds);
+    setResourceProperty(resource, CONFIGURATION_COMPONENT_NAME_PROPERTY_ID, componentName, requestedIds);
+    setResourceProperty(resource, CONFIGURATION_CATEGORY_PROPERTY_ID, categoryName, requestedIds);
+    setResourceProperty(resource, CONFIGURATION_PROPERTIES_PROPERTY_ID, properties, requestedIds);
+    return resource;
+  }
+
+  /**
+   * Retrieves groups of properties from the request data and create or updates them as needed.
+   * <p>
+   * Each group of properties is expected to have a category (<code>AmbariConfiguration/category</code>)
+   * 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).
+   *
+   * @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 removePropertiesIfNotSpecified <code>true</code> to remove existing properties that have not been specifed in the request;
+   *                                       <code>false</code> append or update the existing set of properties with values from the request
+   * @throws SystemException if an error occurs saving the configuration data
+   */
+  private void createOrAddProperties(String defaultServiceName, String defaultComponentName, String defaultCategoryName,
+                                     Set<Map<String, Object>> requestProperties, boolean removePropertiesIfNotSpecified)
+      throws SystemException {
+    // 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);
+
+        ConfigurationHandler handler = getConfigurationHandler(requestDetails.serviceName, requestDetails.componentName);
+
+        if (handler != null) {
+          handler.updateCategory(requestDetails.categoryName, requestDetails.properties, removePropertiesIfNotSpecified);
+        } else {
+          throw new SystemException(String.format("Configurations may not be updated for the %s component of the root service, %s", requestDetails.serviceName, requestDetails.componentName));
+        }
+      }
+    }
+  }
+
+  /**
+   * 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
+   * @param defaultComponentName the default component name to use if one is not found in the map of properties
+   * @param defaultCategoryName  the default category name to use if one is not found in the map of properties
+   * @param resourceProperties   a map of properties from a request item   @return a map of category names to maps of name/value pairs
+   * @throws SystemException if an issue with the data is determined
+   */
+  private RequestDetails parseProperties(String defaultServiceName, String defaultComponentName, String defaultCategoryName, Map<String, Object> resourceProperties) throws SystemException {
+    String serviceName = defaultServiceName;
+    String componentName = defaultComponentName;
+    String categoryName = defaultCategoryName;
+    Map<String, String> properties = new HashMap<>();
+
+    for (Map.Entry<String, Object> entry : resourceProperties.entrySet()) {
+      String propertyName = entry.getKey();
+
+      if (CONFIGURATION_CATEGORY_PROPERTY_ID.equals(propertyName)) {
+        if (entry.getValue() instanceof String) {
+          categoryName = (String) entry.getValue();
+        }
+      } else if (CONFIGURATION_COMPONENT_NAME_PROPERTY_ID.equals(propertyName)) {
+        if (entry.getValue() instanceof String) {
+          componentName = (String) entry.getValue();
+        }
+      } else if (CONFIGURATION_SERVICE_NAME_PROPERTY_ID.equals(propertyName)) {
+        if (entry.getValue() instanceof String) {
+          serviceName = (String) entry.getValue();
+        }
+      } else {
+        String propertyCategory = PropertyHelper.getPropertyCategory(entry.getKey());
+        if ((propertyCategory != null) && propertyCategory.equals(CONFIGURATION_PROPERTIES_PROPERTY_ID)) {
+          String name = PropertyHelper.getPropertyName(entry.getKey());
+          Object value = entry.getValue();
+          properties.put(name, (value == null) ? null : value.toString());
+        }
+      }
+    }
+
+    if (StringUtils.isEmpty(serviceName)) {
+      throw new SystemException("The service name must be set");
+    }
+
+    if (StringUtils.isEmpty(componentName)) {
+      throw new SystemException("The component name must be set");
+    }
+
+    if (StringUtils.isEmpty(categoryName)) {
+      throw new SystemException("The configuration category must be set");
+    }
+
+    if (properties.isEmpty()) {
+      throw new SystemException("The configuration properties must be set");
+    }
+
+    return new RequestDetails(serviceName, componentName, categoryName, properties);
+  }
+
+  /**
+   * Retrieves the requested configration resources
+   *
+   * @param requestedIds the requested properties ids
+   * @param propertyMap  the request properties
+   * @return a set of resources built from the found data
+   * @throws NoSuchResourceException if the requested resource was not found
+   */
+  private Set<Resource> getConfigurationResources(Set<String> requestedIds, Map<String, Object> propertyMap) throws NoSuchResourceException {
+    Set<Resource> resources = new HashSet<>();
+
+    String serviceName = getStringProperty(propertyMap, CONFIGURATION_SERVICE_NAME_PROPERTY_ID);
+    String componentName = getStringProperty(propertyMap, CONFIGURATION_COMPONENT_NAME_PROPERTY_ID);
+
+    ConfigurationHandler handler = getConfigurationHandler(serviceName, componentName);
+
+    if (handler != null) {
+      String categoryName = getStringProperty(propertyMap, CONFIGURATION_CATEGORY_PROPERTY_ID);
+      Map<String, Map<String, String>> configurations = handler.getConfigurations(categoryName);
+
+      if (configurations != null) {
+        for (Map.Entry<String, Map<String, String>> entry : configurations.entrySet()) {
+          resources.add(toResource(serviceName, componentName, entry.getKey(), entry.getValue(), requestedIds));
+        }
+      }
+    }
+
+    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;
+
+    if (propertyMap != null) {
+      Object o = propertyMap.get(propertyId);
+      if (o instanceof String) {
+        value = (String) o;
+      }
+    }
+
+    return value;
+  }
+
+  /**
+   * 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 {
+    final String serviceName;
+    final String componentName;
+    final String categoryName;
+    final Map<String, String> properties;
+
+    private RequestDetails(String serviceName, String componentName, String categoryName, Map<String, String> properties) {
+      this.serviceName = serviceName;
+      this.componentName = componentName;
+      this.categoryName = categoryName;
+      this.properties = properties;
+    }
+  }
+}
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentPropertyProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentPropertyProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentPropertyProvider.java
index 433c1fa..b5bbc94 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentPropertyProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentPropertyProvider.java
@@ -29,7 +29,7 @@ import java.util.Set;
 
 import javax.crypto.Cipher;
 
-import org.apache.ambari.server.controller.RootServiceResponseFactory;
+import org.apache.ambari.server.controller.RootComponent;
 import org.apache.ambari.server.controller.spi.Predicate;
 import org.apache.ambari.server.controller.spi.PropertyProvider;
 import org.apache.ambari.server.controller.spi.Request;
@@ -126,7 +126,7 @@ public class RootServiceComponentPropertyProvider extends BaseProvider implement
 
     for (Resource resource : resources) {
       // If this resource represents the AMBARI_SERVER component, handle it's specific properties...
-      if (RootServiceResponseFactory.Components.AMBARI_SERVER.name().equals(resource.getPropertyValue(RootServiceComponentResourceProvider.COMPONENT_NAME_PROPERTY_ID))) {
+      if (RootComponent.AMBARI_SERVER.name().equals(resource.getPropertyValue(RootServiceComponentResourceProvider.COMPONENT_NAME_PROPERTY_ID))) {
         // Attempt to fill in the cipher details only if explicitly asked for.
         if (requestedIds.contains(JCE_POLICY_PROPERTY_ID) || requestedIds.contains(CIPHER_PROPERTIES_PROPERTY_ID)) {
           setCipherDetails(resource, requestedIds);

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentResourceProvider.java
index 3925aeb..dfca00e 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentResourceProvider.java
@@ -25,9 +25,9 @@ import java.util.Set;
 
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.controller.AmbariManagementController;
+import org.apache.ambari.server.controller.RootComponent;
 import org.apache.ambari.server.controller.RootServiceComponentRequest;
 import org.apache.ambari.server.controller.RootServiceComponentResponse;
-import org.apache.ambari.server.controller.RootServiceResponseFactory.Components;
 import org.apache.ambari.server.controller.spi.NoSuchParentResourceException;
 import org.apache.ambari.server.controller.spi.NoSuchResourceException;
 import org.apache.ambari.server.controller.spi.Predicate;
@@ -99,7 +99,7 @@ public class RootServiceComponentResourceProvider extends ReadOnlyResourceProvid
       setResourceProperty(resource, PROPERTIES_PROPERTY_ID, response.getProperties(), requestedIds);
       setResourceProperty(resource, COMPONENT_VERSION_PROPERTY_ID, response.getComponentVersion(), requestedIds);
       
-      if (Components.AMBARI_SERVER.name().equals(response.getComponentName())) {
+      if (RootComponent.AMBARI_SERVER.name().equals(response.getComponentName())) {
         setResourceProperty(resource, SERVER_CLOCK_PROPERTY_ID, response.getServerClock(), requestedIds);
       }      
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java
index 7835373..90e0315 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java
@@ -110,6 +110,7 @@ public interface Resource {
     TaskAttempt,
     RootService,
     RootServiceComponent,
+    RootServiceComponentConfiguration,
     RootServiceHostComponent,
     View,
     ViewURL,
@@ -160,8 +161,7 @@ public interface Resource {
     VersionDefinition,
     ClusterKerberosDescriptor,
     LoggingQuery,
-    RemoteCluster,
-    AmbariConfiguration;
+    RemoteCluster;
 
     /**
      * Get the {@link Type} that corresponds to this InternalType.
@@ -232,6 +232,7 @@ public interface Resource {
     public static final Type TaskAttempt = InternalType.TaskAttempt.getType();
     public static final Type RootService = InternalType.RootService.getType();
     public static final Type RootServiceComponent = InternalType.RootServiceComponent.getType();
+    public static final Type RootServiceComponentConfiguration = InternalType.RootServiceComponentConfiguration.getType();
     public static final Type RootServiceHostComponent = InternalType.RootServiceHostComponent.getType();
     public static final Type View = InternalType.View.getType();
     public static final Type ViewURL = InternalType.ViewURL.getType();
@@ -283,7 +284,6 @@ public interface Resource {
     public static final Type ClusterKerberosDescriptor = InternalType.ClusterKerberosDescriptor.getType();
     public static final Type LoggingQuery = InternalType.LoggingQuery.getType();
     public static final Type RemoteCluster = InternalType.RemoteCluster.getType();
-    public static final Type AmbariConfiguration = InternalType.AmbariConfiguration.getType();
 
 
     /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertReceivedListener.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertReceivedListener.java b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertReceivedListener.java
index 266c7e8..7198814 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertReceivedListener.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertReceivedListener.java
@@ -26,8 +26,8 @@ import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.EagerSingleton;
 import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.controller.MaintenanceStateHelper;
-import org.apache.ambari.server.controller.RootServiceResponseFactory.Components;
-import org.apache.ambari.server.controller.RootServiceResponseFactory.Services;
+import org.apache.ambari.server.controller.RootComponent;
+import org.apache.ambari.server.controller.RootService;
 import org.apache.ambari.server.events.AlertEvent;
 import org.apache.ambari.server.events.AlertReceivedEvent;
 import org.apache.ambari.server.events.AlertStateChangeEvent;
@@ -434,9 +434,9 @@ public class AlertReceivedListener {
     String hostName = alert.getHostName();
 
     // AMBARI/AMBARI_SERVER is always a valid service/component combination
-    String ambariServiceName = Services.AMBARI.name();
-    String ambariServerComponentName = Components.AMBARI_SERVER.name();
-    String ambariAgentComponentName = Components.AMBARI_AGENT.name();
+    String ambariServiceName = RootService.AMBARI.name();
+    String ambariServerComponentName = RootComponent.AMBARI_SERVER.name();
+    String ambariAgentComponentName = RootComponent.AMBARI_AGENT.name();
     if (ambariServiceName.equals(serviceName) && ambariServerComponentName.equals(componentName)) {
       return true;
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertStateChangedListener.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertStateChangedListener.java b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertStateChangedListener.java
index d5dc530..8701b6d 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertStateChangedListener.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertStateChangedListener.java
@@ -24,7 +24,7 @@ import java.util.UUID;
 
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.EagerSingleton;
-import org.apache.ambari.server.controller.RootServiceResponseFactory.Services;
+import org.apache.ambari.server.controller.RootService;
 import org.apache.ambari.server.events.AlertStateChangeEvent;
 import org.apache.ambari.server.events.publishers.AlertEventPublisher;
 import org.apache.ambari.server.orm.dao.AlertDispatchDAO;
@@ -67,7 +67,7 @@ import com.google.inject.Singleton;
  * <ul>
  * <li>If {@link AlertTargetEntity#isEnabled()} is {@code false}
  * <li>If the cluster is upgrading or the upgrade is suspended, only
- * {@link Services#AMBARI} alerts will be dispatched.
+ * {@link RootService#AMBARI} alerts will be dispatched.
  * </ul>
  */
 @Singleton
@@ -230,7 +230,7 @@ public class AlertStateChangedListener {
       if (null != cluster.getUpgradeInProgress()) {
         // only send AMBARI alerts if in an upgrade
         String serviceName = definition.getServiceName();
-        if (!StringUtils.equals(serviceName, Services.AMBARI.name())) {
+        if (!StringUtils.equals(serviceName, RootService.AMBARI.name())) {
           LOG.debug(
               "Skipping alert notifications for {} because the cluster is upgrading",
               definition.getDefinitionName(), target);

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/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 0c1ec0a..6c466ba 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
@@ -33,7 +33,7 @@ public class AmbariLdapConfiguration {
 
   private static final Logger LOGGER = LoggerFactory.getLogger(AmbariLdapConfiguration.class);
 
-  private final Map<String, Object> configurationMap;
+  private final Map<String, String> configurationMap;
 
   private Object configValue(AmbariLdapConfigKeys ambariLdapConfigKeys) {
     Object value = null;
@@ -45,13 +45,13 @@ public class AmbariLdapConfiguration {
     return value;
   }
 
-  public void setValueFor(AmbariLdapConfigKeys ambariLdapConfigKeys, Object value) {
+  public void setValueFor(AmbariLdapConfigKeys ambariLdapConfigKeys, String value) {
     configurationMap.put(ambariLdapConfigKeys.key(), value);
   }
 
   // intentionally package private, instances to be created through the factory
   @Inject
-  AmbariLdapConfiguration(@Assisted Map<String, Object> configuration) {
+  AmbariLdapConfiguration(@Assisted Map<String, String> configuration) {
     this.configurationMap = configuration;
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/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
index 2b9f24b..aafd204 100644
--- 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
@@ -30,5 +30,5 @@ public interface AmbariLdapConfigurationFactory {
    * @param configuration a map where keys are the configuration properties and values are the configuration values
    * @return an AmbariLdapConfiguration instance
    */
-  AmbariLdapConfiguration createLdapConfiguration(Map<String, Object> configuration);
+  AmbariLdapConfiguration createLdapConfiguration(Map<String, String> configuration);
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/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 b32d1ed..ac9c1bc 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
@@ -84,7 +84,7 @@ public class AmbariLdapConfigurationProvider implements Provider<AmbariLdapConfi
     configEntities = ambariConfigurationDAOProvider.get().findByCategory("ldap-configuration");
 
     if (configEntities != null) {
-      Map<String, Object> properties = toProperties(configEntities);
+      Map<String, String> properties = toProperties(configEntities);
       instance = ldapConfigurationFactory.createLdapConfiguration(properties);
     }
 
@@ -93,8 +93,8 @@ public class AmbariLdapConfigurationProvider implements Provider<AmbariLdapConfi
     return instance;
   }
 
-  private Map<String, Object> toProperties(List<AmbariConfigurationEntity> configEntities) {
-    Map<String, Object> map = new HashMap<>();
+  private Map<String, String> toProperties(List<AmbariConfigurationEntity> configEntities) {
+    Map<String, String> map = new HashMap<>();
 
     for (AmbariConfigurationEntity entity : configEntities) {
       map.put(entity.getPropertyName(), entity.getPropertyValue());

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/main/java/org/apache/ambari/server/metadata/AmbariServiceAlertDefinitions.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/metadata/AmbariServiceAlertDefinitions.java b/ambari-server/src/main/java/org/apache/ambari/server/metadata/AmbariServiceAlertDefinitions.java
index 1e20571..d6b0c99 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/metadata/AmbariServiceAlertDefinitions.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/metadata/AmbariServiceAlertDefinitions.java
@@ -23,8 +23,8 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
-import org.apache.ambari.server.controller.RootServiceResponseFactory.Components;
-import org.apache.ambari.server.controller.RootServiceResponseFactory.Services;
+import org.apache.ambari.server.controller.RootComponent;
+import org.apache.ambari.server.controller.RootService;
 import org.apache.ambari.server.state.alert.AlertDefinition;
 import org.apache.ambari.server.state.alert.AlertDefinitionFactory;
 import org.slf4j.Logger;
@@ -36,7 +36,7 @@ import com.google.inject.Singleton;
 /**
  * The {@link AmbariServiceAlertDefinitions} class is used to represent the
  * alerts defined in {@code alerts.json} which are for
- * {@link Components#AMBARI_AGENT} and {@link Components#AMBARI_SERVER}. These
+ * {@link RootComponent#AMBARI_AGENT} and {@link RootComponent#AMBARI_SERVER}. These
  * alerts are bound to the host and are not part of a cluster or hadoop service.
  */
 @Singleton
@@ -67,7 +67,7 @@ public class AmbariServiceAlertDefinitions {
    * Gets all of the {@link AlertDefinition}s that exist on the path for all
    * agent hosts.
    *
-   * @return the alerts with {@link Components#AMBARI_AGENT} as the component
+   * @return the alerts with {@link RootComponent#AMBARI_AGENT} as the component
    *         and {@code AMBARI} as the service.
    */
   public List<AlertDefinition> getAgentDefinitions() {
@@ -75,15 +75,15 @@ public class AmbariServiceAlertDefinitions {
       return m_agentDefinitions;
     }
 
-    m_agentDefinitions = getDefinitions(Components.AMBARI_AGENT);
+    m_agentDefinitions = getDefinitions(RootComponent.AMBARI_AGENT);
     return m_agentDefinitions;
   }
 
   /**
    * Gets all of the {@link AlertDefinition}s that exist on the path for
-   * {@link Components#AMBARI_SERVER}.
+   * {@link RootComponent#AMBARI_SERVER}.
    *
-   * @return the alerts with {@link Components#AMBARI_SERVER} as the component
+   * @return the alerts with {@link RootComponent#AMBARI_SERVER} as the component
    *         and {@code AMBARI} as the service.
    */
   public List<AlertDefinition> getServerDefinitions() {
@@ -91,7 +91,7 @@ public class AmbariServiceAlertDefinitions {
       return m_serverDefinitions;
     }
 
-    m_serverDefinitions = getDefinitions(Components.AMBARI_SERVER);
+    m_serverDefinitions = getDefinitions(RootComponent.AMBARI_SERVER);
     return m_serverDefinitions;
   }
 
@@ -104,7 +104,7 @@ public class AmbariServiceAlertDefinitions {
    * @return the alert definitions for {@code AMBARI} service for the given
    *         component.
    */
-  private List<AlertDefinition> getDefinitions(Components component) {
+  private List<AlertDefinition> getDefinitions(RootComponent component) {
     List<AlertDefinition> definitions = new ArrayList<>();
 
     InputStream inputStream = ClassLoader.getSystemResourceAsStream("alerts.json");
@@ -112,7 +112,7 @@ public class AmbariServiceAlertDefinitions {
 
     try {
       Set<AlertDefinition> allDefinitions = m_factory.getAlertDefinitions(
-          reader, Services.AMBARI.name());
+          reader, RootService.AMBARI.name());
 
       String componentName = component.name();
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDefinitionDAO.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDefinitionDAO.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDefinitionDAO.java
index cda03f3..424910b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDefinitionDAO.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDefinitionDAO.java
@@ -25,7 +25,8 @@ import javax.persistence.EntityManager;
 import javax.persistence.TypedQuery;
 
 import org.apache.ambari.server.AmbariException;
-import org.apache.ambari.server.controller.RootServiceResponseFactory;
+import org.apache.ambari.server.controller.RootComponent;
+import org.apache.ambari.server.controller.RootService;
 import org.apache.ambari.server.controller.internal.AlertDefinitionResourceProvider;
 import org.apache.ambari.server.events.AlertDefinitionChangedEvent;
 import org.apache.ambari.server.events.AlertDefinitionDeleteEvent;
@@ -300,10 +301,10 @@ public class AlertDefinitionDAO {
     query.setParameter("clusterId", clusterId);
 
     query.setParameter("serviceName",
-        RootServiceResponseFactory.Services.AMBARI.name());
+        RootService.AMBARI.name());
 
     query.setParameter("componentName",
-        RootServiceResponseFactory.Components.AMBARI_AGENT.name());
+        RootComponent.AMBARI_AGENT.name());
 
     return daoUtils.selectList(query);
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDispatchDAO.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDispatchDAO.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDispatchDAO.java
index 5c6a82f..1746048 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDispatchDAO.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDispatchDAO.java
@@ -33,7 +33,7 @@ import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.api.query.JpaPredicateVisitor;
 import org.apache.ambari.server.api.query.JpaSortBuilder;
 import org.apache.ambari.server.controller.AlertNoticeRequest;
-import org.apache.ambari.server.controller.RootServiceResponseFactory.Services;
+import org.apache.ambari.server.controller.RootService;
 import org.apache.ambari.server.controller.spi.Predicate;
 import org.apache.ambari.server.controller.utilities.PredicateHelper;
 import org.apache.ambari.server.orm.RequiresSession;
@@ -452,7 +452,7 @@ public class AlertDispatchDAO {
 
     // AMBARI is a special service that we let through, otherwise we need to
     // verify that the service exists before we create the default group
-    String ambariServiceName = Services.AMBARI.name();
+    String ambariServiceName = RootService.AMBARI.name();
     if (!ambariServiceName.equals(serviceName)) {
       Cluster cluster = m_clusters.get().getClusterById(clusterId);
       Map<String, Service> services = cluster.getServices();

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinitionHash.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinitionHash.java b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinitionHash.java
index 15f7048..a1c7249 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinitionHash.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinitionHash.java
@@ -37,8 +37,8 @@ import org.apache.ambari.server.ClusterNotFoundException;
 import org.apache.ambari.server.agent.ActionQueue;
 import org.apache.ambari.server.agent.AgentCommand.AgentCommandType;
 import org.apache.ambari.server.agent.AlertDefinitionCommand;
-import org.apache.ambari.server.controller.RootServiceResponseFactory.Components;
-import org.apache.ambari.server.controller.RootServiceResponseFactory.Services;
+import org.apache.ambari.server.controller.RootComponent;
+import org.apache.ambari.server.controller.RootService;
 import org.apache.ambari.server.orm.dao.AlertDefinitionDAO;
 import org.apache.ambari.server.orm.entities.AlertDefinitionEntity;
 import org.apache.ambari.server.state.Cluster;
@@ -375,8 +375,8 @@ public class AlertDefinitionHash {
       return affectedHosts;
     }
 
-    String ambariServiceName = Services.AMBARI.name();
-    String agentComponentName = Components.AMBARI_AGENT.name();
+    String ambariServiceName = RootService.AMBARI.name();
+    String agentComponentName = RootComponent.AMBARI_AGENT.name();
 
     // intercept host agent alerts; they affect all hosts
     if (ambariServiceName.equals(definitionServiceName)

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
index 9c0b0ca..8f5e4f4 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
@@ -57,7 +57,7 @@ import org.apache.ambari.server.controller.AmbariSessionManager;
 import org.apache.ambari.server.controller.ClusterResponse;
 import org.apache.ambari.server.controller.ConfigurationResponse;
 import org.apache.ambari.server.controller.MaintenanceStateHelper;
-import org.apache.ambari.server.controller.RootServiceResponseFactory.Services;
+import org.apache.ambari.server.controller.RootService;
 import org.apache.ambari.server.controller.ServiceConfigVersionResponse;
 import org.apache.ambari.server.events.AmbariEvent.AmbariEventType;
 import org.apache.ambari.server.events.ClusterConfigChangedEvent;
@@ -2050,7 +2050,7 @@ public class ClusterImpl implements Cluster {
       // server-side events either don't have a service name or are AMBARI;
       // either way they are not handled by this method since it expects a
       // real service and component
-      if (StringUtils.isBlank(serviceName) || Services.AMBARI.name().equals(serviceName)) {
+      if (StringUtils.isBlank(serviceName) || RootService.AMBARI.name().equals(serviceName)) {
         continue;
       }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/main/java/org/apache/ambari/server/state/services/AmbariServerAlertService.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/services/AmbariServerAlertService.java b/ambari-server/src/main/java/org/apache/ambari/server/state/services/AmbariServerAlertService.java
index d3237a9..305f693 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/services/AmbariServerAlertService.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/services/AmbariServerAlertService.java
@@ -29,7 +29,7 @@ import java.util.concurrent.TimeUnit;
 
 import org.apache.ambari.server.AmbariService;
 import org.apache.ambari.server.alerts.AlertRunnable;
-import org.apache.ambari.server.controller.RootServiceResponseFactory.Components;
+import org.apache.ambari.server.controller.RootComponent;
 import org.apache.ambari.server.orm.dao.AlertDefinitionDAO;
 import org.apache.ambari.server.orm.entities.AlertDefinitionEntity;
 import org.apache.ambari.server.state.Cluster;
@@ -133,7 +133,7 @@ public class AmbariServerAlertService extends AbstractScheduledService {
   /**
    * {@inheritDoc}
    * <p/>
-   * Compares all known {@link Components#AMBARI_SERVER} alerts with those that
+   * Compares all known {@link RootComponent#AMBARI_SERVER} alerts with those that
    * are scheduled. If any are not scheduled or have their intervals changed,
    * then reschedule those.
    */

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/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 959db15..2afbf8a 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
@@ -301,9 +301,9 @@ public class StackAdvisorCommandTest {
       "items",
       list(
         map(
-          "AmbariConfiguration",
+          "Configuration",
           map(
-            "data", list(ldapConfigData)
+            "properties", ldapConfigData
           )
         )
       )
@@ -380,7 +380,7 @@ public class StackAdvisorCommandTest {
       "items",
       list(
         map(
-          "AmbariConfiguration",
+          "Configuration",
           map(
             "data",
             list(ldapConfigData, ldapConfigData)
@@ -417,7 +417,7 @@ public class StackAdvisorCommandTest {
       .build();
 
     Map<String, Object> ldapConfig = map(
-      "AmbariConfiguration",
+      "Configuration",
       map(
         "data",
         list(

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/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 7094caa..d95dcef 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
@@ -8248,13 +8248,13 @@ public class AmbariManagementControllerTest {
 
     RootServiceRequest request = new RootServiceRequest(null);
     Set<RootServiceResponse> responses = controller.getRootServices(Collections.singleton(request));
-    Assert.assertEquals(RootServiceResponseFactory.Services.values().length, responses.size());
+    Assert.assertEquals(RootService.values().length, responses.size());
 
-    RootServiceRequest requestWithParams = new RootServiceRequest(RootServiceResponseFactory.Services.AMBARI.toString());
+    RootServiceRequest requestWithParams = new RootServiceRequest(RootService.AMBARI.toString());
     Set<RootServiceResponse> responsesWithParams = controller.getRootServices(Collections.singleton(requestWithParams));
     Assert.assertEquals(1, responsesWithParams.size());
     for (RootServiceResponse responseWithParams: responsesWithParams) {
-      Assert.assertEquals(responseWithParams.getServiceName(), RootServiceResponseFactory.Services.AMBARI.toString());
+      Assert.assertEquals(responseWithParams.getServiceName(), RootService.AMBARI.toString());
     }
 
     RootServiceRequest invalidRequest = new RootServiceRequest(NON_EXT_VALUE);
@@ -8268,18 +8268,18 @@ public class AmbariManagementControllerTest {
   @Test
   public void testGetRootServiceComponents() throws Exception {
 
-    RootServiceComponentRequest request = new RootServiceComponentRequest(RootServiceResponseFactory.Services.AMBARI.toString(), null);
+    RootServiceComponentRequest request = new RootServiceComponentRequest(RootService.AMBARI.toString(), null);
     Set<RootServiceComponentResponse> responses = controller.getRootServiceComponents(Collections.singleton(request));
-    Assert.assertEquals(RootServiceResponseFactory.Services.AMBARI.getComponents().length, responses.size());
+    Assert.assertEquals(RootService.AMBARI.getComponents().length, responses.size());
 
     RootServiceComponentRequest requestWithParams = new RootServiceComponentRequest(
-        RootServiceResponseFactory.Services.AMBARI.toString(),
-        RootServiceResponseFactory.Services.AMBARI.getComponents()[0].toString());
+        RootService.AMBARI.toString(),
+        RootService.AMBARI.getComponents()[0].toString());
 
     Set<RootServiceComponentResponse> responsesWithParams = controller.getRootServiceComponents(Collections.singleton(requestWithParams));
     Assert.assertEquals(1, responsesWithParams.size());
     for (RootServiceComponentResponse responseWithParams: responsesWithParams) {
-      Assert.assertEquals(responseWithParams.getComponentName(), RootServiceResponseFactory.Services.AMBARI.getComponents()[0].toString());
+      Assert.assertEquals(responseWithParams.getComponentName(), RootService.AMBARI.getComponents()[0].toString());
     }
 
     RootServiceComponentRequest invalidRequest = new RootServiceComponentRequest(NON_EXT_VALUE, NON_EXT_VALUE);

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/test/java/org/apache/ambari/server/controller/RootServiceResponseFactoryTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/RootServiceResponseFactoryTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/RootServiceResponseFactoryTest.java
index c27ef7e..e194115 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/RootServiceResponseFactoryTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/RootServiceResponseFactoryTest.java
@@ -29,7 +29,6 @@ import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.H2DatabaseCleaner;
 import org.apache.ambari.server.ObjectNotFoundException;
 import org.apache.ambari.server.api.services.AmbariMetaInfo;
-import org.apache.ambari.server.controller.RootServiceResponseFactory.Components;
 import org.apache.ambari.server.orm.GuiceJpaInitializer;
 import org.apache.ambari.server.orm.InMemoryDefaultTestModule;
 import org.junit.After;
@@ -66,13 +65,13 @@ public class RootServiceResponseFactoryTest {
     // Request a null service name
     RootServiceRequest request = new RootServiceRequest(null);
     Set<RootServiceResponse> rootServices = responseFactory.getRootServices(request);
-    assertEquals(RootServiceResponseFactory.Services.values().length,
+    assertEquals(RootService.values().length,
         rootServices.size());
 
     // null request
     request = null;
     rootServices = responseFactory.getRootServices(request);
-    assertEquals(RootServiceResponseFactory.Services.values().length,
+    assertEquals(RootService.values().length,
         rootServices.size());
 
     // Request nonexistent service
@@ -85,12 +84,12 @@ public class RootServiceResponseFactoryTest {
 
     // Request existent service
     request = new RootServiceRequest(
-        RootServiceResponseFactory.Services.AMBARI.name());
+        RootService.AMBARI.name());
 
     rootServices = responseFactory.getRootServices(request);
     assertEquals(1, rootServices.size());
     assertTrue(rootServices.contains(new RootServiceResponse(
-        RootServiceResponseFactory.Services.AMBARI.name())));
+        RootService.AMBARI.name())));
   }
 
   @Test
@@ -106,7 +105,7 @@ public class RootServiceResponseFactoryTest {
       assertTrue(e instanceof ObjectNotFoundException);
     }
 
-    RootServiceResponseFactory.Components ambariServerComponent = RootServiceResponseFactory.Components.AMBARI_SERVER;
+    RootComponent ambariServerComponent = RootComponent.AMBARI_SERVER;
 
     // Request null service name, not-null component name
     request = new RootServiceComponentRequest(null, ambariServerComponent.name());
@@ -118,18 +117,18 @@ public class RootServiceResponseFactoryTest {
     }
 
     // Request existent service name, null component name
-    String serviceName = RootServiceResponseFactory.Services.AMBARI.name();
+    String serviceName = RootService.AMBARI.name();
     request = new RootServiceComponentRequest(serviceName, null);
 
     rootServiceComponents = responseFactory.getRootServiceComponents(request);
     assertEquals(
-        RootServiceResponseFactory.Services.AMBARI.getComponents().length,
+        RootService.AMBARI.getComponents().length,
         rootServiceComponents.size());
 
     String ambariVersion = ambariMetaInfo.getServerVersion();
 
-    for (int i = 0; i < RootServiceResponseFactory.Services.AMBARI.getComponents().length; i++) {
-      Components component = RootServiceResponseFactory.Services.AMBARI.getComponents()[i];
+    for (int i = 0; i < RootService.AMBARI.getComponents().length; i++) {
+      RootComponent component = RootService.AMBARI.getComponents()[i];
 
       if (component.name().equals(ambariServerComponent.name())) {
         for (RootServiceComponentResponse response : rootServiceComponents) {
@@ -148,14 +147,14 @@ public class RootServiceResponseFactoryTest {
 
     // Request existent service name, existent component name
     request = new RootServiceComponentRequest(
-        RootServiceResponseFactory.Services.AMBARI.name(),
-        RootServiceResponseFactory.Services.AMBARI.getComponents()[0].name());
+        RootService.AMBARI.name(),
+        RootService.AMBARI.getComponents()[0].name());
 
     rootServiceComponents = responseFactory.getRootServiceComponents(request);
     assertEquals(1, rootServiceComponents.size());
     for (RootServiceComponentResponse response : rootServiceComponents) {
       if (response.getComponentName().equals(
-          RootServiceResponseFactory.Services.AMBARI.getComponents()[0].name())) {
+          RootService.AMBARI.getComponents()[0].name())) {
         assertEquals(ambariVersion, response.getComponentVersion());
         assertEquals(2, response.getProperties().size());
         assertTrue(response.getProperties().containsKey("jdk_location"));
@@ -166,7 +165,7 @@ public class RootServiceResponseFactoryTest {
     // Request existent service name, and component, not belongs to requested
     // service
     request = new RootServiceComponentRequest(
-        RootServiceResponseFactory.Services.AMBARI.name(), "XXX");
+        RootService.AMBARI.name(), "XXX");
     
     try {
       rootServiceComponents = responseFactory.getRootServiceComponents(request);

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProviderTest.java
deleted file mode 100644
index a2ecb27..0000000
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProviderTest.java
+++ /dev/null
@@ -1,377 +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.controller.internal;
-
-import static org.apache.ambari.server.controller.internal.AmbariConfigurationResourceProvider.AMBARI_CONFIGURATION_CATEGORY_PROPERTY_ID;
-import static org.apache.ambari.server.controller.internal.AmbariConfigurationResourceProvider.AMBARI_CONFIGURATION_PROPERTIES_PROPERTY_ID;
-import static org.easymock.EasyMock.anyObject;
-import static org.easymock.EasyMock.capture;
-import static org.easymock.EasyMock.eq;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.expectLastCall;
-import static org.easymock.EasyMock.newCapture;
-
-import java.util.ArrayList;
-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 javax.persistence.EntityManager;
-
-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.utilities.PredicateBuilder;
-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.TestAuthenticationFactory;
-import org.apache.ambari.server.security.authorization.AuthorizationException;
-import org.easymock.Capture;
-import org.easymock.EasyMockSupport;
-import org.junit.After;
-import org.junit.Test;
-import org.springframework.security.core.Authentication;
-import org.springframework.security.core.context.SecurityContextHolder;
-
-import com.google.inject.AbstractModule;
-import com.google.inject.Guice;
-import com.google.inject.Injector;
-
-public class AmbariConfigurationResourceProviderTest extends EasyMockSupport {
-
-  private static final String CATEGORY_NAME_1 = "test-category-1";
-  private static final String CATEGORY_NAME_2 = "test-category-2";
-
-  @After
-  public void clearAuthentication() {
-    SecurityContextHolder.getContext().setAuthentication(null);
-  }
-
-  @Test
-  public void testCreateResources_Administrator() throws Exception {
-    testCreateResources(TestAuthenticationFactory.createAdministrator());
-  }
-
-  @Test(expected = AuthorizationException.class)
-  public void testCreateResources_ClusterAdministrator() throws Exception {
-    testCreateResources(TestAuthenticationFactory.createClusterAdministrator());
-  }
-
-  @Test(expected = AuthorizationException.class)
-  public void testCreateResources_ClusterOperator() throws Exception {
-    testCreateResources(TestAuthenticationFactory.createClusterOperator());
-  }
-
-  @Test(expected = AuthorizationException.class)
-  public void testCreateResources_ServiceAdministrator() throws Exception {
-    testCreateResources(TestAuthenticationFactory.createServiceAdministrator());
-  }
-
-  @Test(expected = AuthorizationException.class)
-  public void testCreateResources_ServiceOperator() throws Exception {
-    testCreateResources(TestAuthenticationFactory.createServiceOperator());
-  }
-
-  private void testCreateResources(Authentication authentication) throws Exception {
-    Injector injector = createInjector();
-
-    ResourceProvider resourceProvider = injector.getInstance(AmbariConfigurationResourceProvider.class);
-
-    Set<Map<String, Object>> propertySets = new HashSet<>();
-
-    Map<String, String> properties1 = new HashMap<>();
-    properties1.put("property1a", "value1");
-    properties1.put("property2a", "value2");
-    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));
-
-    Request request = createMock(Request.class);
-    expect(request.getProperties()).andReturn(propertySets).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();
-
-    AmbariEventPublisher publisher = injector.getInstance(AmbariEventPublisher.class);
-    publisher.publish(anyObject(AmbariConfigurationChangedEvent.class));
-    expectLastCall().times(2);
-
-    replayAll();
-
-    SecurityContextHolder.getContext().setAuthentication(authentication);
-
-    resourceProvider.createResources(request);
-
-    verifyAll();
-
-    validateCapturedProperties(properties1, capturedProperties1);
-    validateCapturedProperties(properties2, capturedProperties2);
-  }
-
-  @Test
-  public void testDeleteResources_Administrator() throws Exception {
-    testDeleteResources(TestAuthenticationFactory.createAdministrator());
-  }
-
-  @Test(expected = AuthorizationException.class)
-  public void testDeleteResources_ClusterAdministrator() throws Exception {
-    testDeleteResources(TestAuthenticationFactory.createClusterAdministrator());
-  }
-
-  @Test(expected = AuthorizationException.class)
-  public void testDeleteResources_ClusterOperator() throws Exception {
-    testDeleteResources(TestAuthenticationFactory.createClusterOperator());
-  }
-
-  @Test(expected = AuthorizationException.class)
-  public void testDeleteResources_ServiceAdministrator() throws Exception {
-    testDeleteResources(TestAuthenticationFactory.createServiceAdministrator());
-  }
-
-  @Test(expected = AuthorizationException.class)
-  public void testDeleteResources_ServiceOperator() throws Exception {
-    testDeleteResources(TestAuthenticationFactory.createServiceOperator());
-  }
-
-  private void testDeleteResources(Authentication authentication) throws Exception {
-    Injector injector = createInjector();
-
-    ResourceProvider resourceProvider = injector.getInstance(AmbariConfigurationResourceProvider.class);
-
-    Predicate predicate = new PredicateBuilder()
-        .property(AMBARI_CONFIGURATION_CATEGORY_PROPERTY_ID)
-        .equals(CATEGORY_NAME_1)
-        .toPredicate();
-
-    Request request = createMock(Request.class);
-
-    AmbariConfigurationDAO dao = injector.getInstance(AmbariConfigurationDAO.class);
-    expect(dao.removeByCategory(CATEGORY_NAME_1)).andReturn(1).once();
-
-    AmbariEventPublisher publisher = injector.getInstance(AmbariEventPublisher.class);
-    publisher.publish(anyObject(AmbariConfigurationChangedEvent.class));
-    expectLastCall().once();
-
-    replayAll();
-
-    SecurityContextHolder.getContext().setAuthentication(authentication);
-
-    resourceProvider.deleteResources(request, predicate);
-
-    verifyAll();
-  }
-
-  @Test
-  public void testGetResources_Administrator() throws Exception {
-    testGetResources(TestAuthenticationFactory.createAdministrator());
-  }
-
-  @Test(expected = AuthorizationException.class)
-  public void testGetResources_ClusterAdministrator() throws Exception {
-    testGetResources(TestAuthenticationFactory.createClusterAdministrator());
-  }
-
-  @Test(expected = AuthorizationException.class)
-  public void testGetResources_ClusterOperator() throws Exception {
-    testGetResources(TestAuthenticationFactory.createClusterOperator());
-  }
-
-  @Test(expected = AuthorizationException.class)
-  public void testGetResources_ServiceAdministrator() throws Exception {
-    testGetResources(TestAuthenticationFactory.createServiceAdministrator());
-  }
-
-  @Test(expected = AuthorizationException.class)
-  public void testGetResources_ServiceOperator() throws Exception {
-    testGetResources(TestAuthenticationFactory.createServiceOperator());
-  }
-
-  private void testGetResources(Authentication authentication) throws Exception {
-    Injector injector = createInjector();
-
-    ResourceProvider resourceProvider = injector.getInstance(AmbariConfigurationResourceProvider.class);
-
-    Predicate predicate = new PredicateBuilder()
-        .property(AMBARI_CONFIGURATION_CATEGORY_PROPERTY_ID)
-        .equals(CATEGORY_NAME_1)
-        .toPredicate();
-
-    Request request = createMock(Request.class);
-    expect(request.getPropertyIds()).andReturn(null).anyTimes();
-
-    Map<String, String> properties = new HashMap<>();
-    properties.put("property1a", "value1");
-    properties.put("property2a", "value2");
-
-    AmbariConfigurationDAO dao = injector.getInstance(AmbariConfigurationDAO.class);
-    expect(dao.findByCategory(CATEGORY_NAME_1)).andReturn(createEntities(CATEGORY_NAME_1, properties)).once();
-
-    replayAll();
-
-    SecurityContextHolder.getContext().setAuthentication(authentication);
-
-    Set<Resource> response = resourceProvider.getResources(request, predicate);
-
-    verifyAll();
-
-    junit.framework.Assert.assertNotNull(response);
-    junit.framework.Assert.assertEquals(1, response.size());
-
-    Resource resource = response.iterator().next();
-    junit.framework.Assert.assertEquals(Resource.Type.AmbariConfiguration, resource.getType());
-
-    Map<String, Map<String, Object>> propertiesMap = resource.getPropertiesMap();
-    junit.framework.Assert.assertEquals(2, propertiesMap.size());
-
-    junit.framework.Assert.assertEquals(CATEGORY_NAME_1, propertiesMap.get(Resource.Type.AmbariConfiguration.name()).get("category"));
-
-    Map<String, Object> retrievedProperties = propertiesMap.get(Resource.Type.AmbariConfiguration.name() + "/properties");
-    junit.framework.Assert.assertEquals(2, retrievedProperties.size());
-
-    for (Map.Entry<String, String> entry : properties.entrySet()) {
-      junit.framework.Assert.assertEquals(entry.getValue(), retrievedProperties.get(entry.getKey()));
-    }
-  }
-
-  @Test
-  public void testUpdateResources_Administrator() throws Exception {
-    testUpdateResources(TestAuthenticationFactory.createAdministrator());
-  }
-
-  @Test(expected = AuthorizationException.class)
-  public void testUpdateResources_ClusterAdministrator() throws Exception {
-    testUpdateResources(TestAuthenticationFactory.createClusterAdministrator());
-  }
-
-  @Test(expected = AuthorizationException.class)
-  public void testUpdateResources_ClusterOperator() throws Exception {
-    testUpdateResources(TestAuthenticationFactory.createClusterOperator());
-  }
-
-  @Test(expected = AuthorizationException.class)
-  public void testUpdateResources_ServiceAdministrator() throws Exception {
-    testUpdateResources(TestAuthenticationFactory.createServiceAdministrator());
-  }
-
-  @Test(expected = AuthorizationException.class)
-  public void testUpdateResources_ServiceOperator() throws Exception {
-    testUpdateResources(TestAuthenticationFactory.createServiceOperator());
-  }
-
-  private void testUpdateResources(Authentication authentication) throws Exception {
-    Injector injector = createInjector();
-
-    ResourceProvider resourceProvider = injector.getInstance(AmbariConfigurationResourceProvider.class);
-
-    Predicate predicate = new PredicateBuilder()
-        .property(AMBARI_CONFIGURATION_CATEGORY_PROPERTY_ID)
-        .equals(CATEGORY_NAME_1)
-        .toPredicate();
-
-    Set<Map<String, Object>> propertySets = new HashSet<>();
-
-    Map<String, String> properties1 = new HashMap<>();
-    properties1.put("property1a", "value1");
-    properties1.put("property2a", "value2");
-    propertySets.add(toRequestProperties(CATEGORY_NAME_1, properties1));
-
-    Request request = createMock(Request.class);
-    expect(request.getProperties()).andReturn(propertySets).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();
-
-    AmbariEventPublisher publisher = injector.getInstance(AmbariEventPublisher.class);
-    publisher.publish(anyObject(AmbariConfigurationChangedEvent.class));
-    expectLastCall().times(1);
-
-    replayAll();
-
-    SecurityContextHolder.getContext().setAuthentication(authentication);
-
-    resourceProvider.updateResources(request, predicate);
-
-    verifyAll();
-
-    validateCapturedProperties(properties1, capturedProperties1);
-  }
-
-  private List<AmbariConfigurationEntity> createEntities(String categoryName, Map<String, String> properties) {
-    List<AmbariConfigurationEntity> entities = new ArrayList<>();
-
-    for (Map.Entry<String, String> property : properties.entrySet()) {
-      AmbariConfigurationEntity entity = new AmbariConfigurationEntity();
-      entity.setCategoryName(categoryName);
-      entity.setPropertyName(property.getKey());
-      entity.setPropertyValue(property.getValue());
-      entities.add(entity);
-    }
-
-    return entities;
-  }
-
-  private Map<String, Object> toRequestProperties(String categoryName1, Map<String, String> properties) {
-    Map<String, Object> requestProperties = new HashMap<>();
-    requestProperties.put(AMBARI_CONFIGURATION_CATEGORY_PROPERTY_ID, categoryName1);
-    for (Map.Entry<String, String> entry : properties.entrySet()) {
-      requestProperties.put(AMBARI_CONFIGURATION_PROPERTIES_PROPERTY_ID + "/" + entry.getKey(), entry.getValue());
-    }
-    return requestProperties;
-  }
-
-  private void validateCapturedProperties(Map<String, String> expectedProperties, Capture<Map<String, String>> capturedProperties) {
-    junit.framework.Assert.assertTrue(capturedProperties.hasCaptured());
-
-    Map<String, String> properties = capturedProperties.getValue();
-    junit.framework.Assert.assertNotNull(properties);
-
-    // Convert the Map to a TreeMap to help with comparisons
-    expectedProperties = new TreeMap<>(expectedProperties);
-    properties = new TreeMap<>(properties);
-    junit.framework.Assert.assertEquals(expectedProperties, properties);
-  }
-
-  private Injector createInjector() throws Exception {
-    return Guice.createInjector(new AbstractModule() {
-      @Override
-      protected void configure() {
-        bind(EntityManager.class).toInstance(createNiceMock(EntityManager.class));
-        bind(AmbariConfigurationDAO.class).toInstance(createMock(AmbariConfigurationDAO.class));
-        bind(AmbariEventPublisher.class).toInstance(createMock(AmbariEventPublisher.class));
-      }
-    });
-  }
-}
\ No newline at end of file


[14/50] [abbrv] ambari git commit: AMBARI-22417. Ambari checks fail with FIPS mode is activated on the OS (rlevas)

Posted by am...@apache.org.
AMBARI-22417. Ambari checks fail with FIPS mode is activated on the OS (rlevas)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 5122671d0076612f4b39f4ae51c2ad627544d768
Parents: 7c4a7e4
Author: Robert Levas <rl...@hortonworks.com>
Authored: Mon Nov 13 05:20:25 2017 -0500
Committer: Robert Levas <rl...@hortonworks.com>
Committed: Mon Nov 13 05:20:25 2017 -0500

----------------------------------------------------------------------
 .../libraries/functions/curl_krb_request.py     | 22 +++++++-------------
 1 file changed, 7 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/5122671d/ambari-common/src/main/python/resource_management/libraries/functions/curl_krb_request.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/curl_krb_request.py b/ambari-common/src/main/python/resource_management/libraries/functions/curl_krb_request.py
index 95e8625..55395ce 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/curl_krb_request.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/curl_krb_request.py
@@ -21,28 +21,20 @@ Ambari Agent
 """
 
 __all__ = ["curl_krb_request"]
+import hashlib
 import logging
 import os
+
 import time
 
+from get_kinit_path import get_kinit_path
+from get_klist_path import get_klist_path
 from resource_management.core import global_lock
 from resource_management.core import shell
 from resource_management.core.exceptions import Fail
-from get_kinit_path import get_kinit_path
-from get_klist_path import get_klist_path
 from resource_management.libraries.functions.get_user_call_output import get_user_call_output
 
-# hashlib is supplied as of Python 2.5 as the replacement interface for md5
-# and other secure hashes.  In 2.6, md5 is deprecated.  Import hashlib if
-# available, avoiding a deprecation warning under 2.6.  Import md5 otherwise,
-# preserving 2.4 compatibility.
-try:
-  import hashlib
-  _md5 = hashlib.md5
-except ImportError:
-  import md5
-  _md5 = md5.new
-
+HASH_ALGORITHM = hashlib.sha224
 CONNECTION_TIMEOUT_DEFAULT = 10
 MAX_TIMEOUT_DEFAULT = CONNECTION_TIMEOUT_DEFAULT + 2
 
@@ -103,10 +95,10 @@ def curl_krb_request(tmp_dir, keytab, principal, url, cache_file_prefix,
   is_kinit_required = False
 
   # Create the kerberos credentials cache (ccache) file and set it in the environment to use
-  # when executing curl. Use the md5 hash of the combination of the principal and keytab file
+  # when executing curl. Use a hash of the combination of the principal and keytab file
   # to generate a (relatively) unique cache filename so that we can use it as needed. Scope
   # this file by user in order to prevent sharing of cache files by multiple users.
-  ccache_file_name = _md5("{0}|{1}".format(principal, keytab)).hexdigest()
+  ccache_file_name = HASH_ALGORITHM("{0}|{1}".format(principal, keytab)).hexdigest()
 
   curl_krb_cache_path = os.path.join(tmp_dir, "curl_krb_cache")
   if not os.path.exists(curl_krb_cache_path):


[29/50] [abbrv] ambari git commit: AMBARI-22398. Upstart is not able to stop the ambari-agent - fix unit test

Posted by am...@apache.org.
AMBARI-22398. Upstart is not able to stop the ambari-agent - fix unit test


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: a4e7bf379dc2392253bd9bad3ab42ab9c2d9552e
Parents: 2b917f4
Author: Attila Doroszlai <ad...@hortonworks.com>
Authored: Wed Nov 15 12:56:23 2017 +0100
Committer: Attila Doroszlai <ad...@hortonworks.com>
Committed: Wed Nov 15 12:56:23 2017 +0100

----------------------------------------------------------------------
 ambari-agent/src/test/python/ambari_agent/TestAmbariAgent.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a4e7bf37/ambari-agent/src/test/python/ambari_agent/TestAmbariAgent.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/test/python/ambari_agent/TestAmbariAgent.py b/ambari-agent/src/test/python/ambari_agent/TestAmbariAgent.py
index 8ff192a..56a73fc 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestAmbariAgent.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestAmbariAgent.py
@@ -35,8 +35,7 @@ class TestAmbariAgent(unittest.TestCase):
   @patch("os.path.isfile")
   @patch("os.remove")
   @patch("os.killpg")
-  @patch("os.setpgrp")
-  def test_main(self, os_setpgrp_mock, os_killpg_mock, os_remove_mock,
+  def test_main(self, os_killpg_mock, os_remove_mock,
                 os_path_isfile_mock, subprocess_popen_mock):
     facter1 = MagicMock()
     facter2 = MagicMock()
@@ -49,7 +48,6 @@ class TestAmbariAgent(unittest.TestCase):
     sys.argv[0] = "test data"
     AmbariAgent.main()
 
-    self.assertTrue(os_setpgrp_mock.called)
     self.assertTrue(subprocess_popen_mock.called)
     self.assertTrue(subprocess_popen_mock.call_count == 2)
     self.assertTrue(facter1.communicate.called)


[38/50] [abbrv] ambari git commit: AMBARI-22444 - Add Native Libraries To Tez Tarball (part2) (jonathanhurley)

Posted by am...@apache.org.
AMBARI-22444 - Add Native Libraries To Tez Tarball (part2) (jonathanhurley)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 0936f463042cf5ba195b0461479d8c29c88330dd
Parents: 8fe6ac4
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Wed Nov 15 17:37:57 2017 -0500
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Wed Nov 15 17:40:29 2017 -0500

----------------------------------------------------------------------
 .../libraries/functions/copy_tarball.py                   | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0936f463/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py b/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py
index f62aa3d..7bca967 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py
@@ -33,6 +33,7 @@ from resource_management.core import shell
 from resource_management.core import sudo
 from resource_management.core.logger import Logger
 from resource_management.core.exceptions import Fail
+from resource_management.core.resources.system import Directory
 from resource_management.core.resources.system import Execute
 from resource_management.libraries.functions import stack_tools, stack_features, stack_select
 from resource_management.libraries.functions import tar_archive
@@ -77,7 +78,14 @@ def _prepare_tez_tarball():
 
   Execute(("cp", "-a", hadoop_lib_native_dir, tez_lib_dir), sudo = True)
 
-  tez_tarball_with_native_lib = os.path.join(os.path.dirname(tez_source_file), "tez-native.tar.gz")
+  tez_native_tarball_staging_dir = os.path.join(temp_dir, "tez-native-tarball-staging")
+  if not os.path.exists(tez_native_tarball_staging_dir):
+    Directory(tez_native_tarball_staging_dir,
+      cd_access='a',
+      create_parents = True,
+      recursive_ownership = True)
+
+  tez_tarball_with_native_lib = os.path.join(tez_native_tarball_staging_dir, "tez-native.tar.gz")
   Logger.info("Creating a new Tez tarball at {0}".format(tez_tarball_with_native_lib))
 
   # tar up Tez, making sure to specify nothing for the arcname so that it does not include an absolute path


[02/50] [abbrv] ambari git commit: AMBARI-22370 - Remove HADOOP_HOME From Environment For Daemons (jonathanhurley)

Posted by am...@apache.org.
AMBARI-22370 - Remove HADOOP_HOME From Environment For Daemons (jonathanhurley)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 780e91e6124f39fcd67e58369ed2a42da2a6f247
Parents: 444718a
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Mon Nov 6 16:05:56 2017 -0500
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Thu Nov 9 08:23:15 2017 -0500

----------------------------------------------------------------------
 .../libraries/functions/stack_select.py          |  3 ++-
 .../ATLAS/0.1.0.2.3/package/scripts/params.py    |  2 +-
 .../ATLAS/0.7.0.3.0/package/scripts/params.py    |  2 +-
 .../FALCON/0.5.0.2.1/package/scripts/falcon.py   | 11 +----------
 .../package/scripts/hive_service_interactive.py  |  5 ++---
 .../package/scripts/webhcat_service.py           | 19 ++++---------------
 .../package/scripts/hive_service_interactive.py  |  5 ++---
 .../2.1.0.3.0/package/scripts/params_linux.py    |  7 +++----
 .../2.1.0.3.0/package/scripts/webhcat_service.py | 19 ++++---------------
 .../1.0.0.2.3/package/scripts/service_check.py   |  3 +--
 .../1.4.4.2.0/package/scripts/params_linux.py    |  4 ++--
 .../1.4.4.3.0/package/scripts/params_linux.py    |  4 ++--
 .../0.4.0.2.1/package/scripts/params_linux.py    |  2 +-
 .../0.9.0.3.0/package/scripts/params_linux.py    |  2 +-
 .../2.1.0.2.0/package/scripts/params_linux.py    |  2 +-
 .../3.0.0.3.0/package/scripts/params_linux.py    |  2 +-
 .../stacks/2.0.6/HIVE/test_webhcat_server.py     |  4 ----
 .../stacks/2.1/FALCON/test_falcon_server.py      | 10 ++--------
 .../python/stacks/2.1/TEZ/test_tez_client.py     |  2 +-
 .../2.3/MAHOUT/test_mahout_service_check.py      |  4 +---
 .../stacks/2.5/HIVE/test_hive_server_int.py      | 15 +++++----------
 21 files changed, 38 insertions(+), 89 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/780e91e6/ambari-common/src/main/python/resource_management/libraries/functions/stack_select.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/stack_select.py b/ambari-common/src/main/python/resource_management/libraries/functions/stack_select.py
index 9b7d0eb..b741a33 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/stack_select.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/stack_select.py
@@ -71,7 +71,8 @@ HADOOP_DIR_DEFAULTS = {
   "libexec": "/usr/lib/hadoop/libexec",
   "sbin": "/usr/lib/hadoop/sbin",
   "bin": "/usr/bin",
-  "lib": "/usr/lib/hadoop/lib"
+  "lib": "/usr/lib/hadoop/lib",
+  "conf": "/etc/hadoop/conf"
 }
 
 PACKAGE_SCOPE_INSTALL = "INSTALL"

http://git-wip-us.apache.org/repos/asf/ambari/blob/780e91e6/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py
index 968ceed..31a866e 100644
--- a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py
@@ -118,7 +118,7 @@ metadata_stop_script = format("{metadata_bin}/atlas_stop.py")
 log_dir = config['configurations']['atlas-env']['metadata_log_dir']
 
 # service locations
-hadoop_conf_dir = os.path.join(os.environ["HADOOP_HOME"], "conf") if 'HADOOP_HOME' in os.environ else '/etc/hadoop/conf'
+hadoop_conf_dir = os.path.join(os.environ["HADOOP_HOME"], "conf") if 'HADOOP_HOME' in os.environ else format('{stack_root}/current/hadoop-client/conf')
 
 # some commands may need to supply the JAAS location when running as atlas
 atlas_jaas_file = format("{conf_dir}/atlas_jaas.conf")

http://git-wip-us.apache.org/repos/asf/ambari/blob/780e91e6/ambari-server/src/main/resources/common-services/ATLAS/0.7.0.3.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ATLAS/0.7.0.3.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/ATLAS/0.7.0.3.0/package/scripts/params.py
index b01884c..7c1249a 100644
--- a/ambari-server/src/main/resources/common-services/ATLAS/0.7.0.3.0/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/ATLAS/0.7.0.3.0/package/scripts/params.py
@@ -116,7 +116,7 @@ metadata_stop_script = format("{metadata_bin}/atlas_stop.py")
 log_dir = config['configurations']['atlas-env']['metadata_log_dir']
 
 # service locations
-hadoop_conf_dir = os.path.join(os.environ["HADOOP_HOME"], "conf") if 'HADOOP_HOME' in os.environ else '/etc/hadoop/conf'
+hadoop_conf_dir = os.path.join(os.environ["HADOOP_HOME"], "conf") if 'HADOOP_HOME' in os.environ else format('{stack_root}/current/hadoop-client/conf')
 
 # some commands may need to supply the JAAS location when running as atlas
 atlas_jaas_file = format("{conf_dir}/atlas_jaas.conf")

http://git-wip-us.apache.org/repos/asf/ambari/blob/780e91e6/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon.py b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon.py
index 933515b..7d8fa13 100644
--- a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon.py
+++ b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon.py
@@ -209,12 +209,6 @@ def falcon(type, action = None, upgrade_type=None):
           owner = params.falcon_user,
           create_parents = True)
 
-    # although Falcon's falcon-config.sh will use 'which hadoop' to figure
-    # this out, in an upgraded cluster, it's possible that 'which hadoop'
-    # still points to older binaries; it's safer to just pass in the
-    # hadoop home directory to use
-    environment_dictionary = { "HADOOP_HOME" : params.hadoop_home_dir }
-
     pid = get_user_call_output.get_user_call_output(format("cat {server_pid_file}"), user=params.falcon_user, is_checked_call=False)[1]
     process_exists = format("ls {server_pid_file} && ps -p {pid}")
 
@@ -223,7 +217,6 @@ def falcon(type, action = None, upgrade_type=None):
         Execute(format('{falcon_home}/bin/falcon-config.sh server falcon'),
           user = params.falcon_user,
           path = params.hadoop_bin_dir,
-          environment=environment_dictionary,
           not_if = process_exists,
         )
       except:
@@ -253,7 +246,6 @@ in the Falcon documentation.
         Execute(format('{falcon_home}/bin/falcon-start -port {falcon_port}'),
           user = params.falcon_user,
           path = params.hadoop_bin_dir,
-          environment=environment_dictionary,
           not_if = process_exists,
         )
       except:
@@ -264,8 +256,7 @@ in the Falcon documentation.
       try:
         Execute(format('{falcon_home}/bin/falcon-stop'),
           user = params.falcon_user,
-          path = params.hadoop_bin_dir,
-          environment=environment_dictionary)
+          path = params.hadoop_bin_dir)
       except:
         show_logs(params.falcon_log_dir, params.falcon_user)
         raise

http://git-wip-us.apache.org/repos/asf/ambari/blob/780e91e6/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service_interactive.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service_interactive.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service_interactive.py
index 703d104..71c22d7 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service_interactive.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service_interactive.py
@@ -52,12 +52,11 @@ def hive_service_interactive(name, action='start', upgrade_type=None):
   if action == 'start':
     check_fs_root(params.hive_server_interactive_conf_dir, params.execute_path_hive_interactive)
     daemon_cmd = cmd
-    hadoop_home = params.hadoop_home
-    hive_interactive_bin = "hive2"
+    hive_interactive_bin = format("{stack_root}/current/hive-server2-hive2/bin/hive2")
 
     Execute(daemon_cmd,
             user = params.hive_user,
-            environment = { 'HADOOP_HOME': hadoop_home, 'JAVA_HOME': params.java64_home, 'HIVE_BIN': hive_interactive_bin },
+            environment = { 'JAVA_HOME': params.java64_home, 'HIVE_BIN': hive_interactive_bin },
             path = params.execute_path,
             not_if = process_id_exists_command)
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/780e91e6/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/webhcat_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/webhcat_service.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/webhcat_service.py
index cb4aafd..bddb5b2 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/webhcat_service.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/webhcat_service.py
@@ -40,30 +40,22 @@ def webhcat_service(action='start', rolling_restart=False):
 def webhcat_service(action='start', upgrade_type=None):
   import params
 
-  environ = {
-    'HADOOP_HOME': params.hadoop_home
-  }
-
   cmd = format('{webhcat_bin_dir}/webhcat_server.sh')
 
   if action == 'start':
-    if upgrade_type is not None and params.version and params.stack_root:
-      environ['HADOOP_HOME'] = format("{stack_root}/{version}/hadoop")
-
     daemon_cmd = format('cd {hcat_pid_dir} ; {cmd} start')
     no_op_test = format('ls {webhcat_pid_file} >/dev/null 2>&1 && ps -p `cat {webhcat_pid_file}` >/dev/null 2>&1')
     try:
       Execute(daemon_cmd,
               user=params.webhcat_user,
-              not_if=no_op_test,
-              environment = environ)
+              not_if=no_op_test)
     except:
       show_logs(params.hcat_log_dir, params.webhcat_user)
       raise
   elif action == 'stop':
     try:
       # try stopping WebHCat using its own script
-      graceful_stop(cmd, environ)
+      graceful_stop(cmd)
     except Fail:
       show_logs(params.hcat_log_dir, params.webhcat_user)
       Logger.info(traceback.format_exc())
@@ -95,17 +87,14 @@ def webhcat_service(action='start', upgrade_type=None):
 
     File(params.webhcat_pid_file, action="delete")
 
-def graceful_stop(cmd, environ):
+def graceful_stop(cmd):
   """
   Attemps to stop WebHCat using its own shell script. On some versions this may not correctly
   stop the daemon.
   :param cmd: the command to run to stop the daemon
-  :param environ: the environment variables to execute the command with
   :return:
   """
   import params
   daemon_cmd = format('{cmd} stop')
 
-  Execute(daemon_cmd,
-          user = params.webhcat_user,
-          environment = environ)
+  Execute(daemon_cmd, user = params.webhcat_user)

http://git-wip-us.apache.org/repos/asf/ambari/blob/780e91e6/ambari-server/src/main/resources/common-services/HIVE/2.1.0.3.0/package/scripts/hive_service_interactive.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/2.1.0.3.0/package/scripts/hive_service_interactive.py b/ambari-server/src/main/resources/common-services/HIVE/2.1.0.3.0/package/scripts/hive_service_interactive.py
index 703d104..71c22d7 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/2.1.0.3.0/package/scripts/hive_service_interactive.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/2.1.0.3.0/package/scripts/hive_service_interactive.py
@@ -52,12 +52,11 @@ def hive_service_interactive(name, action='start', upgrade_type=None):
   if action == 'start':
     check_fs_root(params.hive_server_interactive_conf_dir, params.execute_path_hive_interactive)
     daemon_cmd = cmd
-    hadoop_home = params.hadoop_home
-    hive_interactive_bin = "hive2"
+    hive_interactive_bin = format("{stack_root}/current/hive-server2-hive2/bin/hive2")
 
     Execute(daemon_cmd,
             user = params.hive_user,
-            environment = { 'HADOOP_HOME': hadoop_home, 'JAVA_HOME': params.java64_home, 'HIVE_BIN': hive_interactive_bin },
+            environment = { 'JAVA_HOME': params.java64_home, 'HIVE_BIN': hive_interactive_bin },
             path = params.execute_path,
             not_if = process_id_exists_command)
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/780e91e6/ambari-server/src/main/resources/common-services/HIVE/2.1.0.3.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/2.1.0.3.0/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/HIVE/2.1.0.3.0/package/scripts/params_linux.py
index 1bd6a1a..088a540 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/2.1.0.3.0/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/2.1.0.3.0/package/scripts/params_linux.py
@@ -36,19 +36,17 @@ from resource_management.libraries.functions import get_kinit_path
 from resource_management.libraries.functions.get_not_managed_resources import get_not_managed_resources
 from resource_management.libraries.script.script import Script
 from resource_management.libraries.functions import StackFeature
+from resource_management.libraries.functions import stack_select
 from resource_management.libraries.functions.stack_features import check_stack_feature
 from resource_management.libraries.functions.stack_features import get_stack_feature_version
 from resource_management.libraries.functions import upgrade_summary
 from resource_management.libraries.functions.get_port_from_url import get_port_from_url
 from resource_management.libraries.functions.expect import expect
 from resource_management.libraries import functions
-from resource_management.libraries.functions.setup_atlas_hook import has_atlas_in_cluster
-from ambari_commons.ambari_metrics_helper import select_metric_collector_hosts_from_hostnames
 from resource_management.libraries.functions.setup_ranger_plugin_xml import get_audit_configs, generate_ranger_service_config
 from resource_management.libraries.functions.get_architecture import get_architecture
 
 from resource_management.core.utils import PasswordString
-from resource_management.core.shell import checked_call
 from resource_management.core.exceptions import Fail
 from ambari_commons.credential_store_helper import get_password_from_credential_store
 
@@ -107,7 +105,8 @@ stack_supports_hive_interactive_ga = check_stack_feature(StackFeature.HIVE_INTER
 component_directory = status_params.component_directory
 component_directory_interactive = status_params.component_directory_interactive
 
-hadoop_home = format('{stack_root}/current/hadoop-client')
+hadoop_home = stack_select.get_hadoop_dir("home")
+
 hive_bin = format('{stack_root}/current/{component_directory}/bin')
 hive_cmd = os.path.join(hive_bin, "hive")
 hive_schematool_ver_bin = format('{stack_root}/{version}/hive/bin')

http://git-wip-us.apache.org/repos/asf/ambari/blob/780e91e6/ambari-server/src/main/resources/common-services/HIVE/2.1.0.3.0/package/scripts/webhcat_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/2.1.0.3.0/package/scripts/webhcat_service.py b/ambari-server/src/main/resources/common-services/HIVE/2.1.0.3.0/package/scripts/webhcat_service.py
index cb4aafd..bddb5b2 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/2.1.0.3.0/package/scripts/webhcat_service.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/2.1.0.3.0/package/scripts/webhcat_service.py
@@ -40,30 +40,22 @@ def webhcat_service(action='start', rolling_restart=False):
 def webhcat_service(action='start', upgrade_type=None):
   import params
 
-  environ = {
-    'HADOOP_HOME': params.hadoop_home
-  }
-
   cmd = format('{webhcat_bin_dir}/webhcat_server.sh')
 
   if action == 'start':
-    if upgrade_type is not None and params.version and params.stack_root:
-      environ['HADOOP_HOME'] = format("{stack_root}/{version}/hadoop")
-
     daemon_cmd = format('cd {hcat_pid_dir} ; {cmd} start')
     no_op_test = format('ls {webhcat_pid_file} >/dev/null 2>&1 && ps -p `cat {webhcat_pid_file}` >/dev/null 2>&1')
     try:
       Execute(daemon_cmd,
               user=params.webhcat_user,
-              not_if=no_op_test,
-              environment = environ)
+              not_if=no_op_test)
     except:
       show_logs(params.hcat_log_dir, params.webhcat_user)
       raise
   elif action == 'stop':
     try:
       # try stopping WebHCat using its own script
-      graceful_stop(cmd, environ)
+      graceful_stop(cmd)
     except Fail:
       show_logs(params.hcat_log_dir, params.webhcat_user)
       Logger.info(traceback.format_exc())
@@ -95,17 +87,14 @@ def webhcat_service(action='start', upgrade_type=None):
 
     File(params.webhcat_pid_file, action="delete")
 
-def graceful_stop(cmd, environ):
+def graceful_stop(cmd):
   """
   Attemps to stop WebHCat using its own shell script. On some versions this may not correctly
   stop the daemon.
   :param cmd: the command to run to stop the daemon
-  :param environ: the environment variables to execute the command with
   :return:
   """
   import params
   daemon_cmd = format('{cmd} stop')
 
-  Execute(daemon_cmd,
-          user = params.webhcat_user,
-          environment = environ)
+  Execute(daemon_cmd, user = params.webhcat_user)

http://git-wip-us.apache.org/repos/asf/ambari/blob/780e91e6/ambari-server/src/main/resources/common-services/MAHOUT/1.0.0.2.3/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/MAHOUT/1.0.0.2.3/package/scripts/service_check.py b/ambari-server/src/main/resources/common-services/MAHOUT/1.0.0.2.3/package/scripts/service_check.py
index c1151fc..b15d158 100644
--- a/ambari-server/src/main/resources/common-services/MAHOUT/1.0.0.2.3/package/scripts/service_check.py
+++ b/ambari-server/src/main/resources/common-services/MAHOUT/1.0.0.2.3/package/scripts/service_check.py
@@ -71,8 +71,7 @@ class MahoutServiceCheck(Script):
     Execute( mahout_command,
              tries = 3,
              try_sleep = 5,
-             environment={'HADOOP_HOME': params.hadoop_home,'HADOOP_CONF_DIR': params.hadoop_conf_dir,
-                          'MAHOUT_HOME': params.mahout_home,'JAVA_HOME': params.java64_home},
+             environment={'MAHOUT_HOME': params.mahout_home,'JAVA_HOME': params.java64_home},
              path = format('/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'),
              user = params.smokeuser
     )

http://git-wip-us.apache.org/repos/asf/ambari/blob/780e91e6/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/params_linux.py
index 400c87c..eaf1ee4 100644
--- a/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/params_linux.py
@@ -23,11 +23,11 @@ from resource_management.libraries.functions.version import format_stack_version
 from resource_management.libraries.functions.default import default
 from resource_management.libraries.functions.get_kinit_path import get_kinit_path
 from resource_management.libraries.script import Script
+from resource_management.libraries.functions import stack_select
 from resource_management.libraries.functions.format import format
 from resource_management.libraries.functions import StackFeature
 from resource_management.libraries.functions.stack_features import check_stack_feature
 from resource_management.libraries.functions.expect import expect
-from resource_management.libraries.functions.setup_atlas_hook import has_atlas_in_cluster
 from resource_management.core.exceptions import Fail
 
 
@@ -71,7 +71,7 @@ zoo_conf_dir = "/etc/zookeeper"
 if stack_version_formatted and check_stack_feature(StackFeature.ROLLING_UPGRADE, stack_version_formatted):
   sqoop_conf_dir = format("{stack_root}/current/sqoop-client/conf")
   sqoop_lib = format("{stack_root}/current/sqoop-client/lib")
-  hadoop_home = format("{stack_root}/current/hadoop-client")
+  hadoop_home = stack_select.get_hadoop_dir("home")
   hbase_home = format("{stack_root}/current/hbase-client")
   hive_home = format("{stack_root}/current/hive-client")
   sqoop_bin_dir = format("{stack_root}/current/sqoop-client/bin/")

http://git-wip-us.apache.org/repos/asf/ambari/blob/780e91e6/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.3.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.3.0/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.3.0/package/scripts/params_linux.py
index 400c87c..eaf1ee4 100644
--- a/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.3.0/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.3.0/package/scripts/params_linux.py
@@ -23,11 +23,11 @@ from resource_management.libraries.functions.version import format_stack_version
 from resource_management.libraries.functions.default import default
 from resource_management.libraries.functions.get_kinit_path import get_kinit_path
 from resource_management.libraries.script import Script
+from resource_management.libraries.functions import stack_select
 from resource_management.libraries.functions.format import format
 from resource_management.libraries.functions import StackFeature
 from resource_management.libraries.functions.stack_features import check_stack_feature
 from resource_management.libraries.functions.expect import expect
-from resource_management.libraries.functions.setup_atlas_hook import has_atlas_in_cluster
 from resource_management.core.exceptions import Fail
 
 
@@ -71,7 +71,7 @@ zoo_conf_dir = "/etc/zookeeper"
 if stack_version_formatted and check_stack_feature(StackFeature.ROLLING_UPGRADE, stack_version_formatted):
   sqoop_conf_dir = format("{stack_root}/current/sqoop-client/conf")
   sqoop_lib = format("{stack_root}/current/sqoop-client/lib")
-  hadoop_home = format("{stack_root}/current/hadoop-client")
+  hadoop_home = stack_select.get_hadoop_dir("home")
   hbase_home = format("{stack_root}/current/hbase-client")
   hive_home = format("{stack_root}/current/hive-client")
   sqoop_bin_dir = format("{stack_root}/current/sqoop-client/bin/")

http://git-wip-us.apache.org/repos/asf/ambari/blob/780e91e6/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/params_linux.py
index 4d63685..cef709b 100644
--- a/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/params_linux.py
@@ -50,7 +50,7 @@ version = default("/commandParams/version", None)
 hadoop_lib_home = stack_select.get_hadoop_dir("lib")
 
 # default hadoop parameters
-hadoop_home = '/usr'
+hadoop_home = stack_select.get_hadoop_dir("home")
 hadoop_bin_dir = stack_select.get_hadoop_dir("bin")
 hadoop_conf_dir = conf_select.get_hadoop_conf_dir()
 tez_etc_dir = "/etc/tez"

http://git-wip-us.apache.org/repos/asf/ambari/blob/780e91e6/ambari-server/src/main/resources/common-services/TEZ/0.9.0.3.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/TEZ/0.9.0.3.0/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/TEZ/0.9.0.3.0/package/scripts/params_linux.py
index 5a028bd..2b3fa38 100644
--- a/ambari-server/src/main/resources/common-services/TEZ/0.9.0.3.0/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/TEZ/0.9.0.3.0/package/scripts/params_linux.py
@@ -48,7 +48,7 @@ stack_version_formatted = format_stack_version(stack_version_unformatted)
 version = default("/commandParams/version", None)
 
 # default hadoop parameters
-hadoop_home = '/usr'
+hadoop_home = stack_select.get_hadoop_dir("home")
 hadoop_bin_dir = stack_select.get_hadoop_dir("bin")
 hadoop_conf_dir = conf_select.get_hadoop_conf_dir()
 tez_etc_dir = "/etc/tez"

http://git-wip-us.apache.org/repos/asf/ambari/blob/780e91e6/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
index 620408b..3e4504d 100644
--- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
@@ -65,7 +65,7 @@ stack_name = status_params.stack_name
 stack_root = Script.get_stack_root()
 tarball_map = default("/configurations/cluster-env/tarball_map", None)
 
-config_path = os.path.join(stack_root, "current/hadoop-client/conf")
+config_path = stack_select.get_hadoop_dir("conf")
 config_dir = os.path.realpath(config_path)
 
 # get the correct version to use for checking stack features

http://git-wip-us.apache.org/repos/asf/ambari/blob/780e91e6/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/package/scripts/params_linux.py
index e4dbe2c..617dc3b 100644
--- a/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/package/scripts/params_linux.py
@@ -65,7 +65,7 @@ stack_name = status_params.stack_name
 stack_root = Script.get_stack_root()
 tarball_map = default("/configurations/cluster-env/tarball_map", None)
 
-config_path = os.path.join(stack_root, "current/hadoop-client/conf")
+config_path = stack_select.get_hadoop_dir("conf")
 config_dir = os.path.realpath(config_path)
 
 # get the correct version to use for checking stack features

http://git-wip-us.apache.org/repos/asf/ambari/blob/780e91e6/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_webhcat_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_webhcat_server.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_webhcat_server.py
index f9480ee..b4652ac 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_webhcat_server.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_webhcat_server.py
@@ -65,7 +65,6 @@ class TestWebHCatServer(RMFTestCase):
 
     self.assert_configure_default()
     self.assertResourceCalled('Execute', 'cd /var/run/webhcat ; /usr/hdp/current/hive-webhcat/sbin/webhcat_server.sh start',
-        environment = {'HADOOP_HOME': '/usr/hdp/current/hadoop-client'},
         not_if = "ls /var/run/webhcat/webhcat.pid >/dev/null 2>&1 && ps -p `cat /var/run/webhcat/webhcat.pid` >/dev/null 2>&1",
         user = 'hcat',
     )
@@ -82,7 +81,6 @@ class TestWebHCatServer(RMFTestCase):
 
     self.assertResourceCalled('Execute', '/usr/hdp/current/hive-webhcat/sbin/webhcat_server.sh stop',
                               user = 'hcat',
-                              environment = {'HADOOP_HOME': '/usr/hdp/current/hadoop-client' }
                               )
 
     self.assertResourceCalled('Execute', 'ambari-sudo.sh kill -9 `cat /var/run/webhcat/webhcat.pid`',
@@ -148,7 +146,6 @@ class TestWebHCatServer(RMFTestCase):
 
     self.assert_configure_secured()
     self.assertResourceCalled('Execute', 'cd /var/run/webhcat ; /usr/hdp/current/hive-webhcat/sbin/webhcat_server.sh start',
-        environment = {'HADOOP_HOME': '/usr/hdp/2.1.0.0-1234/hadoop'},
         not_if = "ls /var/run/webhcat/webhcat.pid >/dev/null 2>&1 && ps -p `cat /var/run/webhcat/webhcat.pid` >/dev/null 2>&1",
         user = 'hcat',
     )
@@ -165,7 +162,6 @@ class TestWebHCatServer(RMFTestCase):
 
     self.assertResourceCalled('Execute', '/usr/hdp/current/hive-webhcat/sbin/webhcat_server.sh stop',
                               user = 'hcat',
-                              environment = {'HADOOP_HOME': '/usr/hdp/2.1.0.0-1234/hadoop' }
                               )
 
     self.assertResourceCalled('Execute', 'ambari-sudo.sh kill -9 `cat /var/run/webhcat/webhcat.pid`',

http://git-wip-us.apache.org/repos/asf/ambari/blob/780e91e6/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py b/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py
index 7f2ed46..8c48347 100644
--- a/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py
+++ b/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py
@@ -49,7 +49,6 @@ class TestFalconServer(RMFTestCase):
     self.assertResourceCalled('Execute', '/usr/hdp/current/falcon-server/bin/falcon-config.sh server falcon',
       path = ['/usr/bin'],
       user = 'falcon',
-      environment = {'HADOOP_HOME': '/usr/lib/hadoop'},
       not_if = 'ls /var/run/falcon/falcon.pid && ps -p ',
     )
 
@@ -61,7 +60,6 @@ class TestFalconServer(RMFTestCase):
     self.assertResourceCalled('Execute', '/usr/hdp/current/falcon-server/bin/falcon-start -port 15000',
       path = ['/usr/bin'],
       user = 'falcon',
-      environment = {'HADOOP_HOME': '/usr/lib/hadoop'},
       not_if = 'ls /var/run/falcon/falcon.pid && ps -p ',
     )
 
@@ -78,8 +76,7 @@ class TestFalconServer(RMFTestCase):
 
     self.assertResourceCalled('Execute', '/usr/hdp/current/falcon-server/bin/falcon-stop',
       path = ['/usr/bin'],
-      user = 'falcon',
-      environment = {'HADOOP_HOME': '/usr/lib/hadoop'})
+      user = 'falcon')
 
     self.assertResourceCalled('File', '/var/run/falcon/falcon.pid',
       action = ['delete'])
@@ -236,8 +233,7 @@ class TestFalconServer(RMFTestCase):
 
     self.assertResourceCalled('Execute',
       '/usr/hdp/current/falcon-server/bin/falcon-stop',
-      path = ['/usr/hdp/2.2.1.0-2135/hadoop/bin'], user='falcon',
-      environment = {'HADOOP_HOME': '/usr/hdp/2.2.1.0-2135/hadoop'})
+      path = ['/usr/hdp/2.2.1.0-2135/hadoop/bin'], user='falcon')
 
     self.assertResourceCalled('File', '/var/run/falcon/falcon.pid',
       action = ['delete'])
@@ -406,14 +402,12 @@ class TestFalconServer(RMFTestCase):
     )
 
     self.assertResourceCalled('Execute', '/usr/hdp/current/falcon-server/bin/falcon-config.sh server falcon',
-        environment = {'HADOOP_HOME': '/usr/hdp/2.2.1.0-2135/hadoop'},
         path = ['/usr/hdp/2.2.1.0-2135/hadoop/bin'],
         user = 'falcon',
         not_if = 'ls /var/run/falcon/falcon.pid && ps -p ',
     )
 
     self.assertResourceCalled('Execute', '/usr/hdp/current/falcon-server/bin/falcon-start -port 15000',
-        environment = {'HADOOP_HOME': '/usr/hdp/2.2.1.0-2135/hadoop'},
         path = ['/usr/hdp/2.2.1.0-2135/hadoop/bin'],
         user = 'falcon',
         not_if = 'ls /var/run/falcon/falcon.pid && ps -p ',

http://git-wip-us.apache.org/repos/asf/ambari/blob/780e91e6/ambari-server/src/test/python/stacks/2.1/TEZ/test_tez_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.1/TEZ/test_tez_client.py b/ambari-server/src/test/python/stacks/2.1/TEZ/test_tez_client.py
index fad99f6..59b2166 100644
--- a/ambari-server/src/test/python/stacks/2.1/TEZ/test_tez_client.py
+++ b/ambari-server/src/test/python/stacks/2.1/TEZ/test_tez_client.py
@@ -130,6 +130,6 @@ class TestTezClient(RMFTestCase):
                        config_dict = json_content,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES,
-                       call_mocks = [(0, None, ''), (0, None)],
+                       call_mocks = [(0, None, ''),(0, None, ''), (0, None)],
                        mocks_dict = mocks_dict)
     # for now, it's enough to know the method didn't fail
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/780e91e6/ambari-server/src/test/python/stacks/2.3/MAHOUT/test_mahout_service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.3/MAHOUT/test_mahout_service_check.py b/ambari-server/src/test/python/stacks/2.3/MAHOUT/test_mahout_service_check.py
index b80476c..8695653 100644
--- a/ambari-server/src/test/python/stacks/2.3/MAHOUT/test_mahout_service_check.py
+++ b/ambari-server/src/test/python/stacks/2.3/MAHOUT/test_mahout_service_check.py
@@ -109,9 +109,7 @@ class TestMahoutClient(RMFTestCase):
     self.assertResourceCalled('Execute', 'mahout seqdirectory --input /user/ambari-qa/mahoutsmokeinput/'
                                          'sample-mahout-test.txt --output /user/ambari-qa/mahoutsmokeoutput/ '
                                          '--charset utf-8',
-                              environment = {'HADOOP_CONF_DIR': '/usr/hdp/2.2.1.0-2067/hadoop/conf',
-                                             'HADOOP_HOME': '/usr/hdp/2.2.1.0-2067/hadoop',
-                                             'JAVA_HOME': u'/usr/jdk64/jdk1.7.0_45',
+                              environment = {'JAVA_HOME': u'/usr/jdk64/jdk1.7.0_45',
                                              'MAHOUT_HOME': '/usr/hdp/current/mahout-client'},
                               path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],
                               tries = 3,

http://git-wip-us.apache.org/repos/asf/ambari/blob/780e91e6/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py b/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
index 4951c7e..cf79ec7 100644
--- a/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
+++ b/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
@@ -115,8 +115,7 @@ class TestHiveServerInteractive(RMFTestCase):
     )
     self.assertResourceCalled('Execute',
                               '/tmp/start_hiveserver2_interactive_script /var/run/hive/hive-server2-interactive.out /var/log/hive/hive-server2-interactive.err /var/run/hive/hive-interactive.pid /usr/hdp/current/hive-server2-hive2/conf/conf.server /var/log/hive',
-                              environment={'HADOOP_HOME': '/usr/hdp/current/hadoop-client',
-                                           'HIVE_BIN': 'hive2',
+                              environment={'HIVE_BIN': '/usr/hdp/current/hive-server2-hive2/bin/hive2',
                                            'JAVA_HOME': u'/usr/jdk64/jdk1.7.0_45'},
                               not_if="ls /var/run/hive/hive-interactive.pid >/dev/null 2>&1 && ps -p 123 >/dev/null 2>&1",
                               user='hive',
@@ -178,8 +177,7 @@ class TestHiveServerInteractive(RMFTestCase):
     )
     self.assertResourceCalled('Execute',
                               '/tmp/start_hiveserver2_interactive_script /var/run/hive/hive-server2-interactive.out /var/log/hive/hive-server2-interactive.err /var/run/hive/hive-interactive.pid /usr/hdp/current/hive-server2-hive2/conf/conf.server /var/log/hive',
-                              environment={'HADOOP_HOME': '/usr/hdp/current/hadoop-client',
-                                           'HIVE_BIN': 'hive2',
+                              environment={'HIVE_BIN': '/usr/hdp/current/hive-server2-hive2/bin/hive2',
                                            'JAVA_HOME': u'/usr/jdk64/jdk1.7.0_45'},
                               not_if="ls /var/run/hive/hive-interactive.pid >/dev/null 2>&1 && ps -p 123 >/dev/null 2>&1",
                               user='hive',
@@ -227,8 +225,7 @@ class TestHiveServerInteractive(RMFTestCase):
     )
     self.assertResourceCalled('Execute',
                               '/tmp/start_hiveserver2_interactive_script /var/run/hive/hive-server2-interactive.out /var/log/hive/hive-server2-interactive.err /var/run/hive/hive-interactive.pid /usr/hdp/current/hive-server2-hive2/conf/conf.server /var/log/hive',
-                              environment={'HADOOP_HOME': '/usr/hdp/current/hadoop-client',
-                                           'HIVE_BIN': 'hive2',
+                              environment={'HIVE_BIN': '/usr/hdp/current/hive-server2-hive2/bin/hive2',
                                            'JAVA_HOME': u'/usr/jdk64/jdk1.7.0_45'},
                               not_if="ls /var/run/hive/hive-interactive.pid >/dev/null 2>&1 && ps -p 123 >/dev/null 2>&1",
                               user='hive',
@@ -305,8 +302,7 @@ class TestHiveServerInteractive(RMFTestCase):
     )
     self.assertResourceCalled('Execute',
                               '/tmp/start_hiveserver2_interactive_script /var/run/hive/hive-server2-interactive.out /var/log/hive/hive-server2-interactive.err /var/run/hive/hive-interactive.pid /usr/hdp/current/hive-server2-hive2/conf/conf.server /var/log/hive',
-                              environment={'HADOOP_HOME': '/usr/hdp/current/hadoop-client',
-                                           'HIVE_BIN': 'hive2',
+                              environment={'HIVE_BIN': '/usr/hdp/current/hive-server2-hive2/bin/hive2',
                                            'JAVA_HOME': u'/usr/jdk64/jdk1.7.0_45'},
                               not_if="ls /var/run/hive/hive-interactive.pid >/dev/null 2>&1 && ps -p 123 >/dev/null 2>&1",
                               user='hive',
@@ -364,8 +360,7 @@ class TestHiveServerInteractive(RMFTestCase):
                               )
     self.assertResourceCalled('Execute',
                               '/tmp/start_hiveserver2_interactive_script /var/run/hive/hive-server2-interactive.out /var/log/hive/hive-server2-interactive.err /var/run/hive/hive-interactive.pid /usr/hdp/current/hive-server2-hive2/conf/conf.server /var/log/hive',
-                              environment={'HADOOP_HOME': '/usr/hdp/current/hadoop-client',
-                                           'HIVE_BIN': 'hive2',
+                              environment={'HIVE_BIN': '/usr/hdp/current/hive-server2-hive2/bin/hive2',
                                            'JAVA_HOME': u'/usr/jdk64/jdk1.7.0_45'},
                               not_if="ls /var/run/hive/hive-interactive.pid >/dev/null 2>&1 && ps -p 123 >/dev/null 2>&1",
                               user='hive',


[41/50] [abbrv] ambari git commit: AMBARI-22121. Create mpack for Isilon OneFS (amagyar)

Posted by am...@apache.org.
AMBARI-22121. Create mpack for Isilon OneFS (amagyar)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 2a1c2e496c14cd5b00c8c235a00fc907d85dac90
Parents: f087874
Author: Attila Magyar <am...@hortonworks.com>
Authored: Fri Oct 6 09:13:09 2017 +0200
Committer: Attila Magyar <am...@hortonworks.com>
Committed: Wed Nov 22 10:50:40 2017 +0100

----------------------------------------------------------------------
 .../isilon-onefs-mpack/.gitignore               |   1 +
 .../management-packs/isilon-onefs-mpack/pom.xml | 110 ++++++
 .../src/main/assemblies/isilon-onefs-mpack.xml  |  40 ++
 .../addon-services/ONEFS/1.0.0/alerts.json      |  46 +++
 .../ONEFS/1.0.0/configuration/core-site.xml     | 102 +++++
 .../ONEFS/1.0.0/configuration/hadoop-env.xml    | 386 +++++++++++++++++++
 .../ONEFS/1.0.0/configuration/hdfs-site.xml     |  61 +++
 .../addon-services/ONEFS/1.0.0/metainfo.xml     |  90 +++++
 .../addon-services/ONEFS/1.0.0/metrics.json     |  59 +++
 .../ONEFS/1.0.0/package/scripts/__init__.py     |  20 +
 .../ONEFS/1.0.0/package/scripts/onefs_client.py |  56 +++
 .../ONEFS/1.0.0/package/scripts/params.py       |  29 ++
 .../ONEFS/1.0.0/package/scripts/params_linux.py |  74 ++++
 .../1.0.0/package/scripts/params_windows.py     |  83 ++++
 .../1.0.0/package/scripts/service_check.py      | 137 +++++++
 .../1.0.0/package/scripts/status_params.py      |  58 +++
 .../addon-services/ONEFS/1.0.0/widgets.json     |  38 ++
 .../src/main/resources/mpack.json               |  28 ++
 18 files changed, 1418 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2a1c2e49/contrib/management-packs/isilon-onefs-mpack/.gitignore
----------------------------------------------------------------------
diff --git a/contrib/management-packs/isilon-onefs-mpack/.gitignore b/contrib/management-packs/isilon-onefs-mpack/.gitignore
new file mode 100644
index 0000000..1377554
--- /dev/null
+++ b/contrib/management-packs/isilon-onefs-mpack/.gitignore
@@ -0,0 +1 @@
+*.swp

http://git-wip-us.apache.org/repos/asf/ambari/blob/2a1c2e49/contrib/management-packs/isilon-onefs-mpack/pom.xml
----------------------------------------------------------------------
diff --git a/contrib/management-packs/isilon-onefs-mpack/pom.xml b/contrib/management-packs/isilon-onefs-mpack/pom.xml
new file mode 100644
index 0000000..5d8f215
--- /dev/null
+++ b/contrib/management-packs/isilon-onefs-mpack/pom.xml
@@ -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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.ambari</groupId>
+  <artifactId>isilon-onefs-mpack</artifactId>
+  <packaging>pom</packaging>
+  <version>0.1.0.0-SNAPSHOT</version>
+  <name>Isilon OneFS Ambari Management Pack</name>
+  <url>http://ambari.apache.org/</url>
+  <properties>
+    <minAmbariVersion>3.0.0.0</minAmbariVersion>
+    <maxAmbariVersion></maxAmbariVersion>
+    <nifiversion>1.0.0</nifiversion>
+  </properties>
+  <parent>
+    <groupId>org.apache.ambari.contrib.mpacks</groupId>
+    <artifactId>ambari-contrib-mpacks</artifactId>
+    <version>2.0.0.0-SNAPSHOT</version>
+  </parent>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>build-helper-maven-plugin</artifactId>
+        <version>1.8</version>
+        <executions>
+          <execution>
+            <id>parse-version</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>parse-version</goal>
+            </goals>
+          </execution>
+          <execution>
+            <id>regex-property</id>
+            <goals>
+              <goal>regex-property</goal>
+            </goals>
+            <configuration>
+              <name>mpackVersion</name>
+              <value>${project.version}</value>
+              <regex>^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)(\.|-).*</regex>
+              <replacement>$1.$2.$3.$4</replacement>
+              <failIfNoMatch>false</failIfNoMatch>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <artifactId>maven-resources-plugin</artifactId>
+        <version>2.6</version>
+        <executions>
+          <execution>
+            <id>copy-resources</id>
+            <phase>compile</phase>
+            <goals>
+              <goal>copy-resources</goal>
+            </goals>
+            <configuration>
+              <outputDirectory>${basedir}/target/</outputDirectory>
+              <resources>
+                <resource>
+                  <directory>${basedir}/src/main/resources</directory>
+                  <includes>
+                    <include>mpack.json</include>
+                  </includes>
+                  <filtering>true</filtering>
+                </resource>
+              </resources>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <configuration>
+          <tarLongFileMode>gnu</tarLongFileMode>
+          <descriptors>
+            <descriptor>src/main/assemblies/isilon-onefs-mpack.xml</descriptor>
+          </descriptors>
+        </configuration>
+        <executions>
+          <execution>
+            <id>build-tarball</id>
+            <phase>package</phase>
+            <goals>
+              <goal>single</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

http://git-wip-us.apache.org/repos/asf/ambari/blob/2a1c2e49/contrib/management-packs/isilon-onefs-mpack/src/main/assemblies/isilon-onefs-mpack.xml
----------------------------------------------------------------------
diff --git a/contrib/management-packs/isilon-onefs-mpack/src/main/assemblies/isilon-onefs-mpack.xml b/contrib/management-packs/isilon-onefs-mpack/src/main/assemblies/isilon-onefs-mpack.xml
new file mode 100644
index 0000000..232cf50
--- /dev/null
+++ b/contrib/management-packs/isilon-onefs-mpack/src/main/assemblies/isilon-onefs-mpack.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+  
+       http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<assembly>
+  <id></id>
+  <formats>
+    <format>dir</format>
+    <format>tar.gz</format>
+  </formats>
+  <includeBaseDirectory>true</includeBaseDirectory>
+  <fileSets>
+     <fileSet>
+      <directory>src/main/resources/addon-services</directory>
+      <outputDirectory>addon-services</outputDirectory>
+    </fileSet>
+  </fileSets>
+  <files>
+    <file>
+      <source>target/mpack.json</source>
+    </file>
+  </files>    
+  <dependencySets>
+  </dependencySets>
+</assembly>
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/2a1c2e49/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/alerts.json
----------------------------------------------------------------------
diff --git a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/alerts.json b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/alerts.json
new file mode 100644
index 0000000..5718721
--- /dev/null
+++ b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/alerts.json
@@ -0,0 +1,46 @@
+{
+  "ONEFS":{
+    "service": [
+      {
+        "name": "onefs_namenode_cpu",
+        "label": "OneFS NameNode Host CPU Utilization",
+        "description": "This host-level alert is triggered if CPU utilization of the NameNode exceeds certain warning and critical thresholds. It checks the NameNode JMX Servlet for the SystemCPULoad property. The threshold values are in percent.",
+        "interval": 1,
+        "scope": "HOST",
+        "enabled": true,
+        "source": {
+          "type": "SERVER",
+          "class": "org.apache.ambari.server.alerts.JmxServerSideAlert",
+          "uri": {
+            "http": "${hdfs-site/dfs.namenode.http-address}",
+            "https": "${hdfs-site/dfs.namenode.https-address}",
+            "https_property": "${hdfs-site/dfs.http.policy}",
+            "https_property_value": "HTTPS_ONLY",
+            "connection_timeout": 5.0
+          },
+          "reporting": {
+            "ok": {
+              "text": "{1} CPU, load {0,number,percent}"
+            },
+            "warning": {
+              "text": "{1} CPU, load {0,number,percent}",
+              "value": 5
+            },
+            "critical": {
+              "text": "{1} CPU, load {0,number,percent}",
+              "value": 20
+            },
+            "units" : "%",
+            "type": "PERCENT"
+           },
+           "jmx": {
+             "property_list": [
+              "java.lang:type=OperatingSystem/SystemCpuLoad",
+              "java.lang:type=OperatingSystem/AvailableProcessors"
+             ]
+           }
+          }
+      }
+    ]
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/2a1c2e49/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/configuration/core-site.xml
----------------------------------------------------------------------
diff --git a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/configuration/core-site.xml b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/configuration/core-site.xml
new file mode 100644
index 0000000..7d3acd7
--- /dev/null
+++ b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/configuration/core-site.xml
@@ -0,0 +1,102 @@
+<?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.
+ -->
+<!-- Put site-specific property overrides in this file. -->
+<configuration xmlns:xi="http://www.w3.org/2001/XInclude" supports_final="true">
+  <!-- file system properties -->
+  <property>
+    <name>fs.defaultFS</name>
+    <!-- cluster variant -->
+    <value>hdfs://localhost:8020</value>
+    <description>The name of the default file system.  Either the
+  literal string "local" or a host:port for HDFS.</description>
+    <final>true</final>
+    <on-ambari-upgrade add="false"/>
+  </property>
+  <property>
+    <name>hadoop.security.authentication</name>
+    <value>simple</value>
+    <description>
+   Set the authentication for the cluster. Valid values are: simple or
+   kerberos.
+   </description>
+    <on-ambari-upgrade add="true"/>
+  </property>
+  <property>
+    <name>hadoop.security.authorization</name>
+    <value>false</value>
+    <description>
+     Enable authorization for different protocols.
+  </description>
+    <on-ambari-upgrade add="true"/>
+  </property>
+  <property>
+    <name>hadoop.security.auth_to_local</name>
+    <value>DEFAULT</value>
+    <description>The mapping from kerberos principal names to local OS mapreduce.job.user.names.
+  So the default rule is just "DEFAULT" which takes all principals in your default domain to their first component.
+  "omalley@APACHE.ORG" and "omalley/admin@APACHE.ORG" to "omalley", if your default domain is APACHE.ORG.
+The translations rules have 3 sections:
+      base     filter    substitution
+The base consists of a number that represents the number of components in the principal name excluding the realm and the pattern for building the name from the sections of the principal name. The base uses $0 to mean the realm, $1 to mean the first component and $2 to mean the second component.
+
+[1:$1@$0] translates "omalley@APACHE.ORG" to "omalley@APACHE.ORG"
+[2:$1] translates "omalley/admin@APACHE.ORG" to "omalley"
+[2:$1%$2] translates "omalley/admin@APACHE.ORG" to "omalley%admin"
+
+The filter is a regex in parens that must the generated string for the rule to apply.
+
+"(.*%admin)" will take any string that ends in "%admin"
+"(.*@ACME.COM)" will take any string that ends in "@ACME.COM"
+
+Finally, the substitution is a sed rule to translate a regex into a fixed string.
+
+"s/@ACME\.COM//" removes the first instance of "@ACME.COM".
+"s/@[A-Z]*\.COM//" removes the first instance of "@" followed by a name followed by ".COM".
+"s/X/Y/g" replaces all of the "X" in the name with "Y"
+
+So, if your default realm was APACHE.ORG, but you also wanted to take all principals from ACME.COM that had a single component "joe@ACME.COM", you'd do:
+
+RULE:[1:$1@$0](.@ACME.ORG)s/@.//
+DEFAULT
+
+To also translate the names with a second component, you'd make the rules:
+
+RULE:[1:$1@$0](.@ACME.ORG)s/@.//
+RULE:[2:$1@$0](.@ACME.ORG)s/@.//
+DEFAULT
+
+If you want to treat all principals from APACHE.ORG with /admin as "admin", your rules would look like:
+
+RULE[2:$1%$2@$0](.%admin@APACHE.ORG)s/./admin/
+DEFAULT
+    </description>
+    <value-attributes>
+      <type>multiLine</type>
+    </value-attributes>
+    <on-ambari-upgrade add="true"/>
+  </property>
+  <property>
+    <name>net.topology.script.file.name</name>
+    <value>/etc/hadoop/conf/topology_script.py</value>
+    <description>
+      Location of topology script used by Hadoop to determine the rack location of nodes.
+    </description>
+    <on-ambari-upgrade add="true"/>
+  </property>
+</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/2a1c2e49/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/configuration/hadoop-env.xml
----------------------------------------------------------------------
diff --git a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/configuration/hadoop-env.xml b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/configuration/hadoop-env.xml
new file mode 100644
index 0000000..bb671cc
--- /dev/null
+++ b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/configuration/hadoop-env.xml
@@ -0,0 +1,386 @@
+<?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_adding_forbidden="true">
+  <property>
+    <name>hdfs_log_dir_prefix</name>
+    <value>/var/log/hadoop</value>
+    <description>Hadoop Log Dir Prefix</description>
+    <display-name>Hadoop Log Dir Prefix</display-name>
+    <value-attributes>
+      <type>directory</type>
+      <overridable>false</overridable>
+    </value-attributes>
+    <on-ambari-upgrade add="true"/>
+  </property>
+  <property>
+    <name>hadoop_pid_dir_prefix</name>
+    <value>/var/run/hadoop</value>
+    <display-name>Hadoop PID Dir Prefix</display-name>
+    <description>Hadoop PID Dir Prefix</description>
+    <value-attributes>
+      <type>directory</type>
+      <overridable>false</overridable>
+      <editable-only-at-install>true</editable-only-at-install>
+    </value-attributes>
+    <on-ambari-upgrade add="true"/>
+  </property>
+  <property>
+    <name>hadoop_root_logger</name>
+    <value>INFO,RFA</value>
+    <display-name>Hadoop Root Logger</display-name>
+    <description>Hadoop Root Logger</description>
+    <value-attributes>
+      <overridable>false</overridable>
+    </value-attributes>
+    <on-ambari-upgrade add="true"/>
+  </property>
+  <property>
+    <name>hadoop_heapsize</name>
+    <value>1024</value>
+    <description>Hadoop maximum Java heap size</description>
+    <display-name>Hadoop maximum Java heap size</display-name>
+    <value-attributes>
+      <type>int</type>
+      <unit>MB</unit>
+      <overridable>false</overridable>
+    </value-attributes>
+    <on-ambari-upgrade add="true"/>
+  </property>
+  <property>
+    <name>namenode_heapsize</name>
+    <value>1024</value>
+    <description>NameNode Java heap size</description>
+    <display-name>NameNode Java heap size</display-name>
+    <value-attributes>
+      <type>int</type>
+      <minimum>0</minimum>
+      <maximum>268435456</maximum>
+      <unit>MB</unit>
+      <increment-step>256</increment-step>
+      <overridable>false</overridable>
+    </value-attributes>
+    <depends-on>
+      <property>
+        <type>hdfs-site</type>
+        <name>dfs.datanode.data.dir</name>
+      </property>
+    </depends-on>
+    <on-ambari-upgrade add="true"/>
+  </property>
+  <property>
+    <name>namenode_opt_newsize</name>
+    <value>200</value>
+    <description>Default size of Java new generation for NameNode (Java option -XX:NewSize) Note: The value of NameNode new generation size (default size of Java new generation for NameNode (Java option -XX:NewSize)) should be 1/8 of maximum heap size (-Xmx). Ensure that the value of the namenode_opt_newsize property is 1/8 the value of maximum heap size (-Xmx).</description>
+    <display-name>NameNode new generation size</display-name>
+    <depends-on>
+      <property>
+        <type>hadoop-env</type>
+        <name>namenode_heapsize</name>
+      </property>
+    </depends-on>
+    <value-attributes>
+      <type>int</type>
+      <minimum>0</minimum>
+      <maximum>16384</maximum>
+      <unit>MB</unit>
+      <increment-step>256</increment-step>
+      <overridable>false</overridable>
+    </value-attributes>
+    <on-ambari-upgrade add="true"/>
+  </property>
+  <property>
+    <name>namenode_opt_maxnewsize</name>
+    <value>200</value>
+    <description>NameNode maximum new generation size</description>
+    <display-name>NameNode maximum new generation size</display-name>
+    <depends-on>
+      <property>
+        <type>hadoop-env</type>
+        <name>namenode_heapsize</name>
+      </property>
+    </depends-on>
+    <value-attributes>
+      <type>int</type>
+      <minimum>0</minimum>
+      <maximum>16384</maximum>
+      <unit>MB</unit>
+      <increment-step>256</increment-step>
+      <overridable>false</overridable>
+    </value-attributes>
+    <on-ambari-upgrade add="true"/>
+  </property>
+  <property>
+    <name>namenode_opt_permsize</name>
+    <value>128</value>
+    <description>NameNode permanent generation size</description>
+    <display-name>NameNode permanent generation size</display-name>
+    <value-attributes>
+      <type>int</type>
+      <minimum>0</minimum>
+      <maximum>2096</maximum>
+      <unit>MB</unit>
+      <increment-step>128</increment-step>
+      <overridable>false</overridable>
+    </value-attributes>
+    <on-ambari-upgrade add="true"/>
+  </property>
+  <property>
+    <name>namenode_opt_maxpermsize</name>
+    <value>256</value>
+    <description>NameNode maximum permanent generation size</description>
+    <display-name>NameNode maximum permanent generation size</display-name>
+    <value-attributes>
+      <type>int</type>
+      <minimum>0</minimum>
+      <maximum>2096</maximum>
+      <unit>MB</unit>
+      <increment-step>128</increment-step>
+      <overridable>false</overridable>
+    </value-attributes>
+    <on-ambari-upgrade add="true"/>
+  </property>
+  <property>
+    <name>dtnode_heapsize</name>
+    <value>1024</value>
+    <description>DataNode maximum Java heap size</description>
+    <display-name>DataNode maximum Java heap size</display-name>
+    <value-attributes>
+      <type>int</type>
+      <minimum>0</minimum>
+      <maximum>268435456</maximum>
+      <unit>MB</unit>
+      <increment-step>128</increment-step>
+    </value-attributes>
+    <on-ambari-upgrade add="true"/>
+  </property>
+  <property>
+    <name>proxyuser_group</name>
+    <display-name>Proxy User Group</display-name>
+    <value>users</value>
+    <property-type>GROUP</property-type>
+    <description>Proxy user group.</description>
+    <value-attributes>
+      <type>user</type>
+      <overridable>false</overridable>
+    </value-attributes>
+    <on-ambari-upgrade add="true"/>
+  </property>
+  <property>
+    <name>hdfs_user</name>
+    <display-name>HDFS User</display-name>
+    <value>hdfs</value>
+    <property-type>USER</property-type>
+    <description>User to run HDFS as</description>
+    <value-attributes>
+      <type>user</type>
+      <overridable>false</overridable>
+    </value-attributes>
+    <on-ambari-upgrade add="true"/>
+  </property>
+  <property>
+    <name>hdfs_tmp_dir</name>
+    <value>/tmp</value>
+    <description>HDFS tmp Dir</description>
+    <display-name>HDFS tmp Dir</display-name>
+    <property-type>NOT_MANAGED_HDFS_PATH</property-type>
+    <value-attributes>
+      <read-only>true</read-only>
+      <overridable>false</overridable>
+      <visible>false</visible>
+    </value-attributes>
+    <on-ambari-upgrade add="true"/>
+  </property>
+  <property>
+    <name>hdfs_user_nofile_limit</name>
+    <value>128000</value>
+    <description>Max open files limit setting for HDFS user.</description>
+    <on-ambari-upgrade add="true"/>
+  </property>
+  <property>
+    <name>hdfs_user_nproc_limit</name>
+    <value>65536</value>
+    <description>Max number of processes limit setting for HDFS user.</description>
+    <on-ambari-upgrade add="true"/>
+  </property>
+  <property>
+    <name>namenode_backup_dir</name>
+    <description>Local directory for storing backup copy of NameNode images during upgrade</description>
+    <value>/tmp/upgrades</value>
+    <on-ambari-upgrade add="false"/>
+  </property>
+  <property>
+    <name>hdfs_user_keytab</name>
+    <description>HDFS keytab path</description>
+    <on-ambari-upgrade add="true"/>
+  </property>
+  <property>
+    <name>hdfs_principal_name</name>
+    <description>HDFS principal name</description>
+    <property-type>KERBEROS_PRINCIPAL</property-type>
+    <on-ambari-upgrade add="true"/>
+  </property>
+  <!-- hadoop-env.sh -->
+  <property>
+    <name>content</name>
+    <display-name>hadoop-env template</display-name>
+    <description>This is the jinja template for hadoop-env.sh file</description>
+    <value>
+# Set Hadoop-specific environment variables here.
+
+# The only required environment variable is JAVA_HOME.  All others are
+# optional.  When running a distributed configuration it is best to
+# set JAVA_HOME in this file, so that it is correctly defined on
+# remote nodes.
+
+# The java implementation to use.  Required.
+export JAVA_HOME={{java_home}}
+export HADOOP_HOME_WARN_SUPPRESS=1
+
+# Hadoop home directory
+export HADOOP_HOME=${HADOOP_HOME:-/usr/lib/hadoop}
+
+# Hadoop Configuration Directory
+#TODO: if env var set that can cause problems
+export HADOOP_CONF_DIR=${HADOOP_CONF_DIR:-{{hadoop_conf_dir}}}
+
+
+# Path to jsvc required by secure datanode
+export JSVC_HOME={{jsvc_path}}
+
+
+# The maximum amount of heap to use, in MB. Default is 1000.
+if [[ ("$SERVICE" = "hiveserver2") || ("$SERVICE" = "metastore") || ( "$SERVICE" = "cli") ]]; then
+  if [ "$HADOOP_HEAPSIZE" = "" ]; then
+    export HADOOP_HEAPSIZE="{{hadoop_heapsize}}"
+  fi
+else
+  export HADOOP_HEAPSIZE="{{hadoop_heapsize}}"
+fi
+
+
+export HADOOP_NAMENODE_INIT_HEAPSIZE="-Xms{{namenode_heapsize}}"
+
+# Extra Java runtime options.  Empty by default.
+export HADOOP_OPTS="-Djava.net.preferIPv4Stack=true ${HADOOP_OPTS}"
+
+# Command specific options appended to HADOOP_OPTS when specified
+
+{% if java_version &lt; 8 %}
+export HADOOP_NAMENODE_OPTS="-server -XX:ParallelGCThreads=8 -XX:+UseConcMarkSweepGC -XX:ErrorFile={{hdfs_log_dir_prefix}}/$USER/hs_err_pid%p.log -XX:NewSize={{namenode_opt_newsize}} -XX:MaxNewSize={{namenode_opt_maxnewsize}} -XX:PermSize={{namenode_opt_permsize}} -XX:MaxPermSize={{namenode_opt_maxpermsize}} -Xloggc:{{hdfs_log_dir_prefix}}/$USER/gc.log-`date +'%Y%m%d%H%M'` -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly -Xms{{namenode_heapsize}} -Xmx{{namenode_heapsize}} -Dhadoop.security.logger=INFO,DRFAS -Dhdfs.audit.logger=INFO,DRFAAUDIT -Dorg.mortbay.jetty.Request.maxFormContentSize=-1  ${HADOOP_NAMENODE_OPTS}"
+export HADOOP_SECONDARYNAMENODE_OPTS="-server -XX:ParallelGCThreads=8 -XX:+UseConcMarkSweepGC -XX:ErrorFile={{hdfs_log_dir_prefix}}/$USER/hs_err_pid%p.log -XX:NewSize={{namenode_opt_newsize}} -XX:MaxNewSize={{namenode_opt_maxnewsize}} -XX:PermSize={{namenode_opt_permsize}} -XX:MaxPermSize={{namenode_opt_maxpermsize}} -Xloggc:{{hdfs_log_dir_prefix}}/$USER/gc.log-`date +'%Y%m%d%H%M'` -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly ${HADOOP_NAMENODE_INIT_HEAPSIZE} -Xmx{{namenode_heapsize}} -Dhadoop.security.logger=INFO,DRFAS -Dhdfs.audit.logger=INFO,DRFAAUDIT ${HADOOP_SECONDARYNAMENODE_OPTS}"
+
+# The following applies to multiple commands (fs, dfs, fsck, distcp etc)
+export HADOOP_CLIENT_OPTS="-Xmx${HADOOP_HEAPSIZE}m -XX:MaxPermSize=512m $HADOOP_CLIENT_OPTS"
+{% else %}
+export HADOOP_NAMENODE_OPTS="-server -XX:ParallelGCThreads=8 -XX:+UseConcMarkSweepGC -XX:ErrorFile={{hdfs_log_dir_prefix}}/$USER/hs_err_pid%p.log -XX:NewSize={{namenode_opt_newsize}} -XX:MaxNewSize={{namenode_opt_maxnewsize}} -Xloggc:{{hdfs_log_dir_prefix}}/$USER/gc.log-`date +'%Y%m%d%H%M'` -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly -Xms{{namenode_heapsize}} -Xmx{{namenode_heapsize}} -Dhadoop.security.logger=INFO,DRFAS -Dhdfs.audit.logger=INFO,DRFAAUDIT -Dorg.mortbay.jetty.Request.maxFormContentSize=-1 ${HADOOP_NAMENODE_OPTS}"
+export HADOOP_SECONDARYNAMENODE_OPTS="-server -XX:ParallelGCThreads=8 -XX:+UseConcMarkSweepGC -XX:ErrorFile={{hdfs_log_dir_prefix}}/$USER/hs_err_pid%p.log -XX:NewSize={{namenode_opt_newsize}} -XX:MaxNewSize={{namenode_opt_maxnewsize}} -Xloggc:{{hdfs_log_dir_prefix}}/$USER/gc.log-`date +'%Y%m%d%H%M'` -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly ${HADOOP_NAMENODE_INIT_HEAPSIZE} -Xmx{{namenode_heapsize}} -Dhadoop.security.logger=INFO,DRFAS -Dhdfs.audit.logger=INFO,DRFAAUDIT ${HADOOP_SECONDARYNAMENODE_OPTS}"
+
+# The following applies to multiple commands (fs, dfs, fsck, distcp etc)
+export HADOOP_CLIENT_OPTS="-Xmx${HADOOP_HEAPSIZE}m $HADOOP_CLIENT_OPTS"
+{% endif %}
+HADOOP_JOBTRACKER_OPTS="-server -XX:ParallelGCThreads=8 -XX:+UseConcMarkSweepGC -XX:ErrorFile={{hdfs_log_dir_prefix}}/$USER/hs_err_pid%p.log -XX:NewSize={{jtnode_opt_newsize}} -XX:MaxNewSize={{jtnode_opt_maxnewsize}} -Xloggc:{{hdfs_log_dir_prefix}}/$USER/gc.log-`date +'%Y%m%d%H%M'` -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -Xmx{{jtnode_heapsize}} -Dhadoop.security.logger=INFO,DRFAS -Dmapred.audit.logger=INFO,MRAUDIT -Dhadoop.mapreduce.jobsummary.logger=INFO,JSA ${HADOOP_JOBTRACKER_OPTS}"
+
+HADOOP_TASKTRACKER_OPTS="-server -Xmx{{ttnode_heapsize}} -Dhadoop.security.logger=ERROR,console -Dmapred.audit.logger=ERROR,console ${HADOOP_TASKTRACKER_OPTS}"
+HADOOP_DATANODE_OPTS="-XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly -XX:ConcGCThreads=4 -XX:+UseConcMarkSweepGC -Xmx{{dtnode_heapsize}} -Dhadoop.security.logger=ERROR,DRFAS ${HADOOP_DATANODE_OPTS}"
+HADOOP_BALANCER_OPTS="-server -Xmx{{hadoop_heapsize}}m ${HADOOP_BALANCER_OPTS}"
+
+# On secure datanodes, user to run the datanode as after dropping privileges
+export HADOOP_SECURE_DN_USER=${HADOOP_SECURE_DN_USER:-{{hadoop_secure_dn_user}}}
+
+# Extra ssh options.  Empty by default.
+export HADOOP_SSH_OPTS="-o ConnectTimeout=5 -o SendEnv=HADOOP_CONF_DIR"
+
+# Where log files are stored.  $HADOOP_HOME/logs by default.
+export HADOOP_LOG_DIR={{hdfs_log_dir_prefix}}/$USER
+
+# History server logs
+export HADOOP_MAPRED_LOG_DIR={{mapred_log_dir_prefix}}/$USER
+
+# Where log files are stored in the secure data environment.
+export HADOOP_SECURE_DN_LOG_DIR={{hdfs_log_dir_prefix}}/$HADOOP_SECURE_DN_USER
+
+# File naming remote slave hosts.  $HADOOP_HOME/conf/slaves by default.
+# export HADOOP_SLAVES=${HADOOP_HOME}/conf/slaves
+
+# host:path where hadoop code should be rsync'd from.  Unset by default.
+# export HADOOP_MASTER=master:/home/$USER/src/hadoop
+
+# Seconds to sleep between slave commands.  Unset by default.  This
+# can be useful in large clusters, where, e.g., slave rsyncs can
+# otherwise arrive faster than the master can service them.
+# export HADOOP_SLAVE_SLEEP=0.1
+
+# The directory where pid files are stored. /tmp by default.
+export HADOOP_PID_DIR={{hadoop_pid_dir_prefix}}/$USER
+export HADOOP_SECURE_DN_PID_DIR={{hadoop_pid_dir_prefix}}/$HADOOP_SECURE_DN_USER
+
+# History server pid
+export HADOOP_MAPRED_PID_DIR={{mapred_pid_dir_prefix}}/$USER
+
+YARN_RESOURCEMANAGER_OPTS="-Dyarn.server.resourcemanager.appsummary.logger=INFO,RMSUMMARY -Drm.audit.logger=INFO,RMAUDIT"
+
+# A string representing this instance of hadoop. $USER by default.
+export HADOOP_IDENT_STRING=$USER
+
+# The scheduling priority for daemon processes.  See 'man nice'.
+
+# export HADOOP_NICENESS=10
+
+# Add database libraries
+JAVA_JDBC_LIBS=""
+if [ -d "/usr/share/java" ]; then
+  for jarFile in `ls /usr/share/java | grep -E "(mysql|ojdbc|postgresql|sqljdbc)" 2&gt;/dev/null`
+  do
+    JAVA_JDBC_LIBS=${JAVA_JDBC_LIBS}:$jarFile
+  done
+fi
+
+# Add libraries required by nodemanager
+MAPREDUCE_LIBS={{mapreduce_libs_path}}
+
+# Add libraries to the hadoop classpath - some may not need a colon as they already include it
+export HADOOP_CLASSPATH=${HADOOP_CLASSPATH}${JAVA_JDBC_LIBS}:${MAPREDUCE_LIBS}
+
+if [ -d "/usr/lib/tez" ]; then
+  export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:/usr/lib/tez/*:/usr/lib/tez/lib/*:/etc/tez/conf
+fi
+
+# Setting path to hdfs command line
+export HADOOP_LIBEXEC_DIR={{hadoop_libexec_dir}}
+
+#Mostly required for hadoop 2.0
+export JAVA_LIBRARY_PATH=${JAVA_LIBRARY_PATH}:{{hadoop_lib_home}}/native/Linux-{{architecture}}-64
+
+{% if is_datanode_max_locked_memory_set %}
+# Fix temporary bug, when ulimit from conf files is not picked up, without full relogin. 
+# Makes sense to fix only when runing DN as root 
+if [ "$command" == "datanode" ] &amp;&amp; [ "$EUID" -eq 0 ] &amp;&amp; [ -n "$HADOOP_SECURE_DN_USER" ]; then
+  ulimit -l {{datanode_max_locked_memory}}
+fi
+{% endif %}
+    </value>
+    <value-attributes>
+      <type>content</type>
+    </value-attributes>
+    <on-ambari-upgrade add="true"/>
+  </property>
+</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/2a1c2e49/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/configuration/hdfs-site.xml
----------------------------------------------------------------------
diff --git a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/configuration/hdfs-site.xml b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/configuration/hdfs-site.xml
new file mode 100644
index 0000000..cb6544f
--- /dev/null
+++ b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/configuration/hdfs-site.xml
@@ -0,0 +1,61 @@
+<?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.
+-->
+<!-- Put site-specific property overrides in this file. -->
+<configuration supports_final="true">
+  <property>
+    <name>dfs.webhdfs.enabled</name>
+    <value>false</value>
+    <display-name>WebHDFS enabled</display-name>
+    <description>Whether to enable WebHDFS feature</description>
+    <final>true</final>
+    <value-attributes>
+      <type>boolean</type>
+      <overridable>false</overridable>
+    </value-attributes>
+    <on-ambari-upgrade add="true"/>
+  </property>
+  <property>
+    <name>dfs.datanode.http.address</name>
+    <value>0.0.0.0:8082</value>
+    <description>
+      The datanode http server address and port.
+    </description>
+    <on-ambari-upgrade add="true"/>
+  </property>
+  <property>
+    <name>dfs.namenode.http-address</name>
+    <value>localhost:8082</value>
+    <description>The name of the default file system.  Either the
+      literal string "local" or a host:port for HDFS.</description>
+    <final>true</final>
+    <on-ambari-upgrade add="false"/>
+  </property>
+  <property>
+    <name>dfs.namenode.https-address</name>
+    <value>localhost:8080</value>
+    <description>The https address where namenode binds</description>
+    <on-ambari-upgrade add="false"/>
+  </property>
+  <property>
+    <name>dfs.client-write-packet-size</name>
+    <value>131072</value>
+    <description>Packet size for clients to write</description>
+    <on-ambari-upgrade add="false"/>
+  </property>
+</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/2a1c2e49/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metainfo.xml
----------------------------------------------------------------------
diff --git a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metainfo.xml b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metainfo.xml
new file mode 100644
index 0000000..f20bcf8
--- /dev/null
+++ b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metainfo.xml
@@ -0,0 +1,90 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<metainfo>
+  <schemaVersion>2.0</schemaVersion>
+  <services>
+    <service>
+      <name>ONEFS</name>
+      <displayName>OneFS</displayName>
+      <serviceType>HCFS</serviceType>
+      <comment>Isilon Systems OneFS</comment>
+      <version>1.0.0</version>
+      <components>
+       <component>
+          <name>ONEFS_CLIENT</name>
+          <displayName>OneFS Client</displayName>
+          <category>CLIENT</category>
+          <componentType>HCFS_CLIENT</componentType>
+          <cardinality>1+</cardinality>
+          <versionAdvertised>true</versionAdvertised>
+          <commandScript>
+            <script>scripts/onefs_client.py</script>
+            <scriptType>PYTHON</scriptType>
+            <timeout>1200</timeout>
+          </commandScript>
+          <configFiles>
+            <configFile>
+              <type>xml</type>
+              <fileName>hdfs-site.xml</fileName>
+              <dictionaryName>hdfs-site</dictionaryName>
+            </configFile>
+            <configFile>
+              <type>xml</type>
+              <fileName>core-site.xml</fileName>
+              <dictionaryName>core-site</dictionaryName>
+            </configFile>
+            <configFile>
+              <type>env</type>
+              <fileName>log4j.properties</fileName>
+              <dictionaryName>hdfs-log4j,yarn-log4j</dictionaryName>
+            </configFile>
+            <configFile>
+              <type>env</type>
+              <fileName>hadoop-env.sh</fileName>
+              <dictionaryName>hadoop-env</dictionaryName>
+            </configFile>
+          </configFiles>
+        </component>
+      </components>
+
+      <osSpecifics>
+        <osSpecific>
+          <osFamily>any</osFamily>
+          <packages>
+            <package>
+              <name>hadoop-client</name>
+            </package>
+          </packages>
+        </osSpecific>
+      </osSpecifics>
+
+      <commandScript>
+        <script>scripts/service_check.py</script>
+        <scriptType>PYTHON</scriptType>
+        <timeout>300</timeout>
+      </commandScript>
+
+      <configuration-dependencies>
+        <config-type>core-site</config-type>
+        <config-type>hdfs-site</config-type>
+        <config-type>hadoop-env</config-type>
+      </configuration-dependencies>
+      <restartRequiredAfterRackChange>true</restartRequiredAfterRackChange>
+    </service>
+  </services>
+</metainfo>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/2a1c2e49/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metrics.json
----------------------------------------------------------------------
diff --git a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metrics.json b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metrics.json
new file mode 100644
index 0000000..cd705eb
--- /dev/null
+++ b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metrics.json
@@ -0,0 +1,59 @@
+{
+  "ONEFS_CLIENT": {
+    "Component": [
+      {
+        "type": "ganglia",
+        "metrics": {
+          "default": {
+            "metrics/onefs/demo/counter": {
+              "metric": "onefs.demo.counter",
+              "pointInTime": true,
+              "temporal": true
+            }
+          }
+        }
+      },
+      {
+        "type": "jmx",
+        "properties": {
+          "url_config_type": "hdfs-site",
+          "url_property_name": "dfs.namenode.http-address"
+        },
+        "metrics": {
+          "default": {
+            "metrics/dfs/namenode/Used": {
+              "metric": "Hadoop:service=NameNode,name=NameNodeInfo.Used",
+              "pointInTime": true,
+              "temporal": false
+            },
+            "metrics/jvm/memHeapUsedM": {
+              "metric": "jvm.JvmMetrics.MemHeapUsedM",
+              "pointInTime": true,
+              "temporal": true
+            },
+            "metrics/jvm/HeapMemoryMax": {
+              "metric": "java.lang:type=Memory.HeapMemoryUsage[max]",
+              "pointInTime": true,
+              "temporal": false
+            },
+            "metrics/jvm/HeapMemoryUsed": {
+              "metric": "java.lang:type=Memory.HeapMemoryUsage[used]",
+              "pointInTime": true,
+              "temporal": false
+            },
+            "metrics/jvm/NonHeapMemoryMax": {
+              "metric": "java.lang:type=Memory.NonHeapMemoryUsage[max]",
+              "pointInTime": true,
+              "temporal": false
+            },
+            "metrics/jvm/NonHeapMemoryUsed": {
+              "metric": "java.lang:type=Memory.NonHeapMemoryUsage[used]",
+              "pointInTime": true,
+              "temporal": false
+            }
+          }
+        }
+      }
+    ]
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/2a1c2e49/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/__init__.py
----------------------------------------------------------------------
diff --git a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/__init__.py b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/__init__.py
new file mode 100644
index 0000000..35de4bb
--- /dev/null
+++ b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/__init__.py
@@ -0,0 +1,20 @@
+"""
+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.
+
+Ambari Agent
+
+"""

http://git-wip-us.apache.org/repos/asf/ambari/blob/2a1c2e49/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/onefs_client.py
----------------------------------------------------------------------
diff --git a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/onefs_client.py b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/onefs_client.py
new file mode 100644
index 0000000..dbf1331
--- /dev/null
+++ b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/onefs_client.py
@@ -0,0 +1,56 @@
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+"""
+from resource_management.core.exceptions import ClientComponentHasNoStatus
+from resource_management.libraries.script import Script
+from resource_management.libraries.resources.xml_config import XmlConfig
+
+class OneFsClient(Script):
+
+  def install(self, env):
+    self.install_packages(env)
+    self.configure(env)
+
+  def configure(self, env):
+    self.setup_config(env)
+
+  def status(self, env):
+    raise ClientComponentHasNoStatus()
+
+  def setup_config(self, env):
+    import params
+    env.set_params(params)
+    XmlConfig("hdfs-site.xml",
+            conf_dir=params.hadoop_conf_dir,
+            configurations=params.config['configurations']['hdfs-site'],
+            configuration_attributes=params.config['configuration_attributes']['hdfs-site'],
+            owner=params.hdfs_user,
+            group=params.user_group
+    )
+    XmlConfig("core-site.xml",
+            conf_dir=params.hadoop_conf_dir,
+            configurations=params.config['configurations']['core-site'],
+            configuration_attributes=params.config['configuration_attributes']['core-site'],
+            owner=params.hdfs_user,
+            group=params.user_group,
+            mode=0644
+    )
+
+if __name__ == "__main__":
+  OneFsClient().execute()
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/2a1c2e49/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/params.py b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/params.py
new file mode 100644
index 0000000..838510c
--- /dev/null
+++ b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/params.py
@@ -0,0 +1,29 @@
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+"""
+from ambari_commons import OSCheck
+from resource_management.libraries.functions.default import default
+
+if OSCheck.is_windows_family():
+  from params_windows import *
+else:
+  from params_linux import *
+
+nfsgateway_heapsize = config['configurations']['hadoop-env']['nfsgateway_heapsize']
+retryAble = default("/commandParams/command_retry_enabled", False)
+script_https_protocol = Script.get_force_https_protocol_name()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/2a1c2e49/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/params_linux.py b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/params_linux.py
new file mode 100644
index 0000000..72e0ae9
--- /dev/null
+++ b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/params_linux.py
@@ -0,0 +1,74 @@
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+"""
+
+from resource_management.libraries.functions.version import format_stack_version, compare_versions
+from resource_management import *
+import os
+import itertools
+import re
+from resource_management.libraries.functions import conf_select
+from resource_management.libraries.functions.get_not_managed_resources import get_not_managed_resources
+from resource_management.libraries.resources.hdfs_resource import HdfsResource
+from resource_management.libraries.functions import stack_select
+
+config = Script.get_config()
+
+hostname = config["hostname"]
+hadoop_conf_dir = conf_select.get_hadoop_conf_dir(force_latest_on_upgrade=True)
+hdfs_user = config['configurations']['hadoop-env']['hdfs_user']
+user_group = config['configurations']['cluster-env']['user_group']
+hdfs_tmp_dir = config['configurations']['hadoop-env']['hdfs_tmp_dir']
+security_enabled = config['configurations']['cluster-env']['security_enabled']
+
+namenode_host = default("/clusterHostInfo/namenode_host", [])
+journalnode_hosts = default("/clusterHostInfo/journalnode_hosts", [])
+zkfc_hosts = default("/clusterHostInfo/zkfc_hosts", [])
+
+has_journalnode_hosts = not len(journalnode_hosts)  == 0
+has_zkfc_hosts = not len(zkfc_hosts)  == 0
+is_namenode_master = hostname in namenode_host
+
+dfs_type = default("/commandParams/dfs_type", "")
+hdfs_user_keytab = config['configurations']['hadoop-env']['hdfs_user_keytab']
+kinit_path_local = get_kinit_path(default('/configurations/kerberos-env/executable_search_paths', None))
+hadoop_bin_dir = stack_select.get_hadoop_dir("bin")
+hadoop_conf_dir = conf_select.get_hadoop_conf_dir()
+hdfs_principal_name = default('/configurations/hadoop-env/hdfs_principal_name', None)
+hdfs_site = config['configurations']['hdfs-site']
+default_fs = config['configurations']['core-site']['fs.defaultFS']
+
+import functools
+#create partial functions with common arguments for every HdfsResource call
+#to create/delete/copyfromlocal hdfs directories/files we need to call params.HdfsResource in code
+HdfsResource = functools.partial(
+  HdfsResource,
+  user=hdfs_user,
+  hdfs_resource_ignore_file = "/var/lib/ambari-agent/data/.hdfs_resource_ignore",
+  security_enabled = security_enabled,
+  keytab = hdfs_user_keytab,
+  kinit_path_local = kinit_path_local,
+  hadoop_bin_dir = hadoop_bin_dir,
+  hadoop_conf_dir = hadoop_conf_dir,
+  principal_name = hdfs_principal_name,
+  hdfs_site = hdfs_site,
+  default_fs = default_fs,
+  immutable_paths = get_not_managed_resources(),
+  dfs_type = dfs_type
+)
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/2a1c2e49/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/params_windows.py
----------------------------------------------------------------------
diff --git a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/params_windows.py b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/params_windows.py
new file mode 100644
index 0000000..3e712b3
--- /dev/null
+++ b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/params_windows.py
@@ -0,0 +1,83 @@
+"""
+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 os
+
+#Used in subsequent imports from params
+from install_params import exclude_packages
+from status_params import *
+
+config = Script.get_config()
+hadoop_conf_dir = None
+hbase_conf_dir = None
+hadoop_home = None
+try:
+  hadoop_conf_dir = os.environ["HADOOP_CONF_DIR"]
+  hbase_conf_dir = os.environ["HBASE_CONF_DIR"]
+  hadoop_home = os.environ["HADOOP_HOME"]
+except:
+  pass
+#directories & files
+dfs_name_dir = config['configurations']['hdfs-site']['dfs.namenode.name.dir']
+fs_checkpoint_dir = config['configurations']['hdfs-site']['dfs.namenode.checkpoint.dir']
+dfs_data_dir = config['configurations']['hdfs-site']['dfs.datanode.data.dir']
+#decomission
+hdfs_exclude_file = default("/clusterHostInfo/decom_dn_hosts", [])
+exclude_file_path = config['configurations']['hdfs-site']['dfs.hosts.exclude']
+include_file_path = default("/configurations/hdfs-site/dfs.hosts", None)
+hdfs_include_file = None
+manage_include_files = default("/configurations/hdfs-site/manage.include.files", False)
+if include_file_path and manage_include_files:
+  slave_hosts = default("/clusterHostInfo/slave_hosts", [])
+  hdfs_include_file = list(set(slave_hosts) - set(hdfs_exclude_file))
+update_files_only = default("/commandParams/update_files_only",False)
+# HDFS High Availability properties
+dfs_ha_enabled = False
+dfs_ha_nameservices = default("/configurations/hdfs-site/dfs.internal.nameservices", None)
+dfs_ha_namenode_ids = default(format("/configurations/hdfs-site/dfs.ha.namenodes.{dfs_ha_nameservices}"), None)
+
+namenode_id = None
+namenode_rpc = None
+hostname = config["hostname"]
+if dfs_ha_namenode_ids:
+  dfs_ha_namemodes_ids_list = dfs_ha_namenode_ids.split(",")
+  dfs_ha_namenode_ids_array_len = len(dfs_ha_namemodes_ids_list)
+  if dfs_ha_namenode_ids_array_len > 1:
+    dfs_ha_enabled = True
+if dfs_ha_enabled:
+  for nn_id in dfs_ha_namemodes_ids_list:
+    nn_host = config['configurations']['hdfs-site'][format('dfs.namenode.rpc-address.{dfs_ha_nameservices}.{nn_id}')]
+    if hostname.lower() in nn_host.lower():
+      namenode_id = nn_id
+      namenode_rpc = nn_host
+
+hadoop_user = config["configurations"]["cluster-env"]["hadoop.user.name"]
+hdfs_user = hadoop_user
+
+grep_exe = "findstr"
+
+name_node_params = default("/commandParams/namenode", None)
+
+service_map = {
+  "datanode" : datanode_win_service_name,
+  "journalnode" : journalnode_win_service_name,
+  "namenode" : namenode_win_service_name,
+  "secondarynamenode" : snamenode_win_service_name,
+  "zkfc_slave": zkfc_win_service_name
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/2a1c2e49/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/service_check.py b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/service_check.py
new file mode 100644
index 0000000..3d798a3
--- /dev/null
+++ b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/service_check.py
@@ -0,0 +1,137 @@
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+"""
+
+from resource_management import *
+from resource_management.core.shell import as_user
+from ambari_commons.os_family_impl import OsFamilyImpl
+from ambari_commons import OSConst
+from resource_management.libraries.functions.curl_krb_request import curl_krb_request
+from resource_management.core.logger import Logger
+
+class HdfsServiceCheck(Script):
+  pass
+
+@OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
+class HdfsServiceCheckDefault(HdfsServiceCheck):
+  def service_check(self, env):
+    import params
+
+    env.set_params(params)
+    unique = functions.get_unique_id_and_date()
+    dir = params.hdfs_tmp_dir
+    tmp_file = format("{dir}/{unique}")
+
+    if params.security_enabled:
+      Execute(format("{kinit_path_local} -kt {hdfs_user_keytab} {hdfs_principal_name}"),
+        user=params.hdfs_user
+      )
+    params.HdfsResource(dir,
+                        type="directory",
+                        action="create_on_execute",
+                        mode=0777
+    )
+    params.HdfsResource(tmp_file,
+                        type="file",
+                        action="delete_on_execute",
+    )
+
+    params.HdfsResource(tmp_file,
+                        type="file",
+                        source="/etc/passwd",
+                        action="create_on_execute"
+    )
+    params.HdfsResource(None, action="execute")
+
+    if params.has_journalnode_hosts:
+      if params.security_enabled:
+        for host in params.journalnode_hosts:
+          if params.https_only:
+            uri = format("https://{host}:{journalnode_port}")
+          else:
+            uri = format("http://{host}:{journalnode_port}")
+          response, errmsg, time_millis = curl_krb_request(params.tmp_dir, params.smoke_user_keytab,
+                                                           params.smokeuser_principal, uri, "jn_service_check",
+                                                           params.kinit_path_local, False, None, params.smoke_user)
+          if not response:
+            Logger.error("Cannot access WEB UI on: {0}. Error : {1}", uri, errmsg)
+            return 1
+      else:
+        journalnode_port = params.journalnode_port
+        checkWebUIFileName = "checkWebUI.py"
+        checkWebUIFilePath = format("{tmp_dir}/{checkWebUIFileName}")
+        comma_sep_jn_hosts = ",".join(params.journalnode_hosts)
+
+        checkWebUICmd = format("ambari-python-wrap {checkWebUIFilePath} -m {comma_sep_jn_hosts} -p {journalnode_port} -s {https_only} -o {script_https_protocol}")
+        File(checkWebUIFilePath,
+             content=StaticFile(checkWebUIFileName),
+             mode=0775)
+
+        Execute(checkWebUICmd,
+                logoutput=True,
+                try_sleep=3,
+                tries=5,
+                user=params.smoke_user
+        )
+
+    if params.is_namenode_master:
+      if params.has_zkfc_hosts:
+        pid_dir = format("{hadoop_pid_dir_prefix}/{hdfs_user}")
+        pid_file = format("{pid_dir}/hadoop-{hdfs_user}-zkfc.pid")
+        check_zkfc_process_cmd = as_user(format(
+          "ls {pid_file} >/dev/null 2>&1 && ps -p `cat {pid_file}` >/dev/null 2>&1"), user=params.hdfs_user)
+        Execute(check_zkfc_process_cmd,
+                logoutput=True,
+                try_sleep=3,
+                tries=5
+        )
+
+@OsFamilyImpl(os_family=OSConst.WINSRV_FAMILY)
+class HdfsServiceCheckWindows(HdfsServiceCheck):
+  def service_check(self, env):
+    import params
+    env.set_params(params)
+
+    unique = functions.get_unique_id_and_date()
+
+    #Hadoop uses POSIX-style paths, separator is always /
+    dir = params.hdfs_tmp_dir
+    tmp_file = dir + '/' + unique
+
+    #commands for execution
+    hadoop_cmd = "cmd /C %s" % (os.path.join(params.hadoop_home, "bin", "hadoop.cmd"))
+    create_dir_cmd = "%s fs -mkdir %s" % (hadoop_cmd, dir)
+    own_dir = "%s fs -chmod 777 %s" % (hadoop_cmd, dir)
+    test_dir_exists = "%s fs -test -e %s" % (hadoop_cmd, dir)
+    cleanup_cmd = "%s fs -rm %s" % (hadoop_cmd, tmp_file)
+    create_file_cmd = "%s fs -put %s %s" % (hadoop_cmd, os.path.join(params.hadoop_conf_dir, "core-site.xml"), tmp_file)
+    test_cmd = "%s fs -test -e %s" % (hadoop_cmd, tmp_file)
+
+    hdfs_cmd = "cmd /C %s" % (os.path.join(params.hadoop_home, "bin", "hdfs.cmd"))
+    safemode_command = "%s dfsadmin -safemode get | %s OFF" % (hdfs_cmd, params.grep_exe)
+
+    Execute(safemode_command, logoutput=True, try_sleep=3, tries=20)
+    Execute(create_dir_cmd, user=params.hdfs_user,logoutput=True, ignore_failures=True)
+    Execute(own_dir, user=params.hdfs_user,logoutput=True)
+    Execute(test_dir_exists, user=params.hdfs_user,logoutput=True)
+    Execute(create_file_cmd, user=params.hdfs_user,logoutput=True)
+    Execute(test_cmd, user=params.hdfs_user,logoutput=True)
+    Execute(cleanup_cmd, user=params.hdfs_user,logoutput=True)
+
+if __name__ == "__main__":
+  HdfsServiceCheck().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/2a1c2e49/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/status_params.py
----------------------------------------------------------------------
diff --git a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/status_params.py b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/status_params.py
new file mode 100644
index 0000000..153f9a6
--- /dev/null
+++ b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/status_params.py
@@ -0,0 +1,58 @@
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+"""
+
+from ambari_commons import OSCheck
+
+from resource_management.libraries.functions import conf_select
+from resource_management.libraries.functions import format
+from resource_management.libraries.functions.default import default
+from resource_management.libraries.functions import get_kinit_path
+from resource_management.libraries.script.script import Script
+
+config = Script.get_config()
+
+if OSCheck.is_windows_family():
+  namenode_win_service_name = "namenode"
+  datanode_win_service_name = "datanode"
+  snamenode_win_service_name = "secondarynamenode"
+  journalnode_win_service_name = "journalnode"
+  zkfc_win_service_name = "zkfc"
+else:
+  hadoop_pid_dir_prefix = config['configurations']['hadoop-env']['hadoop_pid_dir_prefix']
+  hdfs_user = config['configurations']['hadoop-env']['hdfs_user']
+  hadoop_pid_dir = format("{hadoop_pid_dir_prefix}/{hdfs_user}")
+  datanode_pid_file = format("{hadoop_pid_dir}/hadoop-{hdfs_user}-datanode.pid")
+  namenode_pid_file = format("{hadoop_pid_dir}/hadoop-{hdfs_user}-namenode.pid")
+  snamenode_pid_file = format("{hadoop_pid_dir}/hadoop-{hdfs_user}-secondarynamenode.pid")
+  journalnode_pid_file = format("{hadoop_pid_dir}/hadoop-{hdfs_user}-journalnode.pid")
+  zkfc_pid_file = format("{hadoop_pid_dir}/hadoop-{hdfs_user}-zkfc.pid")
+  nfsgateway_pid_file = format("{hadoop_pid_dir_prefix}/root/hadoop_privileged_nfs3.pid")
+
+  # Security related/required params
+  hostname = config['hostname']
+  security_enabled = config['configurations']['cluster-env']['security_enabled']
+  hdfs_user_principal = config['configurations']['hadoop-env']['hdfs_principal_name']
+  hdfs_user_keytab = config['configurations']['hadoop-env']['hdfs_user_keytab']
+
+  hadoop_conf_dir = conf_select.get_hadoop_conf_dir()
+
+  kinit_path_local = get_kinit_path(default('/configurations/kerberos-env/executable_search_paths', None))
+  tmp_dir = Script.get_tmp_dir()
+
+stack_name = default("/hostLevelParams/stack_name", None)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/2a1c2e49/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/widgets.json
----------------------------------------------------------------------
diff --git a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/widgets.json b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/widgets.json
new file mode 100644
index 0000000..23da1d6
--- /dev/null
+++ b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/widgets.json
@@ -0,0 +1,38 @@
+{
+  "layouts": [
+    {
+      "layout_name": "default_onefs_layout",
+      "display_name": "Standard ONEFS Dashboard",
+      "section_name": "ONEFS_SUMMARY",
+      "widgetLayoutInfo": [
+        {
+          "widget_name": "OneFS metrics demo",
+          "description": "Test widget",
+          "default_section_name": "ONEFS_SUMMARY",
+          "widget_type": "GRAPH",
+          "is_visible": true,
+          "scope" : "SERVICE",
+          "metrics": [
+            {
+              "name": "counter",
+              "metric_path": "metrics/onefs/demo/counter",
+              "service_name": "ONEFS",
+              "component_name": "ONEFS_CLUSTER"
+            }
+          ],
+          "values": [
+            {
+              "name": "demo value",
+              "values" : "${counter}"
+            }
+          ],
+          "properties": {
+            "graph_type": "LINE",
+            "time_range": "1",
+            "display_unit": "%"
+          }
+        }
+      ]
+    }
+  ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/2a1c2e49/contrib/management-packs/isilon-onefs-mpack/src/main/resources/mpack.json
----------------------------------------------------------------------
diff --git a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/mpack.json b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/mpack.json
new file mode 100644
index 0000000..f15fcb6
--- /dev/null
+++ b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/mpack.json
@@ -0,0 +1,28 @@
+{
+  "type" : "full-release",
+  "name" : "onefs-ambari-mpack",
+  "version": "0.1",
+  "description" : "OneFS Ambari Management Pack",
+  "prerequisites": {
+    "min-ambari-version" : "3.0.0.0"
+  },
+  "artifacts": [
+    {
+      "name" : "ONEFS-addon-services",
+      "type" : "stack-addon-service-definitions",
+      "source_dir" : "addon-services",
+      "service_versions_map" : [
+          {
+             "service_name" : "ONEFS",
+             "service_version" : "1.0.0",
+             "applicable_stacks" : [
+                 {
+                      "stack_name" : "HDP", "stack_version" : "2.6"
+                  }
+              ]
+          }
+      ]
+    }
+  ]
+}
+


[43/50] [abbrv] ambari git commit: AMBARI-22236. Expression parser support for JMXServerSide alerts (amagyar)

Posted by am...@apache.org.
AMBARI-22236. Expression parser support for JMXServerSide alerts (amagyar)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: ae45a551f2b1029285e891772a3580ae741f1efb
Parents: 362b4f0
Author: Attila Magyar <am...@hortonworks.com>
Authored: Tue Oct 17 16:15:15 2017 +0200
Committer: Attila Magyar <am...@hortonworks.com>
Committed: Wed Nov 22 10:50:40 2017 +0100

----------------------------------------------------------------------
 .../server/alerts/JmxServerSideAlert.java       | 42 ++++++------
 .../server/state/alert/AlertDefinition.java     | 13 ++++
 .../ambari/server/state/alert/MetricSource.java | 59 ++++++++++++++++-
 .../ambari/server/state/alert/Reporting.java    | 16 ++---
 .../AlertDefinitionResourceProviderTest.java    |  4 +-
 .../ambari/server/state/alert/JmxInfoTest.java  | 68 ++++++++++++++++++++
 6 files changed, 162 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ae45a551/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java b/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
index a4b86f8..09eb0a4 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
@@ -23,6 +23,7 @@ import static java.util.Collections.singletonList;
 import java.net.URI;
 import java.util.List;
 import java.util.Map;
+import java.util.Optional;
 
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.configuration.ComponentSSLConfiguration;
@@ -35,7 +36,6 @@ import org.apache.ambari.server.state.ConfigHelper;
 import org.apache.ambari.server.state.alert.AlertDefinition;
 import org.apache.ambari.server.state.alert.AlertDefinitionFactory;
 import org.apache.ambari.server.state.alert.MetricSource;
-import org.apache.ambari.server.state.alert.Reporting;
 import org.apache.ambari.server.state.alert.ServerSource;
 import org.apache.ambari.server.state.services.MetricsRetrievalService;
 import org.slf4j.Logger;
@@ -64,41 +64,35 @@ public class JmxServerSideAlert extends AlertRunnable {
   List<Alert> execute(Cluster cluster, AlertDefinitionEntity entity) throws AmbariException {
     AlertDefinition alertDef = definitionFactory.coerce(entity);
     ServerSource serverSource = (ServerSource) alertDef.getSource();
-    URI jmxUrl = jmxUrl(cluster, serverSource);
-    JMXMetricHolder metricHolder = jmxMetric(serverSource, jmxUrl);
-    return metricHolder == null
-      ? emptyList()
-      : alerts(alertDef, serverSource.getJmxInfo(), metricHolder, serverSource.getReporting());
+    return buildAlert(jmxMetric(serverSource, cluster), serverSource.getJmxInfo(), alertDef)
+      .map(alert -> singletonList(alert))
+      .orElse(emptyList());
   }
 
-  private URI jmxUrl(Cluster cluster, ServerSource serverSource) throws AmbariException {
-    return serverSource.getUri().resolve(config(cluster)).resolve(serverSource.getJmxInfo().getUrlSuffix());
+  public Optional<Alert> buildAlert(Optional<JMXMetricHolder> metricHolder, MetricSource.JmxInfo jmxInfo, AlertDefinition alertDef) {
+    return metricHolder.flatMap(metric -> buildAlert(metric, jmxInfo, alertDef));
   }
 
-  private Map<String, Map<String, String>> config(Cluster cluster) throws AmbariException {
-    return configHelper.getEffectiveConfigProperties(cluster, configHelper.getEffectiveDesiredTags(cluster, null));
+  private Optional<Alert> buildAlert(JMXMetricHolder metricHolder, MetricSource.JmxInfo jmxInfo, AlertDefinition alertDef) {
+    List<Object> allMetrics = metricHolder.findAll(jmxInfo.getPropertyList());
+    return jmxInfo.eval(metricHolder).map(val -> alertDef.buildAlert(val.doubleValue(), allMetrics));
   }
 
-  private JMXMetricHolder jmxMetric(ServerSource serverSource, URI jmxUri) {
+  private Optional<JMXMetricHolder> jmxMetric(ServerSource serverSource, Cluster cluster) throws AmbariException {
+    URI jmxUri = jmxUrl(cluster, serverSource);
     URLStreamProvider streamProvider = new URLStreamProvider(
       serverSource.getUri().getConnectionTimeoutMsec(),
       serverSource.getUri().getReadTimeoutMsec(),
       ComponentSSLConfiguration.instance());
     metricsRetrievalService.submitRequest(MetricsRetrievalService.MetricSourceType.JMX, streamProvider, jmxUri.toString());
-    return metricsRetrievalService.getCachedJMXMetric(jmxUri.toString());
+    return Optional.ofNullable(metricsRetrievalService.getCachedJMXMetric(jmxUri.toString()));
+  }
+
+  private URI jmxUrl(Cluster cluster, ServerSource serverSource) throws AmbariException {
+    return serverSource.getUri().resolve(config(cluster)).resolve(serverSource.getJmxInfo().getUrlSuffix());
   }
 
-  private List<Alert> alerts(AlertDefinition alertDef, MetricSource.JmxInfo jmxInfo, JMXMetricHolder jmxMetricHolder, Reporting reporting) throws AmbariException {
-    List<Object> metrics = jmxMetricHolder.findAll(jmxInfo.getPropertyList());
-    if (metrics.isEmpty()) {
-      return emptyList();
-    }
-    if (metrics.get(0) instanceof Number) {
-      Alert alert = reporting.alert(((Number) metrics.get(0)).doubleValue(), metrics, alertDef);
-      return singletonList(alert);
-    } else {
-      LOG.info("Unsupported metrics value: {} when running alert: {}", metrics.get(0), alertDef);
-      return emptyList();
-    }
+  private Map<String, Map<String, String>> config(Cluster cluster) throws AmbariException {
+    return configHelper.getEffectiveConfigProperties(cluster, configHelper.getEffectiveDesiredTags(cluster, null));
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/ae45a551/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinition.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinition.java b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinition.java
index 665430d..f1f21a4 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinition.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinition.java
@@ -18,7 +18,10 @@
 package org.apache.ambari.server.state.alert;
 
 import java.util.HashSet;
+import java.util.List;
 
+import org.apache.ambari.server.state.Alert;
+import org.apache.ambari.server.state.AlertState;
 import org.apache.commons.lang.StringUtils;
 
 import com.google.gson.annotations.SerializedName;
@@ -354,6 +357,16 @@ public class AlertDefinition {
   }
 
   /**
+   * Map the incoming value to {@link AlertState} and generate an alert with that state.
+   */
+  public Alert buildAlert(double value, List<Object> args) {
+    Reporting reporting = source.getReporting();
+    Alert alert = new Alert(name, null, serviceName, componentName, null, reporting.state(value));
+    alert.setText(reporting.formatMessage(value, args));
+    return alert;
+  }
+
+  /**
    * Gets equality based on name only.
    *
    * @see #deeplyEquals(Object)

http://git-wip-us.apache.org/repos/asf/ambari/blob/ae45a551/ambari-server/src/main/java/org/apache/ambari/server/state/alert/MetricSource.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/MetricSource.java b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/MetricSource.java
index d7283fe..019f3b1 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/MetricSource.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/MetricSource.java
@@ -17,8 +17,16 @@
  */
 package org.apache.ambari.server.state.alert;
 
+import static java.util.stream.Collectors.toMap;
+import static java.util.stream.IntStream.range;
+
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Optional;
+
+import org.apache.ambari.server.controller.jmx.JMXMetricHolder;
+import org.springframework.expression.spel.standard.SpelExpressionParser;
+import org.springframework.expression.spel.support.StandardEvaluationContext;
 
 import com.google.gson.annotations.SerializedName;
 
@@ -127,7 +135,7 @@ public class MetricSource extends Source {
     @SerializedName("property_list")
     private List<String> propertyList;
 
-    private String value;
+    private String value = "{0}";
 
     @SerializedName("url_suffix")
     private String urlSuffix = "/jmx";
@@ -136,8 +144,16 @@ public class MetricSource extends Source {
       return propertyList;
     }
 
-    public String getValue() {
-      return value;
+    public void setPropertyList(List<String> propertyList) {
+      this.propertyList = propertyList;
+    }
+
+    public void setValue(String value) {
+      this.value = value;
+    }
+
+    public Value getValue() {
+      return new Value(value);
     }
 
     @Override
@@ -159,5 +175,42 @@ public class MetricSource extends Source {
     public String getUrlSuffix() {
       return urlSuffix;
     }
+
+    public Optional<Number> eval(JMXMetricHolder jmxMetricHolder) {
+      List<Object> metrics = jmxMetricHolder.findAll(propertyList);
+      if (metrics.isEmpty()) {
+        return Optional.empty();
+      } else {
+        Object value = getValue().eval(metrics);
+        return value instanceof Number ? Optional.of((Number)value) : Optional.empty();
+      }
+    }
+  }
+
+  public static class Value {
+    private final String value;
+
+    public Value(String value) {
+      this.value = value;
+    }
+
+    /**
+     * Evaluate an expression like "{0}/({0} + {1}) * 100.0" where each positional argument represent a metrics value.
+     * The value is converted to SpEL syntax:
+     *  #var0/(#var0 + #var1) * 100.0
+     * then it is evaluated in the context of the metrics parameters.
+     */
+    public Object eval(List<Object> metrics) {
+      StandardEvaluationContext context = new StandardEvaluationContext();
+      context.setVariables(range(0, metrics.size()).boxed().collect(toMap(i -> "var" + i, metrics::get)));
+      return new SpelExpressionParser()
+        .parseExpression(value.replaceAll("(\\{(\\d+)\\})", "#var$2"))
+        .getValue(context);
+    }
+
+    @Override
+    public String toString() {
+      return value;
+    }
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/ae45a551/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
index 51d074e..a7e11e1 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
@@ -23,7 +23,6 @@ import java.text.MessageFormat;
 import java.util.List;
 
 import org.apache.ambari.server.alerts.Threshold;
-import org.apache.ambari.server.state.Alert;
 import org.apache.ambari.server.state.AlertState;
 
 import com.google.gson.annotations.SerializedName;
@@ -208,16 +207,7 @@ public class Reporting {
     return true;
   }
 
-  /**
-   * Map the incoming value to {@link AlertState} and generate an alert with that state.
-   */
-  public Alert alert(double value, List<Object> args, AlertDefinition alertDef) {
-    Alert alert = new Alert(alertDef.getName(), null, alertDef.getServiceName(), alertDef.getComponentName(), null, state(value));
-    alert.setText(MessageFormat.format(message(value), args.toArray()));
-    return alert;
-  }
-
-  private AlertState state(double value) {
+  public AlertState state(double value) {
     return getThreshold().state(PERCENT == getType() ? value * 100 : value);
   }
 
@@ -225,6 +215,10 @@ public class Reporting {
     return new Threshold(getOk().getValue(), getWarning().getValue(), getCritical().getValue());
   }
 
+  public String formatMessage(double value, List<Object> args) {
+    return MessageFormat.format(message(value), args.toArray());
+  }
+
   private String message(double value) {
     switch (state(value)) {
       case OK:

http://git-wip-us.apache.org/repos/asf/ambari/blob/ae45a551/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AlertDefinitionResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AlertDefinitionResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AlertDefinitionResourceProviderTest.java
index 3ef2c48..e8ad651 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AlertDefinitionResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AlertDefinitionResourceProviderTest.java
@@ -457,7 +457,7 @@ public class AlertDefinitionResourceProviderTest {
 
     // JMX
     requestProps.put("AlertDefinition/source/jmx/value",
-        source.getJmxInfo().getValue());
+        source.getJmxInfo().getValue().toString());
     requestProps.put("AlertDefinition/source/jmx/property_list",
         source.getJmxInfo().getPropertyList());
 
@@ -600,7 +600,7 @@ public class AlertDefinitionResourceProviderTest {
 
     // JMX
     requestProps.put("AlertDefinition/source/jmx/value",
-        source.getJmxInfo().getValue());
+        source.getJmxInfo().getValue().toString());
     requestProps.put("AlertDefinition/source/jmx/property_list",
         source.getJmxInfo().getPropertyList());
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ae45a551/ambari-server/src/test/java/org/apache/ambari/server/state/alert/JmxInfoTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/alert/JmxInfoTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/alert/JmxInfoTest.java
new file mode 100644
index 0000000..308ab4f
--- /dev/null
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/alert/JmxInfoTest.java
@@ -0,0 +1,68 @@
+package org.apache.ambari.server.state.alert;
+
+import static java.util.Arrays.asList;
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+import java.util.HashMap;
+import java.util.Optional;
+
+import org.apache.ambari.server.controller.jmx.JMXMetricHolder;
+import org.junit.Test;
+
+public class JmxInfoTest {
+  private static final String JMX_PROP_NAME1 = "Hadoop:service=NameNode,name=FSNamesystem/CapacityUsed";
+  private static final String JMX_PROP_NAME2 = "Hadoop:service=NameNode,name=FSNamesystem/CapacityRemaining";
+
+  @Test
+  public void testFindJmxMetricsAndCalculateSimpleValue() throws Exception {
+    MetricSource.JmxInfo jmxInfo = jmxInfoWith("{1}");
+    JMXMetricHolder metrics = metrics(12.5, 3.5);
+    assertThat(jmxInfo.eval(metrics), is(Optional.of(3.5)));
+  }
+
+  @Test
+  public void testFindJmxMetricsAndCalculateComplexValue() throws Exception {
+    MetricSource.JmxInfo jmxInfo = jmxInfoWith("2 * ({0} + {1})");
+    JMXMetricHolder metrics = metrics(12.5, 2.5);
+    assertThat(jmxInfo.eval(metrics), is(Optional.of(30.0)));
+  }
+
+  @Test
+  public void testReturnsEmptyWhenJmxPropertyWasNotFound() throws Exception {
+    MetricSource.JmxInfo jmxInfo = new MetricSource.JmxInfo();
+    jmxInfo.setPropertyList(asList("notfound/notfound"));
+    JMXMetricHolder metrics = metrics(1, 2);
+    assertThat(jmxInfo.eval(metrics), is(Optional.empty()));
+  }
+
+  private MetricSource.JmxInfo jmxInfoWith(String value) {
+    MetricSource.JmxInfo jmxInfo = new MetricSource.JmxInfo();
+    jmxInfo.setValue(value);
+    jmxInfo.setPropertyList(asList(JMX_PROP_NAME1, JMX_PROP_NAME2));
+    return jmxInfo;
+  }
+
+  private JMXMetricHolder metrics(final double jmxValue1, final double jmxValue2) {
+    JMXMetricHolder metrics = new JMXMetricHolder();
+    metrics.setBeans(asList(
+      new HashMap<String,Object>() {{
+        put("name", name(JMX_PROP_NAME1));
+        put(key(JMX_PROP_NAME1), jmxValue1);
+      }},
+      new HashMap<String,Object>() {{
+        put("name", name(JMX_PROP_NAME2));
+        put(key(JMX_PROP_NAME2), jmxValue2);
+      }}
+    ));
+    return metrics;
+  }
+
+  private String name(String jmxProp) {
+    return jmxProp.split("/")[0];
+  }
+
+  private String key(String jmxProp) {
+    return jmxProp.split("/")[1];
+  }
+}
\ No newline at end of file


[08/50] [abbrv] ambari git commit: AMBARI-22346. Beeline connection hangs for longer time when connection to HS2 with metastore DB down (aonishuk)

Posted by am...@apache.org.
AMBARI-22346. Beeline connection hangs for longer time when connection to HS2 with metastore DB down (aonishuk)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 98915a114769c7ddd590854ccf0ab33beabddcf3
Parents: 46ad6c6
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Fri Nov 10 13:28:27 2017 +0200
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Fri Nov 10 13:28:27 2017 +0200

----------------------------------------------------------------------
 .../HIVE/0.12.0.2.0/package/alerts/alert_hive_thrift_port.py | 3 ++-
 .../1.2.1/package/scripts/alerts/alert_spark_thrift_port.py  | 8 +++++++-
 .../2.0.0/package/scripts/alerts/alert_spark2_thrift_port.py | 8 +++++++-
 3 files changed, 16 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/98915a11/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_thrift_port.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_thrift_port.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_thrift_port.py
index 3560bf8..6db92b0 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_thrift_port.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_thrift_port.py
@@ -28,6 +28,7 @@ from resource_management.libraries.functions import format
 from resource_management.libraries.functions import get_kinit_path
 from ambari_commons.os_check import OSConst
 from ambari_commons.os_family_impl import OsFamilyFuncImpl, OsFamilyImpl
+from resource_management.core.signal_utils import TerminateStrategy
 
 OK_MESSAGE = "TCP OK - {0:.3f}s response on port {1}"
 CRITICAL_MESSAGE = "Connection failed on host {0}:{1} ({2})"
@@ -271,7 +272,7 @@ def execute(configurations={}, parameters={}, host_name=None):
 
     start_time = time.time()
     try:
-      Execute(cmd, user=hiveuser, timeout=30)
+      Execute(cmd, user=hiveuser, timeout=30, timeout_kill_strategy=TerminateStrategy.KILL_PROCESS_TREE)
       total_time = time.time() - start_time
       result_code = 'OK'
       label = OK_MESSAGE.format(total_time, port)

http://git-wip-us.apache.org/repos/asf/ambari/blob/98915a11/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/alerts/alert_spark_thrift_port.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/alerts/alert_spark_thrift_port.py b/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/alerts/alert_spark_thrift_port.py
index 3f80fd9..6874cb4 100644
--- a/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/alerts/alert_spark_thrift_port.py
+++ b/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/alerts/alert_spark_thrift_port.py
@@ -27,6 +27,7 @@ from resource_management.libraries.script.script import Script
 from resource_management.libraries.functions import get_kinit_path
 from resource_management.core.resources import Execute
 from resource_management.core import global_lock
+from resource_management.core.signal_utils import TerminateStrategy
 
 stack_root = Script.get_stack_root()
 
@@ -140,7 +141,12 @@ def execute(configurations={}, parameters={}, host_name=None):
 
         start_time = time.time()
         try:
-            Execute(cmd, user=hiveruser, path=[beeline_cmd], timeout=CHECK_COMMAND_TIMEOUT_DEFAULT)
+            Execute(cmd,
+                    user=hiveruser,
+                    path=[beeline_cmd],
+                    timeout=CHECK_COMMAND_TIMEOUT_DEFAULT,
+                    timeout_kill_strategy=TerminateStrategy.KILL_PROCESS_TREE,
+            )
             total_time = time.time() - start_time
             result_code = 'OK'
             label = OK_MESSAGE.format(total_time, port)

http://git-wip-us.apache.org/repos/asf/ambari/blob/98915a11/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/alerts/alert_spark2_thrift_port.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/alerts/alert_spark2_thrift_port.py b/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/alerts/alert_spark2_thrift_port.py
index 9e1afea..d3660de 100644
--- a/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/alerts/alert_spark2_thrift_port.py
+++ b/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/alerts/alert_spark2_thrift_port.py
@@ -27,6 +27,7 @@ from resource_management.libraries.script.script import Script
 from resource_management.libraries.functions import get_kinit_path
 from resource_management.core.resources import Execute
 from resource_management.core import global_lock
+from resource_management.core.signal_utils import TerminateStrategy
 
 
 stack_root = Script.get_stack_root()
@@ -141,7 +142,12 @@ def execute(configurations={}, parameters={}, host_name=None):
 
         start_time = time.time()
         try:
-            Execute(cmd, user=hiveruser, path=[beeline_cmd], timeout=CHECK_COMMAND_TIMEOUT_DEFAULT)
+            Execute(cmd,
+                    user=hiveruser,
+                    path=[beeline_cmd],
+                    timeout=CHECK_COMMAND_TIMEOUT_DEFAULT,
+                    timeout_kill_strategy=TerminateStrategy.KILL_PROCESS_TREE
+            )
             total_time = time.time() - start_time
             result_code = 'OK'
             label = OK_MESSAGE.format(total_time, port)


[05/50] [abbrv] ambari git commit: AMBARI-22338 : Review Request for new HDP StackFeatures entry(mradhakrishnan on behalf of ydavis)

Posted by am...@apache.org.
AMBARI-22338 : Review Request for new HDP StackFeatures entry(mradhakrishnan on behalf of ydavis)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: c693de3650d9b115a3da7639dbd97931c6ebb61b
Parents: 430dcbf
Author: Madhuvanthi Radhakrishnan <mr...@hortonworks.com>
Authored: Thu Nov 9 11:09:32 2017 -0800
Committer: Madhuvanthi Radhakrishnan <mr...@hortonworks.com>
Committed: Thu Nov 9 11:09:32 2017 -0800

----------------------------------------------------------------------
 .../resources/stacks/HDP/2.0.6/properties/stack_features.json   | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c693de36/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 86de20d..702fb13 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
@@ -427,6 +427,11 @@
         "name": "hadoop_custom_extensions",
         "description": "Support hadoop custom extensions",
         "min_version": "2.6.0.0"
+      },
+      {
+        "name": "sam_storage_core_in_registry",
+        "description": "Storage core module moved to registry",
+        "min_version": "2.6.0.0"
       }
     ]
   }


[18/50] [abbrv] ambari git commit: AMBARI-22347. Simplify Ambari configuration tables from AMBARI-21307 (rlevas)

Posted by am...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/4fa9ac55/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProviderTest.java
index c2a1421..a2ecb27 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProviderTest.java
@@ -14,238 +14,364 @@
 
 package org.apache.ambari.server.controller.internal;
 
+import static org.apache.ambari.server.controller.internal.AmbariConfigurationResourceProvider.AMBARI_CONFIGURATION_CATEGORY_PROPERTY_ID;
+import static org.apache.ambari.server.controller.internal.AmbariConfigurationResourceProvider.AMBARI_CONFIGURATION_PROPERTIES_PROPERTY_ID;
+import static org.easymock.EasyMock.anyObject;
+import static org.easymock.EasyMock.capture;
+import static org.easymock.EasyMock.eq;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.expectLastCall;
+import static org.easymock.EasyMock.newCapture;
+
+import java.util.ArrayList;
+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 javax.persistence.EntityManager;
 
 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.utilities.PredicateBuilder;
-import org.apache.ambari.server.events.AmbariLdapConfigChangedEvent;
+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.orm.entities.ConfigurationBaseEntity;
+import org.apache.ambari.server.security.TestAuthenticationFactory;
+import org.apache.ambari.server.security.authorization.AuthorizationException;
 import org.easymock.Capture;
-import org.easymock.EasyMock;
-import org.easymock.EasyMockRule;
 import org.easymock.EasyMockSupport;
-import org.easymock.Mock;
-import org.easymock.TestSubject;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Rule;
+import org.junit.After;
 import org.junit.Test;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.core.context.SecurityContextHolder;
 
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-import com.google.common.collect.Sets;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
+import com.google.inject.AbstractModule;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
 
 public class AmbariConfigurationResourceProviderTest extends EasyMockSupport {
 
-  @Rule
-  public EasyMockRule mocks = new EasyMockRule(this);
+  private static final String CATEGORY_NAME_1 = "test-category-1";
+  private static final String CATEGORY_NAME_2 = "test-category-2";
 
-  @Mock
-  private Request requestMock;
+  @After
+  public void clearAuthentication() {
+    SecurityContextHolder.getContext().setAuthentication(null);
+  }
 
-  @Mock
-  private AmbariConfigurationDAO ambariConfigurationDAO;
+  @Test
+  public void testCreateResources_Administrator() throws Exception {
+    testCreateResources(TestAuthenticationFactory.createAdministrator());
+  }
 
-  @Mock
-  private AmbariEventPublisher publisher;
+  @Test(expected = AuthorizationException.class)
+  public void testCreateResources_ClusterAdministrator() throws Exception {
+    testCreateResources(TestAuthenticationFactory.createClusterAdministrator());
+  }
 
-  private Capture<AmbariConfigurationEntity> ambariConfigurationEntityCapture;
+  @Test(expected = AuthorizationException.class)
+  public void testCreateResources_ClusterOperator() throws Exception {
+    testCreateResources(TestAuthenticationFactory.createClusterOperator());
+  }
 
-  private Gson gson;
+  @Test(expected = AuthorizationException.class)
+  public void testCreateResources_ServiceAdministrator() throws Exception {
+    testCreateResources(TestAuthenticationFactory.createServiceAdministrator());
+  }
 
-  private static final String DATA_MOCK_STR = "[\n" +
-    "      {\n" +
-    "        \"authentication.ldap.baseDn\" : \"dc=ambari,dc=apache,dc=org\",\n" +
-    "        \"authentication.ldap.primaryUrl\" : \"localhost:33389\",\n" +
-    "        \"authentication.ldap.secondaryUrl\" : \"localhost:333\"\n" +
-    "      }\n" +
-    "    ]";
+  @Test(expected = AuthorizationException.class)
+  public void testCreateResources_ServiceOperator() throws Exception {
+    testCreateResources(TestAuthenticationFactory.createServiceOperator());
+  }
 
-  private static final Long PK_LONG = Long.valueOf(1);
-  private static final String PK_STRING = String.valueOf(1);
-  private static final String VERSION_TAG = "test version";
-  private static final String VERSION = "1";
-  private static final String TYPE = "AmbariConfiguration";
+  private void testCreateResources(Authentication authentication) throws Exception {
+    Injector injector = createInjector();
 
-  @TestSubject
-  private AmbariConfigurationResourceProvider ambariConfigurationResourceProvider = new AmbariConfigurationResourceProvider();
+    ResourceProvider resourceProvider = injector.getInstance(AmbariConfigurationResourceProvider.class);
 
-  @Before
-  public void setup() {
-    ambariConfigurationEntityCapture = Capture.newInstance();
-    gson = new GsonBuilder().create();
-  }
+    Set<Map<String, Object>> propertySets = new HashSet<>();
 
-  @Test
-  public void testCreateAmbariConfigurationRequestResultsInTheProperPersistenceCall() throws Exception {
-
-    // GIVEN
-    // configuration properties parsed from the request
-    Set<Map<String, Object>> resourcePropertiesSet = Sets.newHashSet(
-      new PropertiesMapBuilder()
-        .withId(PK_LONG)
-        .withVersion(VERSION)
-        .withVersionTag(VERSION_TAG)
-        .withData(DATA_MOCK_STR)
-        .withType(TYPE)
-        .build());
-
-    // mock the request to return the properties
-    EasyMock.expect(requestMock.getProperties()).andReturn(resourcePropertiesSet);
-
-    // capture the entity the DAO gets called with
-    ambariConfigurationDAO.create(EasyMock.capture(ambariConfigurationEntityCapture));
-    publisher.publish(EasyMock.anyObject(AmbariLdapConfigChangedEvent.class));
+    Map<String, String> properties1 = new HashMap<>();
+    properties1.put("property1a", "value1");
+    properties1.put("property2a", "value2");
+    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));
+
+    Request request = createMock(Request.class);
+    expect(request.getProperties()).andReturn(propertySets).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();
+
+    AmbariEventPublisher publisher = injector.getInstance(AmbariEventPublisher.class);
+    publisher.publish(anyObject(AmbariConfigurationChangedEvent.class));
+    expectLastCall().times(2);
 
     replayAll();
 
-    // WHEN
-    ambariConfigurationResourceProvider.createResourcesAuthorized(requestMock);
+    SecurityContextHolder.getContext().setAuthentication(authentication);
 
-    // THEN
-    AmbariConfigurationEntity capturedAmbariConfigurationEntity = ambariConfigurationEntityCapture.getValue();
-    Assert.assertNotNull(capturedAmbariConfigurationEntity);
-    Assert.assertNull("The entity identifier should be null", capturedAmbariConfigurationEntity.getId());
-    Assert.assertEquals("The entity version is not the expected", Integer.valueOf(VERSION),
-      capturedAmbariConfigurationEntity.getConfigurationBaseEntity().getVersion());
-    Assert.assertEquals("The entity version tag is not the expected", VERSION_TAG,
-      capturedAmbariConfigurationEntity.getConfigurationBaseEntity().getVersionTag());
-    Assert.assertEquals("The entity data is not the expected", DATA_MOCK_STR,
-      gson.fromJson(capturedAmbariConfigurationEntity.getConfigurationBaseEntity().getConfigurationData(), String.class));
+    resourceProvider.createResources(request);
+
+    verifyAll();
+
+    validateCapturedProperties(properties1, capturedProperties1);
+    validateCapturedProperties(properties2, capturedProperties2);
   }
 
   @Test
-  public void testRemoveAmbariConfigurationRequestResultsInTheProperPersistenceCall() throws Exception {
-    // GIVEN
-    Predicate predicate = new PredicateBuilder().property(
-      AmbariConfigurationResourceProvider.ResourcePropertyId.ID.getPropertyId()).equals("1").toPredicate();
+  public void testDeleteResources_Administrator() throws Exception {
+    testDeleteResources(TestAuthenticationFactory.createAdministrator());
+  }
 
-    Capture<Long> pkCapture = Capture.newInstance();
-    ambariConfigurationDAO.removeByPK(EasyMock.capture(pkCapture));
-    publisher.publish(EasyMock.anyObject(AmbariLdapConfigChangedEvent.class));
+  @Test(expected = AuthorizationException.class)
+  public void testDeleteResources_ClusterAdministrator() throws Exception {
+    testDeleteResources(TestAuthenticationFactory.createClusterAdministrator());
+  }
 
-    replayAll();
+  @Test(expected = AuthorizationException.class)
+  public void testDeleteResources_ClusterOperator() throws Exception {
+    testDeleteResources(TestAuthenticationFactory.createClusterOperator());
+  }
 
-    // WHEN
-    ambariConfigurationResourceProvider.deleteResourcesAuthorized(requestMock, predicate);
+  @Test(expected = AuthorizationException.class)
+  public void testDeleteResources_ServiceAdministrator() throws Exception {
+    testDeleteResources(TestAuthenticationFactory.createServiceAdministrator());
+  }
 
-    // THEN
-    Assert.assertEquals("The pk of the entity to be removed doen't match the expected id", Long.valueOf(1), pkCapture.getValue());
+  @Test(expected = AuthorizationException.class)
+  public void testDeleteResources_ServiceOperator() throws Exception {
+    testDeleteResources(TestAuthenticationFactory.createServiceOperator());
   }
 
+  private void testDeleteResources(Authentication authentication) throws Exception {
+    Injector injector = createInjector();
 
-  @Test
-  public void testRetrieveAmbariConfigurationShouldResultsInTheProperDAOCall() throws Exception {
-    // GIVEN
-    Predicate predicate = new PredicateBuilder().property(
-      AmbariConfigurationResourceProvider.ResourcePropertyId.ID.getPropertyId()).equals("1").toPredicate();
+    ResourceProvider resourceProvider = injector.getInstance(AmbariConfigurationResourceProvider.class);
+
+    Predicate predicate = new PredicateBuilder()
+        .property(AMBARI_CONFIGURATION_CATEGORY_PROPERTY_ID)
+        .equals(CATEGORY_NAME_1)
+        .toPredicate();
+
+    Request request = createMock(Request.class);
+
+    AmbariConfigurationDAO dao = injector.getInstance(AmbariConfigurationDAO.class);
+    expect(dao.removeByCategory(CATEGORY_NAME_1)).andReturn(1).once();
+
+    AmbariEventPublisher publisher = injector.getInstance(AmbariEventPublisher.class);
+    publisher.publish(anyObject(AmbariConfigurationChangedEvent.class));
+    expectLastCall().once();
 
-    EasyMock.expect(ambariConfigurationDAO.findAll()).andReturn(Lists.newArrayList(createDummyAmbariConfigurationEntity()));
     replayAll();
 
-    // WHEN
-    Set<Resource> resourceSet = ambariConfigurationResourceProvider.getResourcesAuthorized(requestMock, predicate);
+    SecurityContextHolder.getContext().setAuthentication(authentication);
+
+    resourceProvider.deleteResources(request, predicate);
 
-    // THEN
-    Assert.assertNotNull(resourceSet);
-    Assert.assertFalse(resourceSet.isEmpty());
+    verifyAll();
   }
 
   @Test
-  public void testUpdateAmbariConfigurationShouldResultInTheProperDAOCalls() throws Exception {
-    // GIVEN
+  public void testGetResources_Administrator() throws Exception {
+    testGetResources(TestAuthenticationFactory.createAdministrator());
+  }
+
+  @Test(expected = AuthorizationException.class)
+  public void testGetResources_ClusterAdministrator() throws Exception {
+    testGetResources(TestAuthenticationFactory.createClusterAdministrator());
+  }
+
+  @Test(expected = AuthorizationException.class)
+  public void testGetResources_ClusterOperator() throws Exception {
+    testGetResources(TestAuthenticationFactory.createClusterOperator());
+  }
+
+  @Test(expected = AuthorizationException.class)
+  public void testGetResources_ServiceAdministrator() throws Exception {
+    testGetResources(TestAuthenticationFactory.createServiceAdministrator());
+  }
+
+  @Test(expected = AuthorizationException.class)
+  public void testGetResources_ServiceOperator() throws Exception {
+    testGetResources(TestAuthenticationFactory.createServiceOperator());
+  }
+
+  private void testGetResources(Authentication authentication) throws Exception {
+    Injector injector = createInjector();
+
+    ResourceProvider resourceProvider = injector.getInstance(AmbariConfigurationResourceProvider.class);
 
-    Predicate predicate = new PredicateBuilder().property(
-      AmbariConfigurationResourceProvider.ResourcePropertyId.ID.getPropertyId()).equals("1").toPredicate();
+    Predicate predicate = new PredicateBuilder()
+        .property(AMBARI_CONFIGURATION_CATEGORY_PROPERTY_ID)
+        .equals(CATEGORY_NAME_1)
+        .toPredicate();
 
-    // properteies in the request, representing the updated configuration
-    Set<Map<String, Object>> resourcePropertiesSet = Sets.newHashSet(new PropertiesMapBuilder()
-      .withId(PK_LONG)
-      .withVersion("2")
-      .withVersionTag("version-2")
-      .withData(DATA_MOCK_STR)
-      .withType(TYPE)
-      .build());
+    Request request = createMock(Request.class);
+    expect(request.getPropertyIds()).andReturn(null).anyTimes();
 
-    EasyMock.expect(requestMock.getProperties()).andReturn(resourcePropertiesSet);
+    Map<String, String> properties = new HashMap<>();
+    properties.put("property1a", "value1");
+    properties.put("property2a", "value2");
 
-    AmbariConfigurationEntity persistedEntity = createDummyAmbariConfigurationEntity();
-    EasyMock.expect(ambariConfigurationDAO.findByPK(PK_LONG)).andReturn(persistedEntity);
-    ambariConfigurationDAO.update(EasyMock.capture(ambariConfigurationEntityCapture));
-    publisher.publish(EasyMock.anyObject(AmbariLdapConfigChangedEvent.class));
+    AmbariConfigurationDAO dao = injector.getInstance(AmbariConfigurationDAO.class);
+    expect(dao.findByCategory(CATEGORY_NAME_1)).andReturn(createEntities(CATEGORY_NAME_1, properties)).once();
 
     replayAll();
 
-    // WHEN
-    ambariConfigurationResourceProvider.updateResourcesAuthorized(requestMock, predicate);
+    SecurityContextHolder.getContext().setAuthentication(authentication);
 
-    // the captured entity should be the updated one
-    AmbariConfigurationEntity updatedEntity = ambariConfigurationEntityCapture.getValue();
+    Set<Resource> response = resourceProvider.getResources(request, predicate);
 
-    // THEN
-    Assert.assertNotNull(updatedEntity);
-    Assert.assertEquals("The updated version is wrong", Integer.valueOf(2), updatedEntity.getConfigurationBaseEntity().getVersion());
-  }
+    verifyAll();
 
-  private class PropertiesMapBuilder {
+    junit.framework.Assert.assertNotNull(response);
+    junit.framework.Assert.assertEquals(1, response.size());
 
-    private Map<String, Object> resourcePropertiesMap = Maps.newHashMap();
+    Resource resource = response.iterator().next();
+    junit.framework.Assert.assertEquals(Resource.Type.AmbariConfiguration, resource.getType());
 
-    private PropertiesMapBuilder() {
-    }
+    Map<String, Map<String, Object>> propertiesMap = resource.getPropertiesMap();
+    junit.framework.Assert.assertEquals(2, propertiesMap.size());
 
-    public PropertiesMapBuilder withId(Long id) {
-      resourcePropertiesMap.put(AmbariConfigurationResourceProvider.ResourcePropertyId.ID.getPropertyId(), id);
-      return this;
-    }
+    junit.framework.Assert.assertEquals(CATEGORY_NAME_1, propertiesMap.get(Resource.Type.AmbariConfiguration.name()).get("category"));
 
-    private PropertiesMapBuilder withVersion(String version) {
-      resourcePropertiesMap.put(AmbariConfigurationResourceProvider.ResourcePropertyId.VERSION.getPropertyId(), version);
-      return this;
-    }
+    Map<String, Object> retrievedProperties = propertiesMap.get(Resource.Type.AmbariConfiguration.name() + "/properties");
+    junit.framework.Assert.assertEquals(2, retrievedProperties.size());
 
-    private PropertiesMapBuilder withVersionTag(String versionTag) {
-      resourcePropertiesMap.put(AmbariConfigurationResourceProvider.ResourcePropertyId.VERSION_TAG.getPropertyId(), versionTag);
-      return this;
+    for (Map.Entry<String, String> entry : properties.entrySet()) {
+      junit.framework.Assert.assertEquals(entry.getValue(), retrievedProperties.get(entry.getKey()));
     }
+  }
 
-    private PropertiesMapBuilder withData(String dataJson) {
-      resourcePropertiesMap.put(AmbariConfigurationResourceProvider.ResourcePropertyId.DATA.getPropertyId(), dataJson);
-      return this;
-    }
+  @Test
+  public void testUpdateResources_Administrator() throws Exception {
+    testUpdateResources(TestAuthenticationFactory.createAdministrator());
+  }
 
-    private PropertiesMapBuilder withType(String type) {
-      resourcePropertiesMap.put(AmbariConfigurationResourceProvider.ResourcePropertyId.TYPE.getPropertyId(), type);
-      return this;
-    }
+  @Test(expected = AuthorizationException.class)
+  public void testUpdateResources_ClusterAdministrator() throws Exception {
+    testUpdateResources(TestAuthenticationFactory.createClusterAdministrator());
+  }
 
+  @Test(expected = AuthorizationException.class)
+  public void testUpdateResources_ClusterOperator() throws Exception {
+    testUpdateResources(TestAuthenticationFactory.createClusterOperator());
+  }
 
-    public Map<String, Object> build() {
-      return this.resourcePropertiesMap;
-    }
+  @Test(expected = AuthorizationException.class)
+  public void testUpdateResources_ServiceAdministrator() throws Exception {
+    testUpdateResources(TestAuthenticationFactory.createServiceAdministrator());
+  }
+
+  @Test(expected = AuthorizationException.class)
+  public void testUpdateResources_ServiceOperator() throws Exception {
+    testUpdateResources(TestAuthenticationFactory.createServiceOperator());
+  }
+
+  private void testUpdateResources(Authentication authentication) throws Exception {
+    Injector injector = createInjector();
+
+    ResourceProvider resourceProvider = injector.getInstance(AmbariConfigurationResourceProvider.class);
+
+    Predicate predicate = new PredicateBuilder()
+        .property(AMBARI_CONFIGURATION_CATEGORY_PROPERTY_ID)
+        .equals(CATEGORY_NAME_1)
+        .toPredicate();
+
+    Set<Map<String, Object>> propertySets = new HashSet<>();
 
+    Map<String, String> properties1 = new HashMap<>();
+    properties1.put("property1a", "value1");
+    properties1.put("property2a", "value2");
+    propertySets.add(toRequestProperties(CATEGORY_NAME_1, properties1));
+
+    Request request = createMock(Request.class);
+    expect(request.getProperties()).andReturn(propertySets).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();
+
+    AmbariEventPublisher publisher = injector.getInstance(AmbariEventPublisher.class);
+    publisher.publish(anyObject(AmbariConfigurationChangedEvent.class));
+    expectLastCall().times(1);
+
+    replayAll();
+
+    SecurityContextHolder.getContext().setAuthentication(authentication);
+
+    resourceProvider.updateResources(request, predicate);
+
+    verifyAll();
+
+    validateCapturedProperties(properties1, capturedProperties1);
   }
 
-  private AmbariConfigurationEntity createDummyAmbariConfigurationEntity() {
-    AmbariConfigurationEntity acEntity = new AmbariConfigurationEntity();
-    ConfigurationBaseEntity configurationBaseEntity = new ConfigurationBaseEntity();
-    acEntity.setConfigurationBaseEntity(configurationBaseEntity);
-    acEntity.setId(PK_LONG);
-    acEntity.getConfigurationBaseEntity().setConfigurationData(DATA_MOCK_STR);
-    acEntity.getConfigurationBaseEntity().setVersion(Integer.valueOf(VERSION));
-    acEntity.getConfigurationBaseEntity().setVersionTag(VERSION_TAG);
-    acEntity.getConfigurationBaseEntity().setType("ldap-config");
+  private List<AmbariConfigurationEntity> createEntities(String categoryName, Map<String, String> properties) {
+    List<AmbariConfigurationEntity> entities = new ArrayList<>();
 
-    return acEntity;
+    for (Map.Entry<String, String> property : properties.entrySet()) {
+      AmbariConfigurationEntity entity = new AmbariConfigurationEntity();
+      entity.setCategoryName(categoryName);
+      entity.setPropertyName(property.getKey());
+      entity.setPropertyValue(property.getValue());
+      entities.add(entity);
+    }
+
+    return entities;
+  }
+
+  private Map<String, Object> toRequestProperties(String categoryName1, Map<String, String> properties) {
+    Map<String, Object> requestProperties = new HashMap<>();
+    requestProperties.put(AMBARI_CONFIGURATION_CATEGORY_PROPERTY_ID, categoryName1);
+    for (Map.Entry<String, String> entry : properties.entrySet()) {
+      requestProperties.put(AMBARI_CONFIGURATION_PROPERTIES_PROPERTY_ID + "/" + entry.getKey(), entry.getValue());
+    }
+    return requestProperties;
   }
 
+  private void validateCapturedProperties(Map<String, String> expectedProperties, Capture<Map<String, String>> capturedProperties) {
+    junit.framework.Assert.assertTrue(capturedProperties.hasCaptured());
 
+    Map<String, String> properties = capturedProperties.getValue();
+    junit.framework.Assert.assertNotNull(properties);
+
+    // Convert the Map to a TreeMap to help with comparisons
+    expectedProperties = new TreeMap<>(expectedProperties);
+    properties = new TreeMap<>(properties);
+    junit.framework.Assert.assertEquals(expectedProperties, properties);
+  }
+
+  private Injector createInjector() throws Exception {
+    return Guice.createInjector(new AbstractModule() {
+      @Override
+      protected void configure() {
+        bind(EntityManager.class).toInstance(createNiceMock(EntityManager.class));
+        bind(AmbariConfigurationDAO.class).toInstance(createMock(AmbariConfigurationDAO.class));
+        bind(AmbariEventPublisher.class).toInstance(createMock(AmbariEventPublisher.class));
+      }
+    });
+  }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/4fa9ac55/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AmbariConfigurationDAOTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AmbariConfigurationDAOTest.java b/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AmbariConfigurationDAOTest.java
new file mode 100644
index 0000000..f801fd6
--- /dev/null
+++ b/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AmbariConfigurationDAOTest.java
@@ -0,0 +1,298 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.server.orm.dao;
+
+import static org.easymock.EasyMock.capture;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.expectLastCall;
+import static org.easymock.EasyMock.newCapture;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
+import javax.persistence.EntityManager;
+
+import org.apache.ambari.server.orm.entities.AmbariConfigurationEntity;
+import org.easymock.Capture;
+import org.easymock.CaptureType;
+import org.easymock.EasyMockSupport;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import com.google.inject.Provider;
+
+import junit.framework.Assert;
+
+public class AmbariConfigurationDAOTest extends EasyMockSupport {
+
+  private static final String CATEGORY_NAME = "test-category";
+  private static Method methodMerge;
+  private static Method methodRemove;
+  private static Method methodCreate;
+  private static Method methodFindByCategory;
+
+  private static Field fieldEntityManagerProvider;
+
+  @BeforeClass
+  public static void beforeKDCKerberosOperationHandlerTest() throws Exception {
+    methodMerge = AmbariConfigurationDAO.class.getMethod("merge", AmbariConfigurationEntity.class);
+    methodRemove = CrudDAO.class.getMethod("remove", Object.class);
+    methodCreate = AmbariConfigurationDAO.class.getMethod("create", AmbariConfigurationEntity.class);
+    methodFindByCategory = AmbariConfigurationDAO.class.getMethod("findByCategory", String.class);
+
+    fieldEntityManagerProvider = CrudDAO.class.getDeclaredField("entityManagerProvider");
+  }
+
+  @Test
+  public void testReconcileCategoryNewCategory() throws Exception {
+    Capture<AmbariConfigurationEntity> capturedEntities = newCapture(CaptureType.ALL);
+
+    AmbariConfigurationDAO dao = createDao();
+
+    expect(dao.findByCategory(CATEGORY_NAME)).andReturn(null).once();
+
+    dao.create(capture(capturedEntities));
+    expectLastCall().anyTimes();
+
+    replayAll();
+
+    Map<String, String> properties;
+    properties = new HashMap<>();
+    properties.put("property1", "value1");
+    properties.put("property2", "value2");
+    dao.reconcileCategory(CATEGORY_NAME, properties, true);
+
+    verifyAll();
+
+    validateCapturedEntities(CATEGORY_NAME, properties, capturedEntities);
+  }
+
+  @Test
+  public void testReconcileCategoryReplaceCategory() throws Exception {
+
+    Map<String, String> existingProperties;
+    existingProperties = new HashMap<>();
+    existingProperties.put("property1", "value1");
+    existingProperties.put("property2", "value2");
+
+    Capture<AmbariConfigurationEntity> capturedCreatedEntities = newCapture(CaptureType.ALL);
+    Capture<AmbariConfigurationEntity> capturedRemovedEntities = newCapture(CaptureType.ALL);
+
+    AmbariConfigurationDAO dao = createDao();
+
+    expect(dao.findByCategory(CATEGORY_NAME)).andReturn(toEntities(CATEGORY_NAME, existingProperties)).once();
+
+    dao.remove(capture(capturedRemovedEntities));
+    expectLastCall().anyTimes();
+
+    dao.create(capture(capturedCreatedEntities));
+    expectLastCall().anyTimes();
+
+    replayAll();
+
+    Map<String, String> newProperties;
+    newProperties = new HashMap<>();
+    newProperties.put("property1_new", "value1");
+    newProperties.put("property2_new", "value2");
+    dao.reconcileCategory(CATEGORY_NAME, newProperties, true);
+
+    verifyAll();
+
+    validateCapturedEntities(CATEGORY_NAME, newProperties, capturedCreatedEntities);
+    validateCapturedEntities(CATEGORY_NAME, existingProperties, capturedRemovedEntities);
+  }
+
+  @Test
+  public void testReconcileCategoryUpdateCategoryKeepNotSpecified() throws Exception {
+
+    Map<String, String> existingProperties;
+    existingProperties = new HashMap<>();
+    existingProperties.put("property1", "value1");
+    existingProperties.put("property2", "value2");
+
+    Capture<AmbariConfigurationEntity> capturedCreatedEntities = newCapture(CaptureType.ALL);
+    Capture<AmbariConfigurationEntity> capturedMergedEntities = newCapture(CaptureType.ALL);
+
+    AmbariConfigurationDAO dao = createDao();
+
+    expect(dao.findByCategory(CATEGORY_NAME)).andReturn(toEntities(CATEGORY_NAME, existingProperties)).once();
+
+    expect(dao.merge(capture(capturedMergedEntities))).andReturn(createNiceMock(AmbariConfigurationEntity.class)).anyTimes();
+
+    dao.create(capture(capturedCreatedEntities));
+    expectLastCall().anyTimes();
+
+    replayAll();
+
+    Map<String, String> newProperties;
+    newProperties = new HashMap<>();
+    newProperties.put("property1", "new_value1");
+    newProperties.put("property2_new", "value2");
+    newProperties.put("property3", "value3");
+    dao.reconcileCategory(CATEGORY_NAME, newProperties, false);
+
+    verifyAll();
+
+    Map<String, String> expectedProperties;
+
+    expectedProperties = new HashMap<>();
+    expectedProperties.put("property2_new", "value2");
+    expectedProperties.put("property3", "value3");
+    validateCapturedEntities(CATEGORY_NAME, expectedProperties, capturedCreatedEntities);
+
+    expectedProperties = new HashMap<>();
+    expectedProperties.put("property1", "new_value1");
+    validateCapturedEntities(CATEGORY_NAME, expectedProperties, capturedMergedEntities);
+  }
+
+  @Test
+  public void testReconcileCategoryUpdateCategoryRemoveNotSpecified() throws Exception {
+
+    Map<String, String> existingProperties;
+    existingProperties = new HashMap<>();
+    existingProperties.put("property1", "value1");
+    existingProperties.put("property2", "value2");
+
+    Capture<AmbariConfigurationEntity> capturedCreatedEntities = newCapture(CaptureType.ALL);
+    Capture<AmbariConfigurationEntity> capturedRemovedEntities = newCapture(CaptureType.ALL);
+    Capture<AmbariConfigurationEntity> capturedMergedEntities = newCapture(CaptureType.ALL);
+
+    AmbariConfigurationDAO dao = createDao();
+
+    expect(dao.findByCategory(CATEGORY_NAME)).andReturn(toEntities(CATEGORY_NAME, existingProperties)).once();
+
+    expect(dao.merge(capture(capturedMergedEntities))).andReturn(createNiceMock(AmbariConfigurationEntity.class)).anyTimes();
+
+    dao.remove(capture(capturedRemovedEntities));
+    expectLastCall().anyTimes();
+
+    dao.create(capture(capturedCreatedEntities));
+    expectLastCall().anyTimes();
+
+    replayAll();
+
+    Map<String, String> newProperties;
+    newProperties = new HashMap<>();
+    newProperties.put("property1", "new_value1");
+    newProperties.put("property2_new", "value2");
+    newProperties.put("property3", "value3");
+    dao.reconcileCategory(CATEGORY_NAME, newProperties, true);
+
+    verifyAll();
+
+    Map<String, String> expectedProperties;
+
+    expectedProperties = new HashMap<>();
+    expectedProperties.put("property2_new", "value2");
+    expectedProperties.put("property3", "value3");
+    validateCapturedEntities(CATEGORY_NAME, expectedProperties, capturedCreatedEntities);
+
+    expectedProperties = new HashMap<>();
+    expectedProperties.put("property2", "value2");
+    validateCapturedEntities(CATEGORY_NAME, expectedProperties, capturedRemovedEntities);
+
+    expectedProperties = new HashMap<>();
+    expectedProperties.put("property1", "new_value1");
+    validateCapturedEntities(CATEGORY_NAME, expectedProperties, capturedMergedEntities);
+  }
+
+  @Test
+  public void testReconcileCategoryAppendCategory() throws Exception {
+
+    Map<String, String> existingProperties;
+    existingProperties = new HashMap<>();
+    existingProperties.put("property1", "value1");
+    existingProperties.put("property2", "value2");
+
+    Capture<AmbariConfigurationEntity> capturedCreatedEntities = newCapture(CaptureType.ALL);
+
+    AmbariConfigurationDAO dao = createDao();
+
+    expect(dao.findByCategory(CATEGORY_NAME)).andReturn(toEntities(CATEGORY_NAME, existingProperties)).once();
+
+    dao.create(capture(capturedCreatedEntities));
+    expectLastCall().anyTimes();
+
+    replayAll();
+
+    Map<String, String> newProperties;
+    newProperties = new HashMap<>();
+    newProperties.put("property3", "value3");
+    newProperties.put("property4", "value3");
+    dao.reconcileCategory(CATEGORY_NAME, newProperties, false);
+
+    verifyAll();
+
+    validateCapturedEntities(CATEGORY_NAME, newProperties, capturedCreatedEntities);
+  }
+
+  private AmbariConfigurationDAO createDao() throws IllegalAccessException {
+    AmbariConfigurationDAO dao = createMockBuilder(AmbariConfigurationDAO.class)
+        .addMockedMethods(methodMerge, methodRemove, methodCreate, methodFindByCategory)
+        .createMock();
+
+    EntityManager entityManager = createMock(EntityManager.class);
+    entityManager.flush();
+    expectLastCall().anyTimes();
+
+    Provider<EntityManager> entityManagerProvider = createMock(Provider.class);
+    expect(entityManagerProvider.get()).andReturn(entityManager).anyTimes();
+
+    fieldEntityManagerProvider.set(dao, entityManagerProvider);
+
+    return dao;
+  }
+
+  private List<AmbariConfigurationEntity> toEntities(String categoryName, Map<String, String> properties) {
+    List<AmbariConfigurationEntity> entities = new ArrayList<>();
+
+    for (Map.Entry<String, String> property : properties.entrySet()) {
+      AmbariConfigurationEntity entity = new AmbariConfigurationEntity();
+      entity.setCategoryName(categoryName);
+      entity.setPropertyName(property.getKey());
+      entity.setPropertyValue(property.getValue());
+      entities.add(entity);
+    }
+
+    return entities;
+  }
+
+  private void validateCapturedEntities(String expectedCategoryName, Map<String, String> expectedProperties, Capture<AmbariConfigurationEntity> capturedEntities) {
+    Assert.assertTrue(capturedEntities.hasCaptured());
+
+    List<AmbariConfigurationEntity> entities = capturedEntities.getValues();
+    Assert.assertNotNull(entities);
+
+    Map<String, String> capturedProperties = new TreeMap<>();
+    for (AmbariConfigurationEntity entity : entities) {
+      Assert.assertEquals(expectedCategoryName, entity.getCategoryName());
+      capturedProperties.put(entity.getPropertyName(), entity.getPropertyValue());
+    }
+
+    // Convert the Map to a TreeMap to help with comparisons
+    expectedProperties = new TreeMap<>(expectedProperties);
+    Assert.assertEquals(expectedProperties, capturedProperties);
+  }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/4fa9ac55/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog300Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog300Test.java b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog300Test.java
index bd8f5cb..747f99b 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog300Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog300Test.java
@@ -17,6 +17,10 @@
  */
 package org.apache.ambari.server.upgrade;
 
+import static org.apache.ambari.server.upgrade.UpgradeCatalog300.AMBARI_CONFIGURATION_CATEGORY_NAME_COLUMN;
+import static org.apache.ambari.server.upgrade.UpgradeCatalog300.AMBARI_CONFIGURATION_PROPERTY_NAME_COLUMN;
+import static org.apache.ambari.server.upgrade.UpgradeCatalog300.AMBARI_CONFIGURATION_PROPERTY_VALUE_COLUMN;
+import static org.apache.ambari.server.upgrade.UpgradeCatalog300.AMBARI_CONFIGURATION_TABLE;
 import static org.apache.ambari.server.upgrade.UpgradeCatalog300.COMPONENT_DESIRED_STATE_TABLE;
 import static org.apache.ambari.server.upgrade.UpgradeCatalog300.COMPONENT_STATE_TABLE;
 import static org.apache.ambari.server.upgrade.UpgradeCatalog300.SECURITY_STATE_COLUMN;
@@ -42,6 +46,7 @@ import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import javax.persistence.EntityManager;
@@ -186,6 +191,15 @@ public class UpgradeCatalog300Test {
     dbAccessor.dropColumn(SERVICE_DESIRED_STATE_TABLE, SECURITY_STATE_COLUMN);
     expectLastCall().once();
 
+    // Ambari configuration table addition...
+    Capture<List<DBAccessor.DBColumnInfo>> ambariConfigurationTableColumns = newCapture();
+
+    dbAccessor.createTable(eq(AMBARI_CONFIGURATION_TABLE), capture(ambariConfigurationTableColumns));
+    expectLastCall().once();
+    dbAccessor.addPKConstraint(AMBARI_CONFIGURATION_TABLE, "PK_ambari_configuration", AMBARI_CONFIGURATION_CATEGORY_NAME_COLUMN, AMBARI_CONFIGURATION_PROPERTY_NAME_COLUMN);
+    expectLastCall().once();
+    // Ambari configuration table addition...
+
     replay(dbAccessor, configuration);
 
     Injector injector = Guice.createInjector(module);
@@ -197,6 +211,35 @@ public class UpgradeCatalog300Test {
     Assert.assertEquals(null, capturedOpsDisplayNameColumn.getDefaultValue());
     Assert.assertEquals(String.class, capturedOpsDisplayNameColumn.getType());
 
+    // Ambari configuration table addition...
+    Assert.assertTrue(ambariConfigurationTableColumns.hasCaptured());
+    List<DBAccessor.DBColumnInfo> columns = ambariConfigurationTableColumns.getValue();
+    Assert.assertEquals(3, columns.size());
+
+    for (DBAccessor.DBColumnInfo column : columns) {
+      String columnName = column.getName();
+
+      if (AMBARI_CONFIGURATION_CATEGORY_NAME_COLUMN.equals(columnName)) {
+        Assert.assertEquals(String.class, column.getType());
+        Assert.assertEquals(Integer.valueOf(100), column.getLength());
+        Assert.assertEquals(null, column.getDefaultValue());
+        Assert.assertFalse(column.isNullable());
+      } else if (AMBARI_CONFIGURATION_PROPERTY_NAME_COLUMN.equals(columnName)) {
+        Assert.assertEquals(String.class, column.getType());
+        Assert.assertEquals(Integer.valueOf(100), column.getLength());
+        Assert.assertEquals(null, column.getDefaultValue());
+        Assert.assertFalse(column.isNullable());
+      } else if (AMBARI_CONFIGURATION_PROPERTY_VALUE_COLUMN.equals(columnName)) {
+        Assert.assertEquals(String.class, column.getType());
+        Assert.assertEquals(Integer.valueOf(255), column.getLength());
+        Assert.assertEquals(null, column.getDefaultValue());
+        Assert.assertTrue(column.isNullable());
+      } else {
+        Assert.fail("Unexpected column name: " + columnName);
+      }
+    }
+    // Ambari configuration table addition...
+
     verify(dbAccessor);
   }
 


[24/50] [abbrv] ambari git commit: AMBARI-22426. Push down Logger instances (adoroszlai)

Posted by am...@apache.org.
AMBARI-22426. Push down Logger instances (adoroszlai)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: ed7e121f3aee519ee18e53b4d0b05661cca4b48a
Parents: d0ef144
Author: Attila Doroszlai <ad...@hortonworks.com>
Authored: Mon Nov 13 14:01:15 2017 +0100
Committer: Attila Doroszlai <ad...@hortonworks.com>
Committed: Tue Nov 14 18:30:01 2017 +0100

----------------------------------------------------------------------
 .../ambari/server/api/handlers/BaseManagementHandler.java    | 8 --------
 .../org/apache/ambari/server/api/handlers/CreateHandler.java | 4 ++++
 .../org/apache/ambari/server/api/services/BaseService.java   | 5 +----
 .../apache/ambari/server/api/services/LoggingService.java    | 4 ++++
 .../services/stackadvisor/commands/StackAdvisorCommand.java  | 2 +-
 .../ambari/server/checks/DatabaseConsistencyCheckHelper.java | 2 +-
 .../apache/ambari/server/controller/AmbariHandlerList.java   | 5 +----
 .../server/controller/internal/AbstractPropertyProvider.java | 4 ++++
 .../server/controller/internal/AbstractProviderModule.java   | 2 +-
 .../server/controller/internal/AbstractResourceProvider.java | 2 +-
 .../server/controller/internal/ActionResourceProvider.java   | 4 ++++
 .../controller/internal/AlertDefinitionResourceProvider.java | 4 ++++
 .../controller/internal/AlertGroupResourceProvider.java      | 4 ++++
 .../server/controller/internal/AlertResourceProvider.java    | 4 ++++
 .../controller/internal/AlertTargetResourceProvider.java     | 4 ++++
 .../server/controller/internal/ArtifactResourceProvider.java | 4 ++++
 .../ambari/server/controller/internal/BaseProvider.java      | 6 +-----
 .../controller/internal/BlueprintConfigurationProcessor.java | 2 +-
 .../controller/internal/BlueprintResourceProvider.java       | 4 ++++
 .../server/controller/internal/ClusterResourceProvider.java  | 4 ++++
 .../internal/ClusterStackVersionResourceProvider.java        | 4 ++++
 .../CompatibleRepositoryVersionResourceProvider.java         | 4 ++++
 .../controller/internal/ComponentResourceProvider.java       | 4 ++++
 .../controller/internal/CredentialResourceProvider.java      | 4 ++++
 .../server/controller/internal/GroupResourceProvider.java    | 4 ++++
 .../controller/internal/HostComponentResourceProvider.java   | 4 ++++
 .../server/controller/internal/HostResourceProvider.java     | 2 ++
 .../internal/HostStackVersionResourceProvider.java           | 4 ++++
 .../ambari/server/controller/internal/HostStatusHelper.java  | 2 +-
 .../server/controller/internal/HttpPropertyProvider.java     | 2 +-
 .../server/controller/internal/JsonHttpPropertyRequest.java  | 2 +-
 .../controller/internal/LdapSyncEventResourceProvider.java   | 2 +-
 .../server/controller/internal/MemberResourceProvider.java   | 4 ++++
 .../internal/QuickLinkArtifactResourceProvider.java          | 4 ++++
 .../controller/internal/RecommendationResourceProvider.java  | 4 ++++
 .../server/controller/internal/RequestResourceProvider.java  | 4 ++++
 .../internal/RoleAuthorizationResourceProvider.java          | 4 ++++
 .../server/controller/internal/ServiceResourceProvider.java  | 5 +++++
 .../controller/internal/StackAdvisorResourceProvider.java    | 4 ++++
 .../controller/internal/StackArtifactResourceProvider.java   | 5 +++++
 .../server/controller/internal/StageResourceProvider.java    | 4 ++++
 .../server/controller/internal/TaskResourceProvider.java     | 4 ++++
 .../controller/internal/ThemeArtifactResourceProvider.java   | 4 ++++
 .../controller/internal/UpgradeItemResourceProvider.java     | 4 ++++
 .../server/controller/internal/UserResourceProvider.java     | 4 ++++
 .../controller/internal/ValidationResourceProvider.java      | 4 ++++
 .../internal/VersionDefinitionResourceProvider.java          | 4 ++++
 .../ambari/server/controller/jdbc/JDBCResourceProvider.java  | 2 +-
 .../ambari/server/controller/jmx/JMXPropertyProvider.java    | 2 +-
 .../controller/metrics/MetricsCollectorHAClusterState.java   | 2 +-
 .../server/controller/metrics/MetricsCollectorHAManager.java | 2 +-
 .../server/controller/metrics/MetricsDownsamplingMethod.java | 2 +-
 .../server/controller/metrics/MetricsPropertyProvider.java   | 2 +-
 .../controller/metrics/MetricsReportPropertyProvider.java    | 2 +-
 .../controller/metrics/RestMetricsPropertyProvider.java      | 2 +-
 .../metrics/ThreadPoolEnabledPropertyProvider.java           | 4 ++++
 .../controller/metrics/ganglia/GangliaPropertyProvider.java  | 2 +-
 .../metrics/ganglia/GangliaReportPropertyProvider.java       | 2 +-
 .../controller/metrics/timeline/AMSPropertyProvider.java     | 3 +++
 .../metrics/timeline/AMSReportPropertyProvider.java          | 3 +++
 .../ambari/server/controller/utilities/DatabaseChecker.java  | 2 +-
 .../utilities/state/DefaultServiceCalculatedState.java       | 2 +-
 .../utilities/state/FlumeServiceCalculatedState.java         | 4 ++++
 .../utilities/state/HBaseServiceCalculatedState.java         | 4 ++++
 .../utilities/state/HDFSServiceCalculatedState.java          | 4 ++++
 .../utilities/state/HiveServiceCalculatedState.java          | 4 ++++
 .../utilities/state/OozieServiceCalculatedState.java         | 4 ++++
 .../utilities/state/YARNServiceCalculatedState.java          | 4 ++++
 .../ldap/service/ads/DefaultLdapConnectionConfigService.java | 2 +-
 .../server/orm/entities/RemoteAmbariClusterEntity.java       | 2 +-
 .../authorization/AmbariLdapAuthenticationProvider.java      | 2 +-
 .../server/security/encryption/CredentialProvider.java       | 2 +-
 .../serveraction/kerberos/KDCKerberosOperationHandler.java   | 2 +-
 .../server/state/services/MetricsRetrievalService.java       | 2 +-
 .../java/org/apache/ambari/server/state/stack/OsFamily.java  | 2 +-
 .../ambari/server/topology/ClusterConfigurationRequest.java  | 2 +-
 .../apache/ambari/server/topology/PersistedStateImpl.java    | 2 +-
 .../java/org/apache/ambari/server/utils/RetryHelper.java     | 2 +-
 .../apache/ambari/server/view/ViewDataMigrationUtility.java  | 2 +-
 .../java/org/apache/ambari/server/view/ViewExtractor.java    | 2 +-
 .../java/org/apache/ambari/server/view/ViewRegistry.java     | 2 +-
 .../apache/ambari/server/view/ViewSubResourceProvider.java   | 4 ++++
 .../apache/ambari/server/view/persistence/DataStoreImpl.java | 2 +-
 83 files changed, 212 insertions(+), 56 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/api/handlers/BaseManagementHandler.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/handlers/BaseManagementHandler.java b/ambari-server/src/main/java/org/apache/ambari/server/api/handlers/BaseManagementHandler.java
index d0bd5d3..1fa55eb 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/handlers/BaseManagementHandler.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/handlers/BaseManagementHandler.java
@@ -36,20 +36,12 @@ import org.apache.ambari.server.controller.spi.RequestStatus;
 import org.apache.ambari.server.controller.spi.RequestStatusMetaData;
 import org.apache.ambari.server.controller.spi.Resource;
 import org.apache.ambari.server.controller.utilities.ClusterControllerHelper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
  * Base handler for operations that persist state to the back-end.
  */
 public abstract class BaseManagementHandler implements RequestHandler {
 
-  /**
-   * Logger instance.
-   */
-  protected final static Logger LOG =
-      LoggerFactory.getLogger(BaseManagementHandler.class);
-
   public static final String RESOURCES_NODE_NAME = "resources";
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/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 549da76..b614c5e 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
@@ -31,6 +31,8 @@ import org.apache.ambari.server.controller.spi.ResourceAlreadyExistsException;
 import org.apache.ambari.server.controller.spi.SystemException;
 import org.apache.ambari.server.controller.spi.UnsupportedPropertyException;
 import org.apache.ambari.server.security.authorization.AuthorizationException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -38,6 +40,8 @@ import org.apache.ambari.server.security.authorization.AuthorizationException;
  */
 public class CreateHandler extends BaseManagementHandler {
 
+  private final static Logger LOG = LoggerFactory.getLogger(CreateHandler.class);
+
   @Override
   protected Result persist(ResourceInstance resource, RequestBody body) {
     Result result;

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/api/services/BaseService.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/BaseService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/BaseService.java
index d24780b..17155a4 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/BaseService.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/BaseService.java
@@ -90,10 +90,7 @@ public abstract class BaseService {
 
   static final String FIELDS_SEPARATOR = ", ";
 
-  /**
-   * Logger instance.
-   */
-  protected final static Logger LOG = LoggerFactory.getLogger(BaseService.class);
+  private final static Logger LOG = LoggerFactory.getLogger(BaseService.class);
 
   /**
    * Factory for creating resource instances.

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/api/services/LoggingService.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/LoggingService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/LoggingService.java
index c86b9a0..e830d3b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/LoggingService.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/LoggingService.java
@@ -51,6 +51,8 @@ import org.apache.ambari.server.security.authorization.RoleAuthorization;
 import org.apache.ambari.server.state.Cluster;
 import org.apache.ambari.server.utils.RetryHelper;
 import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.inject.Inject;
 
@@ -63,6 +65,8 @@ import com.google.inject.Inject;
  */
 public class LoggingService extends BaseService {
 
+  private final static Logger LOG = LoggerFactory.getLogger(LoggingService.class);
+
   /**
    * The user of authorizations for which a user must have one of in order to access LogSearch data
    */

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/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 2dc45de..91edf86 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
@@ -71,7 +71,7 @@ public abstract class StackAdvisorCommand<T extends StackAdvisorResponse> extend
    */
   private Class<T> type;
 
-  protected static Logger LOG = LoggerFactory.getLogger(StackAdvisorCommand.class);
+  private static final Logger LOG = LoggerFactory.getLogger(StackAdvisorCommand.class);
 
   private static final String GET_HOSTS_INFO_URI = "/api/v1/hosts"
       + "?fields=Hosts/*&Hosts/host_name.in(%s)";

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelper.java
index 34888f2..669ab81 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelper.java
@@ -81,7 +81,7 @@ import com.google.inject.persist.Transactional;
 
 public class DatabaseConsistencyCheckHelper {
 
-  static Logger LOG = LoggerFactory.getLogger(DatabaseConsistencyCheckHelper.class);
+  private static final Logger LOG = LoggerFactory.getLogger(DatabaseConsistencyCheckHelper.class);
 
   @Inject
   private static Injector injector;

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariHandlerList.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariHandlerList.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariHandlerList.java
index e134f6d..23c9dee 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariHandlerList.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariHandlerList.java
@@ -111,10 +111,7 @@ public class AmbariHandlerList extends HandlerCollection implements ViewInstance
    */
   private final Collection<Handler> nonViewHandlers = new HashSet<>();
 
-  /**
-   * The logger.
-   */
-  protected final static Logger LOG = LoggerFactory.getLogger(AmbariHandlerList.class);
+  private static final Logger LOG = LoggerFactory.getLogger(AmbariHandlerList.class);
 
 
   // ----- Constructors ------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractPropertyProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractPropertyProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractPropertyProvider.java
index 322596e..05b0eaa 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractPropertyProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractPropertyProvider.java
@@ -45,12 +45,16 @@ 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.apache.hadoop.metrics2.sink.timeline.TimelineMetric;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  *  Abstract property provider implementation.
  */
 public abstract class AbstractPropertyProvider extends BaseProvider implements PropertyProvider {
 
+  private static final Logger LOG = LoggerFactory.getLogger(AbstractPropertyProvider.class);
+
   /**
    * The property/metric information for this provider keyed by component name / property id.
    */

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
index 1501a01..caa21bc 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
@@ -267,7 +267,7 @@ public abstract class AbstractProviderModule implements ProviderModule,
 
   private volatile boolean initialized = false;
 
-  protected final static Logger LOG =
+  private static final Logger LOG =
       LoggerFactory.getLogger(AbstractProviderModule.class);
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractResourceProvider.java
index 5598650..40e1b2d 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractResourceProvider.java
@@ -68,7 +68,7 @@ public abstract class AbstractResourceProvider extends BaseProvider implements R
    */
   private final Set<ResourceProviderObserver> observers = new HashSet<>();
 
-  protected final static Logger LOG = LoggerFactory.getLogger(AbstractResourceProvider.class);
+  private static final Logger LOG = LoggerFactory.getLogger(AbstractResourceProvider.class);
   protected final static String PROPERTIES_ATTRIBUTES_REGEX = "properties_attributes/[a-zA-Z][a-zA-Z._-]*$";
   public static Pattern propertiesAttributesPattern = Pattern.compile(".*/" + PROPERTIES_ATTRIBUTES_REGEX);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ActionResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ActionResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ActionResourceProvider.java
index 4e618e7..290931555 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ActionResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ActionResourceProvider.java
@@ -43,9 +43,13 @@ import org.apache.ambari.server.controller.spi.SystemException;
 import org.apache.ambari.server.controller.spi.UnsupportedPropertyException;
 import org.apache.ambari.server.controller.utilities.PropertyHelper;
 import org.apache.ambari.server.customactions.ActionDefinition;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class ActionResourceProvider extends AbstractControllerResourceProvider {
 
+  private static final Logger LOG = LoggerFactory.getLogger(ActionResourceProvider.class);
+
   public static final String ACTION_NAME_PROPERTY_ID = PropertyHelper
       .getPropertyId("Actions", "action_name");
   public static final String ACTION_TYPE_PROPERTY_ID = PropertyHelper

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertDefinitionResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertDefinitionResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertDefinitionResourceProvider.java
index 32f1fd8..9579dca 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertDefinitionResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertDefinitionResourceProvider.java
@@ -61,6 +61,8 @@ import org.apache.ambari.server.state.alert.Scope;
 import org.apache.ambari.server.state.alert.SourceType;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.math.NumberUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.gson.Gson;
 import com.google.gson.JsonElement;
@@ -73,6 +75,8 @@ import com.google.inject.Inject;
 @StaticallyInject
 public class AlertDefinitionResourceProvider extends AbstractControllerResourceProvider {
 
+  private static final Logger LOG = LoggerFactory.getLogger(AlertDefinitionResourceProvider.class);
+
   protected static final String ALERT_DEF = "AlertDefinition";
 
   protected static final String ALERT_DEF_CLUSTER_NAME = "AlertDefinition/cluster_name";

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertGroupResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertGroupResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertGroupResourceProvider.java
index cf4e747..0898bc3 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertGroupResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertGroupResourceProvider.java
@@ -49,6 +49,8 @@ import org.apache.ambari.server.security.authorization.AuthorizationException;
 import org.apache.ambari.server.state.Cluster;
 import org.apache.ambari.server.state.alert.AlertTarget;
 import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.inject.Inject;
 
@@ -61,6 +63,8 @@ import com.google.inject.Inject;
 public class AlertGroupResourceProvider extends
     AbstractControllerResourceProvider {
 
+  private static final Logger LOG = LoggerFactory.getLogger(AlertGroupResourceProvider.class);
+
   public static final String ALERT_GROUP = "AlertGroup";
   public static final String ALERT_GROUP_ID = "AlertGroup/id";
   public static final String ALERT_GROUP_CLUSTER_NAME = "AlertGroup/cluster_name";

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertResourceProvider.java
index c71651e..4ab78b7 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertResourceProvider.java
@@ -50,6 +50,8 @@ import org.apache.ambari.server.state.Clusters;
 import org.apache.ambari.server.state.ConfigHelper;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.math.NumberUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.inject.Inject;
 import com.google.inject.Provider;
@@ -61,6 +63,8 @@ import com.google.inject.Provider;
 public class AlertResourceProvider extends ReadOnlyResourceProvider implements
     ExtendedResourceProvider {
 
+  private static final Logger LOG = LoggerFactory.getLogger(AlertResourceProvider.class);
+
   public static final String ALERT_ID = "Alert/id";
   public static final String ALERT_STATE = "Alert/state";
   public static final String ALERT_ORIGINAL_TIMESTAMP = "Alert/original_timestamp";

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertTargetResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertTargetResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertTargetResourceProvider.java
index 43ee7fe..c1e9eb4 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertTargetResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertTargetResourceProvider.java
@@ -53,6 +53,8 @@ import org.apache.ambari.server.state.AlertState;
 import org.apache.ambari.server.state.alert.AlertGroup;
 import org.apache.ambari.server.state.alert.AlertTarget;
 import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.gson.Gson;
 import com.google.inject.Inject;
@@ -67,6 +69,8 @@ import com.google.inject.persist.Transactional;
 public class AlertTargetResourceProvider extends
  AbstractAuthorizedResourceProvider {
 
+  private static final Logger LOG = LoggerFactory.getLogger(AlertTargetResourceProvider.class);
+
   public static final String ALERT_TARGET = "AlertTarget";
   public static final String ALERT_TARGET_ID = "AlertTarget/id";
   public static final String ALERT_TARGET_NAME = "AlertTarget/name";

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ArtifactResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ArtifactResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ArtifactResourceProvider.java
index c5c02cf..567cfa9 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ArtifactResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ArtifactResourceProvider.java
@@ -47,6 +47,8 @@ import org.apache.ambari.server.controller.utilities.PropertyHelper;
 import org.apache.ambari.server.orm.dao.ArtifactDAO;
 import org.apache.ambari.server.orm.entities.ArtifactEntity;
 import org.apache.ambari.server.state.Cluster;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.gson.Gson;
 import com.google.inject.Inject;
@@ -62,6 +64,8 @@ import com.google.inject.Inject;
 @StaticallyInject
 public class ArtifactResourceProvider extends AbstractResourceProvider {
 
+  private static final Logger LOG = LoggerFactory.getLogger(ArtifactResourceProvider.class);
+
   public static final String RESPONSE_KEY = "Artifacts";
   public static final String ARTIFACT_NAME = "artifact_name";
   public static final String CLUSTER_NAME = "cluster_name";

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BaseProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BaseProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BaseProvider.java
index 135eefe..c9fee7d 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BaseProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BaseProvider.java
@@ -61,11 +61,7 @@ public abstract class BaseProvider {
    */
   private final Map<String, Pattern> patterns;
 
-  /**
-   * The logger.
-   */
-  protected final static Logger LOG =
-      LoggerFactory.getLogger(BaseProvider.class);
+  private static final Logger LOG = LoggerFactory.getLogger(BaseProvider.class);
 
   /**
    * The regex pattern that will match on all $1, $2.method(0), and

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
index 5a7cda0..5b75532 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
@@ -67,7 +67,7 @@ import com.google.common.collect.Sets;
  */
 public class BlueprintConfigurationProcessor {
 
-  protected final static Logger LOG = LoggerFactory.getLogger(BlueprintConfigurationProcessor.class);
+  private static final Logger LOG = LoggerFactory.getLogger(BlueprintConfigurationProcessor.class);
 
   private final static String COMMAND_RETRY_ENABLED_PROPERTY_NAME = "command_retry_enabled";
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintResourceProvider.java
index 73d2490..67f5448 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintResourceProvider.java
@@ -60,6 +60,8 @@ import org.apache.ambari.server.topology.InvalidTopologyException;
 import org.apache.ambari.server.topology.SecurityConfiguration;
 import org.apache.ambari.server.topology.SecurityConfigurationFactory;
 import org.apache.ambari.server.utils.SecretReference;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.common.base.Preconditions;
 import com.google.common.base.Strings;
@@ -71,6 +73,8 @@ import com.google.gson.Gson;
  */
 public class BlueprintResourceProvider extends AbstractControllerResourceProvider {
 
+  private static final Logger LOG = LoggerFactory.getLogger(BlueprintResourceProvider.class);
+
   // ----- Property ID constants ---------------------------------------------
 
   // Blueprints

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterResourceProvider.java
index 54c8360..b9b3b56 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterResourceProvider.java
@@ -56,6 +56,8 @@ import org.apache.ambari.server.topology.SecurityConfiguration;
 import org.apache.ambari.server.topology.SecurityConfigurationFactory;
 import org.apache.ambari.server.topology.TopologyManager;
 import org.apache.ambari.server.topology.TopologyRequestFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.security.core.Authentication;
 
 import com.google.gson.Gson;
@@ -66,6 +68,8 @@ import com.google.gson.Gson;
  */
 public class ClusterResourceProvider extends AbstractControllerResourceProvider {
 
+  private static final Logger LOG = LoggerFactory.getLogger(ClusterResourceProvider.class);
+
   // ----- Property ID constants ---------------------------------------------
 
   // Clusters

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java
index 98adcd1..24e4d70 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java
@@ -88,6 +88,8 @@ import org.apache.ambari.server.utils.StageUtils;
 import org.apache.ambari.server.utils.VersionUtils;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Lists;
@@ -103,6 +105,8 @@ import com.google.inject.persist.Transactional;
 @StaticallyInject
 public class ClusterStackVersionResourceProvider extends AbstractControllerResourceProvider {
 
+  private static final Logger LOG = LoggerFactory.getLogger(ClusterStackVersionResourceProvider.class);
+
   // ----- Property ID constants ---------------------------------------------
 
   protected static final String CLUSTER_STACK_VERSION_ID_PROPERTY_ID = PropertyHelper.getPropertyId("ClusterStackVersions", "id");

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CompatibleRepositoryVersionResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CompatibleRepositoryVersionResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CompatibleRepositoryVersionResourceProvider.java
index f05ffbe..fa963c6 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CompatibleRepositoryVersionResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CompatibleRepositoryVersionResourceProvider.java
@@ -51,6 +51,8 @@ import org.apache.ambari.server.state.StackInfo;
 import org.apache.ambari.server.state.repository.ManifestServiceInfo;
 import org.apache.ambari.server.state.repository.VersionDefinitionXml;
 import org.apache.ambari.server.state.stack.UpgradePack;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
@@ -64,6 +66,8 @@ import com.google.inject.Provider;
 @StaticallyInject
 public class CompatibleRepositoryVersionResourceProvider extends ReadOnlyResourceProvider {
 
+  private static final Logger LOG = LoggerFactory.getLogger(CompatibleRepositoryVersionResourceProvider.class);
+
   // ----- Property ID constants ---------------------------------------------
 
   public static final String REPOSITORY_VERSION_ID_PROPERTY_ID                 = "CompatibleRepositoryVersions/id";

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java
index 2e86b2d..482e5d2 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java
@@ -62,6 +62,8 @@ import org.apache.ambari.server.state.StackId;
 import org.apache.ambari.server.state.State;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.Validate;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.common.collect.Sets;
 import com.google.inject.assistedinject.Assisted;
@@ -73,6 +75,8 @@ import com.google.inject.persist.Transactional;
  */
 public class ComponentResourceProvider extends AbstractControllerResourceProvider {
 
+  private static final Logger LOG = LoggerFactory.getLogger(ComponentResourceProvider.class);
+
   // ----- Property ID constants ---------------------------------------------
 
   // Components

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CredentialResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CredentialResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CredentialResourceProvider.java
index 79254c6..ebc7645 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CredentialResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CredentialResourceProvider.java
@@ -45,6 +45,8 @@ 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.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.inject.Inject;
 import com.google.inject.assistedinject.Assisted;
@@ -56,6 +58,8 @@ import com.google.inject.assistedinject.AssistedInject;
 @StaticallyInject
 public class CredentialResourceProvider extends AbstractControllerResourceProvider {
 
+  private static final Logger LOG = LoggerFactory.getLogger(CredentialResourceProvider.class);
+
   // ----- Property ID constants ---------------------------------------------
 
   public static final String CREDENTIAL_CLUSTER_NAME_PROPERTY_ID = PropertyHelper.getPropertyId("Credential", "cluster_name");

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/GroupResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/GroupResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/GroupResourceProvider.java
index f051651..6cdd24e 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/GroupResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/GroupResourceProvider.java
@@ -38,12 +38,16 @@ import org.apache.ambari.server.controller.spi.SystemException;
 import org.apache.ambari.server.controller.spi.UnsupportedPropertyException;
 import org.apache.ambari.server.controller.utilities.PropertyHelper;
 import org.apache.ambari.server.security.authorization.RoleAuthorization;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Resource provider for group resources.
  */
 public class GroupResourceProvider extends AbstractControllerResourceProvider {
 
+  private static final Logger LOG = LoggerFactory.getLogger(GroupResourceProvider.class);
+
   // ----- Property ID constants ---------------------------------------------
 
   // Groups

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
index 6708560..94766a5 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
@@ -66,6 +66,8 @@ import org.apache.ambari.server.state.svccomphost.ServiceComponentHostDisableEve
 import org.apache.ambari.server.state.svccomphost.ServiceComponentHostRestoreEvent;
 import org.apache.ambari.server.topology.Setting;
 import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.inject.Inject;
 import com.google.inject.Injector;
@@ -77,6 +79,8 @@ import com.google.inject.assistedinject.AssistedInject;
  */
 public class HostComponentResourceProvider extends AbstractControllerResourceProvider {
 
+  private static final Logger LOG = LoggerFactory.getLogger(HostComponentResourceProvider.class);
+
   // ----- Property ID constants ---------------------------------------------
 
   // Host Components

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/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 5373ffe..2b18eb2 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
@@ -85,6 +85,8 @@ import com.google.inject.persist.Transactional;
  */
 public class HostResourceProvider extends AbstractControllerResourceProvider {
 
+  private static final Logger LOG = LoggerFactory.getLogger(HostResourceProvider.class);
+
   // ----- Property ID constants ---------------------------------------------
 
   // Hosts

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java
index b106209..62fb530 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java
@@ -65,6 +65,8 @@ import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang.BooleanUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.Validate;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.common.collect.Sets;
 import com.google.inject.Inject;
@@ -76,6 +78,8 @@ import com.google.inject.Provider;
 @StaticallyInject
 public class HostStackVersionResourceProvider extends AbstractControllerResourceProvider {
 
+  private static final Logger LOG = LoggerFactory.getLogger(HostStackVersionResourceProvider.class);
+
   // ----- Property ID constants ---------------------------------------------
 
   protected static final String HOST_STACK_VERSION_ID_PROPERTY_ID              = PropertyHelper.getPropertyId("HostStackVersions", "id");

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStatusHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStatusHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStatusHelper.java
index f94b979..44d3110 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStatusHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStatusHelper.java
@@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory;
 
 public class HostStatusHelper {
 
-  protected final static Logger LOG =
+  private static final Logger LOG =
     LoggerFactory.getLogger(HostStatusHelper.class);
 
   public static boolean isHostComponentLive(AmbariManagementController managementController,

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HttpPropertyProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HttpPropertyProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HttpPropertyProvider.java
index c556b06..cb7afcd 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HttpPropertyProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HttpPropertyProvider.java
@@ -43,7 +43,7 @@ import org.slf4j.LoggerFactory;
  */
 public class HttpPropertyProvider extends BaseProvider implements PropertyProvider {
 
-  protected final static Logger LOG = LoggerFactory.getLogger(HttpPropertyProvider.class);
+  private static final Logger LOG = LoggerFactory.getLogger(HttpPropertyProvider.class);
 
   private final StreamProvider streamProvider;
   private final String clusterNamePropertyId;

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/JsonHttpPropertyRequest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/JsonHttpPropertyRequest.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/JsonHttpPropertyRequest.java
index 2e51e8c..7fea2ff 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/JsonHttpPropertyRequest.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/JsonHttpPropertyRequest.java
@@ -37,7 +37,7 @@ import com.google.gson.reflect.TypeToken;
  * instance.
  */
 public abstract class JsonHttpPropertyRequest extends HttpPropertyProvider.HttpPropertyRequest {
-  protected final static Logger LOG = LoggerFactory.getLogger(JsonHttpPropertyRequest.class);
+  private static final Logger LOG = LoggerFactory.getLogger(JsonHttpPropertyRequest.class);
 
   private static final Type MAP_TYPE = new TypeToken<Map<String, Object>>() {}.getType();
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/LdapSyncEventResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/LdapSyncEventResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/LdapSyncEventResourceProvider.java
index 4badc9c..fc409a3 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/LdapSyncEventResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/LdapSyncEventResourceProvider.java
@@ -155,7 +155,7 @@ public class LdapSyncEventResourceProvider extends AbstractControllerResourcePro
   /**
    * The logger.
    */
-  protected final static Logger LOG = LoggerFactory.getLogger(LdapSyncEventResourceProvider.class);
+  private static final Logger LOG = LoggerFactory.getLogger(LdapSyncEventResourceProvider.class);
 
 
   // ----- Constructors ------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/MemberResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/MemberResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/MemberResourceProvider.java
index d9d56ee..3cecddb 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/MemberResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/MemberResourceProvider.java
@@ -39,6 +39,8 @@ import org.apache.ambari.server.controller.spi.SystemException;
 import org.apache.ambari.server.controller.spi.UnsupportedPropertyException;
 import org.apache.ambari.server.controller.utilities.PropertyHelper;
 import org.apache.ambari.server.security.authorization.RoleAuthorization;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.inject.assistedinject.Assisted;
 import com.google.inject.assistedinject.AssistedInject;
@@ -49,6 +51,8 @@ import com.google.inject.persist.Transactional;
  */
 public class MemberResourceProvider extends AbstractControllerResourceProvider {
 
+  private static final Logger LOG = LoggerFactory.getLogger(MemberResourceProvider.class);
+
   // ----- Property ID constants ---------------------------------------------
 
   // Members

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/QuickLinkArtifactResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/QuickLinkArtifactResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/QuickLinkArtifactResourceProvider.java
index 073ec60..f293941 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/QuickLinkArtifactResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/QuickLinkArtifactResourceProvider.java
@@ -44,9 +44,13 @@ import org.apache.ambari.server.state.StackInfo;
 import org.apache.ambari.server.state.quicklinks.Link;
 import org.apache.ambari.server.state.quicklinks.QuickLinks;
 import org.apache.ambari.server.state.quicklinksprofile.QuickLinkVisibilityController;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class QuickLinkArtifactResourceProvider extends AbstractControllerResourceProvider {
 
+  private static final Logger LOG = LoggerFactory.getLogger(QuickLinkArtifactResourceProvider.class);
+
   public static final String STACK_NAME_PROPERTY_ID = PropertyHelper.getPropertyId("QuickLinkInfo", "stack_name");
   public static final String STACK_VERSION_PROPERTY_ID = PropertyHelper.getPropertyId("QuickLinkInfo", "stack_version");
   public static final String STACK_SERVICE_NAME_PROPERTY_ID = PropertyHelper.getPropertyId("QuickLinkInfo", "service_name");

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RecommendationResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RecommendationResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RecommendationResourceProvider.java
index 70ed3dc..9c6259c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RecommendationResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RecommendationResourceProvider.java
@@ -43,9 +43,13 @@ import org.apache.ambari.server.controller.spi.ResourceAlreadyExistsException;
 import org.apache.ambari.server.controller.spi.SystemException;
 import org.apache.ambari.server.controller.spi.UnsupportedPropertyException;
 import org.apache.ambari.server.controller.utilities.PropertyHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class RecommendationResourceProvider extends StackAdvisorResourceProvider {
 
+  private static final Logger LOG = LoggerFactory.getLogger(RecommendationResourceProvider.class);
+
   protected static final String RECOMMENDATION_ID_PROPERTY_ID = PropertyHelper.getPropertyId(
       "Recommendation", "id");
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestResourceProvider.java
index 81f283c..26e3b86 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestResourceProvider.java
@@ -71,6 +71,8 @@ import org.apache.ambari.server.topology.LogicalRequest;
 import org.apache.ambari.server.topology.TopologyManager;
 import org.apache.ambari.server.utils.SecretReference;
 import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.common.collect.Sets;
 import com.google.inject.Inject;
@@ -81,6 +83,8 @@ import com.google.inject.Inject;
 @StaticallyInject
 public class RequestResourceProvider extends AbstractControllerResourceProvider {
 
+  private static final Logger LOG = LoggerFactory.getLogger(RequestResourceProvider.class);
+
   @Inject
   private static RequestDAO s_requestDAO = null;
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RoleAuthorizationResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RoleAuthorizationResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RoleAuthorizationResourceProvider.java
index 78eb80e..8dbe2bf 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RoleAuthorizationResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RoleAuthorizationResourceProvider.java
@@ -42,6 +42,8 @@ import org.apache.ambari.server.orm.dao.RoleAuthorizationDAO;
 import org.apache.ambari.server.orm.entities.PermissionEntity;
 import org.apache.ambari.server.orm.entities.RoleAuthorizationEntity;
 import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.inject.Inject;
 
@@ -51,6 +53,8 @@ import com.google.inject.Inject;
 @StaticallyInject
 public class RoleAuthorizationResourceProvider extends ReadOnlyResourceProvider {
 
+  private static final Logger LOG = LoggerFactory.getLogger(RoleAuthorizationResourceProvider.class);
+
   // ----- Property ID constants ---------------------------------------------
 
   public static final String AUTHORIZATION_ID_PROPERTY_ID = PropertyHelper.getPropertyId("AuthorizationInfo", "authorization_id");

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
index e55a380..9b12f03 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
@@ -78,6 +78,8 @@ import org.apache.ambari.server.state.State;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.Validate;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.inject.Inject;
 import com.google.inject.assistedinject.Assisted;
@@ -87,6 +89,9 @@ import com.google.inject.assistedinject.AssistedInject;
  * Resource provider for service resources.
  */
 public class ServiceResourceProvider extends AbstractControllerResourceProvider {
+
+  private static final Logger LOG = LoggerFactory.getLogger(ServiceResourceProvider.class);
+
   public static final String SERVICE_CLUSTER_NAME_PROPERTY_ID = PropertyHelper.getPropertyId(
       "ServiceInfo", "cluster_name");
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackAdvisorResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackAdvisorResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackAdvisorResourceProvider.java
index 7035f0a..1ea664c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackAdvisorResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackAdvisorResourceProvider.java
@@ -41,6 +41,8 @@ import org.apache.ambari.server.controller.spi.Request;
 import org.apache.ambari.server.controller.spi.Resource.Type;
 import org.apache.ambari.server.controller.utilities.PropertyHelper;
 import org.apache.ambari.server.state.ChangedConfigInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.inject.Inject;
 
@@ -49,6 +51,8 @@ import com.google.inject.Inject;
  */
 public abstract class StackAdvisorResourceProvider extends ReadOnlyResourceProvider {
 
+  private static final Logger LOG = LoggerFactory.getLogger(StackAdvisorResourceProvider.class);
+
   protected static final String STACK_NAME_PROPERTY_ID = PropertyHelper.getPropertyId("Versions",
       "stack_name");
   protected static final String STACK_VERSION_PROPERTY_ID = PropertyHelper.getPropertyId(

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackArtifactResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackArtifactResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackArtifactResourceProvider.java
index 6bb421b..d042f86 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackArtifactResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackArtifactResourceProvider.java
@@ -56,6 +56,8 @@ import org.apache.ambari.server.state.stack.Metric;
 import org.apache.ambari.server.state.stack.MetricDefinition;
 import org.apache.ambari.server.state.stack.WidgetLayout;
 import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.gson.Gson;
 import com.google.gson.reflect.TypeToken;
@@ -73,6 +75,9 @@ import com.google.inject.Inject;
  */
 @StaticallyInject
 public class StackArtifactResourceProvider extends AbstractControllerResourceProvider {
+
+  private static final Logger LOG = LoggerFactory.getLogger(StackArtifactResourceProvider.class);
+
   /**
    * stack name
    */

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StageResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StageResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StageResourceProvider.java
index 6a326b5..c4251c1 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StageResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StageResourceProvider.java
@@ -56,6 +56,8 @@ import org.apache.ambari.server.topology.TopologyManager;
 import org.apache.ambari.server.utils.SecretReference;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.math.NumberUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.common.collect.Sets;
 
@@ -65,6 +67,8 @@ import com.google.common.collect.Sets;
 @StaticallyInject
 public class StageResourceProvider extends AbstractControllerResourceProvider implements ExtendedResourceProvider {
 
+  private static final Logger LOG = LoggerFactory.getLogger(StageResourceProvider.class);
+
   /**
    * Used for querying stage resources.
    */

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/TaskResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/TaskResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/TaskResourceProvider.java
index 0b4fcd9..39419ec 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/TaskResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/TaskResourceProvider.java
@@ -44,6 +44,8 @@ import org.apache.ambari.server.orm.entities.HostRoleCommandEntity;
 import org.apache.ambari.server.topology.TopologyManager;
 import org.apache.ambari.server.utils.StageUtils;
 import org.codehaus.jackson.map.ObjectMapper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.inject.Inject;
 
@@ -53,6 +55,8 @@ import com.google.inject.Inject;
 @StaticallyInject
 public class TaskResourceProvider extends AbstractControllerResourceProvider {
 
+  private static final Logger LOG = LoggerFactory.getLogger(TaskResourceProvider.class);
+
   // ----- Property ID constants ---------------------------------------------
 
   // Tasks

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ThemeArtifactResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ThemeArtifactResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ThemeArtifactResourceProvider.java
index fc7cfe7..affd969 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ThemeArtifactResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ThemeArtifactResourceProvider.java
@@ -41,9 +41,13 @@ import org.apache.ambari.server.controller.utilities.PropertyHelper;
 import org.apache.ambari.server.state.ServiceInfo;
 import org.apache.ambari.server.state.StackInfo;
 import org.apache.ambari.server.state.ThemeInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class ThemeArtifactResourceProvider extends AbstractControllerResourceProvider {
 
+  private static final Logger LOG = LoggerFactory.getLogger(ThemeArtifactResourceProvider.class);
+
   public static final String STACK_NAME_PROPERTY_ID = PropertyHelper.getPropertyId("ThemeInfo", "stack_name");
   public static final String STACK_VERSION_PROPERTY_ID = PropertyHelper.getPropertyId("ThemeInfo", "stack_version");
   public static final String STACK_SERVICE_NAME_PROPERTY_ID = PropertyHelper.getPropertyId("ThemeInfo", "service_name");

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeItemResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeItemResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeItemResourceProvider.java
index 36eb3be..93b3e46 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeItemResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeItemResourceProvider.java
@@ -57,6 +57,8 @@ import org.apache.ambari.server.security.authorization.RoleAuthorization;
 import org.apache.ambari.server.state.Cluster;
 import org.apache.ambari.server.utils.SecretReference;
 import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.inject.Inject;
 
@@ -66,6 +68,8 @@ import com.google.inject.Inject;
 @StaticallyInject
 public class UpgradeItemResourceProvider extends ReadOnlyResourceProvider {
 
+  private static final Logger LOG = LoggerFactory.getLogger(UpgradeItemResourceProvider.class);
+
   public static final String UPGRADE_CLUSTER_NAME = "UpgradeItem/cluster_name";
   public static final String UPGRADE_REQUEST_ID = "UpgradeItem/request_id";
   public static final String UPGRADE_GROUP_ID = "UpgradeItem/group_id";

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserResourceProvider.java
index c5c36e9..698f419 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserResourceProvider.java
@@ -41,12 +41,16 @@ import org.apache.ambari.server.controller.spi.UnsupportedPropertyException;
 import org.apache.ambari.server.controller.utilities.PropertyHelper;
 import org.apache.ambari.server.security.authorization.AuthorizationException;
 import org.apache.ambari.server.security.authorization.RoleAuthorization;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Resource provider for user resources.
  */
 public class UserResourceProvider extends AbstractControllerResourceProvider implements ResourcePredicateEvaluator {
 
+  private static final Logger LOG = LoggerFactory.getLogger(UserResourceProvider.class);
+
   // ----- Property ID constants ---------------------------------------------
 
   // Users

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ValidationResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ValidationResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ValidationResourceProvider.java
index b78c64a..5448784 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ValidationResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ValidationResourceProvider.java
@@ -42,9 +42,13 @@ import org.apache.ambari.server.controller.spi.ResourceAlreadyExistsException;
 import org.apache.ambari.server.controller.spi.SystemException;
 import org.apache.ambari.server.controller.spi.UnsupportedPropertyException;
 import org.apache.ambari.server.controller.utilities.PropertyHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class ValidationResourceProvider extends StackAdvisorResourceProvider {
 
+  private static final Logger LOG = LoggerFactory.getLogger(ValidationResourceProvider.class);
+
   protected static final String VALIDATION_ID_PROPERTY_ID = PropertyHelper.getPropertyId(
       "Validation", "id");
   protected static final String VALIDATE_PROPERTY_ID = "validate";

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/VersionDefinitionResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/VersionDefinitionResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/VersionDefinitionResourceProvider.java
index f94ac32..b8c956f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/VersionDefinitionResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/VersionDefinitionResourceProvider.java
@@ -71,6 +71,8 @@ import org.apache.commons.lang.math.NumberUtils;
 import org.codehaus.jackson.node.ArrayNode;
 import org.codehaus.jackson.node.JsonNodeFactory;
 import org.codehaus.jackson.node.ObjectNode;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.common.base.Function;
 import com.google.common.collect.Collections2;
@@ -86,6 +88,8 @@ import com.google.inject.Provider;
 @StaticallyInject
 public class VersionDefinitionResourceProvider extends AbstractAuthorizedResourceProvider {
 
+  private static final Logger LOG = LoggerFactory.getLogger(VersionDefinitionResourceProvider.class);
+
   public static final String VERSION_DEF                             = "VersionDefinition";
   public static final String VERSION_DEF_BASE64_PROPERTY             = "version_base64";
   public static final String VERSION_DEF_STACK_NAME                  = "VersionDefinition/stack_name";

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/jdbc/JDBCResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/jdbc/JDBCResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/jdbc/JDBCResourceProvider.java
index ec5363b..8bcbce4 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/jdbc/JDBCResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/jdbc/JDBCResourceProvider.java
@@ -70,7 +70,7 @@ public class JDBCResourceProvider extends BaseProvider implements ResourceProvid
      */
     private final Map<String, Map<String, String>> importedKeys = new HashMap<>();
 
-    protected final static Logger LOG =
+    private static final Logger LOG =
             LoggerFactory.getLogger(JDBCResourceProvider.class);
 
     public JDBCResourceProvider(ConnectionFactory connectionFactory,

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXPropertyProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXPropertyProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXPropertyProvider.java
index 832d9ae..c22f90e 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXPropertyProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXPropertyProvider.java
@@ -116,7 +116,7 @@ public class JMXPropertyProvider extends ThreadPoolEnabledPropertyProvider {
                                  "/jmx?get=Hadoop:service=NameNode,name=FSNamesystem::tag.HAState"));
   }
 
-  protected final static Logger LOG =
+  private static final Logger LOG =
       LoggerFactory.getLogger(JMXPropertyProvider.class);
 
   private static final Pattern dotReplacementCharPattern =

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsCollectorHAClusterState.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsCollectorHAClusterState.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsCollectorHAClusterState.java
index 9ff40b4..231d103 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsCollectorHAClusterState.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsCollectorHAClusterState.java
@@ -47,7 +47,7 @@ public class MetricsCollectorHAClusterState {
   @Inject
   AmbariManagementController managementController;
 
-  protected final static Logger LOG =
+  private static final Logger LOG =
     LoggerFactory.getLogger(MetricsCollectorHAClusterState.class);
 
   public MetricsCollectorHAClusterState(String clusterName) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsCollectorHAManager.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsCollectorHAManager.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsCollectorHAManager.java
index f107aab..d4b5dae 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsCollectorHAManager.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsCollectorHAManager.java
@@ -38,7 +38,7 @@ public class MetricsCollectorHAManager {
   protected AmbariEventPublisher eventPublisher;
 
   private Map<String, MetricsCollectorHAClusterState> clusterCollectorHAState;
-  protected final static Logger LOG =
+  private static final Logger LOG =
     LoggerFactory.getLogger(MetricsCollectorHAManager.class);
 
   public MetricsCollectorHAManager() {

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsDownsamplingMethod.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsDownsamplingMethod.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsDownsamplingMethod.java
index 5994f16..8059560 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsDownsamplingMethod.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsDownsamplingMethod.java
@@ -26,7 +26,7 @@ public abstract class MetricsDownsamplingMethod {
   // Allow for 2 minute discrepancy to account for client side buffering,
   // this ensures at least some data is returned in the initial few minutes.
   private static final long OUT_OF_BAND_TIME_ALLOWANCE = 120000;
-  static Logger LOG = LoggerFactory.getLogger(MetricsDownsamplingMethod.class);
+  private static final Logger LOG = LoggerFactory.getLogger(MetricsDownsamplingMethod.class);
 
   // Downsampling methods iterate over the entire metrics result to create output array.
   // Passing down @TemporalInfo avoids re-iterating to filter out out of band data.

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsPropertyProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsPropertyProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsPropertyProvider.java
index 04f8c78..d5d4368 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsPropertyProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsPropertyProvider.java
@@ -36,7 +36,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public abstract class MetricsPropertyProvider extends AbstractPropertyProvider {
-  protected final static Logger LOG =
+  private static final Logger LOG =
     LoggerFactory.getLogger(MetricsPropertyProvider.class);
 
   protected static final Pattern questionMarkPattern = Pattern.compile("\\?");

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsReportPropertyProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsReportPropertyProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsReportPropertyProvider.java
index a11bcc9..46bc26b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsReportPropertyProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsReportPropertyProvider.java
@@ -43,7 +43,7 @@ public abstract class MetricsReportPropertyProvider extends AbstractPropertyProv
 
   // ----- Constants --------------------------------------------------------
 
-  protected final static Logger LOG =
+  private static final Logger LOG =
     LoggerFactory.getLogger(MetricsReportPropertyProvider.class);
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/RestMetricsPropertyProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/RestMetricsPropertyProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/RestMetricsPropertyProvider.java
index 7ab16da..e2f0906 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/RestMetricsPropertyProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/RestMetricsPropertyProvider.java
@@ -70,7 +70,7 @@ import com.google.inject.assistedinject.AssistedInject;
  */
 public class RestMetricsPropertyProvider extends ThreadPoolEnabledPropertyProvider {
 
-  protected final static Logger LOG =
+  private static final Logger LOG =
       LoggerFactory.getLogger(RestMetricsPropertyProvider.class);
 
   @Inject

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ThreadPoolEnabledPropertyProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ThreadPoolEnabledPropertyProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ThreadPoolEnabledPropertyProvider.java
index a2f7248..d571dae 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ThreadPoolEnabledPropertyProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ThreadPoolEnabledPropertyProvider.java
@@ -41,6 +41,8 @@ import org.apache.ambari.server.controller.spi.Resource;
 import org.apache.ambari.server.controller.spi.SystemException;
 import org.apache.ambari.server.controller.utilities.BufferedThreadPoolExecutorCompletionService;
 import org.apache.ambari.server.controller.utilities.ScalingThreadPoolExecutor;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.common.base.Throwables;
 import com.google.common.cache.Cache;
@@ -75,6 +77,8 @@ import com.google.inject.Inject;
  */
 public abstract class ThreadPoolEnabledPropertyProvider extends AbstractPropertyProvider {
 
+  private static final Logger LOG = LoggerFactory.getLogger(ThreadPoolEnabledPropertyProvider.class);
+
   protected static Configuration configuration;
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaPropertyProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaPropertyProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaPropertyProvider.java
index ecfd400..ac0c590 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaPropertyProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaPropertyProvider.java
@@ -77,7 +77,7 @@ public abstract class GangliaPropertyProvider extends MetricsPropertyProvider {
     GANGLIA_CLUSTER_NAME_MAP.put("SUPERVISOR",         Collections.singletonList("HDPSupervisor"));
   }
 
-  protected final static Logger LOG =
+  private static final Logger LOG =
       LoggerFactory.getLogger(GangliaPropertyProvider.class);
 
   // ----- Constructors ------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaReportPropertyProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaReportPropertyProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaReportPropertyProvider.java
index f15615b..02ea9f3 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaReportPropertyProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaReportPropertyProvider.java
@@ -49,7 +49,7 @@ import org.slf4j.LoggerFactory;
 public class GangliaReportPropertyProvider extends MetricsReportPropertyProvider {
   // ----- Constants --------------------------------------------------------
 
-  protected final static Logger LOG =
+  private static final Logger LOG =
       LoggerFactory.getLogger(GangliaReportPropertyProvider.class);
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java
index cae330b..3d4ad2c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java
@@ -66,10 +66,13 @@ import org.apache.commons.lang.StringUtils;
 import org.apache.hadoop.metrics2.sink.timeline.TimelineMetric;
 import org.apache.hadoop.metrics2.sink.timeline.TimelineMetrics;
 import org.apache.http.client.utils.URIBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.common.collect.Sets;
 
 public abstract class AMSPropertyProvider extends MetricsPropertyProvider {
+  private static final Logger LOG = LoggerFactory.getLogger(AMSPropertyProvider.class);
   private static final String METRIC_REGEXP_PATTERN = "\\([^)]*\\)";
   private static final int COLLECTOR_DEFAULT_PORT = 6188;
   private final TimelineMetricCache metricCache;

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSReportPropertyProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSReportPropertyProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSReportPropertyProvider.java
index 74df3a7..d86a671 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSReportPropertyProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSReportPropertyProvider.java
@@ -51,8 +51,11 @@ import org.apache.ambari.server.events.publishers.AmbariEventPublisher;
 import org.apache.hadoop.metrics2.sink.timeline.TimelineMetric;
 import org.apache.hadoop.metrics2.sink.timeline.TimelineMetrics;
 import org.apache.http.client.utils.URIBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class AMSReportPropertyProvider extends MetricsReportPropertyProvider {
+  private static final Logger LOG = LoggerFactory.getLogger(AMSReportPropertyProvider.class);
   private MetricsPaddingMethod metricsPaddingMethod;
   private final TimelineMetricCache metricCache;
   MetricsRequestHelper requestHelper;

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/DatabaseChecker.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/DatabaseChecker.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/DatabaseChecker.java
index 95352bf..8643fc8 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/DatabaseChecker.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/DatabaseChecker.java
@@ -58,7 +58,7 @@ import com.google.inject.Injector;
 * now we will use DatabaseConsistencyChecker*/
 public class DatabaseChecker {
 
-  static Logger LOG = LoggerFactory.getLogger(DatabaseChecker.class);
+  private static final Logger LOG = LoggerFactory.getLogger(DatabaseChecker.class);
 
   @Inject
   static Injector injector;

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/DefaultServiceCalculatedState.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/DefaultServiceCalculatedState.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/DefaultServiceCalculatedState.java
index 5e02a64..ab07a08 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/DefaultServiceCalculatedState.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/DefaultServiceCalculatedState.java
@@ -55,7 +55,7 @@ import com.google.inject.Provider;
 @StaticallyInject
 public class DefaultServiceCalculatedState implements ServiceCalculatedState {
 
-  protected final static Logger LOG = LoggerFactory.getLogger(DefaultServiceCalculatedState.class);
+  private static final Logger LOG = LoggerFactory.getLogger(DefaultServiceCalculatedState.class);
 
   @Inject
   protected static Provider<Clusters> clustersProvider = null;


[50/50] [abbrv] ambari git commit: Merge branch 'branch-feature-AMBARI-22008' of https://git-wip-us.apache.org/repos/asf/ambari into branch-feature-AMBARI-22008

Posted by am...@apache.org.
Merge branch 'branch-feature-AMBARI-22008' of https://git-wip-us.apache.org/repos/asf/ambari into branch-feature-AMBARI-22008


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: bd5320232d911dec5adf1e253cb2497226841163
Parents: 91087e6 8f2ccf9
Author: Attila Magyar <am...@hortonworks.com>
Authored: Wed Nov 22 12:16:32 2017 +0100
Committer: Attila Magyar <am...@hortonworks.com>
Committed: Wed Nov 22 12:16:32 2017 +0100

----------------------------------------------------------------------

----------------------------------------------------------------------



[09/50] [abbrv] ambari git commit: AMBARI-22412. Remove IPA integration from experimental status (rlevas)

Posted by am...@apache.org.
AMBARI-22412. Remove IPA integration from experimental status (rlevas)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 22b2d55f646ebd965834e43536056c5f229e236e
Parents: 98915a1
Author: Robert Levas <rl...@hortonworks.com>
Authored: Fri Nov 10 10:46:01 2017 -0500
Committer: Robert Levas <rl...@hortonworks.com>
Committed: Fri Nov 10 10:46:01 2017 -0500

----------------------------------------------------------------------
 ambari-web/app/config.js                        |  1 -
 .../main/admin/kerberos/step1_controller.js     | 52 +++++++++-----------
 ambari-web/app/messages.js                      |  2 +-
 .../admin/kerberos/step1_controller_test.js     | 17 -------
 4 files changed, 23 insertions(+), 49 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/22b2d55f/ambari-web/app/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/config.js b/ambari-web/app/config.js
index 0963f70..8dbbde3 100644
--- a/ambari-web/app/config.js
+++ b/ambari-web/app/config.js
@@ -82,7 +82,6 @@ App.supports = {
   serviceAutoStart: true,
   logSearch: true,
   redhatSatellite: false,
-  enableIpa: false,
   addingNewRepository: false,
   kerberosStackAdvisor: true,
   logCountVizualization: false,

http://git-wip-us.apache.org/repos/asf/ambari/blob/22b2d55f/ambari-web/app/controllers/main/admin/kerberos/step1_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/kerberos/step1_controller.js b/ambari-web/app/controllers/main/admin/kerberos/step1_controller.js
index 2e41e3d..9c864a8 100644
--- a/ambari-web/app/controllers/main/admin/kerberos/step1_controller.js
+++ b/ambari-web/app/controllers/main/admin/kerberos/step1_controller.js
@@ -25,29 +25,6 @@ App.KerberosWizardStep1Controller = Em.Controller.extend({
 
   isSubmitDisabled: Em.computed.someBy('selectedOption.preConditions', 'checked', false),
 
-  ipaOption: Em.Object.create({
-    displayName: Em.I18n.t('admin.kerberos.wizard.step1.option.ipa'),
-    value: Em.I18n.t('admin.kerberos.wizard.step1.option.ipa'),
-    preConditions: [
-      Em.Object.create({
-        displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.ipa.condition.1'),
-        checked: false
-      }),
-      Em.Object.create({
-        displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.ipa.condition.2'),
-        checked: false
-      }),
-      Em.Object.create({
-        displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.ipa.condition.3'),
-        checked: false
-      }),
-      Em.Object.create({
-        displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.ipa.condition.4'),
-        checked: false
-      })
-    ]
-  }),
-
   options: Em.A([
     Em.Object.create({
       displayName: Em.I18n.t('admin.kerberos.wizard.step1.option.kdc'),
@@ -94,6 +71,28 @@ App.KerberosWizardStep1Controller = Em.Controller.extend({
       ]
     }),
     Em.Object.create({
+      displayName: Em.I18n.t('admin.kerberos.wizard.step1.option.ipa'),
+      value: Em.I18n.t('admin.kerberos.wizard.step1.option.ipa'),
+      preConditions: [
+        Em.Object.create({
+          displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.ipa.condition.1'),
+          checked: false
+        }),
+        Em.Object.create({
+          displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.ipa.condition.2'),
+          checked: false
+        }),
+        Em.Object.create({
+          displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.ipa.condition.3'),
+          checked: false
+        }),
+        Em.Object.create({
+          displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.ipa.condition.4'),
+          checked: false
+        })
+      ]
+    }),
+    Em.Object.create({
       displayName: Em.I18n.t('admin.kerberos.wizard.step1.option.manual'),
       value: Em.I18n.t('admin.kerberos.wizard.step1.option.manual'),
       preConditions: [
@@ -135,13 +134,6 @@ App.KerberosWizardStep1Controller = Em.Controller.extend({
 
 
   loadStep: function () {
-    if (App.get('supports.enableIpa')) {
-      var ipaOption = this.get('ipaOption');
-      var options = this.get('options');
-      if (options.indexOf(ipaOption) === -1){
-        options.pushObject(ipaOption);
-      }
-    }
   },
 
   submit: function () {

http://git-wip-us.apache.org/repos/asf/ambari/blob/22b2d55f/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index bee581a..390f803 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1273,7 +1273,7 @@ Em.I18n.translations = {
   'admin.kerberos.wizard.step1.option.ad.condition.5': 'The Java Cryptography Extensions (JCE) have been setup on the Ambari Server host and all hosts in the cluster.',
   'admin.kerberos.wizard.step1.option.ipa': 'Existing IPA',
   'admin.kerberos.wizard.step1.option.ipa.condition.1': 'Cluster hosts are joined to the IPA domain and hosts are registered in DNS',
-  'admin.kerberos.wizard.step1.option.ipa.condition.2': 'A password policy in place that sets no expiry for created principals or krbPasswordExpiry attribute is writable',
+  'admin.kerberos.wizard.step1.option.ipa.condition.2': 'A password policy in place that sets no expiry for created principals',
   'admin.kerberos.wizard.step1.option.ipa.condition.3': 'The ipa managed krb5.conf sets default_ccache_name = /tmp/krb5cc_%{uid}',
   'admin.kerberos.wizard.step1.option.ipa.condition.4': 'The Java Cryptography Extensions (JCE) have been setup on the Ambari Server host and all hosts in the cluster.',
   'admin.kerberos.wizard.step1.prerequisites.label': 'Following prerequisites needs to be checked to progress ahead in the wizard.',

http://git-wip-us.apache.org/repos/asf/ambari/blob/22b2d55f/ambari-web/test/controllers/main/admin/kerberos/step1_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/admin/kerberos/step1_controller_test.js b/ambari-web/test/controllers/main/admin/kerberos/step1_controller_test.js
index ca80341..e5a185e 100644
--- a/ambari-web/test/controllers/main/admin/kerberos/step1_controller_test.js
+++ b/ambari-web/test/controllers/main/admin/kerberos/step1_controller_test.js
@@ -46,23 +46,6 @@ describe('App.KerberosWizardStep1Controller', function() {
       controller.set('options', []);
     });
 
-    it("enableIpa is true", function() {
-      App.set('supports.enableIpa', true);
-      controller.loadStep();
-      expect(controller.get('selectedItem')).to.be.equal(Em.I18n.t('admin.kerberos.wizard.step1.option.kdc'));
-      expect(controller.get('options')).to.not.be.empty;
-      controller.loadStep();
-      var options = controller.get('options');
-      expect(options.length).to.be.equal(1);
-    });
-
-    it("enableIpa is false", function() {
-      App.set('supports.enableIpa', false);
-      controller.loadStep();
-      expect(controller.get('selectedItem')).to.be.equal(Em.I18n.t('admin.kerberos.wizard.step1.option.kdc'));
-      expect(controller.get('options')).to.be.empty;
-    });
-    
     it("on load selected item should not change", function() {
       controller.set('selectedItem',Em.I18n.t('admin.kerberos.wizard.step3.option.kdc'));	
       controller.loadStep();