[ambari] branch trunk updated: AMBARI-23179 : Hive view 2.0 does not parse the TAB delimited CSV files while using 'Upload Table' (nitirajrathore) (#592)

2018-03-12 Thread nitiraj
This is an automated email from the ASF dual-hosted git repository.

nitiraj 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 577bf7d  AMBARI-23179 : Hive view 2.0 does not parse the TAB delimited 
CSV files while using 'Upload Table' (nitirajrathore) (#592)
577bf7d is described below

commit 577bf7d08257300d96d6bc05178d6af065fa3afb
Author: nitirajrathore 
AuthorDate: Tue Mar 13 10:21:06 2018 +0530

AMBARI-23179 : Hive view 2.0 does not parse the TAB delimited CSV files 
while using 'Upload Table' (nitirajrathore) (#592)

* AMBARI-22833 : change commons-collections-3.2.1.jar being used by ambari 
views to commons-collections-3.2.2.jar (nitirajrathore)

* AMBARI-23179 : Hive view 2.0 does not parse the TAB delimited CSV files 
while using 'Upload Table' (nitirajrathore)
---
 .../databases/database/tables/upload-table.js  | 65 ++
 1 file changed, 43 insertions(+), 22 deletions(-)

diff --git 
a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/upload-table.js
 
b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/upload-table.js
index 799a87a..54acc22 100644
--- 
a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/upload-table.js
+++ 
b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/upload-table.js
@@ -28,6 +28,10 @@ export default NewTable.extend(UILoggerMixin, {
   COLUMN_NAME_REGEX: "^[a-zA-Z]{1}[a-zA-Z0-9_]*$",
   TABLE_NAME_REGEX: "^[a-zA-Z]{1}[a-zA-Z0-9_]*$",
   HDFS_PATH_REGEX: "^[/]{1}.+",  // unix path allows everything but here we 
have to mention full path so starts with /
+  DEFAULT_CSV_DELIMITER: ',',
+  DEFAULT_CSV_QUOTE: '"',
+  DEFAULT_CSV_ESCAPE: '\\',
+
   i18n : Ember.inject.service("i18n"),
   jobService: Ember.inject.service(constants.services.jobs),
   notifyService: Ember.inject.service(constants.services.alertMessages),
@@ -130,18 +134,30 @@ export default NewTable.extend(UILoggerMixin, {
   reject(error);
 });
   },
+  getCSVParams : function(csvParams){
+var csvd = String.fromCharCode(csvParams.get('csvDelimiter.id'));
+if(!csvd && csvd != 0) csvd = this.get('DEFAULT_CSV_DELIMITER');
+
+var csvq = String.fromCharCode(csvParams.get('csvQuote.id'));
+if(!csvq && csvq != 0) csvq = this.get('DEFAULT_CSV_QUOTE');
+
+var csve = String.fromCharCode(csvParams.get('csvEscape.id'));
+if(!csve && csve != 0) csve = this.get('DEFAULT_CSV_ESCAPE');
+
+return Ember.Object.create({"csvDelimiter": csvd, "csvQuote" : csvq, 
"csvEscape": csve});
+  },
 
   uploadForPreview: function (sourceObject) {
 console.log("uploaderForPreview called.");
 let files = sourceObject.get("fileInfo.files");
-let csvParams = sourceObject.get("fileFormatInfo.csvParams");
-
+let fileFormatCsvParams = sourceObject.get("fileFormatInfo.csvParams");
+let csvParams = this.getCSVParams(fileFormatCsvParams);
 return this.getUploader().uploadFiles('preview', files, {
   "inputFileType": sourceObject.get("fileFormatInfo.inputFileType").id,
-  "isFirstRowHeader": csvParams.get("isFirstRowHeader"),
-  "csvDelimiter": csvParams.get("csvDelimiter").name,
-  "csvEscape": csvParams.get("csvEscape").name,
-  "csvQuote": csvParams.get("csvQuote").name
+  "isFirstRowHeader": fileFormatCsvParams.get("isFirstRowHeader"),
+  "csvDelimiter": csvParams.get("csvDelimiter"),
+  "csvEscape": csvParams.get("csvEscape"),
+  "csvQuote": csvParams.get("csvQuote")
 });
   },
 
@@ -150,15 +166,16 @@ export default NewTable.extend(UILoggerMixin, {
 // this.validateHDFSPath(hdfsPath);
 var self = sourceObject;
 var hdfsPath = sourceObject.get("fileInfo.hdfsPath");
-var csvParams = sourceObject.get("fileFormatInfo.csvParams");
+var fileFormatCsvParams = sourceObject.get("fileFormatInfo.csvParams");
+let csvParams = this.getCSVParams(fileFormatCsvParams);
 
 return this.getUploader().previewFromHDFS({
   "inputFileType": sourceObject.get("fileFormatInfo.inputFileType").id,
   "hdfsPath": hdfsPath,
-  "isFirstRowHeader": csvParams.get("isFirstRowHeader"),
-  "csvDelimiter": csvParams.get("csvDelimiter").name,
-  "csvEscape": csvParams.get("csvEscape").name,
-  "csvQuote": csvParams.get("csvQuote").name
+  "isFirstRowHeader": fileFormatCsvParams.get("isFirstRowHeader"),
+  "csvDelimiter": csvParams.get("csvDelimiter"),
+  "csvEscape": csvParams.get("csvEscape"),
+  "csvQuote": csvParams.get("csvQuote")
 });
   },
 
@@ -681,8 +698,10 @@ export default NewTable.extend(UILoggerMixin, {
   },
   uploadTableFromHdfs : function(tableData){
 console.log("uploadTableFromHdfs called.");
-this.pushUploadProgressInfos(this.formatMessage('uploadingFromHdfs'));
-var csvParams = 

[ambari] branch branch-2.6 updated: AMBARI-23179 : Hive view 2.0 does not parse the TAB delimited CSV files while using 'Upload Table' (nitirajrathore) (#591)

2018-03-12 Thread nitiraj
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/branch-2.6 by this push:
 new 200a986  AMBARI-23179 : Hive view 2.0 does not parse the TAB delimited 
CSV files while using 'Upload Table' (nitirajrathore) (#591)
200a986 is described below

commit 200a9868c859d2be72d0729517bf6693a52b0aa5
Author: nitirajrathore 
AuthorDate: Tue Mar 13 10:20:45 2018 +0530

AMBARI-23179 : Hive view 2.0 does not parse the TAB delimited CSV files 
while using 'Upload Table' (nitirajrathore) (#591)
---
 .../databases/database/tables/upload-table.js  | 65 ++
 1 file changed, 43 insertions(+), 22 deletions(-)

diff --git 
a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/upload-table.js
 
b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/upload-table.js
index 799a87a..54acc22 100644
--- 
a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/upload-table.js
+++ 
b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/upload-table.js
@@ -28,6 +28,10 @@ export default NewTable.extend(UILoggerMixin, {
   COLUMN_NAME_REGEX: "^[a-zA-Z]{1}[a-zA-Z0-9_]*$",
   TABLE_NAME_REGEX: "^[a-zA-Z]{1}[a-zA-Z0-9_]*$",
   HDFS_PATH_REGEX: "^[/]{1}.+",  // unix path allows everything but here we 
have to mention full path so starts with /
+  DEFAULT_CSV_DELIMITER: ',',
+  DEFAULT_CSV_QUOTE: '"',
+  DEFAULT_CSV_ESCAPE: '\\',
+
   i18n : Ember.inject.service("i18n"),
   jobService: Ember.inject.service(constants.services.jobs),
   notifyService: Ember.inject.service(constants.services.alertMessages),
@@ -130,18 +134,30 @@ export default NewTable.extend(UILoggerMixin, {
   reject(error);
 });
   },
+  getCSVParams : function(csvParams){
+var csvd = String.fromCharCode(csvParams.get('csvDelimiter.id'));
+if(!csvd && csvd != 0) csvd = this.get('DEFAULT_CSV_DELIMITER');
+
+var csvq = String.fromCharCode(csvParams.get('csvQuote.id'));
+if(!csvq && csvq != 0) csvq = this.get('DEFAULT_CSV_QUOTE');
+
+var csve = String.fromCharCode(csvParams.get('csvEscape.id'));
+if(!csve && csve != 0) csve = this.get('DEFAULT_CSV_ESCAPE');
+
+return Ember.Object.create({"csvDelimiter": csvd, "csvQuote" : csvq, 
"csvEscape": csve});
+  },
 
   uploadForPreview: function (sourceObject) {
 console.log("uploaderForPreview called.");
 let files = sourceObject.get("fileInfo.files");
-let csvParams = sourceObject.get("fileFormatInfo.csvParams");
-
+let fileFormatCsvParams = sourceObject.get("fileFormatInfo.csvParams");
+let csvParams = this.getCSVParams(fileFormatCsvParams);
 return this.getUploader().uploadFiles('preview', files, {
   "inputFileType": sourceObject.get("fileFormatInfo.inputFileType").id,
-  "isFirstRowHeader": csvParams.get("isFirstRowHeader"),
-  "csvDelimiter": csvParams.get("csvDelimiter").name,
-  "csvEscape": csvParams.get("csvEscape").name,
-  "csvQuote": csvParams.get("csvQuote").name
+  "isFirstRowHeader": fileFormatCsvParams.get("isFirstRowHeader"),
+  "csvDelimiter": csvParams.get("csvDelimiter"),
+  "csvEscape": csvParams.get("csvEscape"),
+  "csvQuote": csvParams.get("csvQuote")
 });
   },
 
@@ -150,15 +166,16 @@ export default NewTable.extend(UILoggerMixin, {
 // this.validateHDFSPath(hdfsPath);
 var self = sourceObject;
 var hdfsPath = sourceObject.get("fileInfo.hdfsPath");
-var csvParams = sourceObject.get("fileFormatInfo.csvParams");
+var fileFormatCsvParams = sourceObject.get("fileFormatInfo.csvParams");
+let csvParams = this.getCSVParams(fileFormatCsvParams);
 
 return this.getUploader().previewFromHDFS({
   "inputFileType": sourceObject.get("fileFormatInfo.inputFileType").id,
   "hdfsPath": hdfsPath,
-  "isFirstRowHeader": csvParams.get("isFirstRowHeader"),
-  "csvDelimiter": csvParams.get("csvDelimiter").name,
-  "csvEscape": csvParams.get("csvEscape").name,
-  "csvQuote": csvParams.get("csvQuote").name
+  "isFirstRowHeader": fileFormatCsvParams.get("isFirstRowHeader"),
+  "csvDelimiter": csvParams.get("csvDelimiter"),
+  "csvEscape": csvParams.get("csvEscape"),
+  "csvQuote": csvParams.get("csvQuote")
 });
   },
 
@@ -681,8 +698,10 @@ export default NewTable.extend(UILoggerMixin, {
   },
   uploadTableFromHdfs : function(tableData){
 console.log("uploadTableFromHdfs called.");
-this.pushUploadProgressInfos(this.formatMessage('uploadingFromHdfs'));
-var csvParams = tableData.get("fileFormatInfo.csvParams");
+
this.pushUploadProgressInfos(this.formatMessage('hive.messages.uploadingFromHdfs'));
+var fileFormatCsvParams = tableData.get("fileFormatInfo.csvParams");
+var csvParams = 

[ambari] branch trunk updated: AMBARI-23199. Infra Solr - add status and host checks for backup/restore/migrate custom commands. (#622)

2018-03-12 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 a6fecc5  AMBARI-23199. Infra Solr - add status and host checks for 
backup/restore/migrate custom commands. (#622)
a6fecc5 is described below

commit a6fecc5f2cb53608fc92d496870c16bc45484493
Author: Olivér Szabó 
AuthorDate: Tue Mar 13 05:48:39 2018 +0100

AMBARI-23199. Infra Solr - add status and host checks for 
backup/restore/migrate custom commands. (#622)
---
 .../0.1.0/package/scripts/collection.py|  41 +-
 .../0.1.0/package/scripts/command_commons.py   | 140 -
 .../0.1.0/package/scripts/migrate.py   |   5 +
 3 files changed, 178 insertions(+), 8 deletions(-)

diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_INFRA_SOLR/0.1.0/package/scripts/collection.py
 
b/ambari-server/src/main/resources/common-services/AMBARI_INFRA_SOLR/0.1.0/package/scripts/collection.py
index 0abcbc9..fa54cc0 100644
--- 
a/ambari-server/src/main/resources/common-services/AMBARI_INFRA_SOLR/0.1.0/package/scripts/collection.py
+++ 
b/ambari-server/src/main/resources/common-services/AMBARI_INFRA_SOLR/0.1.0/package/scripts/collection.py
@@ -16,7 +16,7 @@ See the License for the specific language governing 
permissions and
 limitations under the License.
 
 """
-
+import time
 from resource_management.core.logger import Logger
 from resource_management.core.resources.system import Directory, Execute, File
 from resource_management.libraries.functions.format import format
@@ -28,20 +28,34 @@ def backup_collection(env):
 import params, command_commons
 env.set_params(command_commons)
 
-Logger.info(format("Backup Solr Collection {collection} to 
{index_location}"))
-
-solr_request_path = 
format("{collection}/replication?command=BACKUP={index_location}={backup_name}=json")
-backup_api_cmd = 
command_commons.create_solr_api_request_command(solr_request_path)
-
 Directory(command_commons.index_location,
   mode=0755,
   cd_access='a',
   owner=params.infra_solr_user,
   group=params.user_group
   )
+collection_available = command_commons.is_collection_available_on_host()
+if command_commons.check_hosts and not collection_available:
+  Logger.info(format("No any '{collection}' replica is used on 
{params.hostname} host"))
+  return
+
+Logger.info(format("Backup Solr Collection {collection} to 
{index_location}"))
+
+solr_request_path = 
format("{collection}/replication?command=BACKUP={index_location}={backup_name}=json")
+backup_api_cmd = 
command_commons.create_solr_api_request_command(solr_request_path)
 
 Execute(backup_api_cmd, user=params.infra_solr_user, logoutput=True)
 
+if command_commons.request_async is False:
+  Logger.info("Sleep 5 seconds to wait until the backup request is 
executed.")
+  time.sleep(5)
+  Logger.info("Check backup status ...")
+  solr_status_request_path = 
format("{collection}/replication?command=details=json")
+  status_check_json_output = format("{index_location}/backup_status.json")
+  status_check_cmd = 
command_commons.create_solr_api_request_command(solr_status_request_path, 
status_check_json_output)
+  command_commons.snapshot_status_check(status_check_cmd, 
status_check_json_output, command_commons.backup_name, True,
+log_output=command_commons.log_output, 
tries=command_commons.request_tries, 
time_interval=command_commons.request_time_interval)
+
 def restore_collection(env):
 """
 Restore collections using replication API (as Solr Cloud Backup API is not 
available in Solr 5)
@@ -49,6 +63,11 @@ def restore_collection(env):
 import params, command_commons
 env.set_params(command_commons)
 
+collection_available = command_commons.is_collection_available_on_host()
+if command_commons.check_hosts and not collection_available:
+  Logger.info(format("No any '{collection}' replica is used on 
{params.hostname} host"))
+  return
+
 Logger.info(format("Remove write.lock files from folder 
'{index_location}'"))
 for write_lock_file in 
command_commons.get_files_by_pattern(format("{index_location}"), 'write.lock'):
   File(write_lock_file, action="delete")
@@ -60,6 +79,16 @@ def restore_collection(env):
 
 Execute(restore_api_cmd, user=params.infra_solr_user, logoutput=True)
 
+if command_commons.request_async is False:
+  Logger.info("Sleep 5 seconds to wait until the restore request is 
executed.")
+  time.sleep(5)
+  Logger.info("Check restore status ...")
+  solr_status_request_path = 
format("{collection}/replication?command=restorestatus=json")
+  status_check_json_output = format("{index_location}/restore_status.json")
+  

[ambari] branch branch-feature-AMBARI-14714 updated (1523f80 -> 68d6e53)

2018-03-12 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 1523f80  Merge pull request #627 from 
ishanbha/branch-feature-AMBARI-14714
 add b609d6f  AMBARI-23215. Update logic to skip *_CLIENT services Service 
Checks (SC), as there is no SC defined for them.
 new 68d6e53  AMBARI-23215. Update logic to skip *_CLIENT services Service 
Checks (SC), as there is no SC defined for them.

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:
 .../ambari/server/controller/AmbariManagementControllerImpl.java  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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


[ambari] 01/01: AMBARI-23215. Update logic to skip *_CLIENT services Service Checks (SC), as there is no SC defined for them.

2018-03-12 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 68d6e5328405489b27715268811451662868984c
Merge: 1523f80 b609d6f
Author: swapanshridhar 
AuthorDate: Mon Mar 12 17:10:15 2018 -0700

AMBARI-23215. Update logic to skip *_CLIENT services Service Checks (SC), 
as there is no SC defined for them.

 .../ambari/server/controller/AmbariManagementControllerImpl.java  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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


[ambari] branch trunk updated (55ae952 -> b614378)

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

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


from 55ae952  [AMBARI-23185] Added a new CLI option in the setup-ldap tool 
to indicate whether to force LDAP auth method even if another one - or none at 
all - is already configured (#615)
 new cb01382  AMBARI-22755. Show OneFS JMX metrics on the UI (amagyar)
 new 0c14220   AMBARI-22755. Show OneFS JMX metrics on the UI (amagyar)
 new a6dd77a  AMBARI-22755. Show OneFS JMX metrics on the UI (amagyar)
 new b614378  AMBARI-22755. Show OneFS JMX metrics on the UI (amagyar)

The 4 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:
 .../internal/AbstractProviderModule.java   |  10 +-
 .../internal/ConfigBasedJmxHostProvider.java   |  95 +++
 .../internal/StackDefinedPropertyProvider.java |   9 +-
 .../server/controller/jmx/JMXHostProvider.java |  32 +--
 .../state/{alert/AlertUri.java => UriInfo.java}|   8 +-
 .../ambari/server/state/alert/AmsSource.java   |   6 +-
 .../ambari/server/state/alert/MetricSource.java|   5 +-
 .../ambari/server/state/alert/ServerSource.java|   6 +-
 .../ambari/server/state/alert/WebSource.java   |   6 +-
 .../server/state/stack/MetricDefinition.java   |   9 ++
 .../internal/ConfigBasedJmxHostProviderTest.java   |  93 ++
 .../controller/internal/JMXHostProviderTest.java   | 104 +++-
 .../OverriddenMetricsHostProviderTest.java |   2 +-
 ...ComponentConfigurationResourceProviderTest.java |   2 +-
 .../metrics/JMXPropertyProviderTest.java   |  11 +--
 .../{alert/AlertUriTest.java => UriInfoTest.java}  |  10 +-
 .../app/controllers/global/update_controller.js|   3 +-
 ambari-web/app/mappers/service_metrics_mapper.js   |  49 ++
 ambari-web/app/models.js   |   1 +
 ambari-web/app/models/service.js   |   1 +
 ambari-web/app/models/service/onefs.js |  43 +
 ambari-web/app/views/main/service/info/summary.js  |   1 +
 .../addon-services/ONEFS/1.0.0/metrics.json| 105 +
 23 files changed, 472 insertions(+), 139 deletions(-)
 create mode 100644 
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigBasedJmxHostProvider.java
 rename 
ambari-server/src/main/java/org/apache/ambari/server/state/{alert/AlertUri.java 
=> UriInfo.java} (98%)
 create mode 100644 
ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ConfigBasedJmxHostProviderTest.java
 rename 
ambari-server/src/test/java/org/apache/ambari/server/state/{alert/AlertUriTest.java
 => UriInfoTest.java} (89%)
 create mode 100644 ambari-web/app/models/service/onefs.js

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


[ambari] 04/04: AMBARI-22755. Show OneFS JMX metrics on the UI (amagyar)

2018-03-12 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

commit b614378a9c6edc23ab628f2acf8af5ef11ba68d5
Author: Attila Magyar 
AuthorDate: Mon Mar 12 20:35:03 2018 +0100

AMBARI-22755. Show OneFS JMX metrics on the UI (amagyar)
---
 .../ambari/server/controller/internal/ConfigBasedJmxHostProvider.java | 4 ++--
 .../server/controller/internal/StackDefinedPropertyProvider.java  | 2 +-
 .../main/java/org/apache/ambari/server/state/{alert => }/UriInfo.java | 2 +-
 .../src/main/java/org/apache/ambari/server/state/alert/AmsSource.java | 2 ++
 .../main/java/org/apache/ambari/server/state/alert/MetricSource.java  | 1 +
 .../main/java/org/apache/ambari/server/state/alert/ServerSource.java  | 2 ++
 .../src/main/java/org/apache/ambari/server/state/alert/WebSource.java | 2 ++
 .../java/org/apache/ambari/server/state/stack/MetricDefinition.java   | 2 +-
 .../server/controller/internal/ConfigBasedJmxHostProviderTest.java| 2 +-
 .../java/org/apache/ambari/server/state/{alert => }/UriInfoTest.java  | 2 +-
 10 files changed, 14 insertions(+), 7 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigBasedJmxHostProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigBasedJmxHostProvider.java
index ff513c5..5291898 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigBasedJmxHostProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigBasedJmxHostProvider.java
@@ -30,10 +30,10 @@ import java.util.Set;
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.controller.jmx.JMXHostProvider;
 import org.apache.ambari.server.state.ConfigHelper;
-import org.apache.ambari.server.state.alert.UriInfo;
+import org.apache.ambari.server.state.UriInfo;
 
 /**
- * I'm a special {@link JMXHostProvider} that resolves JMX URIs based on 
cluster configuration.
+ * A special {@link JMXHostProvider} that resolves JMX URIs based on cluster 
configuration.
  */
 public class ConfigBasedJmxHostProvider implements JMXHostProvider {
   private final Map overriddenJmxUris;
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackDefinedPropertyProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackDefinedPropertyProvider.java
index 99ad46f..4e1d07e 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackDefinedPropertyProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackDefinedPropertyProvider.java
@@ -50,7 +50,7 @@ import org.apache.ambari.server.state.Clusters;
 import org.apache.ambari.server.state.ConfigHelper;
 import org.apache.ambari.server.state.Service;
 import org.apache.ambari.server.state.StackId;
-import org.apache.ambari.server.state.alert.UriInfo;
+import org.apache.ambari.server.state.UriInfo;
 import org.apache.ambari.server.state.stack.Metric;
 import org.apache.ambari.server.state.stack.MetricDefinition;
 import org.slf4j.Logger;
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/UriInfo.java 
b/ambari-server/src/main/java/org/apache/ambari/server/state/UriInfo.java
similarity index 99%
rename from 
ambari-server/src/main/java/org/apache/ambari/server/state/alert/UriInfo.java
rename to 
ambari-server/src/main/java/org/apache/ambari/server/state/UriInfo.java
index a2f1497..f7713c4 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/UriInfo.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/UriInfo.java
@@ -15,7 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.ambari.server.state.alert;
+package org.apache.ambari.server.state;
 
 import java.net.URI;
 import java.util.Map;
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AmsSource.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AmsSource.java
index f739115..ab8b671 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AmsSource.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AmsSource.java
@@ -20,6 +20,8 @@ package org.apache.ambari.server.state.alert;
 import java.util.List;
 import java.util.Objects;
 
+import org.apache.ambari.server.state.UriInfo;
+
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.google.gson.annotations.SerializedName;
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/MetricSource.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/MetricSource.java

[ambari] 02/04: AMBARI-22755. Show OneFS JMX metrics on the UI (amagyar)

2018-03-12 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

commit 0c142208035d3d5f7837a5d3f16cd2c52fc7708f
Author: Attila Magyar 
AuthorDate: Thu Mar 8 13:14:49 2018 +0100

 AMBARI-22755. Show OneFS JMX metrics on the UI (amagyar)
---
 .../ambari/server/controller/internal/ConfigBasedJmxHostProvider.java   | 2 +-
 .../server/controller/internal/OverriddenMetricsHostProviderTest.java   | 2 +-
 .../internal/RootServiceComponentConfigurationResourceProviderTest.java | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigBasedJmxHostProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigBasedJmxHostProvider.java
index 62b292f..17ac1fe 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigBasedJmxHostProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigBasedJmxHostProvider.java
@@ -20,7 +20,7 @@
 
 package org.apache.ambari.server.controller.internal;
 
-import static edu.emory.mathcs.backport.java.util.Collections.singleton;
+import static java.util.Collections.singleton;
 
 import java.net.URI;
 import java.util.Map;
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/OverriddenMetricsHostProviderTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/OverriddenMetricsHostProviderTest.java
index cf4b131..3026b29 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/OverriddenMetricsHostProviderTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/OverriddenMetricsHostProviderTest.java
@@ -17,7 +17,7 @@
  */
 package org.apache.ambari.server.controller.internal;
 
-import static edu.emory.mathcs.backport.java.util.Collections.emptyMap;
+import static java.util.Collections.emptyMap;
 import static org.easymock.EasyMock.expect;
 import static org.hamcrest.core.Is.is;
 import static org.junit.Assert.assertThat;
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationResourceProviderTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationResourceProviderTest.java
index 6dbdd65..8f9ac7e 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationResourceProviderTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationResourceProviderTest.java
@@ -28,6 +28,7 @@ import static org.easymock.EasyMock.newCapture;
 import java.io.File;
 import java.nio.charset.Charset;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
@@ -74,7 +75,6 @@ import com.google.inject.AbstractModule;
 import com.google.inject.Guice;
 import com.google.inject.Injector;
 
-import edu.emory.mathcs.backport.java.util.Collections;
 import junit.framework.Assert;
 import junit.framework.AssertionFailedError;
 

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


[ambari] 03/04: AMBARI-22755. Show OneFS JMX metrics on the UI (amagyar)

2018-03-12 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

commit a6dd77afacbbc348aaa0f6c3b2c666f40269f3fe
Author: Attila Magyar 
AuthorDate: Mon Mar 12 13:51:51 2018 +0100

AMBARI-22755. Show OneFS JMX metrics on the UI (amagyar)
---
 .../server/controller/internal/ConfigBasedJmxHostProvider.java | 10 +-
 .../controller/internal/StackDefinedPropertyProvider.java  |  6 +++---
 .../java/org/apache/ambari/server/state/alert/AmsSource.java   |  4 ++--
 .../org/apache/ambari/server/state/alert/MetricSource.java |  4 ++--
 .../org/apache/ambari/server/state/alert/ServerSource.java |  4 ++--
 .../server/state/alert/{MetricsUri.java => UriInfo.java}   |  6 +++---
 .../java/org/apache/ambari/server/state/alert/WebSource.java   |  4 ++--
 .../org/apache/ambari/server/state/stack/MetricDefinition.java |  6 +++---
 .../controller/internal/ConfigBasedJmxHostProviderTest.java|  8 
 .../state/alert/{MetricsUriTest.java => UriInfoTest.java}  |  8 
 10 files changed, 30 insertions(+), 30 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigBasedJmxHostProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigBasedJmxHostProvider.java
index 17ac1fe..ff513c5 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigBasedJmxHostProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigBasedJmxHostProvider.java
@@ -30,17 +30,17 @@ import java.util.Set;
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.controller.jmx.JMXHostProvider;
 import org.apache.ambari.server.state.ConfigHelper;
-import org.apache.ambari.server.state.alert.MetricsUri;
+import org.apache.ambari.server.state.alert.UriInfo;
 
 /**
  * I'm a special {@link JMXHostProvider} that resolves JMX URIs based on 
cluster configuration.
  */
 public class ConfigBasedJmxHostProvider implements JMXHostProvider {
-  private final Map overriddenJmxUris;
+  private final Map overriddenJmxUris;
   private final JMXHostProvider defaultProvider;
   private final ConfigHelper configHelper;
 
-  public ConfigBasedJmxHostProvider(Map overriddenJmxUris, 
JMXHostProvider defaultProvider, ConfigHelper configHelper) {
+  public ConfigBasedJmxHostProvider(Map overriddenJmxUris, 
JMXHostProvider defaultProvider, ConfigHelper configHelper) {
 this.overriddenJmxUris = overriddenJmxUris;
 this.defaultProvider = defaultProvider;
 this.configHelper = configHelper;
@@ -58,7 +58,7 @@ public class ConfigBasedJmxHostProvider implements 
JMXHostProvider {
   .orElseGet(() -> defaultProvider.getHostNames(clusterName, 
componentName));
   }
 
-  private URI resolve(MetricsUri uri, String clusterName) {
+  private URI resolve(UriInfo uri, String clusterName) {
 try {
   return uri.resolve(config(clusterName));
 } catch (AmbariException e) {
@@ -85,7 +85,7 @@ public class ConfigBasedJmxHostProvider implements 
JMXHostProvider {
 return defaultProvider.getJMXRpcMetricTag(clusterName, componentName, 
port);
   }
 
-  private Optional overridenJmxUri(String component) {
+  private Optional overridenJmxUri(String component) {
 return Optional.ofNullable(overriddenJmxUris.get(component));
   }
 
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackDefinedPropertyProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackDefinedPropertyProvider.java
index 34936a9..99ad46f 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackDefinedPropertyProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackDefinedPropertyProvider.java
@@ -50,7 +50,7 @@ import org.apache.ambari.server.state.Clusters;
 import org.apache.ambari.server.state.ConfigHelper;
 import org.apache.ambari.server.state.Service;
 import org.apache.ambari.server.state.StackId;
-import org.apache.ambari.server.state.alert.MetricsUri;
+import org.apache.ambari.server.state.alert.UriInfo;
 import org.apache.ambari.server.state.stack.Metric;
 import org.apache.ambari.server.state.stack.MetricDefinition;
 import org.slf4j.Logger;
@@ -158,7 +158,7 @@ public class StackDefinedPropertyProvider implements 
PropertyProvider {
 
 List additional = new ArrayList<>();
 Map overriddenHosts = new HashMap<>();
-Map overriddenJmxUris = new HashMap<>();
+Map overriddenJmxUris = new HashMap<>();
 
 try {
   for (Resource r : resources) {
@@ -250,7 +250,7 @@ public class StackDefinedPropertyProvider implements 
PropertyProvider {
 return 

[ambari] 01/04: AMBARI-22755. Show OneFS JMX metrics on the UI (amagyar)

2018-03-12 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

commit cb013822f6f93548bab0734a7660a361e5a4f725
Author: Attila Magyar 
AuthorDate: Wed Mar 7 20:09:16 2018 +0100

AMBARI-22755. Show OneFS JMX metrics on the UI (amagyar)
---
 .../internal/AbstractProviderModule.java   |  10 +-
 .../internal/ConfigBasedJmxHostProvider.java   |  95 +++
 .../internal/StackDefinedPropertyProvider.java |   9 +-
 .../server/controller/jmx/JMXHostProvider.java |  32 +--
 .../ambari/server/state/alert/AmsSource.java   |   4 +-
 .../ambari/server/state/alert/MetricSource.java|   4 +-
 .../state/alert/{AlertUri.java => MetricsUri.java} |   6 +-
 .../ambari/server/state/alert/ServerSource.java|   4 +-
 .../ambari/server/state/alert/WebSource.java   |   4 +-
 .../server/state/stack/MetricDefinition.java   |   9 ++
 .../internal/ConfigBasedJmxHostProviderTest.java   |  93 ++
 .../controller/internal/JMXHostProviderTest.java   | 104 +++-
 .../metrics/JMXPropertyProviderTest.java   |  11 +--
 .../{AlertUriTest.java => MetricsUriTest.java} |   8 +-
 .../app/controllers/global/update_controller.js|   3 +-
 ambari-web/app/mappers/service_metrics_mapper.js   |  49 ++
 ambari-web/app/models.js   |   1 +
 ambari-web/app/models/service.js   |   1 +
 ambari-web/app/models/service/onefs.js |  43 +
 ambari-web/app/views/main/service/info/summary.js  |   1 +
 .../addon-services/ONEFS/1.0.0/metrics.json| 105 +
 21 files changed, 461 insertions(+), 135 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
index caa21bc..4486410 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
@@ -486,8 +486,7 @@ public abstract class AbstractProviderModule implements 
ProviderModule,
 return hosts;
   }
 
-  @Override
-  public Host getHost(String clusterName, String hostName) {
+  private Host getHost(String clusterName, String hostName) {
 Host host = null;
 try {
   Cluster cluster = 
managementController.getClusters().getCluster(clusterName);
@@ -518,12 +517,7 @@ public abstract class AbstractProviderModule implements 
ProviderModule,
   // - JMXHostProvider ---
 
   @Override
-  public String getPort(String clusterName, String componentName, String 
hostName) throws SystemException {
-return getPort(clusterName, componentName, hostName, false);
-  }
-
-  @Override
-  public String getPort(String clusterName, String componentName, String 
hostName, boolean httpsEnabled) throws SystemException {
+  public String getPort(String clusterName, String componentName, String 
hostName, boolean httpsEnabled) {
 ConcurrentMap> clusterJmxPorts;
 // Still need double check to ensure single init
 if (!jmxPortMap.containsKey(clusterName)) {
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigBasedJmxHostProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigBasedJmxHostProvider.java
new file mode 100644
index 000..62b292f
--- /dev/null
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigBasedJmxHostProvider.java
@@ -0,0 +1,95 @@
+/*
+ *
+ *  * Licensed to the Apache Software Foundation (ASF) under one
+ *  * or more contributor license agreements.  See the NOTICE file
+ *  * distributed with this work for additional information
+ *  * regarding copyright ownership.  The ASF licenses this file
+ *  * to you under the Apache License, Version 2.0 (the
+ *  * "License"); you may not use this file except in compliance
+ *  * with the License.  You may obtain a copy of the License at
+ *  *
+ *  * http://www.apache.org/licenses/LICENSE-2.0
+ *  *
+ *  * Unless required by applicable law or agreed to in writing, software
+ *  * distributed under the License is distributed on an "AS IS" BASIS,
+ *  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  * See the License for the specific language governing permissions and
+ *  * limitations under the License.
+ *
+ */
+
+package org.apache.ambari.server.controller.internal;
+
+import static edu.emory.mathcs.backport.java.util.Collections.singleton;
+
+import java.net.URI;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+
+import 

[ambari] 30/36: AMBARI-22567 : Integrate Spark lifecycle management into AMS AD Manager. (avijayan)

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

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

commit f57c47d5d2b61d561995c7615d743e022f1e450b
Author: Aravindan Vijayan 
AuthorDate: Thu Nov 30 16:07:56 2017 -0800

AMBARI-22567 : Integrate Spark lifecycle management into AMS AD Manager. 
(avijayan)
---
 ...trics-admanager.sh => ambari-metrics-admanager} |  75 ---
 .../resources/config.yml => conf/unix/config.yaml} |   9 +-
 .../pom.xml|  44 --
 .../src/main/assemblies/empty.xml  |  21 +++
 .../adservice/app/AnomalyDetectionAppConfig.scala  |  10 ++
 .../MetricDefinitionServiceConfiguration.scala |   3 -
 .../configuration/SparkConfiguration.scala |  39 ++
 .../adservice/db/PhoenixAnomalyStoreAccessor.scala |   5 +-
 .../PointInTimeAnomalyInstance.scala   |   4 +-
 .../adservice/{common => model}/Range.scala|   2 +-
 .../adservice/{common => model}/Season.scala   |   4 +-
 .../adservice/{common => model}/SeasonType.scala   |   2 +-
 .../adservice/{common => model}/TimeRange.scala|   2 +-
 .../trend => model}/TrendAnomalyInstance.scala |   4 +-
 .../config.yml => test/resources/config.yaml}  |  17 +--
 .../app/AnomalyDetectionAppConfigTest.scala|  19 +--
 .../adservice/app/DefaultADResourceSpecTest.scala  |   2 +-
 .../adservice/{common => model}/RangeTest.scala|   7 +-
 .../adservice/{common => model}/SeasonTest.scala   |  19 +--
 ambari-metrics/ambari-metrics-assembly/pom.xml | 148 +
 .../src/main/assembly/anomaly-detection.xml|  60 +
 .../package/rpm/anomaly-detection/postinstall.sh   |  27 
 ambari-metrics/pom.xml |   4 +-
 .../0.1.0/configuration/ams-admanager-config.xml   |   4 +
 .../0.1.0/configuration/ams-admanager-env.xml  |   6 +-
 .../0.1.0/configuration/ams-admanager-log4j.xml|   2 +-
 .../configuration/ams-admanager-spark-env.xml  | 129 ++
 .../AMBARI_METRICS/0.1.0/metainfo.xml  |   1 +
 .../AMBARI_METRICS/0.1.0/package/scripts/ams.py|  14 +-
 .../0.1.0/package/scripts/ams_admanager.py |   4 +-
 .../AMBARI_METRICS/0.1.0/package/scripts/params.py |  22 ++-
 .../0.1.0/package/scripts/status_params.py |   2 +-
 32 files changed, 613 insertions(+), 98 deletions(-)

diff --git 
a/ambari-metrics/ambari-metrics-anomaly-detection-service/conf/unix/ambari-metrics-admanager.sh
 
b/ambari-metrics/ambari-metrics-anomaly-detection-service/conf/unix/ambari-metrics-admanager
similarity index 70%
rename from 
ambari-metrics/ambari-metrics-anomaly-detection-service/conf/unix/ambari-metrics-admanager.sh
rename to 
ambari-metrics/ambari-metrics-anomaly-detection-service/conf/unix/ambari-metrics-admanager
index f1a1ae3..98b7606 100644
--- 
a/ambari-metrics/ambari-metrics-anomaly-detection-service/conf/unix/ambari-metrics-admanager.sh
+++ 
b/ambari-metrics/ambari-metrics-anomaly-detection-service/conf/unix/ambari-metrics-admanager
@@ -14,13 +14,44 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific
 
-PIDFILE=/var/run//var/run/ambari-metrics-anomaly-detection/ambari-metrics-admanager.pid
+PIDFILE=/var/run/ambari-metrics-anomaly-detection/ambari-metrics-admanager.pid
 OUTFILE=/var/log/ambari-metrics-anomaly-detection/ambari-metrics-admanager.out
 
 CONF_DIR=/etc/ambari-metrics-anomaly-detection/conf
 DAEMON_NAME=ams_admanager
+SPARK_HOME=/usr/lib/ambari-metrics-anomaly-detection/spark
 
-STOP_TIMEOUT=5
+SPARK_MASTER_PID=/var/run/ambari-metrics-anomaly-detection/spark-ams-org.apache.spark.deploy.master.Master.pid
+
+STOP_TIMEOUT=10
+
+function spark_daemon
+{
+local cmd=$1
+local pid
+
+if [[ "${cmd}" == "start" ]]
+  then
+
+${SPARK_HOME}/sbin/start-master.sh
+sleep 2
+master_pid=$(cat "$SPARK_MASTER_PID")
+if [ -z "`ps ax | grep -w ${master_pid} | grep 
org.apache.spark.deploy.master.Master`" ]; then
+  echo "ERROR: Spark Master start failed. For more details, see 
outfile in log directory."
+  exit -1
+fi
+
+${SPARK_HOME}/sbin/start-slave.sh 
spark://${SPARK_MASTER_HOST}:${SPARK_MASTER_PORT}
+elif [[ "${cmd}" == "stop" ]]
+  then
+${SPARK_HOME}/sbin/stop-slave.sh
+${SPARK_HOME}/sbin/stop-master.sh
+else
+pid=${SPARK_MASTER_PID}
+daemon_status "${pid}"
+fi
+
+}
 
 function write_pidfile
 {
@@ -55,22 +86,6 @@ function java_setup
 
 function daemon_status()
 {
-  #
-  # LSB 4.1.0 compatible status command (1)
-  #
-  # 0 = program is running
-  # 1 = dead, but still a pid (2)
-  # 2 = (not used by us)
-  # 3 = not running
-  #
-  # 1 - this is not an endorsement of the LSB
-  #
-  # 2 - technically, the specification says /var/run/pid, so
-  #  

[ambari] 33/36: AMBARI-22744. Fix issues with webapp deployment with new Hadoop common changes. (swagle)

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

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

commit 3a054944c15305bf9cc16866d3fe07e962864158
Author: Siddharth Wagle 
AuthorDate: Fri Jan 5 13:34:57 2018 -0800

AMBARI-22744. Fix issues with webapp deployment with new Hadoop common 
changes. (swagle)
---
 .../AMSApplicationServer.java  | 10 ++--
 .../metrics/loadsimulator/LoadRunner.java  | 40 +++
 .../loadsimulator/MetricsLoadSimulator.java|  6 +--
 .../metrics/loadsimulator/MetricsSenderWorker.java | 21 +++-
 .../loadsimulator/data/HostMetricsGenerator.java   |  8 ++-
 .../data/MetricsGeneratorConfigurer.java   | 12 ++---
 .../loadsimulator/net/RestMetricsSender.java   |  9 ++--
 .../metrics/loadsimulator/util/Json.java   |  4 +-
 .../timeline/HBaseTimelineMetricsService.java  |  1 -
 .../metrics/timeline/PhoenixHBaseAccessor.java |  1 -
 .../timeline/TimelineMetricConfiguration.java  |  2 -
 .../timeline/TimelineMetricDistributedCache.java   |  6 +--
 .../metrics/timeline/TimelineMetricStore.java  | 12 ++---
 .../timeline/TimelineMetricStoreWatcher.java   | 14 +++---
 .../timeline/TimelineMetricsIgniteCache.java   | 57 +++---
 .../aggregators/AbstractTimelineAggregator.java| 35 ++---
 .../timeline/aggregators/DownSamplerUtils.java | 10 ++--
 .../TimelineMetricAggregatorFactory.java   | 20 
 .../aggregators/TimelineMetricAppAggregator.java   | 20 
 .../TimelineMetricClusterAggregator.java   | 20 
 ...tricClusterAggregatorSecondWithCacheSource.java | 14 +++---
 .../TimelineMetricFilteringHostAggregator.java | 14 +++---
 .../aggregators/TimelineMetricHostAggregator.java  | 16 +++---
 .../aggregators/TimelineMetricReadHelper.java  | 10 ++--
 .../timeline/aggregators/TopNDownSampler.java  | 14 +++---
 .../v2/TimelineMetricClusterAggregator.java| 16 +++---
 .../v2/TimelineMetricFilteringHostAggregator.java  | 14 +++---
 .../v2/TimelineMetricHostAggregator.java   | 14 +++---
 .../availability/AggregationTaskRunner.java| 24 -
 .../timeline/availability/CheckpointManager.java   |  4 +-
 .../availability/MetricCollectorHAController.java  | 26 +-
 .../OnlineOfflineStateModelFactory.java|  4 +-
 .../discovery/TimelineMetricMetadataKey.java   |  4 +-
 .../discovery/TimelineMetricMetadataManager.java   | 43 
 .../discovery/TimelineMetricMetadataSync.java  |  7 +--
 ...ractTimelineMetricsSeriesAggregateFunction.java |  9 ++--
 .../metrics/timeline/query/Condition.java  |  4 +-
 .../metrics/timeline/query/ConditionBuilder.java   |  6 +--
 .../metrics/timeline/query/ConnectionProvider.java |  2 -
 .../metrics/timeline/query/DefaultCondition.java   | 13 ++---
 .../timeline/query/DefaultPhoenixDataSource.java   | 12 ++---
 .../metrics/timeline/query/EmptyCondition.java |  4 +-
 .../timeline/query/PhoenixConnectionProvider.java  |  5 +-
 .../metrics/timeline/query/PhoenixTransactSQL.java | 15 +++---
 .../query/SplitByMetricNamesCondition.java |  4 +-
 .../metrics/timeline/query/TopNCondition.java  |  3 +-
 .../metrics/timeline/source/RawMetricsSource.java  |  1 -
 .../timeline/uuid/HashBasedUuidGenStrategy.java|  8 +--
 .../timeline/uuid/MetricUuidGenStrategy.java   |  1 -
 .../timeline/uuid/RandomUuidGenStrategy.java   |  6 +--
 .../timeline/TimelineWriter.java   |  4 +-
 .../webapp/TimelineWebServices.java|  3 --
 ambari-metrics/pom.xml |  2 +-
 53 files changed, 306 insertions(+), 328 deletions(-)

diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/AMSApplicationServer.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/AMSApplicationServer.java
index f576362..38d46ef 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/AMSApplicationServer.java
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/AMSApplicationServer.java
@@ -20,7 +20,6 @@ package 
org.apache.hadoop.yarn.server.applicationhistoryservice;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.classification.InterfaceAudience.Private;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.http.HttpConfig;
 import org.apache.hadoop.metrics2.lib.DefaultMetricsSystem;
@@ -35,13 +34,10 @@ import 
org.apache.hadoop.yarn.exceptions.YarnRuntimeException;
 import 

[ambari] 27/36: AMBARI-22365. Add storage support for storing metric definitions using LevelDB. (swagle)

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

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

commit af6c91baf490bce52ae340c11158a2faa3fb8211
Author: Siddharth Wagle 
AuthorDate: Fri Nov 3 10:06:12 2017 -0700

AMBARI-22365. Add storage support for storing metric definitions using 
LevelDB. (swagle)
---
 .../pom.xml|  19 +++-
 .../src/main/resources/config.yml  |   8 ++
 .../adservice/app/AnomalyDetectionAppConfig.scala  |  11 ++-
 .../adservice/app/AnomalyDetectionAppModule.scala  |   4 +-
 .../MetricDefinitionDBConfiguration.scala  |  38 
 .../metrics/adservice/db/MetadataDatasource.scala  |  73 +++
 .../adservice/leveldb/LevelDBDatasource.scala  | 102 +
 .../adservice/leveldb/LevelDBDataSourceTest.scala  |  57 
 8 files changed, 306 insertions(+), 6 deletions(-)

diff --git a/ambari-metrics/ambari-metrics-anomaly-detection-service/pom.xml 
b/ambari-metrics/ambari-metrics-anomaly-detection-service/pom.xml
index 44bdc1f..cfa8124 100644
--- a/ambari-metrics/ambari-metrics-anomaly-detection-service/pom.xml
+++ b/ambari-metrics/ambari-metrics-anomaly-detection-service/pom.xml
@@ -424,11 +424,18 @@
   jackson-datatype-jdk8
   ${jackson.version}
 
+
 
-  com.fasterxml.jackson.core
-  jackson-databind
-  ${jackson.version}
+  org.fusesource.leveldbjni
+  leveldbjni-all
+  1.8
+
+
+  org.iq80.leveldb
+  leveldb
+  0.9
 
+
 
   junit
   junit
@@ -452,5 +459,11 @@
   2.5
   test
 
+
+  org.mockito
+  mockito-all
+  1.8.4
+  test
+
   
 
\ No newline at end of file
diff --git 
a/ambari-metrics/ambari-metrics-anomaly-detection-service/src/main/resources/config.yml
 
b/ambari-metrics/ambari-metrics-anomaly-detection-service/src/main/resources/config.yml
index 920c50c..299a472 100644
--- 
a/ambari-metrics/ambari-metrics-anomaly-detection-service/src/main/resources/config.yml
+++ 
b/ambari-metrics/ambari-metrics-anomaly-detection-service/src/main/resources/config.yml
@@ -30,6 +30,14 @@ metricsCollector:
 adQueryService:
   anomalyDataTtl: 604800
 
+metricDefinitionDB:
+  # force checksum verification of all data that is read from the file system 
on behalf of a particular read
+  verifyChecksums: true
+  # raise an error as soon as it detects an internal corruption
+  performParanoidChecks: false
+  # Path to Level DB directory
+  dbDirPath: /var/lib/ambari-metrics-anomaly-detection/
+
 #subsystemService:
 #  spark:
 #  pointInTime:
diff --git 
a/ambari-metrics/ambari-metrics-anomaly-detection-service/src/main/scala/org/apache/ambari/metrics/adservice/app/AnomalyDetectionAppConfig.scala
 
b/ambari-metrics/ambari-metrics-anomaly-detection-service/src/main/scala/org/apache/ambari/metrics/adservice/app/AnomalyDetectionAppConfig.scala
index c1ef0d1..aa20223 100644
--- 
a/ambari-metrics/ambari-metrics-anomaly-detection-service/src/main/scala/org/apache/ambari/metrics/adservice/app/AnomalyDetectionAppConfig.scala
+++ 
b/ambari-metrics/ambari-metrics-anomaly-detection-service/src/main/scala/org/apache/ambari/metrics/adservice/app/AnomalyDetectionAppConfig.scala
@@ -20,10 +20,9 @@ package org.apache.ambari.metrics.adservice.app
 
 import javax.validation.Valid
 
-import 
org.apache.ambari.metrics.adservice.configuration.{AdServiceConfiguration, 
HBaseConfiguration, MetricCollectorConfiguration, 
MetricDefinitionServiceConfiguration}
+import org.apache.ambari.metrics.adservice.configuration._
 
 import com.fasterxml.jackson.annotation.JsonProperty
-
 import io.dropwizard.Configuration
 
 /**
@@ -46,6 +45,12 @@ class AnomalyDetectionAppConfig extends Configuration {
   @Valid
   private val adServiceConfiguration = new AdServiceConfiguration
 
+  /**
+* LevelDB settings for metrics definitions
+*/
+  @Valid
+  private val metricDefinitionDBConfiguration = new 
MetricDefinitionDBConfiguration
+
   /*
HBase Conf
 */
@@ -66,4 +71,6 @@ class AnomalyDetectionAppConfig extends Configuration {
   @JsonProperty("metricsCollector")
   def getMetricCollectorConfiguration: MetricCollectorConfiguration = 
metricCollectorConfiguration
 
+  @JsonProperty("metricDefinitionDB")
+  def getMetricDefinitionDBConfiguration: MetricDefinitionDBConfiguration = 
metricDefinitionDBConfiguration
 }
diff --git 
a/ambari-metrics/ambari-metrics-anomaly-detection-service/src/main/scala/org/apache/ambari/metrics/adservice/app/AnomalyDetectionAppModule.scala
 
b/ambari-metrics/ambari-metrics-anomaly-detection-service/src/main/scala/org/apache/ambari/metrics/adservice/app/AnomalyDetectionAppModule.scala
index 7425a7e..28b2880 100644
--- 
a/ambari-metrics/ambari-metrics-anomaly-detection-service/src/main/scala/org/apache/ambari/metrics/adservice/app/AnomalyDetectionAppModule.scala
+++ 

[ambari] 36/36: AMBARI-23100 : Merge branch-3.0-ams onto trunk. (Remove logsearch-it pom change)

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

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

commit a4eca612916e7c7fbcd16cc960761d2ad773855c
Author: Aravindan Vijayan 
AuthorDate: Tue Feb 27 12:25:49 2018 -0800

AMBARI-23100 : Merge branch-3.0-ams onto trunk. (Remove logsearch-it pom 
change)
---
 ambari-logsearch/ambari-logsearch-it/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ambari-logsearch/ambari-logsearch-it/pom.xml 
b/ambari-logsearch/ambari-logsearch-it/pom.xml
index b3a1d45..db3e09f 100644
--- a/ambari-logsearch/ambari-logsearch-it/pom.xml
+++ b/ambari-logsearch/ambari-logsearch-it/pom.xml
@@ -122,7 +122,7 @@
   
 
   
-test/target/classes
+target/classes
 
   
 src/test/java/

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


[ambari] 24/36: AMBARI-22343. Add ability in AMS to tee metrics to a set of configured Kafka brokers. (swagle)

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

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

commit 74fd517feda4489abc870880a4414306e4667205
Author: Siddharth Wagle 
AuthorDate: Tue Oct 31 11:34:45 2017 -0700

AMBARI-22343. Add ability in AMS to tee metrics to a set of configured 
Kafka brokers. (swagle)
---
 .../libraries/functions/package_conditions.py  |   4 +
 .../pom.xml|  11 ++
 .../src/main/resources/config.yml  |   3 -
 .../ambari-metrics-timelineservice/pom.xml | 127 -
 .../metrics/timeline/PhoenixHBaseAccessor.java |  29 ++---
 .../timeline/TimelineMetricConfiguration.java  |  55 ++---
 .../timeline/sink/ExternalSinkProvider.java|  12 +-
 .../metrics/timeline/sink/HttpSinkProvider.java|   4 +-
 .../metrics/timeline/sink/KafkaSinkProvider.java   | 118 +++
 .../DefaultInternalMetricsSourceProvider.java  |   2 +-
 .../metrics/timeline/source/RawMetricsSource.java  |  17 +--
 .../0.1.0/configuration/ams-admanager-config.xml   |  60 ++
 .../0.1.0/configuration/ams-admanager-env.xml  | 105 +
 .../0.1.0/configuration/ams-site.xml   |   1 -
 .../AMBARI_METRICS/0.1.0/metainfo.xml  |  41 ++-
 .../AMBARI_METRICS/0.1.0/package/scripts/ams.py|  35 ++
 .../0.1.0/package/scripts/ams_admanager.py |  73 
 .../AMBARI_METRICS/0.1.0/package/scripts/params.py |   9 ++
 .../AMBARI_METRICS/0.1.0/package/scripts/status.py |   2 +
 .../0.1.0/package/scripts/status_params.py |   2 +
 .../package/templates/admanager_config.yaml.j2 |  24 
 21 files changed, 619 insertions(+), 115 deletions(-)

diff --git 
a/ambari-common/src/main/python/resource_management/libraries/functions/package_conditions.py
 
b/ambari-common/src/main/python/resource_management/libraries/functions/package_conditions.py
index ebc1aba..64cda98 100644
--- 
a/ambari-common/src/main/python/resource_management/libraries/functions/package_conditions.py
+++ 
b/ambari-common/src/main/python/resource_management/libraries/functions/package_conditions.py
@@ -50,6 +50,10 @@ def should_install_phoenix():
   has_phoenix = len(phoenix_hosts) > 0
   return phoenix_enabled or has_phoenix
 
+def should_install_ams_admanager():
+  config = Script.get_config()
+  return _has_applicable_local_component(config, ["AD_MANAGER"])
+
 def should_install_ams_collector():
   config = Script.get_config()
   return _has_applicable_local_component(config, ["METRICS_COLLECTOR"])
diff --git a/ambari-metrics/ambari-metrics-anomaly-detection-service/pom.xml 
b/ambari-metrics/ambari-metrics-anomaly-detection-service/pom.xml
index 554d026..e96e957 100644
--- a/ambari-metrics/ambari-metrics-anomaly-detection-service/pom.xml
+++ b/ambari-metrics/ambari-metrics-anomaly-detection-service/pom.xml
@@ -296,6 +296,12 @@
   spark-mllib_${scala.binary.version}
   ${spark.version}
   provided
+  
+
+  com.fasterxml.jackson.core
+  jackson-databind
+
+  
 
 
   org.apache.hadoop
@@ -419,6 +425,11 @@
   ${jackson.version}
 
 
+  com.fasterxml.jackson.core
+  jackson-databind
+  ${jackson.version}
+
+
   junit
   junit
   4.12
diff --git 
a/ambari-metrics/ambari-metrics-anomaly-detection-service/src/main/resources/config.yml
 
b/ambari-metrics/ambari-metrics-anomaly-detection-service/src/main/resources/config.yml
index 9ca9e95..bd88d57 100644
--- 
a/ambari-metrics/ambari-metrics-anomaly-detection-service/src/main/resources/config.yml
+++ 
b/ambari-metrics/ambari-metrics-anomaly-detection-service/src/main/resources/config.yml
@@ -2,9 +2,6 @@ server:
   applicationConnectors:
- type: http
  port: 
-  adminConnectors:
-- type: http
-  port: 9990
   requestLog:
 type: external
 
diff --git a/ambari-metrics/ambari-metrics-timelineservice/pom.xml 
b/ambari-metrics/ambari-metrics-timelineservice/pom.xml
index 3d119f9..7794a11 100644
--- a/ambari-metrics/ambari-metrics-timelineservice/pom.xml
+++ b/ambari-metrics/ambari-metrics-timelineservice/pom.xml
@@ -80,7 +80,8 @@
   ${project.build.directory}/lib
   compile
   test
-  
jasper-runtime,jasper-compiler
+  jasper-runtime,jasper-compiler
+  
 
   
 
@@ -125,11 +126,13 @@
 
   target/lib
   
-  *tests.jar
+*tests.jar
   
 
 
-  
${project.build.directory}/${project.artifactId}-${project.version}.jar
+  
+
${project.build.directory}/${project.artifactId}-${project.version}.jar
+  
   

[ambari] 09/36: AMBARI-21244 Add https support to local metrics aggregator application (dsen)

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

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

commit 7e0e520f7af31cde6d0de0e92416226e30c03806
Author: Dmytro Sen 
AuthorDate: Wed Jun 21 15:49:27 2017 +0300

AMBARI-21244 Add https support to local metrics aggregator application 
(dsen)
---
 .../logfeeder/metrics/LogFeederAMSClient.java  |   5 +
 .../sink/timeline/AbstractTimelineMetricsSink.java |  13 +-
 .../AbstractTimelineMetricSinkTest.java|   5 +
 .../availability/MetricCollectorHATest.java|   5 +
 .../timeline/cache/HandleConnectExceptionTest.java |   5 +
 .../src/main/conf/flume-metrics2.properties.j2 |   8 +-
 .../sink/flume/FlumeTimelineMetricsSink.java   |  13 +-
 .../sink/timeline/HadoopTimelineMetricsSink.java   |  13 +-
 .../timeline/HadoopTimelineMetricsSinkTest.java|   4 +
 .../ambari-metrics-host-aggregator/pom.xml |  10 ++
 .../host/aggregator/AggregatorApplication.java |  51 +++-
 .../sink/timeline/AbstractMetricPublisher.java |  12 +-
 .../sink/timeline/AggregatedMetricsPublisher.java  |   5 +
 .../sink/timeline/RawMetricsPublisher.java |   5 +
 .../src/main/python/core/aggregator.py |   6 +-
 .../src/main/python/core/config_reader.py  |   9 +-
 .../src/main/python/core/emitter.py|  42 +++---
 .../src/main/python/core/host_info.py  |   1 -
 .../src/main/python/core/stop_handler.py   |   4 +-
 .../sink/kafka/KafkaTimelineMetricsReporter.java   |  10 +-
 .../sink/storm/StormTimelineMetricsReporter.java   |  16 ++-
 .../sink/storm/StormTimelineMetricsSink.java   |  13 +-
 .../sink/storm/StormTimelineMetricsReporter.java   |  13 +-
 .../sink/storm/StormTimelineMetricsSink.java   |  13 +-
 .../metrics/system/impl/AmbariMetricSinkImpl.java  |   5 +
 .../ACCUMULO/1.6.1.2.2.0/package/scripts/params.py |   6 +
 .../hadoop-metrics2-accumulo.properties.j2 |   3 +
 .../0.1.0/configuration/ams-site.xml   |   4 +
 .../AMBARI_METRICS/0.1.0/package/scripts/ams.py|  42 --
 .../AMBARI_METRICS/0.1.0/package/scripts/params.py |   8 +-
 .../templates/hadoop-metrics2-hbase.properties.j2  | 100 ++-
 .../0.1.0/package/templates/metric_monitor.ini.j2  |   3 +
 .../FLUME/1.4.0.2.0/package/scripts/params.py  |   6 +
 .../package/templates/flume-metrics2.properties.j2 |   3 +
 .../0.96.0.2.0/package/scripts/params_linux.py |   6 +
 ...oop-metrics2-hbase.properties-GANGLIA-MASTER.j2 |   3 +
 .../hadoop-metrics2-hbase.properties-GANGLIA-RS.j2 |   3 +
 .../0.12.0.2.0/package/scripts/params_linux.py |   6 +
 .../hadoop-metrics2-hivemetastore.properties.j2|   4 +-
 .../hadoop-metrics2-hiveserver2.properties.j2  |   3 +
 .../templates/hadoop-metrics2-llapdaemon.j2|   3 +
 .../templates/hadoop-metrics2-llaptaskscheduler.j2 |   3 +
 .../KAFKA/0.8.1/configuration/kafka-broker.xml |   5 +
 .../KAFKA/0.8.1/package/scripts/params.py  |   6 +
 .../STORM/0.9.1/package/scripts/params_linux.py|   6 +
 .../STORM/0.9.1/package/templates/config.yaml.j2   |   7 +-
 .../package/templates/storm-metrics2.properties.j2 |   3 +
 .../stack-hooks/before-START/scripts/params.py |   6 +
 .../templates/hadoop-metrics2.properties.j2|   3 +
 .../STORM/package/templates/config.yaml.j2 |  48 ---
 .../configuration/hadoop-metrics2.properties.xml   |   3 +
 .../configuration/hadoop-metrics2.properties.xml   |   5 +
 .../system/impl/TestAmbariMetricsSinkImpl.java |   5 +
 .../2.0.6/AMBARI_METRICS/test_metrics_monitor.py   | 142 +
 .../stacks/2.0.6/configs/default_ams_embedded.json |   1 +
 .../HDF/2.0/hooks/before-START/scripts/params.py   |   6 +
 .../templates/hadoop-metrics2.properties.j2|  10 +-
 .../ODPi/2.0/hooks/before-START/scripts/params.py  |  19 +++
 .../services/HIVE/package/scripts/params_linux.py  |   9 ++
 .../hadoop-metrics2-hivemetastore.properties.j2|  10 +-
 .../hadoop-metrics2-hiveserver2.properties.j2  |  10 +-
 .../templates/hadoop-metrics2-llapdaemon.j2|  11 +-
 .../templates/hadoop-metrics2-llaptaskscheduler.j2 |   9 +-
 63 files changed, 656 insertions(+), 160 deletions(-)

diff --git 
a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/metrics/LogFeederAMSClient.java
 
b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/metrics/LogFeederAMSClient.java
index ba986c7..0ccdff3 100644
--- 
a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/metrics/LogFeederAMSClient.java
+++ 
b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/metrics/LogFeederAMSClient.java
@@ -100,6 +100,11 @@ public class LogFeederAMSClient extends 
AbstractTimelineMetricsSink {
   }
 
   @Override
+  protected String 

[ambari] 10/36: AMBARI-17382 : Migrate AMS queries to use ROW_TIMESTAMP instead of native timerange hint. (avijayan)

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

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

commit c8f371eff809bcc6f5d9719473b8acc395f44ae9
Author: Aravindan Vijayan 
AuthorDate: Mon Jul 10 17:03:22 2017 -0700

AMBARI-17382 : Migrate AMS queries to use ROW_TIMESTAMP instead of native 
timerange hint. (avijayan)
---
 .../sink/timeline/SingleValuedTimelineMetric.java  | 15 ++-
 .../metrics2/sink/timeline/TimelineMetric.java | 18 ++---
 .../metrics2/sink/timeline/TimelineMetrics.java|  8 +---
 .../cache/TimelineMetricsEhCacheSizeOfEngine.java  |  1 -
 .../timeline/AggregatedMetricsPublisherTest.java   |  6 +--
 .../sink/timeline/RawMetricsPublisherTest.java |  2 +-
 .../metrics/timeline/PhoenixHBaseAccessor.java | 24 ---
 .../timeline/TimelineMetricStoreWatcher.java   |  1 -
 .../aggregators/AbstractTimelineAggregator.java|  2 +-
 .../TimelineMetricClusterAggregator.java   |  4 +-
 .../TimelineMetricClusterAggregatorSecond.java |  9 +
 .../aggregators/TimelineMetricHostAggregator.java  |  7 ++--
 .../aggregators/TimelineMetricReadHelper.java  |  4 +-
 .../v2/TimelineMetricClusterAggregator.java|  2 +-
 .../v2/TimelineMetricHostAggregator.java   |  2 +-
 .../metrics/timeline/query/PhoenixTransactSQL.java | 47 +-
 .../metrics/timeline/query/TopNCondition.java  |  2 -
 .../source/cache/InternalMetricsCache.java |  2 -
 .../TestApplicationHistoryServer.java  |  1 +
 .../timeline/AbstractMiniHBaseClusterTest.java | 15 ---
 .../metrics/timeline/ITPhoenixHBaseAccessor.java   |  2 +-
 .../metrics/timeline/MetricTestHelper.java |  2 +-
 .../metrics/timeline/TestPhoenixTransactSQL.java   |  6 +--
 .../timeline/aggregators/ITClusterAggregator.java  |  1 -
 .../timeline/aggregators/ITMetricAggregator.java   | 14 ++-
 .../timeline/discovery/TestMetadataManager.java|  5 ---
 .../timeline/source/RawMetricsSourceTest.java  |  1 -
 .../metrics/timeline/MetricsRequestHelper.java |  4 +-
 .../package/templates/smoketest_metrics.json.j2|  1 -
 .../cache/TimelineMetricCacheSizingTest.java   |  1 -
 30 files changed, 66 insertions(+), 143 deletions(-)

diff --git 
a/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/SingleValuedTimelineMetric.java
 
b/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/SingleValuedTimelineMetric.java
index 4bb9355..83d8e2c 100644
--- 
a/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/SingleValuedTimelineMetric.java
+++ 
b/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/SingleValuedTimelineMetric.java
@@ -23,7 +23,6 @@ package org.apache.hadoop.metrics2.sink.timeline;
  * with @TimelineMetric
  */
 public class SingleValuedTimelineMetric {
-  private Long timestamp;
   private Double value;
   private String metricName;
   private String appId;
@@ -31,26 +30,21 @@ public class SingleValuedTimelineMetric {
   private String hostName;
   private Long startTime;
 
-  public void setSingleTimeseriesValue(Long timestamp, Double value) {
-this.timestamp = timestamp;
+  public void setSingleTimeseriesValue(Long startTime, Double value) {
+this.startTime = startTime;
 this.value = value;
   }
 
   public SingleValuedTimelineMetric(String metricName, String appId,
 String instanceId, String hostName,
-long timestamp, long startTime) {
+long startTime) {
 this.metricName = metricName;
 this.appId = appId;
 this.instanceId = instanceId;
 this.hostName = hostName;
-this.timestamp = timestamp;
 this.startTime = startTime;
   }
 
-  public Long getTimestamp() {
-return timestamp;
-  }
-
   public long getStartTime() {
 return startTime;
   }
@@ -93,8 +87,7 @@ public class SingleValuedTimelineMetric {
 metric.setHostName(this.hostName);
 metric.setInstanceId(this.instanceId);
 metric.setStartTime(this.startTime);
-metric.setTimestamp(this.timestamp);
-metric.getMetricValues().put(timestamp, value);
+metric.getMetricValues().put(startTime, value);
 return metric;
   }
 }
diff --git 
a/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/TimelineMetric.java
 
b/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/TimelineMetric.java
index 3d3b19c..1f03fe9 100644
--- 
a/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/TimelineMetric.java
+++ 
b/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/TimelineMetric.java
@@ -40,7 

[ambari] 14/36: AMBARI-21106 : ML-Prototype: Detect timeseries anomaly for a metric. (Refine PIT & Trend subsystems, Integrate with AMS, Ambari Alerts.)

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

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

commit 759ff824a3d1c443056cba4204ed22eddf91be91
Author: Aravindan Vijayan 
AuthorDate: Tue Sep 26 14:38:40 2017 -0700

AMBARI-21106 : ML-Prototype: Detect timeseries anomaly for a metric. 
(Refine PIT & Trend subsystems, Integrate with AMS, Ambari Alerts.)
---
 .../prototype/AmbariServerInterface.java   |   1 -
 .../prototype/MetricSparkConsumer.java | 113 ++---
 .../prototype/MetricsCollectorInterface.java   |  10 +-
 .../prototype/PointInTimeADSystem.java |  18 +-
 .../alertservice/prototype/TrendADSystem.java  |  26 +--
 .../prototype/methods/ema/EmaModel.java|  31 ++--
 .../prototype/methods/ema/EmaTechnique.java|  21 ++-
 .../prototype/methods/hsdev/HsdevTechnique.java|  26 +--
 .../src/main/resources/R-scripts/tukeys.r  |  17 +-
 .../src/main/resources/input-config.properties |  24 +++
 .../alertservice/prototype/TestEmaTechnique.java   |  22 ++-
 .../metrics/alertservice/prototype/TestTukeys.java |   1 -
 .../ambari-metrics-grafana/src/main/scripted.js| 118 +
 .../metrics/TestMetricSeriesGenerator.java |  87 ++
 .../timeline/HBaseTimelineMetricsService.java  |  18 +-
 .../metrics/timeline/PhoenixHBaseAccessor.java | 122 +-
 .../timeline/TimelineMetricConfiguration.java  |  11 +-
 .../metrics/timeline/TimelineMetricStore.java  |   2 +
 .../metrics/timeline/query/PhoenixTransactSQL.java |  94 +++
 .../webapp/MetricAnomalyDetectorTestService.java   |  87 ++
 .../webapp/TimelineWebServices.java|  36 +++-
 .../metrics/timeline/TestTimelineMetricStore.java  |   5 +
 .../AMBARI_METRICS/0.1.0/alerts.json   |  70 
 .../alerts/alert_point_in_time_metric_anomalies.py | 185 +
 .../package/alerts/alert_trend_metric_anomalies.py | 185 +
 .../package/alerts/alert_metrics_deviation.py  |   4 +-
 .../metrics/timeline/MetricsPaddingMethodTest.java |   7 +
 27 files changed, 1234 insertions(+), 107 deletions(-)

diff --git 
a/ambari-metrics/ambari-metrics-alertservice/src/main/java/org/apache/ambari/metrics/alertservice/prototype/AmbariServerInterface.java
 
b/ambari-metrics/ambari-metrics-alertservice/src/main/java/org/apache/ambari/metrics/alertservice/prototype/AmbariServerInterface.java
index 0c1c6fc..b98f04c 100644
--- 
a/ambari-metrics/ambari-metrics-alertservice/src/main/java/org/apache/ambari/metrics/alertservice/prototype/AmbariServerInterface.java
+++ 
b/ambari-metrics/ambari-metrics-alertservice/src/main/java/org/apache/ambari/metrics/alertservice/prototype/AmbariServerInterface.java
@@ -76,7 +76,6 @@ public class AmbariServerInterface implements Serializable{
   JSONArray array = jsonObject.getJSONArray("items");
   for(int i = 0 ; i < array.length() ; i++){
 JSONObject alertDefn = 
array.getJSONObject(i).getJSONObject("AlertDefinition");
-LOG.info("alertDefn : " + alertDefn.get("name"));
 if (alertDefn.get("name") != null && 
alertDefn.get("name").equals("point_in_time_metrics_anomalies")) {
   JSONObject sourceNode = alertDefn.getJSONObject("source");
   JSONArray params = sourceNode.getJSONArray("parameters");
diff --git 
a/ambari-metrics/ambari-metrics-alertservice/src/main/java/org/apache/ambari/metrics/alertservice/prototype/MetricSparkConsumer.java
 
b/ambari-metrics/ambari-metrics-alertservice/src/main/java/org/apache/ambari/metrics/alertservice/prototype/MetricSparkConsumer.java
index 7735d6c..61b3dee 100644
--- 
a/ambari-metrics/ambari-metrics-alertservice/src/main/java/org/apache/ambari/metrics/alertservice/prototype/MetricSparkConsumer.java
+++ 
b/ambari-metrics/ambari-metrics-alertservice/src/main/java/org/apache/ambari/metrics/alertservice/prototype/MetricSparkConsumer.java
@@ -37,6 +37,12 @@ import org.apache.spark.streaming.kafka.KafkaUtils;
 import scala.Tuple2;
 
 import java.util.*;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 public class MetricSparkConsumer {
 
@@ -47,38 +53,75 @@ public class MetricSparkConsumer {
   private static long pitStartTime = System.currentTimeMillis();
   private static long ksStartTime = pitStartTime;
   private static long hdevStartTime = ksStartTime;
+  private static Set includeMetricPatterns = new HashSet<>();
+  private static Set includedHosts = new HashSet<>();
+  private static Set trendMetrics = new HashSet<>();
 
   public MetricSparkConsumer() {
   }
 
+  public static Properties readProperties(String propertiesFile) {
+try {
+  Properties properties = new Properties();
+  InputStream inputStream = 

[ambari] 16/36: Fixed compile errors from Merge trunk into branch-3.0-ams

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

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

commit 1a3ad8a1d7fbf6abb7f3295e868caecaf69a5ef6
Author: Siddharth Wagle 
AuthorDate: Tue Sep 26 15:56:28 2017 -0700

Fixed compile errors from Merge trunk into branch-3.0-ams
---
 .../metrics2/sink/timeline/cache/HandleConnectExceptionTest.java | 5 +
 .../server/controller/metrics/timeline/MetricsRequestHelper.java | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git 
a/ambari-metrics/ambari-metrics-common/src/test/java/org/apache/hadoop/metrics2/sink/timeline/cache/HandleConnectExceptionTest.java
 
b/ambari-metrics/ambari-metrics-common/src/test/java/org/apache/hadoop/metrics2/sink/timeline/cache/HandleConnectExceptionTest.java
index 77aba6b..4bcc2fb 100644
--- 
a/ambari-metrics/ambari-metrics-common/src/test/java/org/apache/hadoop/metrics2/sink/timeline/cache/HandleConnectExceptionTest.java
+++ 
b/ambari-metrics/ambari-metrics-common/src/test/java/org/apache/hadoop/metrics2/sink/timeline/cache/HandleConnectExceptionTest.java
@@ -213,6 +213,11 @@ public class HandleConnectExceptionTest {
 }
 
 @Override
+protected String getHostInMemoryAggregationProtocol() {
+  return "http";
+}
+
+@Override
 public boolean emitMetrics(TimelineMetrics metrics) {
   super.init();
   return super.emitMetrics(metrics);
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/MetricsRequestHelper.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/MetricsRequestHelper.java
index ce0fe6d..062c228 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/MetricsRequestHelper.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/MetricsRequestHelper.java
@@ -87,7 +87,7 @@ public class MetricsRequestHelper {
   uriBuilder.setParameter("precision", higherPrecision);
   String newSpec = uriBuilder.toString();
   connection = streamProvider.processURL(newSpec, HttpMethod.GET, 
(String) null,
-Collections.emptyMap());
+Collections.  emptyMap());
   if (!checkConnectionForPrecisionException(connection)) {
 throw new IOException("Encountered Precision exception : Higher 
precision request also failed.");
   }

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


[ambari] 12/36: AMBARI-21458 Provide ability to shard Cluster second aggregation across appId. (dsen)

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

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

commit a1c9713acb0ac6a9d8b388fa6f9d036189be3817
Author: Dmytro Sen 
AuthorDate: Thu Aug 31 13:00:14 2017 +0300

AMBARI-21458 Provide ability to shard Cluster second aggregation across 
appId. (dsen)
---
 .../availability/MetricCollectorHAHelper.java  |   8 +-
 .../ambari-metrics-timelineservice/pom.xml |  10 +
 .../timeline/HBaseTimelineMetricsService.java  |  32 ++-
 .../metrics/timeline/PhoenixHBaseAccessor.java |   2 +-
 .../timeline/TimelineMetricConfiguration.java  |  76 +
 ...ta.java => TimelineMetricDistributedCache.java} |  47 +---
 .../timeline/TimelineMetricsIgniteCache.java   | 305 +
 .../aggregators/AbstractTimelineAggregator.java|  11 +-
 .../timeline/aggregators/AggregatorUtils.java  | 192 +
 .../TimelineMetricAggregatorFactory.java   |  30 +-
 .../aggregators/TimelineMetricAppAggregator.java   |  15 +-
 .../TimelineMetricClusterAggregatorSecond.java | 231 ++--
 ...tricClusterAggregatorSecondWithCacheSource.java | 132 +
 .../availability/MetricCollectorHAController.java  |  19 +-
 .../discovery/TimelineMetricHostMetadata.java  |  19 +-
 .../discovery/TimelineMetricMetadataManager.java   |  20 +-
 .../discovery/TimelineMetricMetadataSync.java  |   2 +-
 .../timeline/uuid/HashBasedUuidGenStrategy.java|   4 +
 .../metrics/timeline/ITPhoenixHBaseAccessor.java   |   4 +-
 .../timeline/TimelineMetricsIgniteCacheTest.java   | 296 
 .../AbstractTimelineAggregatorTest.java|  12 +-
 .../timeline/aggregators/ITClusterAggregator.java  |  10 +-
 .../TimelineMetricClusterAggregatorSecondTest.java |  32 +--
 ...ClusterAggregatorSecondWithCacheSourceTest.java | 178 
 .../MetricCollectorHAControllerTest.java   |   1 +
 .../timeline/discovery/TestMetadataManager.java|   8 +-
 ambari-metrics/pom.xml |   4 +-
 27 files changed, 1364 insertions(+), 336 deletions(-)

diff --git 
a/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/availability/MetricCollectorHAHelper.java
 
b/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/availability/MetricCollectorHAHelper.java
index c6f6beb..3071cbc 100644
--- 
a/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/availability/MetricCollectorHAHelper.java
+++ 
b/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/availability/MetricCollectorHAHelper.java
@@ -38,7 +38,7 @@ import java.util.concurrent.Callable;
  * does not add a watcher on the znode.
  */
 public class MetricCollectorHAHelper {
-  private final String zookeeperQuorum;
+  private final String zookeeperConnectionURL;
   private final int tryCount;
   private final int sleepMsBetweenRetries;
 
@@ -52,8 +52,8 @@ public class MetricCollectorHAHelper {
 
   private static final Log LOG = 
LogFactory.getLog(MetricCollectorHAHelper.class);
 
-  public MetricCollectorHAHelper(String zookeeperQuorum, int tryCount, int 
sleepMsBetweenRetries) {
-this.zookeeperQuorum = zookeeperQuorum;
+  public MetricCollectorHAHelper(String zookeeperConnectionURL, int tryCount, 
int sleepMsBetweenRetries) {
+this.zookeeperConnectionURL = zookeeperConnectionURL;
 this.tryCount = tryCount;
 this.sleepMsBetweenRetries = sleepMsBetweenRetries;
   }
@@ -66,7 +66,7 @@ public class MetricCollectorHAHelper {
 Set collectors = new HashSet<>();
 
 RetryPolicy retryPolicy = new 
BoundedExponentialBackoffRetry(sleepMsBetweenRetries, 10*sleepMsBetweenRetries, 
tryCount);
-final CuratorZookeeperClient client = new 
CuratorZookeeperClient(zookeeperQuorum,
+final CuratorZookeeperClient client = new 
CuratorZookeeperClient(zookeeperConnectionURL,
   SESSION_TIMEOUT, CONNECTION_TIMEOUT, null, retryPolicy);
 
 List liveInstances = null;
diff --git a/ambari-metrics/ambari-metrics-timelineservice/pom.xml 
b/ambari-metrics/ambari-metrics-timelineservice/pom.xml
index f3e0041..d306ad3 100644
--- a/ambari-metrics/ambari-metrics-timelineservice/pom.xml
+++ b/ambari-metrics/ambari-metrics-timelineservice/pom.xml
@@ -703,6 +703,16 @@
   1.0.0.0-SNAPSHOT
   test
 
+
+  org.apache.ignite
+  ignite-core
+  2.1.0
+
+
+  org.apache.ignite
+  ignite-log4j
+  2.1.0
+
   
 
   
diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricsService.java
 

[ambari] 11/36: AMBARI-21279 Handle scenario when host in-memory aggregation is not working (dsen)

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

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

commit 35eb7de3826a11edd93adc5c2eb6e53758d88611
Author: Dmytro Sen 
AuthorDate: Tue Jul 11 14:17:58 2017 +0300

AMBARI-21279 Handle scenario when host in-memory aggregation is not working 
(dsen)
---
 .../timeline/HBaseTimelineMetricsService.java  |  15 +-
 .../TimelineMetricAggregatorFactory.java   |  49 
 .../TimelineMetricFilteringHostAggregator.java |  94 
 .../v2/TimelineMetricFilteringHostAggregator.java  | 119 ++
 .../discovery/TimelineMetricMetadataManager.java   |  76 +--
 .../metrics/timeline/query/Condition.java  |   2 +
 .../metrics/timeline/query/DefaultCondition.java   | 246 ++---
 .../metrics/timeline/query/EmptyCondition.java |  11 +
 .../metrics/timeline/query/PhoenixTransactSQL.java |  13 +-
 .../query/SplitByMetricNamesCondition.java |  10 +
 .../metrics/timeline/TestPhoenixTransactSQL.java   |   4 +-
 .../timeline/query/DefaultConditionTest.java   | 194 ++--
 12 files changed, 608 insertions(+), 225 deletions(-)

diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricsService.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricsService.java
index 2d890c0..4318fd3 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricsService.java
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricsService.java
@@ -82,6 +82,7 @@ public class HBaseTimelineMetricsService extends 
AbstractService implements Time
   private static volatile boolean isInitialized = false;
   private final ScheduledExecutorService watchdogExecutorService = 
Executors.newSingleThreadScheduledExecutor();
   private final Map 
scheduledExecutors = new HashMap<>();
+  private final ConcurrentHashMap postedAggregatedMap = new 
ConcurrentHashMap<>();
   private TimelineMetricMetadataManager metricMetadataManager;
   private Integer defaultTopNHostsLimit;
   private MetricCollectorHAController haController;
@@ -172,7 +173,11 @@ public class HBaseTimelineMetricsService extends 
AbstractService implements Time
 
   // Start the minute host aggregator
   if 
(Boolean.parseBoolean(metricsConf.get(TIMELINE_METRICS_HOST_INMEMORY_AGGREGATION,
 "true"))) {
-LOG.info("timeline.metrics.host.inmemory.aggregation is set to True, 
disabling host minute aggregation on collector");
+LOG.info("timeline.metrics.host.inmemory.aggregation is set to True, 
switching to filtering host minute aggregation on collector");
+TimelineMetricAggregator minuteHostAggregator =
+  
TimelineMetricAggregatorFactory.createFilteringTimelineMetricAggregatorMinute(
+hBaseAccessor, metricsConf, metricMetadataManager, haController, 
postedAggregatedMap);
+scheduleAggregatorThread(minuteHostAggregator);
   } else {
 TimelineMetricAggregator minuteHostAggregator =
   TimelineMetricAggregatorFactory.createTimelineMetricAggregatorMinute(
@@ -463,8 +468,16 @@ public class HBaseTimelineMetricsService extends 
AbstractService implements Time
   @Override
   public TimelinePutResponse putHostAggregatedMetrics(AggregationResult 
aggregationResult) throws SQLException, IOException {
 Map aggregateMap = new HashMap<>();
+String hostname = null;
 for (TimelineMetricWithAggregatedValues entry : 
aggregationResult.getResult()) {
   aggregateMap.put(entry.getTimelineMetric(), entry.getMetricAggregate());
+  hostname = hostname == null ? entry.getTimelineMetric().getHostName() : 
hostname;
+  break;
+}
+long timestamp = aggregationResult.getTimeInMilis();
+postedAggregatedMap.put(hostname, timestamp);
+if (LOG.isDebugEnabled()) {
+  LOG.debug(String.format("Adding host %s to aggregated by in-memory 
aggregator. Timestamp : %s", hostname, timestamp));
 }
 hBaseAccessor.saveHostAggregateRecords(aggregateMap, 
PhoenixTransactSQL.METRICS_AGGREGATE_MINUTE_TABLE_NAME);
 
diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricAggregatorFactory.java
 

[ambari] 06/36: Fixing rat check failures and compilation issues. (avijayan)

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

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

commit 07cac0ef560286069a50bca9caf1f7d928e75795
Author: Aravindan Vijayan 
AuthorDate: Wed May 31 11:31:57 2017 -0700

Fixing rat check failures and compilation issues. (avijayan)
---
 ambari-metrics/ambari-metrics-alertservice/pom.xml | 23 --
 .../ambari/metrics/alertservice/R/AmsRTest.java| 17 +
 .../metrics/alertservice/R/RFunctionInvoker.java   | 17 +
 .../metrics/alertservice/common/DataSet.java   | 17 +
 .../metrics/alertservice/common/MethodResult.java  | 17 +
 .../metrics/alertservice/common/MetricAnomaly.java | 17 +
 .../metrics/alertservice/common/ResultSet.java | 17 +
 .../common/SingleValuedTimelineMetric.java | 17 +
 .../alertservice/common/StatisticUtils.java| 17 +
 .../alertservice/common/TimelineMetric.java| 17 +
 .../alertservice/common/TimelineMetrics.java   | 17 +
 .../alertservice/methods/MetricAnomalyModel.java   | 17 +
 .../metrics/alertservice/methods/ema/EmaDS.java| 20 +-
 .../metrics/alertservice/methods/ema/EmaModel.java | 21 +-
 .../alertservice/methods/ema/EmaModelLoader.java   | 17 +
 .../alertservice/methods/ema/EmaResult.java| 17 +
 .../alertservice/methods/ema/TestEmaModel.java | 17 +
 .../alertservice/spark/AmsKafkaProducer.java   | 17 +
 .../alertservice/spark/AnomalyMetricPublisher.java | 19 -
 .../alertservice/spark/MetricAnomalyDetector.java  | 21 --
 .../src/main/resources/R-scripts/ema.R | 19 -
 .../src/main/resources/R-scripts/hsdev.r   | 17 +
 .../src/main/resources/R-scripts/iforest.R | 17 +
 .../src/main/resources/R-scripts/kstest.r  | 17 +
 .../src/main/resources/R-scripts/test.R| 18 +
 .../src/main/resources/R-scripts/tukeys.r  | 17 +
 .../src/main/resources/R-scripts/util.R| 17 +
 ambari-metrics/ambari-metrics-spark/pom.xml| 20 +-
 .../metrics/spark/MetricAnomalyDetector.scala  | 16 +
 .../ambari/metrics/spark/SparkPhoenixReader.scala  | 17 +
 .../ambari-metrics-timelineservice/pom.xml | 11 +--
 .../timeline/HBaseTimelineMetricsService.java  |  5 +-
 .../cache/InternalMetricsCacheSizeOfEngine.java| 81 +++---
 ambari-metrics/pom.xml |  2 +-
 34 files changed, 566 insertions(+), 67 deletions(-)

diff --git a/ambari-metrics/ambari-metrics-alertservice/pom.xml 
b/ambari-metrics/ambari-metrics-alertservice/pom.xml
index 10f920a..4afc80f 100644
--- a/ambari-metrics/ambari-metrics-alertservice/pom.xml
+++ b/ambari-metrics/ambari-metrics-alertservice/pom.xml
@@ -1,4 +1,22 @@
 
+
+
 http://maven.apache.org/POM/4.0.0;
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
@@ -26,11 +44,6 @@
 jar
 
 
-
-org.apache.ambari
-ambari-metrics-common
-${project.version}
-
 
 
 commons-lang
diff --git 
a/ambari-metrics/ambari-metrics-alertservice/src/main/java/org/apache/ambari/metrics/alertservice/R/AmsRTest.java
 
b/ambari-metrics/ambari-metrics-alertservice/src/main/java/org/apache/ambari/metrics/alertservice/R/AmsRTest.java
index 0929f4c..2bbc250 100644
--- 
a/ambari-metrics/ambari-metrics-alertservice/src/main/java/org/apache/ambari/metrics/alertservice/R/AmsRTest.java
+++ 
b/ambari-metrics/ambari-metrics-alertservice/src/main/java/org/apache/ambari/metrics/alertservice/R/AmsRTest.java
@@ -1,3 +1,20 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.ambari.metrics.alertservice.R;
 
 import org.apache.ambari.metrics.alertservice.common.ResultSet;
diff --git 
a/ambari-metrics/ambari-metrics-alertservice/src/main/java/org/apache/ambari/metrics/alertservice/R/RFunctionInvoker.java
 

[ambari] 28/36: AMBARI-22437 : Create an 'AD Manager' component in Ambari Metrics Service stack side. (avijayan)

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

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

commit a2aec07065986395e5bc05de8bdcd389409a0a95
Author: Aravindan Vijayan 
AuthorDate: Tue Nov 14 09:46:00 2017 -0800

AMBARI-22437 : Create an 'AD Manager' component in Ambari Metrics Service 
stack side. (avijayan)
---
 .../conf/unix/ambari-metrics-admanager.sh  | 194 +
 .../conf/unix/log4j.properties |  31 
 .../pom.xml|  14 +-
 .../src/main/resources/config.yml  |   6 +-
 .../adservice/app/AnomalyDetectionAppConfig.scala  |   7 +-
 .../adservice/app/AnomalyDetectionAppModule.scala  |   9 +-
 .../configuration/HBaseConfiguration.scala |   2 +
 .../MetricCollectorConfiguration.scala |  16 +-
 .../MetricDefinitionDBConfiguration.scala  |   6 +-
 .../adservice/db/LevelDbStoreAccessor.scala|  56 ++
 .../adservice/leveldb/LevelDBDatasource.scala  |  17 +-
 .../adservice/metadata/ADMetadataProvider.scala|  17 +-
 .../metadata/MetricDefinitionServiceImpl.scala |  32 ++--
 .../adservice/resource/AnomalyResource.scala   |   2 +-
 .../resource/MetricDefinitionResource.scala|  24 ++-
 .../subsystem/trend/TrendAnomalyInstance.scala |  17 ++
 .../app/AnomalyDetectionAppConfigTest.scala|  14 +-
 .../adservice/app/DefaultADResourceSpecTest.scala  |   4 +-
 .../adservice/leveldb/LevelDBDataSourceTest.scala  |   4 +-
 .../0.1.0/configuration/ams-admanager-config.xml   |  51 ++
 .../0.1.0/configuration/ams-admanager-env.xml  |  12 +-
 .../0.1.0/configuration/ams-admanager-log4j.xml|  86 +
 .../AMBARI_METRICS/0.1.0/metainfo.xml  |   1 +
 .../AMBARI_METRICS/0.1.0/package/scripts/ams.py|  23 ++-
 .../AMBARI_METRICS/0.1.0/package/scripts/params.py |  15 +-
 .../0.1.0/package/scripts/status_params.py |   2 +-
 .../package/templates/admanager_config.yaml.j2 |  20 +++
 .../stacks/2.0.6/AMBARI_METRICS/test_admanager.py  | 106 +++
 .../test/python/stacks/2.0.6/configs/default.json  |  13 ++
 .../stacks/2.0.6/configs/default_ams_embedded.json |  13 ++
 30 files changed, 751 insertions(+), 63 deletions(-)

diff --git 
a/ambari-metrics/ambari-metrics-anomaly-detection-service/conf/unix/ambari-metrics-admanager.sh
 
b/ambari-metrics/ambari-metrics-anomaly-detection-service/conf/unix/ambari-metrics-admanager.sh
new file mode 100644
index 000..f1a1ae3
--- /dev/null
+++ 
b/ambari-metrics/ambari-metrics-anomaly-detection-service/conf/unix/ambari-metrics-admanager.sh
@@ -0,0 +1,194 @@
+#!/usr/bin/env bash
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific
+
+PIDFILE=/var/run//var/run/ambari-metrics-anomaly-detection/ambari-metrics-admanager.pid
+OUTFILE=/var/log/ambari-metrics-anomaly-detection/ambari-metrics-admanager.out
+
+CONF_DIR=/etc/ambari-metrics-anomaly-detection/conf
+DAEMON_NAME=ams_admanager
+
+STOP_TIMEOUT=5
+
+function write_pidfile
+{
+local pidfile="$1"
+echo $! > "${pidfile}" 2>/dev/null
+if [[ $? -gt 0 ]]; then
+  echo "ERROR:  Cannot write pid ${pidfile}." | tee -a $STARTUPFILE
+  exit 1;
+fi
+}
+
+function java_setup
+{
+  # Bail if we did not detect it
+  if [[ -z "${JAVA_HOME}" ]]; then
+echo "ERROR: JAVA_HOME is not set and could not be found."
+exit 1
+  fi
+
+  if [[ ! -d "${JAVA_HOME}" ]]; then
+echo "ERROR: JAVA_HOME ${JAVA_HOME} does not exist."
+exit 1
+  fi
+
+  JAVA="${JAVA_HOME}/bin/java"
+
+  if [[ ! -x "$JAVA" ]]; then
+echo "ERROR: $JAVA is not executable."
+exit 1
+  fi
+}
+
+function daemon_status()
+{
+  #
+  # LSB 4.1.0 compatible status command (1)
+  #
+  # 0 = program is running
+  # 1 = dead, but still a pid (2)
+  # 2 = (not used by us)
+  # 3 = not running
+  #
+  # 1 - this is not an endorsement of the LSB
+  #
+  # 2 - technically, the specification says /var/run/pid, so
+  # we should never return this value, but we're giving
+  # them the benefit of a doubt and returning 1 even if
+  # our pid is not in in /var/run .
+  #
+
+  local pidfile="$1"
+  shift
+
+  local pid
+
+  if [[ -f "${pidfile}" ]]; then
+   

[ambari] 02/36: AMBARI-21106 : Ambari Metrics Anomaly detection prototype.(avijayan)

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

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

commit 12294fd03d4b9899f01fb05e932bee4a247842fd
Author: Aravindan Vijayan 
AuthorDate: Tue May 30 12:34:18 2017 -0700

AMBARI-21106 : Ambari Metrics Anomaly detection prototype.(avijayan)
---
 ambari-metrics/ambari-metrics-alertservice/pom.xml | 121 +++
 .../ambari/metrics/alertservice/R/AmsRTest.java| 130 
 .../metrics/alertservice/R/RFunctionInvoker.java   | 180 +
 .../metrics/alertservice/common/DataSet.java   |  21 ++
 .../metrics/alertservice/common/MethodResult.java  |  10 +
 .../metrics/alertservice/common/MetricAnomaly.java |  52 +
 .../metrics/alertservice/common/ResultSet.java |  26 +++
 .../common/SingleValuedTimelineMetric.java |  86 
 .../alertservice/common/StatisticUtils.java|  60 ++
 .../alertservice/common/TimelineMetric.java| 221 +
 .../alertservice/common/TimelineMetrics.java   | 112 +++
 .../alertservice/methods/MetricAnomalyModel.java   |  12 ++
 .../metrics/alertservice/methods/ema/EmaDS.java|  56 ++
 .../metrics/alertservice/methods/ema/EmaModel.java | 114 +++
 .../alertservice/methods/ema/EmaModelLoader.java   |  29 +++
 .../alertservice/methods/ema/EmaResult.java|  19 ++
 .../alertservice/methods/ema/TestEmaModel.java |  51 +
 .../alertservice/spark/AmsKafkaProducer.java   |  75 +++
 .../alertservice/spark/AnomalyMetricPublisher.java | 181 +
 .../alertservice/spark/MetricAnomalyDetector.java  | 134 +
 ambari-metrics/ambari-metrics-spark/pom.xml| 133 +
 .../metrics/spark/MetricAnomalyDetector.scala  |  97 +
 .../ambari/metrics/spark/SparkPhoenixReader.scala  |  67 +++
 .../ambari-metrics-timelineservice/pom.xml |   5 +
 ...Store.java => HBaseTimelineMetricsService.java} |  39 +++-
 ambari-metrics/pom.xml |   2 +
 26 files changed, 2029 insertions(+), 4 deletions(-)

diff --git a/ambari-metrics/ambari-metrics-alertservice/pom.xml 
b/ambari-metrics/ambari-metrics-alertservice/pom.xml
new file mode 100644
index 000..3a3545b
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-alertservice/pom.xml
@@ -0,0 +1,121 @@
+
+http://maven.apache.org/POM/4.0.0;
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
+
+ambari-metrics
+org.apache.ambari
+2.5.1.0.0
+
+4.0.0
+ambari-metrics-alertservice
+2.5.1.0.0
+
+
+
+org.apache.maven.plugins
+maven-compiler-plugin
+
+1.8
+1.8
+
+
+
+
+Ambari Metrics Alert Service
+jar
+
+
+
+org.apache.ambari
+ambari-metrics-common
+${project.version}
+
+
+
+commons-lang
+commons-lang
+2.5
+
+
+
+org.slf4j
+slf4j-api
+1.7.2
+
+
+
+org.slf4j
+slf4j-log4j12
+1.7.2
+
+
+
+com.github.lucarosellini.rJava
+JRI
+0.9-7
+
+
+org.apache.spark
+spark-streaming_2.11
+2.1.1
+
+
+org.apache.kafka
+kafka_2.10
+0.10.1.0
+
+
+com.sun.jdmk
+jmxtools
+
+
+com.sun.jmx
+jmxri
+
+
+javax.mail
+mail
+
+
+javax.jms
+jmx
+
+
+javax.jms
+jms
+
+
+
+
+org.apache.kafka
+kafka-clients
+0.10.1.0
+
+
+org.apache.kafka
+connect-json
+0.10.1.0
+
+
+org.apache.spark
+spark-streaming-kafka_2.10
+1.6.3
+
+
+org.apache.spark
+spark-sql_2.10
+1.6.3
+
+
+org.apache.phoenix
+phoenix-spark
+4.7.0-HBase-1.0
+
+
+org.apache.spark
+spark-mllib_2.10
+1.3.0
+
+
+
\ No newline at end of file
diff --git 

[ambari] 19/36: AMBARI-22077 : Create maven module and package structure for the anomaly detection engine. (Commit 2) (avijayan)

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

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

commit 67fff4e37339a0742d48358f88f490b841a607d1
Author: Aravindan Vijayan 
AuthorDate: Wed Sep 27 15:02:56 2017 -0700

AMBARI-22077 : Create maven module and package structure for the anomaly 
detection engine. (Commit 2) (avijayan)
---
 .../pom.xml|   4 +-
 .../adservice}/prototype/common/DataSeries.java|   2 +-
 .../adservice}/prototype/common/ResultSet.java |   2 +-
 .../prototype/common/StatisticUtils.java   |   2 +-
 .../prototype/core/AmbariServerInterface.java  |   2 +-
 .../prototype/core/MetricKafkaProducer.java|   2 +-
 .../prototype/core/MetricSparkConsumer.java|   6 +-
 .../prototype/core/MetricsCollectorInterface.java  |   4 +-
 .../prototype/core/PointInTimeADSystem.java|  10 +-
 .../prototype/core/RFunctionInvoker.java   |   6 +-
 .../adservice}/prototype/core/TrendADSystem.java   |  10 +-
 .../adservice}/prototype/core/TrendMetric.java |   2 +-
 .../methods/AnomalyDetectionTechnique.java |   4 +-
 .../prototype/methods/MetricAnomaly.java   |   2 +-
 .../adservice}/prototype/methods/ema/EmaModel.java |   4 +-
 .../prototype/methods/ema/EmaModelLoader.java  |   8 +-
 .../prototype/methods/ema/EmaTechnique.java|   6 +-
 .../prototype/methods/hsdev/HsdevTechnique.java|  10 +-
 .../prototype/methods/kstest/KSTechnique.java  |  10 +-
 .../utilities/MetricAnomalyDetectorTestInput.java  |   2 +-
 .../testing/utilities/MetricAnomalyTester.java | 168 +
 .../utilities/TestMetricSeriesGenerator.java   |   2 +-
 .../testing/utilities/TestSeriesInputRequest.java  |   2 +-
 .../src/main/resources/R-scripts/ema.R |   0
 .../src/main/resources/R-scripts/hsdev.r   |   0
 .../src/main/resources/R-scripts/iforest.R |   0
 .../src/main/resources/R-scripts/kstest.r  |   0
 .../src/main/resources/R-scripts/test.R|   0
 .../src/main/resources/R-scripts/tukeys.r  |   0
 .../src/main/resources/input-config.properties |   0
 .../spark/prototype}/MetricAnomalyDetector.scala   |   9 +-
 .../spark/prototype}/SparkPhoenixReader.scala  |   4 +-
 .../adservice}/prototype/TestEmaTechnique.java |  10 +-
 .../adservice}/prototype/TestRFunctionInvoker.java |  10 +-
 .../metrics/adservice}/prototype/TestTukeys.java   |  10 +-
 .../seriesgenerator/AbstractMetricSeries.java  |   2 +-
 .../seriesgenerator/DualBandMetricSeries.java  |   2 +-
 .../MetricSeriesGeneratorFactory.java  |   4 +-
 .../seriesgenerator/MetricSeriesGeneratorTest.java |   2 +-
 .../seriesgenerator/MonotonicMetricSeries.java |   2 +-
 .../seriesgenerator/NormalMetricSeries.java|   2 +-
 .../SteadyWithTurbulenceMetricSeries.java  |   2 +-
 .../seriesgenerator/StepFunctionMetricSeries.java  |   2 +-
 .../seriesgenerator/UniformMetricSeries.java   |   2 +-
 .../testing/utilities/MetricAnomalyTester.java | 166 
 ambari-metrics/pom.xml |   2 +-
 46 files changed, 246 insertions(+), 255 deletions(-)

diff --git a/ambari-metrics/ambari-metrics-anomaly-detector/pom.xml 
b/ambari-metrics/ambari-metrics-anomaly-detection-service/pom.xml
similarity index 98%
rename from ambari-metrics/ambari-metrics-anomaly-detector/pom.xml
rename to ambari-metrics/ambari-metrics-anomaly-detection-service/pom.xml
index e6e12f2..1a10f86 100644
--- a/ambari-metrics/ambari-metrics-anomaly-detector/pom.xml
+++ b/ambari-metrics/ambari-metrics-anomaly-detection-service/pom.xml
@@ -26,7 +26,7 @@
 2.0.0.0-SNAPSHOT
 
 4.0.0
-ambari-metrics-anomaly-detector
+ambari-metrics-anomaly-detection-service
 2.0.0.0-SNAPSHOT
 
 2.10.4
@@ -78,7 +78,7 @@
 
 
 
-Ambari Metrics Anomaly Detector
+Ambari Metrics Anomaly Detection Service
 jar
 
 
diff --git 
a/ambari-metrics/ambari-metrics-anomaly-detector/src/main/java/org/apache/ambari/metrics/alertservice/prototype/common/DataSeries.java
 
b/ambari-metrics/ambari-metrics-anomaly-detection-service/src/main/java/org/apache/ambari/metrics/adservice/prototype/common/DataSeries.java
similarity index 95%
rename from 
ambari-metrics/ambari-metrics-anomaly-detector/src/main/java/org/apache/ambari/metrics/alertservice/prototype/common/DataSeries.java
rename to 
ambari-metrics/ambari-metrics-anomaly-detection-service/src/main/java/org/apache/ambari/metrics/adservice/prototype/common/DataSeries.java
index eb19857..54b402f 100644
--- 
a/ambari-metrics/ambari-metrics-anomaly-detector/src/main/java/org/apache/ambari/metrics/alertservice/prototype/common/DataSeries.java
+++ 

[ambari] 18/36: AMBARI-22077 : Create maven module and package structure for the anomaly detection engine. (avijayan)

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

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

commit d064c38245dfc00955bce575a806833670ed8140
Author: Aravindan Vijayan 
AuthorDate: Wed Sep 27 10:43:48 2017 -0700

AMBARI-22077 : Create maven module and package structure for the anomaly 
detection engine. (avijayan)
---
 .../pom.xml|  62 -
 .../alertservice/prototype/common/DataSeries.java  |   0
 .../alertservice/prototype/common/ResultSet.java   |   0
 .../prototype/common/StatisticUtils.java   |   0
 .../prototype/core}/AmbariServerInterface.java |   2 +-
 .../prototype/core}/MetricKafkaProducer.java   |   2 +-
 .../prototype/core}/MetricSparkConsumer.java   |   4 +-
 .../prototype/core}/MetricsCollectorInterface.java |   2 +-
 .../prototype/core}/PointInTimeADSystem.java   |   2 +-
 .../prototype/core}/RFunctionInvoker.java  |   2 +-
 .../prototype/core}/TrendADSystem.java |   2 +-
 .../alertservice/prototype/core}/TrendMetric.java  |   2 +-
 .../methods/AnomalyDetectionTechnique.java |   0
 .../prototype/methods/MetricAnomaly.java   |   0
 .../prototype/methods/ema/EmaModel.java|   0
 .../prototype/methods/ema/EmaModelLoader.java  |   0
 .../prototype/methods/ema/EmaTechnique.java|   0
 .../prototype/methods/hsdev/HsdevTechnique.java|   0
 .../prototype/methods/kstest/KSTechnique.java  |   2 +-
 .../utilities}/MetricAnomalyDetectorTestInput.java |   2 +-
 .../testing/utilities}/MetricAnomalyTester.java|   5 +-
 .../utilities/TestMetricSeriesGenerator.java   |  92 +
 .../testing/utilities}/TestSeriesInputRequest.java |   2 +-
 .../seriesgenerator/AbstractMetricSeries.java  |   0
 .../seriesgenerator/DualBandMetricSeries.java  |   0
 .../MetricSeriesGeneratorFactory.java  |   0
 .../seriesgenerator/MonotonicMetricSeries.java |   0
 .../seriesgenerator/NormalMetricSeries.java|   0
 .../SteadyWithTurbulenceMetricSeries.java  |   0
 .../seriesgenerator/StepFunctionMetricSeries.java  |   0
 .../seriesgenerator/UniformMetricSeries.java   |   0
 .../src/main/resources/R-scripts/ema.R |   0
 .../src/main/resources/R-scripts/hsdev.r   |   0
 .../src/main/resources/R-scripts/iforest.R |   0
 .../src/main/resources/R-scripts/kstest.r  |   0
 .../src/main/resources/R-scripts/test.R|   0
 .../src/main/resources/R-scripts/tukeys.r  |   0
 .../src/main/resources/input-config.properties |   0
 .../metrics/spark/MetricAnomalyDetector.scala  | 127 +
 .../ambari/metrics/spark/SparkPhoenixReader.scala  |  16 +--
 .../alertservice/prototype/TestEmaTechnique.java   |   2 +-
 .../prototype/TestRFunctionInvoker.java|   2 +-
 .../metrics/alertservice/prototype/TestTukeys.java |   3 +-
 .../seriesgenerator/MetricSeriesGeneratorTest.java |   7 -
 ambari-metrics/ambari-metrics-spark/pom.xml| 151 -
 .../metrics/spark/MetricAnomalyDetector.scala  | 109 ---
 .../ambari-metrics-timelineservice/pom.xml |   6 -
 .../metrics/TestMetricSeriesGenerator.java |  87 
 .../webapp/MetricAnomalyDetectorTestService.java   |  87 
 .../webapp/TimelineWebServices.java|   1 -
 ambari-metrics/pom.xml |   3 +-
 51 files changed, 301 insertions(+), 483 deletions(-)

diff --git a/ambari-metrics/ambari-metrics-alertservice/pom.xml 
b/ambari-metrics/ambari-metrics-anomaly-detector/pom.xml
similarity index 71%
rename from ambari-metrics/ambari-metrics-alertservice/pom.xml
rename to ambari-metrics/ambari-metrics-anomaly-detector/pom.xml
index 4db8a6a..e6e12f2 100644
--- a/ambari-metrics/ambari-metrics-alertservice/pom.xml
+++ b/ambari-metrics/ambari-metrics-anomaly-detector/pom.xml
@@ -26,8 +26,29 @@
 2.0.0.0-SNAPSHOT
 
 4.0.0
-ambari-metrics-alertservice
+ambari-metrics-anomaly-detector
 2.0.0.0-SNAPSHOT
+
+2.10.4
+2.11
+
+
+
+
+scala-tools.org
+Scala-Tools Maven2 Repository
+http://scala-tools.org/repo-releases
+
+
+
+
+
+scala-tools.org
+Scala-Tools Maven2 Repository
+http://scala-tools.org/repo-releases
+
+
+
 
 
 
@@ -37,9 +58,27 @@
 1.8
 
 
+
+org.scala-tools
+maven-scala-plugin
+
+
+
+compile
+testCompile
+
+
+
+
+

[ambari] 26/36: AMBARI-22359 : Fix Serialization issues in Metric Definition Service (avijayan).

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

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

commit d865b6ef31c894d4160690edf93fdaf430296e86
Author: Aravindan Vijayan 
AuthorDate: Thu Nov 2 14:41:38 2017 -0700

AMBARI-22359 : Fix Serialization issues in Metric Definition Service 
(avijayan).
---
 .../src/main/resources/config.yml  |  4 +-
 .../adservice/app/AnomalyDetectionAppConfig.scala  | 10 ++---
 .../ambari/metrics/adservice/common/Season.scala   |  4 +-
 .../MetricCollectorConfiguration.scala | 10 -
 ... => MetricDefinitionServiceConfiguration.scala} |  2 +-
 .../adservice/db/PhoenixAnomalyStoreAccessor.scala |  8 ++--
 .../adservice/metadata/ADMetadataProvider.scala| 12 ++---
 .../adservice/metadata/MetricDefinition.scala  | 52 ++
 ...Service.scala => MetricDefinitionService.scala} |  2 +-
 ...mpl.scala => MetricDefinitionServiceImpl.scala} | 34 --
 .../metadata/MetricSourceDefinition.scala  | 38 +---
 .../app/AnomalyDetectionAppConfigTest.scala|  2 +-
 .../metrics/adservice/common/SeasonTest.scala  |  4 +-
 ...est.scala => MetricDefinitionServiceTest.scala} | 34 +++---
 .../metadata/MetricSourceDefinitionTest.scala  | 11 +++--
 15 files changed, 126 insertions(+), 101 deletions(-)

diff --git 
a/ambari-metrics/ambari-metrics-anomaly-detection-service/src/main/resources/config.yml
 
b/ambari-metrics/ambari-metrics-anomaly-detection-service/src/main/resources/config.yml
index 6953745..920c50c 100644
--- 
a/ambari-metrics/ambari-metrics-anomaly-detection-service/src/main/resources/config.yml
+++ 
b/ambari-metrics/ambari-metrics-anomaly-detection-service/src/main/resources/config.yml
@@ -20,8 +20,8 @@ server:
 logging:
   type: external
 
-metricManagerService:
-  inputDefinitionDirectory: /etc/adservice/conf/input-definitions-directory
+metricDefinitionService:
+  inputDefinitionDirectory: /etc/ambari-metrics-anomaly-detection/conf
 
 metricsCollector:
   hostPortList: host1:6188,host2:6188
diff --git 
a/ambari-metrics/ambari-metrics-anomaly-detection-service/src/main/scala/org/apache/ambari/metrics/adservice/app/AnomalyDetectionAppConfig.scala
 
b/ambari-metrics/ambari-metrics-anomaly-detection-service/src/main/scala/org/apache/ambari/metrics/adservice/app/AnomalyDetectionAppConfig.scala
index be8d027..c1ef0d1 100644
--- 
a/ambari-metrics/ambari-metrics-anomaly-detection-service/src/main/scala/org/apache/ambari/metrics/adservice/app/AnomalyDetectionAppConfig.scala
+++ 
b/ambari-metrics/ambari-metrics-anomaly-detection-service/src/main/scala/org/apache/ambari/metrics/adservice/app/AnomalyDetectionAppConfig.scala
@@ -20,7 +20,7 @@ package org.apache.ambari.metrics.adservice.app
 
 import javax.validation.Valid
 
-import 
org.apache.ambari.metrics.adservice.configuration.{AdServiceConfiguration, 
HBaseConfiguration, MetricCollectorConfiguration, 
MetricManagerServiceConfiguration}
+import 
org.apache.ambari.metrics.adservice.configuration.{AdServiceConfiguration, 
HBaseConfiguration, MetricCollectorConfiguration, 
MetricDefinitionServiceConfiguration}
 
 import com.fasterxml.jackson.annotation.JsonProperty
 
@@ -35,7 +35,7 @@ class AnomalyDetectionAppConfig extends Configuration {
Metric Definition Service configuration
 */
   @Valid
-  private val metricManagerServiceConfiguration = new 
MetricManagerServiceConfiguration
+  private val metricDefinitionServiceConfiguration = new 
MetricDefinitionServiceConfiguration
 
   @Valid
   private val metricCollectorConfiguration = new MetricCollectorConfiguration
@@ -53,9 +53,9 @@ class AnomalyDetectionAppConfig extends Configuration {
 HBaseConfiguration.getHBaseConf
   }
 
-  @JsonProperty("metricManagerService")
-  def getMetricManagerServiceConfiguration: MetricManagerServiceConfiguration 
= {
-metricManagerServiceConfiguration
+  @JsonProperty("metricDefinitionService")
+  def getMetricDefinitionServiceConfiguration: 
MetricDefinitionServiceConfiguration = {
+metricDefinitionServiceConfiguration
   }
 
   @JsonProperty("adQueryService")
diff --git 
a/ambari-metrics/ambari-metrics-anomaly-detection-service/src/main/scala/org/apache/ambari/metrics/adservice/common/Season.scala
 
b/ambari-metrics/ambari-metrics-anomaly-detection-service/src/main/scala/org/apache/ambari/metrics/adservice/common/Season.scala
index aba2587..f875e3b 100644
--- 
a/ambari-metrics/ambari-metrics-anomaly-detection-service/src/main/scala/org/apache/ambari/metrics/adservice/common/Season.scala
+++ 
b/ambari-metrics/ambari-metrics-anomaly-detection-service/src/main/scala/org/apache/ambari/metrics/adservice/common/Season.scala
@@ -112,11 +112,11 @@ object Season {
 validSeasons.toList
   }
 
-  def serialize(season: Season) : String = {
+  def toJson(season: Season) : String = {
 mapper.writeValueAsString(season)
   

[ambari] 34/36: AMBARI-22744. Fix issues with webapp deployment with new Hadoop common changes. Addendum. (swagle)

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

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

commit 575fd37f985d5db34b267de5902a09787105b580
Author: Siddharth Wagle 
AuthorDate: Mon Jan 8 14:08:22 2018 -0800

AMBARI-22744. Fix issues with webapp deployment with new Hadoop common 
changes. Addendum. (swagle)
---
 .../yarn/server/applicationhistoryservice/AMSApplicationServer.java   | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/AMSApplicationServer.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/AMSApplicationServer.java
index 38d46ef..db889bf 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/AMSApplicationServer.java
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/AMSApplicationServer.java
@@ -18,6 +18,8 @@
 
 package org.apache.hadoop.yarn.server.applicationhistoryservice;
 
+import static org.apache.hadoop.http.HttpServer2.HTTP_MAX_THREADS_KEY;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
@@ -120,7 +122,7 @@ public class AMSApplicationServer extends CompositeService {
 LOG.info("Instantiating metrics collector at " + bindAddress);
 try {
   Configuration conf = metricConfiguration.getMetricsConf();
-  conf.set("hadoop.http.max.threads", String.valueOf(metricConfiguration
+  conf.set(HTTP_MAX_THREADS_KEY, String.valueOf(metricConfiguration
 .getTimelineMetricsServiceHandlerThreadCount()));
   HttpConfig.Policy policy = HttpConfig.Policy.valueOf(
 conf.get(TimelineMetricConfiguration.TIMELINE_SERVICE_HTTP_POLICY,

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


[ambari] 20/36: AMBARI-22163 : Anomaly Storage: Design Metric anomalies schema. (avijayan)

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

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

commit af79c69f0a4a710b90fc2582c2c9f39febfad468
Author: Aravindan Vijayan 
AuthorDate: Fri Oct 6 10:53:28 2017 -0700

AMBARI-22163 : Anomaly Storage: Design Metric anomalies schema. (avijayan)
---
 ambari-logsearch/ambari-logsearch-it/pom.xml   |   2 +-
 .../pom.xml|  33 ++-
 .../adservice/common/ADServiceConfiguration.scala  |  74 ++
 .../adservice/common/PhoenixQueryConstants.scala   | 109 +
 .../adservice/db/PhoenixAnomalyStoreAccessor.scala |  67 +
 .../spark/prototype/SparkPhoenixReader.scala   |  92 -
 .../common/ADManagerConfigurationTest.scala|  23 +
 .../db/PhoenixAnomalyStoreAccessorTest.scala   |  26 +
 ambari-metrics/ambari-metrics-common/pom.xml   |  46 +
 .../sink}/timeline/query/ConnectionProvider.java   |   5 +-
 .../timeline/query/DefaultPhoenixDataSource.java   |  20 +++-
 .../timeline/query/PhoenixConnectionProvider.java  |   2 +-
 .../metrics/timeline/PhoenixHBaseAccessor.java |  23 +
 .../TestApplicationHistoryServer.java  |   2 +-
 .../timeline/AbstractMiniHBaseClusterTest.java |   6 +-
 .../metrics/timeline/PhoenixHBaseAccessorTest.java |   4 +-
 16 files changed, 454 insertions(+), 80 deletions(-)

diff --git a/ambari-logsearch/ambari-logsearch-it/pom.xml 
b/ambari-logsearch/ambari-logsearch-it/pom.xml
index db3e09f..b3a1d45 100644
--- a/ambari-logsearch/ambari-logsearch-it/pom.xml
+++ b/ambari-logsearch/ambari-logsearch-it/pom.xml
@@ -122,7 +122,7 @@
   
 
   
-target/classes
+test/target/classes
 
   
 src/test/java/
diff --git a/ambari-metrics/ambari-metrics-anomaly-detection-service/pom.xml 
b/ambari-metrics/ambari-metrics-anomaly-detection-service/pom.xml
index 1a10f86..6f8f8c1 100644
--- a/ambari-metrics/ambari-metrics-anomaly-detection-service/pom.xml
+++ b/ambari-metrics/ambari-metrics-anomaly-detection-service/pom.xml
@@ -29,8 +29,9 @@
 ambari-metrics-anomaly-detection-service
 2.0.0.0-SNAPSHOT
 
-2.10.4
+2.11.1
 2.11
+2.7.3.2.6.0.3-8
 
 
 
@@ -201,5 +202,35 @@
 2.1.1
 provided
 
+
+org.apache.hadoop
+hadoop-common
+${hadoop.version}
+provided
+
+
+commons-el
+commons-el
+
+
+tomcat
+jasper-runtime
+
+
+tomcat
+jasper-compiler
+
+
+org.mortbay.jetty
+jsp-2.1-jetty
+
+
+
+
+org.scalatest
+scalatest_2.11
+3.0.1
+test
+
 
 
\ No newline at end of file
diff --git 
a/ambari-metrics/ambari-metrics-anomaly-detection-service/src/main/scala/org/apache/ambari/metrics/adservice/common/ADServiceConfiguration.scala
 
b/ambari-metrics/ambari-metrics-anomaly-detection-service/src/main/scala/org/apache/ambari/metrics/adservice/common/ADServiceConfiguration.scala
new file mode 100644
index 000..248c74e
--- /dev/null
+++ 
b/ambari-metrics/ambari-metrics-anomaly-detection-service/src/main/scala/org/apache/ambari/metrics/adservice/common/ADServiceConfiguration.scala
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ambari.metrics.adservice.common
+
+import java.net.{MalformedURLException, URISyntaxException}
+
+import org.apache.hadoop.conf.Configuration
+
+object ADServiceConfiguration {
+
+  private val AMS_AD_SITE_CONFIGURATION_FILE = "ams-ad-site.xml"
+  private val HBASE_SITE_CONFIGURATION_FILE = "hbase-site.xml"
+
+  val ANOMALY_METRICS_TTL = "timeline.metrics.anomaly.data.ttl"
+
+  private var hbaseConf: org.apache.hadoop.conf.Configuration = _
+  private var adConf: 

[ambari] 07/36: AMBARI-21079. Add ability to sink Raw metrics to external system via Http. Compilation error fix. (swagle)

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

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

commit b81c38d98591acd2d1b2ee1c6356942352d23ef3
Author: Siddharth Wagle 
AuthorDate: Thu Jun 8 16:14:24 2017 -0700

AMBARI-21079. Add ability to sink Raw metrics to external system via Http. 
Compilation error fix. (swagle)
---
 ambari-metrics/ambari-metrics-common/pom.xml   |  2 +-
 .../cache/TimelineMetricsEhCacheSizeOfEngine.java  | 22 +++
 .../cache/InternalMetricsCacheSizeOfEngine.java| 71 +-
 .../cache/TimelineMetricsCacheSizeOfEngine.java| 17 +-
 4 files changed, 53 insertions(+), 59 deletions(-)

diff --git a/ambari-metrics/ambari-metrics-common/pom.xml 
b/ambari-metrics/ambari-metrics-common/pom.xml
index bd94ad1..4f08820 100644
--- a/ambari-metrics/ambari-metrics-common/pom.xml
+++ b/ambari-metrics/ambari-metrics-common/pom.xml
@@ -74,7 +74,7 @@
 
 
   org.apache.commons.io
-  
org.apache.ambari.metrics.sink.relocated.commons.ioStormTimelineMetricsReporter
+  
org.apache.ambari.metrics.sink.relocated.commons.io
 
 
   org.apache.commons.lang
diff --git 
a/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/cache/TimelineMetricsEhCacheSizeOfEngine.java
 
b/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/cache/TimelineMetricsEhCacheSizeOfEngine.java
index ea694b7..0e23e17 100644
--- 
a/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/cache/TimelineMetricsEhCacheSizeOfEngine.java
+++ 
b/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/cache/TimelineMetricsEhCacheSizeOfEngine.java
@@ -24,6 +24,9 @@ import 
org.apache.hadoop.metrics2.sink.timeline.TimelineMetric;
 import org.apache.hadoop.metrics2.sink.timeline.TimelineMetrics;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+
+import net.sf.ehcache.Element;
+import net.sf.ehcache.pool.Size;
 import net.sf.ehcache.pool.SizeOfEngine;
 import net.sf.ehcache.pool.impl.DefaultSizeOfEngine;
 import net.sf.ehcache.pool.sizeof.ReflectionSizeOf;
@@ -51,6 +54,7 @@ public abstract class TimelineMetricsEhCacheSizeOfEngine 
implements SizeOfEngine
   // Map entry sizing
   private long sizeOfMapEntry;
   private long sizeOfMapEntryOverhead;
+  private long sizeOfElement;
 
   protected TimelineMetricsEhCacheSizeOfEngine(SizeOfEngine underlying) {
 this.underlying = underlying;
@@ -62,6 +66,8 @@ public abstract class TimelineMetricsEhCacheSizeOfEngine 
implements SizeOfEngine
 this.sizeOfMapEntry = reflectionSizeOf.sizeOf(new Long(1)) +
   reflectionSizeOf.sizeOf(new Double(2.0));
 
+this.sizeOfElement = reflectionSizeOf.sizeOf(new Element(new Object(), new 
Object()));
+
 //SizeOfMapEntryOverhead = SizeOfMapWithOneEntry - (SizeOfEmptyMap + 
SizeOfOneEntry)
 TreeMap map = new TreeMap<>();
 long emptyMapSize = reflectionSizeOf.sizeOf(map);
@@ -112,4 +118,20 @@ public abstract class TimelineMetricsEhCacheSizeOfEngine 
implements SizeOfEngine
 }
 return size;
   }
+
+  // Get size of the Cache entry for final size calculation
+  protected abstract long getSizeOfEntry(Object key, Object value);
+
+  @Override
+  public Size sizeOf(Object key, Object value, Object container) {
+return new Size(sizeOfElement + getSizeOfEntry(key, value), false);
+  }
+
+  @Override
+  public SizeOfEngine copyWith(int maxDepth, boolean 
abortWhenMaxDepthExceeded) {
+LOG.debug("Copying tracing sizeof engine, maxdepth: {}, abort: {}", 
maxDepth, abortWhenMaxDepthExceeded);
+
+return underlying.copyWith(maxDepth, abortWhenMaxDepthExceeded);
+  }
+
 }
diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/source/cache/InternalMetricsCacheSizeOfEngine.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/source/cache/InternalMetricsCacheSizeOfEngine.java
index 071dcd4..e36c981 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/source/cache/InternalMetricsCacheSizeOfEngine.java
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/source/cache/InternalMetricsCacheSizeOfEngine.java
@@ -20,48 +20,33 @@ package 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline
 import 
org.apache.hadoop.metrics2.sink.timeline.cache.TimelineMetricsEhCacheSizeOfEngine;
 import org.slf4j.Logger;
 import 

[ambari] 21/36: AMBARI-22215 Refine cluster second aggregator by aligning sink publish times to 1 minute boundaries. (dsen)

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

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

commit 5defd04d61d72874934183a40a3fe210c64dbbd3
Author: Dmytro Sen 
AuthorDate: Thu Oct 12 12:49:22 2017 +0300

AMBARI-22215 Refine cluster second aggregator by aligning sink publish 
times to 1 minute boundaries. (dsen)
---
 .../sink/timeline/AbstractTimelineMetricsSink.java |  95 +++-
 .../metrics2/sink/timeline/TimelineMetric.java |   3 +
 .../timeline/AbstractTimelineMetricSinkTest.java   | 240 +
 .../AbstractTimelineMetricSinkTest.java| 113 --
 .../sink/timeline/HadoopTimelineMetricsSink.java   |   2 +-
 .../timeline/HadoopTimelineMetricsSinkTest.java|   4 +-
 .../src/main/python/core/application_metric_map.py |  52 -
 .../test/python/core/TestApplicationMetricMap.py   |  38 +++-
 .../timeline/TimelineMetricConfiguration.java  |   3 -
 .../timeline/TimelineMetricsIgniteCache.java   |  14 +-
 .../timeline/aggregators/AggregatorUtils.java  |   2 +-
 .../TimelineMetricAggregatorFactory.java   |   7 +-
 ...tricClusterAggregatorSecondWithCacheSource.java |  38 +---
 .../timeline/TimelineMetricsIgniteCacheTest.java   |  56 -
 ...ClusterAggregatorSecondWithCacheSourceTest.java |  65 +-
 15 files changed, 437 insertions(+), 295 deletions(-)

diff --git 
a/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/AbstractTimelineMetricsSink.java
 
b/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/AbstractTimelineMetricsSink.java
index 3c06032..739e9dc 100644
--- 
a/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/AbstractTimelineMetricsSink.java
+++ 
b/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/AbstractTimelineMetricsSink.java
@@ -19,6 +19,8 @@ package org.apache.hadoop.metrics2.sink.timeline;
 
 import com.google.common.base.Supplier;
 import com.google.common.base.Suppliers;
+import com.google.common.cache.Cache;
+import com.google.common.cache.CacheBuilder;
 import com.google.common.reflect.TypeToken;
 import com.google.gson.Gson;
 import com.google.gson.JsonSyntaxException;
@@ -58,6 +60,7 @@ import java.util.List;
 import java.util.Random;
 import java.util.Set;
 import java.util.SortedSet;
+import java.util.TreeMap;
 import java.util.TreeSet;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -130,6 +133,13 @@ public abstract class AbstractTimelineMetricsSink {
   private static final int COLLECTOR_HOST_CACHE_MAX_EXPIRATION_MINUTES = 75;
   private static final int COLLECTOR_HOST_CACHE_MIN_EXPIRATION_MINUTES = 60;
 
+  //10 seconds
+  protected int collectionPeriodMillis = 1;
+
+  private int cacheExpireTimeMinutesDefault = 10;
+
+  private volatile Cache metricsPostCache = 
CacheBuilder.newBuilder().expireAfterAccess(cacheExpireTimeMinutesDefault, 
TimeUnit.MINUTES).build();
+
   static {
 mapper = new ObjectMapper();
 AnnotationIntrospector introspector = new JaxbAnnotationIntrospector();
@@ -289,7 +299,21 @@ public abstract class AbstractTimelineMetricsSink {
 return collectorHost;
   }
 
+  /**
+   * @param metrics metrics to post, metric values will be aligned by minute 
mark,
+   *last uncompleted minute will be cached to post in future 
iteration
+   */
   protected boolean emitMetrics(TimelineMetrics metrics) {
+return emitMetrics(metrics, false);
+  }
+
+  /**
+   * @param metrics metrics to post, if postAllCachedMetrics is false metric 
values will be aligned by minute mark,
+   *last uncompleted minute will be cached to post in future 
iteration
+   * @param postAllCachedMetrics if set to true all cached metrics will be 
posted, ignoring the minute aligning
+   * @return
+   */
+  protected boolean emitMetrics(TimelineMetrics metrics, boolean 
postAllCachedMetrics) {
 String connectUrl;
 boolean validCollectorHost = true;
 
@@ -307,11 +331,20 @@ public abstract class AbstractTimelineMetricsSink {
   connectUrl = getCollectorUri(collectorHost);
 }
 
+TimelineMetrics metricsToEmit = alignMetricsByMinuteMark(metrics);
+
+if (postAllCachedMetrics) {
+  for (TimelineMetric timelineMetric : metricsPostCache.asMap().values()) {
+metricsToEmit.addOrMergeTimelineMetric(timelineMetric);
+  }
+  metricsPostCache.invalidateAll();
+}
+
 if (validCollectorHost) {
   String jsonData = null;
   LOG.debug("EmitMetrics connectUrl = "  + connectUrl);
   try {
-jsonData = mapper.writeValueAsString(metrics);
+jsonData = mapper.writeValueAsString(metricsToEmit);
   } catch (IOException e) {
 LOG.error("Unable to parse metrics", e);
   }
@@ 

[ambari] 29/36: AMBARI-22470 : Refine Metric Definition Service and AD Query service. (avijayan)

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

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

commit f54a7f3dcc65bcad7b5321fffcef04f4d5a94268
Author: Aravindan Vijayan 
AuthorDate: Mon Nov 20 10:46:13 2017 -0800

AMBARI-22470 : Refine Metric Definition Service and AD Query service. 
(avijayan)
---
 .../pom.xml|  63 +++--
 .../src/main/resources/config.yml  |   2 +-
 .../src/main/resources/hbase-site.xml  | 286 +
 .../adservice/app/ADServiceScalaModule.scala   |  50 
 .../adservice/app/AnomalyDetectionApp.scala|  10 +-
 .../adservice/app/AnomalyDetectionAppConfig.scala  |   4 +-
 .../adservice/app/AnomalyDetectionAppModule.scala  |   5 +-
 .../configuration/HBaseConfiguration.scala |   3 +
 .../AdAnomalyStoreAccessor.scala}  |  19 +-
 .../adservice/db/AdMetadataStoreAccessorImpl.scala |  96 +++
 .../metrics/adservice/db/ConnectionProvider.scala  |  45 
 .../adservice/db/DefaultPhoenixDataSource.scala|  79 ++
 .../adservice/db/LevelDbStoreAccessor.scala|  56 
 .../metrics/adservice/db/MetadataDatasource.scala  |   6 +
 .../adservice/db/PhoenixAnomalyStoreAccessor.scala |  75 --
 .../adservice/db/PhoenixConnectionProvider.scala   |  66 +
 .../adservice/db/PhoenixQueryConstants.scala   |  12 +-
 .../adservice/leveldb/LevelDBDatasource.scala  |  17 +-
 .../adservice/metadata/ADMetadataProvider.scala|  86 ---
 .../metadata/InputMetricDefinitionParser.scala |  24 +-
 .../adservice/metadata/MetricDefinition.scala  |   2 +
 .../metadata/MetricDefinitionService.scala |  16 +-
 .../metadata/MetricDefinitionServiceImpl.scala |  73 --
 .../metrics/adservice/metadata/MetricKey.scala |   3 +
 .../metadata/MetricMetadataProvider.scala  |   2 +-
 ...yInstance.scala => MetricAnomalyInstance.scala} |   7 +-
 .../adservice/resource/AnomalyResource.scala   |  55 +++-
 .../resource/MetricDefinitionResource.scala|  77 +-
 .../metrics/adservice/resource/RootResource.scala  |   5 +-
 .../metrics/adservice/service/ADQueryService.scala |   6 +-
 .../adservice/service/ADQueryServiceImpl.scala |  25 +-
 .../adservice/service/AbstractADService.scala  |  44 
 .../pointintime/PointInTimeAnomalyInstance.scala   |   4 +-
 .../subsystem/trend/TrendAnomalyInstance.scala |   4 +-
 .../adservice/app/DefaultADResourceSpecTest.scala  |   5 +-
 .../metadata/AMSMetadataProviderTest.scala |  16 +-
 .../metadata/MetricSourceDefinitionTest.scala  |  16 +-
 ambari-metrics/ambari-metrics-common/pom.xml   |  45 
 .../metrics2/sink/timeline/TimelineMetricKey.java  |  59 -
 .../timeline/HBaseTimelineMetricsService.java  |  36 ++-
 .../metrics/timeline/PhoenixHBaseAccessor.java |  26 +-
 .../metrics/timeline/TimelineMetricStore.java  |   3 +-
 .../timeline/query/ConnectionProvider.java |   3 +-
 .../timeline/query/DefaultPhoenixDataSource.java   |  18 +-
 .../timeline/query/PhoenixConnectionProvider.java  |   2 +-
 .../webapp/TimelineWebServices.java|  12 +-
 .../TestApplicationHistoryServer.java  |   2 +-
 .../timeline/AbstractMiniHBaseClusterTest.java |  13 +-
 .../metrics/timeline/PhoenixHBaseAccessorTest.java |  11 +-
 .../metrics/timeline/TestTimelineMetricStore.java  |   3 +-
 50 files changed, 1223 insertions(+), 374 deletions(-)

diff --git a/ambari-metrics/ambari-metrics-anomaly-detection-service/pom.xml 
b/ambari-metrics/ambari-metrics-anomaly-detection-service/pom.xml
index 142f02f..c6927dd 100644
--- a/ambari-metrics/ambari-metrics-anomaly-detection-service/pom.xml
+++ b/ambari-metrics/ambari-metrics-anomaly-detection-service/pom.xml
@@ -34,10 +34,12 @@
   
 2.12.3
 2.11
-2.7.3.2.6.0.3-8
 2.9.1
 1.2.0
 2.2.0
+2.7.3.2.6.0.3-8
+1.1.2.2.6.0.3-8
+4.7.0.2.6.0.3-8
   
   
   
@@ -64,6 +66,7 @@
 src/main/resources
 
   **/*.yml
+  **/*.xml
   **/*.txt
 
   
@@ -145,6 +148,28 @@
 META-INF/*.RSA
   
 
+
+  org.apache.phoenix:phoenix-core
+  
+org/joda/time/**
+com/codahale/metrics/**
+com/google/common/collect/**
+  
+
+
+  org.apache.phoenix:phoenix-core
+  
+org/joda/time/**
+com/codahale/metrics/**
+com/google/common/collect/**
+  
+
+
+  *:*
+  
+com/sun/jersey/**
+  
+
   
 
 
@@ -245,33 +270,25 @@
 
 
   org.apache.phoenix
-  phoenix-spark
-  

[ambari] 03/36: AMBARI-21106 : Ambari Metrics Anomaly detection prototype (Commit 2). (avijayan)

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

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

commit 24a7b39b14c46b6825d597f86999a615ffa14a88
Author: Aravindan Vijayan 
AuthorDate: Tue May 30 13:17:28 2017 -0700

AMBARI-21106 : Ambari Metrics Anomaly detection prototype (Commit 2). 
(avijayan)
---
 ambari-metrics/ambari-metrics-alertservice/pom.xml | 4 ++--
 ambari-metrics/ambari-metrics-spark/pom.xml| 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/ambari-metrics/ambari-metrics-alertservice/pom.xml 
b/ambari-metrics/ambari-metrics-alertservice/pom.xml
index 3a3545b..10f920a 100644
--- a/ambari-metrics/ambari-metrics-alertservice/pom.xml
+++ b/ambari-metrics/ambari-metrics-alertservice/pom.xml
@@ -5,11 +5,11 @@
 
 ambari-metrics
 org.apache.ambari
-2.5.1.0.0
+2.0.0.0-SNAPSHOT
 
 4.0.0
 ambari-metrics-alertservice
-2.5.1.0.0
+2.0.0.0-SNAPSHOT
 
 
 
diff --git a/ambari-metrics/ambari-metrics-spark/pom.xml 
b/ambari-metrics/ambari-metrics-spark/pom.xml
index 33b4257..f1c8a13 100644
--- a/ambari-metrics/ambari-metrics-spark/pom.xml
+++ b/ambari-metrics/ambari-metrics-spark/pom.xml
@@ -3,11 +3,11 @@
 
 ambari-metrics
 org.apache.ambari
-2.5.1.0.0
+2.0.0.0-SNAPSHOT
 
 4.0.0
 ambari-metrics-spark
-2.5.1.0.0
+2.0.0.0-SNAPSHOT
 
 2.10.4
 

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


[ambari] 05/36: AMBARI-21079. Add ability to sink Raw metrics to external system via Http. Renamed files to fix build. (swagle)

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

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

commit f4d07091f1c20603036ce49494d9f171dd91b9a5
Author: Siddharth Wagle 
AuthorDate: Tue May 30 16:45:27 2017 -0700

AMBARI-21079. Add ability to sink Raw metrics to external system via Http. 
Renamed files to fix build. (swagle)
---
 ...eTimelineMetricStoreTest.java => HBaseTimelineMetricsServiceTest.java} | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStoreTest.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricsServiceTest.java
similarity index 100%
rename from 
ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStoreTest.java
rename to 
ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricsServiceTest.java

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


[ambari] 17/36: Fixed rat errors from Merge trunk into branch-3.0-ams

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

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

commit 5559b5815fbb2662f1ee9f9a79dc2701377b98d1
Author: Siddharth Wagle 
AuthorDate: Tue Sep 26 16:03:17 2017 -0700

Fixed rat errors from Merge trunk into branch-3.0-ams
---
 .../src/main/resources/input-config.properties | 18 ++
 1 file changed, 18 insertions(+)

diff --git 
a/ambari-metrics/ambari-metrics-alertservice/src/main/resources/input-config.properties
 
b/ambari-metrics/ambari-metrics-alertservice/src/main/resources/input-config.properties
index 88304c7..ab106c4 100644
--- 
a/ambari-metrics/ambari-metrics-alertservice/src/main/resources/input-config.properties
+++ 
b/ambari-metrics/ambari-metrics-alertservice/src/main/resources/input-config.properties
@@ -1,3 +1,21 @@
+# Copyright 2011 The Apache Software Foundation
+#
+# 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.
+
 appIds=HOST
 
 collectorHost=localhost

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


[ambari] 35/36: Fix AMS phoenix, hbase and hadoop versions in pom.xml

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

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

commit dadebdbcd0b1f6a252d61159da4750bdec6a3323
Author: Aravindan Vijayan 
AuthorDate: Tue Feb 27 11:52:24 2018 -0800

Fix AMS phoenix, hbase and hadoop versions in pom.xml
---
 ambari-metrics/ambari-metrics-timelineservice/pom.xml |  6 +++---
 ambari-metrics/pom.xml| 14 +++---
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/ambari-metrics/ambari-metrics-timelineservice/pom.xml 
b/ambari-metrics/ambari-metrics-timelineservice/pom.xml
index d06c0ea..6a6dc3e 100644
--- a/ambari-metrics/ambari-metrics-timelineservice/pom.xml
+++ b/ambari-metrics/ambari-metrics-timelineservice/pom.xml
@@ -34,9 +34,9 @@
 
 
 2.5.0
-3.0.0.3.0.0.0-623
-5.0.0.3.0.0.0-623
-2.0.0.3.0.0.0-623
+3.0.0.3.0.0.2-97
+5.0.0.3.0.0.2-97
+2.0.0.3.0.0.2-97
   
 
   
diff --git a/ambari-metrics/pom.xml b/ambari-metrics/pom.xml
index d52f93d..32f7ab2 100644
--- a/ambari-metrics/pom.xml
+++ b/ambari-metrics/pom.xml
@@ -40,14 +40,14 @@
 python = 2.6
 python (= 2.6)
 
-
http://dev.hortonworks.com.s3.amazonaws.com/HDP/centos7/3.x/BUILDS/3.0.0.0-623/tars/hbase/hbase-2.0.0.3.0.0.0-623-bin.tar.gz
-hbase-2.0.0.3.0.0.0-623
-
http://dev.hortonworks.com.s3.amazonaws.com/HDP/centos7/3.x/BUILDS/3.0.0.0-623/tars/hadoop/hadoop-3.0.0.3.0.0.0-623.tar.gz
-hadoop-3.0.0.3.0.0.0-623
+
http://dev.hortonworks.com.s3.amazonaws.com/HDP/centos7/3.x/BUILDS/3.0.0.2-97/tars/hbase/hbase-2.0.0.3.0.0.2-97-bin.tar.gz
+hbase-2.0.0.3.0.0.2-97
+
http://dev.hortonworks.com.s3.amazonaws.com/HDP/centos7/3.x/BUILDS/3.0.0.2-97/tars/hadoop/hadoop-3.0.0.3.0.0.2-97.tar.gz
+hadoop-3.0.0.3.0.0.2-97
 grafana-2.6.0
 
https://grafanarel.s3.amazonaws.com/builds/grafana-2.6.0.linux-x64.tar.gz
-
http://dev.hortonworks.com.s3.amazonaws.com/HDP/centos7/3.x/BUILDS/3.0.0.0-623/tars/phoenix/phoenix-5.0.0.3.0.0.0-623.tar.gz
-phoenix-5.0.0.3.0.0.0-623
+
http://dev.hortonworks.com.s3.amazonaws.com/HDP/centos7/3.x/BUILDS/3.0.0.2-97/tars/phoenix/phoenix-5.0.0.3.0.0.2-97.tar.gz
+phoenix-5.0.0.3.0.0.2-97
 
/usr/lib/python2.6/site-packages/resource_monitoring
 1.6.2
 apache.snapshots.https
@@ -73,7 +73,7 @@
 
   apache-hadoop
   hdp
-  http://repo.hortonworks.com/content/groups/public/
+  
http://nexus-private.hortonworks.com/nexus/content/groups/public
 
 
   apache-snapshots

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


[ambari] branch branch-feature-AMBARI-23212 updated (55ae952 -> a4eca61)

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

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


from 55ae952  [AMBARI-23185] Added a new CLI option in the setup-ldap tool 
to indicate whether to force LDAP auth method even if another one - or none at 
all - is already configured (#615)
 new 7ca4a70  AMBARI-21079. Add ability to sink Raw metrics to external 
system via Http. (swagle)
 new 12294fd  AMBARI-21106 : Ambari Metrics Anomaly detection 
prototype.(avijayan)
 new 24a7b39  AMBARI-21106 : Ambari Metrics Anomaly detection prototype 
(Commit 2). (avijayan)
 new 7c9e1f7  AMBARI-21106 : Ambari Metrics Anomaly detection prototype 
(Commit 3). (avijayan)
 new f4d0709  AMBARI-21079. Add ability to sink Raw metrics to external 
system via Http. Renamed files to fix build. (swagle)
 new 07cac0e  Fixing rat check failures and compilation issues. (avijayan)
 new b81c38d  AMBARI-21079. Add ability to sink Raw metrics to external 
system via Http. Compilation error fix. (swagle)
 new 888296c  AMBARI-21214 : Use a uuid vs long row key for metrics in AMS 
schema. (avijayan)
 new 7e0e520  AMBARI-21244 Add https support to local metrics aggregator 
application (dsen)
 new c8f371e  AMBARI-17382 : Migrate AMS queries to use ROW_TIMESTAMP 
instead of native timerange hint. (avijayan)
 new 35eb7de  AMBARI-21279 Handle scenario when host in-memory aggregation 
is not working (dsen)
 new a1c9713  AMBARI-21458 Provide ability to shard Cluster second 
aggregation across appId. (dsen)
 new 9d426a1  AMBARI-21686 : Implement a test driver that provides a set of 
metric series with different kinds of metric behavior. (avijayan)
 new 759ff82  AMBARI-21106 : ML-Prototype: Detect timeseries anomaly for a 
metric. (Refine PIT & Trend subsystems, Integrate with AMS, Ambari Alerts.)
 new b02701b  Fixed compile errors from Merge trunk into branch-3.0-ams
 new 1a3ad8a  Fixed compile errors from Merge trunk into branch-3.0-ams
 new 5559b58  Fixed rat errors from Merge trunk into branch-3.0-ams
 new d064c38  AMBARI-22077 : Create maven module and package structure for 
the anomaly detection engine. (avijayan)
 new 67fff4e  AMBARI-22077 : Create maven module and package structure for 
the anomaly detection engine. (Commit 2) (avijayan)
 new af79c69  AMBARI-22163 : Anomaly Storage: Design Metric anomalies 
schema. (avijayan)
 new 5defd04  AMBARI-22215 Refine cluster second aggregator by aligning 
sink publish times to 1 minute boundaries. (dsen)
 new 8052d96  AMBARI-22192. Setup an application server for hosting the AD 
System Manager.
 new 2a790bc  AMBARI-22192. Setup an application server for hosting the AD 
System Manager. (avijayan)
 new 74fd517  AMBARI-22343. Add ability in AMS to tee metrics to a set of 
configured Kafka brokers. (swagle)
 new f45aeed  AMBARI-22348 : Metric Definition Service V1 Implementation. 
(avijayan)
 new d865b6e  AMBARI-22359 : Fix Serialization issues in Metric Definition 
Service (avijayan).
 new af6c91b  AMBARI-22365. Add storage support for storing metric 
definitions using LevelDB. (swagle)
 new a2aec07  AMBARI-22437 : Create an 'AD Manager' component in Ambari 
Metrics Service stack side. (avijayan)
 new f54a7f3  AMBARI-22470 : Refine Metric Definition Service and AD Query 
service. (avijayan)
 new f57c47d  AMBARI-22567 : Integrate Spark lifecycle management into AMS 
AD Manager. (avijayan)
 new d97f46a  AMBARI-22688. Fix AMS compilation issues and unit test with 
hbase,hadoop and phoenix upgraded. (swagle)
 new aa26d39  AMBARI-22717 : Remove Anomaly Detection code from 
branch-3.0-ams. (avijayan)
 new 3a05494  AMBARI-22744. Fix issues with webapp deployment with new 
Hadoop common changes. (swagle)
 new 575fd37  AMBARI-22744. Fix issues with webapp deployment with new 
Hadoop common changes. Addendum. (swagle)
 new dadebdb  Fix AMS phoenix, hbase and hadoop versions in pom.xml
 new a4eca61  AMBARI-23100 : Merge branch-3.0-ams onto trunk. (Remove 
logsearch-it pom change)

The 36 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:
 .../logfeeder/metrics/LogFeederAMSClient.java  |5 +
 ambari-metrics/ambari-metrics-assembly/pom.xml |2 +-
 ambari-metrics/ambari-metrics-common/pom.xml   |   42 +-
 .../sink/timeline/AbstractTimelineMetricsSink.java |  108 +-
 .../sink/timeline/SingleValuedTimelineMetric.java  |   22 +-
 .../metrics2/sink/timeline/TimelineMetric.java |   34 +-
 .../sink/timeline/TimelineMetricMetadata.java  |   37 +-
 .../metrics2/sink/timeline/TimelineMetrics.java|   11 +-
 .../availability/MetricCollectorHAHelper.java  |

[ambari] 15/36: Fixed compile errors from Merge trunk into branch-3.0-ams

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

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

commit b02701b093bf279e2e19f7f9102df6b06594d860
Author: Siddharth Wagle 
AuthorDate: Tue Sep 26 15:30:09 2017 -0700

Fixed compile errors from Merge trunk into branch-3.0-ams
---
 .../ambari/server/controller/metrics/timeline/MetricsRequestHelper.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/MetricsRequestHelper.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/MetricsRequestHelper.java
index d7fbe31..ce0fe6d 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/MetricsRequestHelper.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/MetricsRequestHelper.java
@@ -87,7 +87,7 @@ public class MetricsRequestHelper {
   uriBuilder.setParameter("precision", higherPrecision);
   String newSpec = uriBuilder.toString();
   connection = streamProvider.processURL(newSpec, HttpMethod.GET, 
(String) null,
-Collections.emptyMap());
+Collections.emptyMap());
   if (!checkConnectionForPrecisionException(connection)) {
 throw new IOException("Encountered Precision exception : Higher 
precision request also failed.");
   }

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


[ambari] 23/36: AMBARI-22192. Setup an application server for hosting the AD System Manager. (avijayan)

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

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

commit 2a790bc4cd4774b78c723faf7123283f433e3f2a
Author: Aravindan Vijayan 
AuthorDate: Wed Oct 18 10:16:28 2017 -0700

AMBARI-22192. Setup an application server for hosting the AD System 
Manager. (avijayan)
---
 .../pom.xml| 52 +-
 .../prototype/core/AmbariServerInterface.java  | 34 +++---
 .../adservice/app/AnomalyDetectionApp.scala|  2 +
 .../timeline/AbstractMiniHBaseClusterTest.java | 13 ++
 .../metrics/timeline/PhoenixHBaseAccessorTest.java | 13 +-
 5 files changed, 94 insertions(+), 20 deletions(-)

diff --git a/ambari-metrics/ambari-metrics-anomaly-detection-service/pom.xml 
b/ambari-metrics/ambari-metrics-anomaly-detection-service/pom.xml
index c9bb7b7..554d026 100644
--- a/ambari-metrics/ambari-metrics-anomaly-detection-service/pom.xml
+++ b/ambari-metrics/ambari-metrics-anomaly-detection-service/pom.xml
@@ -35,7 +35,7 @@
 2.12.3
 2.11
 2.7.3.2.6.0.3-8
-2.8.9
+2.9.1
 1.2.0
 2.2.0
   
@@ -223,6 +223,11 @@
   0.10.1.0
 
 
+  com.fasterxml.jackson.core
+  jackson-databind
+  ${jackson.version}
+
+
   org.apache.kafka
   connect-json
   0.10.1.0
@@ -236,6 +241,28 @@
   org.apache.phoenix
   phoenix-spark
   4.10.0-HBase-1.1
+  
+
+  jersey-server
+  com.sun.jersey
+
+
+  jersey-core
+  com.sun.jersey
+
+
+  jersey-client
+  com.sun.jersey
+
+
+  jersey-guice
+  com.sun.jersey.contribs
+
+
+  jersey-json
+  com.sun.jersey
+
+  
 
 
   org.apache.ambari
@@ -257,6 +284,12 @@
   spark-core_${scala.binary.version}
   ${spark.version}
   provided
+  
+
+  com.fasterxml.jackson.module
+  jackson-module-scala_2.11
+
+  
 
 
   org.apache.spark
@@ -286,6 +319,18 @@
   org.mortbay.jetty
   jsp-2.1-jetty
 
+
+  jersey-server
+  com.sun.jersey
+
+
+  jersey-core
+  com.sun.jersey
+
+
+  jersey-json
+  com.sun.jersey
+
   
 
 
@@ -385,5 +430,10 @@
   21.0
   test
 
+
+  io.dropwizard.metrics
+  metrics-core
+  3.2.5
+
   
 
\ No newline at end of file
diff --git 
a/ambari-metrics/ambari-metrics-anomaly-detection-service/src/main/java/org/apache/ambari/metrics/adservice/prototype/core/AmbariServerInterface.java
 
b/ambari-metrics/ambari-metrics-anomaly-detection-service/src/main/java/org/apache/ambari/metrics/adservice/prototype/core/AmbariServerInterface.java
index 920d758..ac50c54 100644
--- 
a/ambari-metrics/ambari-metrics-anomaly-detection-service/src/main/java/org/apache/ambari/metrics/adservice/prototype/core/AmbariServerInterface.java
+++ 
b/ambari-metrics/ambari-metrics-anomaly-detection-service/src/main/java/org/apache/ambari/metrics/adservice/prototype/core/AmbariServerInterface.java
@@ -20,8 +20,6 @@ package org.apache.ambari.metrics.adservice.prototype.core;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.codehaus.jettison.json.JSONArray;
-import org.codehaus.jettison.json.JSONObject;
 
 import java.io.BufferedReader;
 import java.io.IOException;
@@ -72,22 +70,22 @@ public class AmbariServerInterface implements Serializable{
 responseJsonSb.append(line);
   }
 
-  JSONObject jsonObject = new JSONObject(responseJsonSb.toString());
-  JSONArray array = jsonObject.getJSONArray("items");
-  for(int i = 0 ; i < array.length() ; i++){
-JSONObject alertDefn = 
array.getJSONObject(i).getJSONObject("AlertDefinition");
-if (alertDefn.get("name") != null && 
alertDefn.get("name").equals("point_in_time_metrics_anomalies")) {
-  JSONObject sourceNode = alertDefn.getJSONObject("source");
-  JSONArray params = sourceNode.getJSONArray("parameters");
-  for(int j = 0 ; j < params.length() ; j++){
-JSONObject param = params.getJSONObject(j);
-if (param.get("name").equals("sensitivity")) {
-  return param.getInt("value");
-}
-  }
-  break;
-}
-  }
+//  JSONObject jsonObject = new JSONObject(responseJsonSb.toString());
+//  JSONArray array = jsonObject.getJSONArray("items");
+//  for(int i = 0 ; i < array.length() ; i++){
+//JSONObject alertDefn = 
array.getJSONObject(i).getJSONObject("AlertDefinition");
+//if (alertDefn.get("name") != null && 
alertDefn.get("name").equals("point_in_time_metrics_anomalies")) {

[ambari] 04/36: AMBARI-21106 : Ambari Metrics Anomaly detection prototype (Commit 3). (avijayan)

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

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

commit 7c9e1f7627aed4f29f7f9b6cab8cfd6151b382dc
Author: Aravindan Vijayan 
AuthorDate: Tue May 30 13:35:54 2017 -0700

AMBARI-21106 : Ambari Metrics Anomaly detection prototype (Commit 3). 
(avijayan)
---
 .../metrics/alertservice/R/RFunctionInvoker.java   | 15 ++--
 .../src/main/resources/R-scripts/ema.R | 79 ++
 .../src/main/resources/R-scripts/hsdev.r   | 60 
 .../src/main/resources/R-scripts/iforest.R | 35 ++
 .../src/main/resources/R-scripts/kstest.r  | 21 ++
 .../src/main/resources/R-scripts/test.R| 67 ++
 .../src/main/resources/R-scripts/tukeys.r  | 26 +++
 .../src/main/resources/R-scripts/util.R| 19 ++
 8 files changed, 312 insertions(+), 10 deletions(-)

diff --git 
a/ambari-metrics/ambari-metrics-alertservice/src/main/java/org/apache/ambari/metrics/alertservice/R/RFunctionInvoker.java
 
b/ambari-metrics/ambari-metrics-alertservice/src/main/java/org/apache/ambari/metrics/alertservice/R/RFunctionInvoker.java
index 8d1e520..71ad66d 100644
--- 
a/ambari-metrics/ambari-metrics-alertservice/src/main/java/org/apache/ambari/metrics/alertservice/R/RFunctionInvoker.java
+++ 
b/ambari-metrics/ambari-metrics-alertservice/src/main/java/org/apache/ambari/metrics/alertservice/R/RFunctionInvoker.java
@@ -31,8 +31,7 @@ public class RFunctionInvoker {
 
 public static ResultSet tukeys(DataSet trainData, DataSet testData, 
Map configs) {
 try {
-r.eval("library(ambarimetricsAD)");
-
r.eval("source('~/dev/AMS/AD/ambarimetricsAD/org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.alerting.R/tukeys.org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.alerting.R',
 echo=TRUE)");
+r.eval("source('tukeys.r', echo=TRUE)");
 
 int n = Integer.parseInt(configs.get("tukeys.n"));
 r.eval("n <- " + n);
@@ -57,8 +56,7 @@ public class RFunctionInvoker {
 
 public static ResultSet ema_global(DataSet trainData, DataSet testData, 
Map configs) {
 try {
-r.eval("library(ambarimetricsAD)");
-
r.eval("source('~/dev/AMS/AD/ambarimetricsAD/org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.alerting.R/ema.org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.alerting.R',
 echo=TRUE)");
+r.eval("source('ema.R', echo=TRUE)");
 
 int n = Integer.parseInt(configs.get("ema.n"));
 r.eval("n <- " + n);
@@ -87,8 +85,7 @@ public class RFunctionInvoker {
 
 public static ResultSet ema_daily(DataSet trainData, DataSet testData, 
Map configs) {
 try {
-r.eval("library(ambarimetricsAD)");
-
r.eval("source('~/dev/AMS/AD/ambarimetricsAD/org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.alerting.R/ema.org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.alerting.R',
 echo=TRUE)");
+r.eval("source('ema.R', echo=TRUE)");
 
 int n = Integer.parseInt(configs.get("ema.n"));
 r.eval("n <- " + n);
@@ -117,8 +114,7 @@ public class RFunctionInvoker {
 
 public static ResultSet ksTest(DataSet trainData, DataSet testData, 
Map configs) {
 try {
-r.eval("library(ambarimetricsAD)");
-
r.eval("source('~/dev/AMS/AD/ambarimetricsAD/org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.alerting.R/kstest.org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.alerting.R',
 echo=TRUE)");
+r.eval("source('kstest.r', echo=TRUE)");
 
 double p_value = Double.parseDouble(configs.get("ks.p_value"));
 r.eval("p_value <- " + p_value);
@@ -144,8 +140,7 @@ public class RFunctionInvoker {
 
 public static ResultSet hsdev(DataSet trainData, DataSet testData, 
Map configs) {
 try {
-r.eval("library(ambarimetricsAD)");
-
r.eval("source('~/dev/AMS/AD/ambarimetricsAD/org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.alerting.R/hsdev.org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.alerting.R',
 echo=TRUE)");
+r.eval("source('hsdev.r', echo=TRUE)");
 
 int n = Integer.parseInt(configs.get("hsdev.n"));
 r.eval("n <- " + n);
diff --git 
a/ambari-metrics/ambari-metrics-alertservice/src/main/resources/R-scripts/ema.R 
b/ambari-metrics/ambari-metrics-alertservice/src/main/resources/R-scripts/ema.R
new file mode 100644
index 000..d3188f0
--- /dev/null
+++ 
b/ambari-metrics/ambari-metrics-alertservice/src/main/resources/R-scripts/ema.R
@@ -0,0 +1,79 @@
+# EMA <- w * EMA + (1 - w) * x

[ambari] branch trunk updated: [AMBARI-23185] Added a new CLI option in the setup-ldap tool to indicate whether to force LDAP auth method even if another one - or none at all - is already configured (

2018-03-12 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 55ae952  [AMBARI-23185] Added a new CLI option in the setup-ldap tool 
to indicate whether to force LDAP auth method even if another one - or none at 
all - is already configured (#615)
55ae952 is described below

commit 55ae952958c9cd7bc526f2e0d5fa859a667dc8f2
Author: smolnar82 <34065904+smolna...@users.noreply.github.com>
AuthorDate: Mon Mar 12 19:42:26 2018 +0100

[AMBARI-23185] Added a new CLI option in the setup-ldap tool to indicate 
whether to force LDAP auth method even if another one - or none at all - is 
already configured (#615)

* AMBARI-23185. Enabled TestAmbariServer and fixed errors

* AMBARI-23185. Added a new CLI option in the setup-ldap tool to indicate 
wheter to force LDAP ayth method even if another one - or none at all - is 
already configured

* AMBARI-23185. Using better option name for LDAP setup enforcment and make 
it boolean

* AMBARI-23185. In case there is not authentication method is configured we 
default the setup question to 'y'

* AMBARI-23185. Code cleaning
---
 ambari-server/src/main/python/ambari-server.py |  1 +
 .../src/main/python/ambari_server/setupSecurity.py | 20 ---
 ambari-server/src/test/python/TestAmbariServer.py  | 61 +-
 3 files changed, 72 insertions(+), 10 deletions(-)

diff --git a/ambari-server/src/main/python/ambari-server.py 
b/ambari-server/src/main/python/ambari-server.py
index 57ad80e..fe11bf4 100755
--- a/ambari-server/src/main/python/ambari-server.py
+++ b/ambari-server/src/main/python/ambari-server.py
@@ -567,6 +567,7 @@ def init_ldap_setup_parser_options(parser):
   parser.add_option('--ldap-sync-username-collisions-behavior', default=None, 
help="Handling behavior for username collisions [convert/skip] for LDAP sync", 
dest="ldap_sync_username_collisions_behavior")
   parser.add_option('--ldap-force-lowercase-usernames', default=None, 
help="Declares whether to force the ldap user name to be lowercase or leave 
as-is", dest="ldap_force_lowercase_usernames")
   parser.add_option('--ldap-pagination-enabled', default=None, 
help="Determines whether results from LDAP are paginated when requested", 
dest="ldap_pagination_enabled")
+  parser.add_option('--ldap-force-setup', action="store_true", default=False, 
help="Forces the use of LDAP even if other (i.e. PAM) authentication method is 
configured already or if there is no authentication method configured at all", 
dest="ldap_force_setup")
   parser.add_option('--ambari-admin-username', default=None, help="Ambari 
Admin username for LDAP setup", dest="ambari_admin_username")
   parser.add_option('--ambari-admin-password', default=None, help="Ambari 
Admin password for LDAP setup", dest="ambari_admin_password")
 
diff --git a/ambari-server/src/main/python/ambari_server/setupSecurity.py 
b/ambari-server/src/main/python/ambari_server/setupSecurity.py
index bb21100..f30915b 100644
--- a/ambari-server/src/main/python/ambari_server/setupSecurity.py
+++ b/ambari-server/src/main/python/ambari_server/setupSecurity.py
@@ -84,6 +84,7 @@ LDAP_MGR_USERNAME_PROPERTY = 
"ambari.ldap.connectivity.bind_dn"
 LDAP_MGR_PASSWORD_FILENAME = "ldap-password.dat"
 LDAP_ANONYMOUS_BIND="ambari.ldap.connectivity.anonymous_bind"
 LDAP_USE_SSL="ambari.ldap.connectivity.use_ssl"
+NO_AUTH_METHOD_CONFIGURED = "no auth method"
 
 def read_master_key(isReset=False, options = None):
   passwordPattern = ".*"
@@ -716,14 +717,17 @@ def setup_ldap(options):
 err = 'Ambari Server is not running.'
 raise FatalException(1, err)
 
-  current_client_security = 
get_value_from_properties(properties,CLIENT_SECURITY,"no auth method")
-  if current_client_security != 'ldap':
-query = "Currently '" + current_client_security + "' is configured, do you 
wish to use LDAP instead [y/n] (n)? "
-if get_YN_input(query, False):
-  pass
-else:
-  err = "Currently '" + current_client_security + "' configured. Can not 
setup LDAP."
-  raise FatalException(1, err)
+  enforce_ldap = options.ldap_force_setup if options.ldap_force_setup is not 
None else False
+  if not enforce_ldap:
+current_client_security = get_value_from_properties(properties, 
CLIENT_SECURITY, NO_AUTH_METHOD_CONFIGURED)
+if current_client_security != 'ldap':
+  query = "Currently '{0}' is configured, do you wish to use LDAP instead 
[y/n] ({1})? "
+  ldap_setup_default = 'y' if current_client_security == 
NO_AUTH_METHOD_CONFIGURED else 'n'
+  if get_YN_input(query.format(current_client_security, 
ldap_setup_default), ldap_setup_default == 'y'):
+pass
+  else:
+err = "Currently '" + current_client_security + "' configured. Can not 
setup LDAP."
+raise FatalException(1, err)
 
   isSecure = 

[ambari] branch trunk updated: AMBARI-23211. Hive client Installation is failing (aonishuk)

2018-03-12 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 f554d97  AMBARI-23211. Hive client Installation is failing  (aonishuk)
f554d97 is described below

commit f554d975c56416f5f54052e98a14aa39d4b80c73
Author: Andrew Onishuk 
AuthorDate: Mon Mar 12 19:54:26 2018 +0200

AMBARI-23211. Hive client Installation is failing  (aonishuk)
---
 ambari-agent/src/main/python/ambari_agent/Utils.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ambari-agent/src/main/python/ambari_agent/Utils.py 
b/ambari-agent/src/main/python/ambari_agent/Utils.py
index ad74fa6..d4162c4 100644
--- a/ambari-agent/src/main/python/ambari_agent/Utils.py
+++ b/ambari-agent/src/main/python/ambari_agent/Utils.py
@@ -221,6 +221,7 @@ def execute_with_retries(tries, try_sleep, 
retry_exception_class, func, *args, *
   for i in range(tries):
 try:
   func(*args, **kwargs)
+  break
 except retry_exception_class:
   if i==tries-1:
 raise

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


[ambari] branch branch-feature-AMBARI-14714-ui updated: Add missing translations in messages (#629)

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

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


The following commit(s) were added to refs/heads/branch-feature-AMBARI-14714-ui 
by this push:
 new 8f2aa6b  Add missing translations in messages (#629)
8f2aa6b is described below

commit 8f2aa6be6206d8a4b804b63f9ae10f9aa7622ff9
Author: Ishan Bhatt 
AuthorDate: Mon Mar 12 10:42:17 2018 -0700

Add missing translations in messages (#629)
---
 ambari-web/app/messages.js | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 1488fc4..be9df39 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -223,6 +223,7 @@ Em.I18n.translations = {
   'common.maint': 'Maint',
   'common.maintenance.task': ' Toggle Maintenance Mode',
   'common.maintenance': 'Maintenance',
+  'common.master':'Master',
   'common.maximum':'Maximum',
   'common.memory':'Memory',
   'common.message':'Message',
@@ -317,6 +318,7 @@ Em.I18n.translations = {
   'common.show':'Show',
   'common.showDetails':'Show Details',
   'common.skip':'Skip',
+  'common.slave':'Slave',
   'common.stack.versions':'Stack Versions',
   'common.stack': 'Stack',
   'common.stacks': 'Stacks',

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


[ambari] 01/01: Merge pull request #627 from ishanbha/branch-feature-AMBARI-14714

2018-03-12 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

commit 1523f80805cb1486c61f71c105ac48c24dc5324c
Merge: f835be6 d491562
Author: Ishan Bhatt 
AuthorDate: Mon Mar 12 10:41:58 2018 -0700

Merge pull request #627 from ishanbha/branch-feature-AMBARI-14714

Add missing translations in messages

 ambari-web/app/messages.js | 2 ++
 1 file changed, 2 insertions(+)

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


[ambari] branch branch-feature-AMBARI-14714 updated (f835be6 -> 1523f80)

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

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


from f835be6  AMBARI-22649. Avoid using uninitialized logger, reduce 
verbosity (#536)
 add d491562  Add missing translations in messages
 new 1523f80  Merge pull request #627 from 
ishanbha/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:
 ambari-web/app/messages.js | 2 ++
 1 file changed, 2 insertions(+)

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


[ambari] branch trunk updated: AMBARI-23171. Ambari logo is missing. (mpapirkovskyy)

2018-03-12 Thread mpapirkovskyy
This is an automated email from the ASF dual-hosted git repository.

mpapirkovskyy 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 23743c9  AMBARI-23171. Ambari logo is missing. (mpapirkovskyy)
23743c9 is described below

commit 23743c99fd7caee522c6ec740749d11b11472380
Author: Myroslav Papirkovskyi 
AuthorDate: Fri Mar 9 09:26:47 2018 +0200

AMBARI-23171. Ambari logo is missing. (mpapirkovskyy)
---
 .../ambari/server/controller/AmbariServer.java |   1 +
 ambari-web/gzip-content.ps1| Bin 2349 -> 2566 bytes
 ambari-web/gzip-content.sh |  38 +
 ambari-web/pom.xml |   3 +-
 4 files changed, 41 insertions(+), 1 deletion(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
index 9eedd26..f8e4d21 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
@@ -386,6 +386,7 @@ public class AmbariServer {
 
   ServletHolder rootServlet = root.addServlet(DefaultServlet.class, "/");
   rootServlet.setInitParameter("dirAllowed", "false");
+  rootServlet.setInitParameter("precompressed", "gzip=.gz");
   rootServlet.setInitOrder(1);
 
   /* Configure default servlet for agent server */
diff --git a/ambari-web/gzip-content.ps1 b/ambari-web/gzip-content.ps1
index a6042a1..fe76007 100644
Binary files a/ambari-web/gzip-content.ps1 and b/ambari-web/gzip-content.ps1 
differ
diff --git a/ambari-web/gzip-content.sh b/ambari-web/gzip-content.sh
new file mode 100755
index 000..99d2c3f
--- /dev/null
+++ b/ambari-web/gzip-content.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# 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.
+#
+
+force_command=""
+save_original=false
+eval last=\${$#}
+file=$last
+while test $# -gt 0
+do
+case "$1" in
+-f) force_command="-f"
+;;
+-c) save_original=true
+;;
+esac
+shift
+done
+case $save_original in
+  (true)gzip "$force_command" -c -- "$file" > "$file.gz";;
+  (false)   gzip "$force_command" "$file";;
+esac
\ No newline at end of file
diff --git a/ambari-web/pom.xml b/ambari-web/pom.xml
index bcc0601..a483f19 100644
--- a/ambari-web/pom.xml
+++ b/ambari-web/pom.xml
@@ -240,6 +240,7 @@
 
 
 
+
 
 
 
@@ -334,7 +335,7 @@
 linux
 /
 brunch
-gzip
+${basedir}/gzip-content.sh
 
 node
 mkdir

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


[ambari] branch trunk updated: AMBARI-23153 BootStrap Standby NameNode page does not conform to new UI

2018-03-12 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 8c05281  AMBARI-23153 BootStrap Standby NameNode page does not conform 
to new UI
8c05281 is described below

commit 8c052818edb63c44cb00e1a2661031af204381a0
Author: Andrii Tkach 
AuthorDate: Tue Mar 6 17:01:21 2018 +0200

AMBARI-23153 BootStrap Standby NameNode page does not conform to new UI
---
 ambari-web/app/styles/wizard.less|  4 ++--
 .../main/admin/highAvailability/journalNode/step7.hbs| 16 ++--
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/ambari-web/app/styles/wizard.less 
b/ambari-web/app/styles/wizard.less
index 882e25e..4917aa7 100644
--- a/ambari-web/app/styles/wizard.less
+++ b/ambari-web/app/styles/wizard.less
@@ -452,14 +452,14 @@
   margin-left: 0;
 }
   }
-  #ha-step1, #ha-step4, #ha-step8, #mjn-step7 {
+  #ha-step1, #ha-step4, #ha-step8, #manage-journal-node-step7 {
 .alert.alert-warn {
   margin-top: 10px;
   margin-bottom: 10px;
 }
   }
 
-  #ha-step4 li, #ha-step6 li, #ha-step8 li, #mjn-step7 li {
+  #ha-step4 li, #ha-step6 li, #ha-step8 li, #manage-journal-node-step7 li {
 margin-top: 8px;
   }
 
diff --git 
a/ambari-web/app/templates/main/admin/highAvailability/journalNode/step7.hbs 
b/ambari-web/app/templates/main/admin/highAvailability/journalNode/step7.hbs
index 63cd0df..1c96c81 100644
--- a/ambari-web/app/templates/main/admin/highAvailability/journalNode/step7.hbs
+++ b/ambari-web/app/templates/main/admin/highAvailability/journalNode/step7.hbs
@@ -15,10 +15,14 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 }}
-
-{{t admin.manageJournalNode.wizard.step7.bodyHeader}}
-{{{view.step7BodyText}}}
-
-{{t common.next}} 
-
+
+{{t 
admin.manageJournalNode.wizard.step7.bodyHeader}}
+
+  {{{view.step7BodyText}}}
+
+
+
+  
+{{t common.next}} 
+  
 

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


[ambari] branch branch-2.6 updated: AMBARI-23014. Unable to proceed to step1 on Install Wizard (akovalenko)

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

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


The following commit(s) were added to refs/heads/branch-2.6 by this push:
 new 9d714a4  AMBARI-23014. Unable to proceed to step1 on Install Wizard  
(akovalenko)
9d714a4 is described below

commit 9d714a44838ebdf6b85d492a0e171536de8223a5
Author: Aleksandr Kovalenko 
AuthorDate: Mon Mar 12 14:00:05 2018 +0200

AMBARI-23014. Unable to proceed to step1 on Install Wizard  (akovalenko)
---
 ambari-web/app/views/wizard/step1_view.js   |  3 +
 ambari-web/test/views/wizard/step1_view_test.js | 89 +
 2 files changed, 92 insertions(+)

diff --git a/ambari-web/app/views/wizard/step1_view.js 
b/ambari-web/app/views/wizard/step1_view.js
index 3e78810..8c50e8d 100644
--- a/ambari-web/app/views/wizard/step1_view.js
+++ b/ambari-web/app/views/wizard/step1_view.js
@@ -171,6 +171,9 @@ App.WizardStep1View = Em.View.extend({
*/
   invalidFormatUrlExist: function () {
 var allRepositories = this.get('allRepositories');
+if (!allRepositories) {
+  return false;
+}
 if (this.get('controller.selectedStack.useRedhatSatellite')) {
   allRepositories = allRepositories.filter(this.isRedhat);
 }
diff --git a/ambari-web/test/views/wizard/step1_view_test.js 
b/ambari-web/test/views/wizard/step1_view_test.js
index f353a2f..1472850 100644
--- a/ambari-web/test/views/wizard/step1_view_test.js
+++ b/ambari-web/test/views/wizard/step1_view_test.js
@@ -130,4 +130,93 @@ describe('App.WizardStep1View', function () {
   expect(view.isRedhat(Em.Object.create({osType: 
'redhat-ppc7'}))).to.be.true;
 });
   });
+
+  describe('#invalidFormatUrlExist', function () {
+
+var testCases = [
+  {
+title: 'no repositories',
+allRepositories: undefined,
+useRedhatSatellite: false,
+result: false
+  },
+  {
+title: 'use redhat, invalid format',
+allRepositories: [
+  Em.Object.create({
+osType: '',
+invalidFormatError: false
+  }),
+  Em.Object.create({
+osType: 'redhat',
+invalidFormatError: true
+  })
+],
+useRedhatSatellite: true,
+result: true
+  },
+  {
+title: 'use redhat, no invalid format',
+allRepositories: [
+  Em.Object.create({
+osType: '',
+invalidFormatError: true
+  }),
+  Em.Object.create({
+osType: 'redhat',
+invalidFormatError: false
+  })
+],
+useRedhatSatellite: true,
+result: false
+  },
+  {
+title: 'no use redhat, invalid format',
+allRepositories: [
+  Em.Object.create({
+osType: '',
+invalidFormatError: true
+  }),
+  Em.Object.create({
+osType: 'redhat',
+invalidFormatError: false
+  })
+],
+useRedhatSatellite: false,
+result: true
+  },
+  {
+title: 'no use redhat, invalid format',
+allRepositories: [
+  Em.Object.create({
+osType: '',
+invalidFormatError: false
+  }),
+  Em.Object.create({
+osType: 'redhat',
+invalidFormatError: true
+  })
+],
+useRedhatSatellite: false,
+result: true
+  }
+];
+
+testCases.forEach(function (testCase) {
+  describe(testCase.title, function () {
+beforeEach(function () {
+  view.reopen({
+allRepositories: testCase.allRepositories
+  });
+  view.set('controller.selectedStack', Em.Object.create({
+useRedhatSatellite: testCase.useRedhatSatellite
+  }));
+});
+it('', function () {
+  expect(view.get('invalidFormatUrlExist')).to.equal(testCase.result);
+});
+  });
+});
+  });
+
 });
\ No newline at end of file

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


[ambari] branch trunk updated: AMBARI-23188 UI Changes required for Manage Versions /Register Versions Page

2018-03-12 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 227da41  AMBARI-23188 UI Changes required for Manage Versions 
/Register Versions Page
227da41 is described below

commit 227da417a811abba6116802081d6cc05b8e521a5
Author: Andrii Tkach 
AuthorDate: Fri Mar 9 15:19:11 2018 +0200

AMBARI-23188 UI Changes required for Manage Versions /Register Versions Page
---
 .../main/resources/ui/admin-web/app/styles/main.css | 21 ++---
 .../app/views/stackVersions/stackVersionPage.html   | 21 ++---
 2 files changed, 24 insertions(+), 18 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 cebe2b8..17c6beb 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
@@ -754,8 +754,9 @@ accordion .panel-group .panel{
   padding-left: 19px;
 }
 
-.repo-version-inline .dot {
-  padding-right: 15px;
+.repo-version-inline .form-group {
+  margin-left: 0;
+  margin-right: 0;
 }
 
 .status-CURRENT {
@@ -984,12 +985,14 @@ thead.view-permission-header > tr > th {
 }
 
 #current-stack-details {
-  bottom: 20px;
-  padding-left: 0px;
+  padding-left: 0;
+  margin-right: 15px;
 }
 
-#current-stack-details .table-borderless {
- border: transparent;
+#current-stack-details .table {
+  position: absolute;
+  top: 2px;
+  border: transparent;
 }
 
 #current-stack-details .table-borderless tbody tr td, .table-borderless tbody 
tr th, .table-borderless thead tr th {
@@ -1084,7 +1087,7 @@ thead.view-permission-header > tr > th {
   overflow: auto;
   border: 1px solid #ddd;
   padding: 8px 25px;
-  margin: 8px;
+  margin: 2px;
 }
 
 .register-version-form .details-panel .control-label {
@@ -1382,3 +1385,7 @@ a[disabled] i:before {
   color: #ccc;
   cursor: not-allowed;
 }
+
+.display-inline {
+  display: inline;
+}
diff --git 
a/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html
 
b/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html
index 61d5257..1eb247c 100644
--- 
a/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html
+++ 
b/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html
@@ -50,7 +50,7 @@
 
   
 
-  

+  

 
   
 {{'common.stack' | translate}}
@@ -88,13 +88,11 @@
   
 
 
-  {{'common.name' | translate}}:
-  
-
-  {{activeStackVersion.stackNameVersion}}
-
-.
-
+  
+
+  {{'common.name' | 
translate}}:{{activeStackVersion.stackNameVersion}}.
+
+
   
 
@@ -104,7 +102,6 @@
   
 
   
-  
   
 
   
@@ -199,8 +196,10 @@
 
   
 
-{{'common.controls.remove' | translate}}
+
+  
+{{'common.controls.remove' | translate}}
+  
 
   
 

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