[39/45] ambari git commit: AMBARI-22115. Alerts for OneFS mpack (amagyar)

2018-01-04 Thread amagyar
AMBARI-22115. Alerts for OneFS mpack (amagyar)


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

Branch: refs/heads/branch-feature-AMBARI-22008-isilon
Commit: 45b6549c10e82c59e6f6f935562d72bc6847dcf5
Parents: 3011a48
Author: Attila Magyar 
Authored: Thu Oct 26 11:49:18 2017 +0200
Committer: Attila Magyar 
Committed: Fri Jan 5 08:54:45 2018 +0100

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


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

http://git-wip-us.apache.org/repos/asf/ambari/blob/45b6549c/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
index a7e11e1..66d09a5 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
@@ -17,9 +17,8 @@
  */
 

[36/45] ambari git commit: AMBARI-22115. Alerts for OneFS mpack (amagyar)

2018-01-04 Thread amagyar
AMBARI-22115. Alerts for OneFS mpack (amagyar)


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

Branch: refs/heads/branch-feature-AMBARI-22008-isilon
Commit: 3287d952e8a3b9469e71afaa820ddf25b84aa642
Parents: f15e2c5
Author: Attila Magyar 
Authored: Thu Oct 12 15:21:13 2017 +0200
Committer: Attila Magyar 
Committed: Fri Jan 5 08:54:45 2018 +0100

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


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

http://git-wip-us.apache.org/repos/asf/ambari/blob/3287d952/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
new file mode 100644
index 000..a4b86f8
--- /dev/null
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ambari.server.alerts;
+
+import static java.util.Collections.emptyList;
+import static 

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

2017-12-22 Thread amagyar
AMBARI-22115. Alerts for OneFS mpack (amagyar)


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

Branch: refs/heads/branch-feature-AMBARI-22008-isilon
Commit: 187851756ab52fcccb7fe40d05617c64162e372d
Parents: 92f8ee0
Author: Attila Magyar 
Authored: Thu Oct 26 11:49:18 2017 +0200
Committer: Attila Magyar 
Committed: Fri Dec 22 09:57:59 2017 +0100

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


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

http://git-wip-us.apache.org/repos/asf/ambari/blob/18785175/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
index a7e11e1..66d09a5 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
@@ -17,9 +17,8 @@
  */
 

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

2017-12-22 Thread amagyar
AMBARI-22115. Alerts for OneFS mpack (amagyar)


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

Branch: refs/heads/branch-feature-AMBARI-22008-isilon
Commit: 68e7dd3faad9523b0d7d177e041d94acb256e47b
Parents: d88c8ea
Author: Attila Magyar 
Authored: Thu Oct 12 15:21:13 2017 +0200
Committer: Attila Magyar 
Committed: Fri Dec 22 09:57:58 2017 +0100

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


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

http://git-wip-us.apache.org/repos/asf/ambari/blob/68e7dd3f/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
new file mode 100644
index 000..a4b86f8
--- /dev/null
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ambari.server.alerts;
+
+import static java.util.Collections.emptyList;
+import static 

[04/10] ambari git commit: AMBARI-22115. Alerts for OneFS mpack (amagyar)

2017-12-12 Thread amagyar
AMBARI-22115. Alerts for OneFS mpack (amagyar)


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

Branch: refs/heads/branch-feature-AMBARI-22008-isilon
Commit: fee0c794c8d620d44e3981ec46e687ad767fbbf6
Parents: b88f35c
Author: Attila Magyar 
Authored: Thu Oct 26 11:49:18 2017 +0200
Committer: Attila Magyar 
Committed: Wed Dec 6 18:39:56 2017 +0100

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


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

http://git-wip-us.apache.org/repos/asf/ambari/blob/fee0c794/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
index a7e11e1..66d09a5 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
@@ -17,9 +17,8 @@
  */
 

[02/10] ambari git commit: AMBARI-22115. Alerts for OneFS mpack (amagyar)

2017-12-12 Thread amagyar
AMBARI-22115. Alerts for OneFS mpack (amagyar)


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

Branch: refs/heads/branch-feature-AMBARI-22008-isilon
Commit: 5e40e560571d2da37ef09ed4023e33d57ef6beca
Parents: 3635255
Author: Attila Magyar 
Authored: Thu Oct 12 15:21:13 2017 +0200
Committer: Attila Magyar 
Committed: Wed Dec 6 18:15:12 2017 +0100

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


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

http://git-wip-us.apache.org/repos/asf/ambari/blob/5e40e560/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
new file mode 100644
index 000..a4b86f8
--- /dev/null
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ambari.server.alerts;
+
+import static java.util.Collections.emptyList;
+import static 

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

2017-11-22 Thread amagyar
AMBARI-22115. Alerts for OneFS mpack (amagyar)


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

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

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


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

http://git-wip-us.apache.org/repos/asf/ambari/blob/362b4f00/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
new file mode 100644
index 000..a4b86f8
--- /dev/null
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ambari.server.alerts;
+
+import static java.util.Collections.emptyList;
+import static 

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

2017-11-22 Thread amagyar
AMBARI-22115. Alerts for OneFS mpack (amagyar)


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

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

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


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

http://git-wip-us.apache.org/repos/asf/ambari/blob/b8f75de5/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
index a7e11e1..66d09a5 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
@@ -17,9 +17,8 @@
  */
 package 

ambari git commit: AMBARI-22115. Alerts for OneFS mpack (amagyar)

2017-10-26 Thread amagyar
Repository: ambari
Updated Branches:
  refs/heads/branch-feature-AMBARI-22008 560b437b2 -> b34818db3


AMBARI-22115. Alerts for OneFS mpack (amagyar)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: b34818db342c64ee3b6615af0a66cd6072b1c4e5
Parents: 560b437
Author: Attila Magyar 
Authored: Thu Oct 26 11:49:18 2017 +0200
Committer: Attila Magyar 
Committed: Thu Oct 26 11:49:18 2017 +0200

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


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

http://git-wip-us.apache.org/repos/asf/ambari/blob/b34818db/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
index a7e11e1..66d09a5 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
+++ 

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

2017-10-17 Thread amagyar
AMBARI-22115. Alerts for OneFS mpack (amagyar)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: b552da9e100d2c94eb74a5634ce08c16ad9656e7
Parents: 7eb5cd4
Author: Attila Magyar 
Authored: Thu Oct 12 15:21:13 2017 +0200
Committer: Attila Magyar 
Committed: Tue Oct 17 16:52:56 2017 +0200

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


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

http://git-wip-us.apache.org/repos/asf/ambari/blob/b552da9e/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
new file mode 100644
index 000..a4b86f8
--- /dev/null
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ambari.server.alerts;
+
+import static java.util.Collections.emptyList;
+import static 

ambari git commit: AMBARI-22115. Alerts for OneFS mpack (amagyar)

2017-10-12 Thread amagyar
Repository: ambari
Updated Branches:
  refs/heads/branch-feature-AMBARI-22008 95aed902d -> c8a34e51a


AMBARI-22115. Alerts for OneFS mpack (amagyar)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: c8a34e51ad1d9013684633937fa4246f34505ee7
Parents: 95aed90
Author: Attila Magyar 
Authored: Thu Oct 12 15:21:13 2017 +0200
Committer: Attila Magyar 
Committed: Thu Oct 12 15:21:13 2017 +0200

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


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

http://git-wip-us.apache.org/repos/asf/ambari/blob/c8a34e51/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
new file mode 100644
index 000..a4b86f8
--- /dev/null
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package