[ambari] branch branch-2.7 updated (b8461bf -> 9fb4764)

2018-07-25 Thread ishanbha
This is an automated email from the ASF dual-hosted git repository.

ishanbha pushed a change to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git.


from b8461bf  [AMBARI-24354] [Log Search UI] wrong filter label on open log 
tab (#1880)
 new 492e933  AMBARI-24304 Fix convert table classpath (asutosh)
 new 9fb4764  AMBARI-24276 include derby jars for Hive convert table step 
(ashutosh)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../HIVE/0.12.0.2.0/package/scripts/pre_upgrade.py| 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)



[ambari] 02/02: AMBARI-24276 include derby jars for Hive convert table step (ashutosh)

2018-07-25 Thread ishanbha
This is an automated email from the ASF dual-hosted git repository.

ishanbha pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git

commit 9fb4764c1d265a535174903fe9fe9dcda9b32ddc
Author: Miklos Gergely 
AuthorDate: Thu Jul 19 13:23:24 2018 +0200

AMBARI-24276 include derby jars for Hive convert table step (ashutosh)
---
 .../common-services/HIVE/0.12.0.2.0/package/scripts/pre_upgrade.py  | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/pre_upgrade.py
 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/pre_upgrade.py
index 37c099e..c9fd147 100644
--- 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/pre_upgrade.py
+++ 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/pre_upgrade.py
@@ -21,7 +21,7 @@ limitations under the License.
 import os
 import shutil
 import traceback
-
+import glob
 
 # Ambari Commons & Resource Management Imports
 from resource_management.core.exceptions import Fail
@@ -100,6 +100,10 @@ class HivePreUpgrade(Script):
   Execute(hive_kinit_cmd, user = params.hive_user)
 
 classpath = 
format("{source_dir}/hive2/lib/*:{source_dir}/hadoop/*:{source_dir}/hadoop/lib/*:{source_dir}/hadoop-mapreduce/*:{source_dir}/hadoop-mapreduce/lib/*:{source_dir}/hadoop-hdfs/*:{source_dir}/hadoop-hdfs/lib/*:{source_dir}/hadoop/etc/hadoop/:{target_dir}/hive/lib/hive-pre-upgrade.jar:{source_dir}/hive/conf/conf.server")
+# hack to avoid derby cp issue we want derby-10.10.2.0.jar to appear first 
in cp, if its available, note other derby jars are derbyclient-10.11.1.1.jar  
derbynet-10.11.1.1.jar
+derby_jars = glob.glob(source_dir+"/hive2/lib/*derby-*.jar")
+if len(derby_jars) == 1:
+  classpath = derby_jars[0] + ":" + classpath
 cmd = format("{java64_home}/bin/java 
-Djavax.security.auth.useSubjectCredsOnly=false -cp {classpath} 
org.apache.hadoop.hive.upgrade.acid.PreUpgradeTool -execute")
 Execute(cmd, user = params.hive_user)
 



[ambari] 01/02: AMBARI-24304 Fix convert table classpath (asutosh)

2018-07-25 Thread ishanbha
This is an automated email from the ASF dual-hosted git repository.

ishanbha pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git

commit 492e93314e9b83d5d68d10fdc5758a6edbd48ca8
Author: Miklos Gergely 
AuthorDate: Thu Jul 19 11:43:52 2018 +0200

AMBARI-24304 Fix convert table classpath (asutosh)
---
 .../common-services/HIVE/0.12.0.2.0/package/scripts/pre_upgrade.py  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/pre_upgrade.py
 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/pre_upgrade.py
index 4db8b8b..37c099e 100644
--- 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/pre_upgrade.py
+++ 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/pre_upgrade.py
@@ -99,7 +99,7 @@ class HivePreUpgrade(Script):
   hive_kinit_cmd = format("{kinit_path_local} -kt {hive_server2_keytab} 
{hive_principal}; ")
   Execute(hive_kinit_cmd, user = params.hive_user)
 
-classpath = 
format("{source_dir}/hive2/lib/*:{source_dir}/hadoop/*:{source_dir}/hadoop/lib/*:{source_dir}/hadoop-mapreduce/*:{source_dir}/hadoop-mapreduce/lib/*:{target_dir}/hive/lib/hive-pre-upgrade.jar:{source_dir}/hive/conf")
+classpath = 
format("{source_dir}/hive2/lib/*:{source_dir}/hadoop/*:{source_dir}/hadoop/lib/*:{source_dir}/hadoop-mapreduce/*:{source_dir}/hadoop-mapreduce/lib/*:{source_dir}/hadoop-hdfs/*:{source_dir}/hadoop-hdfs/lib/*:{source_dir}/hadoop/etc/hadoop/:{target_dir}/hive/lib/hive-pre-upgrade.jar:{source_dir}/hive/conf/conf.server")
 cmd = format("{java64_home}/bin/java 
-Djavax.security.auth.useSubjectCredsOnly=false -cp {classpath} 
org.apache.hadoop.hive.upgrade.acid.PreUpgradeTool -execute")
 Execute(cmd, user = params.hive_user)
 



[ambari] branch trunk updated: AMBARI-24335. Updating service metainfo to declare if Kerberos is required for SSO integration support (#1870)

2018-07-25 Thread smolnar
This is an automated email from the ASF dual-hosted git repository.

smolnar pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 0b7e8d0  AMBARI-24335. Updating service metainfo to declare if 
Kerberos is required for SSO integration support (#1870)
0b7e8d0 is described below

commit 0b7e8d0b0c9fc0e24e21a8de61ea1eb6e682092f
Author: Sandor Molnar 
AuthorDate: Thu Jul 26 00:01:32 2018 +0200

AMBARI-24335. Updating service metainfo to declare if Kerberos is required 
for SSO integration support (#1870)
---
 .../ambari/server/controller/ServiceResponse.java  | 13 ++-
 .../server/controller/StackServiceResponse.java| 10 +
 .../internal/ServiceResourceProvider.java  |  6 ++
 .../internal/StackServiceResourceProvider.java |  7 +-
 .../apache/ambari/server/state/ServiceImpl.java|  9 +++-
 .../apache/ambari/server/state/ServiceInfo.java|  9 +++-
 .../ambari/server/state/SingleSignOnInfo.java  | 25 +-
 .../ambari/server/stack/ServiceModuleTest.java | 10 +++--
 .../ambari/server/state/ServiceInfoTest.java   |  2 ++
 9 files changed, 84 insertions(+), 7 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceResponse.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceResponse.java
index 2c6c4c4..7502f50 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceResponse.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceResponse.java
@@ -39,11 +39,13 @@ public class ServiceResponse {
   private final boolean ssoIntegrationSupported;
   private final boolean ssoIntegrationDesired;
   private final boolean ssoIntegrationEnabled;
+  private final boolean ssoIntegrationRequiresKerberos;
 
   public ServiceResponse(Long clusterId, String clusterName, String 
serviceName,
  StackId desiredStackId, String 
desiredRepositoryVersion,
  RepositoryVersionState repositoryVersionState, String 
desiredState,
- boolean credentialStoreSupported, boolean 
credentialStoreEnabled, boolean ssoIntegrationSupported, boolean 
ssoIntegrationDesired, boolean ssoIntegrationEnabled) {
+ boolean credentialStoreSupported, boolean 
credentialStoreEnabled, boolean ssoIntegrationSupported,
+ boolean ssoIntegrationDesired, boolean 
ssoIntegrationEnabled, boolean ssoIntegrationRequiresKerberos) {
 this.clusterId = clusterId;
 this.clusterName = clusterName;
 this.serviceName = serviceName;
@@ -56,6 +58,7 @@ public class ServiceResponse {
 this.desiredRepositoryVersion = desiredRepositoryVersion;
 this.credentialStoreSupported = credentialStoreSupported;
 this.credentialStoreEnabled = credentialStoreEnabled;
+this.ssoIntegrationRequiresKerberos = ssoIntegrationRequiresKerberos;
   }
 
 
@@ -259,6 +262,14 @@ public class ServiceResponse {
   }
 
   /**
+   * Indicates if Kerberos is required for SSO integration
+   */
+  @ApiModelProperty(name = "sso_integration_requires_kerberos")
+  public boolean isSsoIntegrationRequiresKerberos() {
+return ssoIntegrationRequiresKerberos;
+  }
+
+  /**
* Interface to help correct Swagger documentation generation
*/
   public interface ServiceResponseSwagger extends ApiModel {
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceResponse.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceResponse.java
index 503f56a..fda087a 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceResponse.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceResponse.java
@@ -80,6 +80,7 @@ public class StackServiceResponse {
   private boolean isSupportDeleteViaUI;
 
   private final boolean ssoIntegrationSupported;
+  private final boolean ssoIntegrationRequiresKerberos;
 
   /**
* Constructor.
@@ -117,6 +118,7 @@ public class StackServiceResponse {
 credentialStoreEnabled = service.isCredentialStoreEnabled();
 isSupportDeleteViaUI = service.isSupportDeleteViaUI();
 ssoIntegrationSupported = service.isSingleSignOnSupported();
+ssoIntegrationRequiresKerberos = 
service.isKerberosRequiredForSingleSignOnIntegration();
   }
 
   @ApiModelProperty(name = "selection")
@@ -343,6 +345,14 @@ public class StackServiceResponse {
 return ssoIntegrationSupported;
   }
 
+  /**
+   * Indicates if Kerberos is required for SSO integration
+   */
+  @ApiModelProperty(name = "sso_integration_requires_kerberos")
+  public boolean isSsoIntegrationRequiresKerberos() {
+return ssoIntegrationRequiresKerberos;
+  }
+
   public interface StackServiceResponseSwagger extends ApiModel {
 

[ambari] branch branch-2.7 updated: [AMBARI-24354] [Log Search UI] wrong filter label on open log tab (#1880)

2018-07-25 Thread tobiasistvan
This is an automated email from the ASF dual-hosted git repository.

tobiasistvan pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
 new b8461bf  [AMBARI-24354] [Log Search UI] wrong filter label on open log 
tab (#1880)
b8461bf is described below

commit b8461bf951fc9175f95ac2a434ef03d4ff534325
Author: Istvan Tobias 
AuthorDate: Wed Jul 25 22:27:42 2018 +0200

[AMBARI-24354] [Log Search UI] wrong filter label on open log tab (#1880)

(cherry picked from commit 6917b7146437f66f00a2d52ff7d0da8c213da3df)
---
 .../src/app/services/logs-filtering-utils.service.ts  | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git 
a/ambari-logsearch/ambari-logsearch-web/src/app/services/logs-filtering-utils.service.ts
 
b/ambari-logsearch/ambari-logsearch-web/src/app/services/logs-filtering-utils.service.ts
index 4879930..185a480 100644
--- 
a/ambari-logsearch/ambari-logsearch-web/src/app/services/logs-filtering-utils.service.ts
+++ 
b/ambari-logsearch/ambari-logsearch-web/src/app/services/logs-filtering-utils.service.ts
@@ -435,9 +435,13 @@ export class LogsFilteringUtilsService {
 });
   } else {
 Object.assign(timeRangeParams, {
-  timeRangeInterval: timeRangeValue.interval,
   timeRangeUnit: timeRangeValue.unit
 });
+if (timeRangeValue.interval !== undefined) {
+  Object.assign(timeRangeParams, {
+timeRangeInterval: timeRangeValue.interval
+  });
+}
   }
   Object.assign(newParams, timeRangeParams);
 }
@@ -493,7 +497,7 @@ export class LogsFilteringUtilsService {
   break;
 case 'timeRangeType':
   const type = params.timeRangeType || 'LAST';
-  const interval = parseInt(params.timeRangeInterval, 0);
+  const interval = params.timeRangeInterval && 
parseInt(params.timeRangeInterval, 0);
   const unit = params.timeRangeUnit;
   const timeRangeFilterValue: {[key: string]: any} = {type, unit, 
interval};
   let timeRangeFilterLabel = 'filter.timeRange.';



[ambari] branch trunk updated: [AMBARI-24354] [Log Search UI] wrong filter label on open log tab (#1879)

2018-07-25 Thread tobiasistvan
This is an automated email from the ASF dual-hosted git repository.

tobiasistvan pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new e5160df  [AMBARI-24354] [Log Search UI] wrong filter label on open log 
tab (#1879)
e5160df is described below

commit e5160dfc2201d104f84e59edced76c9b0575527b
Author: Istvan Tobias 
AuthorDate: Wed Jul 25 22:27:13 2018 +0200

[AMBARI-24354] [Log Search UI] wrong filter label on open log tab (#1879)
---
 .../src/app/services/logs-filtering-utils.service.ts  | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git 
a/ambari-logsearch/ambari-logsearch-web/src/app/services/logs-filtering-utils.service.ts
 
b/ambari-logsearch/ambari-logsearch-web/src/app/services/logs-filtering-utils.service.ts
index 4879930..185a480 100644
--- 
a/ambari-logsearch/ambari-logsearch-web/src/app/services/logs-filtering-utils.service.ts
+++ 
b/ambari-logsearch/ambari-logsearch-web/src/app/services/logs-filtering-utils.service.ts
@@ -435,9 +435,13 @@ export class LogsFilteringUtilsService {
 });
   } else {
 Object.assign(timeRangeParams, {
-  timeRangeInterval: timeRangeValue.interval,
   timeRangeUnit: timeRangeValue.unit
 });
+if (timeRangeValue.interval !== undefined) {
+  Object.assign(timeRangeParams, {
+timeRangeInterval: timeRangeValue.interval
+  });
+}
   }
   Object.assign(newParams, timeRangeParams);
 }
@@ -493,7 +497,7 @@ export class LogsFilteringUtilsService {
   break;
 case 'timeRangeType':
   const type = params.timeRangeType || 'LAST';
-  const interval = parseInt(params.timeRangeInterval, 0);
+  const interval = params.timeRangeInterval && 
parseInt(params.timeRangeInterval, 0);
   const unit = params.timeRangeUnit;
   const timeRangeFilterValue: {[key: string]: any} = {type, unit, 
interval};
   let timeRangeFilterLabel = 'filter.timeRange.';



[ambari] branch branch-feature-AMBARI-14714 updated: AMBARI-24194: Fix broken Java UTs in ambari-server code -- Part 4 (#1836)

2018-07-25 Thread jonathanhurley
This is an automated email from the ASF dual-hosted git repository.

jonathanhurley pushed a commit to branch branch-feature-AMBARI-14714
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-feature-AMBARI-14714 by 
this push:
 new ca45b0c  AMBARI-24194: Fix broken Java UTs in ambari-server code -- 
Part 4 (#1836)
ca45b0c is described below

commit ca45b0c769fed337b8eda6c2c181b6f66d9a8790
Author: sduan 
AuthorDate: Wed Jul 25 11:41:45 2018 -0700

AMBARI-24194: Fix broken Java UTs in ambari-server code -- Part 4 (#1836)
---
 .../ambari/server/stack/StackManagerTest.java  | 12 ++--
 .../server/stack/StackServiceDirectoryTest.java|  3 +-
 .../ambari/server/state/cluster/ClusterTest.java   | 69 +++---
 .../ambari/server/state/cluster/ClustersTest.java  |  4 +-
 .../ConcurrentServiceConfigVersionTest.java| 15 +++--
 .../server/upgrade/UpgradeCatalog260Test.java  |  3 +
 6 files changed, 60 insertions(+), 46 deletions(-)

diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/stack/StackManagerTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/stack/StackManagerTest.java
index cef9666..b68fb63 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/stack/StackManagerTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/stack/StackManagerTest.java
@@ -26,6 +26,7 @@ import static org.easymock.EasyMock.verify;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
@@ -386,7 +387,8 @@ public class StackManagerTest {
 // values from base service
 assertEquals(baseSqoopService.isDeleted(), sqoopService.isDeleted());
 
assertEquals(baseSqoopService.getAlertsFile(),sqoopService.getAlertsFile());
-assertEquals(baseSqoopService.getClientComponent(), 
sqoopService.getClientComponent());
+// they are different because of versions are not the same now
+assertNotSame(baseSqoopService.getClientComponent(), 
sqoopService.getClientComponent());
 assertEquals(baseSqoopService.getCommandScript(), 
sqoopService.getCommandScript());
 assertEquals(baseSqoopService.getConfigDependencies(), 
sqoopService.getConfigDependencies());
 assertEquals(baseSqoopService.getConfigDir(), sqoopService.getConfigDir());
@@ -419,7 +421,8 @@ public class StackManagerTest {
 // compare components
 List stormServiceComponents = stormService.getComponents();
 List baseStormServiceComponents = 
baseStormService.getComponents();
-assertEquals(new HashSet<>(stormServiceComponents), new 
HashSet<>(baseStormServiceComponents));
+// The versions are not the same now
+assertNotSame(new HashSet<>(stormServiceComponents), new 
HashSet<>(baseStormServiceComponents));
 // values from base service
 assertEquals(baseStormService.isDeleted(), stormService.isDeleted());
 //todo: specify alerts file in stack
@@ -460,11 +463,12 @@ public class StackManagerTest {
 // compare components
 List serviceComponents = service.getComponents();
 List baseStormServiceCompoents = 
baseSqoopService.getComponents();
-assertEquals(serviceComponents, baseStormServiceCompoents);
+// Versions are different now
+assertNotSame(serviceComponents, baseStormServiceCompoents);
 // values from base service
 assertEquals(baseSqoopService.isDeleted(), service.isDeleted());
 assertEquals(baseSqoopService.getAlertsFile(),service.getAlertsFile());
-assertEquals(baseSqoopService.getClientComponent(), 
service.getClientComponent());
+assertNotSame(baseSqoopService.getClientComponent(), 
service.getClientComponent());
 assertEquals(baseSqoopService.getCommandScript(), 
service.getCommandScript());
 assertEquals(baseSqoopService.getConfigDependencies(), 
service.getConfigDependencies());
 assertEquals(baseSqoopService.getConfigDir(), service.getConfigDir());
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/stack/StackServiceDirectoryTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/stack/StackServiceDirectoryTest.java
index 5983dce..85add08 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/stack/StackServiceDirectoryTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/stack/StackServiceDirectoryTest.java
@@ -44,7 +44,8 @@ public class StackServiceDirectoryTest {
 String pathWithValidChars = "/FakeStackName/1.0/services/FAKESERVICE/";
 String serviceNameInvalidChars = "Fake-Serv.ice";
 
-String desiredServiceAdvisorName = 
"FakeStackName10FakeServiceServiceAdvisor";
+// ambari 3.0 and beyond, no stack is used in serviceadvisor name
+String desiredServiceAdvisorName = "FakeServiceServiceAdvisor";
 
 

[ambari] branch branch-2.7 updated: AMBARI-24260 Ambari shows success when HBase Decommission/Recommission operations fail. (ababiichuk)

2018-07-25 Thread ababiichuk
This is an automated email from the ASF dual-hosted git repository.

ababiichuk pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
 new 9303409  AMBARI-24260 Ambari shows success when HBase 
Decommission/Recommission operations fail. (ababiichuk)
9303409 is described below

commit 9303409f70be58eeb9cb53b71a60c8c73b3c35a6
Author: aBabiichuk 
AuthorDate: Wed Jul 25 19:45:18 2018 +0300

AMBARI-24260 Ambari shows success when HBase Decommission/Recommission 
operations fail. (ababiichuk)
---
 ambari-web/app/utils/ajax/ajax.js  |   3 +
 .../host_component_views/regionserver_view.js  |  58 +-
 .../host_component_views/regionserver_view_test.js | 218 -
 3 files changed, 270 insertions(+), 9 deletions(-)

diff --git a/ambari-web/app/utils/ajax/ajax.js 
b/ambari-web/app/utils/ajax/ajax.js
index 9c36c45..1308c21 100644
--- a/ambari-web/app/utils/ajax/ajax.js
+++ b/ambari-web/app/utils/ajax/ajax.js
@@ -988,6 +988,9 @@ var urls = {
 'real': 
'/clusters/{clusterName}/host_components?HostRoles/component_name=NAMENODE/host_name.in({hostNames})=metrics/dfs/namenode',
 'mock': '/data/hosts/HDP2/decommission_state.json'
   },
+  'host.host_component.decommission_status_regionserver': {
+'real': 
'/clusters/{clusterName}/host_components?HostRoles/component_name=HBASE_MASTER/host_name={hostName}=metrics/hbase/master/liveRegionServersHosts,metrics/hbase/master/deadRegionServersHosts_response=true'
+  },
   'host.region_servers.in_inservice': {
 'real': 
'/clusters/{clusterName}/host_components?HostRoles/component_name=HBASE_REGIONSERVER/desired_admin_state=INSERVICE=HostRoles/host_name_response=true',
 'mock': ''
diff --git 
a/ambari-web/app/views/main/host/details/host_component_views/regionserver_view.js
 
b/ambari-web/app/views/main/host/details/host_component_views/regionserver_view.js
index 8cfb5f5..a2fbecd 100644
--- 
a/ambari-web/app/views/main/host/details/host_component_views/regionserver_view.js
+++ 
b/ambari-web/app/views/main/host/details/host_component_views/regionserver_view.js
@@ -23,12 +23,64 @@ App.RegionServerComponentView = 
App.HostComponentView.extend(App.Decommissionabl
   componentForCheckDecommission: 'HBASE_MASTER',
 
   setDesiredAdminState: function (desiredAdminState) {
+this.getRSDecommissionStatus(desiredAdminState);
+  },
+
+  getRSDecommissionStatus: function (desiredAdminState) {
+const hostName = App.HBaseService.find('HBASE').get('master.hostName');
+App.ajax.send({
+  name: 'host.host_component.decommission_status_regionserver',
+  sender: this,
+  data: {
+hostName,
+desiredAdminState
+  },
+  success: 'getRSDecommissionStatusSuccessCallback',
+  error: 'getRSDecommissionStatusErrorCallback'
+});
+  },
+
+  getRSDecommissionStatusSuccessCallback: function (data, opt, params) {
+const {desiredAdminState} = params,
+  hostName = this.get('content.hostName');
+if (data) {
+  const liveRSHostsMetrics = Em.get(data, 
'items.0.metrics.hbase.master.liveRegionServersHosts'),
+deadRSHostsMetrics = Em.get(data, 
'items.0.metrics.hbase.master.deadRegionServersHosts'),
+liveRSHosts = this.parseRegionServersHosts(liveRSHostsMetrics),
+deadRSHosts = this.parseRegionServersHosts(deadRSHostsMetrics),
+isLiveRS = liveRSHosts.contains(hostName),
+isDeadRS = deadRSHosts.contains(hostName),
+isInServiceDesired = desiredAdminState === 'INSERVICE',
+isDecommissionedDesired = desiredAdminState === 'DECOMMISSIONED';
+  if ((liveRSHosts.length + deadRSHosts.length === 0) || 
(isInServiceDesired && isLiveRS) || (isDecommissionedDesired && isDeadRS)) {
+this.setDesiredAdminStateDefault(desiredAdminState);
+  } else if (isInServiceDesired) {
+this.setStatusAs('RS_DECOMMISSIONED');
+  } else if (isDecommissionedDesired) {
+this.setStatusAs('INSERVICE');
+  }
+} else {
+  this.setDesiredAdminStateDefault(desiredAdminState);
+}
+  },
+
+  getRSDecommissionStatusErrorCallback: function (request, ajaxOptions, error, 
opt, params) {
+this.setDesiredAdminStateDefault(params.desiredAdminState);
+  },
+
+  parseRegionServersHosts: function (str) {
+const items = str ? str.split(';') : [],
+  hosts = items.map(item => item.split(',')[0]);
+return hosts;
+  },
+
+  setDesiredAdminStateDefault: function (desiredAdminState) {
 switch (desiredAdminState) {
-  case "INSERVICE":
+  case 'INSERVICE':
 this.setStatusAs(desiredAdminState);
 break;
-  case "DECOMMISSIONED":
-this.setStatusAs("RS_DECOMMISSIONED");
+  case 'DECOMMISSIONED':
+this.setStatusAs('RS_DECOMMISSIONED');
 break;
 }
   }
diff --git 

[ambari] branch trunk updated: AMBARI-24260 Ambari shows success when HBase Decommission/Recommission operations fail. (ababiichuk)

2018-07-25 Thread ababiichuk
This is an automated email from the ASF dual-hosted git repository.

ababiichuk pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 24c1a6e  AMBARI-24260 Ambari shows success when HBase 
Decommission/Recommission operations fail. (ababiichuk)
24c1a6e is described below

commit 24c1a6eab620445266fa2af3737f081fbebe7959
Author: aBabiichuk 
AuthorDate: Wed Jul 25 19:44:51 2018 +0300

AMBARI-24260 Ambari shows success when HBase Decommission/Recommission 
operations fail. (ababiichuk)
---
 ambari-web/app/utils/ajax/ajax.js  |   3 +
 .../host_component_views/regionserver_view.js  |  58 +-
 .../host_component_views/regionserver_view_test.js | 218 -
 3 files changed, 270 insertions(+), 9 deletions(-)

diff --git a/ambari-web/app/utils/ajax/ajax.js 
b/ambari-web/app/utils/ajax/ajax.js
index 9c36c45..1308c21 100644
--- a/ambari-web/app/utils/ajax/ajax.js
+++ b/ambari-web/app/utils/ajax/ajax.js
@@ -988,6 +988,9 @@ var urls = {
 'real': 
'/clusters/{clusterName}/host_components?HostRoles/component_name=NAMENODE/host_name.in({hostNames})=metrics/dfs/namenode',
 'mock': '/data/hosts/HDP2/decommission_state.json'
   },
+  'host.host_component.decommission_status_regionserver': {
+'real': 
'/clusters/{clusterName}/host_components?HostRoles/component_name=HBASE_MASTER/host_name={hostName}=metrics/hbase/master/liveRegionServersHosts,metrics/hbase/master/deadRegionServersHosts_response=true'
+  },
   'host.region_servers.in_inservice': {
 'real': 
'/clusters/{clusterName}/host_components?HostRoles/component_name=HBASE_REGIONSERVER/desired_admin_state=INSERVICE=HostRoles/host_name_response=true',
 'mock': ''
diff --git 
a/ambari-web/app/views/main/host/details/host_component_views/regionserver_view.js
 
b/ambari-web/app/views/main/host/details/host_component_views/regionserver_view.js
index 8cfb5f5..a2fbecd 100644
--- 
a/ambari-web/app/views/main/host/details/host_component_views/regionserver_view.js
+++ 
b/ambari-web/app/views/main/host/details/host_component_views/regionserver_view.js
@@ -23,12 +23,64 @@ App.RegionServerComponentView = 
App.HostComponentView.extend(App.Decommissionabl
   componentForCheckDecommission: 'HBASE_MASTER',
 
   setDesiredAdminState: function (desiredAdminState) {
+this.getRSDecommissionStatus(desiredAdminState);
+  },
+
+  getRSDecommissionStatus: function (desiredAdminState) {
+const hostName = App.HBaseService.find('HBASE').get('master.hostName');
+App.ajax.send({
+  name: 'host.host_component.decommission_status_regionserver',
+  sender: this,
+  data: {
+hostName,
+desiredAdminState
+  },
+  success: 'getRSDecommissionStatusSuccessCallback',
+  error: 'getRSDecommissionStatusErrorCallback'
+});
+  },
+
+  getRSDecommissionStatusSuccessCallback: function (data, opt, params) {
+const {desiredAdminState} = params,
+  hostName = this.get('content.hostName');
+if (data) {
+  const liveRSHostsMetrics = Em.get(data, 
'items.0.metrics.hbase.master.liveRegionServersHosts'),
+deadRSHostsMetrics = Em.get(data, 
'items.0.metrics.hbase.master.deadRegionServersHosts'),
+liveRSHosts = this.parseRegionServersHosts(liveRSHostsMetrics),
+deadRSHosts = this.parseRegionServersHosts(deadRSHostsMetrics),
+isLiveRS = liveRSHosts.contains(hostName),
+isDeadRS = deadRSHosts.contains(hostName),
+isInServiceDesired = desiredAdminState === 'INSERVICE',
+isDecommissionedDesired = desiredAdminState === 'DECOMMISSIONED';
+  if ((liveRSHosts.length + deadRSHosts.length === 0) || 
(isInServiceDesired && isLiveRS) || (isDecommissionedDesired && isDeadRS)) {
+this.setDesiredAdminStateDefault(desiredAdminState);
+  } else if (isInServiceDesired) {
+this.setStatusAs('RS_DECOMMISSIONED');
+  } else if (isDecommissionedDesired) {
+this.setStatusAs('INSERVICE');
+  }
+} else {
+  this.setDesiredAdminStateDefault(desiredAdminState);
+}
+  },
+
+  getRSDecommissionStatusErrorCallback: function (request, ajaxOptions, error, 
opt, params) {
+this.setDesiredAdminStateDefault(params.desiredAdminState);
+  },
+
+  parseRegionServersHosts: function (str) {
+const items = str ? str.split(';') : [],
+  hosts = items.map(item => item.split(',')[0]);
+return hosts;
+  },
+
+  setDesiredAdminStateDefault: function (desiredAdminState) {
 switch (desiredAdminState) {
-  case "INSERVICE":
+  case 'INSERVICE':
 this.setStatusAs(desiredAdminState);
 break;
-  case "DECOMMISSIONED":
-this.setStatusAs("RS_DECOMMISSIONED");
+  case 'DECOMMISSIONED':
+this.setStatusAs('RS_DECOMMISSIONED');
 break;
 }
   }
diff --git 
a/ambari-web/test/views/main/host/details/host_component_views/regionserver_view_test.js
 

[ambari] branch branch-feature-AMBARI-14714 updated: [AMBARI-24350] UI service configs page hangs.

2018-07-25 Thread ishanbha
This is an automated email from the ASF dual-hosted git repository.

ishanbha pushed a commit to branch branch-feature-AMBARI-14714
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-feature-AMBARI-14714 by 
this push:
 new f44fe6b  [AMBARI-24350] UI service configs page hangs.
f44fe6b is described below

commit f44fe6bb9c25ce4c3d6ec621a92a11c92d72358a
Author: Ishan Bhatt 
AuthorDate: Tue Jul 24 11:46:17 2018 -0700

[AMBARI-24350] UI service configs page hangs.
---
 ambari-web/app/controllers/global/update_controller.js | 10 +-
 ambari-web/app/controllers/main/service/item.js|  1 +
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/ambari-web/app/controllers/global/update_controller.js 
b/ambari-web/app/controllers/global/update_controller.js
index 7dcac8c..c7a3e47 100644
--- a/ambari-web/app/controllers/global/update_controller.js
+++ b/ambari-web/app/controllers/global/update_controller.js
@@ -675,8 +675,8 @@ App.UpdateController = Em.Controller.extend({
 
   //TODO - update service auto-start to use this
   updateClusterEnv: function () {
-this.loadClusterSettings().then(function (settings) {
-  App.router.get('clusterController').set('clusterEnv', { properties: 
settings });
+return 
App.router.get('configurationController').getCurrentConfigsBySites(['cluster-env']).done(function
 (config) {
+  App.router.get('clusterController').set('clusterEnv', config[0]);
 });
   },
 
@@ -688,7 +688,7 @@ App.UpdateController = Em.Controller.extend({
   sender: this
 }).then(data => {
   const settings = {};
-  
+
   if (data && data.items) {
 data.items.forEach(item => {
   const key = item.ClusterSettingInfo.cluster_setting_name;
@@ -696,10 +696,10 @@ App.UpdateController = Em.Controller.extend({
   settings[key] = value;
 });
   }
-  
+
   dfd.resolve(settings);
 }, dfd.reject);
-
+
 return dfd.promise();
   },
 
diff --git a/ambari-web/app/controllers/main/service/item.js 
b/ambari-web/app/controllers/main/service/item.js
index 1200fde..6604143 100644
--- a/ambari-web/app/controllers/main/service/item.js
+++ b/ambari-web/app/controllers/main/service/item.js
@@ -210,6 +210,7 @@ App.MainServiceItemController = 
Em.Controller.extend(App.SupportClientConfigsDow
   loadConfigs: function() {
 this.set('isServiceConfigsLoaded', false);
 this.set('stepConfigs', []);
+let self = this;
 
App.get('router.mainController.isLoading').call(App.get('router.clusterController'),
 'isConfigsPropertiesLoaded').done(() => {
   
App.router.get('configurationController').getCurrentConfigsBySites(this.get('sitesToLoad')).done((configs)
 => {
 let allConfigs = [];



[ambari] branch branch-feature-AMBARI-14714 updated: [AMBARI-24342] PostTrunkMerge : UI issue at Step 7 of deploy, while g… (#1853)

2018-07-25 Thread ishanbha
This is an automated email from the ASF dual-hosted git repository.

ishanbha pushed a commit to branch branch-feature-AMBARI-14714
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-feature-AMBARI-14714 by 
this push:
 new 6e4a5d1  [AMBARI-24342] PostTrunkMerge : UI issue at Step 7 of deploy, 
while g… (#1853)
6e4a5d1 is described below

commit 6e4a5d123da37ae35b83a12f55ef618fa7b8c72d
Author: Ishan Bhatt 
AuthorDate: Wed Jul 25 09:25:58 2018 -0700

[AMBARI-24342] PostTrunkMerge : UI issue at Step 7 of deploy, while g… 
(#1853)

* [AMBARI-24342] PostTrunkMerge : UI issue at Step 7 of deploy, while 
getting configs for service.

* Removing the commented out code
---
 ambari-web/app/controllers/wizard/step7_controller.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ambari-web/app/controllers/wizard/step7_controller.js 
b/ambari-web/app/controllers/wizard/step7_controller.js
index 8e623f0..f66fece 100644
--- a/ambari-web/app/controllers/wizard/step7_controller.js
+++ b/ambari-web/app/controllers/wizard/step7_controller.js
@@ -2153,7 +2153,9 @@ App.WizardStep7Controller = 
App.WizardStepController.extend(App.ServerValidatorM
   },
 
   updateConfigAttributesFromThemes: function () {
-this.get('allSelectedServiceNames').forEach(serviceName => 
this.updateAttributesFromTheme(serviceName));
+App.config.get('preDefinedServiceConfigs').mapProperty('serviceName')
+  .filter(serviceName => 
this.get('allSelectedServiceNames').contains(serviceName))
+  .forEach(serviceName => this.updateAttributesFromTheme(serviceName));
   },
 
   validateOnTabSwitch: function () {



[ambari] branch trunk updated: AMBARI-24344: Upgrade Infra Solr client operation fails for Ubuntu while running migration script for solr upgrade (#1873) (#1885)

2018-07-25 Thread amagyar
This is an automated email from the ASF dual-hosted git repository.

amagyar pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 37e7352  AMBARI-24344: Upgrade Infra Solr client operation fails for 
Ubuntu while running migration script for solr upgrade (#1873) (#1885)
37e7352 is described below

commit 37e7352c442eebf25e3d249e40a36400f9182eaa
Author: jasmeen19 <33417546+jasmee...@users.noreply.github.com>
AuthorDate: Wed Jul 25 20:46:14 2018 +0530

AMBARI-24344: Upgrade Infra Solr client operation fails for Ubuntu while 
running migration script for solr upgrade (#1873) (#1885)
---
 .../src/main/python/ambari_commons/repo_manager/apt_manager.py| 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/ambari-common/src/main/python/ambari_commons/repo_manager/apt_manager.py 
b/ambari-common/src/main/python/ambari_commons/repo_manager/apt_manager.py
index 95a52a9..2136375 100644
--- a/ambari-common/src/main/python/ambari_commons/repo_manager/apt_manager.py
+++ b/ambari-common/src/main/python/ambari_commons/repo_manager/apt_manager.py
@@ -29,10 +29,10 @@ from resource_management.core.logger import Logger
 
 
 def replace_underscores(function_to_decorate):
-  def wrapper(*args):
+  def wrapper(*args, **kwargs):
 self = args[0]
 name = args[1].replace("_", "-")
-return function_to_decorate(self, name, *args[2:])
+return function_to_decorate(self, name, *args[2:], **kwargs)
   return wrapper
 
 



[ambari] branch branch-2.7 updated: AMBARI-24353. Log Feeder: generate solr id from specific fields. (#1882)

2018-07-25 Thread oleewere
This is an automated email from the ASF dual-hosted git repository.

oleewere pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
 new f82827b  AMBARI-24353. Log Feeder: generate solr id from specific 
fields. (#1882)
f82827b is described below

commit f82827b98faa9746abb9ea5feca8e390778843e4
Author: Olivér Szabó 
AuthorDate: Wed Jul 25 15:57:13 2018 +0200

AMBARI-24353. Log Feeder: generate solr id from specific fields. (#1882)
---
 .../ambari/logfeeder/plugin/output/Output.java |  8 ++
 .../ambari/logfeeder/common/IdGeneratorHelper.java | 62 ++
 .../ambari/logfeeder/output/OutputManagerImpl.java |  9 +-
 .../apache/ambari/logfeeder/output/OutputSolr.java | 16 ++--
 .../logfeeder/common/IdGeneratorHelperTest.java| 98 ++
 5 files changed, 183 insertions(+), 10 deletions(-)

diff --git 
a/ambari-logsearch/ambari-logsearch-logfeeder-plugin-api/src/main/java/org/apache/ambari/logfeeder/plugin/output/Output.java
 
b/ambari-logsearch/ambari-logsearch-logfeeder-plugin-api/src/main/java/org/apache/ambari/logfeeder/plugin/output/Output.java
index f369680..13e5ad8 100644
--- 
a/ambari-logsearch/ambari-logsearch-logfeeder-plugin-api/src/main/java/org/apache/ambari/logfeeder/plugin/output/Output.java
+++ 
b/ambari-logsearch/ambari-logsearch-logfeeder-plugin-api/src/main/java/org/apache/ambari/logfeeder/plugin/output/Output.java
@@ -30,6 +30,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.io.File;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
@@ -79,6 +80,13 @@ public abstract class Output getIdFields() {
+return new ArrayList<>();
+  }
+
   public boolean isClosed() {
 return isClosed;
   }
diff --git 
a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/common/IdGeneratorHelper.java
 
b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/common/IdGeneratorHelper.java
new file mode 100644
index 000..7430573
--- /dev/null
+++ 
b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/common/IdGeneratorHelper.java
@@ -0,0 +1,62 @@
+/*
+ * 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.logfeeder.common;
+
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+/**
+ * Helper class to generete UUID (random or based on specific fields)
+ */
+public class IdGeneratorHelper {
+
+  private IdGeneratorHelper() {
+  }
+
+  /**
+   * Generate UUID based on fields (or just randomly)
+   * @param data object map which can contain the field key-value pairs
+   * @param idFields field names that used for generating uuid
+   * @return generated UUID string
+   */
+  public static String generateUUID(Map data, List 
idFields) {
+String uuid = null;
+if (CollectionUtils.isNotEmpty(idFields)) {
+  final StringBuilder sb = new StringBuilder();
+  for (String idField : idFields) {
+if (data.containsKey(idField)) {
+  sb.append(data.get(idField).toString());
+}
+  }
+  String concatId = sb.toString();
+  if (StringUtils.isNotEmpty(concatId)) {
+uuid = UUID.nameUUIDFromBytes(concatId.getBytes()).toString();
+  } else {
+uuid = UUID.randomUUID().toString();
+  }
+} else {
+  uuid = UUID.randomUUID().toString();
+}
+return uuid;
+  }
+}
diff --git 
a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputManagerImpl.java
 
b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputManagerImpl.java
index 09951cc..390a770 100644
--- 
a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputManagerImpl.java
+++ 
b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputManagerImpl.java
@@ -20,10 +20,10 @@ package 

[ambari] branch trunk updated: AMBARI-24353. Log Feeder: generate solr id from specific fields. (#1881)

2018-07-25 Thread oleewere
This is an automated email from the ASF dual-hosted git repository.

oleewere pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 5bd906b  AMBARI-24353. Log Feeder: generate solr id from specific 
fields. (#1881)
5bd906b is described below

commit 5bd906b741d9247b2bea6ac2d9de57b5209dba1e
Author: Olivér Szabó 
AuthorDate: Wed Jul 25 15:56:12 2018 +0200

AMBARI-24353. Log Feeder: generate solr id from specific fields. (#1881)
---
 .../ambari/logfeeder/plugin/output/Output.java |  8 ++
 .../ambari/logfeeder/common/IdGeneratorHelper.java | 62 ++
 .../ambari/logfeeder/output/OutputManagerImpl.java |  9 +-
 .../apache/ambari/logfeeder/output/OutputSolr.java | 16 ++--
 .../logfeeder/common/IdGeneratorHelperTest.java| 98 ++
 5 files changed, 183 insertions(+), 10 deletions(-)

diff --git 
a/ambari-logsearch/ambari-logsearch-logfeeder-plugin-api/src/main/java/org/apache/ambari/logfeeder/plugin/output/Output.java
 
b/ambari-logsearch/ambari-logsearch-logfeeder-plugin-api/src/main/java/org/apache/ambari/logfeeder/plugin/output/Output.java
index f369680..13e5ad8 100644
--- 
a/ambari-logsearch/ambari-logsearch-logfeeder-plugin-api/src/main/java/org/apache/ambari/logfeeder/plugin/output/Output.java
+++ 
b/ambari-logsearch/ambari-logsearch-logfeeder-plugin-api/src/main/java/org/apache/ambari/logfeeder/plugin/output/Output.java
@@ -30,6 +30,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.io.File;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
@@ -79,6 +80,13 @@ public abstract class Output getIdFields() {
+return new ArrayList<>();
+  }
+
   public boolean isClosed() {
 return isClosed;
   }
diff --git 
a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/common/IdGeneratorHelper.java
 
b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/common/IdGeneratorHelper.java
new file mode 100644
index 000..7430573
--- /dev/null
+++ 
b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/common/IdGeneratorHelper.java
@@ -0,0 +1,62 @@
+/*
+ * 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.logfeeder.common;
+
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+/**
+ * Helper class to generete UUID (random or based on specific fields)
+ */
+public class IdGeneratorHelper {
+
+  private IdGeneratorHelper() {
+  }
+
+  /**
+   * Generate UUID based on fields (or just randomly)
+   * @param data object map which can contain the field key-value pairs
+   * @param idFields field names that used for generating uuid
+   * @return generated UUID string
+   */
+  public static String generateUUID(Map data, List 
idFields) {
+String uuid = null;
+if (CollectionUtils.isNotEmpty(idFields)) {
+  final StringBuilder sb = new StringBuilder();
+  for (String idField : idFields) {
+if (data.containsKey(idField)) {
+  sb.append(data.get(idField).toString());
+}
+  }
+  String concatId = sb.toString();
+  if (StringUtils.isNotEmpty(concatId)) {
+uuid = UUID.nameUUIDFromBytes(concatId.getBytes()).toString();
+  } else {
+uuid = UUID.randomUUID().toString();
+  }
+} else {
+  uuid = UUID.randomUUID().toString();
+}
+return uuid;
+  }
+}
diff --git 
a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputManagerImpl.java
 
b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputManagerImpl.java
index 09951cc..390a770 100644
--- 
a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputManagerImpl.java
+++ 
b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputManagerImpl.java
@@ -20,10 +20,10 @@ package org.apache.ambari.logfeeder.output;
 
 

[ambari] branch branch-2.7 updated: AMBARI-24319. Regenerating keytabs for the given service(s) only

2018-07-25 Thread rlevas
This is an automated email from the ASF dual-hosted git repository.

rlevas pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
 new ee68d7c  AMBARI-24319. Regenerating keytabs for the given service(s) 
only
ee68d7c is described below

commit ee68d7cf49a50942cfc7685a5d3219a046da1157
Author: Sandor Molnar 
AuthorDate: Wed Jul 25 08:11:18 2018 +0200

AMBARI-24319. Regenerating keytabs for the given service(s) only
---
 .../server/controller/KerberosHelperImpl.java  |  6 +--
 .../kerberos/KerberosServerAction.java | 50 --
 2 files changed, 40 insertions(+), 16 deletions(-)

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 13cb8fa..a15f424 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
@@ -138,7 +138,6 @@ import org.slf4j.LoggerFactory;
 
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
 import com.google.gson.JsonArray;
 import com.google.gson.JsonObject;
@@ -1867,7 +1866,7 @@ public class KerberosHelperImpl implements KerberosHelper 
{
 
   String uniqueKey = String.format("%s|%s", principal, 
(keytabFile == null) ? "" : keytabFile);
 
-  if (!hostActiveIdentities.containsKey(uniqueKey)) {
+  if (!hostActiveIdentities.containsKey(uniqueKey) || 
(StringUtils.isNotBlank(hostActiveIdentities.get(uniqueKey).getReference()) && 
StringUtils.isBlank(identity.getReference( {
 KerberosPrincipalType principalType = 
principalDescriptor.getType();
 
 // Assume the principal is a service principal if not 
specified
@@ -2468,8 +2467,7 @@ public class KerberosHelperImpl implements KerberosHelper 
{
   handler.createStages(cluster,
 clusterHostInfoJson, hostParamsJson, event, roleCommandOrder, 
kerberosDetails,
 dataDirectory, requestStageContainer, serviceComponentHostsToProcess,
-Collections.singletonMap("KERBEROS", 
Lists.newArrayList("KERBEROS_CLIENT")),
-null, Sets.newHashSet(principal), hostsWithValidKerberosClient);
+null, null, Sets.newHashSet(principal), hostsWithValidKerberosClient);
 
 
   handler.addFinalizeOperationStage(cluster, clusterHostInfoJson, 
hostParamsJson, event,
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 904fd01..0c11e34 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
@@ -21,6 +21,7 @@ package org.apache.ambari.server.serveraction.kerberos;
 import java.io.File;
 import java.io.IOException;
 import java.lang.reflect.Type;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
@@ -41,6 +42,7 @@ import 
org.apache.ambari.server.serveraction.kerberos.stageutils.ResolvedKerbero
 import 
org.apache.ambari.server.serveraction.kerberos.stageutils.ResolvedKerberosPrincipal;
 import org.apache.ambari.server.state.Cluster;
 import org.apache.ambari.server.state.Clusters;
+import org.apache.ambari.server.state.kerberos.KerberosIdentityDescriptor;
 import org.apache.ambari.server.utils.StageUtils;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang.StringUtils;
@@ -178,12 +180,6 @@ public abstract class KerberosServerAction extends 
AbstractServerAction {
   private KerberosOperationHandlerFactory kerberosOperationHandlerFactory;
 
   /**
-   * The KerberosIdentityDataFileReaderFactory to use to obtain 
KerberosIdentityDataFileReader instances
-   */
-  @Inject
-  private KerberosIdentityDataFileReaderFactory 
kerberosIdentityDataFileReaderFactory;
-
-  /**
* KerberosHelper
*/
   @Inject
@@ -455,13 +451,17 @@ public abstract class KerberosServerAction extends 
AbstractServerAction {
   }
 
   try {
-for (ResolvedKerberosKeytab rkk : 
kerberosKeytabController.getFilteredKeytabs((Map>) 
getServiceComponentFilter(), getHostFilter(), getIdentityFilter())) {
+final Map> serviceComponentFilter = 
(Map>) getServiceComponentFilter();
+final Collection serviceIdentities = 
serviceComponentFilter == null ? null : 
calculateServiceIdentities(getClusterName(), serviceComponentFilter);
+for (ResolvedKerberosKeytab rkk : 

[ambari] branch branch-2.7 updated: AMBARI-24333. Raising an error when user is trying to create a view URL with an existing short URL prefix

2018-07-25 Thread rlevas
This is an automated email from the ASF dual-hosted git repository.

rlevas pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
 new 1a67af5  AMBARI-24333. Raising an error when user is trying to create 
a view URL with an existing short URL prefix
1a67af5 is described below

commit 1a67af59eb948f0d3c129a3691084806a132a803
Author: Sandor Molnar 
AuthorDate: Wed Jul 25 08:02:37 2018 +0200

AMBARI-24333. Raising an error when user is trying to create a view URL 
with an existing short URL prefix
---
 .../internal/ViewURLResourceProvider.java  | 12 
 .../apache/ambari/server/orm/dao/ViewURLDAO.java   | 24 +--
 .../ambari/server/orm/entities/ViewURLEntity.java  | 10 ++-
 .../internal/ViewURLResourceProviderTest.java  | 35 +-
 4 files changed, 64 insertions(+), 17 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ViewURLResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ViewURLResourceProvider.java
index 1cf351e..8267492 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ViewURLResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ViewURLResourceProvider.java
@@ -55,7 +55,6 @@ import com.google.inject.Inject;
 /**
  * Resource provider for view URLs.
  */
-@SuppressWarnings("Duplicates")
 @StaticallyInject
 public class ViewURLResourceProvider extends 
AbstractAuthorizedResourceProvider {
 
@@ -268,15 +267,16 @@ public class ViewURLResourceProvider extends 
AbstractAuthorizedResourceProvider
   throw new IllegalStateException("The view " + viewName + " is not 
loaded.");
 }
 
-ViewURLEntity viewUrl = viewInstanceEntity.getViewUrl();
-Optional savedUrl = 
viewURLDAO.findByName(urlEntity.getUrlName());
+if(viewInstanceEntity.getViewUrl() != null) {
+  throw new AmbariException("The view instance selected already has a 
linked URL");
+}
 
-if(savedUrl.isPresent()){
+if(viewURLDAO.findByName(urlEntity.getUrlName()).isPresent()){
   throw new AmbariException("This view URL name exists, URL names 
should be unique");
 }
 
-if(viewUrl != null) {
-  throw new AmbariException("The view instance selected already has a 
linked URL");
+if (viewURLDAO.findBySuffix(urlEntity.getUrlSuffix()).isPresent()) {
+  throw new AmbariException("This view URL suffix has already been 
recorded, URL suffixes should be unique");
 }
 
 viewURLDAO.save(urlEntity);
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ViewURLDAO.java 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ViewURLDAO.java
index 93c9852..4ddd8d1 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ViewURLDAO.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ViewURLDAO.java
@@ -21,6 +21,7 @@ package org.apache.ambari.server.orm.dao;
 import java.util.List;
 
 import javax.persistence.EntityManager;
+import javax.persistence.NoResultException;
 import javax.persistence.TypedQuery;
 
 import org.apache.ambari.server.orm.RequiresSession;
@@ -42,9 +43,6 @@ public class ViewURLDAO {
*/
   @Inject
   private Provider entityManagerProvider;
-  @Inject
-  private DaoUtils daoUtils;
-
 
   /**
* Find all view instances.
@@ -77,6 +75,26 @@ public class ViewURLDAO {
   }
 
   /**
+   * Find URL by suffix
+   *
+   * @param urlSuffix
+   *  the suffix to get the URL by
+   * @return Optional.absent() if no view URL with the given 
suffix;
+   * otherwise an appropriate Optional instance holding 
the
+   * fetched view URL
+   */
+  @RequiresSession
+  public Optional findBySuffix(String urlSuffix) {
+TypedQuery query = 
entityManagerProvider.get().createNamedQuery("viewUrlBySuffix", 
ViewURLEntity.class);
+query.setParameter("urlSuffix", urlSuffix);
+try {
+  return Optional.of(query.getSingleResult());
+} catch (NoResultException e) {
+  return Optional.absent();
+}
+  }
+
+  /**
* Save a URL entity
* @param urlEntity
  */
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ViewURLEntity.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ViewURLEntity.java
index 78bb49d..c16fdc3 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ViewURLEntity.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ViewURLEntity.java
@@ -41,13 +41,9 @@ import javax.persistence.TableGenerator;
 )
 
 @NamedQueries({
-@NamedQuery(name = "allViewUrls",
-query = "SELECT viewUrl FROM ViewURLEntity viewUrl"),
-

[ambari] branch branch-2.7 updated: AMBARI-24344: Upgrade Infra Solr client operation fails for Ubuntu while running migration script for solr upgrade (#1873)

2018-07-25 Thread amagyar
This is an automated email from the ASF dual-hosted git repository.

amagyar pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
 new dc1d5cc  AMBARI-24344: Upgrade Infra Solr client operation fails for 
Ubuntu while running migration script for solr upgrade (#1873)
dc1d5cc is described below

commit dc1d5ccac4677175b89dcdd4b7dd99d2a481e337
Author: jasmeen19 <33417546+jasmee...@users.noreply.github.com>
AuthorDate: Wed Jul 25 17:24:00 2018 +0530

AMBARI-24344: Upgrade Infra Solr client operation fails for Ubuntu while 
running migration script for solr upgrade (#1873)
---
 .../src/main/python/ambari_commons/repo_manager/apt_manager.py| 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/ambari-common/src/main/python/ambari_commons/repo_manager/apt_manager.py 
b/ambari-common/src/main/python/ambari_commons/repo_manager/apt_manager.py
index 95a52a9..2136375 100644
--- a/ambari-common/src/main/python/ambari_commons/repo_manager/apt_manager.py
+++ b/ambari-common/src/main/python/ambari_commons/repo_manager/apt_manager.py
@@ -29,10 +29,10 @@ from resource_management.core.logger import Logger
 
 
 def replace_underscores(function_to_decorate):
-  def wrapper(*args):
+  def wrapper(*args, **kwargs):
 self = args[0]
 name = args[1].replace("_", "-")
-return function_to_decorate(self, name, *args[2:])
+return function_to_decorate(self, name, *args[2:], **kwargs)
   return wrapper
 
 



[ambari] branch branch-2.7 updated: [AMBARI-24338] [Log Search UI] Add application routing information to README.md (#1859)

2018-07-25 Thread tobiasistvan
This is an automated email from the ASF dual-hosted git repository.

tobiasistvan pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
 new db1d256  [AMBARI-24338] [Log Search UI] Add application routing 
information to README.md (#1859)
db1d256 is described below

commit db1d2566f0c4e2abf14a1c088a7cd5a134bbfb83
Author: Istvan Tobias 
AuthorDate: Wed Jul 25 12:26:33 2018 +0200

[AMBARI-24338] [Log Search UI] Add application routing information to 
README.md (#1859)

* [AMBARI-24338] [Log Search UI] Add application routing information to 
README.md

(cherry picked from commit bff6030f534216687de8f63a7f8c3857d71c9ab3)

* [AMBARI-24338] [Log Search UI] Add application routing information to 
README.md - fixinf unordered list

(cherry picked from commit cddcf63212371d7f7c66da8e99a672d9508d636f)
---
 ambari-logsearch/ambari-logsearch-web/README.md | 169 
 1 file changed, 169 insertions(+)

diff --git a/ambari-logsearch/ambari-logsearch-web/README.md 
b/ambari-logsearch/ambari-logsearch-web/README.md
index a91ad9a..50e1e29 100644
--- a/ambari-logsearch/ambari-logsearch-web/README.md
+++ b/ambari-logsearch/ambari-logsearch-web/README.md
@@ -46,3 +46,172 @@ Before running the tests make sure you are serving the app 
via `npm start` or `y
 ## Further help
 
 To get more help on the Angular CLI use `ng help` or go check out the [Angular 
CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
+
+# Application Info
+
+## Routing and URL params
+We use [Matrix URIs](https://www.w3.org/DesignIssues/MatrixURIs.html) to route 
our components. That means within the components we use semicolon separated 
parameters.
+You can create/generate Log Search Client application URL with the following 
paths and parameters
+
+URL pattern: `/logs/{logs-type};{filter-param1};...;{filter-paramN}`
+Where the `{logs-type}` can be `serviceLogs` or `auditLogs` right now.
+
+For this screen the available URL params are the followings:
+- `components`:
+  - type: filter parameter
+  - a comma separated list of components/services
+  - eg.: `components=activity_explorer,ambari_agent`
+- `levels`:
+  - type: filter parameter
+  - a comma separated list of log levels
+  - eg.: `levels=INFO,WARN,ERROR,FATAL,DEBUG,TRACE,UNKNOW`
+- `hosts`:
+  - type: filter parameter
+  - a comma separated list of hosts
+  - eg.: `hosts=c7401.ambari.apache.org,c7402.ambari.apache.org`
+- `query`:
+  - type: filter parameter
+  - a JSON object with the following available keys as filters
+  - eg.: `[{"name": "level", "label": "Level", "value": "ERROR", "isExclude": 
false}]` 
+
+### Time range matrix params
+To filter for a range of time you can use the following matrix parameters:
+- `timeRangeUnit`: the unit of the time
+  - `m`: minute
+  - `h`: hour
+  - `d`: day
+  - `w`: week
+  - `M`: month
+  - `y`: year
+- `timeRangeType`
+  - `LAST`: it will count the time from the current moment back
+  - `PAST`: it will count the time from the end of the previous time unit (set 
up in `timeRangeUnit`)
+  - `CURRENT`: it will count the time from the end of the current time unit 
(set up in `timeRangeUnit`)
+  - `CUSTOM`: will check the `timeRangeStart` and the `timeRangeEnd` matrix 
parameters
+- `timeRangeStart`: UTC + Time zone format, eg.: 
`timeRangeStart=2018-06-30T22:00:00.000Z`
+- `timeRangeEnd`: UTC + Time zone format, eg.: 
`timeRangeStart=2018-06-30T23:00:00.000Z`
+
+ Examples to defining time ranges:
+Last 3 hours
+`timeRangeType=LAST;timeRangeInterval=3;timeRangeUnit=h`
+Last 7 days:
+`timeRangeType=LAST;timeRangeInterval=7;timeRangeUnit=d`
+Last 1 year
+`timeRangeType=LAST;timeRangeInterval=1;timeRangeUnit=y`
+Previous week
+`timeRangeType=PAST;timeRangeUnit=w`
+Previous month
+`timeRangeType=PAST;timeRangeUnit=M`
+Custom time range
+`timeRangeType=CUSTOM;timeRangeStart=2018-07-01T10:06:00.000Z;timeRangeEnd=2018-07-02T13:06:00.000Z`
+
+# The `query` param
+## Structure
+The `query` matrix param is an array of filter params in JSON format. The item 
schema is the following:
+```
+{
+name: string,
+label: string,
+value: string/number/boolean,
+isExclude: boolean
+}
+```
+Where the `name` is for the field name that you want to filter, the `label` is 
what the filter input bar will display, the `value` is the filter value and the 
`isExclude` is a boolean value indicating if the given field value should be 
included or excluded from the search result.
+
+## Available fields in the `query` matrix param for Service Logs
+- `cluster` (label: Cluster)
+- `method` (label: Method)
+- `level` (label: Level)
+- `ip` (label: IP)
+- `key_log_messafe` (Key Log Message)
+- `type` (label: Component)
+- `path` (label: Path)
+- `logtype` (label: Logtype)
+- `file` (label: File)
+- `line_number` (label: Line Number)
+- `thread_name` (label: