eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hdenduk...@apache.org
Subject [1/9] incubator-eagle git commit: Eagle -168 - AlertEmail Initialization Issue
Date Fri, 26 Feb 2016 21:26:19 GMT
Repository: incubator-eagle
Updated Branches:
  refs/heads/branch-0.3.0 f9a921157 -> 1965b4aff


Eagle -168 - AlertEmail Initialization Issue

https://issues.apache.org/jira/browse/EAGLE-168

1. Fix the alert email initialization issue
2. Not to exclude the zookeeper jar from the assembly

Author: Kumar, Senthil
Reviewer: @yonzhang, @ralphsu

Closes #101


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

Branch: refs/heads/branch-0.3.0
Commit: eb0734b6f1eb0d868f7d8d39d5e543a11d87d0bb
Parents: f9a9211
Author: Ralph, Su <suliangfei@gmail.com>
Authored: Tue Feb 23 09:58:14 2016 +0800
Committer: Ralph, Su <suliangfei@gmail.com>
Committed: Tue Feb 23 09:58:14 2016 +0800

----------------------------------------------------------------------
 .../org/apache/eagle/notification/plugin/AlertEmailPlugin.java | 6 ++++--
 .../src/assembly/eagle-topology-assembly.xml                   | 1 -
 2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/eb0734b6/eagle-core/eagle-alert/eagle-alert-notification-plugin/src/main/java/org/apache/eagle/notification/plugin/AlertEmailPlugin.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-notification-plugin/src/main/java/org/apache/eagle/notification/plugin/AlertEmailPlugin.java
b/eagle-core/eagle-alert/eagle-alert-notification-plugin/src/main/java/org/apache/eagle/notification/plugin/AlertEmailPlugin.java
index 0577f5c..f9a7ed3 100644
--- a/eagle-core/eagle-alert/eagle-alert-notification-plugin/src/main/java/org/apache/eagle/notification/plugin/AlertEmailPlugin.java
+++ b/eagle-core/eagle-alert/eagle-alert-notification-plugin/src/main/java/org/apache/eagle/notification/plugin/AlertEmailPlugin.java
@@ -48,9 +48,11 @@ public class AlertEmailPlugin implements NotificationPlugin {
 	private final static long DEFAULT_THREAD_POOL_SHRINK_TIME = 60000L; // 1 minute
 	private transient ThreadPoolExecutor executorPool;
 	private NotificationStatus status = new NotificationStatus();
+	private Config config;
 
 	@Override
 	public void init(Config config, List<AlertDefinitionAPIEntity> initAlertDefs) throws
Exception {
+		this.config = config;
 		executorPool = new ThreadPoolExecutor(DEFAULT_THREAD_POOL_CORE_SIZE, DEFAULT_THREAD_POOL_MAX_SIZE,
DEFAULT_THREAD_POOL_SHRINK_TIME, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>());
 		LOG.info(" Creating Email Generator... ");
 		for( AlertDefinitionAPIEntity  entity : initAlertDefs ){
@@ -59,7 +61,7 @@ public class AlertEmailPlugin implements NotificationPlugin {
 				String notificationType = notificationConfigMap.get(NotificationConstants.NOTIFICATION_TYPE);
 				// for backward compatibility, default notification is email
 				if(notificationType == null || notificationType.equalsIgnoreCase(NotificationConstants.EMAIL_NOTIFICATION)){
-					AlertEmailGenerator generator = createEmailGenerator(notificationConfigMap);
+					AlertEmailGenerator generator = createEmailGenerator( notificationConfigMap );
 						this.emailGenerators.put(entity.getTags().get(Constants.POLICY_ID), generator);
 						LOG.info("Successfully initialized email notification for policy " + entity.getTags().get(Constants.POLICY_ID)
+ ",with " + notificationConfigMap);
 				}
@@ -117,7 +119,7 @@ public class AlertEmailPlugin implements NotificationPlugin {
 			tplFileName = "ALERT_DEFAULT.vm";
 		}
 		AlertEmailGenerator gen = AlertEmailGeneratorBuilder.newBuilder().
-				withEagleProps(EagleConfigFactory.load().getConfig().getObject("eagleProps")).
+				withEagleProps(this.config.getObject("eagleProps")).
 				withSubject(notificationConfig.get(NotificationConstants.SUBJECT)).
 				withSender(notificationConfig.get(NotificationConstants.SENDER)).
 				withRecipients(notificationConfig.get(NotificationConstants.RECIPIENTS)).

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/eb0734b6/eagle-topology-assembly/src/assembly/eagle-topology-assembly.xml
----------------------------------------------------------------------
diff --git a/eagle-topology-assembly/src/assembly/eagle-topology-assembly.xml b/eagle-topology-assembly/src/assembly/eagle-topology-assembly.xml
index e397efa..2a0d211 100644
--- a/eagle-topology-assembly/src/assembly/eagle-topology-assembly.xml
+++ b/eagle-topology-assembly/src/assembly/eagle-topology-assembly.xml
@@ -47,7 +47,6 @@
                 <exclude>asm:asm</exclude>
                 <exclude>org.apache.log4j.wso2:log4j</exclude>
                 <exclude>log4j:apache-log4j-extras</exclude>
-                <exclude>org.apache.zookeeper:zookeeper</exclude>
             </excludes>
         </dependencySet>
     </dependencySets>


Mime
View raw message