[ambari] branch trunk updated (45076eb -> f2839ad)

2018-04-04 Thread avijayan
This is an automated email from the ASF dual-hosted git repository.

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


from 45076eb  AMBARI-23429 Added missing imports
 new af8d02c  AMBARI-23427 : Metrics Collector stops after starting.
 new f2839ad  AMBARI-23427 : Metrics Collector stops after starting. Fix 
Metadata load issue.

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:
 .../metrics/timeline/PhoenixHBaseAccessor.java | 51 +--
 .../aggregators/AbstractTimelineAggregator.java|  3 +-
 .../metrics/timeline/query/PhoenixTransactSQL.java | 15 ++---
 .../timeline/uuid/HashBasedUuidGenStrategy.java| 73 +-
 .../resources/metrics_def/AMSSMOKETESTFAKE.DAT |  1 +
 .../src/main/resources/metrics_def/NAMENODE.dat|  2 +
 .../metrics_def/TIMELINE_METRIC_STORE_WATCHER.DAT  |  1 +
 .../uuid/TimelineMetricUuidManagerTest.java| 28 +++--
 8 files changed, 94 insertions(+), 80 deletions(-)
 create mode 100644 
ambari-metrics/ambari-metrics-timelineservice/src/main/resources/metrics_def/AMSSMOKETESTFAKE.DAT
 create mode 100644 
ambari-metrics/ambari-metrics-timelineservice/src/main/resources/metrics_def/TIMELINE_METRIC_STORE_WATCHER.DAT

-- 
To stop receiving notification emails like this one, please contact
avija...@apache.org.


[ambari] 01/02: AMBARI-23427 : Metrics Collector stops after starting.

2018-04-04 Thread avijayan
This is an automated email from the ASF dual-hosted git repository.

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

commit af8d02c6c5c6a3c429f9e3a4e68b10586b574bcf
Author: Aravindan Vijayan 
AuthorDate: Mon Apr 2 16:10:27 2018 -0700

AMBARI-23427 : Metrics Collector stops after starting.
---
 .../metrics/timeline/PhoenixHBaseAccessor.java | 45 -
 .../aggregators/AbstractTimelineAggregator.java|  3 +-
 .../metrics/timeline/query/PhoenixTransactSQL.java | 15 ++---
 .../timeline/uuid/HashBasedUuidGenStrategy.java| 73 +-
 .../resources/metrics_def/AMSSMOKETESTFAKE.DAT |  1 +
 .../src/main/resources/metrics_def/NAMENODE.dat|  2 +
 .../metrics_def/TIMELINE_METRIC_STORE_WATCHER.DAT  |  1 +
 .../uuid/TimelineMetricUuidManagerTest.java| 28 +++--
 8 files changed, 89 insertions(+), 79 deletions(-)

diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
index 7cb317b..7535b50 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
@@ -337,25 +337,36 @@ public class PhoenixHBaseAccessor {
   double[] aggregates = AggregatorUtils.calculateAggregates(
   metric.getMetricValues());
 
-  byte[] uuid = metadataManagerInstance.getUuid(metric);
-  if (uuid == null) {
-LOG.error("Error computing UUID for metric. Cannot write metrics : 
" + metric.toString());
-continue;
+  if (aggregates[3] != 0.0) {
+byte[] uuid = metadataManagerInstance.getUuid(metric);
+if (uuid == null) {
+  LOG.error("Error computing UUID for metric. Cannot write metrics 
: " + metric.toString());
+  continue;
+}
+metricRecordStmt.setBytes(1, uuid);
+metricRecordStmt.setLong(2, metric.getStartTime());
+metricRecordStmt.setDouble(3, aggregates[0]);
+metricRecordStmt.setDouble(4, aggregates[1]);
+metricRecordStmt.setDouble(5, aggregates[2]);
+metricRecordStmt.setLong(6, (long) aggregates[3]);
+String json = 
TimelineUtils.dumpTimelineRecordtoJSON(metric.getMetricValues());
+metricRecordStmt.setString(7, json);
+
+try {
+  int rows = metricRecordStmt.executeUpdate();
+  if 
(metric.getMetricName().equals("TimelineMetricStoreWatcher.FakeMetric")) {
+LOG.info("Inserted " + rows + " rows for 
TimelineMetricStoreWatcher.FakeMetric.");
+  }
+} catch (SQLException sql) {
+  LOG.error("Failed on insert records to store.", sql);
+}
+  } else {
+LOG.debug("Discarding empty metric record for : [" + 
metric.getMetricName() + "," +
+  metric.getAppId() + "," +
+  metric.getHostName() + "," +
+  metric.getInstanceId() + "]");
   }
-  metricRecordStmt.setBytes(1, uuid);
-  metricRecordStmt.setLong(2, metric.getStartTime());
-  metricRecordStmt.setDouble(3, aggregates[0]);
-  metricRecordStmt.setDouble(4, aggregates[1]);
-  metricRecordStmt.setDouble(5, aggregates[2]);
-  metricRecordStmt.setLong(6, (long) aggregates[3]);
-  String json = 
TimelineUtils.dumpTimelineRecordtoJSON(metric.getMetricValues());
-  metricRecordStmt.setString(7, json);
 
-  try {
-metricRecordStmt.executeUpdate();
-  } catch (SQLException sql) {
-LOG.error("Failed on insert records to store.", sql);
-  }
 }
   }
 
diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/AbstractTimelineAggregator.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/AbstractTimelineAggregator.java
index 0203f88..8465dc3 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/AbstractTimelineAggregator.java
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/AbstractTimelineAggregator.java
@@ -406,7 +406,7 @@ 

[ambari] 02/02: AMBARI-23427 : Metrics Collector stops after starting. Fix Metadata load issue.

2018-04-04 Thread avijayan
This is an automated email from the ASF dual-hosted git repository.

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

commit f2839ad00e79ecc3fcd74405432f7b4573d0b5de
Author: Aravindan Vijayan 
AuthorDate: Wed Apr 4 09:20:30 2018 -0700

AMBARI-23427 : Metrics Collector stops after starting. Fix Metadata load 
issue.
---
 .../metrics/timeline/PhoenixHBaseAccessor.java  | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
index 7535b50..69307d1 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
@@ -1774,7 +1774,11 @@ public class PhoenixHBaseAccessor {
   rs = stmt.executeQuery();
 
   while (rs.next()) {
-TimelineMetricHostMetadata hostMetadata = new 
TimelineMetricHostMetadata(new 
HashSet<>(Arrays.asList(StringUtils.split(rs.getString("APP_IDS"), ",";
+String appIds = rs.getString("APP_IDS");
+TimelineMetricHostMetadata hostMetadata = new 
TimelineMetricHostMetadata(new HashSet<>());
+if (StringUtils.isNotEmpty(appIds)) {
+  hostMetadata = new TimelineMetricHostMetadata(new 
HashSet<>(Arrays.asList(StringUtils.split(appIds, ",";
+}
 hostMetadata.setUuid(rs.getBytes("UUID"));
 hostedAppMap.put(rs.getString("HOSTNAME"), hostMetadata);
   }

-- 
To stop receiving notification emails like this one, please contact
avija...@apache.org.


[ambari] branch branch-feature-AMBARI-14714 updated (b5f15af -> f395077)

2018-04-04 Thread mradhakrishnan
This is an automated email from the ASF dual-hosted git repository.

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


from b5f15af  Merge pull request #853 from 
scottduan/AMBARI-23136-branch-feature-AMBARI-14714
 add f997a5a  [AMBARI-23255] Load modules and components into a map when 
reading the mpack.json
 add 7305d32  [AMBARI-23255] Load modules and components into a map when 
reading the mpack.json
 add e1a39ac  Merge branch 'AMBARI-23255' of 
https://github.com/mradha25/ambari into AMBARI-23255
 add 3738300  [AMBARI-23255] Load modules and components into a map when 
reading the mpack.json - Review comments
 add 9f5ce92  [AMBARI-23255] Load modules and components into a map when 
reading the mpack.json - Review comments
 new f395077  Merge pull request #808 from mradha25/AMBARI-23255

The 1 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:
 .../apache/ambari/server/mpack/MpackManager.java   |  4 +++
 .../org/apache/ambari/server/state/Module.java | 27 -
 .../java/org/apache/ambari/server/state/Mpack.java | 34 +-
 3 files changed, 43 insertions(+), 22 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
mradhakrish...@apache.org.


[ambari] 01/01: Merge pull request #808 from mradha25/AMBARI-23255

2018-04-04 Thread mradhakrishnan
This is an automated email from the ASF dual-hosted git repository.

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

commit f395077ba2a1b3853b0167e53eef3b0187dac8ae
Merge: b5f15af 9f5ce92
Author: mradha25 
AuthorDate: Wed Apr 4 15:15:01 2018 -0700

Merge pull request #808 from mradha25/AMBARI-23255

[AMBARI-23255] Load modules and components into a map when reading the 
mpack.json

 .../apache/ambari/server/mpack/MpackManager.java   |  4 +++
 .../org/apache/ambari/server/state/Module.java | 27 -
 .../java/org/apache/ambari/server/state/Mpack.java | 34 +-
 3 files changed, 43 insertions(+), 22 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
mradhakrish...@apache.org.


[ambari] branch branch-feature-AMBARI-14714 updated (48b9007 -> b5f15af)

2018-04-04 Thread swapan
This is an automated email from the ASF dual-hosted git repository.

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


from 48b9007  Merge pull request #839 from mradha25/AMBARI-22904
 add 40e080b  AMBARI-23136: Continued: Create an interface to read 
command.json properties via API instead of direct access
 add c5eb80d  Merge branch 'AMBARI-23136-branch-feature-AMBARI-14714' of 
https://github.com/scottduan/ambari into 
AMBARI-23136-branch-feature-AMBARI-14714
 add 5f69f15  AMBARI-23136: Continued: Create an interface to read 
command.json properties via API instead of direct access
 add 5ad2f4f  AMBARI-23136: Continued: Create an interface to read 
command.json properties via API instead of direct access
 new b5f15af  Merge pull request #853 from 
scottduan/AMBARI-23136-branch-feature-AMBARI-14714

The 1 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:
 .../execution_command/execution_command.py | 69 --
 .../libraries/functions/format_jvm_option.py   | 25 
 2 files changed, 77 insertions(+), 17 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
swa...@apache.org.


[ambari] 01/01: Merge pull request #853 from scottduan/AMBARI-23136-branch-feature-AMBARI-14714

2018-04-04 Thread swapan
This is an automated email from the ASF dual-hosted git repository.

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

commit b5f15afb80d94cd86effa9941bd51efa1091b556
Merge: 48b9007 5ad2f4f
Author: swapanshridhar 
AuthorDate: Wed Apr 4 13:53:28 2018 -0700

Merge pull request #853 from 
scottduan/AMBARI-23136-branch-feature-AMBARI-14714

 .../execution_command/execution_command.py | 69 --
 .../libraries/functions/format_jvm_option.py   | 25 
 2 files changed, 77 insertions(+), 17 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
swa...@apache.org.


[ambari] branch trunk updated: AMBARI-23429 Added missing imports

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

rlevas 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 45076eb  AMBARI-23429 Added missing imports
45076eb is described below

commit 45076eb19e373cd18f48372e68833c70f40a728d
Author: Srikanth Janardhan 
AuthorDate: Tue Apr 3 13:16:15 2018 +0530

AMBARI-23429 Added missing imports
---
 .../common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py   | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
index 2908676..17f2310 100644
--- 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
+++ 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
@@ -20,6 +20,7 @@ limitations under the License.
 
 import ConfigParser
 import os
+import re
 
 from ambari_commons import OSCheck
 from ambari_commons.ambari_metrics_helper import 
select_metric_collector_hosts_from_hostnames

-- 
To stop receiving notification emails like this one, please contact
rle...@apache.org.


[ambari] branch trunk updated: AMBARI-23420 Refine pre-check message to remove unsupported services before upgrade to HDP-3.0

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

rlevas 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 726080b  AMBARI-23420 Refine pre-check message to remove unsupported 
services before upgrade to HDP-3.0
726080b is described below

commit 726080bd4fc195c245939e2bfa0f84e0f6126b65
Author: vsharma 
AuthorDate: Sat Mar 31 21:43:35 2018 +0530

AMBARI-23420 Refine pre-check message to remove unsupported services before 
upgrade to HDP-3.0
---
 .../main/java/org/apache/ambari/server/checks/CheckDescription.java| 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

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 ce48640..fa9e583 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
@@ -279,8 +279,7 @@ public class CheckDescription {
   "After upgrading, %s can be reinstalled")
   .put(ServicePresenceCheck.KEY_SERVICE_REMOVED,
   "The %s service is currently installed on the cluster. " +
-  "This service is removed from the new release and must be removed 
before the upgrade can continue. " +
-  "After upgrading, %s can be installed").build());
+  "This service is removed from the new release and must be removed 
before the upgrade can continue.").build());
 
   public static CheckDescription RANGER_SERVICE_AUDIT_DB_CHECK = new 
CheckDescription("RANGER_SERVICE_AUDIT_DB_CHECK",
 PrereqCheckType.SERVICE,

-- 
To stop receiving notification emails like this one, please contact
rle...@apache.org.


[ambari] branch trunk updated: [AMBARI-23433] Remove unnecessary properties from the Ranger SSO configuration updates via the stack advisor

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

rlevas 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 768ee9a  [AMBARI-23433] Remove unnecessary properties from the Ranger 
SSO configuration updates via the stack advisor
768ee9a is described below

commit 768ee9a2035d8ba6061e16c44b371afbf9209276
Author: Robert Levas 
AuthorDate: Tue Apr 3 16:15:44 2018 -0400

[AMBARI-23433] Remove unnecessary properties from the Ranger SSO 
configuration updates via the stack advisor
---
 .../src/main/resources/stacks/HDP/2.6/services/stack_advisor.py  | 1 -
 1 file changed, 1 deletion(-)

diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.6/services/stack_advisor.py 
b/ambari-server/src/main/resources/stacks/HDP/2.6/services/stack_advisor.py
index 7c9527c..7cffa1d 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.6/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/stack_advisor.py
@@ -576,7 +576,6 @@ class HDP26StackAdvisor(HDP25StackAdvisor):
 if ambari_sso_details:
   putRangerAdminSiteProperty('ranger.sso.providerurl', 
ambari_sso_details.get_jwt_provider_url())
   putRangerAdminSiteProperty('ranger.sso.publicKey', 
ambari_sso_details.get_jwt_public_key(False, True))
-  putRangerAdminSiteProperty('ranger.sso.cookiename', 
ambari_sso_details.get_jwt_cookie_name())
   putRangerAdminSiteProperty('ranger.sso.browser.useragent', 
'Mozilla,chrome')
 
   # If SSO should be disabled for this service

-- 
To stop receiving notification emails like this one, please contact
rle...@apache.org.


[ambari] branch trunk updated: AMBARI-23440. Receiving HTTP error code of 404 when fetching sso-configuration from the DB is not a real error and should be handled

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

rlevas 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 e1d45a0  AMBARI-23440. Receiving HTTP error code of 404 when fetching 
sso-configuration from the DB is not a real error and should be handled
e1d45a0 is described below

commit e1d45a0884d9fd7ff5a82fc5ac48f7df1a027410
Author: Sandor Molnar 
AuthorDate: Tue Apr 3 22:01:25 2018 +0200

AMBARI-23440. Receiving HTTP error code of 404 when fetching 
sso-configuration from the DB is not a real error and should be handled
---
 .../src/main/python/ambari_server/setupSso.py  | 33 ++--
 ambari-server/src/test/python/TestSetupSso.py  | 35 ++
 2 files changed, 53 insertions(+), 15 deletions(-)

diff --git a/ambari-server/src/main/python/ambari_server/setupSso.py 
b/ambari-server/src/main/python/ambari_server/setupSso.py
index dc97f22..48e5d77 100644
--- a/ambari-server/src/main/python/ambari_server/setupSso.py
+++ b/ambari-server/src/main/python/ambari_server/setupSso.py
@@ -27,7 +27,7 @@ import urllib2
 
 from ambari_commons.os_utils import is_root, run_os_command, copy_file, 
set_file_permissions, remove_file
 from ambari_commons.exceptions import FatalException, NonFatalException
-from ambari_commons.logging_utils import get_silent, print_info_msg
+from ambari_commons.logging_utils import get_silent
 from ambari_server.userInput import get_validated_string_input, get_YN_input, 
get_multi_line_input
 from ambari_server.serverUtils import is_server_runing, 
get_ambari_server_api_base, get_ambari_admin_username_password_pair, 
get_cluster_name, perform_changes_via_rest_api
 from ambari_server.setupSecurity import REGEX_TRUE_FALSE
@@ -225,20 +225,23 @@ def get_sso_property_from_db(properties, admin_login, 
admin_password, property_n
 response_status_code = response.getcode()
 if response_status_code != 200:
   request_in_progress = False
-  if response_status_code == 404:
-## This means that there is no SSO configuration in the database 
yet -> we can not fetch the property (but this is NOT an error)
-sso_property = None
-  else:
-err = 'Error while fetching SSO configuration. Http status code - 
' + str(response_status_code)
-raise FatalException(1, err)
+  err = 'Error while fetching SSO configuration. Http status code - ' 
+ str(response_status_code)
+  raise FatalException(1, err)
 else:
-response_body = json.loads(response.read())
-sso_properties = response_body['Configuration']['properties']
-sso_property = sso_properties[property_name]
-if not sso_property:
-  time.sleep(1)
-else:
-  request_in_progress = False
+  response_body = json.loads(response.read())
+  sso_properties = response_body['Configuration']['properties']
+  sso_property = sso_properties[property_name]
+  if not sso_property:
+time.sleep(1)
+  else:
+request_in_progress = False
+except urllib2.HTTPError as http_error:
+  if http_error.code == 404:
+# This means that there is no SSO configuration in the database yet -> 
we can not fetch the property (but this is NOT an error)
+request_in_progress = False
+sso_property = None
+  else:
+raise http_error
 except Exception as e:
   request_in_progress = False
   err = 'Error while fetching SSO configuration. Error details: %s' % e
@@ -281,7 +284,7 @@ def setup_sso(options):
 if not options.sso_enabled:
   sso_enabled_from_db = get_sso_property_from_db(properties, admin_login, 
admin_password, SSO_MANAGE_SERVICES)
   sso_enabled = sso_enabled_from_db == None or sso_enabled_from_db in 
['true']
-  print_info_msg("SSO is currently {0}".format("not configured" if 
sso_enabled_from_db == None else ("enabled" if sso_enabled else "disabled")), 
True)
+  sys.stdout.write("\nSSO is currently {0}\n".format("not configured" if 
sso_enabled_from_db == None else ("enabled" if sso_enabled else "disabled")))
   if sso_enabled:
 enable_sso = not get_YN_input("Do you want to disable SSO 
authentication [y/n] (n)? ", False)
   else:
diff --git a/ambari-server/src/test/python/TestSetupSso.py 
b/ambari-server/src/test/python/TestSetupSso.py
index 53455a6..9b822c6 100644
--- a/ambari-server/src/test/python/TestSetupSso.py
+++ b/ambari-server/src/test/python/TestSetupSso.py
@@ -26,6 +26,7 @@ from mock.mock import patch, MagicMock
 
 from only_for_platform import os_distro_value
 from ambari_commons import os_utils
+from urllib2 import HTTPError
 
 import shutil
 project_dir = 

[ambari] 01/01: Merge pull request #839 from mradha25/AMBARI-22904

2018-04-04 Thread mradhakrishnan
This is an automated email from the ASF dual-hosted git repository.

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

commit 48b9007106cab9e26985858904cf2a2d02f8914f
Merge: 7755bff 665775e
Author: mradha25 
AuthorDate: Wed Apr 4 09:31:03 2018 -0700

Merge pull request #839 from mradha25/AMBARI-22904

[AMBARI-22904] Fix mpack-related unit tests

 .../api/resources/MpackResourceDefinitionTest.java |  1 +
 .../internal/MpackResourceProviderTest.java| 86 ++
 .../org/apache/ambari/server/state/MpackTest.java  | 78 ++--
 3 files changed, 78 insertions(+), 87 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
mradhakrish...@apache.org.


[ambari] branch branch-feature-AMBARI-14714 updated (7755bff -> 48b9007)

2018-04-04 Thread mradhakrishnan
This is an automated email from the ASF dual-hosted git repository.

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


from 7755bff  [AMBARI-23441] API Addition for Upgrade Plan for Config 
Changes
 add 665775e  [AMBARI-22904] Fix mpack-related unit tests
 new 48b9007  Merge pull request #839 from mradha25/AMBARI-22904

The 1 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:
 .../api/resources/MpackResourceDefinitionTest.java |  1 +
 .../internal/MpackResourceProviderTest.java| 86 ++
 .../org/apache/ambari/server/state/MpackTest.java  | 78 ++--
 3 files changed, 78 insertions(+), 87 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
mradhakrish...@apache.org.


[ambari] branch trunk updated: AMBARI-23450. NN Federation Wizard: infinite spinner on step3 with no Ranger installed (akovalenko)

2018-04-04 Thread akovalenko
This is an automated email from the ASF dual-hosted git repository.

akovalenko 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 541953e  AMBARI-23450. NN Federation Wizard: infinite spinner on step3 
with no Ranger installed (akovalenko)
541953e is described below

commit 541953e11830f61ab59b253d3738b017bb505e6f
Author: Aleksandr Kovalenko 
AuthorDate: Wed Apr 4 14:37:28 2018 +0300

AMBARI-23450. NN Federation Wizard: infinite spinner on step3 with no 
Ranger installed (akovalenko)
---
 .../main/admin/federation/step3_controller.js   | 21 -
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git 
a/ambari-web/app/controllers/main/admin/federation/step3_controller.js 
b/ambari-web/app/controllers/main/admin/federation/step3_controller.js
index f24785f..7458820 100644
--- a/ambari-web/app/controllers/main/admin/federation/step3_controller.js
+++ b/ambari-web/app/controllers/main/admin/federation/step3_controller.js
@@ -99,15 +99,6 @@ App.NameNodeFederationWizardStep3Controller = 
Em.Controller.extend(App.Blueprint
 ret.clustername = App.get('clusterName');
 
 var hdfsSiteConfigs = configsFromServer.findProperty('type', 
'hdfs-site').properties;
-var hdfsRangerConfigs = configsFromServer.findProperty('type', 
'ranger-hdfs-security').properties;
-
-if (hdfsRangerConfigs['ranger.plugin.hdfs.service.name'] === 
'{{repo_name}}') {
-  ret.ranger_service_name_ns1 = ret.clustername + '_hadoop_' + 
ret.nameservice1;
-  ret.ranger_service_name_ns2 = ret.clustername + '_hadoop_' + 
ret.nameservice2;
-} else {
-  ret.ranger_service_name_ns1 = 
hdfsRangerConfigs['ranger.plugin.hdfs.service.name'] + '_' + ret.nameservice1;
-  ret.ranger_service_name_ns2 = 
hdfsRangerConfigs['ranger.plugin.hdfs.service.name'] + '_' + ret.nameservice2;
-}
 
 var dfsHttpA = hdfsSiteConfigs['dfs.namenode.http-address'];
 ret.nnHttpPort = dfsHttpA ? dfsHttpA.split(':')[1] : 50070;
@@ -118,6 +109,18 @@ App.NameNodeFederationWizardStep3Controller = 
Em.Controller.extend(App.Blueprint
 var dfsRpcA = hdfsSiteConfigs['dfs.namenode.rpc-address'];
 ret.nnRpcPort = dfsRpcA ? dfsRpcA.split(':')[1] : 8020;
 
+if (App.Service.find().someProperty('serviceName', 'RANGER')) {
+  var hdfsRangerConfigs = configsFromServer.findProperty('type', 
'ranger-hdfs-security').properties;
+
+  if (hdfsRangerConfigs['ranger.plugin.hdfs.service.name'] === 
'{{repo_name}}') {
+ret.ranger_service_name_ns1 = ret.clustername + '_hadoop_' + 
ret.nameservice1;
+ret.ranger_service_name_ns2 = ret.clustername + '_hadoop_' + 
ret.nameservice2;
+  } else {
+ret.ranger_service_name_ns1 = 
hdfsRangerConfigs['ranger.plugin.hdfs.service.name'] + '_' + ret.nameservice1;
+ret.ranger_service_name_ns2 = 
hdfsRangerConfigs['ranger.plugin.hdfs.service.name'] + '_' + ret.nameservice2;
+  }
+}
+
 return ret;
   },
 

-- 
To stop receiving notification emails like this one, please contact
akovale...@apache.org.


[ambari] branch trunk updated: [AMBARI-23449] Agent can not to connect to server during blueprint deploy (dsen)

2018-04-04 Thread dsen
This is an automated email from the ASF dual-hosted git repository.

dsen 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 ed95d9a  [AMBARI-23449] Agent can not to connect to server during 
blueprint deploy (dsen)
ed95d9a is described below

commit ed95d9a4d4698bddc579dbee035527d58edf68de
Author: Dmytro Sen 
AuthorDate: Wed Apr 4 14:41:23 2018 +0300

[AMBARI-23449] Agent can not to connect to server during blueprint deploy 
(dsen)
---
 .../src/main/python/ambari_agent/AmbariConfig.py |  4 ++--
 .../src/main/python/ambari_commons/inet_utils.py | 20 ++--
 .../src/main/python/ambari_stomp/transport.py|  4 ++--
 .../resource_management/libraries/script/script.py   |  6 +++---
 4 files changed, 9 insertions(+), 25 deletions(-)

diff --git a/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py 
b/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py
index f5b17f0..d982125 100644
--- a/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py
+++ b/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py
@@ -319,9 +319,9 @@ class AmbariConfig:
 """
 Get forced https protocol name.
 
-:return: protocol name, PROTOCOL_TLSv1 by default
+:return: protocol name, PROTOCOL_TLSv1_2 by default
 """
-return self.get('security', 'force_https_protocol', 
default="PROTOCOL_TLSv1")
+return self.get('security', 'force_https_protocol', 
default="PROTOCOL_TLSv1_2")
 
   def get_force_https_protocol_value(self):
 """
diff --git a/ambari-common/src/main/python/ambari_commons/inet_utils.py 
b/ambari-common/src/main/python/ambari_commons/inet_utils.py
index a226235..0e160c5 100644
--- a/ambari-common/src/main/python/ambari_commons/inet_utils.py
+++ b/ambari-common/src/main/python/ambari_commons/inet_utils.py
@@ -228,10 +228,9 @@ def resolve_address(address):
   return '127.0.0.1'
   return address
 
-def ensure_ssl_using_protocol(protocol="PROTOCOL_TLSv1", ca_certs=None):
+def ensure_ssl_using_protocol(protocol="PROTOCOL_TLSv1_2", ca_certs=None):
   """
-  Monkey patching ssl module to force it use tls_v1. Do this in common module 
to avoid problems with
-  PythonReflectiveExecutor.
+  Patching ssl module to use configured protocol and ca certs
 
   :param protocol: one of ("PROTOCOL_SSLv2", "PROTOCOL_SSLv3", 
"PROTOCOL_SSLv23", "PROTOCOL_TLSv1", "PROTOCOL_TLSv1_1", "PROTOCOL_TLSv1_2")
   :param ca_certs: path to ca_certs file
@@ -240,21 +239,6 @@ def ensure_ssl_using_protocol(protocol="PROTOCOL_TLSv1", 
ca_certs=None):
   from functools import wraps
   import ssl
 
-  if not hasattr(ssl.wrap_socket, "_ambari_patched"):
-def sslwrap(func):
-  @wraps(func)
-  def bar(*args, **kw):
-import ssl
-kw['ssl_version'] = getattr(ssl, protocol)
-if ca_certs and not 'ca_certs' in kw:
-  kw['ca_certs'] = ca_certs
-  kw['cert_reqs'] = ssl.CERT_REQUIRED
-return func(*args, **kw)
-  bar._ambari_patched = True
-  return bar
-ssl.wrap_socket = sslwrap(ssl.wrap_socket)
-
-  # python 2.7 stuff goes here
   if hasattr(ssl, "_create_default_https_context"):
 if not hasattr(ssl._create_default_https_context, "_ambari_patched"):
   @wraps(ssl._create_default_https_context)
diff --git a/ambari-common/src/main/python/ambari_stomp/transport.py 
b/ambari-common/src/main/python/ambari_stomp/transport.py
index 1fd18f0..0896ef2 100644
--- a/ambari-common/src/main/python/ambari_stomp/transport.py
+++ b/ambari-common/src/main/python/ambari_stomp/transport.py
@@ -17,7 +17,7 @@ try:
 import ssl
 from ssl import SSLError
 
-DEFAULT_SSL_VERSION = ssl.PROTOCOL_TLSv1
+DEFAULT_SSL_VERSION = ssl.PROTOCOL_TLSv1_2
 except (ImportError, AttributeError):  # python version < 2.6 without the 
backported ssl module
 ssl = None
 
@@ -814,7 +814,7 @@ class Transport(BaseTransport):
where OK is a boolean, and cert is a 
certificate structure
as returned by ssl.SSLSocket.getpeercert()
 :param ssl_version: SSL protocol to use for the connection. This 
should be one of the PROTOCOL_x
-constants provided by the ssl module. The default 
is ssl.PROTOCOL_TLSv1
+constants provided by the ssl module. The default 
is ssl.PROTOCOL_TLSv1_2
 """
 if not ssl:
 raise Exception("SSL connection requested, but SSL library not 
found")
diff --git 
a/ambari-common/src/main/python/resource_management/libraries/script/script.py 
b/ambari-common/src/main/python/resource_management/libraries/script/script.py
index 76b650a..626aa19 100644
--- 
a/ambari-common/src/main/python/resource_management/libraries/script/script.py
+++ 
b/ambari-common/src/main/python/resource_management/libraries/script/script.py
@@ -80,7 +80,7 @@ USAGE = 

[ambari] branch trunk updated: [AMBARI-23240] Add "tag" property/column to widget (#664)

2018-04-04 Thread swagle
This is an automated email from the ASF dual-hosted git repository.

swagle 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 d000a59  [AMBARI-23240] Add "tag" property/column to widget (#664)
d000a59 is described below

commit d000a5933dd88d9ee719029281ce6eb0b19e0623
Author: majorendre <34535487+majoren...@users.noreply.github.com>
AuthorDate: Wed Apr 4 16:54:29 2018 +0200

[AMBARI-23240] Add "tag" property/column to widget (#664)

* AMBARI-23240 added "tag" property/column to widget

* AMBARI-23240 added widget tag handling to WidgetResponse
---
 .../apache/ambari/server/controller/WidgetResponse.java | 10 ++
 .../controller/internal/WidgetResourceProvider.java | 11 +++
 .../apache/ambari/server/orm/entities/WidgetEntity.java | 17 +
 .../apache/ambari/server/upgrade/UpgradeCatalog270.java |  8 
 .../src/main/resources/Ambari-DDL-Derby-CREATE.sql  |  1 +
 .../src/main/resources/Ambari-DDL-MySQL-CREATE.sql  |  1 +
 .../src/main/resources/Ambari-DDL-Oracle-CREATE.sql |  1 +
 .../src/main/resources/Ambari-DDL-Postgres-CREATE.sql   |  1 +
 .../main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql|  1 +
 .../src/main/resources/Ambari-DDL-SQLServer-CREATE.sql  |  1 +
 .../ambari/server/upgrade/UpgradeCatalog270Test.java|  6 ++
 11 files changed, 58 insertions(+)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/WidgetResponse.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/WidgetResponse.java
index c5b4a0e..32dee17 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/WidgetResponse.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/WidgetResponse.java
@@ -40,6 +40,7 @@ public class WidgetResponse {
   private String widgetValues;
   private String properties;
   private String clusterName;
+  private String tag;
 
   @JsonProperty("id")
   public Long getId() {
@@ -144,6 +145,14 @@ public class WidgetResponse {
 this.clusterName = clusterName;
   }
 
+  public String getTag() {
+return tag;
+  }
+
+  public void setTag(String tag) {
+this.tag = tag;
+  }
+
   @Override
   public String toString() {
 return widgetName;
@@ -175,6 +184,7 @@ public class WidgetResponse {
 response.setProperties(entity.getProperties());
 String clusterName = (entity.getClusterEntity() != null) ? 
entity.getClusterEntity().getClusterName() : null;
 response.setClusterName(clusterName);
+response.setTag(entity.getTag());
 
 return response;
   }
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetResourceProvider.java
index 89a5aa4..5f5d028 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetResourceProvider.java
@@ -74,6 +74,7 @@ public class WidgetResourceProvider extends 
AbstractControllerResourceProvider {
   public static final String WIDGET_METRICS_PROPERTY_ID = 
PropertyHelper.getPropertyId("WidgetInfo", "metrics");
   public static final String WIDGET_VALUES_PROPERTY_ID = 
PropertyHelper.getPropertyId("WidgetInfo", "values");
   public static final String WIDGET_PROPERTIES_PROPERTY_ID = 
PropertyHelper.getPropertyId("WidgetInfo", "properties");
+  public static final String WIDGET_TAG_PROPERTY_ID = 
PropertyHelper.getPropertyId("WidgetInfo", "tag");
   public enum SCOPE {
 CLUSTER,
 USER
@@ -100,6 +101,7 @@ public class WidgetResourceProvider extends 
AbstractControllerResourceProvider {
   add(WIDGET_METRICS_PROPERTY_ID);
   add(WIDGET_VALUES_PROPERTY_ID);
   add(WIDGET_PROPERTIES_PROPERTY_ID);
+  add(WIDGET_TAG_PROPERTY_ID);
 }
   };
 
@@ -189,6 +191,10 @@ public class WidgetResourceProvider extends 
AbstractControllerResourceProvider {
   null : gson.toJson(widgetPropertiesMap);
   entity.setProperties(widgetProperties);
 
+  if (properties.containsKey(WIDGET_TAG_PROPERTY_ID)){
+entity.setTag(properties.get(WIDGET_TAG_PROPERTY_ID).toString());
+  }
+
   widgetDAO.create(entity);
   notifyCreate(Type.Widget, request);
   return entity;
@@ -246,6 +252,7 @@ public class WidgetResourceProvider extends 
AbstractControllerResourceProvider {
   resource.setProperty(WIDGET_SCOPE_PROPERTY_ID, entity.getScope());
   setResourceProperty(resource, WIDGET_VALUES_PROPERTY_ID, 
entity.getWidgetValues(), requestedIds);
   setResourceProperty(resource, WIDGET_PROPERTIES_PROPERTY_ID, 
entity.getProperties(), requestedIds);
+  

[ambari] branch branch-feature-AMBARI-14714 updated: [AMBARI-23441] API Addition for Upgrade Plan for Config Changes

2018-04-04 Thread ncole
This is an automated email from the ASF dual-hosted git repository.

ncole 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 7755bff  [AMBARI-23441] API Addition for Upgrade Plan for Config 
Changes
7755bff is described below

commit 7755bff45cbc1c00852569720e8bd10064a4f0d3
Author: Nate Cole 
AuthorDate: Tue Apr 3 15:04:58 2018 -0400

[AMBARI-23441] API Addition for Upgrade Plan for Config Changes
---
 .../ambari/server/agent/HeartBeatHandler.java  |   2 +-
 .../internal/UpgradePlanResourceProvider.java  |  99 ++--
 .../orm/entities/UpgradePlanConfigEntity.java  | 131 +
 .../orm/entities/UpgradePlanDetailEntity.java  |  29 -
 .../src/main/resources/Ambari-DDL-Derby-CREATE.sql |  13 ++
 .../src/main/resources/Ambari-DDL-MySQL-CREATE.sql |  11 ++
 .../main/resources/Ambari-DDL-Oracle-CREATE.sql|  21 +++-
 .../main/resources/Ambari-DDL-Postgres-CREATE.sql  |  13 ++
 .../resources/Ambari-DDL-SQLAnywhere-CREATE.sql|  12 ++
 .../main/resources/Ambari-DDL-SQLServer-CREATE.sql |  12 ++
 .../src/main/resources/META-INF/persistence.xml|   1 +
 .../internal/UpgradePlanResourceProviderTest.java  |  25 +++-
 12 files changed, 348 insertions(+), 21 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java
index f6dea9b..94cea4b 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java
@@ -246,7 +246,7 @@ public class HeartBeatHandler {
 response.setRecoveryConfig(rc);
 
 if (response.getRecoveryConfig() != null) {
-  LOG.info("Recovery configuration set to {}", 
response.getRecoveryConfig());
+  LOG.debug("Recovery configuration set to {}", 
response.getRecoveryConfig());
 }
   }
 }
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradePlanResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradePlanResourceProvider.java
index 13117cb..eaad55f 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradePlanResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradePlanResourceProvider.java
@@ -26,6 +26,7 @@ import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.stream.Collectors;
 
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.StaticallyInject;
@@ -40,7 +41,12 @@ 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.apache.ambari.server.orm.dao.MpackDAO;
+import org.apache.ambari.server.orm.dao.ServiceGroupDAO;
 import org.apache.ambari.server.orm.dao.UpgradePlanDAO;
+import org.apache.ambari.server.orm.entities.MpackEntity;
+import org.apache.ambari.server.orm.entities.ServiceGroupEntity;
+import org.apache.ambari.server.orm.entities.UpgradePlanConfigEntity;
 import org.apache.ambari.server.orm.entities.UpgradePlanDetailEntity;
 import org.apache.ambari.server.orm.entities.UpgradePlanEntity;
 import org.apache.ambari.server.security.authorization.RoleAuthorization;
@@ -50,6 +56,7 @@ import 
org.apache.ambari.server.state.stack.upgrade.UpgradeType;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang.BooleanUtils;
 import org.apache.commons.lang.StringUtils;
+import org.codehaus.jackson.annotate.JsonProperty;
 
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
@@ -107,6 +114,12 @@ public class UpgradePlanResourceProvider extends 
AbstractControllerResourceProvi
   @Inject
   private static UpgradePlanDAO s_upgradePlanDAO;
 
+  @Inject
+  private static ServiceGroupDAO s_serviceGroupDAO;
+
+  @Inject
+  private static MpackDAO s_mpackDAO;
+
   /**
* Constructor.
*
@@ -145,10 +158,12 @@ public class UpgradePlanResourceProvider extends 
AbstractControllerResourceProvi
 
 s_upgradePlanDAO.create(entity);
 
+// cannot be null since toEntity() checks for it
+String clusterName = propertyMap.get(UPGRADE_PLAN_CLUSTER_NAME).toString();
+
 notifyCreate(Resource.Type.UpgradePlan, request);
 
-Resource res = new ResourceImpl(Resource.Type.UpgradePlan);
-res.setProperty(UPGRADE_PLAN_ID, entity.getId());
+Resource res = toResource(entity, PROPERTY_IDS, 

[ambari] branch trunk updated: AMBARI-23379 UI loading stuck after deleting service

2018-04-04 Thread atkach
This is an automated email from the ASF dual-hosted git repository.

atkach 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 9e6add9  AMBARI-23379 UI loading stuck after deleting service
9e6add9 is described below

commit 9e6add980ad0c09acf76f08b607c178f90776695
Author: Andrii Tkach 
AuthorDate: Tue Mar 27 18:57:03 2018 +0300

AMBARI-23379 UI loading stuck after deleting service
---
 ambari-web/app/models/service.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ambari-web/app/models/service.js b/ambari-web/app/models/service.js
index fa7d30c..df00049 100644
--- a/ambari-web/app/models/service.js
+++ b/ambari-web/app/models/service.js
@@ -21,7 +21,7 @@ var App = require('app');
 require('utils/config');
 
 App.Service = DS.Model.extend({
-  serviceName: DS.attr('string'),
+  serviceName: DS.attr('string', {defaultValue: ''}),
   displayName: Em.computed.formatRole('serviceName', true),
   passiveState: DS.attr('string', {defaultValue: "OFF"}),
   workStatus: DS.attr('string'),

-- 
To stop receiving notification emails like this one, please contact
atk...@apache.org.


[ambari] branch trunk updated: AMBARI-23357 Update combo filter style

2018-04-04 Thread atkach
This is an automated email from the ASF dual-hosted git repository.

atkach 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 a6900dc  AMBARI-23357 Update combo filter style
a6900dc is described below

commit a6900dca0187f2ffef731162c5efc7183d723471
Author: Andrii Tkach 
AuthorDate: Mon Mar 26 12:22:58 2018 +0300

AMBARI-23357 Update combo filter style
---
 .../resources/ui/admin-web/app/styles/main.css |  2 +-
 ambari-web/app/styles/application.less | 55 --
 ambari-web/app/styles/visualsearch.less| 53 -
 ambari-web/app/templates/main/alerts.hbs   |  2 +-
 .../templates/main/dashboard/config_history.hbs|  2 +-
 ambari-web/app/templates/main/host.hbs |  2 +-
 6 files changed, 56 insertions(+), 60 deletions(-)

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 3b7de26..08f8960 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
@@ -1383,7 +1383,7 @@ th.entity-actions {
   transform: rotate(45deg);
   top: 10px;
   left: 2px;
-  box-shadow: -2px -2px 10px -3px rgba(0, 0, 0, 0.5);
+  border: 1px solid #ccc;
 }
 
 a.disabled i:before,
diff --git a/ambari-web/app/styles/application.less 
b/ambari-web/app/styles/application.less
index 335f0a3..04348d2 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -2438,61 +2438,6 @@ input[type="radio"].align-checkbox, 
input[type="checkbox"].align-checkbox {
   }
 }
 
-#combo_search_box {
-  .VS-search {
-.VS-search-box {
-  border: 1px solid #ccc;
-  border-radius: 4px;
-  box-shadow: 0 0 1px #fff inset;
-  min-height: 34px;
-}
-.VS-icon-search, .VS-icon-cancel {
-top: 10px;
-}
-.VS-placeholder {
-  color: #ccc;
-  top: 9px;
-}
-.search_input input {
-  height: 32px;
-  margin-top: 0px;
-}
-.search_facet {
-  border-radius: 4px;
-  margin: 5px -3px 3px 0;
-  height: 22px;
-  .category {
-margin-left: 3px;
-padding: 4px 0 0;
-  }
-  input {
-font: inherit;
-font-family: 'Roboto', sans-serif;
-height: 20px;
-  }
-  .search_facet_remove {
-left: 3px;
-top: 4px;
-  }
-  &.not_selected {
-border: 1px solid #d2d2d2;
-background-image: -moz-linear-gradient(top, #fdfdfd, #e3e3e3); /* 
FF3.6 */
-background-image: -webkit-gradient(linear, left top, left bottom, 
from(#fdfdfd), to(#e3e3e3)); /* Saf4+, Chrome */
-background-image: linear-gradient(top, #fdfdfd, #e3e3e3);
-  }
-  &.is_selected {
-margin-left: 0;
-  }
-}
-  }
-}
-
-.VS-interface.ui-autocomplete.ui-menu{
-  li.ui-menu-item, li.ui-autocomplete-category {
-font-family: 'Roboto', sans-serif;
-  }
-}
-
 .delete-service-progress {
   .modal-body {
 text-align: center;
diff --git a/ambari-web/app/styles/visualsearch.less 
b/ambari-web/app/styles/visualsearch.less
index 16c3377..7e9d478 100644
--- a/ambari-web/app/styles/visualsearch.less
+++ b/ambari-web/app/styles/visualsearch.less
@@ -19,6 +19,7 @@
 @import 'common.less';
 
 @background-color: #ddd;
+@border-color: #ccc;
 
 #combo_search_box {
   .VS-icon-search {
@@ -32,6 +33,50 @@
 background: none;
   }
   .VS-search {
+.VS-search-box {
+  border: 1px solid @border-color;
+  border-radius: 4px;
+  box-shadow: 0 0 1px #fff inset;
+  min-height: 34px;
+}
+.VS-icon-search, .VS-icon-cancel {
+  top: 10px;
+}
+.VS-placeholder {
+  color: @border-color;
+  top: 9px;
+}
+.search_input input {
+  height: 32px;
+  margin-top: 0px;
+}
+.search_facet {
+  border-radius: 4px;
+  margin: 5px -3px 3px 0;
+  height: 22px;
+  .category {
+margin-left: 3px;
+padding: 4px 0 0;
+  }
+  input {
+font: inherit;
+font-family: 'Roboto', sans-serif;
+height: 20px;
+  }
+  .search_facet_remove {
+left: 3px;
+top: 4px;
+  }
+  &.not_selected {
+border: 1px solid #d2d2d2;
+background-image: -moz-linear-gradient(top, #fdfdfd, #e3e3e3); /* 
FF3.6 */
+background-image: -webkit-gradient(linear, left top, left bottom, 
from(#fdfdfd), to(#e3e3e3)); /* Saf4+, Chrome */
+background-image: linear-gradient(top, #fdfdfd, #e3e3e3);
+  }
+  &.is_selected {
+margin-left: 0;
+  }
+}
 .search_facet.not_selected {
   height: 24px;
   padding: 1px 0 0 14px;
@@ -52,6 +97,12 @@
   }
 }
 
+.VS-interface.ui-autocomplete.ui-menu{
+  li.ui-menu-item, li.ui-autocomplete-category {

[ambari] branch trunk updated: AMBARI-23283 Install Wizard > Select Version page: the user cannot proceed with Redhat Satellite option

2018-04-04 Thread atkach
This is an automated email from the ASF dual-hosted git repository.

atkach 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 5d29248  AMBARI-23283 Install Wizard > Select Version page: the user 
cannot proceed with Redhat Satellite option
5d29248 is described below

commit 5d29248131c3482efa4d09a9327a9ef02b68fc9c
Author: Andrii Tkach 
AuthorDate: Tue Mar 20 13:46:21 2018 +0200

AMBARI-23283 Install Wizard > Select Version page: the user cannot proceed 
with Redhat Satellite option
---
 ambari-web/app/views/wizard/step1_view.js   | 15 ++---
 ambari-web/test/views/wizard/step1_view_test.js | 28 -
 2 files changed, 15 insertions(+), 28 deletions(-)

diff --git a/ambari-web/app/views/wizard/step1_view.js 
b/ambari-web/app/views/wizard/step1_view.js
index 71ee8d5..4e37ba2 100644
--- a/ambari-web/app/views/wizard/step1_view.js
+++ b/ambari-web/app/views/wizard/step1_view.js
@@ -84,14 +84,14 @@ App.WizardStep1View = Em.View.extend({
*
* @type {bool}
*/
-  isSubmitDisabled: Em.computed.or('invalidFormatUrlExist', 'isNoOsChecked', 
'isAnyOsEmpty', 'controller.content.isCheckInProgress', 
'App.router.btnClickInProgress', '!controller.isLoadingComplete'),
+  isSubmitDisabled: Em.computed.or('invalidFormatUrlExist', 'isNoOsChecked', 
'isNoOsFilled', 'controller.content.isCheckInProgress', 
'App.router.btnClickInProgress', '!controller.isLoadingComplete'),
 
   /**
* Show warning message flag
*
* @type {bool}
*/
-  warningExist: Em.computed.or('invalidFormatUrlExist', 'isNoOsChecked', 
'isAnyOsEmpty'),
+  warningExist: Em.computed.or('invalidFormatUrlExist', 'isNoOsChecked', 
'isNoOsFilled'),
 
   skipVerifyBaseUrl: 
Em.computed.or('controller.selectedStack.skipValidationChecked', 
'controller.selectedStack.useRedhatSatellite'),
 
@@ -211,19 +211,16 @@ App.WizardStep1View = Em.View.extend({
   },
 
   /**
-   * If any OS is empty
+   * If all OSes are empty
* @type {bool}
*/
-  isAnyOsEmpty: function () {
+  isNoOsFilled: function () {
 var operatingSystems = 
this.get('controller.selectedStack.operatingSystems');
-if (Em.isNone(operatingSystems)) {
+if (this.get('controller.selectedStack.useRedhatSatellite') || 
Em.isNone(operatingSystems)) {
   return false;
 }
 var selectedOS = operatingSystems.filterProperty('isSelected', true);
-if (this.get('controller.selectedStack.useRedhatSatellite')) {
-  selectedOS = selectedOS.filter(this.isRedhat);
-}
-return selectedOS.someProperty('isNotFilled', true);
+return selectedOS.everyProperty('isNotFilled', true);
   }.property('controller.selectedStack.operatingSystems.@each.isSelected', 
'controller.selectedStack.operatingSystems.@each.isNotFilled', 
'controller.selectedStack.useRedhatSatellite'),
 
   popoverView: Em.View.extend({
diff --git a/ambari-web/test/views/wizard/step1_view_test.js 
b/ambari-web/test/views/wizard/step1_view_test.js
index 1f48a3f..ca783c8 100644
--- a/ambari-web/test/views/wizard/step1_view_test.js
+++ b/ambari-web/test/views/wizard/step1_view_test.js
@@ -35,7 +35,7 @@ describe('App.WizardStep1View', function () {
 
   App.TestAliases.testAsComputedEveryBy(getView(), 'isNoOsChecked', 
'controller.selectedStack.operatingSystems', 'isSelected', false);
 
-  App.TestAliases.testAsComputedOr(getView(), 'isSubmitDisabled', 
['invalidFormatUrlExist', 'isNoOsChecked', 'isAnyOsEmpty', 
'controller.content.isCheckInProgress', 'App.router.btnClickInProgress', 
'!controller.isLoadingComplete']);
+  App.TestAliases.testAsComputedOr(getView(), 'isSubmitDisabled', 
['invalidFormatUrlExist', 'isNoOsChecked', 'isNoOsFilled', 
'controller.content.isCheckInProgress', 'App.router.btnClickInProgress', 
'!controller.isLoadingComplete']);
 
   App.TestAliases.testAsComputedSomeBy(getView(), 'invalidUrlExist', 
'allRepositories', 'validation', 'INVALID');
 
@@ -66,27 +66,21 @@ describe('App.WizardStep1View', function () {
 });
   });
 
-  describe('#isAnyOsEmpty', function() {
+  describe('#isNoOsFilled', function() {
 
-it('should be true when useRedhatSatellite is true and redhat os is 
empty', function() {
+it('should be false when useRedhatSatellite is true', function() {
   view.set('controller.selectedStack', Em.Object.create({
-useRedhatSatellite: true,
-operatingSystems: [
-  Em.Object.create({
-isSelected: true,
-isNotFilled: true,
-osType: 'redhat'
-  })
-]
+useRedhatSatellite: true
   }));
-  expect(view.get('isAnyOsEmpty')).to.be.true;
+  expect(view.get('isNoOsFilled')).to.be.false;
 });
 
 it('should be false when operatingSystems is null', function() {
   view.set('controller.selectedStack', Em.Object.create({
+useRedhatSatellite: false,
 operatingSystems: null
  

[ambari] branch trunk updated: Update docker-compose files for Log Search dev env

2018-04-04 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 7292790  Update docker-compose files for Log Search dev env
7292790 is described below

commit 729279088dcf138f3b3141517ce56b949b0497d9
Author: Oliver Szabo 
AuthorDate: Wed Apr 4 13:50:16 2018 +0200

Update docker-compose files for Log Search dev env
---
 ambari-logsearch/docker/docker-compose.yml | 2 +-
 ambari-logsearch/docker/sso.yml| 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ambari-logsearch/docker/docker-compose.yml 
b/ambari-logsearch/docker/docker-compose.yml
index 7ec24b2..de56bef 100644
--- a/ambari-logsearch/docker/docker-compose.yml
+++ b/ambari-logsearch/docker/docker-compose.yml
@@ -59,7 +59,7 @@ services:
   COMPONENT: logsearch
   COMPONENT_LOG: logsearch
   ZK_CONNECT_STRING: ${ZOOKEEPER_CONNECTION_STRING}
-  DISPLAY: $DOCKERIP:0
+  DISPLAY: $DISPLAY_MAC
 volumes:
   - $AMBARI_LOCATION:/root/ambari
   - $AMBARI_LOCATION/ambari-logsearch/docker/test-logs:/root/test-logs
diff --git a/ambari-logsearch/docker/sso.yml b/ambari-logsearch/docker/sso.yml
index e4c43bd..1eaa5a7 100644
--- a/ambari-logsearch/docker/sso.yml
+++ b/ambari-logsearch/docker/sso.yml
@@ -59,7 +59,7 @@ services:
   COMPONENT: logsearch
   COMPONENT_LOG: logsearch
   ZK_CONNECT_STRING: ${ZOOKEEPER_CONNECTION_STRING}
-  DISPLAY: $DOCKERIP:0
+  DISPLAY: $DISPLAY_MAC
   KNOX: "true"
 volumes:
   - $AMBARI_LOCATION:/root/ambari

-- 
To stop receiving notification emails like this one, please contact
oleew...@apache.org.


[ambari] branch trunk updated: AMBARI-23279. Integrate HostComponentService with Swagger (#785)

2018-04-04 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai 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 5df06c1  AMBARI-23279. Integrate HostComponentService with Swagger 
(#785)
5df06c1 is described below

commit 5df06c19d6bcb5ceb398d5aa9f040567c466790d
Author: Gabor Boros <6317425+g-bo...@users.noreply.github.com>
AuthorDate: Wed Apr 4 13:31:50 2018 +0200

AMBARI-23279. Integrate HostComponentService with Swagger (#785)
---
 .../server/api/services/HostComponentService.java  | 165 --
 .../eventcreator/ComponentEventCreator.java|  18 +-
 .../request/eventcreator/HostEventCreator.java |   2 +-
 .../controller/HostComponentProcessResponse.java   |   7 +
 .../server/controller/HostComponentSwagger.java|  88 
 .../controller/ServiceComponentHostResponse.java   |  23 +-
 .../internal/ComponentResourceProvider.java| 154 +++--
 .../HostComponentProcessResourceProvider.java  |  57 ++---
 .../internal/HostComponentResourceProvider.java| 240 +++--
 .../internal/RequestResourceProvider.java  |  26 +--
 .../request/creator/ComponentEventCreatorTest.java |  34 +--
 .../request/creator/HostEventCreatorTest.java  |   2 +-
 .../internal/ComponentResourceProviderTest.java|  96 -
 .../HostComponentProcessResourceProviderTest.java  |  26 +--
 .../HostComponentResourceProviderTest.java | 120 +--
 .../internal/RequestResourceProviderTest.java  |   6 +-
 .../ambari/annotations/SwaggerPreferredParent.java |  40 
 .../apache/ambari/swagger/AmbariSwaggerReader.java |  66 --
 .../ambari/swagger/AmbariSwaggerReaderTest.java| 116 +-
 19 files changed, 875 insertions(+), 411 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/HostComponentService.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/HostComponentService.java
index a5e9aec..2f2051a 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/HostComponentService.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/HostComponentService.java
@@ -35,20 +35,38 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
 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.annotations.ApiIgnore;
+import org.apache.ambari.annotations.SwaggerPreferredParent;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.configuration.Configuration;
+import org.apache.ambari.server.controller.HostComponentProcessResponse;
+import org.apache.ambari.server.controller.HostComponentSwagger;
 import org.apache.ambari.server.controller.spi.Resource;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.Validate;
 
+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;
+
 /**
  * Service responsible for host_components resource requests.
  */
+@Api(value = "Host Components", description = "Endpoint for host component 
specific operations")
+@SwaggerPreferredParent(preferredParent = ClusterService.class)
 public class HostComponentService extends BaseService {
+
+  public static final String HOST_ROLE_REQUEST_TYPE = 
"org.apache.ambari.server.controller.ServiceComponentHostResponse";
+
   /**
* Parent cluster id.
*/
@@ -79,9 +97,21 @@ public class HostComponentService extends BaseService {
* @param hostComponentName host_component id
* @return host_component resource representation
*/
-  @GET @ApiIgnore // until documented
+  @GET
   @Path("{hostComponentName}")
-  @Produces("text/plain")
+  @Produces(MediaType.TEXT_PLAIN)
+  @ApiOperation(value = "Get single host component for a host", response = 
HostComponentSwagger.class)
+  @ApiImplicitParams({
+@ApiImplicitParam(name = QUERY_FIELDS, value = QUERY_FILTER_DESCRIPTION, 
dataType = DATA_TYPE_STRING, paramType = PARAM_TYPE_QUERY),
+  })
+  @ApiResponses({
+@ApiResponse(code = HttpStatus.SC_OK, message = MSG_SUCCESSFUL_OPERATION),
+@ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = 
MSG_CLUSTER_OR_HOST_NOT_FOUND),
+@ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = 
MSG_NOT_AUTHENTICATED),
+@ApiResponse(code = HttpStatus.SC_FORBIDDEN, message = 
MSG_PERMISSION_DENIED),
+@ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = 
MSG_SERVER_ERROR),
+@ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = 

[ambari] branch trunk updated: AMBARI-23361. Integrate RequestScheduleService to Swagger (#867)

2018-04-04 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai 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 31deb40  AMBARI-23361. Integrate RequestScheduleService to Swagger 
(#867)
31deb40 is described below

commit 31deb40bd71dcf39e8beb40923f7cde001cf9747
Author: Gabor Boros <6317425+g-bo...@users.noreply.github.com>
AuthorDate: Wed Apr 4 13:29:56 2018 +0200

AMBARI-23361. Integrate RequestScheduleService to Swagger (#867)

Change-Id: I6d923798452d02059ae06f6198bbf5f17dedea85
---
 .../api/services/RequestScheduleService.java   |  84 ++-
 .../controller/RequestScheduleRequestSwagger.java  | 113 +
 .../controller/RequestScheduleResponseSwagger.java | 140 +++
 .../internal/RequestScheduleResourceProvider.java  | 259 +++--
 .../RequestScheduleResourceProviderTest.java   |  90 +++
 5 files changed, 513 insertions(+), 173 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/RequestScheduleService.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/RequestScheduleService.java
index a734167..68494d4 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/RequestScheduleService.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/RequestScheduleService.java
@@ -28,18 +28,34 @@ 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.annotations.ApiIgnore;
 import org.apache.ambari.server.api.resources.ResourceInstance;
+import org.apache.ambari.server.controller.RequestScheduleResponseSwagger;
 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;
+
+
 /**
  * Service responsible for management of a batch of requests with attached
  * schedule
  */
+@Api(value = "RequestSchedules", description = "Endpoint for request schedule 
specific operations")
 public class RequestScheduleService extends BaseService {
+
+  public static final String REQUEST_SCHEDULE_REQUEST_TYPE = 
"org.apache.ambari.server.controller" +
+  ".RequestScheduleRequestSwagger";
+
   /**
* Parent cluster name.
*/
@@ -61,8 +77,23 @@ public class RequestScheduleService extends BaseService {
* @param ui
* @return
*/
-  @GET @ApiIgnore // until documented
-  @Produces("text/plain")
+  @GET
+  @Path("") // This is needed if class level path is not present otherwise no 
Swagger docs will be generated for this method
+  @Produces(MediaType.TEXT_PLAIN)
+  @ApiOperation(value = "Get all request schedules", response = 
RequestScheduleResponseSwagger.class, responseContainer =
+  RESPONSE_CONTAINER_LIST)
+  @ApiImplicitParams({
+@ApiImplicitParam(name = QUERY_FIELDS, value = QUERY_FILTER_DESCRIPTION, 
defaultValue = "RequestSchedule/*",
+dataType = DATA_TYPE_STRING, paramType = PARAM_TYPE_QUERY),
+  })
+  @ApiResponses({
+@ApiResponse(code = HttpStatus.SC_OK, message = MSG_SUCCESSFUL_OPERATION),
+@ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = 
MSG_CLUSTER_OR_HOST_NOT_FOUND),
+@ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = 
MSG_NOT_AUTHENTICATED),
+@ApiResponse(code = HttpStatus.SC_FORBIDDEN, message = 
MSG_PERMISSION_DENIED),
+@ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = 
MSG_SERVER_ERROR),
+@ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = 
MSG_INVALID_ARGUMENTS),
+  })
   public Response getRequestSchedules(String body,
   @Context HttpHeaders headers,
   @Context UriInfo ui) {
@@ -76,9 +107,22 @@ public class RequestScheduleService extends BaseService {
*
* @return
*/
-  @GET @ApiIgnore // until documented
+  @GET
   @Path("{requestScheduleId}")
-  @Produces("text/plain")
+  @Produces(MediaType.TEXT_PLAIN)
+  @ApiOperation(value = "Get request schedule", response = 
RequestScheduleResponseSwagger.class)
+  @ApiImplicitParams({
+@ApiImplicitParam(name = QUERY_FIELDS, value = QUERY_FILTER_DESCRIPTION, 
defaultValue = "RequestSchedule/*", dataType =
+DATA_TYPE_STRING, paramType = PARAM_TYPE_QUERY),
+  })
+  @ApiResponses({
+@ApiResponse(code = HttpStatus.SC_OK, message = MSG_SUCCESSFUL_OPERATION),
+@ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = 
MSG_CLUSTER_OR_HOST_NOT_FOUND),
+

[ambari] branch trunk updated: AMBARI-23080. Log Search: use compositeId instead of implicit routing by default for collections. (#866)

2018-04-04 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 e2832d0  AMBARI-23080. Log Search: use compositeId instead of implicit 
routing by default for collections. (#866)
e2832d0 is described below

commit e2832d0879a5007a4dac6e99cd15f5e727430769
Author: Olivér Szabó 
AuthorDate: Wed Apr 4 12:57:47 2018 +0200

AMBARI-23080. Log Search: use compositeId instead of implicit routing by 
default for collections. (#866)

* AMBARI-23080. Log Search: use compositeId instead of implicit routing by 
default for collections.

* AMBARI-23080. Use implicitRouting local variable.
---
 .../ambari/logfeeder/common/LogFeederConstants.java  |  1 +
 .../apache/ambari/logfeeder/conf/LogFeederProps.java | 18 ++
 .../apache/ambari/logfeeder/output/OutputSolr.java   | 16 +++-
 .../logsearch/conf/SolrAuditLogPropsConfig.java  | 20 
 .../logsearch/conf/SolrConnectionPropsConfig.java| 20 
 .../ambari/logsearch/conf/SolrPropsConfig.java   |  4 
 .../logsearch/handler/CreateCollectionHandler.java   |  6 +++---
 .../0.5.0/configuration/logfeeder-properties.xml | 12 
 .../0.5.0/configuration/logsearch-properties.xml | 12 
 9 files changed, 101 insertions(+), 8 deletions(-)

diff --git 
a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/common/LogFeederConstants.java
 
b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/common/LogFeederConstants.java
index b241831..80dc163 100644
--- 
a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/common/LogFeederConstants.java
+++ 
b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/common/LogFeederConstants.java
@@ -50,6 +50,7 @@ public class LogFeederConstants {
 
   public static final String LOG_FILTER_ENABLE_PROPERTY = 
"logfeeder.log.filter.enable";
   public static final String INCLUDE_DEFAULT_LEVEL_PROPERTY = 
"logfeeder.include.default.level";
+  public static final String SOLR_IMPLICIT_ROUTING_PROPERTY = 
"logfeeder.solr.implicit.routing";
 
   public static final String CONFIG_DIR_PROPERTY = "logfeeder.config.dir";
   public static final String CONFIG_FILES_PROPERTY = "logfeeder.config.files";
diff --git 
a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/conf/LogFeederProps.java
 
b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/conf/LogFeederProps.java
index cc1f64c..9a40e70 100644
--- 
a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/conf/LogFeederProps.java
+++ 
b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/conf/LogFeederProps.java
@@ -74,6 +74,16 @@ public class LogFeederProps implements LogFeederProperties {
   private boolean logLevelFilterEnabled;
 
   @LogSearchPropertyDescription(
+name = LogFeederConstants.SOLR_IMPLICIT_ROUTING_PROPERTY,
+description = "Use implicit routing for Solr Collections.",
+examples = {"true"},
+defaultValue = "false",
+sources = {LogFeederConstants.SOLR_IMPLICIT_ROUTING_PROPERTY}
+  )
+  @Value("${"+ LogFeederConstants.SOLR_IMPLICIT_ROUTING_PROPERTY + ":false}")
+  private boolean solrImplicitRouting;
+
+  @LogSearchPropertyDescription(
 name = LogFeederConstants.INCLUDE_DEFAULT_LEVEL_PROPERTY,
 description = "Comma separated list of the default log levels to be 
enabled by the filtering.",
 examples = {"FATAL,ERROR,WARN"},
@@ -209,6 +219,14 @@ public class LogFeederProps implements LogFeederProperties 
{
 this.checkpointFolder = checkpointFolder;
   }
 
+  public boolean isSolrImplicitRouting() {
+return solrImplicitRouting;
+  }
+
+  public void setSolrImplicitRouting(boolean solrImplicitRouting) {
+this.solrImplicitRouting = solrImplicitRouting;
+  }
+
   @PostConstruct
   public void init() {
 properties = new Properties();
diff --git 
a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputSolr.java
 
b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputSolr.java
index 160085c..12a804d 100644
--- 
a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputSolr.java
+++ 
b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputSolr.java
@@ -81,7 +81,7 @@ public class OutputSolr extends Output implements C
   private int maxIntervalMS;
   private int workers;
   private int maxBufferSize;
-  private boolean isComputeCurrentCollection = false;
+  private 

[ambari] branch trunk updated: AMBARI-23446. Fix connection drop on ambari-agent by locking the write code (aonishuk)

2018-04-04 Thread aonishuk
This is an automated email from the ASF dual-hosted git repository.

aonishuk 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 d948ff0  AMBARI-23446. Fix connection drop on ambari-agent by locking 
the write code (aonishuk)
d948ff0 is described below

commit d948ff082cced05695a2d8dbed2c15c5e19556de
Author: Andrew Onishuk 
AuthorDate: Wed Apr 4 12:44:01 2018 +0300

AMBARI-23446. Fix connection drop on ambari-agent by locking the write code 
(aonishuk)
---
 .../src/main/python/ambari_ws4py/websocket.py  | 50 +++---
 1 file changed, 34 insertions(+), 16 deletions(-)

diff --git a/ambari-common/src/main/python/ambari_ws4py/websocket.py 
b/ambari-common/src/main/python/ambari_ws4py/websocket.py
index dbaa2b6..936f333 100644
--- a/ambari-common/src/main/python/ambari_ws4py/websocket.py
+++ b/ambari-common/src/main/python/ambari_ws4py/websocket.py
@@ -144,6 +144,11 @@ class WebSocket(object):
 self._local_address = None
 self._peer_address = None
 
+self.lock = threading.Lock()
+
+"Used to signal that the server side should be shutting down"
+self.server_terminate_request = False
+
 @property
 def local_address(self):
 """
@@ -187,12 +192,17 @@ class WebSocket(object):
 
 .. seealso:: Defined Status Codes 
http://tools.ietf.org/html/rfc6455#section-7.4.1
 """
-if not self.server_terminated:
-self.server_terminated = True
-try:
-self._write(self.stream.close(code=code, 
reason=reason).single(mask=self.stream.always_mask))
-except Exception as ex:
-logger.error("Error when terminating the connection: %s", 
str(ex))
+
+#If we are sending a fragmented frame with a generator this will make 
that stop
+self.server_terminate_request = True
+
+with self.lock:
+  if not self.server_terminated:
+  self.server_terminated = True
+  try:
+  self._write(self.stream.close(code=code, 
reason=reason).single(mask=self.stream.always_mask))
+  except Exception as ex:
+  logger.error("Error when terminating the connection: %s", 
str(ex))
 
 def closed(self, code, reason=None):
 """
@@ -300,21 +310,29 @@ class WebSocket(object):
 
 if isinstance(payload, basestring) or isinstance(payload, bytearray):
 m = message_sender(payload).single(mask=self.stream.always_mask)
-self._write(m)
+with self.lock:
+self._write(m)
 
 elif isinstance(payload, Message):
 data = payload.single(mask=self.stream.always_mask)
-self._write(data)
+with self.lock:
+self._write(data)
 
 elif type(payload) == types.GeneratorType:
-bytes = next(payload)
-first = True
-for chunk in payload:
-self._write(message_sender(bytes).fragment(first=first, 
mask=self.stream.always_mask))
-bytes = chunk
-first = False
-
-self._write(message_sender(bytes).fragment(first=first, last=True, 
mask=self.stream.always_mask))
+with self.lock:
+bytes = next(payload)
+first = True
+for chunk in payload:
+
+#This lets close() interrupt even a long running send.
+if self.server_terminate_request:
+break
+
+self._write(message_sender(bytes).fragment(first=first, 
mask=self.stream.always_mask))
+bytes = chunk
+first = False
+
+self._write(message_sender(bytes).fragment(first=first, 
last=True, mask=self.stream.always_mask))
 
 else:
 raise ValueError("Unsupported type '%s' passed to send()" % 
type(payload))

-- 
To stop receiving notification emails like this one, please contact
aonis...@apache.org.