<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>A World of Events</title>
	<atom:link href="http://adcalves.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://adcalves.wordpress.com</link>
	<description>A Blog for CEP, stream management, and other event frameworks</description>
	<lastBuildDate>Thu, 12 Jan 2012 13:43:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='adcalves.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>A World of Events</title>
		<link>http://adcalves.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://adcalves.wordpress.com/osd.xml" title="A World of Events" />
	<atom:link rel='hub' href='http://adcalves.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Answer to CEP quiz: streams and relations</title>
		<link>http://adcalves.wordpress.com/2012/01/04/answer-to-cep-quiz-streams-and-relations/</link>
		<comments>http://adcalves.wordpress.com/2012/01/04/answer-to-cep-quiz-streams-and-relations/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 02:52:45 +0000</pubDate>
		<dc:creator>Alexandre Alves</dc:creator>
				<category><![CDATA[CEP]]></category>
		<category><![CDATA[CQL]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[EPN]]></category>

		<guid isPermaLink="false">http://adcalves.wordpress.com/?p=205</guid>
		<description><![CDATA[Sorry for the long delay on posting an answer to last week&#8217;s, or rather, last year&#8217;s quiz. It is funny how time seems to stretch out sometimes and a few days turn into weeks. Well, let&#8217;s revisit the queries from the last post: SELECT * FROM C1[NOW] ISTREAM (SELECT * FROM C1[NOW]) DSTREAM (SELECT * [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=adcalves.wordpress.com&amp;blog=1179604&amp;post=205&amp;subd=adcalves&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sorry for the long delay on posting an answer to last week&#8217;s, or rather, last year&#8217;s quiz. It is funny how time seems to stretch out sometimes and a few days turn into weeks.</p>
<p>Well, let&#8217;s revisit the queries from the last post:</p>
<blockquote>
<ol>
<li>SELECT * FROM C1[NOW]</li>
<li>ISTREAM (SELECT * FROM C1[NOW])</li>
<li>DSTREAM (SELECT * FROM C1[NOW])</li>
</ol>
</blockquote>
<p>In the first query, the answer is that at the time t = 2 the <em>CACHE </em>is empty. Why empty and not 1?</p>
<p>To understand this, consider the following sequence of events:</p>
<ul>
<li>At time t = 0, the <em>NOW</em> (window) operator creates an empty relation.</li>
<li>At time t = 1, the <em>NOW</em> operator converts the stream with the single event <em>{ p1 = 1 }</em> to a relation containing a single entry <em>{ p1 = 1 }</em>. The result of the <em>NOW</em> operator is a relation, and hence in the absence of other conversion operators, the query likewise outputs a relation. As CEP deals with continuous queries, the best way to represent the difference between the empty relation at time t = 0 and the relation at time t = 1 is to output the insertion of the entry <em>{ p1 = 1 }</em>, or in other words, an insert event <em>{ p1 = 1 }</em>. The CACHE receives this insert event, and puts the entry { p1 = 1} into it.</li>
<li>At time t = 2 (or more precisely at the immediate next moment after t = 1), the <em>NOW</em> operator outputs an empty relation, as the event <em>e1</em> has moved on from the input stream. The difference between the relation at t = 1 and the relation at t = 2 is the deletion of the entry { p1 = 1 }, therefore the query outputs the delete event { p1 = 1 }. The <em>CACHE</em> receives this delete event, and consistently removes the entry { p1 = 1 }, leaving the cache empty.</li>
</ul>
<p>Next, let&#8217;s consider the second query. In this case, the answer is that at the end the <em>CACHE</em> contains a single entry with the value of 1.</p>
<p>Let&#8217;s explore this. In this query, we are using an <em>ISTREAM</em> operator after the <em>NOW</em> operator. The <em>ISTREAM</em> converts the relation into a stream by keeping the insert events. This means that at time t = 1, the insert event being output from the NOW operator is converted into a stream containing the single event { p1 = 1 }. The <em>CACHE</em> receives this event and puts it into it. Next, at time t = 2, the delete event output from the <em>NOW</em> operator is ignored (dropped) by the <em>ISTREAM</em> (convert) operator and never makes it into the <em>CACHE</em>.</p>
<p>The answer for the third query is likewise that at the end the <em>CACHE</em> contains the single entry of 1. The rationale is similar to that of the previous case, however off by one time tick.</p>
<p>At time t = 1, the insert event being output from the <em>NOW</em> operator is ignored by the <em>DSTREAM </em>operator, however the delete event output at time t = 2 is used and converted to a stream. The conversion is simple, the delete event from the relation becomes an insert event in the stream, as the streams only support inserts anyway. The <em>CACHE</em> then picks up this insert event and puts the event into it. Just keep in mind that for this third query this happens at time t = 2, rather than at time t = 1 as it is the case of the second query.</p>
<p>Here is a quick summary:</p>
<p style="text-align:center;"><a href="http://adcalves.files.wordpress.com/2012/01/quiz-results2.jpg"><img class="aligncenter  wp-image-229" title="quiz-results" src="http://adcalves.files.wordpress.com/2012/01/quiz-results2.jpg?w=315&#038;h=477" alt="" width="315" height="477" /></a></p>
<p style="text-align:center;">
<p>I would like to thank those people who pinged me, some of them several times, to gently remind me to post the answer.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/adcalves.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/adcalves.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/adcalves.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/adcalves.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/adcalves.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/adcalves.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/adcalves.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/adcalves.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/adcalves.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/adcalves.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/adcalves.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/adcalves.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/adcalves.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/adcalves.wordpress.com/205/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=adcalves.wordpress.com&amp;blog=1179604&amp;post=205&amp;subd=adcalves&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://adcalves.wordpress.com/2012/01/04/answer-to-cep-quiz-streams-and-relations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Alex Alves</media:title>
		</media:content>

		<media:content url="http://adcalves.files.wordpress.com/2012/01/quiz-results2.jpg" medium="image">
			<media:title type="html">quiz-results</media:title>
		</media:content>
	</item>
		<item>
		<title>A CEP Quiz: streams and relations</title>
		<link>http://adcalves.wordpress.com/2011/10/28/a-cep-quiz-streams-and-relations/</link>
		<comments>http://adcalves.wordpress.com/2011/10/28/a-cep-quiz-streams-and-relations/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 12:13:29 +0000</pubDate>
		<dc:creator>Alexandre Alves</dc:creator>
				<category><![CDATA[CEP]]></category>
		<category><![CDATA[CQL]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://adcalves.wordpress.com/?p=178</guid>
		<description><![CDATA[Last week, we were training some of Oracle&#8217;s top consulting and partners on CEP. The training was realized in Reading, UK (near London). Beautiful weather, contrary to what I was told is the common English predicament for October. At the end, we gave a quiz, which I am reproducing here: Consider an input channel C1 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=adcalves.wordpress.com&amp;blog=1179604&amp;post=178&amp;subd=adcalves&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Last week, we were training some of Oracle&#8217;s top consulting and partners on CEP.</p>
<p>The training was realized in Reading, UK (near London). Beautiful weather, contrary to what I was told is the common English predicament for October.</p>
<p>At the end, we gave a quiz, which I am reproducing here:</p>
<p>Consider an input channel <em>C1</em> of the event type <em>E1</em>, defined as having a single property called <em>p1</em> of type <em>Integer</em>.</p>
<p>An example of events of type <em>E1</em> are <em>{ p1 = 1 }</em> and <em>{ p1 = 2 }</em>.</p>
<p>This input channel <em>C1</em> is connected to a processor <em>P</em>, which is then connected to another (output) channel <em>C2</em>, whose output is sent to cache <em>CACHE</em>. Assume <em>CACHE</em> is keyed on <em>p1</em>.</p>
<p><a href="http://adcalves.files.wordpress.com/2011/10/screen-shot-2011-10-27-at-11-22-44-pm1.png"><img class="aligncenter size-full wp-image-180" title="Screen shot 2011-10-27 at 11.22.44 PM" src="http://adcalves.files.wordpress.com/2011/10/screen-shot-2011-10-27-at-11-22-44-pm1.png?w=450&#038;h=62" alt="" width="450" height="62" /></a></p>
<p>Next, consider three CQL queries as follows which reside on processor P:</p>
<blockquote>
<ol>
<li>SELECT * FROM C1[NOW]</li>
<li>ISTREAM (SELECT * FROM C1[NOW])</li>
<li>DSTREAM (SELECT * FROM C1[NOW])</li>
</ol>
</blockquote>
<p>Finally, send a single event e1 =<em> { p1 = 1 }</em> to <em>S1</em>.</p>
<p>The question is: what should be the content of the cache at the end for each one of these three queries?</p>
<p>To answer this, a couple of points need to be observed.</p>
<p>First, as I have mentioned in the past, CEP deals with two main concepts: that of a stream and that of a relation. </p>
<p>A stream is container of events, which is unbounded, and only supports inserts. Why only inserts? Well, because there is no such thing as a stream delete, think about it, how could we delete an event that has already happened?! </p>
<p>Whereas a relation is a container of events that is bounded by a certain number of events. A relation supports inserts, deletes, and updates.</p>
<p><a href="http://adcalves.files.wordpress.com/2011/10/stream-rel21.jpg"><img src="http://adcalves.files.wordpress.com/2011/10/stream-rel21.jpg?w=300&#038;h=216" alt="" title="" width="300" height="216" class="aligncenter size-medium wp-image-200" /></a></p>
<p>Second, remember that a cache is treated like a table, or more precisely, like a relation, and therefore supports insert, delete, and update operations. In the case the query outputs a stream, then the events inserted into the stream are mapped to inserts (or puts) into the cache. If the query outputs a relation, then inserts into the relation are likewise mapped into puts into the cache, however a delete on the relation, becomes a remove of an entry in the cache.</p>
<p>Third, keep in mind that the operations ISTREAM (i.e. insert stream) and DSTREAM (i.e. delete stream) convert relations to streams. The former converts relation inserts into stream inserts, but ignores the relation updates and deletes. The latter converts relation deletes into stream inserts, and ignores relation inserts and updates (in reality, things are a bit more complicated, but let&#8217;s ignore the details for the time being).</p>
<p><a href="http://adcalves.files.wordpress.com/2011/10/stream-rel2.jpg"><img class="aligncenter size-medium wp-image-185" title="STREAM-REL" src="http://adcalves.files.wordpress.com/2011/10/stream-rel2.jpg?w=300&#038;h=207" alt="" width="300" height="207" /></a></p>
<p>Fourth, we want the answer as if time has moved on from &#8216;now&#8217;. For all purpose, say we measuring time in seconds, and we sent event e1 at time 1 second and want the answer at time 2 seconds.</p>
<p>I will post the answer in a follow up post next week.</p>
<p>The crucial point of this exercise is to understand the difference between two of the most important CEP concepts: that of a <strong>STREAM</strong> and <strong>RELATION</strong>, and how they relate to each other.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/adcalves.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/adcalves.wordpress.com/178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/adcalves.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/adcalves.wordpress.com/178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/adcalves.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/adcalves.wordpress.com/178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/adcalves.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/adcalves.wordpress.com/178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/adcalves.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/adcalves.wordpress.com/178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/adcalves.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/adcalves.wordpress.com/178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/adcalves.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/adcalves.wordpress.com/178/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=adcalves.wordpress.com&amp;blog=1179604&amp;post=178&amp;subd=adcalves&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://adcalves.wordpress.com/2011/10/28/a-cep-quiz-streams-and-relations/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Alex Alves</media:title>
		</media:content>

		<media:content url="http://adcalves.files.wordpress.com/2011/10/screen-shot-2011-10-27-at-11-22-44-pm1.png" medium="image">
			<media:title type="html">Screen shot 2011-10-27 at 11.22.44 PM</media:title>
		</media:content>

		<media:content url="http://adcalves.files.wordpress.com/2011/10/stream-rel21.jpg?w=300" medium="image" />

		<media:content url="http://adcalves.files.wordpress.com/2011/10/stream-rel2.jpg?w=300" medium="image">
			<media:title type="html">STREAM-REL</media:title>
		</media:content>
	</item>
		<item>
		<title>Oracle OpenWorld 2011</title>
		<link>http://adcalves.wordpress.com/2011/09/10/oracle-openworld-2011/</link>
		<comments>http://adcalves.wordpress.com/2011/09/10/oracle-openworld-2011/#comments</comments>
		<pubDate>Sat, 10 Sep 2011 12:10:18 +0000</pubDate>
		<dc:creator>Alexandre Alves</dc:creator>
				<category><![CDATA[CEP]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[BAM]]></category>
		<category><![CDATA[Oracle OpenWorld]]></category>
		<category><![CDATA[spatial]]></category>

		<guid isPermaLink="false">http://adcalves.wordpress.com/?p=168</guid>
		<description><![CDATA[For those attending OOW this year, I will be co-presenting two sessions: Complex Event Processing and Business Activity Monitoring Best Practices (Venue / Room: Marriott Marquis &#8211; Salon 3/4, Date and Time: 10/3/11, 12:30 &#8211; 13:30) In this first session, we talk about how to best integrate CEP and BAM. BAM (Business Activity Monitoring) is a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=adcalves.wordpress.com&amp;blog=1179604&amp;post=168&amp;subd=adcalves&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For those attending OOW this year, I will be co-presenting two sessions:</p>
<ul>
<li>Complex Event Processing and Business Activity Monitoring Best Practices (Venue / Room: Marriott Marquis &#8211; Salon 3/4, Date and Time: 10/3/11, 12:30 &#8211; 13:30)</li>
</ul>
<p>In this first session, we talk about how to best integrate CEP and BAM. BAM (Business Activity Monitoring) is a great fit to CEP, as it can serve as the CEP dashboard for visualizing and acting on complex events that are found to be business related.</p>
<ul>
<li>Using Real-Time GPS Data with Oracle Spatial and Oracle Complex Event Processing (Venue / Room: Marriott Marquis &#8211; Golden Gate C3, Date and Time: 10/3/11, 19:30 &#8211; 20:15)</li>
</ul>
<p>In this following talk, we walk through ours and our customers&#8217; real-world experience on using GPS together with Oracle Spatial and CEP. The combination of CEP and Spatial has become an important trend and a very useful scenario.</p>
<p><img class="alignnone" title="Oracle OpenWorld 2011" src="http://www.oracle.com/us/assets/u04-header.jpg" alt="" width="969" height="93" /></p>
<p>If you are at San Francisco at this time, please stop by to chat.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/adcalves.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/adcalves.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/adcalves.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/adcalves.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/adcalves.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/adcalves.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/adcalves.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/adcalves.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/adcalves.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/adcalves.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/adcalves.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/adcalves.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/adcalves.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/adcalves.wordpress.com/168/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=adcalves.wordpress.com&amp;blog=1179604&amp;post=168&amp;subd=adcalves&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://adcalves.wordpress.com/2011/09/10/oracle-openworld-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Alex Alves</media:title>
		</media:content>

		<media:content url="http://www.oracle.com/us/assets/u04-header.jpg" medium="image">
			<media:title type="html">Oracle OpenWorld 2011</media:title>
		</media:content>
	</item>
		<item>
		<title>Blending Space and Time in CEP</title>
		<link>http://adcalves.wordpress.com/2011/07/31/blending-space-and-time-in-cep/</link>
		<comments>http://adcalves.wordpress.com/2011/07/31/blending-space-and-time-in-cep/#comments</comments>
		<pubDate>Sun, 31 Jul 2011 13:38:20 +0000</pubDate>
		<dc:creator>Alexandre Alves</dc:creator>
				<category><![CDATA[CQL]]></category>
		<category><![CDATA[Spatial]]></category>
		<category><![CDATA[geofencing]]></category>
		<category><![CDATA[spatial]]></category>
		<category><![CDATA[telematics]]></category>

		<guid isPermaLink="false">http://adcalves.wordpress.com/?p=153</guid>
		<description><![CDATA[Space and time are two dimensions that are increasingly more important in today&#8217;s online world. It is therefore no surprise that the blending of CEP and spatial is a natural one and ever more important. Recently at DEBS 2001, I presented our work on integrating Oracle Spatial with Oracle CEP, where we are seamless referencing [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=adcalves.wordpress.com&amp;blog=1179604&amp;post=153&amp;subd=adcalves&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Space and time are two dimensions that are increasingly more important in today&#8217;s online world. It is therefore no surprise that the blending of CEP and spatial is a natural one and ever more important.</p>
<p>Recently at <a href="http://debs2011.fzi.de/">DEBS 2001</a>, I presented our work on integrating <a href="http://www.slideshare.net/adcalves/debs-2011-extension-system">Oracle Spatial with Oracle CEP</a>, where we are seamless referencing to spatial functions and types in CQL (e.g. our event processing language). This allows us to implement geo-fencing and telematics within the <em>real-timeness</em> of CEP.</p>
<p>For example, consider the following query:</p>
<blockquote><p>SELECT shopId, customerIdFROM Location-Stream [ NOW ] AS loc, Shop<br />
WHERE contains@spatial(Shop.geometry, loc.point)</p></blockquote>
<p>Noteworthy to mention:</p>
<ul>
<li><em>Location-Stream</em> is a stream of events containing the customer&#8217;s location as a point, perhaps being emitted by a GPS.</li>
<li><em>Shop</em> is a relation defining the physical location of shops as a geometry.</li>
<li>The <em>contains</em> predicate function verifies if a point (event) from the stream is contained by any of the geometries (row) of the relation.</li>
</ul>
<p>This single query selects an event in time (i.e. now) and joins it with a spatial table!</p>
<div id="attachment_163" class="wp-caption aligncenter" style="width: 310px"><a href="http://adcalves.files.wordpress.com/2011/07/screen-shot-2011-07-31-at-10-32-19-am1.png"><img class="size-medium wp-image-163" title="Join-Point-Relation" src="http://adcalves.files.wordpress.com/2011/07/screen-shot-2011-07-31-at-10-32-19-am1.png?w=300&#038;h=93" alt="" width="300" height="93" /></a><p class="wp-caption-text">Joining point stream with a geometry relation</p></div>
<p>The join happens in memory aided by a R-Tree (i.e. region-tree) data structure, which is also provided by the spatial library, or as we called, the <em>spatial cartridge</em>.</p>
<p>Further, as better detailed in the presentation, CQL accomplishes this in a pluggable form using <em>links </em>and<em> cartridges</em>, but this is the subject of a future post&#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/adcalves.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/adcalves.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/adcalves.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/adcalves.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/adcalves.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/adcalves.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/adcalves.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/adcalves.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/adcalves.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/adcalves.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/adcalves.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/adcalves.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/adcalves.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/adcalves.wordpress.com/153/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=adcalves.wordpress.com&amp;blog=1179604&amp;post=153&amp;subd=adcalves&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://adcalves.wordpress.com/2011/07/31/blending-space-and-time-in-cep/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Alex Alves</media:title>
		</media:content>

		<media:content url="http://adcalves.files.wordpress.com/2011/07/screen-shot-2011-07-31-at-10-32-19-am1.png?w=300" medium="image">
			<media:title type="html">Join-Point-Relation</media:title>
		</media:content>
	</item>
		<item>
		<title>Event Processing Patterns at DEBS 2011</title>
		<link>http://adcalves.wordpress.com/2011/07/13/event-processing-patterns-at-debs-2011/</link>
		<comments>http://adcalves.wordpress.com/2011/07/13/event-processing-patterns-at-debs-2011/#comments</comments>
		<pubDate>Wed, 13 Jul 2011 18:45:28 +0000</pubDate>
		<dc:creator>Alexandre Alves</dc:creator>
				<category><![CDATA[CEP]]></category>
		<category><![CDATA[Event Processing Patterns]]></category>
		<category><![CDATA[DEBS]]></category>
		<category><![CDATA[pattern]]></category>

		<guid isPermaLink="false">http://adcalves.wordpress.com/?p=148</guid>
		<description><![CDATA[This week, I co-presented a tutorial on event processing design patterns and their mapping to the EPTS reference architecture at DEBS 2011. For this presentation, I had the pleasure to work together with Paul Vincent (TIBCO), Adrian Paschke (Freie Universitaet Berlin), and Catherine Moxey (IBM). Event processing design patterns is an interesting and new topic, one [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=adcalves.wordpress.com&amp;blog=1179604&amp;post=148&amp;subd=adcalves&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This week, I co-presented a <a href="http://www.slideshare.net/isvana/epts-debs2011-event-processing-reference-architecture-and-patterns-tutorial-v1-2" target="_blank">tutorial</a> on event processing design patterns and their mapping to the EPTS reference architecture at <a href="http://debs2011.fzi.de/" target="_blank">DEBS 2011</a>. For this presentation, I had the pleasure to work together with Paul Vincent (TIBCO), Adrian Paschke (Freie Universitaet Berlin), and Catherine Moxey (IBM).</p>
<p><a href="http://adcalves.files.wordpress.com/2011/07/screen-shot-2011-07-13-at-12-24-52-pm.png"><img class="aligncenter size-medium wp-image-149" title="Screen shot 2011-07-13 at 12.24.52 PM" src="http://adcalves.files.wordpress.com/2011/07/screen-shot-2011-07-13-at-12-24-52-pm.png?w=300&#038;h=196" alt="" width="300" height="196" /></a></p>
<p>Event processing design patterns is an interesting and new topic, one which I have talked about in the past. However, we have added an interesting aspect to this, which is the illustration of the event processing patterns using different event processing languages. Specifically, we showed how to realize filtering, aggregation, enrichment, and routing using both a stream-based EPL, as well as a rule-based (i.e. logical-programming) EPL.</p>
<p>This not only made it easier to understand and learn these patterns, but also in my opinion showed how both approaches are mostly similar in their fundamentals and achieve similar results.</p>
<p>For example, there is a trivial and obvious mapping between a stream event and a rule&#8217;s fact. Likewise, the specification of predicate conditions (e.g. a &lt; b and c = d) are but identical.</p>
<p>Nonetheless, there are a few areas where there is a best fit. For example, aggregation is typically easier to express in the stream-based idiom, whereas semantic reasoning on events is best expressed in the logical-programming style, as I learned using <a href="http://www.prova.ws/index.html" target="_blank">Prova</a>.</p>
<p>The intent of this work is ultimately to be published as a book, and with that in mind we continue to extend it with additional event processing patterns.</p>
<p>We welcome feedback, particularly around new event processing patterns to be documented and included in this project.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/adcalves.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/adcalves.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/adcalves.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/adcalves.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/adcalves.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/adcalves.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/adcalves.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/adcalves.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/adcalves.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/adcalves.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/adcalves.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/adcalves.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/adcalves.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/adcalves.wordpress.com/148/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=adcalves.wordpress.com&amp;blog=1179604&amp;post=148&amp;subd=adcalves&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://adcalves.wordpress.com/2011/07/13/event-processing-patterns-at-debs-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Alex Alves</media:title>
		</media:content>

		<media:content url="http://adcalves.files.wordpress.com/2011/07/screen-shot-2011-07-13-at-12-24-52-pm.png?w=300" medium="image">
			<media:title type="html">Screen shot 2011-07-13 at 12.24.52 PM</media:title>
		</media:content>
	</item>
		<item>
		<title>Concurrency at the EPN</title>
		<link>http://adcalves.wordpress.com/2011/01/03/concurrency-at-the-epn/</link>
		<comments>http://adcalves.wordpress.com/2011/01/03/concurrency-at-the-epn/#comments</comments>
		<pubDate>Mon, 03 Jan 2011 18:09:02 +0000</pubDate>
		<dc:creator>Alexandre Alves</dc:creator>
				<category><![CDATA[CEP]]></category>
		<category><![CDATA[EDA]]></category>
		<category><![CDATA[EPN]]></category>
		<category><![CDATA[Petri-Network]]></category>
		<category><![CDATA[Petri-Networks]]></category>

		<guid isPermaLink="false">http://adcalves.wordpress.com/?p=126</guid>
		<description><![CDATA[Opher, from IBM, recently posted an interesting article explaining the need for an EPN. As I have posted in the past, an Event Processing Network (EPN) is a directed graph that specifies the flow of the events from and to event processing agents  (EPAs), or, for short, processors. Opher&#8217;s posting raised the valid question on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=adcalves.wordpress.com&amp;blog=1179604&amp;post=126&amp;subd=adcalves&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Opher, from IBM, recently posted an <a href="http://epthinking.blogspot.com/2010/12/revisiting-epn.html" target="_blank">interesting article</a> explaining the need for an EPN.</p>
<p>As I have posted in the past, an Event Processing Network (EPN) is a directed graph that specifies the flow of the events from and to event processing agents  (EPAs), or, for short, processors.</p>
<p>Opher&#8217;s posting raised the valid question on why do we need an EPN at all, and instead couldn&#8217;t we just let all processors receive all events and drop those that are not of interest.</p>
<p>He pointed out two advantages of using an EPN, firstly it improves usability, and secondly it improves efficiency.</p>
<p>I believe there is a third advantage, the EPN allows one to specify concurrency.</p>
<p>For example, the following EPN specifies three sequential processor A, B and C. It is clear from the graph that processor C will only commence processing its events after B has finished, which likewise only processes its events after they have been processed by A.</p>
<p><a href="http://adcalves.files.wordpress.com/2011/01/epn-11.jpg"><img class="aligncenter size-medium wp-image-133" title="epn-1" src="http://adcalves.files.wordpress.com/2011/01/epn-11.jpg?w=300&#038;h=72" alt="" width="300" height="72" /></a></p>
<p>Conversely, in the following EPN, processor B and C execute in parallel, only after the events have been processed by A.</p>
<p><a href="http://adcalves.files.wordpress.com/2011/01/epn-25.jpg"><img class="aligncenter size-medium wp-image-141" title="epn-2" src="http://adcalves.files.wordpress.com/2011/01/epn-25.jpg?w=300&#038;h=256" alt="" width="300" height="256" /></a></p>
<p>Events are concurrent by nature, therefore being able to specify concurrency is a very important aspect of designing a CEP system. Surely, there are cases when the concurrency model can be inferred from the queries (i.e. rules) themselves by looking at their dependencies, however that is not always the case, or rather, that may not in itself be enough.</p>
<p>By the way, do see any resemblances between an EPN and a Petri-Network? This is not merely coincidental, but alas the subject of a later posting.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/adcalves.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/adcalves.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/adcalves.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/adcalves.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/adcalves.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/adcalves.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/adcalves.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/adcalves.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/adcalves.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/adcalves.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/adcalves.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/adcalves.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/adcalves.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/adcalves.wordpress.com/126/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=adcalves.wordpress.com&amp;blog=1179604&amp;post=126&amp;subd=adcalves&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://adcalves.wordpress.com/2011/01/03/concurrency-at-the-epn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Alex Alves</media:title>
		</media:content>

		<media:content url="http://adcalves.files.wordpress.com/2011/01/epn-11.jpg?w=300" medium="image">
			<media:title type="html">epn-1</media:title>
		</media:content>

		<media:content url="http://adcalves.files.wordpress.com/2011/01/epn-25.jpg?w=300" medium="image">
			<media:title type="html">epn-2</media:title>
		</media:content>
	</item>
		<item>
		<title>Hadoop&#8217;s Programming Model</title>
		<link>http://adcalves.wordpress.com/2010/12/12/a-hadoop-primer/</link>
		<comments>http://adcalves.wordpress.com/2010/12/12/a-hadoop-primer/#comments</comments>
		<pubDate>Mon, 13 Dec 2010 02:48:04 +0000</pubDate>
		<dc:creator>Alexandre Alves</dc:creator>
				<category><![CDATA[Hadoop]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Big Data]]></category>

		<guid isPermaLink="false">http://adcalves.wordpress.com/?p=121</guid>
		<description><![CDATA[Hadoop is a Java implementation of Map-Reduce. Map-Reduce is a software architecture used to process large amounts of data, also know as &#8220;big data&#8221;, in a distributed fashion. It is based upon the idea of mapping data items into key and value pairs, which are grouped by the key and reduced into a single value. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=adcalves.wordpress.com&amp;blog=1179604&amp;post=121&amp;subd=adcalves&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hadoop is a Java implementation of Map-Reduce. Map-Reduce is a software architecture used to process large amounts of data, also know as &#8220;big data&#8221;, in a distributed fashion. It is based upon the idea of mapping data items into key and value pairs, which are grouped by the key and reduced into a single value. From a service perspective, Hadoop allows an application to map, group, and reduce data across a distributed cloud of machines, thus permitting the applications to process an enormous amount of data.</p>
<p>A common Hadoop application is the processing of data located in web sites. For example, let’s consider an application that counts the number of occurrences of a word in web pages. In other words, if we had 10 web pages, where each uses the word “hello” twice, then we expect the result to include the key and value pair: {“hello” -&gt; 20}. This word counting application can be easily hosted in Hadoop by using Hadoop’s map and reduce services in the following form:</p>
<ol>
<li>Generate a map of word token to word occurrence for each word present in the input web pages. For example, if a page includes the word “hello” only once, we should generate the map entry {“hello” -&gt; 1}.</li>
<li>Reduce all maps that have been grouped together by Hadoop with the same key into a single map entry where the key is the word token and the value is the sum of all values in that group. In other words, Hadoop collects all maps that have the same key, that is, the same word token, and then groups them together providing the application with their values. The application is then responsible in reducing all values into a single item. For example, if step one generated the entries {“hello” -&gt; 1} and {“hello” -&gt; 2}, then we reduce these to a single entry {“hello” -&gt; 3}.</li>
</ol>
<p><a href="http://adcalves.files.wordpress.com/2010/12/fig_1_10.jpg"><img class="aligncenter size-full wp-image-120" title="Hadoop System View" src="http://adcalves.files.wordpress.com/2010/12/fig_1_10.jpg?w=450&#038;h=183" alt="" width="450" height="183" /></a></p>
<p>Following, we have a walk-through of a simple scenario:</p>
<p>This is done by:</p>
<ul>
<li>Load each web-page as input.</li>
</ul>
<ol></ol>
<blockquote>
<p style="text-align:left;">web-page-1: &#8220;first web-page&#8221;</p>
<p style="text-align:left;">web-page-2: &#8220;and the second and final web-page&#8221;</p>
</blockquote>
<ul>
<li>Map each input (i.e, page) into a collection of sequences (word, occurrences).</li>
</ul>
<blockquote>
<p style="text-align:left;">{(first, 1), (web-page, 1)},</p>
<p style="text-align:left;">{(and, 2), (the, 1), (second, 1), (final, 1), (web-page, 1)}</p>
</blockquote>
<ul>
<li>Group all sequences by &#8216;word&#8217;. Thus, the output will be collections in which all member sequences have the same &#8216;word&#8217;.</li>
</ul>
<blockquote>
<p style="text-align:left;">{(first, 1)},</p>
<p style="text-align:left;">{(web-page, 1), (web-page, 1)},</p>
<p style="text-align:left;">{(and, 2)},</p>
<p style="text-align:left;">{(the, 1)},</p>
<p style="text-align:left;">{(second, 1)},</p>
<p style="text-align:left;">{(final, 1)}</p>
</blockquote>
<ul>
<li>For each group, reduce to a single sequence by summing to together all word occurrences.</li>
</ul>
<blockquote>
<p style="text-align:left;">{(first, 1)},</p>
<p style="text-align:left;">{(web-page, 2)},</p>
<p style="text-align:left;">{(and, 2)},</p>
<p style="text-align:left;">{(the, 1)},</p>
<p style="text-align:left;">{(second, 1)},</p>
<p style="text-align:left;">{(final, 1)}</p>
</blockquote>
<ul>
<li>Store each sequence.</li>
</ul>
<p>We have described a word counting Hadoop application, the next task is to implement it using Hadoop’s programming model. Hadoop provides two basic programming models. The first one is a collection of Java classes, centered on a Mapper and Reducer interfaces. The application needs to extend a base class called MapReduceBase, and implement the Mapper and Reducer interfaces, specifying the data types of the input and output data. The application then registers its Mapper and Reducer classes into a Hadoop job, together with the distributed location of the input and output, and fires it away into the framework. The framework takes care of reading the data from the input location, calls back the Mapper and Reducer application classes when needed in a concurrent and distributed fashion, and writes the result to the output location.</p>
<p>The second option is to use a domain language called Pig. Pig defines keywords such as FOREACH, GROUP, and GENERATE, which fit naturally into the map, group and reduce actions. Using Pig, a developer can write a Hadoop application in a matter of a few lines of code, almost as if writing a SQL query, although Pig is rather more imperative than declarative as SQL.</p>
<blockquote>
<pre>map_result = FOREACH webpage GENERATE FLATTEN(count_word_occurrences(*));
key_groups = GROUP map_result BY $0;
output = FOREACH key_groups GENERATE sum_word_occurrences(*);</pre>
</blockquote>
<p>Hadoop is configured through XML configuration files. A good part of Hadoop is to deal with the distribution of jobs across a distributed file system; hence a large aspect of Hadoop’s configuration is related to configuring servers in the processing cloud.</p>
<p>Hadoop is an excellent example of a newly created application framework targeted for the emergent problem presented by the web where we need to deal with mammoth amounts of data in a soft real-time fashion. As new problems arise, they will be accompanied by new solutions, some of which will certainly take the form of new development platforms, as Hadoop does.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/adcalves.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/adcalves.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/adcalves.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/adcalves.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/adcalves.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/adcalves.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/adcalves.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/adcalves.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/adcalves.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/adcalves.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/adcalves.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/adcalves.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/adcalves.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/adcalves.wordpress.com/121/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=adcalves.wordpress.com&amp;blog=1179604&amp;post=121&amp;subd=adcalves&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://adcalves.wordpress.com/2010/12/12/a-hadoop-primer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Alex Alves</media:title>
		</media:content>

		<media:content url="http://adcalves.files.wordpress.com/2010/12/fig_1_10.jpg" medium="image">
			<media:title type="html">Hadoop System View</media:title>
		</media:content>
	</item>
		<item>
		<title>Event Processing Reference Architecture at DEBS 2010</title>
		<link>http://adcalves.wordpress.com/2010/07/29/event-processing-reference-architecture-at-debs-2010/</link>
		<comments>http://adcalves.wordpress.com/2010/07/29/event-processing-reference-architecture-at-debs-2010/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 17:28:00 +0000</pubDate>
		<dc:creator>Alexandre Alves</dc:creator>
				<category><![CDATA[CEP]]></category>
		<category><![CDATA[EDA]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[EPTS]]></category>
		<category><![CDATA[reference architectures]]></category>

		<guid isPermaLink="false">http://adcalves.wordpress.com/?p=104</guid>
		<description><![CDATA[Recently, the EPTS architecture working group, which I am part of, presented its reference architecture for event processing at DEBS 2010, which was realized at Cambridge in July 12th. The presentation can be found at SlideShare. The presentation first highlights general concepts around event processing and reference architecture models, the latter based upon IEEE. This [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=adcalves.wordpress.com&amp;blog=1179604&amp;post=104&amp;subd=adcalves&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Recently, the EPTS architecture working group, which I am part of, presented its reference architecture for event processing at DEBS 2010, which was realized at Cambridge in July 12th. The <a href="http://www.slideshare.net/isvana/debs2010-tutorial-on-epts-reference-architecture-v11c">presentation</a> can be found at SlideShare.</p>
<p>The presentation first highlights general concepts around event processing and reference architecture models, the latter based upon IEEE. This is needed for us to be able to normalize the architectures of the different vendors and players to be presented into a cohesive set. Following, individual architectures were presented from University of Trento (Themis Palpanas), TIBCO (Paul Vincent), Oracle (myself), and IBM (Catherine Moxey).</p>
<p>Following, I include the functional view for Oracle&#8217;s EP reference architecture:</p>
<p><a href="http://adcalves.files.wordpress.com/2010/07/functional-view-004.png"><img class="aligncenter size-full wp-image-110" title="Functional View for Oracle EP Reference Architecture" src="http://adcalves.files.wordpress.com/2010/07/functional-view-004.png?w=450&#038;h=337" alt="" width="450" height="337" /></a></p>
<p>The pattern for each architecture presentation is to describe different views of the system, in particular a conceptual view, a logical view, a functional view, and a deployment view. Finally, a common event-processing use-case, specifically the <a href="http://www.ep-ts.com/content/view/80/111/">Fast-Flower-Delivery</a> use-case, was selected to be mapped to each architecture, thus showing how each architecture models and solves this same problem.</p>
<p>Having exposed the different architectures, we then collide all into a single reference model, which becomes the EPTS reference architecture for Event Processing.</p>
<p>What are the next steps?</p>
<p>We need to further select event processing use-cases and to continue applying them to the reference architecture, hopefully fine-tuning it and expanding it. In particular, I feel we should tackle some distributed CEP scenarios, in an attempt to improve our deployment models and validate the logical and functional views.</p>
<p>Furthermore, I should also mention that at Oracle we are also working on a general EDA architecture that collaborates with SOA. More on this subject later.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/adcalves.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/adcalves.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/adcalves.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/adcalves.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/adcalves.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/adcalves.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/adcalves.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/adcalves.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/adcalves.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/adcalves.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/adcalves.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/adcalves.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/adcalves.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/adcalves.wordpress.com/104/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=adcalves.wordpress.com&amp;blog=1179604&amp;post=104&amp;subd=adcalves&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://adcalves.wordpress.com/2010/07/29/event-processing-reference-architecture-at-debs-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Alex Alves</media:title>
		</media:content>

		<media:content url="http://adcalves.files.wordpress.com/2010/07/functional-view-004.png" medium="image">
			<media:title type="html">Functional View for Oracle EP Reference Architecture</media:title>
		</media:content>
	</item>
		<item>
		<title>New Point Release for Oracle CEP 11gR1</title>
		<link>http://adcalves.wordpress.com/2010/05/06/new-point-release-for-oracle-cep-11gr1/</link>
		<comments>http://adcalves.wordpress.com/2010/05/06/new-point-release-for-oracle-cep-11gr1/#comments</comments>
		<pubDate>Thu, 06 May 2010 17:28:57 +0000</pubDate>
		<dc:creator>Alexandre Alves</dc:creator>
				<category><![CDATA[CEP]]></category>
		<category><![CDATA[CQL]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[SOA]]></category>

		<guid isPermaLink="false">https://adcalves.wordpress.com/?p=97</guid>
		<description><![CDATA[This week, Oracle announced the release of Oracle CEP 11gR1 11.1.1.3. Even though it is a point release, there are noteworthy improvements and features: Integration of CQL with Java CQL (or any other event processing language) allows the authoring of event processing applications at a higher level of abstraction, making them less suitable for dealing [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=adcalves.wordpress.com&amp;blog=1179604&amp;post=97&amp;subd=adcalves&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This week, Oracle announced the release of <a href="http://www.oracle.com/technology/products/event-driven-architecture/complex-event-processing.html">Oracle CEP 11gR1 11.1.1.3</a>.</p>
<p>Even though it is a point release, there are noteworthy improvements and features:</p>
<h4>Integration of CQL with Java</h4>
<p>CQL (or any other event processing language) allows the authoring of event processing applications at a higher level of abstraction, making them less suitable for dealing with low-level tasks, such as String manipulation, and other programming-in-the-small problems; and lack the richness of other programming language libraries (e.g. Java), which have been built over several years of usage.</p>
<p>In this new release of Oracle CEP, we solve this problem by fully integrating the Java programming language into CQL. This is done at the type-system level, rather than through User-Defined Functions or call-outs, allowing the usage of Java classes (e.g. constructors, methods, fields) directly in CQL in a blended form.</p>
<p><img style="display:block;margin-left:auto;margin-right:auto;" title="CQL and Java.jpg" src="http://adcalves.files.wordpress.com/2010/05/cql-and-java2.jpg?w=400&#038;h=126" border="0" alt="CQL and Java.jpg" width="400" height="126" /></p>
<p>In this example, we make use of the Java class <em>Date</em>, by invoking its constructor, and then we invoke the instance method <em>toString()</em> on the new object.</p>
<p>The JDK has several useful utility classes, such as <em>Date, RegEx</em>p, and <em>String</em>, making it a perfect choice for CQL.</p>
<h4>Integration of CQL and Spatial</h4>
<p>Location tracking and CEP go hand-in-hand. One example of a spatial-related CEP application is automobile traffic monitoring, where the automobile location is received as a continuous event stream.</p>
<p>Oracle CEP now supports the direct usage of spatial types (e.g. Geometry) and spatial functions in CQL, as shown by the next example, which verifies if <em>&#8220;the current location of a bus is contained within a pre-determined arrival location&#8221;.</em></p>
<p> </p>
<p><img style="display:block;margin-left:auto;margin-right:auto;" title="CQL and Spatial.jpg" src="http://adcalves.files.wordpress.com/2010/05/cql-and-spatial.jpg?w=400&#038;h=126" border="0" alt="CQL and Spatial.jpg" width="400" height="126" /></p>
<p>One very important aspect of this integration is that indexing of the spatial types (e.g. Geometry) are also being handled in the appropriate form. In other words, not only a user is able to leverage the spatial package, but also OCEP takes care of using the right indexing mechanism for the spatial data, such as a R-tree instead of a hash-based index.</p>
<h4>High-Availability Adapters</h4>
<p>CEP applications are characterized by their quick response-time. This is also applicable for high-available CEP applications, hence a common approach for achieving high-availability in CEP systems is to use an active/active architecture.</p>
<p>In the previous release of OCEP, several APIs were made available for OCEP developers to create their active/active HA CEP solutions.</p>
<p><img style="display:block;margin-left:auto;margin-right:auto;" title="HA OCEP app.jpg" src="http://adcalves.files.wordpress.com/2010/05/ha-ocep-app1.jpg?w=600&#038;h=210" border="0" alt="HA OCEP app.jpg" width="600" height="210" />In this new release, we take a step further and provide several built-in adapters to aide in the creation of HA OCEP applications. Amongst these, there are HA adapters that synchronize time in the upstream portions of the EPN, and synchronize the events in the downstream portions of the EPN, as illustrated in the previous figure.</p>
<h4>Much More&#8230;</h4>
<p>There is much more, please check the <a href="http://download.oracle.com/docs/cd/E14571_01/soa.htm#ocep">documentation</a> for the full set of features and their details, but here are other examples:</p>
<ul>
<li>Visualizer&#8217;s Event Injection and Trace, which allows a user to easily and dynamically send and receive events into and from a runnign application without having to write any code</li>
<li>Manage the revision history of a OCEP configuration</li>
<li>Deploy OCEP application libraries, facilitating re-use of adapters, JDBC drivers, and event-types</li>
<li>Support for a <em>WITHIN </em>clause in CQL&#8217;s pattern matching to limit the amount of time to wait for a pattern to be detected</li>
<li>Create <em>aliases</em> in CQL, facilitating the creation and management of complex queries</li>
<li>Support for <em>TABLE</em> functions in CQL, thus allowing a query to invoke a function that returns a full set of rows (e.g. table)</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/adcalves.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/adcalves.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/adcalves.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/adcalves.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/adcalves.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/adcalves.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/adcalves.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/adcalves.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/adcalves.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/adcalves.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/adcalves.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/adcalves.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/adcalves.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/adcalves.wordpress.com/97/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=adcalves.wordpress.com&amp;blog=1179604&amp;post=97&amp;subd=adcalves&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://adcalves.wordpress.com/2010/05/06/new-point-release-for-oracle-cep-11gr1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Alex Alves</media:title>
		</media:content>

		<media:content url="http://adcalves.files.wordpress.com/2010/05/cql-and-java2.jpg" medium="image">
			<media:title type="html">CQL and Java.jpg</media:title>
		</media:content>

		<media:content url="http://adcalves.files.wordpress.com/2010/05/cql-and-spatial.jpg" medium="image">
			<media:title type="html">CQL and Spatial.jpg</media:title>
		</media:content>

		<media:content url="http://adcalves.files.wordpress.com/2010/05/ha-ocep-app1.jpg" medium="image">
			<media:title type="html">HA OCEP app.jpg</media:title>
		</media:content>
	</item>
		<item>
		<title>Dealing with different timing models in CEP</title>
		<link>http://adcalves.wordpress.com/2010/03/20/dealing-with-different-timing-models-in-cep/</link>
		<comments>http://adcalves.wordpress.com/2010/03/20/dealing-with-different-timing-models-in-cep/#comments</comments>
		<pubDate>Sun, 21 Mar 2010 06:53:28 +0000</pubDate>
		<dc:creator>Alexandre Alves</dc:creator>
				<category><![CDATA[CEP]]></category>
		<category><![CDATA[CQL]]></category>
		<category><![CDATA[real-time]]></category>
		<category><![CDATA[application-timestamped]]></category>
		<category><![CDATA[system-timestamped]]></category>

		<guid isPermaLink="false">http://adcalves.wordpress.com/?p=81</guid>
		<description><![CDATA[Time can be a subtle thing to understand in CEP systems. In this post, we have a scenario that yields different results depending if we interpret the timing model to be system-timestamped or application timestamped.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=adcalves.wordpress.com&amp;blog=1179604&amp;post=81&amp;subd=adcalves&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Time can be a subtle thing to understand in CEP systems.</p>
<p>Following, we have a scenario that yields different results depending on how one interprets time.</p>
<p>First, let&#8217;s define the use-case:</p>
<p>Consider a stream of events that has a rate of one event every 500 milliseconds. The event contains a single <em>value</em> property of type int. We want to calculate the average of this <em>value </em>property for the last 1 second of events. Note how simple is the use-case.</p>
<p>Is the specification of this use-case complete? Not yet, so far we have described the input, and the event processing (EP) function, but we have not specified when to output. Let&#8217;s do so: we want to output every time the calculated average value changes.</p>
<p>As an illustration, the following CQL implements this EP function:</p>
<blockquote><p>ISTREAM( SELECT AVG(value) AS average FROM stream [RANGE 1 second] )</p></blockquote>
<p>The final question is: how should we interpret time? Say we let the CEP system timestamp the events as they arrive using the wall clock (i.e. CPU clock) time. We shall call this the system-timestamped timing model.</p>
<p>Table 1 shows the output of this use-case for a set of input events when applying the system-timestamped model:</p>
<p><a style="text-decoration:none;" href="http://adcalves.files.wordpress.com/2010/03/screen-shot-2010-03-21-at-3-31-33-am1.png"><img class="aligncenter size-medium wp-image-85" title="Screen shot 2010-03-21 at 3.31.33 AM" src="http://adcalves.files.wordpress.com/2010/03/screen-shot-2010-03-21-at-3-31-33-am1.png?w=300&#038;h=150" alt="" width="300" height="150" /></a></p>
<p>What&#8217;s particularly interesting in this scenario is the output event <em>o4.</em> A CEP system that supports the system-timestamped model can progress time as the wall clock progresses. Let&#8217;s say that our system has a heart-beat of 300 milliseconds, what this means is that at time 1300 milliseconds (i.e. <em>i3</em> + heart-beat) the CEP system is able to automatically update the stream window by expiring the event <em>i1</em>. Note that this only happens when the stream window is full and thus events can be expired.</p>
<p>Next, let&#8217;s assume that the time is defined by the application itself, and this is done by including a <em>timestamp</em> property in the event. Let&#8217;s look what happens when we input the same set of events <strong>at exactly the same time as if we were using the wall clock time</strong>:</p>
<p><a style="text-decoration:none;" href="http://adcalves.files.wordpress.com/2010/03/screen-shot-2010-03-21-at-3-36-06-am1.png"><img class="aligncenter size-full wp-image-88" title="Screen shot 2010-03-21 at 3.36.06 AM" src="http://adcalves.files.wordpress.com/2010/03/screen-shot-2010-03-21-at-3-36-06-am1.png?w=450&#038;h=124" alt="" width="450" height="124" /></a></p>
<p>Interesting enough, now we only get four output events, that is, event o4 is missing. When time is defined by the application, the CEP system itself does not know how to progress time, in other words, even though the wall clock may have progressed several minutes, the application time may not have changed at all. What this means is that the CEP system will only be able to determine that time has moved when it receives a new input event with an updated timestamp property. Hence we don&#8217;t get a situation like in the previous case where the CEP system itself was able to expire events automatically.</p>
<p>In summary, in this simple example we went through two different timing models, system-timestamped and application timestamped. Timing models are very important in CEP, as it allows great flexibility, however you must be aware of the caveats.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/adcalves.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/adcalves.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/adcalves.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/adcalves.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/adcalves.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/adcalves.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/adcalves.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/adcalves.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/adcalves.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/adcalves.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/adcalves.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/adcalves.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/adcalves.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/adcalves.wordpress.com/81/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=adcalves.wordpress.com&amp;blog=1179604&amp;post=81&amp;subd=adcalves&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://adcalves.wordpress.com/2010/03/20/dealing-with-different-timing-models-in-cep/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Alex Alves</media:title>
		</media:content>

		<media:content url="http://adcalves.files.wordpress.com/2010/03/screen-shot-2010-03-21-at-3-31-33-am1.png?w=300" medium="image">
			<media:title type="html">Screen shot 2010-03-21 at 3.31.33 AM</media:title>
		</media:content>

		<media:content url="http://adcalves.files.wordpress.com/2010/03/screen-shot-2010-03-21-at-3-36-06-am1.png" medium="image">
			<media:title type="html">Screen shot 2010-03-21 at 3.36.06 AM</media:title>
		</media:content>
	</item>
	</channel>
</rss>
