You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by an...@apache.org on 2015/09/18 06:23:35 UTC
[1/9] stratos git commit: Removing cep_ip,
cep_port from agent constants
Repository: stratos
Updated Branches:
refs/heads/stratos-4.1.x 3043dc3ac -> 89d8a7af8
Removing cep_ip,cep_port from agent constants
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/89d8a7af
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/89d8a7af
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/89d8a7af
Branch: refs/heads/stratos-4.1.x
Commit: 89d8a7af8260fe8264fa0b5e248d45d71220611f
Parents: a996845
Author: anuruddhal <an...@gmail.com>
Authored: Thu Sep 17 18:45:16 2015 +0530
Committer: anuruddhal <an...@gmail.com>
Committed: Fri Sep 18 09:53:18 2015 +0530
----------------------------------------------------------------------
.../src/main/python/cartridge.agent/cartridge.agent/constants.py | 2 --
1 file changed, 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/89d8a7af/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/constants.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/constants.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/constants.py
index e840057..2fdeba8 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/constants.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/constants.py
@@ -121,8 +121,6 @@ DATE_FORMAT = "%Y.%m.%d"
PORT_CHECK_TIMEOUT = "port.check.timeout"
CEP_PUBLISHER_ENABLED = "cep.stats.publisher.enabled"
-CEP_RECEIVER_IP = "thrift.receiver.ip"
-CEP_RECEIVER_PORT = "thrift.receiver.port"
CEP_RECEIVER_URLS = "thrift.receiver.urls"
CEP_SERVER_ADMIN_USERNAME = "thrift.server.admin.username"
CEP_SERVER_ADMIN_PASSWORD = "thrift.server.admin.password"
[9/9] stratos git commit: Changing python agent to publish thrift
events to multiple CEP servers
Posted by an...@apache.org.
Changing python agent to publish thrift events to multiple CEP servers
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/82ac4d72
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/82ac4d72
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/82ac4d72
Branch: refs/heads/stratos-4.1.x
Commit: 82ac4d72f009677e915c9fc52b35bd1213703850
Parents: 8ad1f6e
Author: anuruddhal <an...@gmail.com>
Authored: Wed Sep 16 14:53:05 2015 +0530
Committer: anuruddhal <an...@gmail.com>
Committed: Fri Sep 18 09:53:18 2015 +0530
----------------------------------------------------------------------
.../cartridge.agent/cartridge.agent/agent.conf | 3 +-
.../cartridge.agent/constants.py | 1 +
.../cartridge.agent/healthstats.py | 67 ++++++++++++--------
3 files changed, 42 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/82ac4d72/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/agent.conf
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/agent.conf b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/agent.conf
index 22d1deb..926ea96 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/agent.conf
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/agent.conf
@@ -19,8 +19,7 @@
mb.ip =MB-IP
mb.port =MB-PORT
listen.address =LISTEN_ADDR
-thrift.receiver.ip =CEP-IP
-thrift.receiver.port =CEP-PORT
+thrift.receiver.urls =CEP-URLS
thrift.server.admin.username =CEP-ADMIN-USERNAME
thrift.server.admin.password =CEP-ADMIN-PASSWORD
cep.stats.publisher.enabled =ENABLE_HEALTH_PUBLISHER
http://git-wip-us.apache.org/repos/asf/stratos/blob/82ac4d72/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/constants.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/constants.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/constants.py
index 5510659..e840057 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/constants.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/constants.py
@@ -123,6 +123,7 @@ PORT_CHECK_TIMEOUT = "port.check.timeout"
CEP_PUBLISHER_ENABLED = "cep.stats.publisher.enabled"
CEP_RECEIVER_IP = "thrift.receiver.ip"
CEP_RECEIVER_PORT = "thrift.receiver.port"
+CEP_RECEIVER_URLS = "thrift.receiver.urls"
CEP_SERVER_ADMIN_USERNAME = "thrift.server.admin.username"
CEP_SERVER_ADMIN_PASSWORD = "thrift.server.admin.password"
http://git-wip-us.apache.org/repos/asf/stratos/blob/82ac4d72/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/healthstats.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/healthstats.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/healthstats.py
index f661294..71e6d2f 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/healthstats.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/healthstats.py
@@ -69,7 +69,7 @@ class HealthStatisticsPublisherManager(Thread):
self.log.exception("Couldn't publish health statistics to CEP. Thrift Receiver offline. Reconnecting...")
self.publisher = HealthStatisticsPublisher()
- self.publisher.publisher.disconnect()
+ self.publisher.disconnect_publisher()
class HealthStatisticsPublisher:
@@ -94,38 +94,44 @@ class HealthStatisticsPublisher:
return conf_value
def __init__(self):
- self.ports = []
- cep_port = HealthStatisticsPublisher.read_config(constants.CEP_RECEIVER_PORT)
- self.ports.append(cep_port)
- cep_ip = HealthStatisticsPublisher.read_config(constants.CEP_RECEIVER_IP)
+ self.publishers = []
+ cep_admin_username = HealthStatisticsPublisher.read_config(constants.CEP_SERVER_ADMIN_USERNAME)
+ cep_admin_password = HealthStatisticsPublisher.read_config(constants.CEP_SERVER_ADMIN_PASSWORD)
+ # 1.1.1.1:1883,2.2.2.2:1883
+ cep_urls = HealthStatisticsPublisher.read_config(constants.CEP_RECEIVER_URLS);
+ cep_urls = cep_urls.split(',')
+ for cep_url in cep_urls:
+ self.ports = []
+ cep_ip = cep_url.split(':')[0]
+ cep_port = cep_url.split(':')[1]
+ self.ports.append(cep_port)
+ cartridgeagentutils.wait_until_ports_active(
+ cep_ip,
+ self.ports,
+ int(Config.read_property("port.check.timeout", critical=False)))
- cartridgeagentutils.wait_until_ports_active(
- cep_ip,
- self.ports,
- int(Config.read_property("port.check.timeout", critical=False)))
+ cep_active = cartridgeagentutils.check_ports_active(
+ cep_ip,
+ self.ports)
- cep_active = cartridgeagentutils.check_ports_active(
- cep_ip,
- self.ports)
+ if not cep_active:
+ raise CEPPublisherException("CEP server not active. Health statistics publishing aborted.")
- if not cep_active:
- raise CEPPublisherException("CEP server not active. Health statistics publishing aborted.")
- cep_admin_username = HealthStatisticsPublisher.read_config(constants.CEP_SERVER_ADMIN_USERNAME)
- cep_admin_password = HealthStatisticsPublisher.read_config(constants.CEP_SERVER_ADMIN_PASSWORD)
+ self.stream_definition = HealthStatisticsPublisher.create_stream_definition()
+ HealthStatisticsPublisher.log.debug("Stream definition created: %r" % str(self.stream_definition))
- self.stream_definition = HealthStatisticsPublisher.create_stream_definition()
- HealthStatisticsPublisher.log.debug("Stream definition created: %r" % str(self.stream_definition))
+ publisher = ThriftPublisher(
+ cep_ip,
+ cep_port,
+ cep_admin_username,
+ cep_admin_password,
+ self.stream_definition)
- self.publisher = ThriftPublisher(
- cep_ip,
- cep_port,
- cep_admin_username,
- cep_admin_password,
- self.stream_definition)
+ self.publishers.append(publisher)
- HealthStatisticsPublisher.log.debug("HealthStatisticsPublisher initialized")
+ HealthStatisticsPublisher.log.debug("HealthStatisticsPublisher initialized")
@staticmethod
def create_stream_definition():
@@ -171,7 +177,7 @@ class HealthStatisticsPublisher:
event.payloadData,
self.stream_definition.version))
- self.publisher.publish(event)
+ self.publish_event(self.publishers, event)
def publish_load_average(self, load_avg):
"""
@@ -195,8 +201,15 @@ class HealthStatisticsPublisher:
event.payloadData,
self.stream_definition.version))
- self.publisher.publish(event)
+ self.publish_event(event)
+
+ def publish_event(self, event):
+ for publisher in self.publishers:
+ publisher.publish(event)
+ def disconnect_publisher(self, publishers):
+ for publisher in self.publishers:
+ publisher.disconnect()
class DefaultHealthStatisticsReader:
"""
[2/9] stratos git commit: Changing agent.conf to accept cep.urls
Posted by an...@apache.org.
Changing agent.conf to accept cep.urls
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/1ac15fa3
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/1ac15fa3
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/1ac15fa3
Branch: refs/heads/stratos-4.1.x
Commit: 1ac15fa3a8920bdd2b062274317530e2c2904f69
Parents: 82ac4d7
Author: anuruddhal <an...@gmail.com>
Authored: Wed Sep 16 16:05:23 2015 +0530
Committer: anuruddhal <an...@gmail.com>
Committed: Fri Sep 18 09:53:18 2015 +0530
----------------------------------------------------------------------
.../python/cartridge.agent/cartridge.agent/healthstats.py | 7 ++++---
.../src/test/resources/ADCMTAppTenantUserTestCase/agent.conf | 3 +--
.../src/test/resources/ADCMTAppTestCase/agent.conf | 3 +--
.../src/test/resources/ADCTestCase/agent.conf | 3 +--
.../src/test/resources/AgentStartupTestCase/agent.conf | 3 +--
5 files changed, 8 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/1ac15fa3/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/healthstats.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/healthstats.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/healthstats.py
index 71e6d2f..eb140c0 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/healthstats.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/healthstats.py
@@ -99,7 +99,7 @@ class HealthStatisticsPublisher:
cep_admin_username = HealthStatisticsPublisher.read_config(constants.CEP_SERVER_ADMIN_USERNAME)
cep_admin_password = HealthStatisticsPublisher.read_config(constants.CEP_SERVER_ADMIN_PASSWORD)
# 1.1.1.1:1883,2.2.2.2:1883
- cep_urls = HealthStatisticsPublisher.read_config(constants.CEP_RECEIVER_URLS);
+ cep_urls = HealthStatisticsPublisher.read_config(constants.CEP_RECEIVER_URLS)
cep_urls = cep_urls.split(',')
for cep_url in cep_urls:
self.ports = []
@@ -131,7 +131,8 @@ class HealthStatisticsPublisher:
self.publishers.append(publisher)
- HealthStatisticsPublisher.log.debug("HealthStatisticsPublisher initialized")
+ HealthStatisticsPublisher.log.debug("HealthStatisticsPublisher initialized. %r %r",
+ cep_ip, cep_port)
@staticmethod
def create_stream_definition():
@@ -177,7 +178,7 @@ class HealthStatisticsPublisher:
event.payloadData,
self.stream_definition.version))
- self.publish_event(self.publishers, event)
+ self.publish_event(event)
def publish_load_average(self, load_avg):
"""
http://git-wip-us.apache.org/repos/asf/stratos/blob/1ac15fa3/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCMTAppTenantUserTestCase/agent.conf
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCMTAppTenantUserTestCase/agent.conf b/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCMTAppTenantUserTestCase/agent.conf
index f945968..89eeae3 100755
--- a/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCMTAppTenantUserTestCase/agent.conf
+++ b/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCMTAppTenantUserTestCase/agent.conf
@@ -19,8 +19,7 @@
mb.ip =localhost
mb.port =1885
listen.address =localhost
-thrift.receiver.ip =localhost
-thrift.receiver.port =7712
+thrift.receiver.urls =localhost:7712
thrift.server.admin.username =admin
thrift.server.admin.password =admin
cep.stats.publisher.enabled =true
http://git-wip-us.apache.org/repos/asf/stratos/blob/1ac15fa3/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCMTAppTestCase/agent.conf
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCMTAppTestCase/agent.conf b/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCMTAppTestCase/agent.conf
index 6444c2e..452129d 100755
--- a/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCMTAppTestCase/agent.conf
+++ b/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCMTAppTestCase/agent.conf
@@ -19,8 +19,7 @@
mb.ip =localhost
mb.port =1885
listen.address =localhost
-thrift.receiver.ip =localhost
-thrift.receiver.port =7712
+thrift.receiver.urls =localhost:7712
thrift.server.admin.username =admin
thrift.server.admin.password =admin
cep.stats.publisher.enabled =true
http://git-wip-us.apache.org/repos/asf/stratos/blob/1ac15fa3/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCTestCase/agent.conf
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCTestCase/agent.conf b/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCTestCase/agent.conf
index fd3e423..42922ec 100755
--- a/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCTestCase/agent.conf
+++ b/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCTestCase/agent.conf
@@ -19,8 +19,7 @@
mb.ip =localhost
mb.port =1885
listen.address =localhost
-thrift.receiver.ip =localhost
-thrift.receiver.port =7712
+thrift.receiver.urls =localhost:7712
thrift.server.admin.username =admin
thrift.server.admin.password =admin
cep.stats.publisher.enabled =true
http://git-wip-us.apache.org/repos/asf/stratos/blob/1ac15fa3/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/AgentStartupTestCase/agent.conf
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/AgentStartupTestCase/agent.conf b/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/AgentStartupTestCase/agent.conf
index 0038b7d..41dfa38 100755
--- a/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/AgentStartupTestCase/agent.conf
+++ b/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/AgentStartupTestCase/agent.conf
@@ -19,8 +19,7 @@
mb.ip =localhost
mb.port =1885
listen.address =localhost
-thrift.receiver.ip =localhost
-thrift.receiver.port =7712
+thrift.receiver.urls =localhost:7712
thrift.server.admin.username =admin
thrift.server.admin.password =admin
cep.stats.publisher.enabled =true
[8/9] stratos git commit: Adding CEP 3.0.0 jar to distribution
Posted by an...@apache.org.
Adding CEP 3.0.0 jar to distribution
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/a9968457
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/a9968457
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/a9968457
Branch: refs/heads/stratos-4.1.x
Commit: a99684579a4b35becbefdb88714ea8bef955184c
Parents: 1ac15fa
Author: anuruddhal <an...@gmail.com>
Authored: Thu Sep 17 17:54:46 2015 +0530
Committer: anuruddhal <an...@gmail.com>
Committed: Fri Sep 18 09:53:18 2015 +0530
----------------------------------------------------------------------
products/stratos/modules/distribution/src/assembly/bin.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9968457/products/stratos/modules/distribution/src/assembly/bin.xml
----------------------------------------------------------------------
diff --git a/products/stratos/modules/distribution/src/assembly/bin.xml b/products/stratos/modules/distribution/src/assembly/bin.xml
index 54a1a56..7569924 100755
--- a/products/stratos/modules/distribution/src/assembly/bin.xml
+++ b/products/stratos/modules/distribution/src/assembly/bin.xml
@@ -509,7 +509,7 @@
<dependencySet>
<outputDirectory>${stratos.distribution.name}-${project.version}/repository/components/lib</outputDirectory>
<includes>
- <include>org.apache.stratos:org.apache.stratos.cep.extension:jar</include>
+ <include>org.apache.stratos:org.apache.stratos.cep300.extension:jar</include>
</includes>
</dependencySet>
<dependencySet>
[4/9] stratos git commit: Upgrading CEP artifacts to 3.1.0
Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/FaultHandlingWindowProcessor.java
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/FaultHandlingWindowProcessor.java b/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/FaultHandlingWindowProcessor.java
deleted file mode 100644
index 0aa01ed..0000000
--- a/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/FaultHandlingWindowProcessor.java
+++ /dev/null
@@ -1,349 +0,0 @@
-/*
- * 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.stratos.cep.extension;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.log4j.Logger;
-import org.apache.stratos.common.threading.StratosThreadPool;
-import org.apache.stratos.messaging.broker.publish.EventPublisher;
-import org.apache.stratos.messaging.broker.publish.EventPublisherPool;
-import org.apache.stratos.messaging.domain.topology.*;
-import org.apache.stratos.messaging.event.health.stat.MemberFaultEvent;
-import org.apache.stratos.messaging.message.receiver.topology.TopologyManager;
-import org.apache.stratos.messaging.util.MessagingUtil;
-import org.wso2.siddhi.core.config.SiddhiContext;
-import org.wso2.siddhi.core.event.StreamEvent;
-import org.wso2.siddhi.core.event.in.InEvent;
-import org.wso2.siddhi.core.event.in.InListEvent;
-import org.wso2.siddhi.core.persistence.ThreadBarrier;
-import org.wso2.siddhi.core.query.QueryPostProcessingElement;
-import org.wso2.siddhi.core.query.processor.window.RunnableWindowProcessor;
-import org.wso2.siddhi.core.query.processor.window.WindowProcessor;
-import org.wso2.siddhi.core.util.collection.queue.scheduler.ISchedulerSiddhiQueue;
-import org.wso2.siddhi.core.util.collection.queue.scheduler.SchedulerSiddhiQueue;
-import org.wso2.siddhi.core.util.collection.queue.scheduler.SchedulerSiddhiQueueGrid;
-import org.wso2.siddhi.query.api.definition.AbstractDefinition;
-import org.wso2.siddhi.query.api.expression.Expression;
-import org.wso2.siddhi.query.api.expression.Variable;
-import org.wso2.siddhi.query.api.expression.constant.IntConstant;
-import org.wso2.siddhi.query.api.expression.constant.LongConstant;
-import org.wso2.siddhi.query.api.extension.annotation.SiddhiExtension;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledFuture;
-import java.util.concurrent.TimeUnit;
-
-/**
- * CEP window processor to handle faulty member instances. This window processor is responsible for
- * publishing MemberFault event if health stats are not received within a given time window.
- */
-@SiddhiExtension(namespace = "stratos", function = "faultHandling")
-public class FaultHandlingWindowProcessor extends WindowProcessor implements RunnableWindowProcessor {
-
- private static final Logger log = Logger.getLogger(FaultHandlingWindowProcessor.class);
-
- private static final int TIME_OUT = 60 * 1000;
- public static final String CEP_EXTENSION_THREAD_POOL_KEY = "cep.extension.thread.pool";
- public static final int CEP_EXTENSION_THREAD_POOL_SIZE = 10;
-
- private ExecutorService executorService;
- private ScheduledExecutorService faultHandleScheduler;
- private ScheduledFuture<?> lastSchedule;
- private ThreadBarrier threadBarrier;
- private long timeToKeep;
- private ISchedulerSiddhiQueue<StreamEvent> window;
- private EventPublisher healthStatPublisher =
- EventPublisherPool.getPublisher(MessagingUtil.Topics.HEALTH_STAT_TOPIC.getTopicName());
- private Map<String, Object> MemberFaultEventMap = new HashMap<String, Object>();
- private Map<String, Object> memberFaultEventMessageMap = new HashMap<String, Object>();
-
- // Map of member id's to their last received health event time stamp
- private ConcurrentHashMap<String, Long> memberTimeStampMap = new ConcurrentHashMap<String, Long>();
-
- // Event receiver to receive topology events published by cloud-controller
- private CEPTopologyEventReceiver cepTopologyEventReceiver = new CEPTopologyEventReceiver(this);
-
- // Stratos member id attribute index in stream execution plan
- private int memberIdAttrIndex;
-
- @Override
- protected void processEvent(InEvent event) {
- addDataToMap(event);
- }
-
- @Override
- protected void processEvent(InListEvent listEvent) {
- for (int i = 0, size = listEvent.getActiveEvents(); i < size; i++) {
- addDataToMap((InEvent) listEvent.getEvent(i));
- }
- }
-
- /**
- * Add new entry to time stamp map from the received event.
- *
- * @param event Event received by Siddhi.
- */
- protected void addDataToMap(InEvent event) {
- String id = (String) event.getData()[memberIdAttrIndex];
- //checking whether this member is the topology.
- //sometimes there can be a delay between publishing member terminated events
- //and actually terminating instances. Hence CEP might get events for already terminated members
- //so we are checking the topology for the member existence
- Member member = getMemberFromId(id);
- if (null == member) {
- log.debug("Member not found in the topology. Event rejected");
- return;
- }
- if (StringUtils.isNotEmpty(id)) {
- memberTimeStampMap.put(id, event.getTimeStamp());
- } else {
- log.warn("NULL member id found in the event received. Event rejected.");
- }
- if (log.isDebugEnabled()){
- log.debug("Event received from [member-id] " + id + " [time-stamp] " + event.getTimeStamp());
- }
- }
-
- @Override
- public Iterator<StreamEvent> iterator() {
- return window.iterator();
- }
-
- @Override
- public Iterator<StreamEvent> iterator(String predicate) {
- if (siddhiContext.isDistributedProcessingEnabled()) {
- return ((SchedulerSiddhiQueueGrid<StreamEvent>) window).iterator(predicate);
- } else {
- return window.iterator();
- }
- }
-
- /**
- * Retrieve the current activated members from the topology and initialize the timestamp map.
- * This will allow the system to recover from a restart
- *
- * @param topology Topology model object
- */
- boolean loadTimeStampMapFromTopology(Topology topology){
-
- long currentTimeStamp = System.currentTimeMillis();
- if (topology == null || topology.getServices() == null){
- return false;
- }
- // TODO make this efficient by adding APIs to messaging component
- for (Service service : topology.getServices()) {
- if (service.getClusters() != null) {
- for (Cluster cluster : service.getClusters()) {
- if (cluster.getMembers() != null) {
- for (Member member : cluster.getMembers()) {
- // we are checking faulty status only in previously activated members
- if (member != null && MemberStatus.Active.equals(member.getStatus())) {
- // Initialize the member time stamp map from the topology at the beginning
- memberTimeStampMap.putIfAbsent(member.getMemberId(), currentTimeStamp);
- }
- }
- }
- }
- }
- }
-
- if (log.isDebugEnabled()){
- log.debug("Member timestamps were successfully loaded from the topology: [timestamps] " +
- memberTimeStampMap);
- }
- return true;
- }
-
- private Member getMemberFromId(String memberId){
- if (StringUtils.isEmpty(memberId)){
- return null;
- }
- if (TopologyManager.getTopology().isInitialized()){
- try {
- TopologyManager.acquireReadLock();
- if (TopologyManager.getTopology().getServices() == null){
- return null;
- }
- // TODO make this efficient by adding APIs to messaging component
- for (Service service : TopologyManager.getTopology().getServices()) {
- if (service.getClusters() != null) {
- for (Cluster cluster : service.getClusters()) {
- if (cluster.getMembers() != null) {
- for (Member member : cluster.getMembers()){
- if (memberId.equals(member.getMemberId())){
- return member;
- }
- }
- }
- }
- }
- }
- } catch (Exception e) {
- log.error("Error while reading topology" + e);
- } finally {
- TopologyManager.releaseReadLock();
- }
- }
- return null;
- }
-
- private void publishMemberFault(String memberId){
- Member member = getMemberFromId(memberId);
- if (member == null){
- log.warn("Failed to publish member fault event. Member having [member-id] " + memberId +
- " does not exist in topology");
- return;
- }
- log.info("Publishing member fault event for [member-id] " + memberId);
-
- MemberFaultEvent memberFaultEvent = new MemberFaultEvent(member.getClusterId(), member.getClusterInstanceId(),
- member.getMemberId(), member.getPartitionId(),
- member.getNetworkPartitionId(), 0);
-
- memberFaultEventMessageMap.put("message", memberFaultEvent);
- healthStatPublisher.publish(MemberFaultEventMap, true);
- }
-
- @Override
- public void run() {
- try {
- threadBarrier.pass();
-
- for (Object o : memberTimeStampMap.entrySet()) {
- Map.Entry pair = (Map.Entry) o;
- long currentTime = System.currentTimeMillis();
- Long eventTimeStamp = (Long) pair.getValue();
-
- if ((currentTime - eventTimeStamp) > TIME_OUT) {
- log.info("Faulty member detected [member-id] " + pair.getKey() + " with [last time-stamp] " +
- eventTimeStamp + " [time-out] " + TIME_OUT + " milliseconds");
- publishMemberFault((String) pair.getKey());
- }
- }
- if (log.isDebugEnabled()){
- log.debug("Fault handling processor iteration completed with [time-stamp map length] " +
- memberTimeStampMap.size() + " [time-stamp map] " + memberTimeStampMap);
- }
- } catch (Throwable t) {
- log.error(t.getMessage(), t);
- } finally {
- if (lastSchedule != null) {
- lastSchedule.cancel(false);
- }
- lastSchedule = faultHandleScheduler.schedule(this, timeToKeep, TimeUnit.MILLISECONDS);
- }
- }
-
- @Override
- protected Object[] currentState() {
- return new Object[]{window.currentState()};
- }
-
- @Override
- protected void restoreState(Object[] data) {
- window.restoreState(data);
- window.restoreState((Object[]) data[0]);
- window.reSchedule();
- }
-
- @Override
- protected void init(Expression[] parameters, QueryPostProcessingElement nextProcessor,
- AbstractDefinition streamDefinition, String elementId, boolean async, SiddhiContext siddhiContext) {
-
- if (parameters[0] instanceof IntConstant) {
- timeToKeep = ((IntConstant) parameters[0]).getValue();
- } else {
- timeToKeep = ((LongConstant) parameters[0]).getValue();
- }
-
- String memberIdAttrName = ((Variable) parameters[1]).getAttributeName();
- memberIdAttrIndex = streamDefinition.getAttributePosition(memberIdAttrName);
-
- if (this.siddhiContext.isDistributedProcessingEnabled()) {
- window = new SchedulerSiddhiQueueGrid<StreamEvent>(elementId, this, this.siddhiContext, this.async);
- } else {
- window = new SchedulerSiddhiQueue<StreamEvent>(this);
- }
- MemberFaultEventMap.put("org.apache.stratos.messaging.event.health.stat.MemberFaultEvent", memberFaultEventMessageMap);
-
- executorService = StratosThreadPool.getExecutorService(CEP_EXTENSION_THREAD_POOL_KEY,
- CEP_EXTENSION_THREAD_POOL_SIZE);
- cepTopologyEventReceiver.setExecutorService(executorService);
- cepTopologyEventReceiver.execute();
-
- //Ordinary scheduling
- window.schedule();
- if (log.isDebugEnabled()){
- log.debug("Fault handling window processor initialized with [timeToKeep] " + timeToKeep +
- ", [memberIdAttrName] " + memberIdAttrName + ", [memberIdAttrIndex] " + memberIdAttrIndex +
- ", [distributed-enabled] " + this.siddhiContext.isDistributedProcessingEnabled());
- }
- }
-
- @Override
- public void schedule() {
- if (lastSchedule != null) {
- lastSchedule.cancel(false);
- }
- lastSchedule = faultHandleScheduler.schedule(this, timeToKeep, TimeUnit.MILLISECONDS);
- }
-
- @Override
- public void scheduleNow() {
- if (lastSchedule != null) {
- lastSchedule.cancel(false);
- }
- lastSchedule = faultHandleScheduler.schedule(this, 0, TimeUnit.MILLISECONDS);
- }
-
- @Override
- public void setScheduledExecutorService(ScheduledExecutorService scheduledExecutorService) {
- this.faultHandleScheduler = scheduledExecutorService;
- }
-
- @Override
- public void setThreadBarrier(ThreadBarrier threadBarrier) {
- this.threadBarrier = threadBarrier;
- }
-
- @Override
- public void destroy(){
- // terminate topology listener thread
- cepTopologyEventReceiver.terminate();
- window = null;
-
- // Shutdown executor service
- if(executorService != null) {
- try {
- executorService.shutdownNow();
- } catch (Exception e) {
- log.warn("An error occurred while shutting down cep extension executor service", e);
- }
- }
- }
-
- public ConcurrentHashMap<String, Long> getMemberTimeStampMap() {
- return memberTimeStampMap;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/GradientFinderWindowProcessor.java
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/GradientFinderWindowProcessor.java b/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/GradientFinderWindowProcessor.java
deleted file mode 100644
index dff0f79..0000000
--- a/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/GradientFinderWindowProcessor.java
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
- * 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.stratos.cep.extension;
-
-import org.apache.log4j.Logger;
-import org.wso2.siddhi.core.config.SiddhiContext;
-import org.wso2.siddhi.core.event.StreamEvent;
-import org.wso2.siddhi.core.event.in.InEvent;
-import org.wso2.siddhi.core.event.in.InListEvent;
-import org.wso2.siddhi.core.event.remove.RemoveEvent;
-import org.wso2.siddhi.core.event.remove.RemoveListEvent;
-import org.wso2.siddhi.core.persistence.ThreadBarrier;
-import org.wso2.siddhi.core.query.QueryPostProcessingElement;
-import org.wso2.siddhi.core.query.processor.window.RunnableWindowProcessor;
-import org.wso2.siddhi.core.query.processor.window.WindowProcessor;
-import org.wso2.siddhi.core.util.collection.queue.scheduler.ISchedulerSiddhiQueue;
-import org.wso2.siddhi.core.util.collection.queue.scheduler.SchedulerSiddhiQueue;
-import org.wso2.siddhi.core.util.collection.queue.scheduler.SchedulerSiddhiQueueGrid;
-import org.wso2.siddhi.query.api.definition.AbstractDefinition;
-import org.wso2.siddhi.query.api.definition.Attribute;
-import org.wso2.siddhi.query.api.definition.Attribute.Type;
-import org.wso2.siddhi.query.api.expression.Expression;
-import org.wso2.siddhi.query.api.expression.Variable;
-import org.wso2.siddhi.query.api.expression.constant.IntConstant;
-import org.wso2.siddhi.query.api.expression.constant.LongConstant;
-import org.wso2.siddhi.query.api.extension.annotation.SiddhiExtension;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.concurrent.RejectedExecutionException;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledFuture;
-import java.util.concurrent.TimeUnit;
-
-@SiddhiExtension(namespace = "stratos", function = "gradient")
-public class GradientFinderWindowProcessor extends WindowProcessor implements RunnableWindowProcessor {
-
- static final Logger log = Logger.getLogger(GradientFinderWindowProcessor.class);
- private ScheduledExecutorService eventRemoverScheduler;
- private ScheduledFuture<?> lastSchedule;
- private long timeToKeep;
- private int subjectedAttrIndex;
- private Attribute.Type subjectedAttrType;
- private List<InEvent> newEventList;
- private List<RemoveEvent> oldEventList;
- private ThreadBarrier threadBarrier;
- private ISchedulerSiddhiQueue<StreamEvent> window;
-
- @Override
- protected void processEvent(InEvent event) {
- acquireLock();
- try {
- newEventList.add(event);
- } finally {
- releaseLock();
- }
- }
-
- @Override
- protected void processEvent(InListEvent listEvent) {
- acquireLock();
- try {
- System.out.println(listEvent);
- for (int i = 0, size = listEvent.getActiveEvents(); i < size; i++) {
- newEventList.add((InEvent) listEvent.getEvent(i));
- }
- } finally {
- releaseLock();
- }
- }
-
- @Override
- public Iterator<StreamEvent> iterator() {
- return window.iterator();
- }
-
- @Override
- public Iterator<StreamEvent> iterator(String predicate) {
- if (siddhiContext.isDistributedProcessingEnabled()) {
- return ((SchedulerSiddhiQueueGrid<StreamEvent>) window).iterator(predicate);
- } else {
- return window.iterator();
- }
- }
-
-
- @Override
- public void run() {
- acquireLock();
- try {
- long scheduledTime = System.currentTimeMillis();
- try {
- oldEventList.clear();
- while (true) {
- threadBarrier.pass();
- RemoveEvent removeEvent = (RemoveEvent) window.poll();
- if (removeEvent == null) {
- if (oldEventList.size() > 0) {
- nextProcessor.process(new RemoveListEvent(
- oldEventList.toArray(new RemoveEvent[oldEventList.size()])));
- oldEventList.clear();
- }
-
- if (newEventList.size() > 0) {
- InEvent[] inEvents =
- newEventList.toArray(new InEvent[newEventList.size()]);
- for (InEvent inEvent : inEvents) {
- window.put(new RemoveEvent(inEvent, -1));
- }
-
- InEvent[] gradientEvents = gradient(inEvents[0], inEvents[newEventList.size() - 1]);
-
- for (InEvent inEvent : gradientEvents) {
- window.put(new RemoveEvent(inEvent, -1));
- }
- nextProcessor.process(new InListEvent(gradientEvents));
-
- newEventList.clear();
- }
-
- long diff = timeToKeep - (System.currentTimeMillis() - scheduledTime);
- if (diff > 0) {
- try {
- if (lastSchedule != null) {
- lastSchedule.cancel(false);
- }
- lastSchedule = eventRemoverScheduler.schedule(this, diff, TimeUnit.MILLISECONDS);
- } catch (RejectedExecutionException ex) {
- log.warn("scheduling cannot be accepted for execution: elementID " +
- elementId);
- }
- break;
- }
- scheduledTime = System.currentTimeMillis();
- } else {
- oldEventList.add(new RemoveEvent(removeEvent, System.currentTimeMillis()));
- }
- }
- } catch (Throwable t) {
- log.error(t.getMessage(), t);
- }
- } finally {
- releaseLock();
- }
- }
-
-
- /**
- * This function will calculate the linear gradient (per second) of the events received during
- * a specified time period.
- */
- private InEvent[] gradient(InEvent firstInEvent, InEvent lastInEvent) {
- double firstVal = 0.0, lastVal = 0.0;
- // FIXME I'm not sure whether there's some other good way to do correct casting,
- // based on the type.
- if (Type.DOUBLE.equals(subjectedAttrType)) {
- firstVal = (Double) firstInEvent.getData()[subjectedAttrIndex];
- lastVal = (Double) lastInEvent.getData()[subjectedAttrIndex];
- } else if (Type.INT.equals(subjectedAttrType)) {
- firstVal = (Integer) firstInEvent.getData()[subjectedAttrIndex];
- lastVal = (Integer) lastInEvent.getData()[subjectedAttrIndex];
- } else if (Type.LONG.equals(subjectedAttrType)) {
- firstVal = (Long) firstInEvent.getData()[subjectedAttrIndex];
- lastVal = (Long) lastInEvent.getData()[subjectedAttrIndex];
- } else if (Type.FLOAT.equals(subjectedAttrType)) {
- firstVal = (Float) firstInEvent.getData()[subjectedAttrIndex];
- lastVal = (Float) lastInEvent.getData()[subjectedAttrIndex];
- }
-
- long t1 = firstInEvent.getTimeStamp();
- long t2 = lastInEvent.getTimeStamp();
- long millisecondsForASecond = 1000;
- long tGap = t2 - t1 > millisecondsForASecond ? t2 - t1 : millisecondsForASecond;
- double gradient = 0.0;
- if (tGap > 0) {
- gradient = ((lastVal - firstVal) * millisecondsForASecond) / tGap;
- }
- if (log.isDebugEnabled()) {
- log.debug("Gradient: " + gradient + " Last val: " + lastVal +
- " First val: " + firstVal + " Time Gap: " + tGap + " t1: "+t1+ " t2: "+
- t2+" hash: "+this.hashCode());
- }
- Object[] data = firstInEvent.getData().clone();
- data[subjectedAttrIndex] = gradient;
- InEvent gradientEvent =
- new InEvent(firstInEvent.getStreamId(), (t1+t2)/2,
- data);
- InEvent[] output = new InEvent[1];
- output[0] = gradientEvent;
- return output;
- }
-
- @Override
- protected Object[] currentState() {
- return new Object[]{window.currentState(), oldEventList, newEventList};
- }
-
- @Override
- protected void restoreState(Object[] data) {
- window.restoreState(data);
- window.restoreState((Object[]) data[0]);
- oldEventList = ((ArrayList<RemoveEvent>) data[1]);
- newEventList = ((ArrayList<InEvent>) data[2]);
- window.reSchedule();
- }
-
- @Override
- protected void init(Expression[] parameters, QueryPostProcessingElement nextProcessor, AbstractDefinition streamDefinition, String elementId, boolean async, SiddhiContext siddhiContext) {
- if (parameters[0] instanceof IntConstant) {
- timeToKeep = ((IntConstant) parameters[0]).getValue();
- } else {
- timeToKeep = ((LongConstant) parameters[0]).getValue();
- }
-
- String subjectedAttr = ((Variable)parameters[1]).getAttributeName();
- subjectedAttrIndex = streamDefinition.getAttributePosition(subjectedAttr);
- subjectedAttrType = streamDefinition.getAttributeType(subjectedAttr);
-
- oldEventList = new ArrayList<RemoveEvent>();
- if (this.siddhiContext.isDistributedProcessingEnabled()) {
- newEventList = this.siddhiContext.getHazelcastInstance().getList(elementId + "-newEventList");
- } else {
- newEventList = new ArrayList<InEvent>();
- }
-
- if (this.siddhiContext.isDistributedProcessingEnabled()) {
- window = new SchedulerSiddhiQueueGrid<StreamEvent>(elementId, this, this.siddhiContext, this.async);
- } else {
- window = new SchedulerSiddhiQueue<StreamEvent>(this);
- }
- //Ordinary scheduling
- window.schedule();
-
- }
-
- @Override
- public void schedule() {
- if (lastSchedule != null) {
- lastSchedule.cancel(false);
- }
- lastSchedule = eventRemoverScheduler.schedule(this, timeToKeep, TimeUnit.MILLISECONDS);
- }
-
- public void scheduleNow() {
- if (lastSchedule != null) {
- lastSchedule.cancel(false);
- }
- lastSchedule = eventRemoverScheduler.schedule(this, 0, TimeUnit.MILLISECONDS);
- }
-
- @Override
- public void setScheduledExecutorService(ScheduledExecutorService scheduledExecutorService) {
- this.eventRemoverScheduler = scheduledExecutorService;
- }
-
- public void setThreadBarrier(ThreadBarrier threadBarrier) {
- this.threadBarrier = threadBarrier;
- }
-
- @Override
- public void destroy(){
- oldEventList = null;
- newEventList = null;
- window = null;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/MemeberRequestHandlingCapabilityWindowProcessor.java
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/MemeberRequestHandlingCapabilityWindowProcessor.java b/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/MemeberRequestHandlingCapabilityWindowProcessor.java
deleted file mode 100755
index 0dc24bd..0000000
--- a/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/MemeberRequestHandlingCapabilityWindowProcessor.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * 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.stratos.cep.extension;
-
-/**
- * Member Request Handling Capability Window Processor
- */
-
-import org.wso2.siddhi.core.config.SiddhiContext;
-import org.wso2.siddhi.core.executor.function.FunctionExecutor;
-import org.wso2.siddhi.query.api.definition.Attribute;
-import org.wso2.siddhi.query.api.extension.annotation.SiddhiExtension;
-
-@SiddhiExtension(namespace = "stratos", function = "divider")
-public class MemeberRequestHandlingCapabilityWindowProcessor extends FunctionExecutor {
-
- Attribute.Type returnType = Attribute.Type.DOUBLE;
-
- @Override
- public void init(Attribute.Type[] types, SiddhiContext siddhiContext) {
- }
-
- @Override
- protected Object process(Object obj) {
-
- double[] value = new double[2];
- if (obj instanceof Object[]) {
- int i=0;
- for (Object aObj : (Object[]) obj) {
- value[i]= Double.parseDouble(String.valueOf(aObj));
- i++;
- }
- }//to do avoid deviding zero number of active instances won't be zero cz there is min
- Double unit = (value[0] / value[1]);
- if(!unit.isNaN() && !unit.isInfinite())
- return unit;
- else
- return 0.0;
-
- }
-
- @Override
- public void destroy() {
-
- }
-
- @Override
- public Attribute.Type getReturnType() {
- return returnType;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/SecondDerivativeFinderWindowProcessor.java
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/SecondDerivativeFinderWindowProcessor.java b/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/SecondDerivativeFinderWindowProcessor.java
deleted file mode 100644
index 96cff22..0000000
--- a/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/SecondDerivativeFinderWindowProcessor.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/*
- * 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.stratos.cep.extension;
-
-import org.apache.log4j.Logger;
-import org.wso2.siddhi.core.config.SiddhiContext;
-import org.wso2.siddhi.core.event.StreamEvent;
-import org.wso2.siddhi.core.event.in.InEvent;
-import org.wso2.siddhi.core.event.in.InListEvent;
-import org.wso2.siddhi.core.event.remove.RemoveEvent;
-import org.wso2.siddhi.core.event.remove.RemoveListEvent;
-import org.wso2.siddhi.core.persistence.ThreadBarrier;
-import org.wso2.siddhi.core.query.QueryPostProcessingElement;
-import org.wso2.siddhi.core.query.processor.window.RunnableWindowProcessor;
-import org.wso2.siddhi.core.query.processor.window.WindowProcessor;
-import org.wso2.siddhi.core.util.collection.queue.scheduler.ISchedulerSiddhiQueue;
-import org.wso2.siddhi.core.util.collection.queue.scheduler.SchedulerSiddhiQueue;
-import org.wso2.siddhi.core.util.collection.queue.scheduler.SchedulerSiddhiQueueGrid;
-import org.wso2.siddhi.query.api.definition.AbstractDefinition;
-import org.wso2.siddhi.query.api.definition.Attribute;
-import org.wso2.siddhi.query.api.definition.Attribute.Type;
-import org.wso2.siddhi.query.api.expression.Expression;
-import org.wso2.siddhi.query.api.expression.Variable;
-import org.wso2.siddhi.query.api.expression.constant.IntConstant;
-import org.wso2.siddhi.query.api.expression.constant.LongConstant;
-import org.wso2.siddhi.query.api.extension.annotation.SiddhiExtension;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.concurrent.RejectedExecutionException;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledFuture;
-import java.util.concurrent.TimeUnit;
-
-@SiddhiExtension(namespace = "stratos", function = "secondDerivative")
-public class SecondDerivativeFinderWindowProcessor extends WindowProcessor implements RunnableWindowProcessor {
-
- static final Logger log = Logger.getLogger(SecondDerivativeFinderWindowProcessor.class);
- private ScheduledExecutorService eventRemoverScheduler;
- private ScheduledFuture<?> lastSchedule;
- private long timeToKeep;
- private int subjectedAttrIndex;
- private Attribute.Type subjectedAttrType;
- private List<InEvent> newEventList;
- private List<RemoveEvent> oldEventList;
- private ThreadBarrier threadBarrier;
- private ISchedulerSiddhiQueue<StreamEvent> window;
-
- @Override
- protected void processEvent(InEvent event) {
- acquireLock();
- try {
- newEventList.add(event);
- } finally {
- releaseLock();
- }
- }
-
- @Override
- protected void processEvent(InListEvent listEvent) {
- acquireLock();
- try {
- System.out.println(listEvent);
- for (int i = 0, size = listEvent.getActiveEvents(); i < size; i++) {
- newEventList.add((InEvent) listEvent.getEvent(i));
- }
- } finally {
- releaseLock();
- }
- }
-
- @Override
- public Iterator<StreamEvent> iterator() {
- return window.iterator();
- }
-
- @Override
- public Iterator<StreamEvent> iterator(String predicate) {
- if (siddhiContext.isDistributedProcessingEnabled()) {
- return ((SchedulerSiddhiQueueGrid<StreamEvent>) window).iterator(predicate);
- } else {
- return window.iterator();
- }
- }
-
-
- @Override
- public void run() {
- acquireLock();
- try {
- long scheduledTime = System.currentTimeMillis();
- try {
- oldEventList.clear();
- while (true) {
- threadBarrier.pass();
- RemoveEvent removeEvent = (RemoveEvent) window.poll();
- if (removeEvent == null) {
- if (oldEventList.size() > 0) {
- nextProcessor.process(new RemoveListEvent(
- oldEventList.toArray(new RemoveEvent[oldEventList.size()])));
- oldEventList.clear();
- }
-
- if (newEventList.size() > 0) {
- InEvent[] inEvents =
- newEventList.toArray(new InEvent[newEventList.size()]);
- for (InEvent inEvent : inEvents) {
- window.put(new RemoveEvent(inEvent, -1));
- }
-
- // in order to find second derivative, we need at least 3 events.
- if (newEventList.size() > 2) {
-
- InEvent firstDerivative1 =
- gradient(inEvents[0],
- inEvents[(newEventList.size() / 2) - 1],
- null)[0];
- InEvent firstDerivative2 =
- gradient(inEvents[newEventList.size() / 2],
- inEvents[newEventList.size() - 1],
- null)[0];
- InEvent[] secondDerivative =
- gradient(firstDerivative1,
- firstDerivative2, Type.DOUBLE);
-
- for (InEvent inEvent : secondDerivative) {
- window.put(new RemoveEvent(inEvent, -1));
- }
- nextProcessor.process(new InListEvent(secondDerivative));
- } else {
- log.debug("Insufficient events to calculate second derivative. We need at least 3 events. Current event count: " +
- newEventList.size());
- }
-
- newEventList.clear();
- }
-
- long diff = timeToKeep - (System.currentTimeMillis() - scheduledTime);
- if (diff > 0) {
- try {
- if (lastSchedule != null) {
- lastSchedule.cancel(false);
- }
- lastSchedule = eventRemoverScheduler.schedule(this, diff, TimeUnit.MILLISECONDS);
- } catch (RejectedExecutionException ex) {
- log.warn("scheduling cannot be accepted for execution: elementID " +
- elementId);
- }
- break;
- }
- scheduledTime = System.currentTimeMillis();
- } else {
- oldEventList.add(new RemoveEvent(removeEvent, System.currentTimeMillis()));
- }
- }
- } catch (Throwable t) {
- log.error(t.getMessage(), t);
- }
- } finally {
- releaseLock();
- }
- }
-
-
- /**
- * This function will calculate the linear gradient (per second) of the events received during
- * a specified time period.
- */
- private InEvent[] gradient(InEvent firstInEvent, InEvent lastInEvent, Type type) {
- Type attrType = type == null ? subjectedAttrType : type;
- double firstVal = 0.0, lastVal = 0.0;
- // FIXME I'm not sure whether there's some other good way to do correct casting,
- // based on the type.
- if (Type.DOUBLE.equals(attrType)) {
- firstVal = (Double) firstInEvent.getData()[subjectedAttrIndex];
- lastVal = (Double) lastInEvent.getData()[subjectedAttrIndex];
- } else if (Type.INT.equals(attrType)) {
- firstVal = (Integer) firstInEvent.getData()[subjectedAttrIndex];
- lastVal = (Integer) lastInEvent.getData()[subjectedAttrIndex];
- } else if (Type.LONG.equals(attrType)) {
- firstVal = (Long) firstInEvent.getData()[subjectedAttrIndex];
- lastVal = (Long) lastInEvent.getData()[subjectedAttrIndex];
- } else if (Type.FLOAT.equals(attrType)) {
- firstVal = (Float) firstInEvent.getData()[subjectedAttrIndex];
- lastVal = (Float) lastInEvent.getData()[subjectedAttrIndex];
- }
-
- long t1 = firstInEvent.getTimeStamp();
- long t2 = lastInEvent.getTimeStamp();
- long millisecondsForASecond = 1000;
- long tGap = t2 - t1 > millisecondsForASecond ? t2 - t1 : millisecondsForASecond;
- double gradient = 0.0;
- if (tGap > 0) {
- gradient = ((lastVal - firstVal) * millisecondsForASecond) / tGap;
- }
- if (log.isDebugEnabled()) {
- log.debug("Gradient: " + gradient + " Last val: " + lastVal +
- " First val: " + firstVal + " Time Gap: " + tGap + " t1: "+t1+ " t2: "+
- t2+" hash: "+this.hashCode());
- }
- Object[] data = firstInEvent.getData().clone();
- data[subjectedAttrIndex] = gradient;
- InEvent gradientEvent =
- new InEvent(firstInEvent.getStreamId(), t1+((t2-t1)/2),
- data);
- InEvent[] output = new InEvent[1];
- output[0] = gradientEvent;
- return output;
- }
-
- @Override
- protected Object[] currentState() {
- return new Object[]{window.currentState(), oldEventList, newEventList};
- }
-
- @Override
- protected void restoreState(Object[] data) {
- window.restoreState(data);
- window.restoreState((Object[]) data[0]);
- oldEventList = ((ArrayList<RemoveEvent>) data[1]);
- newEventList = ((ArrayList<InEvent>) data[2]);
- window.reSchedule();
- }
-
- @Override
- protected void init(Expression[] parameters, QueryPostProcessingElement nextProcessor, AbstractDefinition streamDefinition, String elementId, boolean async, SiddhiContext siddhiContext) {
- if (parameters[0] instanceof IntConstant) {
- timeToKeep = ((IntConstant) parameters[0]).getValue();
- } else {
- timeToKeep = ((LongConstant) parameters[0]).getValue();
- }
-
- String subjectedAttr = ((Variable)parameters[1]).getAttributeName();
- subjectedAttrIndex = streamDefinition.getAttributePosition(subjectedAttr);
- subjectedAttrType = streamDefinition.getAttributeType(subjectedAttr);
-
- oldEventList = new ArrayList<RemoveEvent>();
- if (this.siddhiContext.isDistributedProcessingEnabled()) {
- newEventList = this.siddhiContext.getHazelcastInstance().getList(elementId + "-newEventList");
- } else {
- newEventList = new ArrayList<InEvent>();
- }
-
- if (this.siddhiContext.isDistributedProcessingEnabled()) {
- window = new SchedulerSiddhiQueueGrid<StreamEvent>(elementId, this, this.siddhiContext, this.async);
- } else {
- window = new SchedulerSiddhiQueue<StreamEvent>(this);
- }
- //Ordinary scheduling
- window.schedule();
-
- }
-
- @Override
- public void schedule() {
- if (lastSchedule != null) {
- lastSchedule.cancel(false);
- }
- lastSchedule = eventRemoverScheduler.schedule(this, timeToKeep, TimeUnit.MILLISECONDS);
- }
-
- public void scheduleNow() {
- if (lastSchedule != null) {
- lastSchedule.cancel(false);
- }
- lastSchedule = eventRemoverScheduler.schedule(this, 0, TimeUnit.MILLISECONDS);
- }
-
- @Override
- public void setScheduledExecutorService(ScheduledExecutorService scheduledExecutorService) {
- this.eventRemoverScheduler = scheduledExecutorService;
- }
-
- public void setThreadBarrier(ThreadBarrier threadBarrier) {
- this.threadBarrier = threadBarrier;
- }
-
- @Override
- public void destroy(){
- oldEventList = null;
- newEventList = null;
- window = null;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/stratos-cep-extension/wso2cep-3.0.0/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/stratos-cep-extension/wso2cep-3.0.0/pom.xml b/extensions/cep/modules/stratos-cep-extension/wso2cep-3.0.0/pom.xml
new file mode 100644
index 0000000..1b2bc7a
--- /dev/null
+++ b/extensions/cep/modules/stratos-cep-extension/wso2cep-3.0.0/pom.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ # 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.
+ -->
+<project xmlns="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">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.stratos</groupId>
+ <artifactId>cep-extensions</artifactId>
+ <version>4.1.3-SNAPSHOT</version>
+ <relativePath>../../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>org.apache.stratos.cep300.extension</artifactId>
+ <name>Apache Stratos - CEP Extensions</name>
+ <description>Apache Stratos CEP Extensions</description>
+
+ <repositories>
+ <repository>
+ <id>wso2-maven2-repository</id>
+ <name>WSO2 Maven2 Repository</name>
+ <url>http://dist.wso2.org/maven2</url>
+ </repository>
+ </repositories>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.wso2.siddhi</groupId>
+ <artifactId>siddhi-core</artifactId>
+ <version>2.0.0-wso2v5</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.stratos</groupId>
+ <artifactId>org.apache.stratos.messaging</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/stratos-cep-extension/wso2cep-3.0.0/src/main/java/org/apache/stratos/cep/extension/CEPTopologyEventReceiver.java
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/stratos-cep-extension/wso2cep-3.0.0/src/main/java/org/apache/stratos/cep/extension/CEPTopologyEventReceiver.java b/extensions/cep/modules/stratos-cep-extension/wso2cep-3.0.0/src/main/java/org/apache/stratos/cep/extension/CEPTopologyEventReceiver.java
new file mode 100644
index 0000000..59c70c5
--- /dev/null
+++ b/extensions/cep/modules/stratos-cep-extension/wso2cep-3.0.0/src/main/java/org/apache/stratos/cep/extension/CEPTopologyEventReceiver.java
@@ -0,0 +1,99 @@
+/*
+ * 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.stratos.cep.extension;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.messaging.event.Event;
+import org.apache.stratos.messaging.event.topology.CompleteTopologyEvent;
+import org.apache.stratos.messaging.event.topology.MemberActivatedEvent;
+import org.apache.stratos.messaging.event.topology.MemberTerminatedEvent;
+import org.apache.stratos.messaging.listener.topology.CompleteTopologyEventListener;
+import org.apache.stratos.messaging.listener.topology.MemberActivatedEventListener;
+import org.apache.stratos.messaging.listener.topology.MemberTerminatedEventListener;
+import org.apache.stratos.messaging.message.receiver.topology.TopologyEventReceiver;
+import org.apache.stratos.messaging.message.receiver.topology.TopologyManager;
+
+/**
+ * CEP Topology Receiver for Fault Handling Window Processor.
+ */
+public class CEPTopologyEventReceiver extends TopologyEventReceiver {
+
+ private static final Log log = LogFactory.getLog(CEPTopologyEventReceiver.class);
+
+ private FaultHandlingWindowProcessor faultHandler;
+
+ public CEPTopologyEventReceiver(FaultHandlingWindowProcessor faultHandler) {
+ this.faultHandler = faultHandler;
+ addEventListeners();
+ }
+
+ @Override
+ public void execute() {
+ super.execute();
+ log.info("CEP topology event receiver thread started");
+ }
+
+ private void addEventListeners() {
+ // Load member time stamp map from the topology as a one time task
+ addEventListener(new CompleteTopologyEventListener() {
+ private boolean initialized;
+
+ @Override
+ protected void onEvent(Event event) {
+ if (!initialized) {
+ try {
+ TopologyManager.acquireReadLock();
+ log.debug("Complete topology event received to fault handling window processor.");
+ CompleteTopologyEvent completeTopologyEvent = (CompleteTopologyEvent) event;
+ initialized = faultHandler.loadTimeStampMapFromTopology(completeTopologyEvent.getTopology());
+ } catch (Exception e) {
+ log.error("Error loading member time stamp map from complete topology event.", e);
+ } finally {
+ TopologyManager.releaseReadLock();
+ }
+ }
+ }
+ });
+
+ // Remove member from the time stamp map when MemberTerminated event is received.
+ addEventListener(new MemberTerminatedEventListener() {
+ @Override
+ protected void onEvent(Event event) {
+ MemberTerminatedEvent memberTerminatedEvent = (MemberTerminatedEvent) event;
+ faultHandler.getMemberTimeStampMap().remove(memberTerminatedEvent.getMemberId());
+ log.debug("Member was removed from the timestamp map: [member] " + memberTerminatedEvent.getMemberId());
+ }
+ });
+
+ // Add member to time stamp map whenever member is activated
+ addEventListener(new MemberActivatedEventListener() {
+ @Override
+ protected void onEvent(Event event) {
+ MemberActivatedEvent memberActivatedEvent = (MemberActivatedEvent) event;
+
+ // do not put this member if we have already received a health event
+ faultHandler.getMemberTimeStampMap().putIfAbsent(memberActivatedEvent.getMemberId(),
+ System.currentTimeMillis());
+ log.debug("Member was added to the timestamp map: [member] " + memberActivatedEvent.getMemberId());
+ }
+ });
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/stratos-cep-extension/wso2cep-3.0.0/src/main/java/org/apache/stratos/cep/extension/ConcatWindowProcessor.java
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/stratos-cep-extension/wso2cep-3.0.0/src/main/java/org/apache/stratos/cep/extension/ConcatWindowProcessor.java b/extensions/cep/modules/stratos-cep-extension/wso2cep-3.0.0/src/main/java/org/apache/stratos/cep/extension/ConcatWindowProcessor.java
new file mode 100644
index 0000000..699f036
--- /dev/null
+++ b/extensions/cep/modules/stratos-cep-extension/wso2cep-3.0.0/src/main/java/org/apache/stratos/cep/extension/ConcatWindowProcessor.java
@@ -0,0 +1,54 @@
+/*
+ * 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.stratos.cep.extension;
+import org.wso2.siddhi.core.config.SiddhiContext;
+import org.wso2.siddhi.core.executor.function.FunctionExecutor;
+import org.wso2.siddhi.query.api.definition.Attribute;
+import org.wso2.siddhi.query.api.extension.annotation.SiddhiExtension;
+
+@SiddhiExtension(namespace = "stratos", function = "concat")
+public class ConcatWindowProcessor extends FunctionExecutor {
+ Attribute.Type returnType = Attribute.Type.STRING;
+ @Override
+ public void init(Attribute.Type[] types, SiddhiContext siddhiContext) {
+ }
+
+ @Override
+ protected Object process(Object obj) {
+ if (obj instanceof Object[]) {
+ StringBuffer sb=new StringBuffer();
+ for (Object aObj : (Object[]) obj) {
+ sb.append(aObj);
+ }
+ return sb.toString();
+ } else {
+ return obj.toString();
+ }
+
+ }
+
+ @Override
+ public void destroy() {
+ }
+
+ @Override
+ public Attribute.Type getReturnType() {
+ return returnType;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/stratos-cep-extension/wso2cep-3.0.0/src/main/java/org/apache/stratos/cep/extension/FaultHandlingWindowProcessor.java
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/stratos-cep-extension/wso2cep-3.0.0/src/main/java/org/apache/stratos/cep/extension/FaultHandlingWindowProcessor.java b/extensions/cep/modules/stratos-cep-extension/wso2cep-3.0.0/src/main/java/org/apache/stratos/cep/extension/FaultHandlingWindowProcessor.java
new file mode 100644
index 0000000..0aa01ed
--- /dev/null
+++ b/extensions/cep/modules/stratos-cep-extension/wso2cep-3.0.0/src/main/java/org/apache/stratos/cep/extension/FaultHandlingWindowProcessor.java
@@ -0,0 +1,349 @@
+/*
+ * 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.stratos.cep.extension;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.log4j.Logger;
+import org.apache.stratos.common.threading.StratosThreadPool;
+import org.apache.stratos.messaging.broker.publish.EventPublisher;
+import org.apache.stratos.messaging.broker.publish.EventPublisherPool;
+import org.apache.stratos.messaging.domain.topology.*;
+import org.apache.stratos.messaging.event.health.stat.MemberFaultEvent;
+import org.apache.stratos.messaging.message.receiver.topology.TopologyManager;
+import org.apache.stratos.messaging.util.MessagingUtil;
+import org.wso2.siddhi.core.config.SiddhiContext;
+import org.wso2.siddhi.core.event.StreamEvent;
+import org.wso2.siddhi.core.event.in.InEvent;
+import org.wso2.siddhi.core.event.in.InListEvent;
+import org.wso2.siddhi.core.persistence.ThreadBarrier;
+import org.wso2.siddhi.core.query.QueryPostProcessingElement;
+import org.wso2.siddhi.core.query.processor.window.RunnableWindowProcessor;
+import org.wso2.siddhi.core.query.processor.window.WindowProcessor;
+import org.wso2.siddhi.core.util.collection.queue.scheduler.ISchedulerSiddhiQueue;
+import org.wso2.siddhi.core.util.collection.queue.scheduler.SchedulerSiddhiQueue;
+import org.wso2.siddhi.core.util.collection.queue.scheduler.SchedulerSiddhiQueueGrid;
+import org.wso2.siddhi.query.api.definition.AbstractDefinition;
+import org.wso2.siddhi.query.api.expression.Expression;
+import org.wso2.siddhi.query.api.expression.Variable;
+import org.wso2.siddhi.query.api.expression.constant.IntConstant;
+import org.wso2.siddhi.query.api.expression.constant.LongConstant;
+import org.wso2.siddhi.query.api.extension.annotation.SiddhiExtension;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * CEP window processor to handle faulty member instances. This window processor is responsible for
+ * publishing MemberFault event if health stats are not received within a given time window.
+ */
+@SiddhiExtension(namespace = "stratos", function = "faultHandling")
+public class FaultHandlingWindowProcessor extends WindowProcessor implements RunnableWindowProcessor {
+
+ private static final Logger log = Logger.getLogger(FaultHandlingWindowProcessor.class);
+
+ private static final int TIME_OUT = 60 * 1000;
+ public static final String CEP_EXTENSION_THREAD_POOL_KEY = "cep.extension.thread.pool";
+ public static final int CEP_EXTENSION_THREAD_POOL_SIZE = 10;
+
+ private ExecutorService executorService;
+ private ScheduledExecutorService faultHandleScheduler;
+ private ScheduledFuture<?> lastSchedule;
+ private ThreadBarrier threadBarrier;
+ private long timeToKeep;
+ private ISchedulerSiddhiQueue<StreamEvent> window;
+ private EventPublisher healthStatPublisher =
+ EventPublisherPool.getPublisher(MessagingUtil.Topics.HEALTH_STAT_TOPIC.getTopicName());
+ private Map<String, Object> MemberFaultEventMap = new HashMap<String, Object>();
+ private Map<String, Object> memberFaultEventMessageMap = new HashMap<String, Object>();
+
+ // Map of member id's to their last received health event time stamp
+ private ConcurrentHashMap<String, Long> memberTimeStampMap = new ConcurrentHashMap<String, Long>();
+
+ // Event receiver to receive topology events published by cloud-controller
+ private CEPTopologyEventReceiver cepTopologyEventReceiver = new CEPTopologyEventReceiver(this);
+
+ // Stratos member id attribute index in stream execution plan
+ private int memberIdAttrIndex;
+
+ @Override
+ protected void processEvent(InEvent event) {
+ addDataToMap(event);
+ }
+
+ @Override
+ protected void processEvent(InListEvent listEvent) {
+ for (int i = 0, size = listEvent.getActiveEvents(); i < size; i++) {
+ addDataToMap((InEvent) listEvent.getEvent(i));
+ }
+ }
+
+ /**
+ * Add new entry to time stamp map from the received event.
+ *
+ * @param event Event received by Siddhi.
+ */
+ protected void addDataToMap(InEvent event) {
+ String id = (String) event.getData()[memberIdAttrIndex];
+ //checking whether this member is the topology.
+ //sometimes there can be a delay between publishing member terminated events
+ //and actually terminating instances. Hence CEP might get events for already terminated members
+ //so we are checking the topology for the member existence
+ Member member = getMemberFromId(id);
+ if (null == member) {
+ log.debug("Member not found in the topology. Event rejected");
+ return;
+ }
+ if (StringUtils.isNotEmpty(id)) {
+ memberTimeStampMap.put(id, event.getTimeStamp());
+ } else {
+ log.warn("NULL member id found in the event received. Event rejected.");
+ }
+ if (log.isDebugEnabled()){
+ log.debug("Event received from [member-id] " + id + " [time-stamp] " + event.getTimeStamp());
+ }
+ }
+
+ @Override
+ public Iterator<StreamEvent> iterator() {
+ return window.iterator();
+ }
+
+ @Override
+ public Iterator<StreamEvent> iterator(String predicate) {
+ if (siddhiContext.isDistributedProcessingEnabled()) {
+ return ((SchedulerSiddhiQueueGrid<StreamEvent>) window).iterator(predicate);
+ } else {
+ return window.iterator();
+ }
+ }
+
+ /**
+ * Retrieve the current activated members from the topology and initialize the timestamp map.
+ * This will allow the system to recover from a restart
+ *
+ * @param topology Topology model object
+ */
+ boolean loadTimeStampMapFromTopology(Topology topology){
+
+ long currentTimeStamp = System.currentTimeMillis();
+ if (topology == null || topology.getServices() == null){
+ return false;
+ }
+ // TODO make this efficient by adding APIs to messaging component
+ for (Service service : topology.getServices()) {
+ if (service.getClusters() != null) {
+ for (Cluster cluster : service.getClusters()) {
+ if (cluster.getMembers() != null) {
+ for (Member member : cluster.getMembers()) {
+ // we are checking faulty status only in previously activated members
+ if (member != null && MemberStatus.Active.equals(member.getStatus())) {
+ // Initialize the member time stamp map from the topology at the beginning
+ memberTimeStampMap.putIfAbsent(member.getMemberId(), currentTimeStamp);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (log.isDebugEnabled()){
+ log.debug("Member timestamps were successfully loaded from the topology: [timestamps] " +
+ memberTimeStampMap);
+ }
+ return true;
+ }
+
+ private Member getMemberFromId(String memberId){
+ if (StringUtils.isEmpty(memberId)){
+ return null;
+ }
+ if (TopologyManager.getTopology().isInitialized()){
+ try {
+ TopologyManager.acquireReadLock();
+ if (TopologyManager.getTopology().getServices() == null){
+ return null;
+ }
+ // TODO make this efficient by adding APIs to messaging component
+ for (Service service : TopologyManager.getTopology().getServices()) {
+ if (service.getClusters() != null) {
+ for (Cluster cluster : service.getClusters()) {
+ if (cluster.getMembers() != null) {
+ for (Member member : cluster.getMembers()){
+ if (memberId.equals(member.getMemberId())){
+ return member;
+ }
+ }
+ }
+ }
+ }
+ }
+ } catch (Exception e) {
+ log.error("Error while reading topology" + e);
+ } finally {
+ TopologyManager.releaseReadLock();
+ }
+ }
+ return null;
+ }
+
+ private void publishMemberFault(String memberId){
+ Member member = getMemberFromId(memberId);
+ if (member == null){
+ log.warn("Failed to publish member fault event. Member having [member-id] " + memberId +
+ " does not exist in topology");
+ return;
+ }
+ log.info("Publishing member fault event for [member-id] " + memberId);
+
+ MemberFaultEvent memberFaultEvent = new MemberFaultEvent(member.getClusterId(), member.getClusterInstanceId(),
+ member.getMemberId(), member.getPartitionId(),
+ member.getNetworkPartitionId(), 0);
+
+ memberFaultEventMessageMap.put("message", memberFaultEvent);
+ healthStatPublisher.publish(MemberFaultEventMap, true);
+ }
+
+ @Override
+ public void run() {
+ try {
+ threadBarrier.pass();
+
+ for (Object o : memberTimeStampMap.entrySet()) {
+ Map.Entry pair = (Map.Entry) o;
+ long currentTime = System.currentTimeMillis();
+ Long eventTimeStamp = (Long) pair.getValue();
+
+ if ((currentTime - eventTimeStamp) > TIME_OUT) {
+ log.info("Faulty member detected [member-id] " + pair.getKey() + " with [last time-stamp] " +
+ eventTimeStamp + " [time-out] " + TIME_OUT + " milliseconds");
+ publishMemberFault((String) pair.getKey());
+ }
+ }
+ if (log.isDebugEnabled()){
+ log.debug("Fault handling processor iteration completed with [time-stamp map length] " +
+ memberTimeStampMap.size() + " [time-stamp map] " + memberTimeStampMap);
+ }
+ } catch (Throwable t) {
+ log.error(t.getMessage(), t);
+ } finally {
+ if (lastSchedule != null) {
+ lastSchedule.cancel(false);
+ }
+ lastSchedule = faultHandleScheduler.schedule(this, timeToKeep, TimeUnit.MILLISECONDS);
+ }
+ }
+
+ @Override
+ protected Object[] currentState() {
+ return new Object[]{window.currentState()};
+ }
+
+ @Override
+ protected void restoreState(Object[] data) {
+ window.restoreState(data);
+ window.restoreState((Object[]) data[0]);
+ window.reSchedule();
+ }
+
+ @Override
+ protected void init(Expression[] parameters, QueryPostProcessingElement nextProcessor,
+ AbstractDefinition streamDefinition, String elementId, boolean async, SiddhiContext siddhiContext) {
+
+ if (parameters[0] instanceof IntConstant) {
+ timeToKeep = ((IntConstant) parameters[0]).getValue();
+ } else {
+ timeToKeep = ((LongConstant) parameters[0]).getValue();
+ }
+
+ String memberIdAttrName = ((Variable) parameters[1]).getAttributeName();
+ memberIdAttrIndex = streamDefinition.getAttributePosition(memberIdAttrName);
+
+ if (this.siddhiContext.isDistributedProcessingEnabled()) {
+ window = new SchedulerSiddhiQueueGrid<StreamEvent>(elementId, this, this.siddhiContext, this.async);
+ } else {
+ window = new SchedulerSiddhiQueue<StreamEvent>(this);
+ }
+ MemberFaultEventMap.put("org.apache.stratos.messaging.event.health.stat.MemberFaultEvent", memberFaultEventMessageMap);
+
+ executorService = StratosThreadPool.getExecutorService(CEP_EXTENSION_THREAD_POOL_KEY,
+ CEP_EXTENSION_THREAD_POOL_SIZE);
+ cepTopologyEventReceiver.setExecutorService(executorService);
+ cepTopologyEventReceiver.execute();
+
+ //Ordinary scheduling
+ window.schedule();
+ if (log.isDebugEnabled()){
+ log.debug("Fault handling window processor initialized with [timeToKeep] " + timeToKeep +
+ ", [memberIdAttrName] " + memberIdAttrName + ", [memberIdAttrIndex] " + memberIdAttrIndex +
+ ", [distributed-enabled] " + this.siddhiContext.isDistributedProcessingEnabled());
+ }
+ }
+
+ @Override
+ public void schedule() {
+ if (lastSchedule != null) {
+ lastSchedule.cancel(false);
+ }
+ lastSchedule = faultHandleScheduler.schedule(this, timeToKeep, TimeUnit.MILLISECONDS);
+ }
+
+ @Override
+ public void scheduleNow() {
+ if (lastSchedule != null) {
+ lastSchedule.cancel(false);
+ }
+ lastSchedule = faultHandleScheduler.schedule(this, 0, TimeUnit.MILLISECONDS);
+ }
+
+ @Override
+ public void setScheduledExecutorService(ScheduledExecutorService scheduledExecutorService) {
+ this.faultHandleScheduler = scheduledExecutorService;
+ }
+
+ @Override
+ public void setThreadBarrier(ThreadBarrier threadBarrier) {
+ this.threadBarrier = threadBarrier;
+ }
+
+ @Override
+ public void destroy(){
+ // terminate topology listener thread
+ cepTopologyEventReceiver.terminate();
+ window = null;
+
+ // Shutdown executor service
+ if(executorService != null) {
+ try {
+ executorService.shutdownNow();
+ } catch (Exception e) {
+ log.warn("An error occurred while shutting down cep extension executor service", e);
+ }
+ }
+ }
+
+ public ConcurrentHashMap<String, Long> getMemberTimeStampMap() {
+ return memberTimeStampMap;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/stratos-cep-extension/wso2cep-3.0.0/src/main/java/org/apache/stratos/cep/extension/GradientFinderWindowProcessor.java
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/stratos-cep-extension/wso2cep-3.0.0/src/main/java/org/apache/stratos/cep/extension/GradientFinderWindowProcessor.java b/extensions/cep/modules/stratos-cep-extension/wso2cep-3.0.0/src/main/java/org/apache/stratos/cep/extension/GradientFinderWindowProcessor.java
new file mode 100644
index 0000000..f354ca7
--- /dev/null
+++ b/extensions/cep/modules/stratos-cep-extension/wso2cep-3.0.0/src/main/java/org/apache/stratos/cep/extension/GradientFinderWindowProcessor.java
@@ -0,0 +1,277 @@
+/*
+ * Copyright 2005-2009 WSO2, Inc. (http://wso2.com)
+ * Licensed 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.stratos.cep.extension;
+
+import org.apache.log4j.Logger;
+import org.wso2.siddhi.core.config.SiddhiContext;
+import org.wso2.siddhi.core.event.StreamEvent;
+import org.wso2.siddhi.core.event.in.InEvent;
+import org.wso2.siddhi.core.event.in.InListEvent;
+import org.wso2.siddhi.core.event.remove.RemoveEvent;
+import org.wso2.siddhi.core.event.remove.RemoveListEvent;
+import org.wso2.siddhi.core.persistence.ThreadBarrier;
+import org.wso2.siddhi.core.query.QueryPostProcessingElement;
+import org.wso2.siddhi.core.query.processor.window.RunnableWindowProcessor;
+import org.wso2.siddhi.core.query.processor.window.WindowProcessor;
+import org.wso2.siddhi.core.util.collection.queue.scheduler.ISchedulerSiddhiQueue;
+import org.wso2.siddhi.core.util.collection.queue.scheduler.SchedulerSiddhiQueue;
+import org.wso2.siddhi.core.util.collection.queue.scheduler.SchedulerSiddhiQueueGrid;
+import org.wso2.siddhi.query.api.definition.AbstractDefinition;
+import org.wso2.siddhi.query.api.definition.Attribute;
+import org.wso2.siddhi.query.api.definition.Attribute.Type;
+import org.wso2.siddhi.query.api.expression.Expression;
+import org.wso2.siddhi.query.api.expression.Variable;
+import org.wso2.siddhi.query.api.expression.constant.IntConstant;
+import org.wso2.siddhi.query.api.expression.constant.LongConstant;
+import org.wso2.siddhi.query.api.extension.annotation.SiddhiExtension;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.concurrent.RejectedExecutionException;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.TimeUnit;
+
+@SiddhiExtension(namespace = "stratos", function = "gradient")
+public class GradientFinderWindowProcessor extends WindowProcessor implements RunnableWindowProcessor {
+
+ static final Logger log = Logger.getLogger(GradientFinderWindowProcessor.class);
+ private ScheduledExecutorService eventRemoverScheduler;
+ private ScheduledFuture<?> lastSchedule;
+ private long timeToKeep;
+ private int subjectedAttrIndex;
+ private Type subjectedAttrType;
+ private List<InEvent> newEventList;
+ private List<RemoveEvent> oldEventList;
+ private ThreadBarrier threadBarrier;
+ private ISchedulerSiddhiQueue<StreamEvent> window;
+
+ @Override
+ protected void processEvent(InEvent event) {
+ acquireLock();
+ try {
+ newEventList.add(event);
+ } finally {
+ releaseLock();
+ }
+ }
+
+ @Override
+ protected void processEvent(InListEvent listEvent) {
+ acquireLock();
+ try {
+ System.out.println(listEvent);
+ for (int i = 0, size = listEvent.getActiveEvents(); i < size; i++) {
+ newEventList.add((InEvent) listEvent.getEvent(i));
+ }
+ } finally {
+ releaseLock();
+ }
+ }
+
+ @Override
+ public Iterator<StreamEvent> iterator() {
+ return window.iterator();
+ }
+
+ @Override
+ public Iterator<StreamEvent> iterator(String predicate) {
+ if (siddhiContext.isDistributedProcessingEnabled()) {
+ return ((SchedulerSiddhiQueueGrid<StreamEvent>) window).iterator(predicate);
+ } else {
+ return window.iterator();
+ }
+ }
+
+
+ @Override
+ public void run() {
+ acquireLock();
+ try {
+ long scheduledTime = System.currentTimeMillis();
+ try {
+ oldEventList.clear();
+ while (true) {
+ threadBarrier.pass();
+ RemoveEvent removeEvent = (RemoveEvent) window.poll();
+ if (removeEvent == null) {
+ if (oldEventList.size() > 0) {
+ nextProcessor.process(new RemoveListEvent(
+ oldEventList.toArray(new RemoveEvent[oldEventList.size()])));
+ oldEventList.clear();
+ }
+
+ if (newEventList.size() > 0) {
+ InEvent[] inEvents =
+ newEventList.toArray(new InEvent[newEventList.size()]);
+ for (InEvent inEvent : inEvents) {
+ window.put(new RemoveEvent(inEvent, -1));
+ }
+
+ InEvent[] gradientEvents = gradient(inEvents[0], inEvents[newEventList.size() - 1]);
+
+ for (InEvent inEvent : gradientEvents) {
+ window.put(new RemoveEvent(inEvent, -1));
+ }
+ nextProcessor.process(new InListEvent(gradientEvents));
+
+ newEventList.clear();
+ }
+
+ long diff = timeToKeep - (System.currentTimeMillis() - scheduledTime);
+ if (diff > 0) {
+ try {
+ if (lastSchedule != null) {
+ lastSchedule.cancel(false);
+ }
+ lastSchedule = eventRemoverScheduler.schedule(this, diff, TimeUnit.MILLISECONDS);
+ } catch (RejectedExecutionException ex) {
+ log.warn("scheduling cannot be accepted for execution: elementID " +
+ elementId);
+ }
+ break;
+ }
+ scheduledTime = System.currentTimeMillis();
+ } else {
+ oldEventList.add(new RemoveEvent(removeEvent, System.currentTimeMillis()));
+ }
+ }
+ } catch (Throwable t) {
+ log.error(t.getMessage(), t);
+ }
+ } finally {
+ releaseLock();
+ }
+ }
+
+
+ /**
+ * This function will calculate the linear gradient (per second) of the events received during
+ * a specified time period.
+ */
+ private InEvent[] gradient(InEvent firstInEvent, InEvent lastInEvent) {
+ double firstVal = 0.0, lastVal = 0.0;
+ // FIXME I'm not sure whether there's some other good way to do correct casting,
+ // based on the type.
+ if (Type.DOUBLE.equals(subjectedAttrType)) {
+ firstVal = (Double) firstInEvent.getData()[subjectedAttrIndex];
+ lastVal = (Double) lastInEvent.getData()[subjectedAttrIndex];
+ } else if (Type.INT.equals(subjectedAttrType)) {
+ firstVal = (Integer) firstInEvent.getData()[subjectedAttrIndex];
+ lastVal = (Integer) lastInEvent.getData()[subjectedAttrIndex];
+ } else if (Type.LONG.equals(subjectedAttrType)) {
+ firstVal = (Long) firstInEvent.getData()[subjectedAttrIndex];
+ lastVal = (Long) lastInEvent.getData()[subjectedAttrIndex];
+ } else if (Type.FLOAT.equals(subjectedAttrType)) {
+ firstVal = (Float) firstInEvent.getData()[subjectedAttrIndex];
+ lastVal = (Float) lastInEvent.getData()[subjectedAttrIndex];
+ }
+
+ long t1 = firstInEvent.getTimeStamp();
+ long t2 = lastInEvent.getTimeStamp();
+ long millisecondsForASecond = 1000;
+ long tGap = t2 - t1 > millisecondsForASecond ? t2 - t1 : millisecondsForASecond;
+ double gradient = 0.0;
+ if (tGap > 0) {
+ gradient = ((lastVal - firstVal) * millisecondsForASecond) / tGap;
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("Gradient: " + gradient + " Last val: " + lastVal +
+ " First val: " + firstVal + " Time Gap: " + tGap + " t1: "+t1+ " t2: "+
+ t2+" hash: "+this.hashCode());
+ }
+ Object[] data = firstInEvent.getData().clone();
+ data[subjectedAttrIndex] = gradient;
+ InEvent gradientEvent =
+ new InEvent(firstInEvent.getStreamId(), (t1+t2)/2,
+ data);
+ InEvent[] output = new InEvent[1];
+ output[0] = gradientEvent;
+ return output;
+ }
+
+ @Override
+ protected Object[] currentState() {
+ return new Object[]{window.currentState(), oldEventList, newEventList};
+ }
+
+ @Override
+ protected void restoreState(Object[] data) {
+ window.restoreState(data);
+ window.restoreState((Object[]) data[0]);
+ oldEventList = ((ArrayList<RemoveEvent>) data[1]);
+ newEventList = ((ArrayList<InEvent>) data[2]);
+ window.reSchedule();
+ }
+
+ @Override
+ protected void init(Expression[] parameters, QueryPostProcessingElement nextProcessor, AbstractDefinition streamDefinition, String elementId, boolean async, SiddhiContext siddhiContext) {
+ if (parameters[0] instanceof IntConstant) {
+ timeToKeep = ((IntConstant) parameters[0]).getValue();
+ } else {
+ timeToKeep = ((LongConstant) parameters[0]).getValue();
+ }
+
+ String subjectedAttr = ((Variable)parameters[1]).getAttributeName();
+ subjectedAttrIndex = streamDefinition.getAttributePosition(subjectedAttr);
+ subjectedAttrType = streamDefinition.getAttributeType(subjectedAttr);
+
+ oldEventList = new ArrayList<RemoveEvent>();
+ if (this.siddhiContext.isDistributedProcessingEnabled()) {
+ newEventList = this.siddhiContext.getHazelcastInstance().getList(elementId + "-newEventList");
+ } else {
+ newEventList = new ArrayList<InEvent>();
+ }
+
+ if (this.siddhiContext.isDistributedProcessingEnabled()) {
+ window = new SchedulerSiddhiQueueGrid<StreamEvent>(elementId, this, this.siddhiContext, this.async);
+ } else {
+ window = new SchedulerSiddhiQueue<StreamEvent>(this);
+ }
+ //Ordinary scheduling
+ window.schedule();
+
+ }
+
+ @Override
+ public void schedule() {
+ if (lastSchedule != null) {
+ lastSchedule.cancel(false);
+ }
+ lastSchedule = eventRemoverScheduler.schedule(this, timeToKeep, TimeUnit.MILLISECONDS);
+ }
+
+ public void scheduleNow() {
+ if (lastSchedule != null) {
+ lastSchedule.cancel(false);
+ }
+ lastSchedule = eventRemoverScheduler.schedule(this, 0, TimeUnit.MILLISECONDS);
+ }
+
+ @Override
+ public void setScheduledExecutorService(ScheduledExecutorService scheduledExecutorService) {
+ this.eventRemoverScheduler = scheduledExecutorService;
+ }
+
+ public void setThreadBarrier(ThreadBarrier threadBarrier) {
+ this.threadBarrier = threadBarrier;
+ }
+
+ @Override
+ public void destroy(){
+ oldEventList = null;
+ newEventList = null;
+ window = null;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/stratos-cep-extension/wso2cep-3.0.0/src/main/java/org/apache/stratos/cep/extension/MemeberRequestHandlingCapabilityWindowProcessor.java
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/stratos-cep-extension/wso2cep-3.0.0/src/main/java/org/apache/stratos/cep/extension/MemeberRequestHandlingCapabilityWindowProcessor.java b/extensions/cep/modules/stratos-cep-extension/wso2cep-3.0.0/src/main/java/org/apache/stratos/cep/extension/MemeberRequestHandlingCapabilityWindowProcessor.java
new file mode 100755
index 0000000..0dc24bd
--- /dev/null
+++ b/extensions/cep/modules/stratos-cep-extension/wso2cep-3.0.0/src/main/java/org/apache/stratos/cep/extension/MemeberRequestHandlingCapabilityWindowProcessor.java
@@ -0,0 +1,68 @@
+/*
+ * 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.stratos.cep.extension;
+
+/**
+ * Member Request Handling Capability Window Processor
+ */
+
+import org.wso2.siddhi.core.config.SiddhiContext;
+import org.wso2.siddhi.core.executor.function.FunctionExecutor;
+import org.wso2.siddhi.query.api.definition.Attribute;
+import org.wso2.siddhi.query.api.extension.annotation.SiddhiExtension;
+
+@SiddhiExtension(namespace = "stratos", function = "divider")
+public class MemeberRequestHandlingCapabilityWindowProcessor extends FunctionExecutor {
+
+ Attribute.Type returnType = Attribute.Type.DOUBLE;
+
+ @Override
+ public void init(Attribute.Type[] types, SiddhiContext siddhiContext) {
+ }
+
+ @Override
+ protected Object process(Object obj) {
+
+ double[] value = new double[2];
+ if (obj instanceof Object[]) {
+ int i=0;
+ for (Object aObj : (Object[]) obj) {
+ value[i]= Double.parseDouble(String.valueOf(aObj));
+ i++;
+ }
+ }//to do avoid deviding zero number of active instances won't be zero cz there is min
+ Double unit = (value[0] / value[1]);
+ if(!unit.isNaN() && !unit.isInfinite())
+ return unit;
+ else
+ return 0.0;
+
+ }
+
+ @Override
+ public void destroy() {
+
+ }
+
+ @Override
+ public Attribute.Type getReturnType() {
+ return returnType;
+ }
+}
[3/9] stratos git commit: Upgrading CEP artifacts to 3.1.0
Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/stratos-cep-extension/wso2cep-3.0.0/src/main/java/org/apache/stratos/cep/extension/SecondDerivativeFinderWindowProcessor.java
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/stratos-cep-extension/wso2cep-3.0.0/src/main/java/org/apache/stratos/cep/extension/SecondDerivativeFinderWindowProcessor.java b/extensions/cep/modules/stratos-cep-extension/wso2cep-3.0.0/src/main/java/org/apache/stratos/cep/extension/SecondDerivativeFinderWindowProcessor.java
new file mode 100644
index 0000000..261259a
--- /dev/null
+++ b/extensions/cep/modules/stratos-cep-extension/wso2cep-3.0.0/src/main/java/org/apache/stratos/cep/extension/SecondDerivativeFinderWindowProcessor.java
@@ -0,0 +1,295 @@
+/*
+ * Copyright 2005-2009 WSO2, Inc. (http://wso2.com)
+ * Licensed 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.stratos.cep.extension;
+
+import org.apache.log4j.Logger;
+import org.wso2.siddhi.core.config.SiddhiContext;
+import org.wso2.siddhi.core.event.StreamEvent;
+import org.wso2.siddhi.core.event.in.InEvent;
+import org.wso2.siddhi.core.event.in.InListEvent;
+import org.wso2.siddhi.core.event.remove.RemoveEvent;
+import org.wso2.siddhi.core.event.remove.RemoveListEvent;
+import org.wso2.siddhi.core.persistence.ThreadBarrier;
+import org.wso2.siddhi.core.query.QueryPostProcessingElement;
+import org.wso2.siddhi.core.query.processor.window.RunnableWindowProcessor;
+import org.wso2.siddhi.core.query.processor.window.WindowProcessor;
+import org.wso2.siddhi.core.util.collection.queue.scheduler.ISchedulerSiddhiQueue;
+import org.wso2.siddhi.core.util.collection.queue.scheduler.SchedulerSiddhiQueue;
+import org.wso2.siddhi.core.util.collection.queue.scheduler.SchedulerSiddhiQueueGrid;
+import org.wso2.siddhi.query.api.definition.AbstractDefinition;
+import org.wso2.siddhi.query.api.definition.Attribute;
+import org.wso2.siddhi.query.api.definition.Attribute.Type;
+import org.wso2.siddhi.query.api.expression.Expression;
+import org.wso2.siddhi.query.api.expression.Variable;
+import org.wso2.siddhi.query.api.expression.constant.IntConstant;
+import org.wso2.siddhi.query.api.expression.constant.LongConstant;
+import org.wso2.siddhi.query.api.extension.annotation.SiddhiExtension;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.concurrent.RejectedExecutionException;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.TimeUnit;
+
+@SiddhiExtension(namespace = "stratos", function = "secondDerivative")
+public class SecondDerivativeFinderWindowProcessor extends WindowProcessor implements RunnableWindowProcessor {
+
+ static final Logger log = Logger.getLogger(SecondDerivativeFinderWindowProcessor.class);
+ private ScheduledExecutorService eventRemoverScheduler;
+ private ScheduledFuture<?> lastSchedule;
+ private long timeToKeep;
+ private int subjectedAttrIndex;
+ private Type subjectedAttrType;
+ private List<InEvent> newEventList;
+ private List<RemoveEvent> oldEventList;
+ private ThreadBarrier threadBarrier;
+ private ISchedulerSiddhiQueue<StreamEvent> window;
+
+ @Override
+ protected void processEvent(InEvent event) {
+ acquireLock();
+ try {
+ newEventList.add(event);
+ } finally {
+ releaseLock();
+ }
+ }
+
+ @Override
+ protected void processEvent(InListEvent listEvent) {
+ acquireLock();
+ try {
+ System.out.println(listEvent);
+ for (int i = 0, size = listEvent.getActiveEvents(); i < size; i++) {
+ newEventList.add((InEvent) listEvent.getEvent(i));
+ }
+ } finally {
+ releaseLock();
+ }
+ }
+
+ @Override
+ public Iterator<StreamEvent> iterator() {
+ return window.iterator();
+ }
+
+ @Override
+ public Iterator<StreamEvent> iterator(String predicate) {
+ if (siddhiContext.isDistributedProcessingEnabled()) {
+ return ((SchedulerSiddhiQueueGrid<StreamEvent>) window).iterator(predicate);
+ } else {
+ return window.iterator();
+ }
+ }
+
+
+ @Override
+ public void run() {
+ acquireLock();
+ try {
+ long scheduledTime = System.currentTimeMillis();
+ try {
+ oldEventList.clear();
+ while (true) {
+ threadBarrier.pass();
+ RemoveEvent removeEvent = (RemoveEvent) window.poll();
+ if (removeEvent == null) {
+ if (oldEventList.size() > 0) {
+ nextProcessor.process(new RemoveListEvent(
+ oldEventList.toArray(new RemoveEvent[oldEventList.size()])));
+ oldEventList.clear();
+ }
+
+ if (newEventList.size() > 0) {
+ InEvent[] inEvents =
+ newEventList.toArray(new InEvent[newEventList.size()]);
+ for (InEvent inEvent : inEvents) {
+ window.put(new RemoveEvent(inEvent, -1));
+ }
+
+ // in order to find second derivative, we need at least 3 events.
+ if (newEventList.size() > 2) {
+
+ InEvent firstDerivative1 =
+ gradient(inEvents[0],
+ inEvents[(newEventList.size() / 2) - 1],
+ null)[0];
+ InEvent firstDerivative2 =
+ gradient(inEvents[newEventList.size() / 2],
+ inEvents[newEventList.size() - 1],
+ null)[0];
+ InEvent[] secondDerivative =
+ gradient(firstDerivative1,
+ firstDerivative2, Type.DOUBLE);
+
+ for (InEvent inEvent : secondDerivative) {
+ window.put(new RemoveEvent(inEvent, -1));
+ }
+ nextProcessor.process(new InListEvent(secondDerivative));
+ } else {
+ log.debug("Insufficient events to calculate second derivative. We need at least 3 events. Current event count: " +
+ newEventList.size());
+ }
+
+ newEventList.clear();
+ }
+
+ long diff = timeToKeep - (System.currentTimeMillis() - scheduledTime);
+ if (diff > 0) {
+ try {
+ if (lastSchedule != null) {
+ lastSchedule.cancel(false);
+ }
+ lastSchedule = eventRemoverScheduler.schedule(this, diff, TimeUnit.MILLISECONDS);
+ } catch (RejectedExecutionException ex) {
+ log.warn("scheduling cannot be accepted for execution: elementID " +
+ elementId);
+ }
+ break;
+ }
+ scheduledTime = System.currentTimeMillis();
+ } else {
+ oldEventList.add(new RemoveEvent(removeEvent, System.currentTimeMillis()));
+ }
+ }
+ } catch (Throwable t) {
+ log.error(t.getMessage(), t);
+ }
+ } finally {
+ releaseLock();
+ }
+ }
+
+
+ /**
+ * This function will calculate the linear gradient (per second) of the events received during
+ * a specified time period.
+ */
+ private InEvent[] gradient(InEvent firstInEvent, InEvent lastInEvent, Type type) {
+ Type attrType = type == null ? subjectedAttrType : type;
+ double firstVal = 0.0, lastVal = 0.0;
+ // FIXME I'm not sure whether there's some other good way to do correct casting,
+ // based on the type.
+ if (Type.DOUBLE.equals(attrType)) {
+ firstVal = (Double) firstInEvent.getData()[subjectedAttrIndex];
+ lastVal = (Double) lastInEvent.getData()[subjectedAttrIndex];
+ } else if (Type.INT.equals(attrType)) {
+ firstVal = (Integer) firstInEvent.getData()[subjectedAttrIndex];
+ lastVal = (Integer) lastInEvent.getData()[subjectedAttrIndex];
+ } else if (Type.LONG.equals(attrType)) {
+ firstVal = (Long) firstInEvent.getData()[subjectedAttrIndex];
+ lastVal = (Long) lastInEvent.getData()[subjectedAttrIndex];
+ } else if (Type.FLOAT.equals(attrType)) {
+ firstVal = (Float) firstInEvent.getData()[subjectedAttrIndex];
+ lastVal = (Float) lastInEvent.getData()[subjectedAttrIndex];
+ }
+
+ long t1 = firstInEvent.getTimeStamp();
+ long t2 = lastInEvent.getTimeStamp();
+ long millisecondsForASecond = 1000;
+ long tGap = t2 - t1 > millisecondsForASecond ? t2 - t1 : millisecondsForASecond;
+ double gradient = 0.0;
+ if (tGap > 0) {
+ gradient = ((lastVal - firstVal) * millisecondsForASecond) / tGap;
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("Gradient: " + gradient + " Last val: " + lastVal +
+ " First val: " + firstVal + " Time Gap: " + tGap + " t1: "+t1+ " t2: "+
+ t2+" hash: "+this.hashCode());
+ }
+ Object[] data = firstInEvent.getData().clone();
+ data[subjectedAttrIndex] = gradient;
+ InEvent gradientEvent =
+ new InEvent(firstInEvent.getStreamId(), t1+((t2-t1)/2),
+ data);
+ InEvent[] output = new InEvent[1];
+ output[0] = gradientEvent;
+ return output;
+ }
+
+ @Override
+ protected Object[] currentState() {
+ return new Object[]{window.currentState(), oldEventList, newEventList};
+ }
+
+ @Override
+ protected void restoreState(Object[] data) {
+ window.restoreState(data);
+ window.restoreState((Object[]) data[0]);
+ oldEventList = ((ArrayList<RemoveEvent>) data[1]);
+ newEventList = ((ArrayList<InEvent>) data[2]);
+ window.reSchedule();
+ }
+
+ @Override
+ protected void init(Expression[] parameters, QueryPostProcessingElement nextProcessor, AbstractDefinition streamDefinition, String elementId, boolean async, SiddhiContext siddhiContext) {
+ if (parameters[0] instanceof IntConstant) {
+ timeToKeep = ((IntConstant) parameters[0]).getValue();
+ } else {
+ timeToKeep = ((LongConstant) parameters[0]).getValue();
+ }
+
+ String subjectedAttr = ((Variable)parameters[1]).getAttributeName();
+ subjectedAttrIndex = streamDefinition.getAttributePosition(subjectedAttr);
+ subjectedAttrType = streamDefinition.getAttributeType(subjectedAttr);
+
+ oldEventList = new ArrayList<RemoveEvent>();
+ if (this.siddhiContext.isDistributedProcessingEnabled()) {
+ newEventList = this.siddhiContext.getHazelcastInstance().getList(elementId + "-newEventList");
+ } else {
+ newEventList = new ArrayList<InEvent>();
+ }
+
+ if (this.siddhiContext.isDistributedProcessingEnabled()) {
+ window = new SchedulerSiddhiQueueGrid<StreamEvent>(elementId, this, this.siddhiContext, this.async);
+ } else {
+ window = new SchedulerSiddhiQueue<StreamEvent>(this);
+ }
+ //Ordinary scheduling
+ window.schedule();
+
+ }
+
+ @Override
+ public void schedule() {
+ if (lastSchedule != null) {
+ lastSchedule.cancel(false);
+ }
+ lastSchedule = eventRemoverScheduler.schedule(this, timeToKeep, TimeUnit.MILLISECONDS);
+ }
+
+ public void scheduleNow() {
+ if (lastSchedule != null) {
+ lastSchedule.cancel(false);
+ }
+ lastSchedule = eventRemoverScheduler.schedule(this, 0, TimeUnit.MILLISECONDS);
+ }
+
+ @Override
+ public void setScheduledExecutorService(ScheduledExecutorService scheduledExecutorService) {
+ this.eventRemoverScheduler = scheduledExecutorService;
+ }
+
+ public void setThreadBarrier(ThreadBarrier threadBarrier) {
+ this.threadBarrier = threadBarrier;
+ }
+
+ @Override
+ public void destroy(){
+ oldEventList = null;
+ newEventList = null;
+ window = null;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/stratos-cep-extension/wso2cep-3.1.0/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/stratos-cep-extension/wso2cep-3.1.0/pom.xml b/extensions/cep/modules/stratos-cep-extension/wso2cep-3.1.0/pom.xml
new file mode 100644
index 0000000..f9d7f98
--- /dev/null
+++ b/extensions/cep/modules/stratos-cep-extension/wso2cep-3.1.0/pom.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright 2005-2009 WSO2, Inc. (http://wso2.com)
+ ~ Licensed 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.
+ -->
+<project xmlns="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">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.stratos</groupId>
+ <artifactId>cep-extensions</artifactId>
+ <version>4.1.3-SNAPSHOT</version>
+ <relativePath>../../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>org.apache.stratos.cep.310.extension</artifactId>
+ <name>Apache Stratos - CEP Extensions</name>
+ <description>Apache Stratos CEP Extensions</description>
+
+ <repositories>
+ <repository>
+ <id>wso2-maven2-repository</id>
+ <name>WSO2 Maven2 Repository</name>
+ <url>http://dist.wso2.org/maven2</url>
+ </repository>
+ </repositories>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.wso2.siddhi</groupId>
+ <artifactId>siddhi-core</artifactId>
+ <version>2.1.0-wso2v1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.stratos</groupId>
+ <artifactId>org.apache.stratos.messaging</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/stratos-cep-extension/wso2cep-3.1.0/src/main/java/org/apache/stratos/cep/extension/CEPTopologyEventReceiver.java
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/stratos-cep-extension/wso2cep-3.1.0/src/main/java/org/apache/stratos/cep/extension/CEPTopologyEventReceiver.java b/extensions/cep/modules/stratos-cep-extension/wso2cep-3.1.0/src/main/java/org/apache/stratos/cep/extension/CEPTopologyEventReceiver.java
new file mode 100644
index 0000000..59c70c5
--- /dev/null
+++ b/extensions/cep/modules/stratos-cep-extension/wso2cep-3.1.0/src/main/java/org/apache/stratos/cep/extension/CEPTopologyEventReceiver.java
@@ -0,0 +1,99 @@
+/*
+ * 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.stratos.cep.extension;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.messaging.event.Event;
+import org.apache.stratos.messaging.event.topology.CompleteTopologyEvent;
+import org.apache.stratos.messaging.event.topology.MemberActivatedEvent;
+import org.apache.stratos.messaging.event.topology.MemberTerminatedEvent;
+import org.apache.stratos.messaging.listener.topology.CompleteTopologyEventListener;
+import org.apache.stratos.messaging.listener.topology.MemberActivatedEventListener;
+import org.apache.stratos.messaging.listener.topology.MemberTerminatedEventListener;
+import org.apache.stratos.messaging.message.receiver.topology.TopologyEventReceiver;
+import org.apache.stratos.messaging.message.receiver.topology.TopologyManager;
+
+/**
+ * CEP Topology Receiver for Fault Handling Window Processor.
+ */
+public class CEPTopologyEventReceiver extends TopologyEventReceiver {
+
+ private static final Log log = LogFactory.getLog(CEPTopologyEventReceiver.class);
+
+ private FaultHandlingWindowProcessor faultHandler;
+
+ public CEPTopologyEventReceiver(FaultHandlingWindowProcessor faultHandler) {
+ this.faultHandler = faultHandler;
+ addEventListeners();
+ }
+
+ @Override
+ public void execute() {
+ super.execute();
+ log.info("CEP topology event receiver thread started");
+ }
+
+ private void addEventListeners() {
+ // Load member time stamp map from the topology as a one time task
+ addEventListener(new CompleteTopologyEventListener() {
+ private boolean initialized;
+
+ @Override
+ protected void onEvent(Event event) {
+ if (!initialized) {
+ try {
+ TopologyManager.acquireReadLock();
+ log.debug("Complete topology event received to fault handling window processor.");
+ CompleteTopologyEvent completeTopologyEvent = (CompleteTopologyEvent) event;
+ initialized = faultHandler.loadTimeStampMapFromTopology(completeTopologyEvent.getTopology());
+ } catch (Exception e) {
+ log.error("Error loading member time stamp map from complete topology event.", e);
+ } finally {
+ TopologyManager.releaseReadLock();
+ }
+ }
+ }
+ });
+
+ // Remove member from the time stamp map when MemberTerminated event is received.
+ addEventListener(new MemberTerminatedEventListener() {
+ @Override
+ protected void onEvent(Event event) {
+ MemberTerminatedEvent memberTerminatedEvent = (MemberTerminatedEvent) event;
+ faultHandler.getMemberTimeStampMap().remove(memberTerminatedEvent.getMemberId());
+ log.debug("Member was removed from the timestamp map: [member] " + memberTerminatedEvent.getMemberId());
+ }
+ });
+
+ // Add member to time stamp map whenever member is activated
+ addEventListener(new MemberActivatedEventListener() {
+ @Override
+ protected void onEvent(Event event) {
+ MemberActivatedEvent memberActivatedEvent = (MemberActivatedEvent) event;
+
+ // do not put this member if we have already received a health event
+ faultHandler.getMemberTimeStampMap().putIfAbsent(memberActivatedEvent.getMemberId(),
+ System.currentTimeMillis());
+ log.debug("Member was added to the timestamp map: [member] " + memberActivatedEvent.getMemberId());
+ }
+ });
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/stratos-cep-extension/wso2cep-3.1.0/src/main/java/org/apache/stratos/cep/extension/ConcatWindowProcessor.java
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/stratos-cep-extension/wso2cep-3.1.0/src/main/java/org/apache/stratos/cep/extension/ConcatWindowProcessor.java b/extensions/cep/modules/stratos-cep-extension/wso2cep-3.1.0/src/main/java/org/apache/stratos/cep/extension/ConcatWindowProcessor.java
new file mode 100644
index 0000000..699f036
--- /dev/null
+++ b/extensions/cep/modules/stratos-cep-extension/wso2cep-3.1.0/src/main/java/org/apache/stratos/cep/extension/ConcatWindowProcessor.java
@@ -0,0 +1,54 @@
+/*
+ * 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.stratos.cep.extension;
+import org.wso2.siddhi.core.config.SiddhiContext;
+import org.wso2.siddhi.core.executor.function.FunctionExecutor;
+import org.wso2.siddhi.query.api.definition.Attribute;
+import org.wso2.siddhi.query.api.extension.annotation.SiddhiExtension;
+
+@SiddhiExtension(namespace = "stratos", function = "concat")
+public class ConcatWindowProcessor extends FunctionExecutor {
+ Attribute.Type returnType = Attribute.Type.STRING;
+ @Override
+ public void init(Attribute.Type[] types, SiddhiContext siddhiContext) {
+ }
+
+ @Override
+ protected Object process(Object obj) {
+ if (obj instanceof Object[]) {
+ StringBuffer sb=new StringBuffer();
+ for (Object aObj : (Object[]) obj) {
+ sb.append(aObj);
+ }
+ return sb.toString();
+ } else {
+ return obj.toString();
+ }
+
+ }
+
+ @Override
+ public void destroy() {
+ }
+
+ @Override
+ public Attribute.Type getReturnType() {
+ return returnType;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/stratos-cep-extension/wso2cep-3.1.0/src/main/java/org/apache/stratos/cep/extension/FaultHandlingWindowProcessor.java
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/stratos-cep-extension/wso2cep-3.1.0/src/main/java/org/apache/stratos/cep/extension/FaultHandlingWindowProcessor.java b/extensions/cep/modules/stratos-cep-extension/wso2cep-3.1.0/src/main/java/org/apache/stratos/cep/extension/FaultHandlingWindowProcessor.java
new file mode 100644
index 0000000..55b7572
--- /dev/null
+++ b/extensions/cep/modules/stratos-cep-extension/wso2cep-3.1.0/src/main/java/org/apache/stratos/cep/extension/FaultHandlingWindowProcessor.java
@@ -0,0 +1,343 @@
+/*
+ * Copyright 2005-2009 WSO2, Inc. (http://wso2.com)
+ * Licensed 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.stratos.cep.extension;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.log4j.Logger;
+import org.apache.stratos.common.threading.StratosThreadPool;
+import org.apache.stratos.messaging.broker.publish.EventPublisher;
+import org.apache.stratos.messaging.broker.publish.EventPublisherPool;
+import org.apache.stratos.messaging.domain.topology.*;
+import org.apache.stratos.messaging.event.health.stat.MemberFaultEvent;
+import org.apache.stratos.messaging.message.receiver.topology.TopologyManager;
+import org.apache.stratos.messaging.util.MessagingUtil;
+import org.wso2.siddhi.core.config.SiddhiContext;
+import org.wso2.siddhi.core.event.StreamEvent;
+import org.wso2.siddhi.core.event.in.InEvent;
+import org.wso2.siddhi.core.event.in.InListEvent;
+import org.wso2.siddhi.core.snapshot.ThreadBarrier;
+import org.wso2.siddhi.core.query.QueryPostProcessingElement;
+import org.wso2.siddhi.core.query.processor.window.RunnableWindowProcessor;
+import org.wso2.siddhi.core.query.processor.window.WindowProcessor;
+import org.wso2.siddhi.core.util.collection.queue.scheduler.ISchedulerSiddhiQueue;
+import org.wso2.siddhi.core.util.collection.queue.scheduler.SchedulerSiddhiQueue;
+import org.wso2.siddhi.core.util.collection.queue.scheduler.SchedulerSiddhiQueueGrid;
+import org.wso2.siddhi.query.api.definition.AbstractDefinition;
+import org.wso2.siddhi.query.api.expression.Expression;
+import org.wso2.siddhi.query.api.expression.Variable;
+import org.wso2.siddhi.query.api.expression.constant.IntConstant;
+import org.wso2.siddhi.query.api.expression.constant.LongConstant;
+import org.wso2.siddhi.query.api.extension.annotation.SiddhiExtension;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * CEP window processor to handle faulty member instances. This window processor is responsible for
+ * publishing MemberFault event if health stats are not received within a given time window.
+ */
+@SiddhiExtension(namespace = "stratos", function = "faultHandling")
+public class FaultHandlingWindowProcessor extends WindowProcessor implements RunnableWindowProcessor {
+
+ private static final Logger log = Logger.getLogger(FaultHandlingWindowProcessor.class);
+
+ private static final int TIME_OUT = 60 * 1000;
+ public static final String CEP_EXTENSION_THREAD_POOL_KEY = "cep.extension.thread.pool";
+ public static final int CEP_EXTENSION_THREAD_POOL_SIZE = 10;
+
+ private ExecutorService executorService;
+ private ScheduledExecutorService faultHandleScheduler;
+ private ScheduledFuture<?> lastSchedule;
+ private ThreadBarrier threadBarrier;
+ private long timeToKeep;
+ private ISchedulerSiddhiQueue<StreamEvent> window;
+ private EventPublisher healthStatPublisher =
+ EventPublisherPool.getPublisher(MessagingUtil.Topics.HEALTH_STAT_TOPIC.getTopicName());
+ private Map<String, Object> MemberFaultEventMap = new HashMap<String, Object>();
+ private Map<String, Object> memberFaultEventMessageMap = new HashMap<String, Object>();
+
+ // Map of member id's to their last received health event time stamp
+ private ConcurrentHashMap<String, Long> memberTimeStampMap = new ConcurrentHashMap<String, Long>();
+
+ // Event receiver to receive topology events published by cloud-controller
+ private CEPTopologyEventReceiver cepTopologyEventReceiver = new CEPTopologyEventReceiver(this);
+
+ // Stratos member id attribute index in stream execution plan
+ private int memberIdAttrIndex;
+
+ @Override
+ protected void processEvent(InEvent event) {
+ addDataToMap(event);
+ }
+
+ @Override
+ protected void processEvent(InListEvent listEvent) {
+ for (int i = 0, size = listEvent.getActiveEvents(); i < size; i++) {
+ addDataToMap((InEvent) listEvent.getEvent(i));
+ }
+ }
+
+ /**
+ * Add new entry to time stamp map from the received event.
+ *
+ * @param event Event received by Siddhi.
+ */
+ protected void addDataToMap(InEvent event) {
+ String id = (String) event.getData()[memberIdAttrIndex];
+ //checking whether this member is the topology.
+ //sometimes there can be a delay between publishing member terminated events
+ //and actually terminating instances. Hence CEP might get events for already terminated members
+ //so we are checking the topology for the member existence
+ Member member = getMemberFromId(id);
+ if (null == member) {
+ log.debug("Member not found in the topology. Event rejected");
+ return;
+ }
+ if (StringUtils.isNotEmpty(id)) {
+ memberTimeStampMap.put(id, event.getTimeStamp());
+ } else {
+ log.warn("NULL member id found in the event received. Event rejected.");
+ }
+ if (log.isDebugEnabled()){
+ log.debug("Event received from [member-id] " + id + " [time-stamp] " + event.getTimeStamp());
+ }
+ }
+
+ @Override
+ public Iterator<StreamEvent> iterator() {
+ return window.iterator();
+ }
+
+ @Override
+ public Iterator<StreamEvent> iterator(String predicate) {
+ if (siddhiContext.isDistributedProcessingEnabled()) {
+ return ((SchedulerSiddhiQueueGrid<StreamEvent>) window).iterator(predicate);
+ } else {
+ return window.iterator();
+ }
+ }
+
+ /**
+ * Retrieve the current activated members from the topology and initialize the timestamp map.
+ * This will allow the system to recover from a restart
+ *
+ * @param topology Topology model object
+ */
+ boolean loadTimeStampMapFromTopology(Topology topology){
+
+ long currentTimeStamp = System.currentTimeMillis();
+ if (topology == null || topology.getServices() == null){
+ return false;
+ }
+ // TODO make this efficient by adding APIs to messaging component
+ for (Service service : topology.getServices()) {
+ if (service.getClusters() != null) {
+ for (Cluster cluster : service.getClusters()) {
+ if (cluster.getMembers() != null) {
+ for (Member member : cluster.getMembers()) {
+ // we are checking faulty status only in previously activated members
+ if (member != null && MemberStatus.Active.equals(member.getStatus())) {
+ // Initialize the member time stamp map from the topology at the beginning
+ memberTimeStampMap.putIfAbsent(member.getMemberId(), currentTimeStamp);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (log.isDebugEnabled()){
+ log.debug("Member timestamps were successfully loaded from the topology: [timestamps] " +
+ memberTimeStampMap);
+ }
+ return true;
+ }
+
+ private Member getMemberFromId(String memberId){
+ if (StringUtils.isEmpty(memberId)){
+ return null;
+ }
+ if (TopologyManager.getTopology().isInitialized()){
+ try {
+ TopologyManager.acquireReadLock();
+ if (TopologyManager.getTopology().getServices() == null){
+ return null;
+ }
+ // TODO make this efficient by adding APIs to messaging component
+ for (Service service : TopologyManager.getTopology().getServices()) {
+ if (service.getClusters() != null) {
+ for (Cluster cluster : service.getClusters()) {
+ if (cluster.getMembers() != null) {
+ for (Member member : cluster.getMembers()){
+ if (memberId.equals(member.getMemberId())){
+ return member;
+ }
+ }
+ }
+ }
+ }
+ }
+ } catch (Exception e) {
+ log.error("Error while reading topology" + e);
+ } finally {
+ TopologyManager.releaseReadLock();
+ }
+ }
+ return null;
+ }
+
+ private void publishMemberFault(String memberId){
+ Member member = getMemberFromId(memberId);
+ if (member == null){
+ log.warn("Failed to publish member fault event. Member having [member-id] " + memberId +
+ " does not exist in topology");
+ return;
+ }
+ log.info("Publishing member fault event for [member-id] " + memberId);
+
+ MemberFaultEvent memberFaultEvent = new MemberFaultEvent(member.getClusterId(), member.getClusterInstanceId(),
+ member.getMemberId(), member.getPartitionId(),
+ member.getNetworkPartitionId(), 0);
+
+ memberFaultEventMessageMap.put("message", memberFaultEvent);
+ healthStatPublisher.publish(MemberFaultEventMap, true);
+ }
+
+ @Override
+ public void run() {
+ try {
+ threadBarrier.pass();
+
+ for (Object o : memberTimeStampMap.entrySet()) {
+ Map.Entry pair = (Map.Entry) o;
+ long currentTime = System.currentTimeMillis();
+ Long eventTimeStamp = (Long) pair.getValue();
+
+ if ((currentTime - eventTimeStamp) > TIME_OUT) {
+ log.info("Faulty member detected [member-id] " + pair.getKey() + " with [last time-stamp] " +
+ eventTimeStamp + " [time-out] " + TIME_OUT + " milliseconds");
+ publishMemberFault((String) pair.getKey());
+ }
+ }
+ if (log.isDebugEnabled()){
+ log.debug("Fault handling processor iteration completed with [time-stamp map length] " +
+ memberTimeStampMap.size() + " [time-stamp map] " + memberTimeStampMap);
+ }
+ } catch (Throwable t) {
+ log.error(t.getMessage(), t);
+ } finally {
+ if (lastSchedule != null) {
+ lastSchedule.cancel(false);
+ }
+ lastSchedule = faultHandleScheduler.schedule(this, timeToKeep, TimeUnit.MILLISECONDS);
+ }
+ }
+
+ @Override
+ protected Object[] currentState() {
+ return new Object[]{window.currentState()};
+ }
+
+ @Override
+ protected void restoreState(Object[] data) {
+ window.restoreState(data);
+ window.restoreState((Object[]) data[0]);
+ window.reSchedule();
+ }
+
+ @Override
+ protected void init(Expression[] parameters, QueryPostProcessingElement nextProcessor,
+ AbstractDefinition streamDefinition, String elementId, boolean async, SiddhiContext siddhiContext) {
+
+ if (parameters[0] instanceof IntConstant) {
+ timeToKeep = ((IntConstant) parameters[0]).getValue();
+ } else {
+ timeToKeep = ((LongConstant) parameters[0]).getValue();
+ }
+
+ String memberIdAttrName = ((Variable) parameters[1]).getAttributeName();
+ memberIdAttrIndex = streamDefinition.getAttributePosition(memberIdAttrName);
+
+ if (this.siddhiContext.isDistributedProcessingEnabled()) {
+ window = new SchedulerSiddhiQueueGrid<StreamEvent>(elementId, this, this.siddhiContext, this.async);
+ } else {
+ window = new SchedulerSiddhiQueue<StreamEvent>(this);
+ }
+ MemberFaultEventMap.put("org.apache.stratos.messaging.event.health.stat.MemberFaultEvent", memberFaultEventMessageMap);
+
+ executorService = StratosThreadPool.getExecutorService(CEP_EXTENSION_THREAD_POOL_KEY,
+ CEP_EXTENSION_THREAD_POOL_SIZE);
+ cepTopologyEventReceiver.setExecutorService(executorService);
+ cepTopologyEventReceiver.execute();
+
+ //Ordinary scheduling
+ window.schedule();
+ if (log.isDebugEnabled()){
+ log.debug("Fault handling window processor initialized with [timeToKeep] " + timeToKeep +
+ ", [memberIdAttrName] " + memberIdAttrName + ", [memberIdAttrIndex] " + memberIdAttrIndex +
+ ", [distributed-enabled] " + this.siddhiContext.isDistributedProcessingEnabled());
+ }
+ }
+
+ @Override
+ public void schedule() {
+ if (lastSchedule != null) {
+ lastSchedule.cancel(false);
+ }
+ lastSchedule = faultHandleScheduler.schedule(this, timeToKeep, TimeUnit.MILLISECONDS);
+ }
+
+ @Override
+ public void scheduleNow() {
+ if (lastSchedule != null) {
+ lastSchedule.cancel(false);
+ }
+ lastSchedule = faultHandleScheduler.schedule(this, 0, TimeUnit.MILLISECONDS);
+ }
+
+ @Override
+ public void setScheduledExecutorService(ScheduledExecutorService scheduledExecutorService) {
+ this.faultHandleScheduler = scheduledExecutorService;
+ }
+
+ @Override
+ public void setThreadBarrier(ThreadBarrier threadBarrier) {
+ this.threadBarrier = threadBarrier;
+ }
+
+ @Override
+ public void destroy(){
+ // terminate topology listener thread
+ cepTopologyEventReceiver.terminate();
+ window = null;
+
+ // Shutdown executor service
+ if(executorService != null) {
+ try {
+ executorService.shutdownNow();
+ } catch (Exception e) {
+ log.warn("An error occurred while shutting down cep extension executor service", e);
+ }
+ }
+ }
+
+ public ConcurrentHashMap<String, Long> getMemberTimeStampMap() {
+ return memberTimeStampMap;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/stratos-cep-extension/wso2cep-3.1.0/src/main/java/org/apache/stratos/cep/extension/GradientFinderWindowProcessor.java
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/stratos-cep-extension/wso2cep-3.1.0/src/main/java/org/apache/stratos/cep/extension/GradientFinderWindowProcessor.java b/extensions/cep/modules/stratos-cep-extension/wso2cep-3.1.0/src/main/java/org/apache/stratos/cep/extension/GradientFinderWindowProcessor.java
new file mode 100644
index 0000000..3d13533
--- /dev/null
+++ b/extensions/cep/modules/stratos-cep-extension/wso2cep-3.1.0/src/main/java/org/apache/stratos/cep/extension/GradientFinderWindowProcessor.java
@@ -0,0 +1,277 @@
+/*
+ * Copyright 2005-2009 WSO2, Inc. (http://wso2.com)
+ * Licensed 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.stratos.cep.extension;
+
+import org.apache.log4j.Logger;
+import org.wso2.siddhi.core.config.SiddhiContext;
+import org.wso2.siddhi.core.event.StreamEvent;
+import org.wso2.siddhi.core.event.in.InEvent;
+import org.wso2.siddhi.core.event.in.InListEvent;
+import org.wso2.siddhi.core.event.remove.RemoveEvent;
+import org.wso2.siddhi.core.event.remove.RemoveListEvent;
+import org.wso2.siddhi.core.snapshot.ThreadBarrier;
+import org.wso2.siddhi.core.query.QueryPostProcessingElement;
+import org.wso2.siddhi.core.query.processor.window.RunnableWindowProcessor;
+import org.wso2.siddhi.core.query.processor.window.WindowProcessor;
+import org.wso2.siddhi.core.util.collection.queue.scheduler.ISchedulerSiddhiQueue;
+import org.wso2.siddhi.core.util.collection.queue.scheduler.SchedulerSiddhiQueue;
+import org.wso2.siddhi.core.util.collection.queue.scheduler.SchedulerSiddhiQueueGrid;
+import org.wso2.siddhi.query.api.definition.AbstractDefinition;
+import org.wso2.siddhi.query.api.definition.Attribute;
+import org.wso2.siddhi.query.api.definition.Attribute.Type;
+import org.wso2.siddhi.query.api.expression.Expression;
+import org.wso2.siddhi.query.api.expression.Variable;
+import org.wso2.siddhi.query.api.expression.constant.IntConstant;
+import org.wso2.siddhi.query.api.expression.constant.LongConstant;
+import org.wso2.siddhi.query.api.extension.annotation.SiddhiExtension;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.concurrent.RejectedExecutionException;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.TimeUnit;
+
+@SiddhiExtension(namespace = "stratos", function = "gradient")
+public class GradientFinderWindowProcessor extends WindowProcessor implements RunnableWindowProcessor {
+
+ static final Logger log = Logger.getLogger(GradientFinderWindowProcessor.class);
+ private ScheduledExecutorService eventRemoverScheduler;
+ private ScheduledFuture<?> lastSchedule;
+ private long timeToKeep;
+ private int subjectedAttrIndex;
+ private Attribute.Type subjectedAttrType;
+ private List<InEvent> newEventList;
+ private List<RemoveEvent> oldEventList;
+ private ThreadBarrier threadBarrier;
+ private ISchedulerSiddhiQueue<StreamEvent> window;
+
+ @Override
+ protected void processEvent(InEvent event) {
+ acquireLock();
+ try {
+ newEventList.add(event);
+ } finally {
+ releaseLock();
+ }
+ }
+
+ @Override
+ protected void processEvent(InListEvent listEvent) {
+ acquireLock();
+ try {
+ System.out.println(listEvent);
+ for (int i = 0, size = listEvent.getActiveEvents(); i < size; i++) {
+ newEventList.add((InEvent) listEvent.getEvent(i));
+ }
+ } finally {
+ releaseLock();
+ }
+ }
+
+ @Override
+ public Iterator<StreamEvent> iterator() {
+ return window.iterator();
+ }
+
+ @Override
+ public Iterator<StreamEvent> iterator(String predicate) {
+ if (siddhiContext.isDistributedProcessingEnabled()) {
+ return ((SchedulerSiddhiQueueGrid<StreamEvent>) window).iterator(predicate);
+ } else {
+ return window.iterator();
+ }
+ }
+
+
+ @Override
+ public void run() {
+ acquireLock();
+ try {
+ long scheduledTime = System.currentTimeMillis();
+ try {
+ oldEventList.clear();
+ while (true) {
+ threadBarrier.pass();
+ RemoveEvent removeEvent = (RemoveEvent) window.poll();
+ if (removeEvent == null) {
+ if (oldEventList.size() > 0) {
+ nextProcessor.process(new RemoveListEvent(
+ oldEventList.toArray(new RemoveEvent[oldEventList.size()])));
+ oldEventList.clear();
+ }
+
+ if (newEventList.size() > 0) {
+ InEvent[] inEvents =
+ newEventList.toArray(new InEvent[newEventList.size()]);
+ for (InEvent inEvent : inEvents) {
+ window.put(new RemoveEvent(inEvent, -1));
+ }
+
+ InEvent[] gradientEvents = gradient(inEvents[0], inEvents[newEventList.size() - 1]);
+
+ for (InEvent inEvent : gradientEvents) {
+ window.put(new RemoveEvent(inEvent, -1));
+ }
+ nextProcessor.process(new InListEvent(gradientEvents));
+
+ newEventList.clear();
+ }
+
+ long diff = timeToKeep - (System.currentTimeMillis() - scheduledTime);
+ if (diff > 0) {
+ try {
+ if (lastSchedule != null) {
+ lastSchedule.cancel(false);
+ }
+ lastSchedule = eventRemoverScheduler.schedule(this, diff, TimeUnit.MILLISECONDS);
+ } catch (RejectedExecutionException ex) {
+ log.warn("scheduling cannot be accepted for execution: elementID " +
+ elementId);
+ }
+ break;
+ }
+ scheduledTime = System.currentTimeMillis();
+ } else {
+ oldEventList.add(new RemoveEvent(removeEvent, System.currentTimeMillis()));
+ }
+ }
+ } catch (Throwable t) {
+ log.error(t.getMessage(), t);
+ }
+ } finally {
+ releaseLock();
+ }
+ }
+
+
+ /**
+ * This function will calculate the linear gradient (per second) of the events received during
+ * a specified time period.
+ */
+ private InEvent[] gradient(InEvent firstInEvent, InEvent lastInEvent) {
+ double firstVal = 0.0, lastVal = 0.0;
+ // FIXME I'm not sure whether there's some other good way to do correct casting,
+ // based on the type.
+ if (Type.DOUBLE.equals(subjectedAttrType)) {
+ firstVal = (Double) firstInEvent.getData()[subjectedAttrIndex];
+ lastVal = (Double) lastInEvent.getData()[subjectedAttrIndex];
+ } else if (Type.INT.equals(subjectedAttrType)) {
+ firstVal = (Integer) firstInEvent.getData()[subjectedAttrIndex];
+ lastVal = (Integer) lastInEvent.getData()[subjectedAttrIndex];
+ } else if (Type.LONG.equals(subjectedAttrType)) {
+ firstVal = (Long) firstInEvent.getData()[subjectedAttrIndex];
+ lastVal = (Long) lastInEvent.getData()[subjectedAttrIndex];
+ } else if (Type.FLOAT.equals(subjectedAttrType)) {
+ firstVal = (Float) firstInEvent.getData()[subjectedAttrIndex];
+ lastVal = (Float) lastInEvent.getData()[subjectedAttrIndex];
+ }
+
+ long t1 = firstInEvent.getTimeStamp();
+ long t2 = lastInEvent.getTimeStamp();
+ long millisecondsForASecond = 1000;
+ long tGap = t2 - t1 > millisecondsForASecond ? t2 - t1 : millisecondsForASecond;
+ double gradient = 0.0;
+ if (tGap > 0) {
+ gradient = ((lastVal - firstVal) * millisecondsForASecond) / tGap;
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("Gradient: " + gradient + " Last val: " + lastVal +
+ " First val: " + firstVal + " Time Gap: " + tGap + " t1: "+t1+ " t2: "+
+ t2+" hash: "+this.hashCode());
+ }
+ Object[] data = firstInEvent.getData().clone();
+ data[subjectedAttrIndex] = gradient;
+ InEvent gradientEvent =
+ new InEvent(firstInEvent.getStreamId(), (t1+t2)/2,
+ data);
+ InEvent[] output = new InEvent[1];
+ output[0] = gradientEvent;
+ return output;
+ }
+
+ @Override
+ protected Object[] currentState() {
+ return new Object[]{window.currentState(), oldEventList, newEventList};
+ }
+
+ @Override
+ protected void restoreState(Object[] data) {
+ window.restoreState(data);
+ window.restoreState((Object[]) data[0]);
+ oldEventList = ((ArrayList<RemoveEvent>) data[1]);
+ newEventList = ((ArrayList<InEvent>) data[2]);
+ window.reSchedule();
+ }
+
+ @Override
+ protected void init(Expression[] parameters, QueryPostProcessingElement nextProcessor, AbstractDefinition streamDefinition, String elementId, boolean async, SiddhiContext siddhiContext) {
+ if (parameters[0] instanceof IntConstant) {
+ timeToKeep = ((IntConstant) parameters[0]).getValue();
+ } else {
+ timeToKeep = ((LongConstant) parameters[0]).getValue();
+ }
+
+ String subjectedAttr = ((Variable)parameters[1]).getAttributeName();
+ subjectedAttrIndex = streamDefinition.getAttributePosition(subjectedAttr);
+ subjectedAttrType = streamDefinition.getAttributeType(subjectedAttr);
+
+ oldEventList = new ArrayList<RemoveEvent>();
+ if (this.siddhiContext.isDistributedProcessingEnabled()) {
+ newEventList = this.siddhiContext.getHazelcastInstance().getList(elementId + "-newEventList");
+ } else {
+ newEventList = new ArrayList<InEvent>();
+ }
+
+ if (this.siddhiContext.isDistributedProcessingEnabled()) {
+ window = new SchedulerSiddhiQueueGrid<StreamEvent>(elementId, this, this.siddhiContext, this.async);
+ } else {
+ window = new SchedulerSiddhiQueue<StreamEvent>(this);
+ }
+ //Ordinary scheduling
+ window.schedule();
+
+ }
+
+ @Override
+ public void schedule() {
+ if (lastSchedule != null) {
+ lastSchedule.cancel(false);
+ }
+ lastSchedule = eventRemoverScheduler.schedule(this, timeToKeep, TimeUnit.MILLISECONDS);
+ }
+
+ public void scheduleNow() {
+ if (lastSchedule != null) {
+ lastSchedule.cancel(false);
+ }
+ lastSchedule = eventRemoverScheduler.schedule(this, 0, TimeUnit.MILLISECONDS);
+ }
+
+ @Override
+ public void setScheduledExecutorService(ScheduledExecutorService scheduledExecutorService) {
+ this.eventRemoverScheduler = scheduledExecutorService;
+ }
+
+ public void setThreadBarrier(ThreadBarrier threadBarrier) {
+ this.threadBarrier = threadBarrier;
+ }
+
+ @Override
+ public void destroy(){
+ oldEventList = null;
+ newEventList = null;
+ window = null;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/stratos-cep-extension/wso2cep-3.1.0/src/main/java/org/apache/stratos/cep/extension/MemeberRequestHandlingCapabilityWindowProcessor.java
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/stratos-cep-extension/wso2cep-3.1.0/src/main/java/org/apache/stratos/cep/extension/MemeberRequestHandlingCapabilityWindowProcessor.java b/extensions/cep/modules/stratos-cep-extension/wso2cep-3.1.0/src/main/java/org/apache/stratos/cep/extension/MemeberRequestHandlingCapabilityWindowProcessor.java
new file mode 100755
index 0000000..0dc24bd
--- /dev/null
+++ b/extensions/cep/modules/stratos-cep-extension/wso2cep-3.1.0/src/main/java/org/apache/stratos/cep/extension/MemeberRequestHandlingCapabilityWindowProcessor.java
@@ -0,0 +1,68 @@
+/*
+ * 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.stratos.cep.extension;
+
+/**
+ * Member Request Handling Capability Window Processor
+ */
+
+import org.wso2.siddhi.core.config.SiddhiContext;
+import org.wso2.siddhi.core.executor.function.FunctionExecutor;
+import org.wso2.siddhi.query.api.definition.Attribute;
+import org.wso2.siddhi.query.api.extension.annotation.SiddhiExtension;
+
+@SiddhiExtension(namespace = "stratos", function = "divider")
+public class MemeberRequestHandlingCapabilityWindowProcessor extends FunctionExecutor {
+
+ Attribute.Type returnType = Attribute.Type.DOUBLE;
+
+ @Override
+ public void init(Attribute.Type[] types, SiddhiContext siddhiContext) {
+ }
+
+ @Override
+ protected Object process(Object obj) {
+
+ double[] value = new double[2];
+ if (obj instanceof Object[]) {
+ int i=0;
+ for (Object aObj : (Object[]) obj) {
+ value[i]= Double.parseDouble(String.valueOf(aObj));
+ i++;
+ }
+ }//to do avoid deviding zero number of active instances won't be zero cz there is min
+ Double unit = (value[0] / value[1]);
+ if(!unit.isNaN() && !unit.isInfinite())
+ return unit;
+ else
+ return 0.0;
+
+ }
+
+ @Override
+ public void destroy() {
+
+ }
+
+ @Override
+ public Attribute.Type getReturnType() {
+ return returnType;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/stratos-cep-extension/wso2cep-3.1.0/src/main/java/org/apache/stratos/cep/extension/SecondDerivativeFinderWindowProcessor.java
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/stratos-cep-extension/wso2cep-3.1.0/src/main/java/org/apache/stratos/cep/extension/SecondDerivativeFinderWindowProcessor.java b/extensions/cep/modules/stratos-cep-extension/wso2cep-3.1.0/src/main/java/org/apache/stratos/cep/extension/SecondDerivativeFinderWindowProcessor.java
new file mode 100644
index 0000000..b04c084
--- /dev/null
+++ b/extensions/cep/modules/stratos-cep-extension/wso2cep-3.1.0/src/main/java/org/apache/stratos/cep/extension/SecondDerivativeFinderWindowProcessor.java
@@ -0,0 +1,295 @@
+/*
+ * Copyright 2005-2009 WSO2, Inc. (http://wso2.com)
+ * Licensed 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.stratos.cep.extension;
+
+import org.apache.log4j.Logger;
+import org.wso2.siddhi.core.config.SiddhiContext;
+import org.wso2.siddhi.core.event.StreamEvent;
+import org.wso2.siddhi.core.event.in.InEvent;
+import org.wso2.siddhi.core.event.in.InListEvent;
+import org.wso2.siddhi.core.event.remove.RemoveEvent;
+import org.wso2.siddhi.core.event.remove.RemoveListEvent;
+import org.wso2.siddhi.core.snapshot.ThreadBarrier;
+import org.wso2.siddhi.core.query.QueryPostProcessingElement;
+import org.wso2.siddhi.core.query.processor.window.RunnableWindowProcessor;
+import org.wso2.siddhi.core.query.processor.window.WindowProcessor;
+import org.wso2.siddhi.core.util.collection.queue.scheduler.ISchedulerSiddhiQueue;
+import org.wso2.siddhi.core.util.collection.queue.scheduler.SchedulerSiddhiQueue;
+import org.wso2.siddhi.core.util.collection.queue.scheduler.SchedulerSiddhiQueueGrid;
+import org.wso2.siddhi.query.api.definition.AbstractDefinition;
+import org.wso2.siddhi.query.api.definition.Attribute;
+import org.wso2.siddhi.query.api.definition.Attribute.Type;
+import org.wso2.siddhi.query.api.expression.Expression;
+import org.wso2.siddhi.query.api.expression.Variable;
+import org.wso2.siddhi.query.api.expression.constant.IntConstant;
+import org.wso2.siddhi.query.api.expression.constant.LongConstant;
+import org.wso2.siddhi.query.api.extension.annotation.SiddhiExtension;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.concurrent.RejectedExecutionException;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.TimeUnit;
+
+@SiddhiExtension(namespace = "stratos", function = "secondDerivative")
+public class SecondDerivativeFinderWindowProcessor extends WindowProcessor implements RunnableWindowProcessor {
+
+ static final Logger log = Logger.getLogger(SecondDerivativeFinderWindowProcessor.class);
+ private ScheduledExecutorService eventRemoverScheduler;
+ private ScheduledFuture<?> lastSchedule;
+ private long timeToKeep;
+ private int subjectedAttrIndex;
+ private Attribute.Type subjectedAttrType;
+ private List<InEvent> newEventList;
+ private List<RemoveEvent> oldEventList;
+ private ThreadBarrier threadBarrier;
+ private ISchedulerSiddhiQueue<StreamEvent> window;
+
+ @Override
+ protected void processEvent(InEvent event) {
+ acquireLock();
+ try {
+ newEventList.add(event);
+ } finally {
+ releaseLock();
+ }
+ }
+
+ @Override
+ protected void processEvent(InListEvent listEvent) {
+ acquireLock();
+ try {
+ System.out.println(listEvent);
+ for (int i = 0, size = listEvent.getActiveEvents(); i < size; i++) {
+ newEventList.add((InEvent) listEvent.getEvent(i));
+ }
+ } finally {
+ releaseLock();
+ }
+ }
+
+ @Override
+ public Iterator<StreamEvent> iterator() {
+ return window.iterator();
+ }
+
+ @Override
+ public Iterator<StreamEvent> iterator(String predicate) {
+ if (siddhiContext.isDistributedProcessingEnabled()) {
+ return ((SchedulerSiddhiQueueGrid<StreamEvent>) window).iterator(predicate);
+ } else {
+ return window.iterator();
+ }
+ }
+
+
+ @Override
+ public void run() {
+ acquireLock();
+ try {
+ long scheduledTime = System.currentTimeMillis();
+ try {
+ oldEventList.clear();
+ while (true) {
+ threadBarrier.pass();
+ RemoveEvent removeEvent = (RemoveEvent) window.poll();
+ if (removeEvent == null) {
+ if (oldEventList.size() > 0) {
+ nextProcessor.process(new RemoveListEvent(
+ oldEventList.toArray(new RemoveEvent[oldEventList.size()])));
+ oldEventList.clear();
+ }
+
+ if (newEventList.size() > 0) {
+ InEvent[] inEvents =
+ newEventList.toArray(new InEvent[newEventList.size()]);
+ for (InEvent inEvent : inEvents) {
+ window.put(new RemoveEvent(inEvent, -1));
+ }
+
+ // in order to find second derivative, we need at least 3 events.
+ if (newEventList.size() > 2) {
+
+ InEvent firstDerivative1 =
+ gradient(inEvents[0],
+ inEvents[(newEventList.size() / 2) - 1],
+ null)[0];
+ InEvent firstDerivative2 =
+ gradient(inEvents[newEventList.size() / 2],
+ inEvents[newEventList.size() - 1],
+ null)[0];
+ InEvent[] secondDerivative =
+ gradient(firstDerivative1,
+ firstDerivative2, Type.DOUBLE);
+
+ for (InEvent inEvent : secondDerivative) {
+ window.put(new RemoveEvent(inEvent, -1));
+ }
+ nextProcessor.process(new InListEvent(secondDerivative));
+ } else {
+ log.debug("Insufficient events to calculate second derivative. We need at least 3 events. Current event count: " +
+ newEventList.size());
+ }
+
+ newEventList.clear();
+ }
+
+ long diff = timeToKeep - (System.currentTimeMillis() - scheduledTime);
+ if (diff > 0) {
+ try {
+ if (lastSchedule != null) {
+ lastSchedule.cancel(false);
+ }
+ lastSchedule = eventRemoverScheduler.schedule(this, diff, TimeUnit.MILLISECONDS);
+ } catch (RejectedExecutionException ex) {
+ log.warn("scheduling cannot be accepted for execution: elementID " +
+ elementId);
+ }
+ break;
+ }
+ scheduledTime = System.currentTimeMillis();
+ } else {
+ oldEventList.add(new RemoveEvent(removeEvent, System.currentTimeMillis()));
+ }
+ }
+ } catch (Throwable t) {
+ log.error(t.getMessage(), t);
+ }
+ } finally {
+ releaseLock();
+ }
+ }
+
+
+ /**
+ * This function will calculate the linear gradient (per second) of the events received during
+ * a specified time period.
+ */
+ private InEvent[] gradient(InEvent firstInEvent, InEvent lastInEvent, Type type) {
+ Type attrType = type == null ? subjectedAttrType : type;
+ double firstVal = 0.0, lastVal = 0.0;
+ // FIXME I'm not sure whether there's some other good way to do correct casting,
+ // based on the type.
+ if (Type.DOUBLE.equals(attrType)) {
+ firstVal = (Double) firstInEvent.getData()[subjectedAttrIndex];
+ lastVal = (Double) lastInEvent.getData()[subjectedAttrIndex];
+ } else if (Type.INT.equals(attrType)) {
+ firstVal = (Integer) firstInEvent.getData()[subjectedAttrIndex];
+ lastVal = (Integer) lastInEvent.getData()[subjectedAttrIndex];
+ } else if (Type.LONG.equals(attrType)) {
+ firstVal = (Long) firstInEvent.getData()[subjectedAttrIndex];
+ lastVal = (Long) lastInEvent.getData()[subjectedAttrIndex];
+ } else if (Type.FLOAT.equals(attrType)) {
+ firstVal = (Float) firstInEvent.getData()[subjectedAttrIndex];
+ lastVal = (Float) lastInEvent.getData()[subjectedAttrIndex];
+ }
+
+ long t1 = firstInEvent.getTimeStamp();
+ long t2 = lastInEvent.getTimeStamp();
+ long millisecondsForASecond = 1000;
+ long tGap = t2 - t1 > millisecondsForASecond ? t2 - t1 : millisecondsForASecond;
+ double gradient = 0.0;
+ if (tGap > 0) {
+ gradient = ((lastVal - firstVal) * millisecondsForASecond) / tGap;
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("Gradient: " + gradient + " Last val: " + lastVal +
+ " First val: " + firstVal + " Time Gap: " + tGap + " t1: "+t1+ " t2: "+
+ t2+" hash: "+this.hashCode());
+ }
+ Object[] data = firstInEvent.getData().clone();
+ data[subjectedAttrIndex] = gradient;
+ InEvent gradientEvent =
+ new InEvent(firstInEvent.getStreamId(), t1+((t2-t1)/2),
+ data);
+ InEvent[] output = new InEvent[1];
+ output[0] = gradientEvent;
+ return output;
+ }
+
+ @Override
+ protected Object[] currentState() {
+ return new Object[]{window.currentState(), oldEventList, newEventList};
+ }
+
+ @Override
+ protected void restoreState(Object[] data) {
+ window.restoreState(data);
+ window.restoreState((Object[]) data[0]);
+ oldEventList = ((ArrayList<RemoveEvent>) data[1]);
+ newEventList = ((ArrayList<InEvent>) data[2]);
+ window.reSchedule();
+ }
+
+ @Override
+ protected void init(Expression[] parameters, QueryPostProcessingElement nextProcessor, AbstractDefinition streamDefinition, String elementId, boolean async, SiddhiContext siddhiContext) {
+ if (parameters[0] instanceof IntConstant) {
+ timeToKeep = ((IntConstant) parameters[0]).getValue();
+ } else {
+ timeToKeep = ((LongConstant) parameters[0]).getValue();
+ }
+
+ String subjectedAttr = ((Variable)parameters[1]).getAttributeName();
+ subjectedAttrIndex = streamDefinition.getAttributePosition(subjectedAttr);
+ subjectedAttrType = streamDefinition.getAttributeType(subjectedAttr);
+
+ oldEventList = new ArrayList<RemoveEvent>();
+ if (this.siddhiContext.isDistributedProcessingEnabled()) {
+ newEventList = this.siddhiContext.getHazelcastInstance().getList(elementId + "-newEventList");
+ } else {
+ newEventList = new ArrayList<InEvent>();
+ }
+
+ if (this.siddhiContext.isDistributedProcessingEnabled()) {
+ window = new SchedulerSiddhiQueueGrid<StreamEvent>(elementId, this, this.siddhiContext, this.async);
+ } else {
+ window = new SchedulerSiddhiQueue<StreamEvent>(this);
+ }
+ //Ordinary scheduling
+ window.schedule();
+
+ }
+
+ @Override
+ public void schedule() {
+ if (lastSchedule != null) {
+ lastSchedule.cancel(false);
+ }
+ lastSchedule = eventRemoverScheduler.schedule(this, timeToKeep, TimeUnit.MILLISECONDS);
+ }
+
+ public void scheduleNow() {
+ if (lastSchedule != null) {
+ lastSchedule.cancel(false);
+ }
+ lastSchedule = eventRemoverScheduler.schedule(this, 0, TimeUnit.MILLISECONDS);
+ }
+
+ @Override
+ public void setScheduledExecutorService(ScheduledExecutorService scheduledExecutorService) {
+ this.eventRemoverScheduler = scheduledExecutorService;
+ }
+
+ public void setThreadBarrier(ThreadBarrier threadBarrier) {
+ this.threadBarrier = threadBarrier;
+ }
+
+ @Override
+ public void destroy(){
+ oldEventList = null;
+ newEventList = null;
+ window = null;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/pom.xml b/extensions/cep/pom.xml
index 3c42bcb..9393a04 100644
--- a/extensions/cep/pom.xml
+++ b/extensions/cep/pom.xml
@@ -33,6 +33,7 @@
<modules>
<module>modules/distribution</module>
- <module>modules/stratos-cep-extension</module>
+ <module>modules/stratos-cep-extension/wso2cep-3.0.0</module>
+ <module>modules/stratos-cep-extension/wso2cep-3.1.0</module>
</modules>
</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/products/stratos/modules/distribution/pom.xml
----------------------------------------------------------------------
diff --git a/products/stratos/modules/distribution/pom.xml b/products/stratos/modules/distribution/pom.xml
index 73348ab..9ef940a 100755
--- a/products/stratos/modules/distribution/pom.xml
+++ b/products/stratos/modules/distribution/pom.xml
@@ -71,7 +71,7 @@
</dependency>
<dependency>
<groupId>org.apache.stratos</groupId>
- <artifactId>org.apache.stratos.cep.extension</artifactId>
+ <artifactId>org.apache.stratos.cep300.extension</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/products/stratos/modules/distribution/src/assembly/bin.xml
----------------------------------------------------------------------
diff --git a/products/stratos/modules/distribution/src/assembly/bin.xml b/products/stratos/modules/distribution/src/assembly/bin.xml
index c60bd09..54a1a56 100755
--- a/products/stratos/modules/distribution/src/assembly/bin.xml
+++ b/products/stratos/modules/distribution/src/assembly/bin.xml
@@ -429,34 +429,34 @@
<!-- cep -->
<!--creating an empty input event adaptors directory-->
<fileSet>
- <directory>../../../../extensions/cep/modules/artifacts/inputeventadaptors</directory>
+ <directory>../../../../extensions/cep/modules/artifacts/wso2cep-3.0.0/inputeventadaptors</directory>
<outputDirectory>
${stratos.distribution.name}-${project.version}/repository/deployment/server/inputeventadaptors
</outputDirectory>
</fileSet>
<!--creating an empty output event adaptors directory-->
<fileSet>
- <directory>../../../../extensions/cep/modules/artifacts/outputeventadaptors</directory>
+ <directory>../../../../extensions/cep/modules/artifacts/wso2cep-3.0.0/outputeventadaptors</directory>
<outputDirectory>
${stratos.distribution.name}-${project.version}/repository/deployment/server/outputeventadaptors
</outputDirectory>
</fileSet>
<!--creating an empty event builders directory-->
<fileSet>
- <directory>../../../../extensions/cep/modules/artifacts/eventbuilders</directory>
+ <directory>../../../../extensions/cep/modules/artifacts/wso2cep-3.0.0/eventbuilders</directory>
<outputDirectory>${stratos.distribution.name}-${project.version}/repository/deployment/server/eventbuilders
</outputDirectory>
</fileSet>
<!--creating an empty event formatters directory-->
<fileSet>
- <directory>../../../../extensions/cep/modules/artifacts/eventformatters</directory>
+ <directory>../../../../extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters</directory>
<outputDirectory>
${stratos.distribution.name}-${project.version}/repository/deployment/server/eventformatters
</outputDirectory>
</fileSet>
<!--creating an empty execution plans directory-->
<fileSet>
- <directory>../../../../extensions/cep/modules/artifacts/executionplans</directory>
+ <directory>../../../../extensions/cep/modules/artifacts/wso2cep-3.0.0/executionplans</directory>
<outputDirectory>${stratos.distribution.name}-${project.version}/repository/deployment/server/executionplans
</outputDirectory>
</fileSet>
@@ -603,7 +603,7 @@
<filtered>true</filtered>
</file>
<file>
- <source>../../../../extensions/cep/modules/artifacts/streamdefinitions/stream-manager-config.xml</source>
+ <source>../../../../extensions/cep/modules/artifacts/wso2cep-3.0.0/streamdefinitions/stream-manager-config.xml</source>
<outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf/</outputDirectory>
<filtered>true</filtered>
</file>
[6/9] stratos git commit: Upgrading CEP artifacts to 3.1.0
Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventbuilders/HealthStatisticsEventBuilder.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventbuilders/HealthStatisticsEventBuilder.xml b/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventbuilders/HealthStatisticsEventBuilder.xml
new file mode 100644
index 0000000..92f8d8a
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventbuilders/HealthStatisticsEventBuilder.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<eventBuilder name="HealthStatisticsEventBuilder" statistics="disable"
+ trace="enable" xmlns="http://wso2.org/carbon/eventbuilder">
+ <from eventAdaptorName="DefaultWSO2EventInputAdaptor" eventAdaptorType="wso2event">
+ <property name="stream">cartridge_agent_health_stats</property>
+ <property name="version">1.0.0</property>
+ </from>
+ <mapping customMapping="disable" type="wso2event"/>
+ <to streamName="cartridge_agent_health_stats" version="1.0.0"/>
+</eventBuilder>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventbuilders/LoadBalancerStatisticsEventBuilder.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventbuilders/LoadBalancerStatisticsEventBuilder.xml b/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventbuilders/LoadBalancerStatisticsEventBuilder.xml
new file mode 100644
index 0000000..8090e63
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventbuilders/LoadBalancerStatisticsEventBuilder.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<eventBuilder name="LoadBalancerStatisticsEventBuilder"
+ statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventbuilder">
+ <from eventAdaptorName="DefaultWSO2EventInputAdaptor" eventAdaptorType="wso2event">
+ <property name="stream">in_flight_requests</property>
+ <property name="version">1.0.0</property>
+ </from>
+ <mapping customMapping="disable" type="wso2event"/>
+ <to streamName="in_flight_requests" version="1.0.0"/>
+</eventBuilder>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/AverageInFlightRequestsEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/AverageInFlightRequestsEventFormatter.xml b/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/AverageInFlightRequestsEventFormatter.xml
new file mode 100644
index 0000000..5955866
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/AverageInFlightRequestsEventFormatter.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<eventFormatter name="AverageRequestsInflightEventFormatter"
+ statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
+ <from streamName="average_in_flight_requests" version="1.0.0"/>
+ <mapping customMapping="enable" type="json">
+ <inline>{"org.apache.stratos.messaging.event.health.stat.AverageRequestsInFlightEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{count}}"}}}</inline>
+ </mapping>
+ <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+ <property name="transport.jms.Destination">summarized-health-stats</property>
+ </to>
+</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/AverageLoadAverageEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/AverageLoadAverageEventFormatter.xml b/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/AverageLoadAverageEventFormatter.xml
new file mode 100644
index 0000000..a0e2052
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/AverageLoadAverageEventFormatter.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<eventFormatter name="AverageLoadAverageEventFormatter"
+ statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
+ <from streamName="average_load_average_stats" version="1.0.0"/>
+ <mapping customMapping="enable" type="json">
+ <inline>{"org.apache.stratos.messaging.event.health.stat.AverageLoadAverageEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{average_load_average}}"}}}</inline>
+ </mapping>
+ <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+ <property name="transport.jms.Destination">summarized-health-stats</property>
+ </to>
+</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/AverageMemoryConsumptionEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/AverageMemoryConsumptionEventFormatter.xml b/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/AverageMemoryConsumptionEventFormatter.xml
new file mode 100644
index 0000000..cbcab0a
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/AverageMemoryConsumptionEventFormatter.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<eventFormatter name="AverageMemoryConsumptionEventFormatter"
+ statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
+ <from streamName="average_memory_consumption_stats" version="1.0.0"/>
+ <mapping customMapping="enable" type="json">
+ <inline>{"org.apache.stratos.messaging.event.health.stat.AverageMemoryConsumptionEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{average_memory_consumption}}"}}}</inline>
+ </mapping>
+ <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+ <property name="transport.jms.Destination">summarized-health-stats</property>
+ </to>
+</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/FaultMessageEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/FaultMessageEventFormatter.xml b/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/FaultMessageEventFormatter.xml
new file mode 100644
index 0000000..96264ca
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/FaultMessageEventFormatter.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<eventFormatter name="FaultMessageEventFormatter"
+ statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
+ <from streamName="fault_message" version="1.0.0"/>
+ <mapping customMapping="enable" type="json">
+ <inline>{"org.apache.stratos.messaging.event.health.stat.MemberFaultEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","memberId":"{{member_id}}","partitionId":"{{partition_id}}"}}}</inline>
+ </mapping>
+ <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+ <property name="transport.jms.Destination">summarized-health-stats</property>
+ </to>
+</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/GradientInFlightRequestsEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/GradientInFlightRequestsEventFormatter.xml b/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/GradientInFlightRequestsEventFormatter.xml
new file mode 100644
index 0000000..2b5045b
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/GradientInFlightRequestsEventFormatter.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<eventFormatter name="GradientInFlightRequestsEventFormatter" statistics="disable"
+ trace="disable" xmlns="http://wso2.org/carbon/eventformatter">
+ <from streamName="gradient_in_flight_requests" version="1.0.0"/>
+ <mapping customMapping="enable" type="json">
+ <inline>{"org.apache.stratos.messaging.event.health.stat.GradientOfRequestsInFlightEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{count}}"}}}</inline>
+ </mapping>
+ <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+ <property name="transport.jms.Destination">summarized-health-stats</property>
+ </to>
+</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/GradientLoadAverageEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/GradientLoadAverageEventFormatter.xml b/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/GradientLoadAverageEventFormatter.xml
new file mode 100644
index 0000000..7fa3d7a
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/GradientLoadAverageEventFormatter.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<eventFormatter name="GradientLoadAverageEventFormatter"
+ statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
+ <from streamName="gradient_load_average_stats" version="1.0.0"/>
+ <mapping customMapping="enable" type="json">
+ <inline>{"org.apache.stratos.messaging.event.health.stat.GradientOfLoadAverageEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{gradient_load_average}}"}}}</inline>
+ </mapping>
+ <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+ <property name="transport.jms.Destination">summarized-health-stats</property>
+ </to>
+</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/GradientMemoryConsumptionEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/GradientMemoryConsumptionEventFormatter.xml b/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/GradientMemoryConsumptionEventFormatter.xml
new file mode 100644
index 0000000..8c3b871
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/GradientMemoryConsumptionEventFormatter.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<eventFormatter name="GradientMemoryConsumptionEventFormatter"
+ statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
+ <from streamName="gradient_memory_consumption_stats" version="1.0.0"/>
+ <mapping customMapping="enable" type="json">
+ <inline>{"org.apache.stratos.messaging.event.health.stat.GradientOfMemoryConsumptionEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{gradient_memory_consumption}}"}}}</inline>
+ </mapping>
+ <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+ <property name="transport.jms.Destination">summarized-health-stats</property>
+ </to>
+</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/MemberAverageLoadAverageEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/MemberAverageLoadAverageEventFormatter.xml b/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/MemberAverageLoadAverageEventFormatter.xml
new file mode 100644
index 0000000..cab6df6
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/MemberAverageLoadAverageEventFormatter.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<eventFormatter name="MemberAverageLoadAverageEventFormatter"
+ statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
+ <from streamName="member_average_load_average_stats" version="1.0.0"/>
+ <mapping customMapping="enable" type="json">
+ <inline>{"org.apache.stratos.messaging.event.health.stat.MemberAverageLoadAverageEvent":{"message":{"memberId":"{{member_id}}","clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{member_average_load_average}}"}}}</inline>
+ </mapping>
+ <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+ <property name="transport.jms.Destination">summarized-health-stats</property>
+ </to>
+</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/MemberAverageMemoryConsumptionEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/MemberAverageMemoryConsumptionEventFormatter.xml b/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/MemberAverageMemoryConsumptionEventFormatter.xml
new file mode 100644
index 0000000..7f6e1f8
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/MemberAverageMemoryConsumptionEventFormatter.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<eventFormatter name="MemberAverageMemoryConsumptionEventFormatter"
+ statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
+ <from streamName="member_average_memory_consumption_stats" version="1.0.0"/>
+ <mapping customMapping="enable" type="json">
+ <inline>{"org.apache.stratos.messaging.event.health.stat.MemberAverageMemoryConsumptionEvent":{"message":{"memberId":"{{member_id}}","clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{member_average_memory_consumption}}"}}}</inline>
+ </mapping>
+ <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+ <property name="transport.jms.Destination">summarized-health-stats</property>
+ </to>
+</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/MemberGradientLoadAverageEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/MemberGradientLoadAverageEventFormatter.xml b/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/MemberGradientLoadAverageEventFormatter.xml
new file mode 100644
index 0000000..af73b46
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/MemberGradientLoadAverageEventFormatter.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<eventFormatter name="MemberGradientLoadAverageEventFormatter"
+ statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
+ <from streamName="member_gradient_load_average_stats" version="1.0.0"/>
+ <mapping customMapping="enable" type="json">
+ <inline>{"org.apache.stratos.messaging.event.health.stat.MemberGradientOfLoadAverageEvent":{"message":{"memberId":"{{member_id}}","clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{member_gradient_load_average}}"}}}</inline>
+ </mapping>
+ <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+ <property name="transport.jms.Destination">summarized-health-stats</property>
+ </to>
+</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/MemberGradientMemoryConsumptionEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/MemberGradientMemoryConsumptionEventFormatter.xml b/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/MemberGradientMemoryConsumptionEventFormatter.xml
new file mode 100644
index 0000000..702f149
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/MemberGradientMemoryConsumptionEventFormatter.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<eventFormatter name="MemberGradientMemoryConsumptionEventFormatter"
+ statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
+ <from streamName="member_gradient_memory_consumption_stats" version="1.0.0"/>
+ <mapping customMapping="enable" type="json">
+ <inline>{"org.apache.stratos.messaging.event.health.stat.MemberGradientOfMemoryConsumptionEvent":{"message":{"memberId":"{{member_id}}","clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{member_gradient_memory_consumption}}"}}}</inline>
+ </mapping>
+ <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+ <property name="transport.jms.Destination">summarized-health-stats</property>
+ </to>
+</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/MemberSecondDerivativeLoadAverageEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/MemberSecondDerivativeLoadAverageEventFormatter.xml b/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/MemberSecondDerivativeLoadAverageEventFormatter.xml
new file mode 100644
index 0000000..5281652
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/MemberSecondDerivativeLoadAverageEventFormatter.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<eventFormatter name="MemberSecondDerivativeLoadAverageEventFormatter"
+ statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventformatter">
+ <from streamName="member_second_derivative_load_average_stats" version="1.0.0"/>
+ <mapping customMapping="enable" type="json">
+ <inline>{"org.apache.stratos.messaging.event.health.stat.MemberSecondDerivativeOfLoadAverageEvent":{"message":{"memberId":"{{member_id}}","clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{member_second_derivative_load_average}}"}}}</inline>
+ </mapping>
+ <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+ <property name="transport.jms.Destination">summarized-health-stats</property>
+ </to>
+</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/MemberSecondDerivativeMemoryConsumptionEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/MemberSecondDerivativeMemoryConsumptionEventFormatter.xml b/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/MemberSecondDerivativeMemoryConsumptionEventFormatter.xml
new file mode 100644
index 0000000..2e32be3
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/MemberSecondDerivativeMemoryConsumptionEventFormatter.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<eventFormatter name="MemberSecondDerivativeMemoryConsumptionEventFormatter"
+ statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventformatter">
+ <from streamName="member_second_derivative_memory_consumption_stats" version="1.0.0"/>
+ <mapping customMapping="enable" type="json">
+ <inline>{"org.apache.stratos.messaging.event.health.stat.MemberSecondDerivativeOfMemoryConsumptionEvent":{"message":{"memberId":"{{member_id}}","clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{member_second_derivative_memory_consumption}}"}}}</inline>
+ </mapping>
+ <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+ <property name="transport.jms.Destination">summarized-health-stats</property>
+ </to>
+</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/SecondDerivativeInFlightRequestsEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/SecondDerivativeInFlightRequestsEventFormatter.xml b/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/SecondDerivativeInFlightRequestsEventFormatter.xml
new file mode 100644
index 0000000..61862d1
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/SecondDerivativeInFlightRequestsEventFormatter.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<eventFormatter name="SecondDerivativeEventFormatter"
+ statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventformatter">
+ <from streamName="second_derivative_in_flight_requests" version="1.0.0"/>
+ <mapping customMapping="enable" type="json">
+ <inline>{"org.apache.stratos.messaging.event.health.stat.SecondDerivativeOfRequestsInFlightEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{count}}"}}}</inline>
+ </mapping>
+ <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+ <property name="transport.jms.Destination">summarized-health-stats</property>
+ </to>
+</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/SecondDerivativeLoadAverageEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/SecondDerivativeLoadAverageEventFormatter.xml b/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/SecondDerivativeLoadAverageEventFormatter.xml
new file mode 100644
index 0000000..3dc4a74
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/SecondDerivativeLoadAverageEventFormatter.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<eventFormatter name="SecondDerivativeLoadAverageEventFormatter"
+ statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventformatter">
+ <from streamName="second_derivative_load_average_stats" version="1.0.0"/>
+ <mapping customMapping="enable" type="json">
+ <inline>{"org.apache.stratos.messaging.event.health.stat.SecondDerivativeOfLoadAverageEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{second_derivative_load_average}}"}}}</inline>
+ </mapping>
+ <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+ <property name="transport.jms.Destination">summarized-health-stats</property>
+ </to>
+</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/SecondDerivativeMemoryConsumptionEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/SecondDerivativeMemoryConsumptionEventFormatter.xml b/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/SecondDerivativeMemoryConsumptionEventFormatter.xml
new file mode 100644
index 0000000..bb0f70c
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.0.0/eventformatters/SecondDerivativeMemoryConsumptionEventFormatter.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<eventFormatter name="SecondDerivativeMemoryConsumptionEventFormatter"
+ statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventformatter">
+ <from streamName="second_derivative_memory_consumption_stats" version="1.0.0"/>
+ <mapping customMapping="enable" type="json">
+ <inline>{"org.apache.stratos.messaging.event.health.stat.SecondDerivativeOfMemoryConsumptionEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{second_derivative_memory_consumption}}"}}}</inline>
+ </mapping>
+ <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+ <property name="transport.jms.Destination">summarized-health-stats</property>
+ </to>
+</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.0.0/executionplans/AverageHeathRequest.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.0.0/executionplans/AverageHeathRequest.xml b/extensions/cep/modules/artifacts/wso2cep-3.0.0/executionplans/AverageHeathRequest.xml
new file mode 100644
index 0000000..b60a0bf
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.0.0/executionplans/AverageHeathRequest.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<executionPlan name="AverageHeathRequest" statistics="disable"
+ trace="enable" xmlns="http://wso2.org/carbon/eventprocessor">
+ <description>This will average health stats of an instance over a minute.</description>
+ <siddhiConfiguration>
+ <property name="siddhi.enable.distributed.processing">false</property>
+ <property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
+ </siddhiConfiguration>
+ <importedStreams>
+ <stream as="health_avg_processsor" name="cartridge_agent_health_stats" version="1.0.0"/>
+ </importedStreams>
+ <queryExpressions><![CDATA[
+ from health_avg_processsor [health_description == 'ports_not_open']
+ select cluster_id, cluster_instance_id, network_partition_id, member_id, partition_id insert into fault_message;
+ from health_avg_processsor
+ select cluster_id, cluster_instance_id, network_partition_id, member_id, partition_id, health_description, value,
+ stratos:concat(cluster_id, '-' , cluster_instance_id) as health_grad_cluster_network
+ insert into health_avg_concatinator;
+ define partition health_avg_cluster_partition by health_avg_concatinator.health_grad_cluster_network;
+ define partition member_health_avg_cluster_partition by health_avg_processsor.member_id;
+ from health_avg_concatinator [health_description == 'load_average']
+ #window.timeBatch(1 min) select cluster_id, cluster_instance_id, network_partition_id, avg(value) as average_load_average
+ insert into average_load_average_stats
+ partition by health_avg_cluster_partition;
+ from health_avg_processsor [health_description == 'load_average']
+ #window.timeBatch(1 min) select member_id, cluster_id, cluster_instance_id, network_partition_id, avg(value) as member_average_load_average
+ insert into member_average_load_average_stats
+ partition by member_health_avg_cluster_partition;
+ from health_avg_processsor [health_description == 'memory_consumption']
+ #window.timeBatch(1 min) select member_id, cluster_id, cluster_instance_id, network_partition_id, avg(value) as member_average_memory_consumption
+ insert into member_average_memory_consumption_stats
+ partition by member_health_avg_cluster_partition;
+ from health_avg_concatinator [health_description == 'memory_consumption']
+ #window.timeBatch(1 min) select cluster_id, cluster_instance_id, network_partition_id, avg(value) as average_memory_consumption
+ insert into average_memory_consumption_stats
+ partition by health_avg_cluster_partition;
+ ]]></queryExpressions>
+ <exportedStreams>
+ <stream name="average_load_average_stats" passthroughFlow="disable"
+ valueOf="average_load_average_stats" version="1.0.0"/>
+ <stream name="member_average_load_average_stats" passthroughFlow="disable"
+ valueOf="member_average_load_average_stats" version="1.0.0"/>
+ <stream name="member_average_memory_consumption_stats" passthroughFlow="disable"
+ valueOf="member_average_memory_consumption_stats" version="1.0.0"/>
+ <stream name="average_memory_consumption_stats" passthroughFlow="disable"
+ valueOf="average_memory_consumption_stats" version="1.0.0"/>
+ <stream name="fault_message" passthroughFlow="disable"
+ valueOf="fault_message" version="1.0.0"/>
+ </exportedStreams>
+</executionPlan>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.0.0/executionplans/AverageInFlightRequestsFinder.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.0.0/executionplans/AverageInFlightRequestsFinder.xml b/extensions/cep/modules/artifacts/wso2cep-3.0.0/executionplans/AverageInFlightRequestsFinder.xml
new file mode 100644
index 0000000..20b94da
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.0.0/executionplans/AverageInFlightRequestsFinder.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<executionPlan name="AverageInFlightRequestsFinder" statistics="disable"
+ trace="enable" xmlns="http://wso2.org/carbon/eventprocessor">
+ <description>This will average the number of requests in flight over a minute.</description>
+ <siddhiConfiguration>
+ <property name="siddhi.enable.distributed.processing">false</property>
+ <property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
+ </siddhiConfiguration>
+ <importedStreams>
+ <stream as="avg_rif_stat" name="in_flight_requests" version="1.0.0"/>
+ </importedStreams>
+ <queryExpressions><![CDATA[
+ from avg_rif_stat
+ select cluster_id, cluster_instance_id, network_partition_id, in_flight_request_count,
+ stratos:concat(cluster_id, '-' ,cluster_instance_id) as avg_rif_cluster_network
+ insert into avg_rif_concat;
+ define partition avg_rif_cluster_partition by avg_rif_concat.avg_rif_cluster_network;
+ from avg_rif_concat#window.timeBatch(1 min)
+ select cluster_id, cluster_instance_id, network_partition_id, avg(in_flight_request_count) as count
+ insert into average_in_flight_requests
+ partition by avg_rif_cluster_partition;
+ ]]></queryExpressions>
+ <exportedStreams>
+ <stream name="average_in_flight_requests"
+ valueOf="average_in_flight_requests" version="1.0.0"/>
+ </exportedStreams>
+</executionPlan>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.0.0/executionplans/GradientOfHealthRequest.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.0.0/executionplans/GradientOfHealthRequest.xml b/extensions/cep/modules/artifacts/wso2cep-3.0.0/executionplans/GradientOfHealthRequest.xml
new file mode 100644
index 0000000..fcbc24e
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.0.0/executionplans/GradientOfHealthRequest.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<executionPlan name="GradientOfHealthRequest" statistics="disable"
+ trace="disable" xmlns="http://wso2.org/carbon/eventprocessor">
+ <description>This will find the gradient of the heath request over a minute.</description>
+ <siddhiConfiguration>
+ <property name="siddhi.enable.distributed.processing">false</property>
+ <property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
+ </siddhiConfiguration>
+ <importedStreams>
+ <stream as="health_grad_processsor" name="cartridge_agent_health_stats" version="1.0.0"/>
+ </importedStreams>
+ <queryExpressions><![CDATA[
+ from health_grad_processsor
+ #window.stratos:faultHandling(1min, member_id) select cluster_id, cluster_instance_id, network_partition_id, member_id, partition_id
+ group by cluster_id, network_partition_id
+ insert into fault_message;
+ from health_grad_processsor
+ select cluster_id, cluster_instance_id, network_partition_id, member_id, partition_id, health_description, value,
+ stratos:concat(cluster_id, '-' , cluster_instance_id) as health_grad_cluster_network
+ insert into health_grad_concatinator;
+ define partition health_grad_cluster_partition by health_grad_concatinator.health_grad_cluster_network;
+ define partition member_health_grad_cluster_partition by health_grad_processsor.member_id;
+ from health_grad_concatinator [health_description == 'load_average']
+ #window.stratos:gradient(1 min, value) select cluster_id, cluster_instance_id, network_partition_id, value as gradient_load_average
+ insert into gradient_load_average_stats
+ partition by health_grad_cluster_partition;
+ from health_grad_processsor [health_description == 'load_average']
+ #window.stratos:gradient(1 min, value) select member_id, cluster_id, cluster_instance_id, network_partition_id, value as member_gradient_load_average
+ insert into member_gradient_load_average_stats
+ partition by member_health_grad_cluster_partition;
+ from health_grad_processsor [health_description == 'memory_consumption']
+ #window.stratos:gradient(1 min, value) select member_id, cluster_id, cluster_instance_id, network_partition_id, value as member_gradient_memory_consumption
+ insert into member_gradient_memory_consumption_stats partition by member_health_grad_cluster_partition;
+ from health_grad_concatinator [health_description == 'memory_consumption']
+ #window.stratos:gradient(1 min, value) select cluster_id, cluster_instance_id, network_partition_id, value as gradient_memory_consumption
+ insert into gradient_memory_consumption_stats
+ partition by health_grad_cluster_partition;]]></queryExpressions>
+ <exportedStreams>
+ <stream name="gradient_load_average_stats"
+ valueOf="gradient_load_average_stats" version="1.0.0"/>
+ <stream name="gradient_memory_consumption_stats"
+ valueOf="gradient_memory_consumption_stats" version="1.0.0"/>
+ <stream name="member_gradient_load_average_stats"
+ valueOf="member_gradient_load_average_stats" version="1.0.0"/>
+ <stream name="member_gradient_memory_consumption_stats"
+ valueOf="member_gradient_memory_consumption_stats" version="1.0.0"/>
+ <stream name="fault_message" passthroughFlow="disable"
+ valueOf="fault_message" version="1.0.0"/>
+ </exportedStreams>
+</executionPlan>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.0.0/executionplans/GradientOfRequestsInFlightFinder.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.0.0/executionplans/GradientOfRequestsInFlightFinder.xml b/extensions/cep/modules/artifacts/wso2cep-3.0.0/executionplans/GradientOfRequestsInFlightFinder.xml
new file mode 100644
index 0000000..fff4a8a
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.0.0/executionplans/GradientOfRequestsInFlightFinder.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<executionPlan name="GradientOfRequestsInFlightFinder"
+ statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventprocessor">
+ <description>This will find the gradient of the number of requests in flight over a minute.</description>
+ <siddhiConfiguration>
+ <property name="siddhi.enable.distributed.processing">false</property>
+ <property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
+ </siddhiConfiguration>
+ <importedStreams>
+ <stream as="gradient_rif_processor" name="in_flight_requests" version="1.0.0"/>
+ </importedStreams>
+ <queryExpressions><![CDATA[
+ from gradient_rif_processor
+ select cluster_id, cluster_instance_id, network_partition_id, in_flight_request_count,
+ stratos:concat(cluster_id, '-' , network_partition_id) as request_grad_cluster_network
+ insert into gradient_rif_concatinator;
+ define partition request_grad_cluster_partition by gradient_rif_concatinator.request_grad_cluster_network;
+ from gradient_rif_concatinator
+ #window.stratos:gradient(1 min, in_flight_request_count)
+ select cluster_id, cluster_instance_id, network_partition_id,in_flight_request_count as count
+ insert into gradient_in_flight_requests
+ partition by request_grad_cluster_partition;
+]]></queryExpressions>
+ <exportedStreams>
+ <stream name="gradient_in_flight_requests" valueOf="gradient_in_flight_requests" version="1.0.0"/>
+ </exportedStreams>
+</executionPlan>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.0.0/executionplans/SecondDerivativeOfHealthRequest.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.0.0/executionplans/SecondDerivativeOfHealthRequest.xml b/extensions/cep/modules/artifacts/wso2cep-3.0.0/executionplans/SecondDerivativeOfHealthRequest.xml
new file mode 100644
index 0000000..0fa4a0a
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.0.0/executionplans/SecondDerivativeOfHealthRequest.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<executionPlan name="SecondDerivativeOfHealthRequest"
+ statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventprocessor">
+ <description>This will find the second derivative of health stats over a minute.</description>
+ <siddhiConfiguration>
+ <property name="siddhi.enable.distributed.processing">false</property>
+ <property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
+ </siddhiConfiguration>
+ <importedStreams>
+ <stream as="health_second_der_request" name="cartridge_agent_health_stats" version="1.0.0"/>
+ </importedStreams>
+ <queryExpressions><![CDATA[
+ from health_second_der_request
+ select member_id, cluster_id, cluster_instance_id, network_partition_id, health_description, value,
+ stratos:concat(cluster_id, '-' ,cluster_instance_id) as health_second_der_cluster_network
+ insert into health_second_der_concat;
+ define partition health_second_der_cluster_partition by health_second_der_concat.health_second_der_cluster_network;
+ from health_second_der_concat [health_description == 'memory_consumption']
+ #window.stratos:secondDerivative(1 min, value) select cluster_id, cluster_instance_id, network_partition_id, value as second_derivative_memory_consumption
+ insert into second_derivative_memory_consumption_stats
+ partition by health_second_der_cluster_partition;
+ from health_second_der_concat [health_description == 'load_average']
+ #window.stratos:secondDerivative(1 min, value) select cluster_id, cluster_instance_id, network_partition_id, value as second_derivative_load_average
+ insert into second_derivative_load_average_stats
+ partition by health_second_der_cluster_partition;
+ define partition health_second_der_member_partition by health_second_der_request.member_id;
+ from health_second_der_request [health_description == 'memory_consumption']
+ #window.stratos:secondDerivative(1 min, value)
+ select member_id, cluster_id, cluster_instance_id, network_partition_id, value as member_second_derivative_memory_consumption
+ insert into member_second_derivative_memory_consumption_stats
+ partition by health_second_der_member_partition;
+ from health_second_der_request [health_description == 'load_average']
+ #window.stratos:secondDerivative(1 min, value)
+ select member_id, cluster_id, cluster_instance_id, network_partition_id, value as member_second_derivative_load_average
+ insert into member_second_derivative_load_average_stats
+ partition by health_second_der_member_partition;]]></queryExpressions>
+ <exportedStreams>
+ <stream name="second_derivative_memory_consumption_stats"
+ valueOf="second_derivative_memory_consumption_stats" version="1.0.0"/>
+ <stream name="second_derivative_load_average_stats"
+ valueOf="second_derivative_load_average_stats" version="1.0.0"/>
+ <stream name="member_second_derivative_memory_consumption_stats"
+ valueOf="member_second_derivative_memory_consumption_stats" version="1.0.0"/>
+ <stream name="member_second_derivative_load_average_stats"
+ valueOf="member_second_derivative_load_average_stats" version="1.0.0"/>
+ </exportedStreams>
+</executionPlan>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.0.0/executionplans/SecondDerivativeOfRequestsInFlightFinder.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.0.0/executionplans/SecondDerivativeOfRequestsInFlightFinder.xml b/extensions/cep/modules/artifacts/wso2cep-3.0.0/executionplans/SecondDerivativeOfRequestsInFlightFinder.xml
new file mode 100644
index 0000000..c8e4ed5
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.0.0/executionplans/SecondDerivativeOfRequestsInFlightFinder.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<executionPlan name="SecondDerivativeOfRequestsInFlightFinder"
+ statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventprocessor">
+ <description>This will find the second derivative of the number of requests in flight over a minute.</description>
+ <siddhiConfiguration>
+ <property name="siddhi.enable.distributed.processing">false</property>
+ <property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
+ </siddhiConfiguration>
+ <importedStreams>
+ <stream as="second_der_rif" name="in_flight_requests" version="1.0.0"/>
+ </importedStreams>
+ <queryExpressions><![CDATA[
+ from second_der_rif
+ select cluster_id, cluster_instance_id, network_partition_id, in_flight_request_count,
+ stratos:concat(cluster_id, '-' ,network_partition_id) as rif_second_der_cluster_network
+ insert into rif_second_der_concat;
+ define partition rif_second_der_cluster_partition by rif_second_der_concat.rif_second_der_cluster_network;
+ from rif_second_der_concat#window.stratos:secondDerivative(1 min, in_flight_request_count)
+ select cluster_id, cluster_instance_id, network_partition_id,in_flight_request_count as count
+ insert into second_derivative_in_flight_requests
+ partition by rif_second_der_cluster_partition;
+ ]]></queryExpressions>
+ <exportedStreams>
+ <stream name="second_derivative_in_flight_requests"
+ valueOf="second_derivative_in_flight_requests" version="1.0.0"/>
+ </exportedStreams>
+</executionPlan>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.0.0/inputeventadaptors/DefaultWSO2EventInputAdaptor.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.0.0/inputeventadaptors/DefaultWSO2EventInputAdaptor.xml b/extensions/cep/modules/artifacts/wso2cep-3.0.0/inputeventadaptors/DefaultWSO2EventInputAdaptor.xml
new file mode 100644
index 0000000..77af463
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.0.0/inputeventadaptors/DefaultWSO2EventInputAdaptor.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<inputEventAdaptor name="DefaultWSO2EventInputAdaptor"
+ statistics="disable" trace="enable" type="wso2event" xmlns="http://wso2.org/carbon/eventadaptormanager"/>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.0.0/outputeventadaptors/DefaultWSO2EventOutputAdaptor.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.0.0/outputeventadaptors/DefaultWSO2EventOutputAdaptor.xml b/extensions/cep/modules/artifacts/wso2cep-3.0.0/outputeventadaptors/DefaultWSO2EventOutputAdaptor.xml
new file mode 100644
index 0000000..4438d2c
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.0.0/outputeventadaptors/DefaultWSO2EventOutputAdaptor.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<outputEventAdaptor name="DefaultWSO2EventOutputAdaptor"
+ statistics="disable" trace="disable" type="wso2event" xmlns="http://wso2.org/carbon/eventadaptormanager">
+ <property name="username">admin</property>
+ <property name="receiverURL">tcp://localhost:7661</property>
+ <property name="password">admin</property>
+ <property name="authenticatorURL">ssl://localhost:7761</property>
+</outputEventAdaptor>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.0.0/outputeventadaptors/JMSOutputAdaptor.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.0.0/outputeventadaptors/JMSOutputAdaptor.xml b/extensions/cep/modules/artifacts/wso2cep-3.0.0/outputeventadaptors/JMSOutputAdaptor.xml
new file mode 100644
index 0000000..59c3653
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.0.0/outputeventadaptors/JMSOutputAdaptor.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<outputEventAdaptor name="JMSOutputAdaptor" statistics="disable"
+ trace="enable" type="jms" xmlns="http://wso2.org/carbon/eventadaptormanager">
+ <!--property name="java.naming.provider.url">CEP_HOME/repository/conf/jndi.properties</property-->
+ <property name="java.naming.provider.url">tcp://localhost:61616</property>
+ <property name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</property>
+ <property name="transport.jms.ConnectionFactoryJNDIName">TopicConnectionFactory</property>
+ <property name="transport.jms.DestinationType">topic</property>
+</outputEventAdaptor>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.0.0/streamdefinitions/stream-manager-config.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.0.0/streamdefinitions/stream-manager-config.xml b/extensions/cep/modules/artifacts/wso2cep-3.0.0/streamdefinitions/stream-manager-config.xml
new file mode 100644
index 0000000..4c4c7e0
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.0.0/streamdefinitions/stream-manager-config.xml
@@ -0,0 +1,309 @@
+<?xml version='1.0'?>
+<!--
+
+ 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.
+
+-->
+
+<streamManagerConfiguration xmlns="http://wso2.org/carbon/streammanager">
+ <!-- in-flight requests stream definitions start -->
+ <streamDefinition name="in_flight_requests" version="1.0.0">
+ <description>in-flight request count</description>
+ <nickName>in-flight requests</nickName>
+ <metaData>
+ </metaData>
+ <correlationData>
+ </correlationData>
+ <payloadData>
+ <property name="cluster_id" type="String"/>
+ <property name="cluster_instance_id" type="String"/>
+ <property name="network_partition_id" type="String"/>
+ <property name="in_flight_request_count" type="double"/>
+ </payloadData>
+ </streamDefinition>
+
+ <streamDefinition name="gradient_in_flight_requests" version="1.0.0">
+ <description>gradient of in flight request count</description>
+ <nickName>gradient in flight requests</nickName>
+ <metaData>
+ </metaData>
+ <correlationData>
+ </correlationData>
+ <payloadData>
+ <property name="cluster_id" type="String"/>
+ <property name="cluster_instance_id" type="String"/>
+ <property name="network_partition_id" type="String"/>
+ <property name="count" type="double"/>
+ </payloadData>
+ </streamDefinition>
+
+ <streamDefinition name="average_in_flight_requests" version="1.0.0">
+ <description>average of in-flight request count</description>
+ <nickName>average in-flight requests</nickName>
+ <metaData>
+ </metaData>
+ <correlationData>
+ </correlationData>
+ <payloadData>
+ <property name="cluster_id" type="String"/>
+ <property name="cluster_instance_id" type="String"/>
+ <property name="network_partition_id" type="String"/>
+ <property name="count" type="double"/>
+ </payloadData>
+ </streamDefinition>
+
+ <streamDefinition name="second_derivative_in_flight_requests" version="1.0.0">
+ <description>second derivative of in-flight request count</description>
+ <nickName>second derivative in-flight requests</nickName>
+ <metaData>
+ </metaData>
+ <correlationData>
+ </correlationData>
+ <payloadData>
+ <property name="cluster_id" type="String"/>
+ <property name="cluster_instance_id" type="String"/>
+ <property name="network_partition_id" type="String"/>
+ <property name="count" type="double"/>
+ </payloadData>
+ </streamDefinition>
+ <!-- in-flight requests stream definitions end -->
+
+ <!-- cartridge agent health stats stream definitions start -->
+ <streamDefinition name="cartridge_agent_health_stats" version="1.0.0">
+ <description>agent health stats</description>
+ <nickName>agent health stats</nickName>
+ <metaData>
+ </metaData>
+ <correlationData>
+ </correlationData>
+ <payloadData>
+ <property name="cluster_id" type="String" />
+ <property name="cluster_instance_id" type="String"/>
+ <property name="network_partition_id" type="String"/>
+ <property name="member_id" type="String" />
+ <property name="partition_id" type="String" />
+ <property name="health_description" type="String"/>
+ <property name="value" type="double"/>
+ </payloadData>
+ </streamDefinition>
+
+ <streamDefinition name="average_load_average_stats" version="1.0.0">
+ <description>average load average stats</description>
+ <nickName>average load average stats</nickName>
+ <metaData>
+ </metaData>
+ <correlationData>
+ </correlationData>
+ <payloadData>
+ <property name="cluster_id" type="String" />
+ <property name="cluster_instance_id" type="String"/>
+ <property name="network_partition_id" type="String"/>
+ <property name="average_load_average" type="double"/>
+ </payloadData>
+ </streamDefinition>
+
+ <streamDefinition name="average_memory_consumption_stats" version="1.0.0">
+ <description>average memory consumption stats</description>
+ <nickName>average memory consumption stats</nickName>
+ <metaData>
+ </metaData>
+ <correlationData>
+ </correlationData>
+ <payloadData>
+ <property name="cluster_id" type="String"/>
+ <property name="cluster_instance_id" type="String"/>
+ <property name="network_partition_id" type="String"/>
+ <property name="average_memory_consumption" type="double"/>
+ </payloadData>
+ </streamDefinition>
+
+ <streamDefinition name="gradient_load_average_stats" version="1.0.0">
+ <description>gradient load average stats</description>
+ <nickName>gradient load average stats</nickName>
+ <metaData>
+ </metaData>
+ <correlationData>
+ </correlationData>
+ <payloadData>
+ <property name="cluster_id" type="String" />
+ <property name="cluster_instance_id" type="String"/>
+ <property name="network_partition_id" type="String"/>
+ <property name="gradient_load_average" type="double"/>
+ </payloadData>
+ </streamDefinition>
+
+ <streamDefinition name="gradient_memory_consumption_stats" version="1.0.0">
+ <description>gradient memoryconsumption stats</description>
+ <nickName>gradient memoryconsumption stats</nickName>
+ <metaData>
+ </metaData>
+ <correlationData>
+ </correlationData>
+ <payloadData>
+ <property name="cluster_id" type="String" />
+ <property name="cluster_instance_id" type="String"/>
+ <property name="network_partition_id" type="String"/>
+ <property name="gradient_memory_consumption" type="double"/>
+ </payloadData>
+ </streamDefinition>
+
+ <streamDefinition name="second_derivative_memory_consumption_stats" version="1.0.0">
+ <description>second derivative memory consumption stats</description>
+ <nickName>second derivative memory consumption stats</nickName>
+ <metaData>
+ </metaData>
+ <correlationData>
+ </correlationData>
+ <payloadData>
+ <property name="cluster_id" type="String" />
+ <property name="cluster_instance_id" type="String"/>
+ <property name="network_partition_id" type="String"/>
+ <property name="second_derivative_memory_consumption" type="double"/>
+ </payloadData>
+ </streamDefinition>
+
+ <streamDefinition name="second_derivative_load_average_stats" version="1.0.0">
+ <description>second derivative load average stats</description>
+ <nickName>second derivative load average stats</nickName>
+ <metaData>
+ </metaData>
+ <correlationData>
+ </correlationData>
+ <payloadData>
+ <property name="cluster_id" type="String" />
+ <property name="cluster_instance_id" type="String"/>
+ <property name="network_partition_id" type="String"/>
+ <property name="second_derivative_load_average" type="double"/>
+ </payloadData>
+ </streamDefinition>
+
+ <streamDefinition name="fault_message" version="1.0.0">
+ <description>fault message</description>
+ <nickName>fault message</nickName>
+ <metaData>
+ </metaData>
+ <correlationData>
+ </correlationData>
+ <payloadData>
+ <property name="cluster_id" type="String"/>
+ <property name="cluster_instance_id" type="String"/>
+ <property name="network_partition_id" type="String"/>
+ <property name="member_id" type="String"/>
+ <property name="partition_id" type="String"/>
+ </payloadData>
+ </streamDefinition>
+ <!-- cartridge agent health stats stream definitions end -->
+
+ <!-- This is for member_id wise grouping-->
+ <streamDefinition name="member_average_load_average_stats" version="1.0.0">
+ <description>average load average stats</description>
+ <nickName>average load average stats</nickName>
+ <metaData>
+ </metaData>
+ <correlationData>
+ </correlationData>
+ <payloadData>
+ <property name="member_id" type="String" />
+ <property name="cluster_id" type="String" />
+ <property name="cluster_instance_id" type="String"/>
+ <property name="network_partition_id" type="String"/>
+ <property name="member_average_load_average" type="double"/>
+ </payloadData>
+ </streamDefinition>
+
+ <streamDefinition name="member_average_memory_consumption_stats" version="1.0.0">
+ <description>average memory consumption stats</description>
+ <nickName>average memory consumption stats</nickName>
+ <metaData>
+ </metaData>
+ <correlationData>
+ </correlationData>
+ <payloadData>
+ <property name="member_id" type="String"/>
+ <property name="cluster_id" type="String"/>
+ <property name="cluster_instance_id" type="String"/>
+ <property name="network_partition_id" type="String"/>
+ <property name="member_average_memory_consumption" type="double"/>
+ </payloadData>
+ </streamDefinition>
+
+ <streamDefinition name="member_gradient_load_average_stats" version="1.0.0">
+ <description>gradient load average stats</description>
+ <nickName>gradient load average stats</nickName>
+ <metaData>
+ </metaData>
+ <correlationData>
+ </correlationData>
+ <payloadData>
+ <property name="member_id" type="String" />
+ <property name="cluster_id" type="String" />
+ <property name="cluster_instance_id" type="String"/>
+ <property name="network_partition_id" type="String"/>
+ <property name="member_gradient_load_average" type="double"/>
+ </payloadData>
+ </streamDefinition>
+
+ <streamDefinition name="member_gradient_memory_consumption_stats" version="1.0.0">
+ <description>gradient memoryconsumption stats</description>
+ <nickName>gradient memoryconsumption stats</nickName>
+ <metaData>
+ </metaData>
+ <correlationData>
+ </correlationData>
+ <payloadData>
+ <property name="member_id" type="String" />
+ <property name="cluster_id" type="String" />
+ <property name="cluster_instance_id" type="String"/>
+ <property name="network_partition_id" type="String"/>
+ <property name="member_gradient_memory_consumption" type="double"/>
+ </payloadData>
+ </streamDefinition>
+
+ <streamDefinition name="member_second_derivative_memory_consumption_stats" version="1.0.0">
+ <description>second derivative memory consumption stats</description>
+ <nickName>second derivative memory consumption stats</nickName>
+ <metaData>
+ </metaData>
+ <correlationData>
+ </correlationData>
+ <payloadData>
+ <property name="member_id" type="String" />
+ <property name="cluster_id" type="String" />
+ <property name="cluster_instance_id" type="String"/>
+ <property name="network_partition_id" type="String"/>
+ <property name="member_second_derivative_memory_consumption" type="double"/>
+ </payloadData>
+ </streamDefinition>
+
+ <streamDefinition name="member_second_derivative_load_average_stats" version="1.0.0">
+ <description>second derivative load average stats</description>
+ <nickName>second derivative load average stats</nickName>
+ <metaData>
+ </metaData>
+ <correlationData>
+ </correlationData>
+ <payloadData>
+ <property name="member_id" type="String" />
+ <property name="cluster_id" type="String" />
+ <property name="cluster_instance_id" type="String"/>
+ <property name="network_partition_id" type="String"/>
+ <property name="member_second_derivative_load_average" type="double"/>
+ </payloadData>
+ </streamDefinition>
+
+</streamManagerConfiguration>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventbuilders/HealthStatisticsEventBuilder.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventbuilders/HealthStatisticsEventBuilder.xml b/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventbuilders/HealthStatisticsEventBuilder.xml
new file mode 100644
index 0000000..92f8d8a
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventbuilders/HealthStatisticsEventBuilder.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<eventBuilder name="HealthStatisticsEventBuilder" statistics="disable"
+ trace="enable" xmlns="http://wso2.org/carbon/eventbuilder">
+ <from eventAdaptorName="DefaultWSO2EventInputAdaptor" eventAdaptorType="wso2event">
+ <property name="stream">cartridge_agent_health_stats</property>
+ <property name="version">1.0.0</property>
+ </from>
+ <mapping customMapping="disable" type="wso2event"/>
+ <to streamName="cartridge_agent_health_stats" version="1.0.0"/>
+</eventBuilder>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventbuilders/LoadBalancerStatisticsEventBuilder.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventbuilders/LoadBalancerStatisticsEventBuilder.xml b/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventbuilders/LoadBalancerStatisticsEventBuilder.xml
new file mode 100644
index 0000000..8090e63
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventbuilders/LoadBalancerStatisticsEventBuilder.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<eventBuilder name="LoadBalancerStatisticsEventBuilder"
+ statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventbuilder">
+ <from eventAdaptorName="DefaultWSO2EventInputAdaptor" eventAdaptorType="wso2event">
+ <property name="stream">in_flight_requests</property>
+ <property name="version">1.0.0</property>
+ </from>
+ <mapping customMapping="disable" type="wso2event"/>
+ <to streamName="in_flight_requests" version="1.0.0"/>
+</eventBuilder>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/AverageInFlightRequestsEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/AverageInFlightRequestsEventFormatter.xml b/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/AverageInFlightRequestsEventFormatter.xml
new file mode 100644
index 0000000..5955866
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/AverageInFlightRequestsEventFormatter.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<eventFormatter name="AverageRequestsInflightEventFormatter"
+ statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
+ <from streamName="average_in_flight_requests" version="1.0.0"/>
+ <mapping customMapping="enable" type="json">
+ <inline>{"org.apache.stratos.messaging.event.health.stat.AverageRequestsInFlightEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{count}}"}}}</inline>
+ </mapping>
+ <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+ <property name="transport.jms.Destination">summarized-health-stats</property>
+ </to>
+</eventFormatter>
[5/9] stratos git commit: Upgrading CEP artifacts to 3.1.0
Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/AverageLoadAverageEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/AverageLoadAverageEventFormatter.xml b/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/AverageLoadAverageEventFormatter.xml
new file mode 100644
index 0000000..a0e2052
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/AverageLoadAverageEventFormatter.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<eventFormatter name="AverageLoadAverageEventFormatter"
+ statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
+ <from streamName="average_load_average_stats" version="1.0.0"/>
+ <mapping customMapping="enable" type="json">
+ <inline>{"org.apache.stratos.messaging.event.health.stat.AverageLoadAverageEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{average_load_average}}"}}}</inline>
+ </mapping>
+ <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+ <property name="transport.jms.Destination">summarized-health-stats</property>
+ </to>
+</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/AverageMemoryConsumptionEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/AverageMemoryConsumptionEventFormatter.xml b/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/AverageMemoryConsumptionEventFormatter.xml
new file mode 100644
index 0000000..cbcab0a
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/AverageMemoryConsumptionEventFormatter.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<eventFormatter name="AverageMemoryConsumptionEventFormatter"
+ statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
+ <from streamName="average_memory_consumption_stats" version="1.0.0"/>
+ <mapping customMapping="enable" type="json">
+ <inline>{"org.apache.stratos.messaging.event.health.stat.AverageMemoryConsumptionEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{average_memory_consumption}}"}}}</inline>
+ </mapping>
+ <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+ <property name="transport.jms.Destination">summarized-health-stats</property>
+ </to>
+</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/FaultMessageEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/FaultMessageEventFormatter.xml b/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/FaultMessageEventFormatter.xml
new file mode 100644
index 0000000..96264ca
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/FaultMessageEventFormatter.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<eventFormatter name="FaultMessageEventFormatter"
+ statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
+ <from streamName="fault_message" version="1.0.0"/>
+ <mapping customMapping="enable" type="json">
+ <inline>{"org.apache.stratos.messaging.event.health.stat.MemberFaultEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","memberId":"{{member_id}}","partitionId":"{{partition_id}}"}}}</inline>
+ </mapping>
+ <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+ <property name="transport.jms.Destination">summarized-health-stats</property>
+ </to>
+</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/GradientInFlightRequestsEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/GradientInFlightRequestsEventFormatter.xml b/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/GradientInFlightRequestsEventFormatter.xml
new file mode 100644
index 0000000..2b5045b
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/GradientInFlightRequestsEventFormatter.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<eventFormatter name="GradientInFlightRequestsEventFormatter" statistics="disable"
+ trace="disable" xmlns="http://wso2.org/carbon/eventformatter">
+ <from streamName="gradient_in_flight_requests" version="1.0.0"/>
+ <mapping customMapping="enable" type="json">
+ <inline>{"org.apache.stratos.messaging.event.health.stat.GradientOfRequestsInFlightEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{count}}"}}}</inline>
+ </mapping>
+ <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+ <property name="transport.jms.Destination">summarized-health-stats</property>
+ </to>
+</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/GradientLoadAverageEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/GradientLoadAverageEventFormatter.xml b/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/GradientLoadAverageEventFormatter.xml
new file mode 100644
index 0000000..7fa3d7a
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/GradientLoadAverageEventFormatter.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<eventFormatter name="GradientLoadAverageEventFormatter"
+ statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
+ <from streamName="gradient_load_average_stats" version="1.0.0"/>
+ <mapping customMapping="enable" type="json">
+ <inline>{"org.apache.stratos.messaging.event.health.stat.GradientOfLoadAverageEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{gradient_load_average}}"}}}</inline>
+ </mapping>
+ <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+ <property name="transport.jms.Destination">summarized-health-stats</property>
+ </to>
+</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/GradientMemoryConsumptionEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/GradientMemoryConsumptionEventFormatter.xml b/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/GradientMemoryConsumptionEventFormatter.xml
new file mode 100644
index 0000000..8c3b871
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/GradientMemoryConsumptionEventFormatter.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<eventFormatter name="GradientMemoryConsumptionEventFormatter"
+ statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
+ <from streamName="gradient_memory_consumption_stats" version="1.0.0"/>
+ <mapping customMapping="enable" type="json">
+ <inline>{"org.apache.stratos.messaging.event.health.stat.GradientOfMemoryConsumptionEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{gradient_memory_consumption}}"}}}</inline>
+ </mapping>
+ <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+ <property name="transport.jms.Destination">summarized-health-stats</property>
+ </to>
+</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/MemberAverageLoadAverageEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/MemberAverageLoadAverageEventFormatter.xml b/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/MemberAverageLoadAverageEventFormatter.xml
new file mode 100644
index 0000000..cab6df6
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/MemberAverageLoadAverageEventFormatter.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<eventFormatter name="MemberAverageLoadAverageEventFormatter"
+ statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
+ <from streamName="member_average_load_average_stats" version="1.0.0"/>
+ <mapping customMapping="enable" type="json">
+ <inline>{"org.apache.stratos.messaging.event.health.stat.MemberAverageLoadAverageEvent":{"message":{"memberId":"{{member_id}}","clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{member_average_load_average}}"}}}</inline>
+ </mapping>
+ <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+ <property name="transport.jms.Destination">summarized-health-stats</property>
+ </to>
+</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/MemberAverageMemoryConsumptionEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/MemberAverageMemoryConsumptionEventFormatter.xml b/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/MemberAverageMemoryConsumptionEventFormatter.xml
new file mode 100644
index 0000000..7f6e1f8
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/MemberAverageMemoryConsumptionEventFormatter.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<eventFormatter name="MemberAverageMemoryConsumptionEventFormatter"
+ statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
+ <from streamName="member_average_memory_consumption_stats" version="1.0.0"/>
+ <mapping customMapping="enable" type="json">
+ <inline>{"org.apache.stratos.messaging.event.health.stat.MemberAverageMemoryConsumptionEvent":{"message":{"memberId":"{{member_id}}","clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{member_average_memory_consumption}}"}}}</inline>
+ </mapping>
+ <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+ <property name="transport.jms.Destination">summarized-health-stats</property>
+ </to>
+</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/MemberGradientLoadAverageEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/MemberGradientLoadAverageEventFormatter.xml b/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/MemberGradientLoadAverageEventFormatter.xml
new file mode 100644
index 0000000..af73b46
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/MemberGradientLoadAverageEventFormatter.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<eventFormatter name="MemberGradientLoadAverageEventFormatter"
+ statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
+ <from streamName="member_gradient_load_average_stats" version="1.0.0"/>
+ <mapping customMapping="enable" type="json">
+ <inline>{"org.apache.stratos.messaging.event.health.stat.MemberGradientOfLoadAverageEvent":{"message":{"memberId":"{{member_id}}","clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{member_gradient_load_average}}"}}}</inline>
+ </mapping>
+ <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+ <property name="transport.jms.Destination">summarized-health-stats</property>
+ </to>
+</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/MemberGradientMemoryConsumptionEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/MemberGradientMemoryConsumptionEventFormatter.xml b/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/MemberGradientMemoryConsumptionEventFormatter.xml
new file mode 100644
index 0000000..702f149
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/MemberGradientMemoryConsumptionEventFormatter.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<eventFormatter name="MemberGradientMemoryConsumptionEventFormatter"
+ statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
+ <from streamName="member_gradient_memory_consumption_stats" version="1.0.0"/>
+ <mapping customMapping="enable" type="json">
+ <inline>{"org.apache.stratos.messaging.event.health.stat.MemberGradientOfMemoryConsumptionEvent":{"message":{"memberId":"{{member_id}}","clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{member_gradient_memory_consumption}}"}}}</inline>
+ </mapping>
+ <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+ <property name="transport.jms.Destination">summarized-health-stats</property>
+ </to>
+</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/MemberSecondDerivativeLoadAverageEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/MemberSecondDerivativeLoadAverageEventFormatter.xml b/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/MemberSecondDerivativeLoadAverageEventFormatter.xml
new file mode 100644
index 0000000..5281652
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/MemberSecondDerivativeLoadAverageEventFormatter.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<eventFormatter name="MemberSecondDerivativeLoadAverageEventFormatter"
+ statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventformatter">
+ <from streamName="member_second_derivative_load_average_stats" version="1.0.0"/>
+ <mapping customMapping="enable" type="json">
+ <inline>{"org.apache.stratos.messaging.event.health.stat.MemberSecondDerivativeOfLoadAverageEvent":{"message":{"memberId":"{{member_id}}","clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{member_second_derivative_load_average}}"}}}</inline>
+ </mapping>
+ <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+ <property name="transport.jms.Destination">summarized-health-stats</property>
+ </to>
+</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/MemberSecondDerivativeMemoryConsumptionEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/MemberSecondDerivativeMemoryConsumptionEventFormatter.xml b/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/MemberSecondDerivativeMemoryConsumptionEventFormatter.xml
new file mode 100644
index 0000000..2e32be3
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/MemberSecondDerivativeMemoryConsumptionEventFormatter.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<eventFormatter name="MemberSecondDerivativeMemoryConsumptionEventFormatter"
+ statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventformatter">
+ <from streamName="member_second_derivative_memory_consumption_stats" version="1.0.0"/>
+ <mapping customMapping="enable" type="json">
+ <inline>{"org.apache.stratos.messaging.event.health.stat.MemberSecondDerivativeOfMemoryConsumptionEvent":{"message":{"memberId":"{{member_id}}","clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{member_second_derivative_memory_consumption}}"}}}</inline>
+ </mapping>
+ <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+ <property name="transport.jms.Destination">summarized-health-stats</property>
+ </to>
+</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/SecondDerivativeInFlightRequestsEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/SecondDerivativeInFlightRequestsEventFormatter.xml b/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/SecondDerivativeInFlightRequestsEventFormatter.xml
new file mode 100644
index 0000000..61862d1
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/SecondDerivativeInFlightRequestsEventFormatter.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<eventFormatter name="SecondDerivativeEventFormatter"
+ statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventformatter">
+ <from streamName="second_derivative_in_flight_requests" version="1.0.0"/>
+ <mapping customMapping="enable" type="json">
+ <inline>{"org.apache.stratos.messaging.event.health.stat.SecondDerivativeOfRequestsInFlightEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{count}}"}}}</inline>
+ </mapping>
+ <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+ <property name="transport.jms.Destination">summarized-health-stats</property>
+ </to>
+</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/SecondDerivativeLoadAverageEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/SecondDerivativeLoadAverageEventFormatter.xml b/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/SecondDerivativeLoadAverageEventFormatter.xml
new file mode 100644
index 0000000..3dc4a74
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/SecondDerivativeLoadAverageEventFormatter.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<eventFormatter name="SecondDerivativeLoadAverageEventFormatter"
+ statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventformatter">
+ <from streamName="second_derivative_load_average_stats" version="1.0.0"/>
+ <mapping customMapping="enable" type="json">
+ <inline>{"org.apache.stratos.messaging.event.health.stat.SecondDerivativeOfLoadAverageEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{second_derivative_load_average}}"}}}</inline>
+ </mapping>
+ <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+ <property name="transport.jms.Destination">summarized-health-stats</property>
+ </to>
+</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/SecondDerivativeMemoryConsumptionEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/SecondDerivativeMemoryConsumptionEventFormatter.xml b/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/SecondDerivativeMemoryConsumptionEventFormatter.xml
new file mode 100644
index 0000000..bb0f70c
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.1.0/eventformatters/SecondDerivativeMemoryConsumptionEventFormatter.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<eventFormatter name="SecondDerivativeMemoryConsumptionEventFormatter"
+ statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventformatter">
+ <from streamName="second_derivative_memory_consumption_stats" version="1.0.0"/>
+ <mapping customMapping="enable" type="json">
+ <inline>{"org.apache.stratos.messaging.event.health.stat.SecondDerivativeOfMemoryConsumptionEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{second_derivative_memory_consumption}}"}}}</inline>
+ </mapping>
+ <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+ <property name="transport.jms.Destination">summarized-health-stats</property>
+ </to>
+</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.1.0/executionplans/AverageHeathRequest.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.1.0/executionplans/AverageHeathRequest.xml b/extensions/cep/modules/artifacts/wso2cep-3.1.0/executionplans/AverageHeathRequest.xml
new file mode 100644
index 0000000..0a6881b
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.1.0/executionplans/AverageHeathRequest.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright 2005-2009 WSO2, Inc. (http://wso2.com)
+ ~ Licensed 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.
+ -->
+
+<executionPlan name="AverageHeathRequest" statistics="disable"
+ trace="enable" xmlns="http://wso2.org/carbon/eventprocessor">
+ <description>This will average health stats of an instance over a minute.</description>
+ <siddhiConfiguration>
+ <property name="siddhi.enable.distributed.processing">RedundantNode</property>
+ <property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
+ </siddhiConfiguration>
+ <importedStreams>
+ <stream as="health_avg_processsor" name="cartridge_agent_health_stats" version="1.0.0"/>
+ </importedStreams>
+ <queryExpressions><![CDATA[
+ from health_avg_processsor [health_description == 'ports_not_open']
+ select cluster_id, cluster_instance_id, network_partition_id, member_id, partition_id insert into fault_message;
+ from health_avg_processsor
+ select cluster_id, cluster_instance_id, network_partition_id, member_id, partition_id, health_description, value,
+ stratos:concat(cluster_id, '-' , cluster_instance_id) as health_grad_cluster_network
+ insert into health_avg_concatinator;
+ define partition health_avg_cluster_partition by health_avg_concatinator.health_grad_cluster_network;
+ define partition member_health_avg_cluster_partition by health_avg_processsor.member_id;
+ from health_avg_concatinator [health_description == 'load_average']
+ #window.timeBatch(1 min) select cluster_id, cluster_instance_id, network_partition_id, avg(value) as average_load_average
+ insert into average_load_average_stats
+ partition by health_avg_cluster_partition;
+ from health_avg_processsor [health_description == 'load_average']
+ #window.timeBatch(1 min) select member_id, cluster_id, cluster_instance_id, network_partition_id, avg(value) as member_average_load_average
+ insert into member_average_load_average_stats
+ partition by member_health_avg_cluster_partition;
+ from health_avg_processsor [health_description == 'memory_consumption']
+ #window.timeBatch(1 min) select member_id, cluster_id, cluster_instance_id, network_partition_id, avg(value) as member_average_memory_consumption
+ insert into member_average_memory_consumption_stats
+ partition by member_health_avg_cluster_partition;
+ from health_avg_concatinator [health_description == 'memory_consumption']
+ #window.timeBatch(1 min) select cluster_id, cluster_instance_id, network_partition_id, avg(value) as average_memory_consumption
+ insert into average_memory_consumption_stats
+ partition by health_avg_cluster_partition;
+ ]]></queryExpressions>
+ <exportedStreams>
+ <stream name="average_load_average_stats" passthroughFlow="disable"
+ valueOf="average_load_average_stats" version="1.0.0"/>
+ <stream name="member_average_load_average_stats" passthroughFlow="disable"
+ valueOf="member_average_load_average_stats" version="1.0.0"/>
+ <stream name="member_average_memory_consumption_stats" passthroughFlow="disable"
+ valueOf="member_average_memory_consumption_stats" version="1.0.0"/>
+ <stream name="average_memory_consumption_stats" passthroughFlow="disable"
+ valueOf="average_memory_consumption_stats" version="1.0.0"/>
+ <stream name="fault_message" passthroughFlow="disable"
+ valueOf="fault_message" version="1.0.0"/>
+ </exportedStreams>
+</executionPlan>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.1.0/executionplans/AverageInFlightRequestsFinder.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.1.0/executionplans/AverageInFlightRequestsFinder.xml b/extensions/cep/modules/artifacts/wso2cep-3.1.0/executionplans/AverageInFlightRequestsFinder.xml
new file mode 100644
index 0000000..0c950c6
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.1.0/executionplans/AverageInFlightRequestsFinder.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright 2005-2009 WSO2, Inc. (http://wso2.com)
+ ~ Licensed 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.
+ -->
+
+<executionPlan name="AverageInFlightRequestsFinder" statistics="disable"
+ trace="enable" xmlns="http://wso2.org/carbon/eventprocessor">
+ <description>This will average the number of requests in flight over a minute.</description>
+ <siddhiConfiguration>
+ <property name="siddhi.enable.distributed.processing">RedundantNode</property>
+ <property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
+ </siddhiConfiguration>
+ <importedStreams>
+ <stream as="avg_rif_stat" name="in_flight_requests" version="1.0.0"/>
+ </importedStreams>
+ <queryExpressions><![CDATA[
+ from avg_rif_stat
+ select cluster_id, cluster_instance_id, network_partition_id, in_flight_request_count,
+ stratos:concat(cluster_id, '-' ,cluster_instance_id) as avg_rif_cluster_network
+ insert into avg_rif_concat;
+ define partition avg_rif_cluster_partition by avg_rif_concat.avg_rif_cluster_network;
+ from avg_rif_concat#window.timeBatch(1 min)
+ select cluster_id, cluster_instance_id, network_partition_id, avg(in_flight_request_count) as count
+ insert into average_in_flight_requests
+ partition by avg_rif_cluster_partition;
+ ]]></queryExpressions>
+ <exportedStreams>
+ <stream name="average_in_flight_requests"
+ valueOf="average_in_flight_requests" version="1.0.0"/>
+ </exportedStreams>
+</executionPlan>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.1.0/executionplans/GradientOfHealthRequest.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.1.0/executionplans/GradientOfHealthRequest.xml b/extensions/cep/modules/artifacts/wso2cep-3.1.0/executionplans/GradientOfHealthRequest.xml
new file mode 100644
index 0000000..05bb942
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.1.0/executionplans/GradientOfHealthRequest.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright 2005-2009 WSO2, Inc. (http://wso2.com)
+ ~ Licensed 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.
+ -->
+
+<executionPlan name="GradientOfHealthRequest" statistics="disable"
+ trace="disable" xmlns="http://wso2.org/carbon/eventprocessor">
+ <description>This will find the gradient of the heath request over a minute.</description>
+ <siddhiConfiguration>
+ <property name="siddhi.enable.distributed.processing">RedundantNode</property>
+ <property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
+ </siddhiConfiguration>
+ <importedStreams>
+ <stream as="health_grad_processsor" name="cartridge_agent_health_stats" version="1.0.0"/>
+ </importedStreams>
+ <queryExpressions><![CDATA[
+ from health_grad_processsor
+ #window.stratos:faultHandling(1min, member_id) select cluster_id, cluster_instance_id, network_partition_id, member_id, partition_id
+ group by cluster_id, network_partition_id
+ insert into fault_message;
+ from health_grad_processsor
+ select cluster_id, cluster_instance_id, network_partition_id, member_id, partition_id, health_description, value,
+ stratos:concat(cluster_id, '-' , cluster_instance_id) as health_grad_cluster_network
+ insert into health_grad_concatinator;
+ define partition health_grad_cluster_partition by health_grad_concatinator.health_grad_cluster_network;
+ define partition member_health_grad_cluster_partition by health_grad_processsor.member_id;
+ from health_grad_concatinator [health_description == 'load_average']
+ #window.stratos:gradient(1 min, value) select cluster_id, cluster_instance_id, network_partition_id, value as gradient_load_average
+ insert into gradient_load_average_stats
+ partition by health_grad_cluster_partition;
+ from health_grad_processsor [health_description == 'load_average']
+ #window.stratos:gradient(1 min, value) select member_id, cluster_id, cluster_instance_id, network_partition_id, value as member_gradient_load_average
+ insert into member_gradient_load_average_stats
+ partition by member_health_grad_cluster_partition;
+ from health_grad_processsor [health_description == 'memory_consumption']
+ #window.stratos:gradient(1 min, value) select member_id, cluster_id, cluster_instance_id, network_partition_id, value as member_gradient_memory_consumption
+ insert into member_gradient_memory_consumption_stats partition by member_health_grad_cluster_partition;
+ from health_grad_concatinator [health_description == 'memory_consumption']
+ #window.stratos:gradient(1 min, value) select cluster_id, cluster_instance_id, network_partition_id, value as gradient_memory_consumption
+ insert into gradient_memory_consumption_stats
+ partition by health_grad_cluster_partition;]]></queryExpressions>
+ <exportedStreams>
+ <stream name="gradient_load_average_stats"
+ valueOf="gradient_load_average_stats" version="1.0.0"/>
+ <stream name="gradient_memory_consumption_stats"
+ valueOf="gradient_memory_consumption_stats" version="1.0.0"/>
+ <stream name="member_gradient_load_average_stats"
+ valueOf="member_gradient_load_average_stats" version="1.0.0"/>
+ <stream name="member_gradient_memory_consumption_stats"
+ valueOf="member_gradient_memory_consumption_stats" version="1.0.0"/>
+ <stream name="fault_message" passthroughFlow="disable"
+ valueOf="fault_message" version="1.0.0"/>
+ </exportedStreams>
+</executionPlan>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.1.0/executionplans/GradientOfRequestsInFlightFinder.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.1.0/executionplans/GradientOfRequestsInFlightFinder.xml b/extensions/cep/modules/artifacts/wso2cep-3.1.0/executionplans/GradientOfRequestsInFlightFinder.xml
new file mode 100644
index 0000000..41e6a89
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.1.0/executionplans/GradientOfRequestsInFlightFinder.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright 2005-2009 WSO2, Inc. (http://wso2.com)
+ ~ Licensed 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.
+ -->
+
+<executionPlan name="GradientOfRequestsInFlightFinder"
+ statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventprocessor">
+ <description>This will find the gradient of the number of requests in flight over a minute.</description>
+ <siddhiConfiguration>
+ <property name="siddhi.enable.distributed.processing">RedundantNode</property>
+ <property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
+ </siddhiConfiguration>
+ <importedStreams>
+ <stream as="gradient_rif_processor" name="in_flight_requests" version="1.0.0"/>
+ </importedStreams>
+ <queryExpressions><![CDATA[
+ from gradient_rif_processor
+ select cluster_id, cluster_instance_id, network_partition_id, in_flight_request_count,
+ stratos:concat(cluster_id, '-' , network_partition_id) as request_grad_cluster_network
+ insert into gradient_rif_concatinator;
+ define partition request_grad_cluster_partition by gradient_rif_concatinator.request_grad_cluster_network;
+ from gradient_rif_concatinator
+ #window.stratos:gradient(1 min, in_flight_request_count)
+ select cluster_id, cluster_instance_id, network_partition_id,in_flight_request_count as count
+ insert into gradient_in_flight_requests
+ partition by request_grad_cluster_partition;
+]]></queryExpressions>
+ <exportedStreams>
+ <stream name="gradient_in_flight_requests" valueOf="gradient_in_flight_requests" version="1.0.0"/>
+ </exportedStreams>
+</executionPlan>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.1.0/executionplans/SecondDerivativeOfHealthRequest.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.1.0/executionplans/SecondDerivativeOfHealthRequest.xml b/extensions/cep/modules/artifacts/wso2cep-3.1.0/executionplans/SecondDerivativeOfHealthRequest.xml
new file mode 100644
index 0000000..df06388
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.1.0/executionplans/SecondDerivativeOfHealthRequest.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright 2005-2009 WSO2, Inc. (http://wso2.com)
+ ~ Licensed 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.
+ -->
+
+<executionPlan name="SecondDerivativeOfHealthRequest"
+ statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventprocessor">
+ <description>This will find the second derivative of health stats over a minute.</description>
+ <siddhiConfiguration>
+ <property name="siddhi.enable.distributed.processing">RedundantNode</property>
+ <property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
+ </siddhiConfiguration>
+ <importedStreams>
+ <stream as="health_second_der_request" name="cartridge_agent_health_stats" version="1.0.0"/>
+ </importedStreams>
+ <queryExpressions><![CDATA[
+ from health_second_der_request
+ select member_id, cluster_id, cluster_instance_id, network_partition_id, health_description, value,
+ stratos:concat(cluster_id, '-' ,cluster_instance_id) as health_second_der_cluster_network
+ insert into health_second_der_concat;
+ define partition health_second_der_cluster_partition by health_second_der_concat.health_second_der_cluster_network;
+ from health_second_der_concat [health_description == 'memory_consumption']
+ #window.stratos:secondDerivative(1 min, value) select cluster_id, cluster_instance_id, network_partition_id, value as second_derivative_memory_consumption
+ insert into second_derivative_memory_consumption_stats
+ partition by health_second_der_cluster_partition;
+ from health_second_der_concat [health_description == 'load_average']
+ #window.stratos:secondDerivative(1 min, value) select cluster_id, cluster_instance_id, network_partition_id, value as second_derivative_load_average
+ insert into second_derivative_load_average_stats
+ partition by health_second_der_cluster_partition;
+ define partition health_second_der_member_partition by health_second_der_request.member_id;
+ from health_second_der_request [health_description == 'memory_consumption']
+ #window.stratos:secondDerivative(1 min, value)
+ select member_id, cluster_id, cluster_instance_id, network_partition_id, value as member_second_derivative_memory_consumption
+ insert into member_second_derivative_memory_consumption_stats
+ partition by health_second_der_member_partition;
+ from health_second_der_request [health_description == 'load_average']
+ #window.stratos:secondDerivative(1 min, value)
+ select member_id, cluster_id, cluster_instance_id, network_partition_id, value as member_second_derivative_load_average
+ insert into member_second_derivative_load_average_stats
+ partition by health_second_der_member_partition;]]></queryExpressions>
+ <exportedStreams>
+ <stream name="second_derivative_memory_consumption_stats"
+ valueOf="second_derivative_memory_consumption_stats" version="1.0.0"/>
+ <stream name="second_derivative_load_average_stats"
+ valueOf="second_derivative_load_average_stats" version="1.0.0"/>
+ <stream name="member_second_derivative_memory_consumption_stats"
+ valueOf="member_second_derivative_memory_consumption_stats" version="1.0.0"/>
+ <stream name="member_second_derivative_load_average_stats"
+ valueOf="member_second_derivative_load_average_stats" version="1.0.0"/>
+ </exportedStreams>
+</executionPlan>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.1.0/executionplans/SecondDerivativeOfRequestsInFlightFinder.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.1.0/executionplans/SecondDerivativeOfRequestsInFlightFinder.xml b/extensions/cep/modules/artifacts/wso2cep-3.1.0/executionplans/SecondDerivativeOfRequestsInFlightFinder.xml
new file mode 100644
index 0000000..2a48c05
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.1.0/executionplans/SecondDerivativeOfRequestsInFlightFinder.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright 2005-2009 WSO2, Inc. (http://wso2.com)
+ ~ Licensed 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.
+ -->
+
+<executionPlan name="SecondDerivativeOfRequestsInFlightFinder"
+ statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventprocessor">
+ <description>This will find the second derivative of the number of requests in flight over a minute.</description>
+ <siddhiConfiguration>
+ <property name="siddhi.enable.distributed.processing">RedundantNode</property>
+ <property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
+ </siddhiConfiguration>
+ <importedStreams>
+ <stream as="second_der_rif" name="in_flight_requests" version="1.0.0"/>
+ </importedStreams>
+ <queryExpressions><![CDATA[
+ from second_der_rif
+ select cluster_id, cluster_instance_id, network_partition_id, in_flight_request_count,
+ stratos:concat(cluster_id, '-' ,network_partition_id) as rif_second_der_cluster_network
+ insert into rif_second_der_concat;
+ define partition rif_second_der_cluster_partition by rif_second_der_concat.rif_second_der_cluster_network;
+ from rif_second_der_concat#window.stratos:secondDerivative(1 min, in_flight_request_count)
+ select cluster_id, cluster_instance_id, network_partition_id,in_flight_request_count as count
+ insert into second_derivative_in_flight_requests
+ partition by rif_second_der_cluster_partition;
+ ]]></queryExpressions>
+ <exportedStreams>
+ <stream name="second_derivative_in_flight_requests"
+ valueOf="second_derivative_in_flight_requests" version="1.0.0"/>
+ </exportedStreams>
+</executionPlan>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.1.0/inputeventadaptors/DefaultWSO2EventInputAdaptor.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.1.0/inputeventadaptors/DefaultWSO2EventInputAdaptor.xml b/extensions/cep/modules/artifacts/wso2cep-3.1.0/inputeventadaptors/DefaultWSO2EventInputAdaptor.xml
new file mode 100644
index 0000000..77af463
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.1.0/inputeventadaptors/DefaultWSO2EventInputAdaptor.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<inputEventAdaptor name="DefaultWSO2EventInputAdaptor"
+ statistics="disable" trace="enable" type="wso2event" xmlns="http://wso2.org/carbon/eventadaptormanager"/>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.1.0/outputeventadaptors/DefaultWSO2EventOutputAdaptor.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.1.0/outputeventadaptors/DefaultWSO2EventOutputAdaptor.xml b/extensions/cep/modules/artifacts/wso2cep-3.1.0/outputeventadaptors/DefaultWSO2EventOutputAdaptor.xml
new file mode 100644
index 0000000..4438d2c
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.1.0/outputeventadaptors/DefaultWSO2EventOutputAdaptor.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<outputEventAdaptor name="DefaultWSO2EventOutputAdaptor"
+ statistics="disable" trace="disable" type="wso2event" xmlns="http://wso2.org/carbon/eventadaptormanager">
+ <property name="username">admin</property>
+ <property name="receiverURL">tcp://localhost:7661</property>
+ <property name="password">admin</property>
+ <property name="authenticatorURL">ssl://localhost:7761</property>
+</outputEventAdaptor>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.1.0/outputeventadaptors/JMSOutputAdaptor.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.1.0/outputeventadaptors/JMSOutputAdaptor.xml b/extensions/cep/modules/artifacts/wso2cep-3.1.0/outputeventadaptors/JMSOutputAdaptor.xml
new file mode 100644
index 0000000..59c3653
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.1.0/outputeventadaptors/JMSOutputAdaptor.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<outputEventAdaptor name="JMSOutputAdaptor" statistics="disable"
+ trace="enable" type="jms" xmlns="http://wso2.org/carbon/eventadaptormanager">
+ <!--property name="java.naming.provider.url">CEP_HOME/repository/conf/jndi.properties</property-->
+ <property name="java.naming.provider.url">tcp://localhost:61616</property>
+ <property name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</property>
+ <property name="transport.jms.ConnectionFactoryJNDIName">TopicConnectionFactory</property>
+ <property name="transport.jms.DestinationType">topic</property>
+</outputEventAdaptor>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/wso2cep-3.1.0/streamdefinitions/stream-manager-config.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/wso2cep-3.1.0/streamdefinitions/stream-manager-config.xml b/extensions/cep/modules/artifacts/wso2cep-3.1.0/streamdefinitions/stream-manager-config.xml
new file mode 100644
index 0000000..4c4c7e0
--- /dev/null
+++ b/extensions/cep/modules/artifacts/wso2cep-3.1.0/streamdefinitions/stream-manager-config.xml
@@ -0,0 +1,309 @@
+<?xml version='1.0'?>
+<!--
+
+ 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.
+
+-->
+
+<streamManagerConfiguration xmlns="http://wso2.org/carbon/streammanager">
+ <!-- in-flight requests stream definitions start -->
+ <streamDefinition name="in_flight_requests" version="1.0.0">
+ <description>in-flight request count</description>
+ <nickName>in-flight requests</nickName>
+ <metaData>
+ </metaData>
+ <correlationData>
+ </correlationData>
+ <payloadData>
+ <property name="cluster_id" type="String"/>
+ <property name="cluster_instance_id" type="String"/>
+ <property name="network_partition_id" type="String"/>
+ <property name="in_flight_request_count" type="double"/>
+ </payloadData>
+ </streamDefinition>
+
+ <streamDefinition name="gradient_in_flight_requests" version="1.0.0">
+ <description>gradient of in flight request count</description>
+ <nickName>gradient in flight requests</nickName>
+ <metaData>
+ </metaData>
+ <correlationData>
+ </correlationData>
+ <payloadData>
+ <property name="cluster_id" type="String"/>
+ <property name="cluster_instance_id" type="String"/>
+ <property name="network_partition_id" type="String"/>
+ <property name="count" type="double"/>
+ </payloadData>
+ </streamDefinition>
+
+ <streamDefinition name="average_in_flight_requests" version="1.0.0">
+ <description>average of in-flight request count</description>
+ <nickName>average in-flight requests</nickName>
+ <metaData>
+ </metaData>
+ <correlationData>
+ </correlationData>
+ <payloadData>
+ <property name="cluster_id" type="String"/>
+ <property name="cluster_instance_id" type="String"/>
+ <property name="network_partition_id" type="String"/>
+ <property name="count" type="double"/>
+ </payloadData>
+ </streamDefinition>
+
+ <streamDefinition name="second_derivative_in_flight_requests" version="1.0.0">
+ <description>second derivative of in-flight request count</description>
+ <nickName>second derivative in-flight requests</nickName>
+ <metaData>
+ </metaData>
+ <correlationData>
+ </correlationData>
+ <payloadData>
+ <property name="cluster_id" type="String"/>
+ <property name="cluster_instance_id" type="String"/>
+ <property name="network_partition_id" type="String"/>
+ <property name="count" type="double"/>
+ </payloadData>
+ </streamDefinition>
+ <!-- in-flight requests stream definitions end -->
+
+ <!-- cartridge agent health stats stream definitions start -->
+ <streamDefinition name="cartridge_agent_health_stats" version="1.0.0">
+ <description>agent health stats</description>
+ <nickName>agent health stats</nickName>
+ <metaData>
+ </metaData>
+ <correlationData>
+ </correlationData>
+ <payloadData>
+ <property name="cluster_id" type="String" />
+ <property name="cluster_instance_id" type="String"/>
+ <property name="network_partition_id" type="String"/>
+ <property name="member_id" type="String" />
+ <property name="partition_id" type="String" />
+ <property name="health_description" type="String"/>
+ <property name="value" type="double"/>
+ </payloadData>
+ </streamDefinition>
+
+ <streamDefinition name="average_load_average_stats" version="1.0.0">
+ <description>average load average stats</description>
+ <nickName>average load average stats</nickName>
+ <metaData>
+ </metaData>
+ <correlationData>
+ </correlationData>
+ <payloadData>
+ <property name="cluster_id" type="String" />
+ <property name="cluster_instance_id" type="String"/>
+ <property name="network_partition_id" type="String"/>
+ <property name="average_load_average" type="double"/>
+ </payloadData>
+ </streamDefinition>
+
+ <streamDefinition name="average_memory_consumption_stats" version="1.0.0">
+ <description>average memory consumption stats</description>
+ <nickName>average memory consumption stats</nickName>
+ <metaData>
+ </metaData>
+ <correlationData>
+ </correlationData>
+ <payloadData>
+ <property name="cluster_id" type="String"/>
+ <property name="cluster_instance_id" type="String"/>
+ <property name="network_partition_id" type="String"/>
+ <property name="average_memory_consumption" type="double"/>
+ </payloadData>
+ </streamDefinition>
+
+ <streamDefinition name="gradient_load_average_stats" version="1.0.0">
+ <description>gradient load average stats</description>
+ <nickName>gradient load average stats</nickName>
+ <metaData>
+ </metaData>
+ <correlationData>
+ </correlationData>
+ <payloadData>
+ <property name="cluster_id" type="String" />
+ <property name="cluster_instance_id" type="String"/>
+ <property name="network_partition_id" type="String"/>
+ <property name="gradient_load_average" type="double"/>
+ </payloadData>
+ </streamDefinition>
+
+ <streamDefinition name="gradient_memory_consumption_stats" version="1.0.0">
+ <description>gradient memoryconsumption stats</description>
+ <nickName>gradient memoryconsumption stats</nickName>
+ <metaData>
+ </metaData>
+ <correlationData>
+ </correlationData>
+ <payloadData>
+ <property name="cluster_id" type="String" />
+ <property name="cluster_instance_id" type="String"/>
+ <property name="network_partition_id" type="String"/>
+ <property name="gradient_memory_consumption" type="double"/>
+ </payloadData>
+ </streamDefinition>
+
+ <streamDefinition name="second_derivative_memory_consumption_stats" version="1.0.0">
+ <description>second derivative memory consumption stats</description>
+ <nickName>second derivative memory consumption stats</nickName>
+ <metaData>
+ </metaData>
+ <correlationData>
+ </correlationData>
+ <payloadData>
+ <property name="cluster_id" type="String" />
+ <property name="cluster_instance_id" type="String"/>
+ <property name="network_partition_id" type="String"/>
+ <property name="second_derivative_memory_consumption" type="double"/>
+ </payloadData>
+ </streamDefinition>
+
+ <streamDefinition name="second_derivative_load_average_stats" version="1.0.0">
+ <description>second derivative load average stats</description>
+ <nickName>second derivative load average stats</nickName>
+ <metaData>
+ </metaData>
+ <correlationData>
+ </correlationData>
+ <payloadData>
+ <property name="cluster_id" type="String" />
+ <property name="cluster_instance_id" type="String"/>
+ <property name="network_partition_id" type="String"/>
+ <property name="second_derivative_load_average" type="double"/>
+ </payloadData>
+ </streamDefinition>
+
+ <streamDefinition name="fault_message" version="1.0.0">
+ <description>fault message</description>
+ <nickName>fault message</nickName>
+ <metaData>
+ </metaData>
+ <correlationData>
+ </correlationData>
+ <payloadData>
+ <property name="cluster_id" type="String"/>
+ <property name="cluster_instance_id" type="String"/>
+ <property name="network_partition_id" type="String"/>
+ <property name="member_id" type="String"/>
+ <property name="partition_id" type="String"/>
+ </payloadData>
+ </streamDefinition>
+ <!-- cartridge agent health stats stream definitions end -->
+
+ <!-- This is for member_id wise grouping-->
+ <streamDefinition name="member_average_load_average_stats" version="1.0.0">
+ <description>average load average stats</description>
+ <nickName>average load average stats</nickName>
+ <metaData>
+ </metaData>
+ <correlationData>
+ </correlationData>
+ <payloadData>
+ <property name="member_id" type="String" />
+ <property name="cluster_id" type="String" />
+ <property name="cluster_instance_id" type="String"/>
+ <property name="network_partition_id" type="String"/>
+ <property name="member_average_load_average" type="double"/>
+ </payloadData>
+ </streamDefinition>
+
+ <streamDefinition name="member_average_memory_consumption_stats" version="1.0.0">
+ <description>average memory consumption stats</description>
+ <nickName>average memory consumption stats</nickName>
+ <metaData>
+ </metaData>
+ <correlationData>
+ </correlationData>
+ <payloadData>
+ <property name="member_id" type="String"/>
+ <property name="cluster_id" type="String"/>
+ <property name="cluster_instance_id" type="String"/>
+ <property name="network_partition_id" type="String"/>
+ <property name="member_average_memory_consumption" type="double"/>
+ </payloadData>
+ </streamDefinition>
+
+ <streamDefinition name="member_gradient_load_average_stats" version="1.0.0">
+ <description>gradient load average stats</description>
+ <nickName>gradient load average stats</nickName>
+ <metaData>
+ </metaData>
+ <correlationData>
+ </correlationData>
+ <payloadData>
+ <property name="member_id" type="String" />
+ <property name="cluster_id" type="String" />
+ <property name="cluster_instance_id" type="String"/>
+ <property name="network_partition_id" type="String"/>
+ <property name="member_gradient_load_average" type="double"/>
+ </payloadData>
+ </streamDefinition>
+
+ <streamDefinition name="member_gradient_memory_consumption_stats" version="1.0.0">
+ <description>gradient memoryconsumption stats</description>
+ <nickName>gradient memoryconsumption stats</nickName>
+ <metaData>
+ </metaData>
+ <correlationData>
+ </correlationData>
+ <payloadData>
+ <property name="member_id" type="String" />
+ <property name="cluster_id" type="String" />
+ <property name="cluster_instance_id" type="String"/>
+ <property name="network_partition_id" type="String"/>
+ <property name="member_gradient_memory_consumption" type="double"/>
+ </payloadData>
+ </streamDefinition>
+
+ <streamDefinition name="member_second_derivative_memory_consumption_stats" version="1.0.0">
+ <description>second derivative memory consumption stats</description>
+ <nickName>second derivative memory consumption stats</nickName>
+ <metaData>
+ </metaData>
+ <correlationData>
+ </correlationData>
+ <payloadData>
+ <property name="member_id" type="String" />
+ <property name="cluster_id" type="String" />
+ <property name="cluster_instance_id" type="String"/>
+ <property name="network_partition_id" type="String"/>
+ <property name="member_second_derivative_memory_consumption" type="double"/>
+ </payloadData>
+ </streamDefinition>
+
+ <streamDefinition name="member_second_derivative_load_average_stats" version="1.0.0">
+ <description>second derivative load average stats</description>
+ <nickName>second derivative load average stats</nickName>
+ <metaData>
+ </metaData>
+ <correlationData>
+ </correlationData>
+ <payloadData>
+ <property name="member_id" type="String" />
+ <property name="cluster_id" type="String" />
+ <property name="cluster_instance_id" type="String"/>
+ <property name="network_partition_id" type="String"/>
+ <property name="member_second_derivative_load_average" type="double"/>
+ </payloadData>
+ </streamDefinition>
+
+</streamManagerConfiguration>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/stratos-cep-extension/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/stratos-cep-extension/pom.xml b/extensions/cep/modules/stratos-cep-extension/pom.xml
deleted file mode 100644
index 01eb733..0000000
--- a/extensions/cep/modules/stratos-cep-extension/pom.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- # 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.
- -->
-<project xmlns="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">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.stratos</groupId>
- <artifactId>cep-extensions</artifactId>
- <version>4.1.3-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>org.apache.stratos.cep.extension</artifactId>
- <name>Apache Stratos - CEP Extensions</name>
- <description>Apache Stratos CEP Extensions</description>
-
- <repositories>
- <repository>
- <id>wso2-maven2-repository</id>
- <name>WSO2 Maven2 Repository</name>
- <url>http://dist.wso2.org/maven2</url>
- </repository>
- </repositories>
-
- <dependencies>
- <dependency>
- <groupId>org.wso2.siddhi</groupId>
- <artifactId>siddhi-core</artifactId>
- <version>2.0.0-wso2v5</version>
- </dependency>
- <dependency>
- <groupId>org.apache.stratos</groupId>
- <artifactId>org.apache.stratos.messaging</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/CEPTopologyEventReceiver.java
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/CEPTopologyEventReceiver.java b/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/CEPTopologyEventReceiver.java
deleted file mode 100644
index 59c70c5..0000000
--- a/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/CEPTopologyEventReceiver.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * 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.stratos.cep.extension;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.stratos.messaging.event.Event;
-import org.apache.stratos.messaging.event.topology.CompleteTopologyEvent;
-import org.apache.stratos.messaging.event.topology.MemberActivatedEvent;
-import org.apache.stratos.messaging.event.topology.MemberTerminatedEvent;
-import org.apache.stratos.messaging.listener.topology.CompleteTopologyEventListener;
-import org.apache.stratos.messaging.listener.topology.MemberActivatedEventListener;
-import org.apache.stratos.messaging.listener.topology.MemberTerminatedEventListener;
-import org.apache.stratos.messaging.message.receiver.topology.TopologyEventReceiver;
-import org.apache.stratos.messaging.message.receiver.topology.TopologyManager;
-
-/**
- * CEP Topology Receiver for Fault Handling Window Processor.
- */
-public class CEPTopologyEventReceiver extends TopologyEventReceiver {
-
- private static final Log log = LogFactory.getLog(CEPTopologyEventReceiver.class);
-
- private FaultHandlingWindowProcessor faultHandler;
-
- public CEPTopologyEventReceiver(FaultHandlingWindowProcessor faultHandler) {
- this.faultHandler = faultHandler;
- addEventListeners();
- }
-
- @Override
- public void execute() {
- super.execute();
- log.info("CEP topology event receiver thread started");
- }
-
- private void addEventListeners() {
- // Load member time stamp map from the topology as a one time task
- addEventListener(new CompleteTopologyEventListener() {
- private boolean initialized;
-
- @Override
- protected void onEvent(Event event) {
- if (!initialized) {
- try {
- TopologyManager.acquireReadLock();
- log.debug("Complete topology event received to fault handling window processor.");
- CompleteTopologyEvent completeTopologyEvent = (CompleteTopologyEvent) event;
- initialized = faultHandler.loadTimeStampMapFromTopology(completeTopologyEvent.getTopology());
- } catch (Exception e) {
- log.error("Error loading member time stamp map from complete topology event.", e);
- } finally {
- TopologyManager.releaseReadLock();
- }
- }
- }
- });
-
- // Remove member from the time stamp map when MemberTerminated event is received.
- addEventListener(new MemberTerminatedEventListener() {
- @Override
- protected void onEvent(Event event) {
- MemberTerminatedEvent memberTerminatedEvent = (MemberTerminatedEvent) event;
- faultHandler.getMemberTimeStampMap().remove(memberTerminatedEvent.getMemberId());
- log.debug("Member was removed from the timestamp map: [member] " + memberTerminatedEvent.getMemberId());
- }
- });
-
- // Add member to time stamp map whenever member is activated
- addEventListener(new MemberActivatedEventListener() {
- @Override
- protected void onEvent(Event event) {
- MemberActivatedEvent memberActivatedEvent = (MemberActivatedEvent) event;
-
- // do not put this member if we have already received a health event
- faultHandler.getMemberTimeStampMap().putIfAbsent(memberActivatedEvent.getMemberId(),
- System.currentTimeMillis());
- log.debug("Member was added to the timestamp map: [member] " + memberActivatedEvent.getMemberId());
- }
- });
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/ConcatWindowProcessor.java
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/ConcatWindowProcessor.java b/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/ConcatWindowProcessor.java
deleted file mode 100644
index 699f036..0000000
--- a/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/ConcatWindowProcessor.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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.stratos.cep.extension;
-import org.wso2.siddhi.core.config.SiddhiContext;
-import org.wso2.siddhi.core.executor.function.FunctionExecutor;
-import org.wso2.siddhi.query.api.definition.Attribute;
-import org.wso2.siddhi.query.api.extension.annotation.SiddhiExtension;
-
-@SiddhiExtension(namespace = "stratos", function = "concat")
-public class ConcatWindowProcessor extends FunctionExecutor {
- Attribute.Type returnType = Attribute.Type.STRING;
- @Override
- public void init(Attribute.Type[] types, SiddhiContext siddhiContext) {
- }
-
- @Override
- protected Object process(Object obj) {
- if (obj instanceof Object[]) {
- StringBuffer sb=new StringBuffer();
- for (Object aObj : (Object[]) obj) {
- sb.append(aObj);
- }
- return sb.toString();
- } else {
- return obj.toString();
- }
-
- }
-
- @Override
- public void destroy() {
- }
-
- @Override
- public Attribute.Type getReturnType() {
- return returnType;
- }
-}
[7/9] stratos git commit: Upgrading CEP artifacts to 3.1.0
Posted by an...@apache.org.
Upgrading CEP artifacts to 3.1.0
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/8ad1f6e7
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/8ad1f6e7
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/8ad1f6e7
Branch: refs/heads/stratos-4.1.x
Commit: 8ad1f6e79c1542a43d5377ad3228fad94e906bed
Parents: 3043dc3
Author: anuruddhal <an...@gmail.com>
Authored: Wed Sep 16 14:52:03 2015 +0530
Committer: anuruddhal <an...@gmail.com>
Committed: Fri Sep 18 09:53:18 2015 +0530
----------------------------------------------------------------------
.../HealthStatisticsEventBuilder.xml | 31 --
.../LoadBalancerStatisticsEventBuilder.xml | 31 --
.../AverageInFlightRequestsEventFormatter.xml | 32 --
.../AverageLoadAverageEventFormatter.xml | 32 --
.../AverageMemoryConsumptionEventFormatter.xml | 32 --
.../FaultMessageEventFormatter.xml | 32 --
.../GradientInFlightRequestsEventFormatter.xml | 32 --
.../GradientLoadAverageEventFormatter.xml | 32 --
.../GradientMemoryConsumptionEventFormatter.xml | 32 --
.../MemberAverageLoadAverageEventFormatter.xml | 32 --
...erAverageMemoryConsumptionEventFormatter.xml | 32 --
.../MemberGradientLoadAverageEventFormatter.xml | 32 --
...rGradientMemoryConsumptionEventFormatter.xml | 32 --
...econdDerivativeLoadAverageEventFormatter.xml | 32 --
...erivativeMemoryConsumptionEventFormatter.xml | 32 --
...DerivativeInFlightRequestsEventFormatter.xml | 32 --
...econdDerivativeLoadAverageEventFormatter.xml | 32 --
...erivativeMemoryConsumptionEventFormatter.xml | 32 --
.../executionplans/AverageHeathRequest.xml | 71 ----
.../AverageInFlightRequestsFinder.xml | 48 ---
.../executionplans/GradientOfHealthRequest.xml | 71 ----
.../GradientOfRequestsInFlightFinder.xml | 48 ---
.../SecondDerivativeOfHealthRequest.xml | 68 ----
...SecondDerivativeOfRequestsInFlightFinder.xml | 48 ---
.../DefaultWSO2EventInputAdaptor.xml | 24 --
.../DefaultWSO2EventOutputAdaptor.xml | 29 --
.../outputeventadaptors/JMSOutputAdaptor.xml | 30 --
.../streamdefinitions/stream-manager-config.xml | 309 ----------------
.../HealthStatisticsEventBuilder.xml | 31 ++
.../LoadBalancerStatisticsEventBuilder.xml | 31 ++
.../AverageInFlightRequestsEventFormatter.xml | 32 ++
.../AverageLoadAverageEventFormatter.xml | 32 ++
.../AverageMemoryConsumptionEventFormatter.xml | 32 ++
.../FaultMessageEventFormatter.xml | 32 ++
.../GradientInFlightRequestsEventFormatter.xml | 32 ++
.../GradientLoadAverageEventFormatter.xml | 32 ++
.../GradientMemoryConsumptionEventFormatter.xml | 32 ++
.../MemberAverageLoadAverageEventFormatter.xml | 32 ++
...erAverageMemoryConsumptionEventFormatter.xml | 32 ++
.../MemberGradientLoadAverageEventFormatter.xml | 32 ++
...rGradientMemoryConsumptionEventFormatter.xml | 32 ++
...econdDerivativeLoadAverageEventFormatter.xml | 32 ++
...erivativeMemoryConsumptionEventFormatter.xml | 32 ++
...DerivativeInFlightRequestsEventFormatter.xml | 32 ++
...econdDerivativeLoadAverageEventFormatter.xml | 32 ++
...erivativeMemoryConsumptionEventFormatter.xml | 32 ++
.../executionplans/AverageHeathRequest.xml | 71 ++++
.../AverageInFlightRequestsFinder.xml | 48 +++
.../executionplans/GradientOfHealthRequest.xml | 71 ++++
.../GradientOfRequestsInFlightFinder.xml | 48 +++
.../SecondDerivativeOfHealthRequest.xml | 68 ++++
...SecondDerivativeOfRequestsInFlightFinder.xml | 48 +++
.../DefaultWSO2EventInputAdaptor.xml | 24 ++
.../DefaultWSO2EventOutputAdaptor.xml | 29 ++
.../outputeventadaptors/JMSOutputAdaptor.xml | 30 ++
.../streamdefinitions/stream-manager-config.xml | 309 ++++++++++++++++
.../HealthStatisticsEventBuilder.xml | 31 ++
.../LoadBalancerStatisticsEventBuilder.xml | 31 ++
.../AverageInFlightRequestsEventFormatter.xml | 32 ++
.../AverageLoadAverageEventFormatter.xml | 32 ++
.../AverageMemoryConsumptionEventFormatter.xml | 32 ++
.../FaultMessageEventFormatter.xml | 32 ++
.../GradientInFlightRequestsEventFormatter.xml | 32 ++
.../GradientLoadAverageEventFormatter.xml | 32 ++
.../GradientMemoryConsumptionEventFormatter.xml | 32 ++
.../MemberAverageLoadAverageEventFormatter.xml | 32 ++
...erAverageMemoryConsumptionEventFormatter.xml | 32 ++
.../MemberGradientLoadAverageEventFormatter.xml | 32 ++
...rGradientMemoryConsumptionEventFormatter.xml | 32 ++
...econdDerivativeLoadAverageEventFormatter.xml | 32 ++
...erivativeMemoryConsumptionEventFormatter.xml | 32 ++
...DerivativeInFlightRequestsEventFormatter.xml | 32 ++
...econdDerivativeLoadAverageEventFormatter.xml | 32 ++
...erivativeMemoryConsumptionEventFormatter.xml | 32 ++
.../executionplans/AverageHeathRequest.xml | 63 ++++
.../AverageInFlightRequestsFinder.xml | 40 +++
.../executionplans/GradientOfHealthRequest.xml | 63 ++++
.../GradientOfRequestsInFlightFinder.xml | 40 +++
.../SecondDerivativeOfHealthRequest.xml | 60 ++++
...SecondDerivativeOfRequestsInFlightFinder.xml | 40 +++
.../DefaultWSO2EventInputAdaptor.xml | 24 ++
.../DefaultWSO2EventOutputAdaptor.xml | 29 ++
.../outputeventadaptors/JMSOutputAdaptor.xml | 30 ++
.../streamdefinitions/stream-manager-config.xml | 309 ++++++++++++++++
.../cep/modules/stratos-cep-extension/pom.xml | 63 ----
.../cep/extension/CEPTopologyEventReceiver.java | 99 ------
.../cep/extension/ConcatWindowProcessor.java | 54 ---
.../extension/FaultHandlingWindowProcessor.java | 349 -------------------
.../GradientFinderWindowProcessor.java | 283 ---------------
...equestHandlingCapabilityWindowProcessor.java | 68 ----
.../SecondDerivativeFinderWindowProcessor.java | 301 ----------------
.../stratos-cep-extension/wso2cep-3.0.0/pom.xml | 63 ++++
.../cep/extension/CEPTopologyEventReceiver.java | 99 ++++++
.../cep/extension/ConcatWindowProcessor.java | 54 +++
.../extension/FaultHandlingWindowProcessor.java | 349 +++++++++++++++++++
.../GradientFinderWindowProcessor.java | 277 +++++++++++++++
...equestHandlingCapabilityWindowProcessor.java | 68 ++++
.../SecondDerivativeFinderWindowProcessor.java | 295 ++++++++++++++++
.../stratos-cep-extension/wso2cep-3.1.0/pom.xml | 57 +++
.../cep/extension/CEPTopologyEventReceiver.java | 99 ++++++
.../cep/extension/ConcatWindowProcessor.java | 54 +++
.../extension/FaultHandlingWindowProcessor.java | 343 ++++++++++++++++++
.../GradientFinderWindowProcessor.java | 277 +++++++++++++++
...equestHandlingCapabilityWindowProcessor.java | 68 ++++
.../SecondDerivativeFinderWindowProcessor.java | 295 ++++++++++++++++
extensions/cep/pom.xml | 3 +-
products/stratos/modules/distribution/pom.xml | 2 +-
.../modules/distribution/src/assembly/bin.xml | 12 +-
108 files changed, 4999 insertions(+), 2545 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/eventbuilders/HealthStatisticsEventBuilder.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/eventbuilders/HealthStatisticsEventBuilder.xml b/extensions/cep/modules/artifacts/eventbuilders/HealthStatisticsEventBuilder.xml
deleted file mode 100644
index 92f8d8a..0000000
--- a/extensions/cep/modules/artifacts/eventbuilders/HealthStatisticsEventBuilder.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-
-<eventBuilder name="HealthStatisticsEventBuilder" statistics="disable"
- trace="enable" xmlns="http://wso2.org/carbon/eventbuilder">
- <from eventAdaptorName="DefaultWSO2EventInputAdaptor" eventAdaptorType="wso2event">
- <property name="stream">cartridge_agent_health_stats</property>
- <property name="version">1.0.0</property>
- </from>
- <mapping customMapping="disable" type="wso2event"/>
- <to streamName="cartridge_agent_health_stats" version="1.0.0"/>
-</eventBuilder>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/eventbuilders/LoadBalancerStatisticsEventBuilder.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/eventbuilders/LoadBalancerStatisticsEventBuilder.xml b/extensions/cep/modules/artifacts/eventbuilders/LoadBalancerStatisticsEventBuilder.xml
deleted file mode 100644
index 8090e63..0000000
--- a/extensions/cep/modules/artifacts/eventbuilders/LoadBalancerStatisticsEventBuilder.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-
-<eventBuilder name="LoadBalancerStatisticsEventBuilder"
- statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventbuilder">
- <from eventAdaptorName="DefaultWSO2EventInputAdaptor" eventAdaptorType="wso2event">
- <property name="stream">in_flight_requests</property>
- <property name="version">1.0.0</property>
- </from>
- <mapping customMapping="disable" type="wso2event"/>
- <to streamName="in_flight_requests" version="1.0.0"/>
-</eventBuilder>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/eventformatters/AverageInFlightRequestsEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/eventformatters/AverageInFlightRequestsEventFormatter.xml b/extensions/cep/modules/artifacts/eventformatters/AverageInFlightRequestsEventFormatter.xml
deleted file mode 100644
index 5955866..0000000
--- a/extensions/cep/modules/artifacts/eventformatters/AverageInFlightRequestsEventFormatter.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-
-<eventFormatter name="AverageRequestsInflightEventFormatter"
- statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
- <from streamName="average_in_flight_requests" version="1.0.0"/>
- <mapping customMapping="enable" type="json">
- <inline>{"org.apache.stratos.messaging.event.health.stat.AverageRequestsInFlightEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{count}}"}}}</inline>
- </mapping>
- <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
- <property name="transport.jms.Destination">summarized-health-stats</property>
- </to>
-</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/eventformatters/AverageLoadAverageEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/eventformatters/AverageLoadAverageEventFormatter.xml b/extensions/cep/modules/artifacts/eventformatters/AverageLoadAverageEventFormatter.xml
deleted file mode 100644
index a0e2052..0000000
--- a/extensions/cep/modules/artifacts/eventformatters/AverageLoadAverageEventFormatter.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-
-<eventFormatter name="AverageLoadAverageEventFormatter"
- statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
- <from streamName="average_load_average_stats" version="1.0.0"/>
- <mapping customMapping="enable" type="json">
- <inline>{"org.apache.stratos.messaging.event.health.stat.AverageLoadAverageEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{average_load_average}}"}}}</inline>
- </mapping>
- <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
- <property name="transport.jms.Destination">summarized-health-stats</property>
- </to>
-</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/eventformatters/AverageMemoryConsumptionEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/eventformatters/AverageMemoryConsumptionEventFormatter.xml b/extensions/cep/modules/artifacts/eventformatters/AverageMemoryConsumptionEventFormatter.xml
deleted file mode 100644
index cbcab0a..0000000
--- a/extensions/cep/modules/artifacts/eventformatters/AverageMemoryConsumptionEventFormatter.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-
-<eventFormatter name="AverageMemoryConsumptionEventFormatter"
- statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
- <from streamName="average_memory_consumption_stats" version="1.0.0"/>
- <mapping customMapping="enable" type="json">
- <inline>{"org.apache.stratos.messaging.event.health.stat.AverageMemoryConsumptionEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{average_memory_consumption}}"}}}</inline>
- </mapping>
- <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
- <property name="transport.jms.Destination">summarized-health-stats</property>
- </to>
-</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/eventformatters/FaultMessageEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/eventformatters/FaultMessageEventFormatter.xml b/extensions/cep/modules/artifacts/eventformatters/FaultMessageEventFormatter.xml
deleted file mode 100644
index 96264ca..0000000
--- a/extensions/cep/modules/artifacts/eventformatters/FaultMessageEventFormatter.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-
-<eventFormatter name="FaultMessageEventFormatter"
- statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
- <from streamName="fault_message" version="1.0.0"/>
- <mapping customMapping="enable" type="json">
- <inline>{"org.apache.stratos.messaging.event.health.stat.MemberFaultEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","memberId":"{{member_id}}","partitionId":"{{partition_id}}"}}}</inline>
- </mapping>
- <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
- <property name="transport.jms.Destination">summarized-health-stats</property>
- </to>
-</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/eventformatters/GradientInFlightRequestsEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/eventformatters/GradientInFlightRequestsEventFormatter.xml b/extensions/cep/modules/artifacts/eventformatters/GradientInFlightRequestsEventFormatter.xml
deleted file mode 100644
index 2b5045b..0000000
--- a/extensions/cep/modules/artifacts/eventformatters/GradientInFlightRequestsEventFormatter.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-
-<eventFormatter name="GradientInFlightRequestsEventFormatter" statistics="disable"
- trace="disable" xmlns="http://wso2.org/carbon/eventformatter">
- <from streamName="gradient_in_flight_requests" version="1.0.0"/>
- <mapping customMapping="enable" type="json">
- <inline>{"org.apache.stratos.messaging.event.health.stat.GradientOfRequestsInFlightEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{count}}"}}}</inline>
- </mapping>
- <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
- <property name="transport.jms.Destination">summarized-health-stats</property>
- </to>
-</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/eventformatters/GradientLoadAverageEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/eventformatters/GradientLoadAverageEventFormatter.xml b/extensions/cep/modules/artifacts/eventformatters/GradientLoadAverageEventFormatter.xml
deleted file mode 100644
index 7fa3d7a..0000000
--- a/extensions/cep/modules/artifacts/eventformatters/GradientLoadAverageEventFormatter.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-
-<eventFormatter name="GradientLoadAverageEventFormatter"
- statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
- <from streamName="gradient_load_average_stats" version="1.0.0"/>
- <mapping customMapping="enable" type="json">
- <inline>{"org.apache.stratos.messaging.event.health.stat.GradientOfLoadAverageEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{gradient_load_average}}"}}}</inline>
- </mapping>
- <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
- <property name="transport.jms.Destination">summarized-health-stats</property>
- </to>
-</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/eventformatters/GradientMemoryConsumptionEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/eventformatters/GradientMemoryConsumptionEventFormatter.xml b/extensions/cep/modules/artifacts/eventformatters/GradientMemoryConsumptionEventFormatter.xml
deleted file mode 100644
index 8c3b871..0000000
--- a/extensions/cep/modules/artifacts/eventformatters/GradientMemoryConsumptionEventFormatter.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-
-<eventFormatter name="GradientMemoryConsumptionEventFormatter"
- statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
- <from streamName="gradient_memory_consumption_stats" version="1.0.0"/>
- <mapping customMapping="enable" type="json">
- <inline>{"org.apache.stratos.messaging.event.health.stat.GradientOfMemoryConsumptionEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{gradient_memory_consumption}}"}}}</inline>
- </mapping>
- <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
- <property name="transport.jms.Destination">summarized-health-stats</property>
- </to>
-</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/eventformatters/MemberAverageLoadAverageEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/eventformatters/MemberAverageLoadAverageEventFormatter.xml b/extensions/cep/modules/artifacts/eventformatters/MemberAverageLoadAverageEventFormatter.xml
deleted file mode 100644
index cab6df6..0000000
--- a/extensions/cep/modules/artifacts/eventformatters/MemberAverageLoadAverageEventFormatter.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-
-<eventFormatter name="MemberAverageLoadAverageEventFormatter"
- statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
- <from streamName="member_average_load_average_stats" version="1.0.0"/>
- <mapping customMapping="enable" type="json">
- <inline>{"org.apache.stratos.messaging.event.health.stat.MemberAverageLoadAverageEvent":{"message":{"memberId":"{{member_id}}","clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{member_average_load_average}}"}}}</inline>
- </mapping>
- <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
- <property name="transport.jms.Destination">summarized-health-stats</property>
- </to>
-</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/eventformatters/MemberAverageMemoryConsumptionEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/eventformatters/MemberAverageMemoryConsumptionEventFormatter.xml b/extensions/cep/modules/artifacts/eventformatters/MemberAverageMemoryConsumptionEventFormatter.xml
deleted file mode 100644
index 7f6e1f8..0000000
--- a/extensions/cep/modules/artifacts/eventformatters/MemberAverageMemoryConsumptionEventFormatter.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-
-<eventFormatter name="MemberAverageMemoryConsumptionEventFormatter"
- statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
- <from streamName="member_average_memory_consumption_stats" version="1.0.0"/>
- <mapping customMapping="enable" type="json">
- <inline>{"org.apache.stratos.messaging.event.health.stat.MemberAverageMemoryConsumptionEvent":{"message":{"memberId":"{{member_id}}","clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{member_average_memory_consumption}}"}}}</inline>
- </mapping>
- <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
- <property name="transport.jms.Destination">summarized-health-stats</property>
- </to>
-</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/eventformatters/MemberGradientLoadAverageEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/eventformatters/MemberGradientLoadAverageEventFormatter.xml b/extensions/cep/modules/artifacts/eventformatters/MemberGradientLoadAverageEventFormatter.xml
deleted file mode 100644
index af73b46..0000000
--- a/extensions/cep/modules/artifacts/eventformatters/MemberGradientLoadAverageEventFormatter.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-
-<eventFormatter name="MemberGradientLoadAverageEventFormatter"
- statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
- <from streamName="member_gradient_load_average_stats" version="1.0.0"/>
- <mapping customMapping="enable" type="json">
- <inline>{"org.apache.stratos.messaging.event.health.stat.MemberGradientOfLoadAverageEvent":{"message":{"memberId":"{{member_id}}","clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{member_gradient_load_average}}"}}}</inline>
- </mapping>
- <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
- <property name="transport.jms.Destination">summarized-health-stats</property>
- </to>
-</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/eventformatters/MemberGradientMemoryConsumptionEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/eventformatters/MemberGradientMemoryConsumptionEventFormatter.xml b/extensions/cep/modules/artifacts/eventformatters/MemberGradientMemoryConsumptionEventFormatter.xml
deleted file mode 100644
index 702f149..0000000
--- a/extensions/cep/modules/artifacts/eventformatters/MemberGradientMemoryConsumptionEventFormatter.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-
-<eventFormatter name="MemberGradientMemoryConsumptionEventFormatter"
- statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
- <from streamName="member_gradient_memory_consumption_stats" version="1.0.0"/>
- <mapping customMapping="enable" type="json">
- <inline>{"org.apache.stratos.messaging.event.health.stat.MemberGradientOfMemoryConsumptionEvent":{"message":{"memberId":"{{member_id}}","clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{member_gradient_memory_consumption}}"}}}</inline>
- </mapping>
- <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
- <property name="transport.jms.Destination">summarized-health-stats</property>
- </to>
-</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/eventformatters/MemberSecondDerivativeLoadAverageEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/eventformatters/MemberSecondDerivativeLoadAverageEventFormatter.xml b/extensions/cep/modules/artifacts/eventformatters/MemberSecondDerivativeLoadAverageEventFormatter.xml
deleted file mode 100644
index 5281652..0000000
--- a/extensions/cep/modules/artifacts/eventformatters/MemberSecondDerivativeLoadAverageEventFormatter.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-
-<eventFormatter name="MemberSecondDerivativeLoadAverageEventFormatter"
- statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventformatter">
- <from streamName="member_second_derivative_load_average_stats" version="1.0.0"/>
- <mapping customMapping="enable" type="json">
- <inline>{"org.apache.stratos.messaging.event.health.stat.MemberSecondDerivativeOfLoadAverageEvent":{"message":{"memberId":"{{member_id}}","clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{member_second_derivative_load_average}}"}}}</inline>
- </mapping>
- <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
- <property name="transport.jms.Destination">summarized-health-stats</property>
- </to>
-</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/eventformatters/MemberSecondDerivativeMemoryConsumptionEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/eventformatters/MemberSecondDerivativeMemoryConsumptionEventFormatter.xml b/extensions/cep/modules/artifacts/eventformatters/MemberSecondDerivativeMemoryConsumptionEventFormatter.xml
deleted file mode 100644
index 2e32be3..0000000
--- a/extensions/cep/modules/artifacts/eventformatters/MemberSecondDerivativeMemoryConsumptionEventFormatter.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-
-<eventFormatter name="MemberSecondDerivativeMemoryConsumptionEventFormatter"
- statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventformatter">
- <from streamName="member_second_derivative_memory_consumption_stats" version="1.0.0"/>
- <mapping customMapping="enable" type="json">
- <inline>{"org.apache.stratos.messaging.event.health.stat.MemberSecondDerivativeOfMemoryConsumptionEvent":{"message":{"memberId":"{{member_id}}","clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{member_second_derivative_memory_consumption}}"}}}</inline>
- </mapping>
- <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
- <property name="transport.jms.Destination">summarized-health-stats</property>
- </to>
-</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/eventformatters/SecondDerivativeInFlightRequestsEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/eventformatters/SecondDerivativeInFlightRequestsEventFormatter.xml b/extensions/cep/modules/artifacts/eventformatters/SecondDerivativeInFlightRequestsEventFormatter.xml
deleted file mode 100644
index 61862d1..0000000
--- a/extensions/cep/modules/artifacts/eventformatters/SecondDerivativeInFlightRequestsEventFormatter.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-
-<eventFormatter name="SecondDerivativeEventFormatter"
- statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventformatter">
- <from streamName="second_derivative_in_flight_requests" version="1.0.0"/>
- <mapping customMapping="enable" type="json">
- <inline>{"org.apache.stratos.messaging.event.health.stat.SecondDerivativeOfRequestsInFlightEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{count}}"}}}</inline>
- </mapping>
- <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
- <property name="transport.jms.Destination">summarized-health-stats</property>
- </to>
-</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/eventformatters/SecondDerivativeLoadAverageEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/eventformatters/SecondDerivativeLoadAverageEventFormatter.xml b/extensions/cep/modules/artifacts/eventformatters/SecondDerivativeLoadAverageEventFormatter.xml
deleted file mode 100644
index 3dc4a74..0000000
--- a/extensions/cep/modules/artifacts/eventformatters/SecondDerivativeLoadAverageEventFormatter.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-
-<eventFormatter name="SecondDerivativeLoadAverageEventFormatter"
- statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventformatter">
- <from streamName="second_derivative_load_average_stats" version="1.0.0"/>
- <mapping customMapping="enable" type="json">
- <inline>{"org.apache.stratos.messaging.event.health.stat.SecondDerivativeOfLoadAverageEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{second_derivative_load_average}}"}}}</inline>
- </mapping>
- <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
- <property name="transport.jms.Destination">summarized-health-stats</property>
- </to>
-</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/eventformatters/SecondDerivativeMemoryConsumptionEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/eventformatters/SecondDerivativeMemoryConsumptionEventFormatter.xml b/extensions/cep/modules/artifacts/eventformatters/SecondDerivativeMemoryConsumptionEventFormatter.xml
deleted file mode 100644
index bb0f70c..0000000
--- a/extensions/cep/modules/artifacts/eventformatters/SecondDerivativeMemoryConsumptionEventFormatter.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-
-<eventFormatter name="SecondDerivativeMemoryConsumptionEventFormatter"
- statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventformatter">
- <from streamName="second_derivative_memory_consumption_stats" version="1.0.0"/>
- <mapping customMapping="enable" type="json">
- <inline>{"org.apache.stratos.messaging.event.health.stat.SecondDerivativeOfMemoryConsumptionEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{second_derivative_memory_consumption}}"}}}</inline>
- </mapping>
- <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
- <property name="transport.jms.Destination">summarized-health-stats</property>
- </to>
-</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/executionplans/AverageHeathRequest.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/executionplans/AverageHeathRequest.xml b/extensions/cep/modules/artifacts/executionplans/AverageHeathRequest.xml
deleted file mode 100644
index b60a0bf..0000000
--- a/extensions/cep/modules/artifacts/executionplans/AverageHeathRequest.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-
-<executionPlan name="AverageHeathRequest" statistics="disable"
- trace="enable" xmlns="http://wso2.org/carbon/eventprocessor">
- <description>This will average health stats of an instance over a minute.</description>
- <siddhiConfiguration>
- <property name="siddhi.enable.distributed.processing">false</property>
- <property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
- </siddhiConfiguration>
- <importedStreams>
- <stream as="health_avg_processsor" name="cartridge_agent_health_stats" version="1.0.0"/>
- </importedStreams>
- <queryExpressions><![CDATA[
- from health_avg_processsor [health_description == 'ports_not_open']
- select cluster_id, cluster_instance_id, network_partition_id, member_id, partition_id insert into fault_message;
- from health_avg_processsor
- select cluster_id, cluster_instance_id, network_partition_id, member_id, partition_id, health_description, value,
- stratos:concat(cluster_id, '-' , cluster_instance_id) as health_grad_cluster_network
- insert into health_avg_concatinator;
- define partition health_avg_cluster_partition by health_avg_concatinator.health_grad_cluster_network;
- define partition member_health_avg_cluster_partition by health_avg_processsor.member_id;
- from health_avg_concatinator [health_description == 'load_average']
- #window.timeBatch(1 min) select cluster_id, cluster_instance_id, network_partition_id, avg(value) as average_load_average
- insert into average_load_average_stats
- partition by health_avg_cluster_partition;
- from health_avg_processsor [health_description == 'load_average']
- #window.timeBatch(1 min) select member_id, cluster_id, cluster_instance_id, network_partition_id, avg(value) as member_average_load_average
- insert into member_average_load_average_stats
- partition by member_health_avg_cluster_partition;
- from health_avg_processsor [health_description == 'memory_consumption']
- #window.timeBatch(1 min) select member_id, cluster_id, cluster_instance_id, network_partition_id, avg(value) as member_average_memory_consumption
- insert into member_average_memory_consumption_stats
- partition by member_health_avg_cluster_partition;
- from health_avg_concatinator [health_description == 'memory_consumption']
- #window.timeBatch(1 min) select cluster_id, cluster_instance_id, network_partition_id, avg(value) as average_memory_consumption
- insert into average_memory_consumption_stats
- partition by health_avg_cluster_partition;
- ]]></queryExpressions>
- <exportedStreams>
- <stream name="average_load_average_stats" passthroughFlow="disable"
- valueOf="average_load_average_stats" version="1.0.0"/>
- <stream name="member_average_load_average_stats" passthroughFlow="disable"
- valueOf="member_average_load_average_stats" version="1.0.0"/>
- <stream name="member_average_memory_consumption_stats" passthroughFlow="disable"
- valueOf="member_average_memory_consumption_stats" version="1.0.0"/>
- <stream name="average_memory_consumption_stats" passthroughFlow="disable"
- valueOf="average_memory_consumption_stats" version="1.0.0"/>
- <stream name="fault_message" passthroughFlow="disable"
- valueOf="fault_message" version="1.0.0"/>
- </exportedStreams>
-</executionPlan>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/executionplans/AverageInFlightRequestsFinder.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/executionplans/AverageInFlightRequestsFinder.xml b/extensions/cep/modules/artifacts/executionplans/AverageInFlightRequestsFinder.xml
deleted file mode 100644
index 20b94da..0000000
--- a/extensions/cep/modules/artifacts/executionplans/AverageInFlightRequestsFinder.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-
-<executionPlan name="AverageInFlightRequestsFinder" statistics="disable"
- trace="enable" xmlns="http://wso2.org/carbon/eventprocessor">
- <description>This will average the number of requests in flight over a minute.</description>
- <siddhiConfiguration>
- <property name="siddhi.enable.distributed.processing">false</property>
- <property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
- </siddhiConfiguration>
- <importedStreams>
- <stream as="avg_rif_stat" name="in_flight_requests" version="1.0.0"/>
- </importedStreams>
- <queryExpressions><![CDATA[
- from avg_rif_stat
- select cluster_id, cluster_instance_id, network_partition_id, in_flight_request_count,
- stratos:concat(cluster_id, '-' ,cluster_instance_id) as avg_rif_cluster_network
- insert into avg_rif_concat;
- define partition avg_rif_cluster_partition by avg_rif_concat.avg_rif_cluster_network;
- from avg_rif_concat#window.timeBatch(1 min)
- select cluster_id, cluster_instance_id, network_partition_id, avg(in_flight_request_count) as count
- insert into average_in_flight_requests
- partition by avg_rif_cluster_partition;
- ]]></queryExpressions>
- <exportedStreams>
- <stream name="average_in_flight_requests"
- valueOf="average_in_flight_requests" version="1.0.0"/>
- </exportedStreams>
-</executionPlan>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/executionplans/GradientOfHealthRequest.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/executionplans/GradientOfHealthRequest.xml b/extensions/cep/modules/artifacts/executionplans/GradientOfHealthRequest.xml
deleted file mode 100644
index fcbc24e..0000000
--- a/extensions/cep/modules/artifacts/executionplans/GradientOfHealthRequest.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-
-<executionPlan name="GradientOfHealthRequest" statistics="disable"
- trace="disable" xmlns="http://wso2.org/carbon/eventprocessor">
- <description>This will find the gradient of the heath request over a minute.</description>
- <siddhiConfiguration>
- <property name="siddhi.enable.distributed.processing">false</property>
- <property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
- </siddhiConfiguration>
- <importedStreams>
- <stream as="health_grad_processsor" name="cartridge_agent_health_stats" version="1.0.0"/>
- </importedStreams>
- <queryExpressions><![CDATA[
- from health_grad_processsor
- #window.stratos:faultHandling(1min, member_id) select cluster_id, cluster_instance_id, network_partition_id, member_id, partition_id
- group by cluster_id, network_partition_id
- insert into fault_message;
- from health_grad_processsor
- select cluster_id, cluster_instance_id, network_partition_id, member_id, partition_id, health_description, value,
- stratos:concat(cluster_id, '-' , cluster_instance_id) as health_grad_cluster_network
- insert into health_grad_concatinator;
- define partition health_grad_cluster_partition by health_grad_concatinator.health_grad_cluster_network;
- define partition member_health_grad_cluster_partition by health_grad_processsor.member_id;
- from health_grad_concatinator [health_description == 'load_average']
- #window.stratos:gradient(1 min, value) select cluster_id, cluster_instance_id, network_partition_id, value as gradient_load_average
- insert into gradient_load_average_stats
- partition by health_grad_cluster_partition;
- from health_grad_processsor [health_description == 'load_average']
- #window.stratos:gradient(1 min, value) select member_id, cluster_id, cluster_instance_id, network_partition_id, value as member_gradient_load_average
- insert into member_gradient_load_average_stats
- partition by member_health_grad_cluster_partition;
- from health_grad_processsor [health_description == 'memory_consumption']
- #window.stratos:gradient(1 min, value) select member_id, cluster_id, cluster_instance_id, network_partition_id, value as member_gradient_memory_consumption
- insert into member_gradient_memory_consumption_stats partition by member_health_grad_cluster_partition;
- from health_grad_concatinator [health_description == 'memory_consumption']
- #window.stratos:gradient(1 min, value) select cluster_id, cluster_instance_id, network_partition_id, value as gradient_memory_consumption
- insert into gradient_memory_consumption_stats
- partition by health_grad_cluster_partition;]]></queryExpressions>
- <exportedStreams>
- <stream name="gradient_load_average_stats"
- valueOf="gradient_load_average_stats" version="1.0.0"/>
- <stream name="gradient_memory_consumption_stats"
- valueOf="gradient_memory_consumption_stats" version="1.0.0"/>
- <stream name="member_gradient_load_average_stats"
- valueOf="member_gradient_load_average_stats" version="1.0.0"/>
- <stream name="member_gradient_memory_consumption_stats"
- valueOf="member_gradient_memory_consumption_stats" version="1.0.0"/>
- <stream name="fault_message" passthroughFlow="disable"
- valueOf="fault_message" version="1.0.0"/>
- </exportedStreams>
-</executionPlan>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/executionplans/GradientOfRequestsInFlightFinder.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/executionplans/GradientOfRequestsInFlightFinder.xml b/extensions/cep/modules/artifacts/executionplans/GradientOfRequestsInFlightFinder.xml
deleted file mode 100644
index fff4a8a..0000000
--- a/extensions/cep/modules/artifacts/executionplans/GradientOfRequestsInFlightFinder.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-
-<executionPlan name="GradientOfRequestsInFlightFinder"
- statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventprocessor">
- <description>This will find the gradient of the number of requests in flight over a minute.</description>
- <siddhiConfiguration>
- <property name="siddhi.enable.distributed.processing">false</property>
- <property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
- </siddhiConfiguration>
- <importedStreams>
- <stream as="gradient_rif_processor" name="in_flight_requests" version="1.0.0"/>
- </importedStreams>
- <queryExpressions><![CDATA[
- from gradient_rif_processor
- select cluster_id, cluster_instance_id, network_partition_id, in_flight_request_count,
- stratos:concat(cluster_id, '-' , network_partition_id) as request_grad_cluster_network
- insert into gradient_rif_concatinator;
- define partition request_grad_cluster_partition by gradient_rif_concatinator.request_grad_cluster_network;
- from gradient_rif_concatinator
- #window.stratos:gradient(1 min, in_flight_request_count)
- select cluster_id, cluster_instance_id, network_partition_id,in_flight_request_count as count
- insert into gradient_in_flight_requests
- partition by request_grad_cluster_partition;
-]]></queryExpressions>
- <exportedStreams>
- <stream name="gradient_in_flight_requests" valueOf="gradient_in_flight_requests" version="1.0.0"/>
- </exportedStreams>
-</executionPlan>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/executionplans/SecondDerivativeOfHealthRequest.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/executionplans/SecondDerivativeOfHealthRequest.xml b/extensions/cep/modules/artifacts/executionplans/SecondDerivativeOfHealthRequest.xml
deleted file mode 100644
index 0fa4a0a..0000000
--- a/extensions/cep/modules/artifacts/executionplans/SecondDerivativeOfHealthRequest.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-
-<executionPlan name="SecondDerivativeOfHealthRequest"
- statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventprocessor">
- <description>This will find the second derivative of health stats over a minute.</description>
- <siddhiConfiguration>
- <property name="siddhi.enable.distributed.processing">false</property>
- <property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
- </siddhiConfiguration>
- <importedStreams>
- <stream as="health_second_der_request" name="cartridge_agent_health_stats" version="1.0.0"/>
- </importedStreams>
- <queryExpressions><![CDATA[
- from health_second_der_request
- select member_id, cluster_id, cluster_instance_id, network_partition_id, health_description, value,
- stratos:concat(cluster_id, '-' ,cluster_instance_id) as health_second_der_cluster_network
- insert into health_second_der_concat;
- define partition health_second_der_cluster_partition by health_second_der_concat.health_second_der_cluster_network;
- from health_second_der_concat [health_description == 'memory_consumption']
- #window.stratos:secondDerivative(1 min, value) select cluster_id, cluster_instance_id, network_partition_id, value as second_derivative_memory_consumption
- insert into second_derivative_memory_consumption_stats
- partition by health_second_der_cluster_partition;
- from health_second_der_concat [health_description == 'load_average']
- #window.stratos:secondDerivative(1 min, value) select cluster_id, cluster_instance_id, network_partition_id, value as second_derivative_load_average
- insert into second_derivative_load_average_stats
- partition by health_second_der_cluster_partition;
- define partition health_second_der_member_partition by health_second_der_request.member_id;
- from health_second_der_request [health_description == 'memory_consumption']
- #window.stratos:secondDerivative(1 min, value)
- select member_id, cluster_id, cluster_instance_id, network_partition_id, value as member_second_derivative_memory_consumption
- insert into member_second_derivative_memory_consumption_stats
- partition by health_second_der_member_partition;
- from health_second_der_request [health_description == 'load_average']
- #window.stratos:secondDerivative(1 min, value)
- select member_id, cluster_id, cluster_instance_id, network_partition_id, value as member_second_derivative_load_average
- insert into member_second_derivative_load_average_stats
- partition by health_second_der_member_partition;]]></queryExpressions>
- <exportedStreams>
- <stream name="second_derivative_memory_consumption_stats"
- valueOf="second_derivative_memory_consumption_stats" version="1.0.0"/>
- <stream name="second_derivative_load_average_stats"
- valueOf="second_derivative_load_average_stats" version="1.0.0"/>
- <stream name="member_second_derivative_memory_consumption_stats"
- valueOf="member_second_derivative_memory_consumption_stats" version="1.0.0"/>
- <stream name="member_second_derivative_load_average_stats"
- valueOf="member_second_derivative_load_average_stats" version="1.0.0"/>
- </exportedStreams>
-</executionPlan>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/executionplans/SecondDerivativeOfRequestsInFlightFinder.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/executionplans/SecondDerivativeOfRequestsInFlightFinder.xml b/extensions/cep/modules/artifacts/executionplans/SecondDerivativeOfRequestsInFlightFinder.xml
deleted file mode 100644
index c8e4ed5..0000000
--- a/extensions/cep/modules/artifacts/executionplans/SecondDerivativeOfRequestsInFlightFinder.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-
-<executionPlan name="SecondDerivativeOfRequestsInFlightFinder"
- statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventprocessor">
- <description>This will find the second derivative of the number of requests in flight over a minute.</description>
- <siddhiConfiguration>
- <property name="siddhi.enable.distributed.processing">false</property>
- <property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
- </siddhiConfiguration>
- <importedStreams>
- <stream as="second_der_rif" name="in_flight_requests" version="1.0.0"/>
- </importedStreams>
- <queryExpressions><![CDATA[
- from second_der_rif
- select cluster_id, cluster_instance_id, network_partition_id, in_flight_request_count,
- stratos:concat(cluster_id, '-' ,network_partition_id) as rif_second_der_cluster_network
- insert into rif_second_der_concat;
- define partition rif_second_der_cluster_partition by rif_second_der_concat.rif_second_der_cluster_network;
- from rif_second_der_concat#window.stratos:secondDerivative(1 min, in_flight_request_count)
- select cluster_id, cluster_instance_id, network_partition_id,in_flight_request_count as count
- insert into second_derivative_in_flight_requests
- partition by rif_second_der_cluster_partition;
- ]]></queryExpressions>
- <exportedStreams>
- <stream name="second_derivative_in_flight_requests"
- valueOf="second_derivative_in_flight_requests" version="1.0.0"/>
- </exportedStreams>
-</executionPlan>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/inputeventadaptors/DefaultWSO2EventInputAdaptor.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/inputeventadaptors/DefaultWSO2EventInputAdaptor.xml b/extensions/cep/modules/artifacts/inputeventadaptors/DefaultWSO2EventInputAdaptor.xml
deleted file mode 100644
index 77af463..0000000
--- a/extensions/cep/modules/artifacts/inputeventadaptors/DefaultWSO2EventInputAdaptor.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-
-<inputEventAdaptor name="DefaultWSO2EventInputAdaptor"
- statistics="disable" trace="enable" type="wso2event" xmlns="http://wso2.org/carbon/eventadaptormanager"/>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/outputeventadaptors/DefaultWSO2EventOutputAdaptor.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/outputeventadaptors/DefaultWSO2EventOutputAdaptor.xml b/extensions/cep/modules/artifacts/outputeventadaptors/DefaultWSO2EventOutputAdaptor.xml
deleted file mode 100644
index 4438d2c..0000000
--- a/extensions/cep/modules/artifacts/outputeventadaptors/DefaultWSO2EventOutputAdaptor.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-
-<outputEventAdaptor name="DefaultWSO2EventOutputAdaptor"
- statistics="disable" trace="disable" type="wso2event" xmlns="http://wso2.org/carbon/eventadaptormanager">
- <property name="username">admin</property>
- <property name="receiverURL">tcp://localhost:7661</property>
- <property name="password">admin</property>
- <property name="authenticatorURL">ssl://localhost:7761</property>
-</outputEventAdaptor>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/outputeventadaptors/JMSOutputAdaptor.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/outputeventadaptors/JMSOutputAdaptor.xml b/extensions/cep/modules/artifacts/outputeventadaptors/JMSOutputAdaptor.xml
deleted file mode 100644
index 59c3653..0000000
--- a/extensions/cep/modules/artifacts/outputeventadaptors/JMSOutputAdaptor.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-
-<outputEventAdaptor name="JMSOutputAdaptor" statistics="disable"
- trace="enable" type="jms" xmlns="http://wso2.org/carbon/eventadaptormanager">
- <!--property name="java.naming.provider.url">CEP_HOME/repository/conf/jndi.properties</property-->
- <property name="java.naming.provider.url">tcp://localhost:61616</property>
- <property name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</property>
- <property name="transport.jms.ConnectionFactoryJNDIName">TopicConnectionFactory</property>
- <property name="transport.jms.DestinationType">topic</property>
-</outputEventAdaptor>
http://git-wip-us.apache.org/repos/asf/stratos/blob/8ad1f6e7/extensions/cep/modules/artifacts/streamdefinitions/stream-manager-config.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/streamdefinitions/stream-manager-config.xml b/extensions/cep/modules/artifacts/streamdefinitions/stream-manager-config.xml
deleted file mode 100644
index 4c4c7e0..0000000
--- a/extensions/cep/modules/artifacts/streamdefinitions/stream-manager-config.xml
+++ /dev/null
@@ -1,309 +0,0 @@
-<?xml version='1.0'?>
-<!--
-
- 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.
-
--->
-
-<streamManagerConfiguration xmlns="http://wso2.org/carbon/streammanager">
- <!-- in-flight requests stream definitions start -->
- <streamDefinition name="in_flight_requests" version="1.0.0">
- <description>in-flight request count</description>
- <nickName>in-flight requests</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="cluster_id" type="String"/>
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="in_flight_request_count" type="double"/>
- </payloadData>
- </streamDefinition>
-
- <streamDefinition name="gradient_in_flight_requests" version="1.0.0">
- <description>gradient of in flight request count</description>
- <nickName>gradient in flight requests</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="cluster_id" type="String"/>
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="count" type="double"/>
- </payloadData>
- </streamDefinition>
-
- <streamDefinition name="average_in_flight_requests" version="1.0.0">
- <description>average of in-flight request count</description>
- <nickName>average in-flight requests</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="cluster_id" type="String"/>
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="count" type="double"/>
- </payloadData>
- </streamDefinition>
-
- <streamDefinition name="second_derivative_in_flight_requests" version="1.0.0">
- <description>second derivative of in-flight request count</description>
- <nickName>second derivative in-flight requests</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="cluster_id" type="String"/>
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="count" type="double"/>
- </payloadData>
- </streamDefinition>
- <!-- in-flight requests stream definitions end -->
-
- <!-- cartridge agent health stats stream definitions start -->
- <streamDefinition name="cartridge_agent_health_stats" version="1.0.0">
- <description>agent health stats</description>
- <nickName>agent health stats</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="cluster_id" type="String" />
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="member_id" type="String" />
- <property name="partition_id" type="String" />
- <property name="health_description" type="String"/>
- <property name="value" type="double"/>
- </payloadData>
- </streamDefinition>
-
- <streamDefinition name="average_load_average_stats" version="1.0.0">
- <description>average load average stats</description>
- <nickName>average load average stats</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="cluster_id" type="String" />
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="average_load_average" type="double"/>
- </payloadData>
- </streamDefinition>
-
- <streamDefinition name="average_memory_consumption_stats" version="1.0.0">
- <description>average memory consumption stats</description>
- <nickName>average memory consumption stats</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="cluster_id" type="String"/>
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="average_memory_consumption" type="double"/>
- </payloadData>
- </streamDefinition>
-
- <streamDefinition name="gradient_load_average_stats" version="1.0.0">
- <description>gradient load average stats</description>
- <nickName>gradient load average stats</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="cluster_id" type="String" />
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="gradient_load_average" type="double"/>
- </payloadData>
- </streamDefinition>
-
- <streamDefinition name="gradient_memory_consumption_stats" version="1.0.0">
- <description>gradient memoryconsumption stats</description>
- <nickName>gradient memoryconsumption stats</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="cluster_id" type="String" />
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="gradient_memory_consumption" type="double"/>
- </payloadData>
- </streamDefinition>
-
- <streamDefinition name="second_derivative_memory_consumption_stats" version="1.0.0">
- <description>second derivative memory consumption stats</description>
- <nickName>second derivative memory consumption stats</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="cluster_id" type="String" />
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="second_derivative_memory_consumption" type="double"/>
- </payloadData>
- </streamDefinition>
-
- <streamDefinition name="second_derivative_load_average_stats" version="1.0.0">
- <description>second derivative load average stats</description>
- <nickName>second derivative load average stats</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="cluster_id" type="String" />
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="second_derivative_load_average" type="double"/>
- </payloadData>
- </streamDefinition>
-
- <streamDefinition name="fault_message" version="1.0.0">
- <description>fault message</description>
- <nickName>fault message</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="cluster_id" type="String"/>
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="member_id" type="String"/>
- <property name="partition_id" type="String"/>
- </payloadData>
- </streamDefinition>
- <!-- cartridge agent health stats stream definitions end -->
-
- <!-- This is for member_id wise grouping-->
- <streamDefinition name="member_average_load_average_stats" version="1.0.0">
- <description>average load average stats</description>
- <nickName>average load average stats</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="member_id" type="String" />
- <property name="cluster_id" type="String" />
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="member_average_load_average" type="double"/>
- </payloadData>
- </streamDefinition>
-
- <streamDefinition name="member_average_memory_consumption_stats" version="1.0.0">
- <description>average memory consumption stats</description>
- <nickName>average memory consumption stats</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="member_id" type="String"/>
- <property name="cluster_id" type="String"/>
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="member_average_memory_consumption" type="double"/>
- </payloadData>
- </streamDefinition>
-
- <streamDefinition name="member_gradient_load_average_stats" version="1.0.0">
- <description>gradient load average stats</description>
- <nickName>gradient load average stats</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="member_id" type="String" />
- <property name="cluster_id" type="String" />
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="member_gradient_load_average" type="double"/>
- </payloadData>
- </streamDefinition>
-
- <streamDefinition name="member_gradient_memory_consumption_stats" version="1.0.0">
- <description>gradient memoryconsumption stats</description>
- <nickName>gradient memoryconsumption stats</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="member_id" type="String" />
- <property name="cluster_id" type="String" />
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="member_gradient_memory_consumption" type="double"/>
- </payloadData>
- </streamDefinition>
-
- <streamDefinition name="member_second_derivative_memory_consumption_stats" version="1.0.0">
- <description>second derivative memory consumption stats</description>
- <nickName>second derivative memory consumption stats</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="member_id" type="String" />
- <property name="cluster_id" type="String" />
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="member_second_derivative_memory_consumption" type="double"/>
- </payloadData>
- </streamDefinition>
-
- <streamDefinition name="member_second_derivative_load_average_stats" version="1.0.0">
- <description>second derivative load average stats</description>
- <nickName>second derivative load average stats</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="member_id" type="String" />
- <property name="cluster_id" type="String" />
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="member_second_derivative_load_average" type="double"/>
- </payloadData>
- </streamDefinition>
-
-</streamManagerConfiguration>