<?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>comSysto Blog</title>
	<atom:link href="http://blog.comsysto.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.comsysto.com</link>
	<description>Innovation through insight :: Thinking lean and moving agile when delivering software products</description>
	<lastBuildDate>Fri, 14 Jun 2013 11:56:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blog.comsysto.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/fcf433742acc8ff8f69d2c46738b2559?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>comSysto Blog</title>
		<link>http://blog.comsysto.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.comsysto.com/osd.xml" title="comSysto Blog" />
	<atom:link rel='hub' href='http://blog.comsysto.com/?pushpress=hub'/>
		<item>
		<title>comSysto auf der TDWI Konferenz</title>
		<link>http://blog.comsysto.com/2013/06/14/comsysto-auf-der-tdwi-konferenz/</link>
		<comments>http://blog.comsysto.com/2013/06/14/comsysto-auf-der-tdwi-konferenz/#comments</comments>
		<pubDate>Fri, 14 Jun 2013 11:56:26 +0000</pubDate>
		<dc:creator>dianaknezevic</dc:creator>
				<category><![CDATA[All About BigData, NoSQL & MongoDB]]></category>
		<category><![CDATA[Big Data]]></category>
		<category><![CDATA[Business Intelligence]]></category>
		<category><![CDATA[Data Science]]></category>
		<category><![CDATA[Events & Fun]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[business intelligence]]></category>
		<category><![CDATA[Hadoop]]></category>
		<category><![CDATA[MapR]]></category>
		<category><![CDATA[MongoDB]]></category>
		<category><![CDATA[nosql]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[R]]></category>
		<category><![CDATA[TDWI]]></category>

		<guid isPermaLink="false">http://blog.comsysto.com/?p=2840</guid>
		<description><![CDATA[Kommende Woche präsentieren sich comSysto und MapR gemeinsam als Silber-Sponsoren auf der vom 17. bis zum 19. Juni 2013 im MOC in München stattfindenden 13. Europäischen TDWI-Konferenz, der größten, unabhängigen Veranstaltung zu den Themenbereichen Business Intelligence, Data Warehousing und Datamanagement im deutschsprachigen Raum. Am Mittwoch, den 19. Juni, wird Dr. Markus Schmidberger von comSysto eine [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.comsysto.com&#038;blog=8304660&#038;post=2840&#038;subd=comsysto&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Kommende Woche präsentieren sich <strong><a href="http://comsysto.com/index.html">comSysto</a></strong> und <strong><a href="http://www.mapr.com/">MapR</a></strong> gemeinsam als Silber-Sponsoren auf der vom 17. bis zum 19. Juni 2013 im MOC in München stattfindenden 13. Europäischen <strong><a href="http://www.tdwi.eu/home/events/conferences/tdwi-2013-munich/">TDWI</a>-Konferenz</strong>, der größten, unabhängigen Veranstaltung zu den Themenbereichen Business Intelligence, Data Warehousing und Datamanagement im deutschsprachigen Raum.</p>
<p>Am Mittwoch, den 19. Juni, wird Dr. Markus Schmidberger von comSysto eine Session zum Thema „Using R for Business Intelligence in Big Data“ halten. Das gesamte Programm der TDWI Konferenz finden Sie <strong><a href="http://www.tdwi.eu/veranstaltungen/konferenzen/tdwi-2013-munich/programm/">hier</a></strong>!</p>
<p>Kommen Sie auf die Gewinnerseite und besuchen Sie comSysto und MapR am Gemeinschaftsstand (# 27 und 28)! Zu gewinnen gibt es:</p>
<p>1.         ein Free Ticket für ein MapR Training<br />
2. + 3.  je ein Workshop (max. 12 Personen) über verschiedene Big Data Technologien<br />
4.         ein neues, originalverpacktes Nexus 7</p>
<p><strong>Kurzinformation</strong>:<br />
TDWI Konferenz, Montag – Mittwoch, 17.-19. Juni 2013</p>
<p>Veranstaltungsort<br />
M.O.C. München, Lilienthalallee 40<br />
Informationen zur <a href="http://www.tdwi.eu/veranstaltungen/konferenzen/tdwi-2013-munich/veranstaltungsort/">Anfahrt</a></p>
<p>Session W3A, 10:00 – 13:15 Uhr, Raum K3<br />
Dr. Markus Schmidberger: „<a href="http://www.tdwi.eu/veranstaltungen/konferenzen/tdwi-2013-munich/sessiondetails/?tx_mwconferences_pi1%5bshowUid%5d=618&amp;tx_mwconferences_pi1%5banchor%5d=%23W3A&amp;tx_mwconferences_pi1%5bs%5d=0">Using R for Business Intelligence in Big Data</a>“</p>
<p>Informationen zu weiteren Events und Trainings stehen auf unserer <a href="http://comsysto.com/events.html">Eventseite</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/comsysto.wordpress.com/2840/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/comsysto.wordpress.com/2840/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.comsysto.com&#038;blog=8304660&#038;post=2840&#038;subd=comsysto&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.comsysto.com/2013/06/14/comsysto-auf-der-tdwi-konferenz/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/25953230d37d79363d17aee1fe402dbc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dianaknezevic</media:title>
		</media:content>
	</item>
		<item>
		<title>Integrating Google Calendar into a Wicket Application</title>
		<link>http://blog.comsysto.com/2013/05/13/integrating-google-calendar-into-a-wicket-application/</link>
		<comments>http://blog.comsysto.com/2013/05/13/integrating-google-calendar-into-a-wicket-application/#comments</comments>
		<pubDate>Mon, 13 May 2013 08:21:47 +0000</pubDate>
		<dc:creator>Daniel Mitterdorfer</dc:creator>
				<category><![CDATA[Apache Wicket]]></category>
		<category><![CDATA[Gradle]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Google API]]></category>

		<guid isPermaLink="false">http://blog.comsysto.com/?p=2442</guid>
		<description><![CDATA[I recently integrated Google Calendar into a Wicket application I use at home. As some requirements are atypical I want to describe them before going into too much detail: As I use the application only by myself I want to allow anonymous access to my application. If multiple users access your system you have to [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.comsysto.com&#038;blog=8304660&#038;post=2442&#038;subd=comsysto&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I recently integrated <strong>Google Calendar</strong> into a <strong>Wicket application</strong> I use at home. As some requirements are atypical I want to describe them before going into too much detail:</p>
<ul>
<li>As I use the application only by myself I want to allow anonymous access to my application. If multiple users access your system you have to implement &#8220;proper&#8221; authentication in your application though.</li>
<li>For the sake of simplicity I do not care about encrypting keys stored on my disk. However, if you use the code from this post in a real production system with multiple users please do yourself a favor and ensure any keys are stored as secure as possible.</li>
</ul>
<p><strong>Technical options</strong></p>
<p>If you want to use a <strong>Google API</strong> in your application there is a chance that they already provide a client library, which is actually the case for Google Calendar. I decided to go another route for two reasons:</p>
<ol>
<li>As this is yet another REST API, there is no need for a special library and a new API. If I use Spring already I can achieve the same result by simply using <a href="http://static.springsource.org/spring/docs/3.2.x/javadoc-api/org/springframework/web/client/RestTemplate.html">Spring’s RestTemplate</a>.</li>
<li>I just wanted to create, update and delete all-day events with an event title. There is no need for a full blown API that allows all options such as support for recurring events, multiple participants or reminders.</li>
</ol>
<p>Prior to accessing a Google API an application needs authorization from users to access their data which is handled by OAuth 2. As the application already uses Spring for various aspects, <a href="https://github.com/SpringSource/spring-security-oauth">Spring Security OAuth 2</a> was the obvious choice for me as it integrates nicely into the rest of the application.</p>
<p>However, I faced two challenges: First, I needed to integrate Wicket and Spring Security OAuth 2 and second, Spring Security OAuth 2 needed some tweaks to work together with my setup.</p>
<p>Apart from Spring Security OAuth 2 I use the following libraries/frameworks:</p>
<ul>
<li><a href="http://wicket.apache.org">Wicket</a> as web framework</li>
<li><a href="http://www.springsource.org/spring-framework">Spring</a> as dependency injection container</li>
<li><a href="https://github.com/FasterXML/jackson-core">Jackson</a> for storing tokens and serializing and deserializing messages to the Google Calendar API</li>
<li><a href="http://gradle.org">Gradle</a> as build tool</li>
<li><a href="http://download.eclipse.org/jetty">Jetty</a> as container</li>
</ul>
<p>I have created a simple demo application which allows you to create an all-day event on any of your calendars. It is available on <a title="Wicket GCal Demo on Github" href="https://github.com/comsysto/wicket-gcal-demo">Github</a>.</p>
<p><strong>OAuth 2 in less than 100 words</strong></p>
<p>There is plenty of information available on the web about OAuth 2, so I just want to describe briefly what OAuth 2 does:</p>
<p>Using <strong>OAuth 2</strong> users can grant your application access to their data available through third-party services without providing you the credentials of the accounts you want to access. It involves three parties: Your users, your application (OAuth 2 client) and the authorization provider (OAuth 2 server). Apart from being users of your application they are also known to the authorization provider. When users access your application (step 1), it requests permission to e.g. access their data from a third party service (step 2). The authorization provider redirects to a page where users can grant your application access (step 3).</p>
<div id="attachment_2443" class="wp-caption aligncenter" style="width: 530px"><a href="http://comsysto.files.wordpress.com/2013/03/oauth2-authorization.png"><img class="size-full wp-image-2443" alt="OAuth2 authorization scenario" src="http://comsysto.files.wordpress.com/2013/03/oauth2-authorization.png?w=625"   /></a><p class="wp-caption-text">OAuth2 authorization scenario (Icons courtesy of <a href="http://adamwhitcroft.com/batch/">Adam Whitcroft</a>)</p></div>
<p>Two great resources for in-depth information about OAuth 2 are <a href="https://developers.google.com/accounts/docs/OAuth2">Google’s OAuth 2 documentation</a> and <a href="http://tools.ietf.org/html/rfc6749">RFC 6749</a>.</p>
<p><strong>OAuth 2 for Web applications</strong></p>
<p><a href="https://developers.google.com/accounts/docs/OAuth2"><strong>Google’s OAuth 2</strong> documentation</a> describes different scenarios which can be used. I assume that you want to use the <a href="https://developers.google.com/accounts/docs/OAuth2#webserver">Webserver scenario</a>, and specifically that you want to use &#8220;online access&#8221; (more on that later). In the Webserver scenario the user is redirected to Google’s authorization server before the first call of the application to the Google Calendar API. After the user has granted access, the authorization server redirects the user to your application along with an access token and the application may access the Google Calendar API with this access token.</p>
<p><strong>Getting started</strong></p>
<p>Before we dive into the code, we have to register the application with the OAuth provider. For Google, this is done via the <a href="https://code.google.com/apis/console#access">API console</a>. The process is pretty straightforward:</p>
<p>1. Create a new project and provide a descriptive name:</p>
<p><a href="http://comsysto.files.wordpress.com/2013/03/001_create_project.png"><img class="aligncenter size-large wp-image-2445" alt="Create a new Google API project" src="http://comsysto.files.wordpress.com/2013/03/001_create_project.png?w=380&#038;h=241" width="380" height="241" /></a></p>
<p>2. Create a new client id. The client id identifies your application against the OAuth provider. Be sure to provide a custom redirect URL in the second screen.</p>
<p><a href="http://comsysto.files.wordpress.com/2013/03/002_create_client_id.png"><img class="aligncenter size-large wp-image-2446" alt="Create a new client id for a Google API project (part 1)" src="http://comsysto.files.wordpress.com/2013/03/002_create_client_id.png?w=380&#038;h=272" width="380" height="272" /></a></p>
<p><a href="http://comsysto.files.wordpress.com/2013/03/003_create_client_id.png"><img class="aligncenter size-large wp-image-2447" alt="Create a new client id for a Google API project (part 2)" src="http://comsysto.files.wordpress.com/2013/03/003_create_client_id.png?w=380&#038;h=350" width="380" height="350" /></a></p>
<p>3. After you have clicked &#8220;Create&#8221; the following overview is presented:</p>
<p><a href="http://comsysto.files.wordpress.com/2013/03/004_create_project_finished.png"><img class="aligncenter size-large wp-image-2448" alt="Google API project has been created" src="http://comsysto.files.wordpress.com/2013/03/004_create_project_finished.png?w=380&#038;h=241" width="380" height="241" /></a></p>
<p>The most relevant pieces for your application are the client id and the client secret. As I have already described, the client id uniquely identifies your application with the OAuth 2 provider. The client secret authenticates your application with the OAuth 2 provider. If you want to think of traditional username/password based authentication, the client id loosely corresponds to the username of your application and the client secret corresponds to the password of your application with the OAuth 2 provider. Apparently, these two properties should not be shared.</p>
<p>Copy the values for &#8220;client id&#8221; into the property &#8220;google.calendar.client.id&#8221; and &#8220;client secret&#8221; into the property &#8220;google.calendar.client.secret&#8221; in the file application.properties if you follow along with the demo application.</p>
<p>4. Next, request access to the Google Calendar API for your application in the &#8220;Services&#8221; menu</p>
<p><a href="http://comsysto.files.wordpress.com/2013/03/005_activate_services.png"><img class="aligncenter size-large wp-image-2449" alt="Activate access to Google calendar API" src="http://comsysto.files.wordpress.com/2013/03/005_activate_services.png?w=380&#038;h=241" width="380" height="241" /></a></p>
<p><strong>Google Calendar Access using Spring OAuth 2</strong></p>
<p>All <strong>accesses</strong> of the demo application to the Google Calendar API are encapsulated in the class <a title="GoogleCalendarRepositoryImpl on Github" href="https://github.com/comsysto/wicket-gcal-demo/blob/master/calendar/src/main/java/com/github/gcaldemo/calendar/repository/impl/GoogleCalendarRepositoryImpl.java">GoogleCalendarRepositoryImpl</a>. It uses an extension of the Spring standard interface <a href="http://static.springsource.org/spring/docs/3.2.x/javadoc-api/org/springframework/web/client/RestOperations.html">RestOperations</a> called <a href="http://static.springsource.org/spring-security/oauth/apidocs/org/springframework/security/oauth2/client/OAuth2RestOperations.html">OAuth2RestOperations</a> which can handle OAuth 2 authorization in addition. Similar to the standard implementation of RestOperations, RestTemplate, Spring Security OAuth 2 provides a OAuth2RestTemplate. In the demo application, the OAuth2RestTemplate is configured in <a href="https://github.com/comsysto/wicket-gcal-demo/blob/master/calendar/src/main/resources/com/github/gcaldemo/calendar/spring-context.xml">com/github/gcaldemo/calendar/spring-context.xml</a>. First, let’s have a look at the „oauth:resource“ element there:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;oauth:resource id=&quot;google&quot;
                type=&quot;authorization_code&quot;
                client-id=&quot;${google.calendar.client.id}&quot;
                client-secret=&quot;${google.calendar.client.secret}&quot;
                access-token-uri=&quot;https://accounts.google.com/o/oauth2/token&quot;
                user-authorization-uri=&quot;https://accounts.google.com/o/oauth2/auth&quot;
                scope=&quot;https://www.googleapis.com/auth/calendar&quot;
                client-authentication-scheme=&quot;form&quot;
/&gt;
</pre>
<p>This definition describes the resources we want to access. Apart from the client id and the client secret we have already discussed it also contains the URL to which users will be redirected when the application needs their approval to access their data (user-authorization-uri). The &#8220;scope&#8221; attribute defines the privileges the application wants to acquire. In this case we want read and write access to calendar data as indicated by the URL. The proper URL can be found in the <a href="https://developers.google.com/google-apps/calendar/auth">Google Calendar API documentation</a>.</p>
<p>Whenever the application tries to call the Google Calendar API, Spring OAuth 2 will check if the application has a valid access token. This access token is issued by the OAuth 2 provider and provided to the application after the user has granted access to its data. However, the access token is only valid for a limited time period which varies across OAuth providers. Google’s access tokens are currently valid for one hour. After that time period the access token is invalid and users have to grant the application access to their data again.</p>
<p>Fortunately, there are multiple means to prevent nagging users continuously:</p>
<ul>
<li>The OAuth 2 RFC specifies a so called refresh token. The refresh token is sent by the OAuth 2 provider along with the first access token. It can be used to obtain a new access token upon expiration of the old one without user intervention. The validity period of the refresh token may be limited and depends on the OAuth provider. Google’s refresh token is valid until the application explicitly prompts the user explicitly for authorization. Note that Google sends the refresh token only in the „offline“ scenario. Offline means basically that an application can act on behalf of users without the user needing to be present (think batch processes). For more information on the refresh token please refer to the <a href="https://developers.google.com/accounts/docs/OAuth2WebServer#refresh">section on refresh tokens in Google&#8217;s OAuth 2 documentation</a>.</li>
<li>In the online scenario (user is present when your application accesses the Google Calendar API), Google does not send a refresh token but rather stores a cookie on the client’s browser. This cookie will be used instead of a refresh token to prevent repeated explicit approval from the user. As I have hinted earlier, this scenario applies to the demo application.</li>
</ul>
<p>The demo application provides a simple JSON based token store which is sufficient for a single user. It is implemented in <a href="https://github.com/comsysto/wicket-gcal-demo/blob/master/calendar/src/main/java/com/github/gcaldemo/calendar/repository/impl/token/JsonClientTokenServices.java">JsonClientTokenServices</a>, which performs the following tasks:</p>
<ul>
<li>It stores the access token in a JSON file</li>
<li>It adjusts the expiry_in value: The expiry that is sent from the OAuth 2 provider is denoted in seconds from the point in time when the OAuth 2 provider has issued the access token. So, if the access token is valid for one hour, the initial value will be 3600 (60 seconds per minute * 60 minutes per hour). However, this is obviously not suitable for persistent storage. Therefore, the token store will adjust the expiry accordingly when loading an access token.</li>
</ul>
<p>The token store is configured along with the access token provider:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;bean id=&quot;accessTokenProviderChain&quot; class=&quot;org.springframework.security.oauth2.client.token.AccessTokenProviderChain&quot;&gt;
&lt;!-- Redefinition of the default access token providers  --&gt;
  &lt;constructor-arg index=&quot;0&quot;&gt;
    &lt;list&gt;
      &lt;bean class=&quot;org.springframework.security.oauth2.client.token.grant.code.AuthorizationCodeAccessTokenProvider&quot;/&gt;
      &lt;bean class=&quot;org.springframework.security.oauth2.client.token.grant.implicit.ImplicitAccessTokenProvider&quot;/&gt;
      &lt;bean class=&quot;org.springframework.security.oauth2.client.token.grant.password.ResourceOwnerPasswordAccessTokenProvider&quot;/&gt;
      &lt;bean class=&quot;org.springframework.security.oauth2.client.token.grant.client.ClientCredentialsAccessTokenProvider&quot;/&gt;
    &lt;/list&gt;
  &lt;/constructor-arg&gt;
  &lt;property name=&quot;clientTokenServices&quot;&gt;
    &lt;bean class=&quot;com.github.gcaldemo.calendar.repository.impl.token.JsonClientTokenServices&quot;/&gt;
  &lt;/property&gt;
&lt;/bean&gt;
</pre>
<p>After defining both the resource to access and the access token provider, the OAuth2RestTemplate can be configured:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;oauth:rest-template id=&quot;googleCalendarRestTemplate&quot;
                     resource=&quot;google&quot;
                     access-token-provider=&quot;accessTokenProviderChain&quot;/&gt;
</pre>
<p><strong>Integrating Spring OAuth 2 into Wicket</strong></p>
<p>If the application has a valid access token, the OAuth2RestTemplate performs the API call, otherwise a UserRedirectRequiredException is thrown. Typically, the OAuth2ClientContextFilter, which is part of the Spring security chain, should catch this exception and redirect the user to the user-authorization-uri specified earlier. However, by default Wicket catches all exceptions that occur in the Web application and just dumps them in development mode or provides an error page in production mode. Hence, the UserRedirectRequiredException will never reach the Spring security filter chain. Therefore, we have to tweak exception handling by implementing a custom IExceptionMapper:</p>
<pre class="brush: java; title: ; notranslate">
public class OAuth2ExceptionMapper implements IExceptionMapper {
  private final IExceptionMapper delegateExceptionMapper;

  public OAuth2ExceptionMapper(IExceptionMapper delegateExceptionMapper) {
    this.delegateExceptionMapper = delegateExceptionMapper;
  }

  @Override
  public IRequestHandler map(Exception e) {
    Throwable rootCause = getRootCause(e);
    if (rootCause instanceof UserRedirectRequiredException) {
      //see DefaultExceptionMapper
      Response response = RequestCycle.get().getResponse();
      if (response instanceof WebResponse) {
        // we don't want to cache an exceptional reply in the browser
        ((WebResponse)response).disableCaching();
      }
      throw ((UserRedirectRequiredException) rootCause);
    } else {
      return delegateExceptionMapper.map(e);
    }
  }

  private Throwable getRootCause(Throwable ex) {
    if (ex == null) {
      return null;
    }
    if (ex.getCause() == null) {
      return ex;
    }
    return getRootCause(ex.getCause());
  }
}
</pre>
<p>The custom exception mapper has to be created in the application by the exception mapper provider:</p>
<pre class="brush: java; title: ; notranslate">
public class CalendarDemoApplication extends WebApplication {
  private IProvider&lt;IExceptionMapper&gt; exceptionMapperProvider;

  @Override
  protected void init() {
    super.init();
    this.exceptionMapperProvider = new OAuth2ExceptionMapperProvider();
    //details left out - see original class on Github
  }

  @Override
  public IProvider&lt;IExceptionMapper&gt; getExceptionMapperProvider() {
    return exceptionMapperProvider;
  }

  /**
   * Custom Exception Mapper provider that integrates the OAuth2ExceptionMapper into the application.
   */
  private static class OAuth2ExceptionMapperProvider implements IProvider&lt;IExceptionMapper&gt; {
    @Override
    public IExceptionMapper get() {
      return new OAuth2ExceptionMapper(new DefaultExceptionMapper());
    }
  }
}
</pre>
<p>Now UserRedirectRequiredException will not be handled by Wicket but propagated further up the call stack which allows the OAuth2ClientContextFilter to handle the exception properly. We are almost done but one last piece is still missing.</p>
<p><strong>System-internal Authentication</strong></p>
<p>As I have written in the introduction, I do not want to authenticate against my own application as I am the only user. However, Spring Security OAuth 2 expects user credentials within the application prior to authenticating the application against an OAuth 2 server. If we try to perform a Google Calendar API call as anonymous user we get the following trace:</p>
<pre class="brush: plain; title: ; notranslate">
org.springframework.security.authentication.InsufficientAuthenticationException: Authentication is required to obtain an access token (anonymous not allowed)
at org.springframework.security.oauth2.client.token.AccessTokenProviderChain.obtainAccessToken(AccessTokenProviderChain.java:88)
at org.springframework.security.oauth2.client.OAuth2RestTemplate.acquireAccessToken(OAuth2RestTemplate.java:217)
at org.springframework.security.oauth2.client.OAuth2RestTemplate.getAccessToken(OAuth2RestTemplate.java:169)
at org.springframework.security.oauth2.client.OAuth2RestTemplate.createRequest(OAuth2RestTemplate.java:90)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:479)
at org.springframework.security.oauth2.client.OAuth2RestTemplate.doExecute(OAuth2RestTemplate.java:124)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:446)
at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:214)
at com.github.gcaldemo.calendar.repository.impl.GoogleCalendarRepositoryImpl.loadCalendars(GoogleCalendarRepositoryImpl.java:45)
[...]
</pre>
<p>As the exception message tells, anonymous users are not allowed to perform OAuth 2 operations. Therefore, we have to grant access to the application only to authenticated users. This is done by configuring an interceptor in the http security configuration:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;security:intercept-url pattern=&quot;/**&quot; access=&quot;ROLE_USER&quot; /&gt;
</pre>
<p>Next, we have to trick Spring Security OAuth 2 by implementing a custom authentication processing filter which publishes a system user with proper privileges to the SecurityContext:</p>
<pre class="brush: java; title: ; notranslate">
//some details omitted - see original class on Github
public class SystemAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter {
  @Override
  public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException, ServletException {
    // Populate an internal system user in the security context with proper access privileges. These is typically not
    // necessary for multi user systems in production as users typically have to authenticate against your
    // application before using it.
    Authentication authentication = new TestingAuthenticationToken(&quot;internal_system_user&quot;, &quot;internal_null_credentials&quot;, &quot;ROLE_USER&quot;);
    authentication.setAuthenticated(true);
    return getAuthenticationManager().authenticate(authentication);
  }

  public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
    throws IOException, ServletException {

    if (SecurityContextHolder.getContext().getAuthentication() == null) {
      SecurityContextHolder.getContext().setAuthentication(attemptAuthentication((HttpServletRequest) req, (HttpServletResponse) res));
    }
    chain.doFilter(req, res);
  }
}
</pre>
<p>Now, Spring Security OAuth 2 can perform authorization requests properly and we are redirected before accessing the Google Calendar API for the first time:</p>
<p><a href="http://comsysto.files.wordpress.com/2013/03/006_request_for_permission.png"><img class="aligncenter size-large wp-image-2450" alt="Demo application requests access permission from Google" src="http://comsysto.files.wordpress.com/2013/03/006_request_for_permission.png?w=380&#038;h=242" width="380" height="242" /></a></p>
<p>After the user has granted the application access to its data we can create an event. Note that the calendar drop down is already pre-filled with all Google calendars the user has at least write access to:</p>
<p><a href="http://comsysto.files.wordpress.com/2013/03/007_create_event.png"><img class="aligncenter size-large wp-image-2451" alt="Creating a new Google calendar event" src="http://comsysto.files.wordpress.com/2013/03/007_create_event.png?w=380&#038;h=407" width="380" height="407" /></a></p>
<p><a href="http://comsysto.files.wordpress.com/2013/03/008_event_created.png"><img class="aligncenter size-large wp-image-2452" alt="New Google calendar event has been created" src="http://comsysto.files.wordpress.com/2013/03/008_event_created.png?w=380&#038;h=407" width="380" height="407" /></a></p>
<p><strong>Summary</strong></p>
<p>Although a client library for the Google Calendar API is available it is sometimes feasible to use libraries and technologies that are already used in a project. With a few tweaks I was able to use the Google Calendar API in a Wicket application using Spring Security OAuth 2. The <a href="https://github.com/comsysto/wicket-gcal-demo">example application on Github</a> demonstrates the integration but beware of the limitation that was mentioned above: This setup is primarily suited for single-user applications. If you want to reuse the sample code in a production environment you should use a <a href="http://static.springsource.org/spring-security/oauth/apidocs/org/springframework/security/oauth2/client/token/ClientTokenServices.html">ClientTokenServices implementation</a> backed by a database and use a real implementation of <a href="http://static.springsource.org/spring-security/site/docs/3.1.x/apidocs/org/springframework/security/web/authentication/AbstractAuthenticationProcessingFilter.html">AbstractAuthenticationProcessingFilter</a> such as <a href="http://static.springsource.org/spring-security/site/docs/3.1.x/apidocs/org/springframework/security/web/authentication/UsernamePasswordAuthenticationFilter.html">UsernamePasswordAuthenticationFilter</a>.</p>
<p>I hope that this post described in enough detail how to integrate the Google Calendar API into a Wicket application. Otherwise, feel free to ask questions in the comments section.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/comsysto.wordpress.com/2442/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/comsysto.wordpress.com/2442/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.comsysto.com&#038;blog=8304660&#038;post=2442&#038;subd=comsysto&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.comsysto.com/2013/05/13/integrating-google-calendar-into-a-wicket-application/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/2b78fb5cc3a6a2e8280e63332fd8250b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmitterdorfer</media:title>
		</media:content>

		<media:content url="http://comsysto.files.wordpress.com/2013/03/oauth2-authorization.png" medium="image">
			<media:title type="html">OAuth2 authorization scenario</media:title>
		</media:content>

		<media:content url="http://comsysto.files.wordpress.com/2013/03/001_create_project.png?w=380" medium="image">
			<media:title type="html">Create a new Google API project</media:title>
		</media:content>

		<media:content url="http://comsysto.files.wordpress.com/2013/03/002_create_client_id.png?w=380" medium="image">
			<media:title type="html">Create a new client id for a Google API project (part 1)</media:title>
		</media:content>

		<media:content url="http://comsysto.files.wordpress.com/2013/03/003_create_client_id.png?w=380" medium="image">
			<media:title type="html">Create a new client id for a Google API project (part 2)</media:title>
		</media:content>

		<media:content url="http://comsysto.files.wordpress.com/2013/03/004_create_project_finished.png?w=380" medium="image">
			<media:title type="html">Google API project has been created</media:title>
		</media:content>

		<media:content url="http://comsysto.files.wordpress.com/2013/03/005_activate_services.png?w=380" medium="image">
			<media:title type="html">Activate access to Google calendar API</media:title>
		</media:content>

		<media:content url="http://comsysto.files.wordpress.com/2013/03/006_request_for_permission.png?w=380" medium="image">
			<media:title type="html">Demo application requests access permission from Google</media:title>
		</media:content>

		<media:content url="http://comsysto.files.wordpress.com/2013/03/007_create_event.png?w=380" medium="image">
			<media:title type="html">Creating a new Google calendar event</media:title>
		</media:content>

		<media:content url="http://comsysto.files.wordpress.com/2013/03/008_event_created.png?w=380" medium="image">
			<media:title type="html">New Google calendar event has been created</media:title>
		</media:content>
	</item>
		<item>
		<title>AWS Summit 2013 Berlin Roundup</title>
		<link>http://blog.comsysto.com/2013/05/06/aws-summit-2013-berlin-roundup/</link>
		<comments>http://blog.comsysto.com/2013/05/06/aws-summit-2013-berlin-roundup/#comments</comments>
		<pubDate>Mon, 06 May 2013 06:45:39 +0000</pubDate>
		<dc:creator>jbrandstettercs</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.comsysto.com/?p=2605</guid>
		<description><![CDATA[This year&#8217;s German AWS Summit took place in Berlin on May 2nd at the Berlin Congress Center right at Alexanderplatz. Amazon seem to have hit a nerve with their product and conference topic as the place was completely packed. Quite a large queue of attendees had stacked up right before the entrance: Most of the [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.comsysto.com&#038;blog=8304660&#038;post=2605&#038;subd=comsysto&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>This year&#8217;s German <a title="AWS Summit 2013 Berlin" href="http://aws.amazon.com/de/aws-summit-2013/berlin/" target="_blank">AWS Summit </a>took place in Berlin on May 2nd at the Berlin Congress Center right at Alexanderplatz.</p>
<p>Amazon seem to have hit a nerve with their product and conference topic as the place was completely packed. Quite a large queue of attendees had stacked up right before the entrance:</p>
<p><a href="http://blog.comsysto.com/2013/05/06/aws-summit-2013-berlin-roundup/img_20130502_092028/" rel="attachment wp-att-2608"><img class="alignnone size-large wp-image-2608" alt="IMG_20130502_092028" src="http://comsysto.files.wordpress.com/2013/05/img_20130502_092028.jpg?w=380&#038;h=506" width="380" height="506" /></a></p>
<p>Most of the conference rooms were also quite full. All in all a very good sign that people are interested in cloud computing and willing to shift their attention to their core business instead of keeping reinventing the wheel in terms of IT infrastructure.</p>
<p><a title="Werner Vogels" href="http://en.wikipedia.org/wiki/Werner_Vogels" target="_blank">Werner Vogels</a>, CTO of AWS opened the summit with his keynote speech. He brought up some interesting case studies, where their product has come from, where they are now and also gave a short glimpse into the future of AWS. He offered a view into how he thinks cloud computing should shape the future of human-computer interaction and how content is experienced utilising all those new possibilities. For him &#8220;devices are only windows to your content in the cloud&#8221;. As an example he brought up treadmills which he sometimes uses in hotels. Vogels wants those built in a way so that he can authenticate to them and then access all his personal content being either work documents or all forms of entertainment. And if you look at<a title="Google Glass" href="http://www.google.com/glass/start/" target="_blank"> Google Glass</a> for example he&#8217;s right because how much of a &#8220;device&#8221; really is left with a pair of glasses that you wear. It doesn&#8217;t really matter if the device has this hardware spec or one slightly better. It all comes down to if you can access your content anytime, anywhere and to have that content augmented with whatever information your current situation benefits from. Vogels also stressed that Amazon&#8217;s vision is to bring prices down for their services so that you don&#8217;t really think about whether to use them or not. &#8220;It&#8217;s just like switching on the light in the evening &#8211; you don&#8217;t think about that!&#8221;</p>
<p><a href="http://blog.comsysto.com/2013/05/06/aws-summit-2013-berlin-roundup/img_20130502_112117/" rel="attachment wp-att-2609"><img class="alignnone size-large wp-image-2609" alt="IMG_20130502_112117" src="http://comsysto.files.wordpress.com/2013/05/img_20130502_112117.jpg?w=380&#038;h=285" width="380" height="285" /></a></p>
<p>Most of the other talks were mainly about how to design applications and infrastructure in the cloud. The main driver for those design decisions is scalability. And this does not only mean that you should be able to scale up or out for peak times but also, and much more important from a cost perspective, to be able to scale down when there are less requests to your application and your provisioned assets are under-utilised. This is an important and interesting aspect when making decisions about e.g. what <a title="AWS EC2 Instance Types" href="http://aws.amazon.com/ec2/instance-types/" target="_blank">instance size</a> to use on AWS. For people coming from traditional IT backgrounds there needs to be some shift in their mind set because they are used to over commission physical hardware just to be on the safe side. With elastic resource provisioning this is no longer necessary.</p>
<p>To make all of this work there is of course a heavy need for automation of all aspects of provisioning systems and deploying software artefacts. A fact which was made clear in nearly all of the talks. But this ultimately also calls for a higher level of abstraction when you think of the services you use. What applications really need is some sort of runtime environment which in case of e.g. Java, Ruby and Python apps is totally accepted. You have a virtual machine and nearly no one questions their internals. We just use them. But with things like web servers or any other &#8220;traditional&#8221; services people tend to set up complete systems from the OS level because they want to push all the shiny knobs and buttons that these offer. I had an interesting discussion with an attendee how was more on the traditional side of things. But it seemed that he had almost something like an epiphany as he said: &#8220;Maybe you&#8217;re right. I don&#8217;t think about OS processes on a low level and how they work. I just trust them to do the right thing!&#8221;</p>
<p>In summary it&#8217;s quite an exciting time to see how usage paradigms slowly but constantly change towards cloud based offerings which are not only getting used by start-ups but also by larger traditional enterprises who recognise that if they want to move fast, be agile and keep up with their competition the cloud is the place to be!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/comsysto.wordpress.com/2605/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/comsysto.wordpress.com/2605/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.comsysto.com&#038;blog=8304660&#038;post=2605&#038;subd=comsysto&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.comsysto.com/2013/05/06/aws-summit-2013-berlin-roundup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/14fa01f5630b5becf6a20b33fd7f790b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jbrandstettercs</media:title>
		</media:content>

		<media:content url="http://comsysto.files.wordpress.com/2013/05/img_20130502_092028.jpg?w=380" medium="image">
			<media:title type="html">IMG_20130502_092028</media:title>
		</media:content>

		<media:content url="http://comsysto.files.wordpress.com/2013/05/img_20130502_112117.jpg?w=380" medium="image">
			<media:title type="html">IMG_20130502_112117</media:title>
		</media:content>
	</item>
		<item>
		<title>Data Analysis with the Unix Shell</title>
		<link>http://blog.comsysto.com/2013/04/25/data-analysis-with-the-unix-shell/</link>
		<comments>http://blog.comsysto.com/2013/04/25/data-analysis-with-the-unix-shell/#comments</comments>
		<pubDate>Thu, 25 Apr 2013 15:19:08 +0000</pubDate>
		<dc:creator>berndzuther</dc:creator>
				<category><![CDATA[Data Science]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[rstats]]></category>
		<category><![CDATA[Analysis]]></category>
		<category><![CDATA[Unix Shell]]></category>

		<guid isPermaLink="false">http://blog.comsysto.com/?p=2508</guid>
		<description><![CDATA[Currently, the Hadoop based software company Cloudera creates the new certification called Data Science Essentials Exam (DS-200). One goal of the certification is to learn tools, techniques, and utilities for evaluating data from the command line. That&#8217;s why I am writing this blog post. The Unix shell provides a huge set of commands that can [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.comsysto.com&#038;blog=8304660&#038;post=2508&#038;subd=comsysto&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Currently, the Hadoop based software company <a href="http://www.cloudera.com/">Cloudera</a> creates the new certification called <a title="Data Science Essentials Exam (DS-200) Preparation" href="http://university.cloudera.com/certification/prep/datascience.html"><strong>Data Science Essentials Exam (DS-200)</strong></a>. One goal of the certification is to learn tools, techniques, and utilities for evaluating data from the command line. That&#8217;s why I am writing this blog post. The <a href="http://en.wikipedia.org/wiki/Unix_shell" target="_blank">Unix shell</a> provides a huge set of commands that can be used for data analysis. A good introduction to Unix commands can be found in this <a href="http://www.ceri.memphis.edu/computer/docs/unix/bshell.htm" target="_blank">tutorial</a>.</p>
<p>The data analyst friendly commands are: <a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?cat"><strong><em>cat</em></strong></a>, <a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?find"><strong><em>find</em></strong></a>, <a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?grep"><strong><em>grep</em></strong></a>, <a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?wc"><strong><em>wc</em></strong></a>, <a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?cut"><strong><em>cut</em></strong></a>, <a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?sort"><strong><em>sort</em></strong></a>, <a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?uniq"><strong><em>uniq</em></strong></a></p>
<p>This commands are called <strong><a href="http://en.wikipedia.org/wiki/Filter_%28Unix%29">filters</a></strong>. Data passes through a filter. Moreover, a filter can modify data a bit on the way through them. All filters read data from the <a href="http://en.wikipedia.org/wiki/Standard_input">standard input</a> and writes data to <a href="http://en.wikipedia.org/wiki/Standard_output">standard output</a>. Filter can use the standard output of another filter to be its standard input while using the pipe<em> &#8220;|&#8221;</em> operator. E.g. the <em>cat</em> command reads a file to standard output and the <em>grep</em> command uses this output of <em>cat</em> as standard input to search if the city &#8216;Munich&#8217; is in a city file. The example dataset is available on <a title="City Country Dataset" href="https://github.com/comsysto/city-country-dataset">github</a>.</p>
<pre class="brush: bash; title: ; notranslate">
bz@cs ~/data $ cat city | grep Munich
    3070,Munich [München],DEU,Bavaria,1194560
</pre>
<p>In the example above you can see the structure of the sample data set. The dataset is a comma separated list. The first number represents the id of an entry, followed by the name of a city, the countrycode, district and the last number represents the population of a city.</p>
<p>Now, let&#8217;s answer an <strong>analytical question</strong>: <em>What is the city with the biggest population in the data set? </em>The second and the fifth column can be selected with the help of <em>awk</em>.  A<em>wk</em> creates a list where the population is on the first position and the city name is on the second position. The <em>sort</em> command can be used for sorting. Therefore, it is possible to find out which city in the dataset has the biggest population.</p>
<pre class="brush: bash; title: ; notranslate">
bz@cs ~/data/ $ awk -v OFS=&quot;  &quot; -F&quot;,&quot; '{print $5, $2}' city | sort -n -r | head -n 1
    10500000  Mumbai (Bombay)
</pre>
<p>It is also possible to make <strong>joins</strong> in the Unix shell with the command called <a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?join"><em>join</em></a>. The <em>join</em> command assumes that input data is sorted based on the key on which the join is going to take place. You can find another dataset on <a title="City Country Dataset" href="https://github.com/comsysto/city-country-dataset">github</a> which contains countries. This dataset is a comma separated list as well. The 14th column in the country dataset represents the capital id which is similar to the id in the city data set. This makes it possible to create a list of countries with their capitals.</p>
<pre class="brush: bash; title: ; notranslate">
bz@cs ~/data/ $ cat city | head -n 2
    1,Kabul,AFG,Kabol,1780000
    2,Qandahar,AFG,Qandahar,237500
bz@cs ~/data/ $ cat country | head -n 2
    AFG,Afghanistan,Asia,Southern and Central Asia,652090,1919,22720000,45.9,5976.00,,Afganistan/Afqanestan,Islamic Emirate,Mohammad Omar,1,AF
    NLD,Netherlands,Europe,Western Europe,41526,1581,15864000,78.3,371362.00,360478.00,Nederland,Constitutional Monarchy,Beatrix,5,NL
bz@cs ~/data/ $ join -t &quot;,&quot; -1 1 -2 14 -o '1.2,2.2' city country | head -n 2
    Kabul,Afghanistan
    Amsterdam,Netherlands
</pre>
<p>Finally, let&#8217;s get a deeper look in the city data set. The question for this example is: <em>How is the distribution of cities in the city data set?</em> A combination of the <em>sort</em> and the <em>uniq</em> commands allows us to create data for a <strong>density plot</strong>. This data can be streamed (&gt;) to a file.</p>
<pre class="brush: bash; title: ; notranslate">
bz@cs ~/data/ $ cat city | cut -d , -f 3 | uniq -c | sort -r | head -n 4
    363 CHN
    341 IND
    274 USA
    250 BRA
bz@cs ~/data/ $ cat city | cut -d , -f 3 | uniq -c | sort -r &gt; count_vs_country
</pre>
<p><a href="http://www.gnuplot.info"><strong><em>Gnuplot</em></strong></a> is a command which allows us to visualize the density data file. We have to tell <em>gnuplot</em> what it has to print and how it should be printed. You can use <em>gnuplot</em> while <em>telnet</em> or <em>ssh</em> session as well because plots can be printed in ACSII-Characters. Therefore, the terminal type has to be set to &#8216;<em>dumb</em>&#8216;.</p>
<pre class="brush: bash; title: ; notranslate">
bz@cs ~/data/ $ gnuplot

	G N U P L O T
	Version 4.6 patchlevel 2    last modified 2013-03-14
	Build System: Darwin x86_64

	Copyright (C) 1986-1993, 1998, 2004, 2007-2013
	Thomas Williams, Colin Kelley and many others

	gnuplot home:     http://www.gnuplot.info
	faq, bugs, etc:   type &quot;help FAQ&quot;
	immediate help:   type &quot;help&quot;  (plot window: hit 'h')

Terminal type set to 'x11'
gnuplot&gt; plot 'count_vs_country' with points
gnuplot&gt; set term dumb
Terminal type set to 'dumb'
Options are 'feed  size 79, 24'
gnuplot&gt; plot 'count_vs_country' with points

400 ++------------+-------------+------------+-------------+------------++
+             +             +            + 'count_vs_country'   A    +
350 A+                                                                  ++
A                                                                    |
|                                                                    |
300 ++                                                                  ++
|A                                                                   |
250 +A                                                                  ++
|                                                                    |
200 ++                                                                  ++
|A                                                                   |
| A                                                                  |
150 ++                                                                  ++
| A                                                                  |
100 ++                                                                  ++
| AA                                                                 |
|  AAA                                                               |
50 ++    AA                                                            ++
+       AAAAAAAA            +            +             +             +
0 ++------------+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA---++
0             50           100          150           200           250
</pre>
<div id="attachment_2524" class="wp-caption aligncenter" style="width: 310px"><a href="http://comsysto.files.wordpress.com/2013/04/bildschirmfoto-2013-04-20-um-21-38-09.png"><img class="size-medium wp-image-2524 " title="Histogram of the Distribution of City related to a Country" alt="GNU-Plot" src="http://comsysto.files.wordpress.com/2013/04/bildschirmfoto-2013-04-20-um-21-38-09.png?w=300&#038;h=228" width="300" height="228" /></a><p class="wp-caption-text">Density plot for the Distribution of City related to a Country</p></div>
<p style="text-align:left;">I hope you enjoyed this little excurse in data analysis with the Unix shell. It is useful for students which are currently working on the study guide of Data Science Essentials (DS-200) Beta. Furthermore, I demonstrated how powerful the Unix shell can be used for basic analytics. The Unix shell is also able to do basic things like an analyst normally is executing in a statistical software as <strong><a href="http://www.r-project.org/">R</a></strong>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/comsysto.wordpress.com/2508/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/comsysto.wordpress.com/2508/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.comsysto.com&#038;blog=8304660&#038;post=2508&#038;subd=comsysto&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.comsysto.com/2013/04/25/data-analysis-with-the-unix-shell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/4249ae095355a8ae4d962d4bcd09659d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">berndzuther</media:title>
		</media:content>

		<media:content url="http://comsysto.files.wordpress.com/2013/04/bildschirmfoto-2013-04-20-um-21-38-09.png?w=300" medium="image">
			<media:title type="html">Histogram of the Distribution of City related to a Country</media:title>
		</media:content>
	</item>
		<item>
		<title>Cassandra 1.1 &#8211; Tuning for Frequent Column Updates</title>
		<link>http://blog.comsysto.com/2013/04/12/cassanrda-1-1-tuning-for-frequent-column-updates/</link>
		<comments>http://blog.comsysto.com/2013/04/12/cassanrda-1-1-tuning-for-frequent-column-updates/#comments</comments>
		<pubDate>Fri, 12 Apr 2013 10:37:22 +0000</pubDate>
		<dc:creator>Maciej Miklas</dc:creator>
				<category><![CDATA[All About BigData, NoSQL & MongoDB]]></category>
		<category><![CDATA[NoSQL]]></category>
		<category><![CDATA[PlanetCassandra]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Cassandra]]></category>
		<category><![CDATA[Tuning for Frequent Column Updates]]></category>

		<guid isPermaLink="false">http://blog.comsysto.com/?p=2496</guid>
		<description><![CDATA[Cassandra is known for its good write performance. But there are scenarios, when you might run into trouble &#8211; especially when particular use case generates heavy disk IO. This could be the case for columns which receive frequent updates. However, you can avoid those problems, with proper configuration, or just by updating to recent Cassandra [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.comsysto.com&#038;blog=8304660&#038;post=2496&#038;subd=comsysto&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a title="Cassandra" href="http://cassandra.apache.org/">Cassandra</a> is known for its <strong>good write performance</strong>. But there are scenarios, when you might run into trouble &#8211; especially when particular use case generates heavy disk IO. This could be the case for columns which receive frequent updates. However, you can avoid those problems, with proper configuration, or just by updating to <a title="Cassandra" href="http://cassandra.apache.org/download/" target="_blank">recent Cassandra version</a>. The good news is, that it can be applied to already ruining system, so when you are already having problems, there is still a hope.</p>
<p><a title="Memtable" href="http://wiki.apache.org/cassandra/MemtableSSTable" target="_blank"><i>Memtables</i></a> are flushed to immutable <i>SSTables</i>, and it is possible, that single column value can be stored in different <i>SSTables</i>, when its value was changing over long enough time period. This guarantees fast inserts, because data is being just appended to disk. But on the other hand, unnecessary writes will decrease disk performance, not only because many <i>SSTables </i>has to be written, but mainly because duplicates on disk will have to be compacted later on.</p>
<p>The idea is to tune Cassandra in the way, that we take benefit from frequent updates. This can be achieved by keeping data in memory and by delaying disk flushes. In this case new updates will replace existing values in memory.<br />
This will generate less disk traffic, because it will decrease amount of flushed duplicates. This is not all &#8211; this will also create write through cache, and read requests will benefit from it. Here are some confutation tips:</p>
<ul>
<li>Make sure that you have at least Cassandra 1.1 &#8211; it contains optimization for frequently changing values (<a href="https://issues.apache.org/jira/browse/CASSANDRA-2498">CASSANDRA-2498</a>). For the cases where single value is stored in multiple <i>SSTables, </i>older Cassandra versions would need to read column values from all <i>SSTables</i> in order to find most recent one. Now <i>SSTables </i>are sorted by modification time, so it&#8217;s enough to read most recent value and simply ignore remaining outdated values.</li>
<li>Increase <a href="http://wiki.apache.org/cassandra/MemtableThresholds">thresholds</a> for flushing <i>memtables</i>. Each update on <i>memtable</i>, results in one less entry in <i>SSTable.</i></li>
<li>Each read operation checks first <i>memtables</i>, if data is still there, it will be simply returned &#8211; this is the fastest possible access. Its like non blocking write through cache (based on <i>skip list)</i>.</li>
<li>To large <i>memtable</i> on the other hand will result in larger <i>commit log</i>. This is not a problem, until your instance crashes. It will need some time to start, because it would need to read whole <i>commit log</i>.</li>
<li>Compaction merges <i>SSTables</i> together, and this increases read performance, since we have less data to go through. But this process does not have high priority. When Cassandra is nearly exhausted, it will skip compaction, and this can lead to data fragmentation.</li>
</ul>
<p><strong>Caching </strong></p>
<ul>
<li><i><a href="http://www.datastax.com/dev/blog/caching-in-cassandra-1-1" target="_blank">Row cache</a> </i>makes really sense for frequent reads of the same row(s), and additionally when you read most of the columns of each single row.</li>
<li>For active <i>row cache</i>, access to single column from particular row will load whole row with all its columns into memory. Analyze data access patterns, and makes sure that<i> </i>it is not an overhead, and that you have enough memory. It would be really waste of resources, to load hundred columns into memory, to just access only a few.</li>
<li><i>Row cache</i> works as wright through, for data that is already in it. Data is loaded into <i>row cache</i> first when it&#8217;s being read, and when it was not found in <i>memtable</i>. From this point of time it will get updated on each write operation. Frequently changing entry, without read access will not affect<i> row cache</i>, because it&#8217;s not there.</li>
<li>Updates on data in <i>row cache</i> will decrease performance, and actually, those frequently changing columns are probably also available in <i>memtable.</i> Read process will first search <i>memtable</i>, and in case of hit ignore <i>row cache.</i> From this point of view <i>row cache</i> makes sense, if you also read other columns which are not changing frequently. For example single row has 200 columns, 50 receive frequent updates, 100 sporadic, and read process reads always all. In this case <i>row cache </i>makes sense &#8211; we will have to actualize 50 columns on each insert, but we will gain fast access to remaining 150<i>.</i></li>
<li>It might be good idea to disable <i>row cache</i>, increase <i>memtable </i>size in hope to reduce disk writes, and to use <i>memtable</i>as cache.</li>
<li>Disabling <i>row cache</i> does not necessary mean additional disk seeks. Cassandra uses memory mapped files, which means that each file access is being cached by operating system. Relaying on memory mapped files is nothing new &#8211; Mongo does not have cache at all &#8211; it&#8217;s not needed, since file system cache works just fine. But Mongo has different data structure on hard drive, because they store <i>BSON</i> document optimized for reads, its all in one place, Cassandra might (not always) need first to collect data from different locations.</li>
<li><i>Row cache </i>would help also in situation where single row spreads over many <i>SSTables</i>. In this case putting all data together is CPU intensive operation, not mentioning possible disk access to read each column value.</li>
<li>When <i>row cache</i> is disabled, key cache must be used. Key cache is like an index &#8211; and you definitely want to load your whole index into memory.</li>
<li>When <i>row cache</i> is disabled and <i>key cache</i> is enabled, and read operation get hits on key cache, we have quiet performant solution. Searching <i>SSTables</i> runs fully in memory, only reading column value itself requires disk access. And maybe even not that, since it&#8217;s <i>memory mapped </i>file.</li>
<li>When disabling <i>row cache </i>remember to tune <a href="http://www.kernel.org/doc/man-pages/online/pages/man2/readahead.2.html">read ahead</a>. The idea is, to read from disk only single column and not more data when it&#8217;s not needed.</li>
</ul>
<p>Just to summary &#8230;. <strong>run performance tests</strong>, <strong>check Cassandra statistics</strong>, and verify<strong> how many <i>SSTables</i></strong> has to be searched to find data, and what is the <strong>cache usage</strong>. This might be a good entry point to change <i>memtable</i> size, or to tune caching. In my case, disabling <i>row cache</i>, large <i>key cache</i> and increased <i>memtable</i> thresholds was the right decision.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/comsysto.wordpress.com/2496/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/comsysto.wordpress.com/2496/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.comsysto.com&#038;blog=8304660&#038;post=2496&#038;subd=comsysto&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.comsysto.com/2013/04/12/cassanrda-1-1-tuning-for-frequent-column-updates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/18903cf65c943cc0a532aeb63e9b51fe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">maciejmiklas</media:title>
		</media:content>
	</item>
		<item>
		<title>Background of collaborative filtering with Mahout</title>
		<link>http://blog.comsysto.com/2013/04/03/background-of-collaborative-filtering-with-mahout/</link>
		<comments>http://blog.comsysto.com/2013/04/03/background-of-collaborative-filtering-with-mahout/#comments</comments>
		<pubDate>Wed, 03 Apr 2013 11:53:17 +0000</pubDate>
		<dc:creator>cindylamm</dc:creator>
				<category><![CDATA[All About BigData, NoSQL & MongoDB]]></category>
		<category><![CDATA[Big Data]]></category>
		<category><![CDATA[Data Science]]></category>
		<category><![CDATA[Hadoop]]></category>
		<category><![CDATA[Recommendation Engine]]></category>
		<category><![CDATA[Collaborative Filtering]]></category>
		<category><![CDATA[eCommerce]]></category>
		<category><![CDATA[Mahout]]></category>
		<category><![CDATA[MongoDB]]></category>
		<category><![CDATA[recommendation engine]]></category>
		<category><![CDATA[Web Application]]></category>

		<guid isPermaLink="false">http://blog.comsysto.com/?p=1887</guid>
		<description><![CDATA[In order to set up Apache Mahout, a library written in Java to perform scalable machine learning algorithms based on Hadoop, in the architecture of Mario&#8217;s fabulous online shop for pizza, pasta and co (see blog post Building an Online-Recommendation Engine with MongoDB and Mahout) we&#8217;d like to know which recommendation strategy is the best for our so far fictional [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.comsysto.com&#038;blog=8304660&#038;post=1887&#038;subd=comsysto&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>In order to set up <a style="line-height:1.714285714;font-size:1rem;" title="Apache Mahout" href="http://mahout.apache.org/" target="_blank">Apache Mahout</a><span style="line-height:1.714285714;font-size:1rem;">, a library written in Java to perform scalable machine learning algorithms based on <a title="http://hadoop.apache.org/" href="http://hadoop.apache.org/" target="_blank">Hadoop</a>, in the architecture of Mario&#8217;s fabulous online shop for pizza, pasta and co (see blog post </span><a title="Building an Online-Recommendation Engine with MongoDB and Mahout" href="http://blog.comsysto.com/2013/03/04/building-an-online-recommendation-engine-with-mongodb-and-mahout/" target="_blank">Building an Online-Recommendation Engine with MongoDB and Mahout</a>) we&#8217;d like <span style="line-height:1.714285714;font-size:1rem;">to know which<strong> recommendation strategy</strong> is the best for our so far fictional use case (which is computing recommendations for 32 products and 101 users in real time). With this small amount of data we could also use other tools, e.g. </span><a style="line-height:1.714285714;font-size:1rem;" title="Weka Homepage" href="http://www.cs.waikato.ac.nz/ml/weka/index.html" target="_blank">Weka</a><span style="line-height:1.714285714;font-size:1rem;">, but in an actual online shop the occurring data would be a lot more than what we simulate here, which is why we choose Apache Mahout. Before we dive into coding details let&#8217;s have a look at what Mahout&#8217;s collaborative filtering actually does.</span></p>
<h3>Collaborative Filtering</h3>
<p>In order to be able to transfer the recommendation logic to use cases of different businesses we opt for <a title="Collaborative filtering on Wikipedia" href="http://en.wikipedia.org/wiki/Collaborative_filtering" target="_blank">collaborative filtering.</a> A technique for producing recommendations <strong>solely based on the user’s preferences for products</strong> (instead of including product features and/or user properties). Well, collaborative filtering can be user- or item-based. User-based recommendation promotes products to the user that are bought by users who are similar to her.</p>
<div id="attachment_1926" class="wp-caption aligncenter" style="width: 390px"><a href="http://comsysto.files.wordpress.com/2013/02/userbased.png"><img class="size-large wp-image-1926" alt="User-based Recommendation" src="http://comsysto.files.wordpress.com/2013/02/userbased.png?w=380&#038;h=208" width="380" height="208" /></a><p class="wp-caption-text">User-based Recommendation: recommend products to a user based on what similar users have bought</p></div>
<p>Item-based recommendation proposes products that are similar to the ones the user already buys.</p>
<div id="attachment_1929" class="wp-caption aligncenter" style="width: 202px"><a href="http://comsysto.files.wordpress.com/2013/02/itembased1.png"><img class="size-medium wp-image-1929" alt="Item-based Recommendation" src="http://comsysto.files.wordpress.com/2013/02/itembased1.png?w=192&#038;h=208" width="192" height="208" /></a><p class="wp-caption-text">Item-based Recommendation: recommend products to a user that are similar to the ones he already bought</p></div>
<h4>User-Item Preferences and Similarity</h4>
<p>Alright, but what does similar mean in this context? In collaborative filtering <strong>similarity</strong> between users (for user-based recommendations) or items (for item-based recommendations) is computed based on the user-item preference only. <span style="line-height:1.714285714;color:#444444;font-size:1rem;">We use the number of how often a user bought a product as a proxy for the user’s preference. It’s not a perfect proxy but is does the trick and it’s easy to gather. One could also use the number of clicks or views or a combination of those.</span></p>
<p>Based on these user-item preferences we can use the <a title="Euclidean distance on Wikipedia" href="http://en.wikipedia.org/wiki/Euclidean_distance" target="_blank">Euclidean distance</a> or the <a title="Pearson correlation on Wikipedia" href="http://en.wikipedia.org/wiki/Pearson_correlation" target="_blank">Pearson correlation</a> to determine the similarity between users respectively items (products). Based on the Euclidean distance, two users are similar if the distance between their preference vectors projected into a Cartesian coordinate system is small. In fact, the Pearson correlation (based on demeaned user-item preferences) coincides with the cosine of the angle between the preference vectors. That is, two users are similar if the angle between their preference vectors is small, or formulated in terms of correlation, two <span style="line-height:1.714285714;font-size:1rem;">users are similar if they rate the same products high and other products low, intuitively spoken. </span></p>
<div id="attachment_1933" class="wp-caption aligncenter" style="width: 310px"><a href="http://comsysto.files.wordpress.com/2013/02/euclidean_pearson_similarity.png"><img class="size-medium wp-image-1933" alt="Euclidean and Cosine/Pearson Similarity" src="http://comsysto.files.wordpress.com/2013/02/euclidean_pearson_similarity.png?w=300&#038;h=230" width="300" height="230" /></a><p class="wp-caption-text">Difference between Euclidean and Cosine/Pearson User-Similarity</p></div>
<p>However, user-item preferences can be (intentionally) limited to pure association, i.e. the user buys or doesn’t buy the product (respectively views or doesn&#8217;t view the product etc.). In this case, similarities between users or items can be computed based on the <a title="Tanimoto coefficient on Wikipedia" href="http://en.wikipedia.org/wiki/Tanimoto_coefficient#Tanimoto_coefficient_.28extended_Jaccard_coefficient.29" target="_blank">Tanimoto coefficient</a> or the <a title="Likelihood similarity explained by its &quot;inventor&quot;" href="http://tdunning.blogspot.de/2008/03/surprise-and-coincidence.html" target="_blank">log-likelihood ratio</a>. Both similarities are concepts of how likely respectively unlikely it is that two users have both an association to some items but not to other items.</p>
<div id="attachment_2284" class="wp-caption aligncenter" style="width: 390px"><a href="http://comsysto.files.wordpress.com/2013/03/tanimoto_koeffizient.png"><img class="size-large wp-image-2284 " alt="Tanimoto similarity" src="http://comsysto.files.wordpress.com/2013/03/tanimoto_koeffizient.png?w=380&#038;h=171" width="380" height="171" /></a><p class="wp-caption-text">The Tanimoto similarity between 2 users is computed as the number of products the 2 users have in common divided by the total number of products they bought (respectively clicked or viewed) overall.</p></div>
<p>This isn’t really a detailed description of similarity measures and it doesn’t need to be one: Even if one fully understands the concept and computational details of these similarities, in the end one would probably still prefer a <strong>data driven</strong> decision in order to choose between them for the particular use case at hand.</p>
<p>So Mario decided to implement all of the above mentioned recommenders, that is user- and item-based each combined with one of the for similarity measures, plus the <a title="Slope One Recommender on Wikipedia" href="http://en.wikipedia.org/wiki/Slope_One">Slope One recommender</a> which doesn&#8217;t need any similarity measure as input at all. Once all 9 Mahout recommendation strategies are implemented he wants to evaluate and compare them.</p>
<p>Stay tuned for the coding details of how to integrate the open source recommendation framework Mahout into Mario&#8217;s online shop.</p>
<p>Please feel free to attend our talk <strong>&#8220;Building a Online-Recommendation Engine with MongoDB&#8221;</strong> at the <a title="NoSQL Roadshow" href="http://nosqlroadshow.com/nosql-munich-2013/upcomingevents/" target="_blank"><strong>Free GOTO NoSQL Munich &#8211; part II</strong></a> in Munich<strong></strong>, <strong>April 9, 2013</strong> to get a live and comprehensive presentation of our online-recommencation engine. Furthermore, we would love to meet you at the <a title="NoSQL Roadshow" href="http://nosqlroadshow.com/nosql-munich-2013/" target="_blank"><strong>NoSQL Roadshow Munich 2013</strong></a>. A great place to learn more about NoSQL and Big Data technologies. To get a 30% discount please use the comSysto Code <a title="NoSQL Roadshow" href="https://secure.trifork.com/nosql-munich-2013/registration/registration.jsp?promotionCode=COMSYSTO30" target="_blank">COMSYSTO30</a>.</p>
<p><span style="color:#ff0000;"> </span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/comsysto.wordpress.com/1887/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/comsysto.wordpress.com/1887/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.comsysto.com&#038;blog=8304660&#038;post=1887&#038;subd=comsysto&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.comsysto.com/2013/04/03/background-of-collaborative-filtering-with-mahout/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:thumbnail url="http://comsysto.files.wordpress.com/2013/02/startup-feedback-3-code1.png?w=100" />
		<media:content url="http://comsysto.files.wordpress.com/2013/02/startup-feedback-3-code1.png?w=100" medium="image">
			<media:title type="html">startup-feedback-3-code</media:title>
		</media:content>

		<media:content url="http://0.gravatar.com/avatar/618bce3b68af4145252c0cce0abbc563?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">cindylamm</media:title>
		</media:content>

		<media:content url="http://comsysto.files.wordpress.com/2013/02/userbased.png?w=380" medium="image">
			<media:title type="html">User-based Recommendation</media:title>
		</media:content>

		<media:content url="http://comsysto.files.wordpress.com/2013/02/itembased1.png?w=192" medium="image">
			<media:title type="html">Item-based Recommendation</media:title>
		</media:content>

		<media:content url="http://comsysto.files.wordpress.com/2013/02/euclidean_pearson_similarity.png?w=300" medium="image">
			<media:title type="html">Euclidean and Cosine/Pearson Similarity</media:title>
		</media:content>

		<media:content url="http://comsysto.files.wordpress.com/2013/03/tanimoto_koeffizient.png?w=380" medium="image">
			<media:title type="html">Tanimoto similarity</media:title>
		</media:content>
	</item>
		<item>
		<title>Cassandra 1.1 &#8211; Reading and Writing from SSTable Perspecitve</title>
		<link>http://blog.comsysto.com/2013/03/28/cassandra-1-1-reading-and-writing-from-sstable-perspecitve/</link>
		<comments>http://blog.comsysto.com/2013/03/28/cassandra-1-1-reading-and-writing-from-sstable-perspecitve/#comments</comments>
		<pubDate>Thu, 28 Mar 2013 21:14:49 +0000</pubDate>
		<dc:creator>Maciej Miklas</dc:creator>
				<category><![CDATA[All About BigData, NoSQL & MongoDB]]></category>
		<category><![CDATA[Big Data]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[NoSQL]]></category>
		<category><![CDATA[PlanetCassandra]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Cassandra]]></category>
		<category><![CDATA[Cassandra read path]]></category>
		<category><![CDATA[SSTables]]></category>

		<guid isPermaLink="false">http://blog.comsysto.com/?p=2475</guid>
		<description><![CDATA[Apache Cassandra, another NoSQL database which provides scalability and high availability. To keep things simple I will stick to read / write value of one column within single row, and single node deployment. Writing We will store one column given by row key and column name. Each thrift insert request blocks until data is stored in commit log and memtable - this [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.comsysto.com&#038;blog=8304660&#038;post=2475&#038;subd=comsysto&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a title="cassandra" href="http://cassandra.apache.org" target="_blank">Apache Cassandra</a>, another <a href="https://en.wikipedia.org/wiki/NoSQL" target="_blank">NoSQL</a> database which provides scalability and high availability.</p>
<p>To keep things simple I will stick to read / write value of one column within single row, and single node deployment.</p>
<p style="text-align:left;"><strong>Writing</strong></p>
<p style="text-align:left;">We will store one column given by <i>row key</i> and <i>column name</i>.</p>
<p style="text-align:left;">Each thrift insert request blocks until data is stored in <a href="http://wiki.apache.org/cassandra/ArchitectureCommitLog" target="_blank"><strong><i>commit log</i></strong></a> and<i> <a href="http://wiki.apache.org/cassandra/MemtableSSTable" target="_blank">memtable</a></i> - this is all, other operations (like replication) are asynchronous. Additionally client can provide consistency level, in this case call will be blocked until required replicas respond, but asides form this, write operation can be seen as simple append. <i>Commit log</i> is required, because <i>memtable</i> exists only in memory, in case of system crash, Cassandra would recreate <i>memtables</i> from <i>commit log.</i></p>
<p style="text-align:left;"><i>Memtable</i> can be seen as dedicated cache created individually for each <i>column family</i>. It&#8217;s based on <a href="http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/ConcurrentSkipListMap.html" target="_blank"><i>ConcurrentSkipListMap</i></a> - so there is no blocking on read or insert.<i> Memtable</i> contains all recent inserts, and each new insert for the same key and column will overwrite existing one. Multiple updates on single column will result in multiple entries in <i>commit log</i>, and single entry in <i>memtable</i>. It will be flushed to disk, when predefined criteria are met, like maximum size, timeout, or number of mutations. Flushing <i>memtable</i> creates <i>SSTable</i> and this one is immutable, it can be simply saved to disk as sequential write.</p>
<p style="text-align:left;"><a href="http://wiki.apache.org/cassandra/MemtableSSTable" target="_blank"><strong><i>Compaction</i></strong></a> process will merge few <i>SSTables</i> into one. The idea is, to clean up deleted data, and to merge together different modifications of single column. Before compaction, a few <i>SSTables</i> could contain value of single column, after compaction it will be only one.</p>
<p style="text-align:left;"><strong>Reading</strong></p>
<p style="text-align:left;">We will try to find value of single column within one row.</p>
<p>First <i>memtable</i> is being searched, it&#8217;s like write through cache, hit on it provides the most recent data &#8211; within single instance of course, not in a whole cluster.</p>
<p>As the second step Cassandra will search <i>SSTables</i>, but only those within single <i>column family</i>. <i>SSTables </i>are grouped by <i>column family</i>, this is also reflected on disk, where <i>SSTables </i>for each <i>column family </i>are stored together in dedicated folder.</p>
<p>Each <i>SSTable</i> contains <i>row <a href="http://javasourcecode.org/html/open-source/cassandra/cassandra-0.8.1/org/apache/cassandra/utils/BloomFilter.html" target="_blank">bloom</a></i><a href="http://javasourcecode.org/html/open-source/cassandra/cassandra-0.8.1/org/apache/cassandra/utils/BloomFilter.html" target="_blank"> <i>filter</i></a>, it is build on <i>row keys</i>, not on <i>column names</i>. This gives Cassandra the possibility to quickly verify, whenever given <i>SSTable</i> at least contains particular row. Row <i>bloom filers</i> are always hold in memory, so checking them is performant. False positives are also not problem anymore, because latest Cassandra versions have improved hashing and increased size of bit masks.</p>
<p>So &#8230; Cassandra have scanned all possible <i>SSTables </i>within particular <i>column family</i>, and found those with positive <i>bloom filter</i>for <i>row key</i>. However the fact, that given <i>SSTable</i> contains given row, does not necessary mean, that is also contains given column. Cassandra needs to &#8220;look into <i>SSTable</i>&#8221; to check whenever it also contains given column. But it does not have to blindly scan all <i>SSTables </i>with postie bloom filter on <i>row key. </i>First it will sort them by last modification time (max time from <i>metadata</i>). Now it has to find first (youngest) <i>SSTable</i> which contains our column. It is still possible, that this particular column is also stored in other <i>SSTables,</i> but those are definitely older, and therefore not interesting. This optimization comes first with Cassandra 1.1 (<a href="https://issues.apache.org/jira/browse/CASSANDRA-2498">CASSANDRA-2498</a>), previous version would need to go over all <i>SSTables</i>.</p>
<p>Cassandra has found all <i>SSTables </i>with positive <i>bloom filter</i> on <i>row key</i>, and it has sorted them by last modification time, now it needs to find this one which finally has our column &#8211; it&#8217;s time to look inside <i>SSTable:</i><br />
First Cassandra will read <i>row keys</i> from <i>index.db</i>, and find our <i>row key</i> using binary search. Found key contains offset to <i>column index</i>. This index has two informations: file offset for each column value, and <i>bloom filter</i> build on <i>column names</i>. Cassandra checks <i>bloom filter</i> on <i>column name</i>, if it is positive it tries to read column value &#8211; this is all.</p>
<p style="text-align:left;">For the record:</p>
<ul>
<li><i>index.db</i> contains sorted<i> row keys</i>, not the <i>column index</i> as the name would suggest &#8211; this one can be found in<i>data.db</i>, under dedicated offset, which is stored together witch each <i>row key</i>.</li>
<li><i>SSTable </i>has one <i>bloom filter</i> build on <i>row keys</i>. Additionally each row hat its own <i>bloom filter</i>, this one id build on<i>column names. SS</i><i>Table </i>containing 100 rows will have 101 <i>bloom filters</i>.</li>
<li>In order to find given column in <i>SSTable </i>Cassandra will not immediately access <i>column index</i>, it will first check <i>key cache</i> - hit will lead directly from <i>row key </i>to <i>column index</i>. In this case only one disk access is required &#8211; to read column value.</li>
</ul>
<p style="text-align:left;"><strong>Conclusion</strong></p>
<p style="text-align:left;">Bloom filters for rows are <strong>always in memory</strong>, accessing them is <strong>fast</strong>. But accessing <i>column index</i> might require extra disk reads (<i>row keys </i>and <i>column index</i>), and this pro single <i>SSTable</i>.<i> </i><br />
Reading can get really slow, if Cassandra needs to scan large amount of <i>SSTables, </i>and key cache is disabled, or not loaded yet.</p>
<p>Cassandra <strong>sorts</strong> all <strong><i>SSTables </i>by modification time</strong>, which at least optimizes case where single column is stored in many locations. On the other hand, it might need to go over many <i>SSTables</i> to find &#8220;old&#8221; column. Key cache in such situation increases performance significantly.</p>
<p>Row keys for each <i>SSTable </i>are <strong>stored in separate file</strong> called <i>index.db</i>, during start Cassandra &#8220;goes over those files&#8221;, in order to warm up.  Cassandra uses memory mapped files, so there is hope, that when reading files during startup, then first access on those files will be served from memory.</p>
<p style="text-align:left;"><a href="http://comsysto.files.wordpress.com/2013/03/cassandra_read_db.jpeg"><img class="alignnone size-full wp-image-2476" alt="cassandra_read_db" src="http://comsysto.files.wordpress.com/2013/03/cassandra_read_db.jpeg?w=625"   /></a></p>
<p style="text-align:left;"><a href="http://comsysto.files.wordpress.com/2013/03/cassandra_read_sstable.jpeg"><img class="alignnone size-full wp-image-2477" alt="cassandra_read_sstable" src="http://comsysto.files.wordpress.com/2013/03/cassandra_read_sstable.jpeg?w=625"   /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/comsysto.wordpress.com/2475/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/comsysto.wordpress.com/2475/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.comsysto.com&#038;blog=8304660&#038;post=2475&#038;subd=comsysto&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.comsysto.com/2013/03/28/cassandra-1-1-reading-and-writing-from-sstable-perspecitve/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/18903cf65c943cc0a532aeb63e9b51fe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">maciejmiklas</media:title>
		</media:content>

		<media:content url="http://comsysto.files.wordpress.com/2013/03/cassandra_read_db.jpeg" medium="image">
			<media:title type="html">cassandra_read_db</media:title>
		</media:content>

		<media:content url="http://comsysto.files.wordpress.com/2013/03/cassandra_read_sstable.jpeg" medium="image">
			<media:title type="html">cassandra_read_sstable</media:title>
		</media:content>
	</item>
		<item>
		<title>Ubercharts  live charts with  Wicket 6 and Websockets</title>
		<link>http://blog.comsysto.com/2013/03/22/ubercharts-live-charts-with-wicket-6-and-websockets/</link>
		<comments>http://blog.comsysto.com/2013/03/22/ubercharts-live-charts-with-wicket-6-and-websockets/#comments</comments>
		<pubDate>Fri, 22 Mar 2013 11:34:39 +0000</pubDate>
		<dc:creator>lukaleovac</dc:creator>
				<category><![CDATA[Data Science]]></category>
		<category><![CDATA[Frontend Development]]></category>
		<category><![CDATA[Lean Java]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Ubercharts]]></category>
		<category><![CDATA[Web 3.0]]></category>
		<category><![CDATA[Apache Wicket]]></category>
		<category><![CDATA[web 3.0]]></category>

		<guid isPermaLink="false">http://blog.comsysto.com/?p=2235</guid>
		<description><![CDATA[Today we want you to show how you can provide live tracking charts for Web-based dashboards. This small showcase Application is based on Wicket 6, Wicket Websockets and Ubercharts. Just imagine you are running a high-frequency Webshop and you released new Features. And you want to see the feedback what have this features bring to [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.comsysto.com&#038;blog=8304660&#038;post=2235&#038;subd=comsysto&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Today we want you to show how you can provide <strong>live tracking charts</strong> for Web-based <strong>dashboards</strong>. This small showcase Application is based on <a title="Apache Wicket " href="http://wicket.apache.org/" target="_blank">Wicket 6</a>, <strong><a title="Wicket Websockets" href="https://cwiki.apache.org/confluence/display/WICKET/Wicket+Native+WebSockets" target="_blank">Wicket Websockets</a></strong> and <strong><a title="Ubercharts Wiki" href="http://code.google.com/p/ubercharts/" target="_blank">Ubercharts</a></strong>.</p>
<p>Just imagine you are running a high-frequency Webshop and you released new Features. And you want to see the feedback what have this features bring to you as soon as possible. Normally you have to wait up to 24h to get the the <strong>reports</strong> generated through your Business Intelligence Tools. To get reports immediately you have to provide dashboards which updates themselves automatically and which are available from everywhere. This requirements we solved with Wicket a Java Webframework for building Websites and <strong><a title="Uberchart Wiki" href="http://code.google.com/p/ubercharts/" target="_blank">Ubercharts</a></strong>. <a title="Uberchart Wiki" href="http://code.google.com/p/ubercharts/" target="_blank">Ubercharts</a> is meant to be a tiny wrapper for apache wicket framework around the <strong><a title="Highcharts Website" href="http://www.highcharts.com/" target="_blank">highcharts</a></strong> javascript library. The communication between the Wicket and Live Ubercharts will be provided by Wicket Websockets. In this post we show only the frontend part, not the backend part with saving tracking events.</p>
<p>Run the demo:</p>
<ol>
<li>Clone GitHub Repo: git clone <a title="Ubercharts Repo " href="https://github.com/comsysto/Ubercharts" target="_blank">git@github.com:comsysto/Ubercharts.git</a></li>
<li>Go to the Ubercharts folder : cd Ubercharts</li>
<li>git checkout wicketWebSockets</li>
<li>gradle idea / gradle eclipse</li>
<li>In IntelliJ IDEA or Eclipse open com.comsysto.runner.Start</li>
<li>Start the main class</li>
</ol>
<div id="attachment_2238" class="wp-caption aligncenter" style="width: 390px"><a title="Uberchart Bar Chart after running the application" href="http://comsysto.files.wordpress.com/2013/03/1666364.png"><img class="size-large wp-image-2238" title="Uberchart  Bar Chart" alt="Uebercharts Bar Diagram" src="http://comsysto.files.wordpress.com/2013/03/1666364.png?w=380&#038;h=363" width="380" height="363" /></a><p class="wp-caption-text">After running Ubercharts sample Application with websockets it&#8217;s should look like this</p></div>
<p style="text-align:center;">What should you see at the end :</p>
<p>Relevant Java Classes Diagram:</p>
<div id="attachment_2239" class="wp-caption aligncenter" style="width: 635px"><a href="http://comsysto.files.wordpress.com/2013/03/diagram.jpg"><img class="size-full wp-image-2239 " title="Class Diagram " alt="Live Charts Diagram" src="http://comsysto.files.wordpress.com/2013/03/diagram.jpg?w=625&#038;h=447" width="625" height="447" /></a><p class="wp-caption-text">Java Class Diagram for Uberchart Websockets example application</p></div>
<p>The Webapplication starts with a <a title="Demo Page sources on GitHub" href="https://github.com/comsysto/Ubercharts/blob/wicketWebSockets/example-page/src/main/java/com/comsysto/ubercharts/ui/DemoPage.java" target="_blank">DemoPage.java</a> which only creates the <a title="Demo Page sources on GitHub" href="https://github.com/comsysto/Ubercharts/blob/wicketWebSockets/example-page/src/main/java/com/comsysto/ubercharts/ui/model/DownloadChartModel.java" target="_blank">DownloadChartModel.java</a> and transfer it to the <a title="Ubercharts Live Charting on GitHub" href="https://github.com/comsysto/Ubercharts/blob/wicketWebSockets/example-page/src/main/java/com/comsysto/ubercharts/ui/panel/DownloadsChartPanel.java" target="_blank">DownloadChartPanel.java</a> class which handles the <strong>Websockets communication</strong> between server and the browser.</p>
<p><a title="Ubercharts on GitHub" href="https://github.com/comsysto/Ubercharts/blob/wicketWebSockets/example-page/src/main/java/com/comsysto/ubercharts/ui/model/DownloadChartModel.java" target="_blank">DownloadChartModel.java</a> creates the charts with the Uberchart library, for initialize and show the chart is the initChart() method enough. As you can see we initialize the Series with emtyArray, because the data will bee update through Websockets in the <a title="Ubercharts Live Charting on GitHub" href="https://github.com/comsysto/Ubercharts/blob/wicketWebSockets/example-page/src/main/java/com/comsysto/ubercharts/ui/panel/DownloadsChartPanel.java" target="_blank">DownloadChartPanel.java</a> class.</p>
<pre class="brush: java; title: ; notranslate">
private Highchart initChart() {

        Number[] emptyArray = {};
        ISeries&lt;Number[]&gt; rock = new NumberSeries(
                   MusikGenre.ROCK.getName()).setData(emptyArray);
        ISeries&lt;Number[]&gt; urban = new NumberSeries(
                   MusikGenre.URBAN.getName()).setData(emptyArray).setVisible(false);
        ......

        Highchart highchart = new Highchart(new BarChart(),
                           rock, pop, urban, electronic, bluesJazz);
        return highchart;
    }
</pre>
<p>For the Websocket communication we have to set events for the charts. The update events we add through highchart.getChart().getEvents().setLoad(getScript()); method the javascript file <a title="Ubercharts on GitHub" href="https://github.com/comsysto/Ubercharts/blob/wicketWebSockets/example-page/src/main/java/com/comsysto/ubercharts/ui/panel/DownloadsChartPanel.js" target="_blank">DownloadsChartPanel.js</a>. This javascript file <strong>subscribes</strong> for <strong>Websocket</strong> messages and updates the <strong>chart</strong>:</p>
<pre class="brush: jscript; title: ; notranslate">
   Wicket.Event.subscribe(&quot;/websocket/open&quot;, function(jqEvent) {
        // show the initial state of the chart
    });

    Wicket.Event.subscribe(&quot;/websocket/message&quot;, function(jqEvent, message) {
        // new record is pushed by the server
        var record = jQuery.parseJSON(message);
        if (record) {
            if(record.type == '${messageType}'){
                columnChartUpdate(record.data, record.dataName);
            }
            if(record.type == '${messageSeriesType}'){
                columnChartCategoriesUpdate(record.data, record.dataName);
            }
        }

    });
</pre>
<p>Websockets handling is initialized in the <a href="https://github.com/comsysto/Ubercharts/blob/wicketWebSockets/example-page/src/main/java/com/comsysto/ubercharts/ui/panel/DownloadsChartPanel.java" target="_blank">DownloadChartPanel.java</a> inner class <strong>ChartUpdatingBehavior</strong>. This inner class creates an <a title="Ubercharts on GitHub" href="https://github.com/comsysto/Ubercharts/blob/wicketWebSockets/example-page/src/main/java/com/comsysto/ubercharts/ui/socket/UpdateTask.java" target="_blank">UpdateTask.java</a> which handles the <strong>WebSocketsConnectionRegistry</strong> and the connection handling in a separate thread:</p>
<pre class="brush: java; title: ; notranslate">
@Override
public void run() {
  IWebSocketConnectionRegistry webSocketConnectionRegistry =
                              new SimpleWebSocketConnectionRegistry();
     while (true) {
       Application application = Application.get(applicationName);
       IWebSocketConnection connection = webSocketConnectionRegistry.
                           getConnection(application, sessionId, pageId);
         if (connection == null || !connection.isOpen()) {
           // stop if the web socket connection is closed
             return;
         }

         try {
           updateFunction(connection);
           // sleep for a while to simulate work
           TimeUnit.SECONDS.sleep(1);
         } catch (Exception x) {
           x.printStackTrace();
           return;
        }
     }
  }
</pre>
<p>In DownloadChartPanel we have to implement  UpdateTask abstract method updateFunction() in order to update update Chart with new data. UpdateTask sends every second a message with the new values for the chart in the updateFunction() method. The Data is here generated random in the method getDownloads(), there should be a DB or Service call instead for real data. This <strong>Websocket Message</strong> will bee handled from chart events javascript functions which are loaded in <a title="Ubercharts on GitHub" href="https://github.com/comsysto/Ubercharts/blob/wicketWebSockets/example-page/src/main/java/com/comsysto/ubercharts/ui/model/DownloadChartModel.java">DownloadChartModel.java</a>.</p>
<pre class="brush: java; title: ; notranslate">
private class ChartUpdatingBehavior extends WebSocketBehavior {
  @Override
  protected void onConnect(ConnectedMessage message) {
     super.onConnect(message);
     // create an asynchronous task that will write the data to the client
     UpdateTask updateTask = new UpdateTask(message.getApplication(),
                message.getSessionId(), message.getPageId()) {
        @Override
        protected void updateFunction(IWebSocketConnection connection)
                                                     throws IOException {
            ObjectMapper objectMapper = new ObjectMapper();
            Message&lt;Number[] &gt; message = new Message&lt;Number[]&gt;(
              MessageType.SERIES_UPDATE,selectedGenreType.name(), getDownloads());
            String json = objectMapper.writeValueAsString(message);
            connection.sendMessage(json);
        }
    };
 Executors.newScheduledThreadPool(1).schedule(updateTask, 1, TimeUnit.SECONDS);
}
</pre>
<p>So now we have one way communication from the Server to the Client. Now we want to change the Music genre in the webfronted with a click on the Chart Legend. For that we add in the ChartModel the <a title="Ubercharts on GitHub" href="https://github.com/comsysto/Ubercharts/blob/wicketWebSockets/example-page/src/main/java/com/comsysto/ubercharts/ui/panel/ChartCategorySwitch.js">ChartCategorySwitch.js</a> which is called on chart click function. The Script sends <strong>Wicket.Websocket</strong> message to the Server with the name of the selected genre.</p>
<pre class="brush: jscript; title: ; notranslate">
function productSwitchUpdate (event) {
    var selected = this.index;
    var allSeries = this.chart.series;
    $.each(allSeries, function(index, series) {
      if(selected == index ){
        series.show() ;
        var message='{&quot;type&quot;:&quot;'+'${messageType}'+'&quot;,&quot;dataName&quot;:&quot;'+series.name+'&quot;}'
        Wicket.WebSocket.send(message);
      }else{
        series.hide();
      }
   });
   return false;
}
</pre>
<p>The Server hadles the click-message in the DownloadsChartPanel.java getWebSocketBehaviorForClicks() method. This method Listens for Websockets Messages and when a GENRE_UPDATE Message comes in selectedGenreType will be set. When a Websocket message will be pushed back to the chart with the new categories names.</p>
<pre class="brush: java; title: ; notranslate">
private Behavior getWebSocketBehaviorForClicks() {
  return new WebSocketBehavior() {
    @Override
    protected void onMessage(WebSocketRequestHandler handler,TextMessage message){
      try{
        ObjectMapper objectMapper = new ObjectMapper();
        Message parsedMsg = objectMapper.readValue(message.getText(),
                     new TypeReference() {});
        if (parsedMsg.getType() == MessageType.GENRE_UPDATE){
           selectedGenreType = MusikGenre.valueOf(
                         parsedMsg.getDataName().toUpperCase());
           Message&lt;String[]&gt; msg = new Message&lt;String[]&gt;(
                         MessageType.CATEGORIES_UPDATE,selectedGenreType.name(),
                         musikGenreMap.get(selectedGenreType));
           String json = objectMapper.writeValueAsString(msg);
           handler.push(json);
        }
    } catch (IOException e) {
       e.printStackTrace();
    }
  }
};
}
</pre>
<p>While developing  we have some problems to get it running in <strong>Jetty</strong> and <strong>Tomcat</strong> with the same war file. For fixing it you have to add dependencies in the build.gradle file:</p>
<pre class="brush: groovy; title: ; notranslate">
  &quot;org.apache.wicket:wicket-native-websocket-jetty:0.6&quot;,
  &quot;org.apache.wicket:wicket-native-websocket-tomcat:0.6&quot;,
</pre>
<p>and also add a filter in web.xml file:</p>
<pre class="brush: xml; title: ; notranslate">
   //ENABLE WHEN JETTY
   &lt;filter-class&gt;org.apache.wicket.protocol.ws.jetty.Jetty7WebSocketFilter&lt;/filter-class&gt;
   //ENABLE WHEN TOMCAT
   &lt;filter-class&gt;org.apache.wicket.protocol.ws.tomcat7.Tomcat7WebSocketFilter&lt;/filter-class&gt;
</pre>
<p>Next steps are migrating it to jetty 9 and add some Wrapper for <strong>Ubercharts</strong> to easier add Updating tasks.</p>
<p>If you have any feedback, please write to <a href="mailto:luka.leovac@comsysto.com">luka.leovac@comsysto.com</a> or <a href="mailto:alen.tolj@comsysto.com">alen.tolj@comsysto.com</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/comsysto.wordpress.com/2235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/comsysto.wordpress.com/2235/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.comsysto.com&#038;blog=8304660&#038;post=2235&#038;subd=comsysto&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.comsysto.com/2013/03/22/ubercharts-live-charts-with-wicket-6-and-websockets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/056bb6f7f566343e3a2aaed9ed434598?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lukaleovac</media:title>
		</media:content>

		<media:content url="http://comsysto.files.wordpress.com/2013/03/1666364.png?w=380" medium="image">
			<media:title type="html">Uberchart  Bar Chart</media:title>
		</media:content>

		<media:content url="http://comsysto.files.wordpress.com/2013/03/diagram.jpg" medium="image">
			<media:title type="html">Class Diagram </media:title>
		</media:content>
	</item>
		<item>
		<title>DevOpsDays London 2013 Roundup</title>
		<link>http://blog.comsysto.com/2013/03/20/devopsdays-london-2013-roundup/</link>
		<comments>http://blog.comsysto.com/2013/03/20/devopsdays-london-2013-roundup/#comments</comments>
		<pubDate>Wed, 20 Mar 2013 10:38:20 +0000</pubDate>
		<dc:creator>jbrandstettercs</dc:creator>
				<category><![CDATA[Continuous Delivery]]></category>
		<category><![CDATA[Events & Fun]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[devops]]></category>

		<guid isPermaLink="false">http://blog.comsysto.com/?p=2436</guid>
		<description><![CDATA[I had the pleasure to visit this year&#8217;s DevOpsDays Conference in London. DevOpsDays is still a very small conference very much focused on communication between participants. This means that about half of the time is assigned to so called &#8220;Open Space&#8221; sessions. These sessions allow all attendees to suggest topics that are import to them [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.comsysto.com&#038;blog=8304660&#038;post=2436&#038;subd=comsysto&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I had the pleasure to visit this year&#8217;s <a href="http://devopsdays.org/events/2013-london/">DevOpsDays</a> Conference in London. DevOpsDays is still a very small conference very much focused on communication between participants. This means that about half of the time is assigned to so called &#8220;<a href="http://en.wikipedia.org/wiki/Open-space_technology">Open Space</a>&#8221; sessions. These sessions allow all attendees to suggest topics that are import to them which can then be discussed with whoever is interested in the topic.</p>
<p>My two favorite talks were:</p>
<p><a href="http://devopsdays.org/events/2013-london/proposals/TraditionalEnterprise/"><strong>DEVOPS and the traditional enterprise IT &#8211; Opposites and the best of two worlds</strong></a> by our friends from <a href="http://www.payback.de/">Payback</a><strong></strong></p>
<p><a href="http://blog.comsysto.com/2013/03/20/devopsdays-london-2013-roundup/2013-03-16-10-49-24/" rel="attachment wp-att-2437"><img class="alignnone size-large wp-image-2437" alt="2013-03-16 10.49.24" src="http://comsysto.files.wordpress.com/2013/03/2013-03-16-10-49-24.jpg?w=380&#038;h=285" width="380" height="285" /></a></p>
<p><strong><a href="http://devopsdays.org/events/2013-london/proposals/MaximizingFlow/">Lessons Learned From Manufacturing For Maximizing Flow From Dev To Ops</a></strong> by the always inspiring <a href="http://www.realgenekim.me/">Gene Kim</a></p>
<p><a href="http://blog.comsysto.com/2013/03/20/devopsdays-london-2013-roundup/2013-03-16-12-17-03/" rel="attachment wp-att-2438"><img class="alignnone size-large wp-image-2438" alt="2013-03-16 12.17.03" src="http://comsysto.files.wordpress.com/2013/03/2013-03-16-12-17-03.jpg?w=380&#038;h=285" width="380" height="285" /></a></p>
<p>Gene also wrote a great <a href="http://scribes.tweetscriber.com/RealGeneKim/114">transcript</a> of the whole conference.</p>
<p>As on any conference there were also a lot of sponsor booths. From all the products advertised <a href="http://www.datadoghq.com/">DataDog</a>&#8216;s monitoring service really impressed me. Amit from DataDog gave me a great introduction to their product and I&#8217;m already using it actively.</p>
<p><a href="http://blog.comsysto.com/2013/03/20/devopsdays-london-2013-roundup/screen-shot-2013-03-20-at-10-46-16-am/" rel="attachment wp-att-2462"><img class="alignnone size-large wp-image-2462" alt="Screen Shot 2013-03-20 at 10.46.16 AM" src="http://comsysto.files.wordpress.com/2013/03/screen-shot-2013-03-20-at-10-46-16-am.png?w=380&#038;h=171" width="380" height="171" /></a></p>
<p>I left after two days with bags full of swag and lots of new ideas and insights. If you have any interest in the DevOps movement I suggest you visit one of the <a href="http://devopsdays.org/">upcoming</a> DevOpsDays!</p>
<p>If you&#8217;re looking for some destraction in the meantime I&#8217;d suggest you watch this and sing along:  <a href="http://www.youtube.com/watch?v=oIu15zIsjQg">http://www.youtube.com/watch?v=oIu15zIsjQg</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/comsysto.wordpress.com/2436/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/comsysto.wordpress.com/2436/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.comsysto.com&#038;blog=8304660&#038;post=2436&#038;subd=comsysto&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.comsysto.com/2013/03/20/devopsdays-london-2013-roundup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/14fa01f5630b5becf6a20b33fd7f790b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jbrandstettercs</media:title>
		</media:content>

		<media:content url="http://comsysto.files.wordpress.com/2013/03/2013-03-16-10-49-24.jpg?w=380" medium="image">
			<media:title type="html">2013-03-16 10.49.24</media:title>
		</media:content>

		<media:content url="http://comsysto.files.wordpress.com/2013/03/2013-03-16-12-17-03.jpg?w=380" medium="image">
			<media:title type="html">2013-03-16 12.17.03</media:title>
		</media:content>

		<media:content url="http://comsysto.files.wordpress.com/2013/03/screen-shot-2013-03-20-at-10-46-16-am.png?w=380" medium="image">
			<media:title type="html">Screen Shot 2013-03-20 at 10.46.16 AM</media:title>
		</media:content>
	</item>
		<item>
		<title>Neue Fortbildungs-Kooperation mit Gradleware</title>
		<link>http://blog.comsysto.com/2013/03/14/neue-fortbildungs-kooperation-mit-gradleware/</link>
		<comments>http://blog.comsysto.com/2013/03/14/neue-fortbildungs-kooperation-mit-gradleware/#comments</comments>
		<pubDate>Thu, 14 Mar 2013 14:19:06 +0000</pubDate>
		<dc:creator>dianaknezevic</dc:creator>
				<category><![CDATA[Events & Fun]]></category>
		<category><![CDATA[Gradle]]></category>
		<category><![CDATA[Groovy]]></category>
		<category><![CDATA[Lean Java]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Gradleware]]></category>
		<category><![CDATA[Lightweight]]></category>

		<guid isPermaLink="false">http://blog.comsysto.com/?p=2326</guid>
		<description><![CDATA[Es gibt Neuigkeiten aus der Rubrik Partnerschaften und Kooperationen! Anfang dieses Jahres haben wir eine Kooperation mit Gradleware gestartet. Konkret bedeutet das, dass bis Ende des Jahres mehrere öffentliche „in-depth“ Gradle Trainings im comSysto Headquarter stattfinden werden. Diese dreitägigen &#8220;in-depth&#8221; Intensivkurse statten den Teilnehmer durch kleine, informative Hands-on-Module mit modernstem Know-how für Gradle-basierte Projektautomatisierung aus. Mit [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.comsysto.com&#038;blog=8304660&#038;post=2326&#038;subd=comsysto&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<div id="attachment_2332" class="wp-caption alignleft" style="width: 234px"><a href="http://www.gradleware.com/training"><img class=" wp-image-2332   " alt="indepth Gradle Training @ comSysto" src="http://comsysto.files.wordpress.com/2013/03/gradleware-logo.png?w=224&#038;h=39" width="224" height="39" /></a><p class="wp-caption-text">in depth Gradle Training @ comSysto</p></div>
<p>Es gibt Neuigkeiten aus der Rubrik Partnerschaften und Kooperationen! Anfang dieses Jahres haben wir eine Kooperation mit <b><a href="http://www.gradleware.com/consulting" target="_blank">Gradleware</a> </b>gestartet. Konkret bedeutet das, dass bis Ende des Jahres <strong>mehrere öffentliche „in-depth“ Gradle Trainings im </strong><b><a title="comSysto GmbH" href="http://www.comsysto.com" target="_blank">comSysto</a> Headquarter</b> stattfinden werden. Diese dreitägigen &#8220;in-depth&#8221; Intensivkurse statten den Teilnehmer durch kleine, informative Hands-on-Module mit modernstem Know-how für Gradle-basierte Projektautomatisierung aus. Mit der Kombination aus Convention over Configuration und der mächtigen Sprache Groovy ist Gradle für uns zweifellos &#8220;A Better Way To Build&#8221;.</p>
<p>Der erste <b>Trainingstermin</b> steht bereits fest. Vom <b>9. bis zum 11. April</b> wird Ihnen beigebracht, wie man das Gradle Build-System optimal nutzt. Trainer wird Gradle Core Developer <strong><a href="http://gradlesummit.com/conference/santa_clara/2013/06/speakers/rene_groeschke" target="_blank">René Gröschke</a> </strong>sein. Sämtliche Informationen zum Ablauf des Trainings finden Sie <strong><a href="http://www.gradleware.com/training?__hstc=4004975.bbef060463a5874900a886d7721e2d34.1357288910769.1360661896689.1360675760914.18&amp;__hssc=4004975.6.1360675760914#in-depth" target="_blank">hier.</a></strong></p>
<p>Schnellentschlossene können <strong>bis zum 22. März mit Frühbucherrabatt</strong> buchen für 1.645€. Der reguläre Preis für dieses 3-tägige Public Training beläuft sich auf 1.795€. Hier geht es direkt zur <strong><a href="http://www.regonline.com/builder/site/Default.aspx?EventID=1199565">Anmeldung.</a></strong></p>
<p><strong></strong>Das Training findet in Deutsch statt, die Unterlagen sind auf Englisch. Für die Verpflegung ist gesorgt. Weitere Trainings sind für das dritte und vierte Quartal in Planung. Nähere Informationen hierzu werden noch rechtzeitig folgen.</p>
<p><strong>Kontakt für Fragen zum Training:</strong><br />
Gradleware<br />
T +49-30-609886880<br />
<a href="mailto:training@gradleware.com">training@gradleware.com</a></p>
<p><strong>Kontakt für Fragen rund um die Organisation:</strong><br />
comSysto<br />
T + 49 89 550604588<br />
<a href="mailto:office@comsysto.com">office@comsysto.com</a></p>
<p>Zusätzlich zum Training veranstalten wir am zweiten Schulungsabend ein <a href="http://www.meetup.com/Lightweight-Java-User-Group-Munchen/events/104581192/"><b>Meetup</b> </a>zu dem wir hiermit herzlich einladen. In unserer <strong><a href="http://www.meetup.com/Lightweight-Java-User-Group-Munchen/" target="_blank">Lightweight Java User Group</a></strong> haben wir das <strong>Meetup</strong> bereits für den 10. April angekündigt. Thematisch wird es um folgendes gehen:</p>
<p><b>&#8220;Gradle &amp; and the new Android build System&#8221;</b></p>
<p>We will talk about the upcoming Gradle based Build System for the Android SDK that uses proper dependency management and allows for bundle distributions of Libraries. We will present and demo what already has been developed and discuss the roadmap and how the new build system will be rolled out. We will also introduce Gradle as such with a special focus on the new generic features that have been developed as part of the Android effort like an more generic dependency management and the concept of variants of a library for different platforms. We will show how these new features are extremely useful for other non-java based platforms like Javascript, Scala and C++.</p>
<p>Termin: <strong>10. April 2013</strong><br />
Uhrzeit: <strong>ab 19 Uhr</strong><br />
Ort: comSysto Headquarter, Lindwurmstr. 97, München</p>
<p><a href="http://de.wikipedia.org/wiki/Gradle"><strong>Gradle</strong> </a>ist ein auf Java basierendes Build-Management-Automatisierungs-Tool, vergleichbar mit Apache Ant und Apache Maven. Anders als bei diesen Tools wird jedoch keine XML-Projektbeschreibung genutzt (build.xml oder pom.xml), sondern eine auf Groovy basierende Domain Specific Language (DSL) zur Beschreibung der zu bauenden Projekte. Damit sind Gradle-Skripte direkt ausführbarer Code. Gradle&#8217;s Konzept will damit die Flexibilität von Ant mit der &#8220;build-by-convention&#8221;-Strategie von Maven zusammenbringen.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/comsysto.wordpress.com/2326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/comsysto.wordpress.com/2326/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.comsysto.com&#038;blog=8304660&#038;post=2326&#038;subd=comsysto&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.comsysto.com/2013/03/14/neue-fortbildungs-kooperation-mit-gradleware/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/25953230d37d79363d17aee1fe402dbc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dianaknezevic</media:title>
		</media:content>

		<media:content url="http://comsysto.files.wordpress.com/2013/03/gradleware-logo.png" medium="image">
			<media:title type="html">indepth Gradle Training @ comSysto</media:title>
		</media:content>
	</item>
	</channel>
</rss>
