blob: 8637ada6d79edaccaa819453c2a1fe902316511c [file] [log] [blame]
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Apache Flink 0.9.0 Documentation: Type Extraction and Serialization</title>
<link rel="shortcut icon" href="http://flink.apache.org/docs/0.9/page/favicon.ico" type="image/x-icon">
<link rel="icon" href="http://flink.apache.org/docs/0.9/page/favicon.ico" type="image/x-icon">
<!-- Bootstrap -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<link rel="stylesheet" href="http://flink.apache.org/docs/0.9/page/css/flink.css">
<link rel="stylesheet" href="http://flink.apache.org/docs/0.9/page/css/syntax.css">
<link rel="stylesheet" href="http://flink.apache.org/docs/0.9/page/css/codetabs.css">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<!-- Top navbar. -->
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<!-- The logo. -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="navbar-logo">
<a href="http://flink.apache.org"><img alt="Apache Flink" src="http://flink.apache.org/docs/0.9/page/img/navbar-brand-logo.jpg"></a>
</div>
</div><!-- /.navbar-header -->
<!-- The navigation links. -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="http://flink.apache.org/docs/0.9/index.html">Overview<span class="hidden-sm hidden-xs"> 0.9.0</span></a></li>
<!-- Setup -->
<li class="dropdown">
<a href="http://flink.apache.org/docs/0.9/setup" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Setup <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="http://flink.apache.org/docs/0.9/setup/building.html">Get Flink 0.9-SNAPSHOT</a></li>
<li class="divider"></li>
<li role="presentation" class="dropdown-header"><strong>Deployment</strong></li>
<li><a href="http://flink.apache.org/docs/0.9/setup/local_setup.html" class="active">Local</a></li>
<li><a href="http://flink.apache.org/docs/0.9/setup/cluster_setup.html">Cluster (Standalone)</a></li>
<li><a href="http://flink.apache.org/docs/0.9/setup/yarn_setup.html">YARN</a></li>
<li><a href="http://flink.apache.org/docs/0.9/setup/gce_setup.html">GCloud</a></li>
<li><a href="http://flink.apache.org/docs/0.9/setup/flink_on_tez.html">Flink on Tez <span class="badge">Beta</span></a></li>
<li class="divider"></li>
<li><a href="http://flink.apache.org/docs/0.9/setup/config.html">Configuration</a></li>
</ul>
</li>
<!-- Programming Guides -->
<li class="dropdown">
<a href="http://flink.apache.org/docs/0.9/apis" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Programming Guides <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="http://flink.apache.org/docs/0.9/apis/programming_guide.html"><strong>Batch: DataSet API</strong></a></li>
<li><a href="http://flink.apache.org/docs/0.9/apis/streaming_guide.html"><strong>Streaming: DataStream API</strong> <span class="badge">Beta</span></a></li>
<li><a href="http://flink.apache.org/docs/0.9/apis/python.html">Python API <span class="badge">Beta</span></a></li>
<li class="divider"></li>
<li><a href="scala_shell.html">Interactive Scala Shell</a></li>
<li><a href="http://flink.apache.org/docs/0.9/apis/dataset_transformations.html">Dataset Transformations</a></li>
<li><a href="http://flink.apache.org/docs/0.9/apis/best_practices.html">Best Practices</a></li>
<li><a href="http://flink.apache.org/docs/0.9/apis/example_connectors.html">Connectors</a></li>
<li><a href="http://flink.apache.org/docs/0.9/apis/examples.html">Examples</a></li>
<li><a href="http://flink.apache.org/docs/0.9/apis/local_execution.html">Local Execution</a></li>
<li><a href="http://flink.apache.org/docs/0.9/apis/cluster_execution.html">Cluster Execution</a></li>
<li><a href="http://flink.apache.org/docs/0.9/apis/cli.html">Command Line Interface</a></li>
<li><a href="http://flink.apache.org/docs/0.9/apis/web_client.html">Web Client</a></li>
<li><a href="http://flink.apache.org/docs/0.9/apis/iterations.html">Iterations</a></li>
<li><a href="http://flink.apache.org/docs/0.9/apis/java8.html">Java 8</a></li>
<li><a href="http://flink.apache.org/docs/0.9/apis/hadoop_compatibility.html">Hadoop Compatability <span class="badge">Beta</span></a></li>
</ul>
</li>
<!-- Libraries -->
<li class="dropdown">
<a href="http://flink.apache.org/docs/0.9/libs" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Libraries <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="http://flink.apache.org/docs/0.9/libs/spargel_guide.html">Graphs: Spargel</a></li>
<li><a href="http://flink.apache.org/docs/0.9/libs/gelly_guide.html">Graphs: Gelly <span class="badge">Beta</span></a></li>
<li><a href="http://flink.apache.org/docs/0.9/libs/ml/">Machine Learning <span class="badge">Beta</span></a></li>
<li><a href="http://flink.apache.org/docs/0.9/libs/table.html">Relational: Table <span class="badge">Beta</span></a></li>
</ul>
</li>
<!-- Internals -->
<li class="dropdown">
<a href="http://flink.apache.org/docs/0.9/internals" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Internals <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li role="presentation" class="dropdown-header"><strong>Contribute</strong></li>
<li><a href="http://flink.apache.org/docs/0.9/internals/how_to_contribute.html">How to Contribute</a></li>
<li><a href="http://flink.apache.org/docs/0.9/internals/coding_guidelines.html">Coding Guidelines</a></li>
<li><a href="http://flink.apache.org/docs/0.9/internals/ide_setup.html">IDE Setup</a></li>
<li><a href="http://flink.apache.org/docs/0.9/internals/logging.html">Logging</a></li>
<li class="divider"></li>
<li role="presentation" class="dropdown-header"><strong>Internals</strong></li>
<li><a href="http://flink.apache.org/docs/0.9/internals/general_arch.html">Architecture &amp; Process Model</a></li>
<li><a href="http://flink.apache.org/docs/0.9/internals/types_serialization.html">Type Extraction &amp; Serialization</a></li>
<li><a href="http://flink.apache.org/docs/0.9/internals/job_scheduling.html">Jobs &amp; Scheduling</a></li>
<li><a href="http://flink.apache.org/docs/0.9/internals/add_operator.html">How-To: Add an Operator</a></li>
</ul>
</li>
</ul>
<form class="navbar-form navbar-right hidden-sm hidden-md" role="search" action="http://flink.apache.org/docs/0.9/search-results.html">
<div class="form-group">
<input type="text" class="form-control" name="q" placeholder="Search all pages">
</div>
<button type="submit" class="btn btn-default">Search</button>
</form>
</div><!-- /.navbar-collapse -->
</div><!-- /.container -->
</nav>
<!-- Main content. -->
<div class="container">
<div class="row">
<div class="col-sm-10 col-sm-offset-1">
<h1>Type Extraction and Serialization</h1>
<p>Flink handles types in a unique way, containing its own type descriptors,
generic type extraction, and type serialization framework.
This document describes the concepts and the rationale behind them.</p>
<p>There are fundamental differences in the way that the Scala API and
the Java API handle type information, so most of the issues described
here relate only to one of the to APIs.</p>
<ul id="markdown-toc">
<li><a href="#type-handling-in-flink" id="markdown-toc-type-handling-in-flink">Type handling in Flink</a></li>
<li><a href="#flinks-typeinformation-class" id="markdown-toc-flinks-typeinformation-class">Flink’s TypeInformation class</a></li>
<li><a href="#type-information-in-the-scala-api" id="markdown-toc-type-information-in-the-scala-api">Type Information in the Scala API</a></li>
<li><a href="#type-information-in-the-java-api" id="markdown-toc-type-information-in-the-java-api">Type Information in the Java API</a></li>
</ul>
<h2 id="type-handling-in-flink">Type handling in Flink</h2>
<p>Flink tries to know as much information about what types enter and leave user functions as possible.
This stands in contrast to the approach to just assuming nothing and letting the
programming language and serialization framework handle all types dynamically.</p>
<ul>
<li>
<p>To allow using POJOs and grouping/joining them by referring to field names, Flink needs the type
information to make checks (for typos and type compatibility) before the job is executed.</p>
</li>
<li>
<p>The more we know, the better serialization and data layout schemes the compiler/optimizer can develop.
That is quite important for the memory usage paradigm in Flink (work on serialized data
inside/outside the heap and make serialization very cheap).</p>
</li>
<li>
<p>For the upcoming logical programs (see roadmap draft) we need this to know the “schema” of functions.</p>
</li>
<li>
<p>Finally, it also spares users having to worry about serialization frameworks and having to register
types at those frameworks.</p>
</li>
</ul>
<h2 id="flinks-typeinformation-class">Flink’s TypeInformation class</h2>
<p>The class <a href="https://github.com/apache/flink/blob/master//flink-core/src/main/java/org/apache/flink/api/common/typeinfo/TypeInformation.java">TypeInformation</a>
is the base class for all type descriptors. It reveals some basic properties of the type and can generate serializers
and, in specializations, comparators for the types.
(<em>Note that comparators in Flink do much more than defining an order - they are basically the utility to handle keys</em>)</p>
<p>Internally, Flink makes the following distinctions between types:</p>
<ul>
<li>
<p>Basic types: All Java primitives and their boxed form, plus <code>void</code>, <code>String</code>, and <code>Date</code>.</p>
</li>
<li>
<p>Primitive arrays and Object arrays</p>
</li>
<li>
<p>Composite types</p>
<ul>
<li>
<p>Flink Java Tuples (part of the Flink Java API)</p>
</li>
<li>
<p>Scala <em>case classes</em> (including Scala tuples)</p>
</li>
<li>
<p>POJOs: classes that follow a certain bean-like pattern</p>
</li>
</ul>
</li>
<li>
<p>Scala auxiliary types (Option, Either, Lists, Maps, …)</p>
</li>
<li>
<p>Generic types: These will not be serialized by Flink itself, but by Kryo.</p>
</li>
</ul>
<p>POJOs are of particular interest, because they support the creation of complex types and the use of field
names in the definition of keys: <code>dataSet.join(another).where("name").equalTo("personName")</code>.
They are also transparent to the runtime and can be handled very efficiently by Flink.</p>
<p><strong>Rules for POJO types</strong></p>
<p>Flink recognizes a data type as a POJO type (and allows “by-name” field referencing) if the following
conditions are fulfilled:</p>
<ul>
<li>The class is public and standalone (no non-static inner class)</li>
<li>The class has a public no-argument constructor</li>
<li>All fields in the class (and all superclasses) are either public or
or have a public getter and a setter method that follows the Java beans
naming conventions for getters and setters.</li>
</ul>
<h2 id="type-information-in-the-scala-api">Type Information in the Scala API</h2>
<p>Scala has very elaborate concepts for runtime type information though <em>type manifests</em> and <em>class tags</em>. In
general, types and methods have access to the types of their generic parameters - thus, Scala programs do
not suffer from type erasure as Java programs do.</p>
<p>In addition, Scala allows to run custom code in the Scala Compiler through Scala Macros - that means that some Flink
code gets executed whenever you compile a Scala program written against Flink’s Scala API.</p>
<p>We use the Macros to look at the parameter types and return types of all user functions during compilation - that
is the point in time when certainly all type information is perfectly available. Within the macro, we create
a <em>TypeInformation</em> for the function’s return types (or parameter types) and make it part of the operation.</p>
<h4 id="no-implicit-value-for-evidence-parameter-error">No Implicit Value for Evidence Parameter Error</h4>
<p>In the case where TypeInformation could not be created, programs fail to compile with an error
stating <em>“could not find implicit value for evidence parameter of type TypeInformation”</em>.</p>
<p>A frequent reason if that the code that generates the TypeInformation has not been imported.
Make sure to import the entire flink.api.scala package.</p>
<div class="highlight"><pre><code class="language-scala" data-lang="scala"><span class="k">import</span> <span class="nn">org.apache.flink.api.scala._</span></code></pre></div>
<p>Another common cause are generic methods, which can be fixed as described in the following section.</p>
<h4 id="generic-methods">Generic Methods</h4>
<p>Consider the following case below:</p>
<div class="highlight"><pre><code class="language-scala" data-lang="scala"><span class="k">def</span><span class="o">[</span><span class="kt">T</span><span class="o">]</span> <span class="n">selectFirst</span><span class="o">(</span><span class="n">input</span><span class="k">:</span> <span class="kt">DataSet</span><span class="o">[(</span><span class="kt">T</span>, <span class="k">_</span><span class="o">)])</span> <span class="k">:</span> <span class="kt">DataSet</span><span class="o">[</span><span class="kt">T</span><span class="o">]</span> <span class="k">=</span> <span class="o">{</span>
<span class="n">input</span><span class="o">.</span><span class="n">map</span> <span class="o">{</span> <span class="n">v</span> <span class="k">=&gt;</span> <span class="n">v</span><span class="o">.</span><span class="n">_1</span> <span class="o">}</span>
<span class="o">}</span>
<span class="k">val</span> <span class="n">data</span> <span class="k">:</span> <span class="kt">DataSet</span><span class="o">[(</span><span class="kt">String</span>, <span class="kt">Long</span><span class="o">)</span> <span class="kt">=</span> <span class="kt">...</span>
<span class="kt">val</span> <span class="kt">result</span> <span class="kt">=</span> <span class="kt">selectFirst</span><span class="o">(</span><span class="kt">data</span><span class="o">)</span></code></pre></div>
<p>For such generic methods, the data types of the function parameters and return type may not be the same
for every call and are not known at the site where the method is defined. The code above will result
in an error that not enough implicit evidence is available.</p>
<p>In such cases, the type information has to be generated at the invocation site and passed to the
method. Scala offers <em>implicit parameters</em> for that.</p>
<p>The following code tells Scala to bring a type information for <em>T</em> into the function. The type
information will then be generated at the sites where the method is invoked, rather than where the
method is defined.</p>
<div class="highlight"><pre><code class="language-scala" data-lang="scala"><span class="k">def</span><span class="o">[</span><span class="kt">T</span> <span class="kt">:</span> <span class="kt">TypeInformation</span><span class="o">]</span> <span class="n">selectFirst</span><span class="o">(</span><span class="n">input</span><span class="k">:</span> <span class="kt">DataSet</span><span class="o">[(</span><span class="kt">T</span>, <span class="k">_</span><span class="o">)])</span> <span class="k">:</span> <span class="kt">DataSet</span><span class="o">[</span><span class="kt">T</span><span class="o">]</span> <span class="k">=</span> <span class="o">{</span>
<span class="n">input</span><span class="o">.</span><span class="n">map</span> <span class="o">{</span> <span class="n">v</span> <span class="k">=&gt;</span> <span class="n">v</span><span class="o">.</span><span class="n">_1</span> <span class="o">}</span>
<span class="o">}</span></code></pre></div>
<h2 id="type-information-in-the-java-api">Type Information in the Java API</h2>
<p>Java in general erases generic type information. Only for subclasses of generic classes, the subclass
stores the type to which the generic type variables bind.</p>
<p>Flink uses reflection on the (anonymous) classes that implement the user functions to figure out the types of
the generic parameters of the function. This logic also contains some simple type inference for cases where
the return types of functions are dependent on input types, such as in the generic utility method below:</p>
<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kd">public</span> <span class="kd">class</span> <span class="nc">AppendOne</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span> <span class="kd">extends</span> <span class="n">MapFunction</span><span class="o">&lt;</span><span class="n">T</span><span class="o">,</span> <span class="n">Tuple2</span><span class="o">&lt;</span><span class="n">T</span><span class="o">,</span> <span class="n">Long</span><span class="o">&gt;&gt;</span> <span class="o">{</span>
<span class="kd">public</span> <span class="n">Tuple2</span><span class="o">&lt;</span><span class="n">T</span><span class="o">,</span> <span class="n">Long</span><span class="o">&gt;</span> <span class="nf">map</span><span class="o">(</span><span class="n">T</span> <span class="n">value</span><span class="o">)</span> <span class="o">{</span>
<span class="k">return</span> <span class="k">new</span> <span class="n">Tuple2</span><span class="o">&lt;</span><span class="n">T</span><span class="o">,</span> <span class="n">Long</span><span class="o">&gt;(</span><span class="n">value</span><span class="o">,</span> <span class="mi">1L</span><span class="o">);</span>
<span class="o">}</span>
<span class="o">}</span></code></pre></div>
<p>Not in all cases can Flink figure out the data types of functions reliably in Java.
Some issues remain with generic lambdas (we are trying to solve this with the Java community,
see below) and with generic type variables that we cannot infer.</p>
<h4 id="type-hints-in-the-java-api">Type Hints in the Java API</h4>
<p>To help cases where Flink cannot reconstruct the erased generic type information, the Java API
offers so called <em>type hints</em> from version 0.9 on. The type hints tell the system the type of
the data set produced by a function. The following gives an example:</p>
<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">DataSet</span><span class="o">&lt;</span><span class="n">SomeType</span><span class="o">&gt;</span> <span class="n">result</span> <span class="o">=</span> <span class="n">dataSet</span>
<span class="o">.</span><span class="na">map</span><span class="o">(</span><span class="k">new</span> <span class="n">MyGenericNonInferrableFunction</span><span class="o">&lt;</span><span class="n">Long</span><span class="o">,</span> <span class="n">SomeType</span><span class="o">&gt;())</span>
<span class="o">.</span><span class="na">returns</span><span class="o">(</span><span class="n">SomeType</span><span class="o">.</span><span class="na">class</span><span class="o">);</span></code></pre></div>
<p>The <code>returns</code> statement specifies the produced type, in this case via a class. The hints support
type definition through</p>
<ul>
<li>Classes, for non-parameterized types (no generics)</li>
<li>Strings in the form of <code>returns("Tuple2&lt;Integer, my.SomeType&gt;")</code>, which are parsed and converted
to a TypeInformation.</li>
<li>A TypeInformation directly</li>
</ul>
<h4 id="type-extraction-for-java-8-lambdas">Type extraction for Java 8 lambdas</h4>
<p>Type extraction for Java 8 lambdas works differently than for non-lambdas, because lambdas are not associated
with an implementing class that extends the function interface.</p>
<p>Currently, Flink tries to figure out which method implements the lambda and uses Java’s generic signatures to
determine the parameter types and the return type. However, these signatures are not generated for lambdas
by all compilers (as of writing this document only reliably by the Eclipse JDT compiler 4.5 from Milestone 2
onwards)</p>
<p><strong>Improving Type information for Java Lambdas</strong></p>
<p>One of the Flink committers (Timo Walther) has actually become active in the Eclipse JDT compiler community and
in the OpenJDK community and submitted patches to the compiler to improve availability of type information
available for Java 8 lambdas.</p>
<p>The Eclipse JDT compiler has added support for this as of version 4.5 M4. Discussion about the feature in the
OpenJDK compiler is pending.</p>
<h4 id="serialization-of-pojo-types">Serialization of POJO types</h4>
<p>The PojoTypeInformation is creating serializers for all the fields inside the POJO. Standard types such as
int, long, String etc. are handled by serializers we ship with Flink.
For all other types, we fall back to Kryo.</p>
<p>If Kryo is not able to handle the type, you can ask the PojoTypeInfo to serialize the POJO using Avro.
To do so, you have to call</p>
<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kd">final</span> <span class="n">ExecutionEnvironment</span> <span class="n">env</span> <span class="o">=</span> <span class="n">ExecutionEnvironment</span><span class="o">.</span><span class="na">getExecutionEnvironment</span><span class="o">();</span>
<span class="n">env</span><span class="o">.</span><span class="na">getConfig</span><span class="o">().</span><span class="na">enableForceAvro</span><span class="o">();</span></code></pre></div>
<p>Note that Flink is automatically serializing POJOs generated by Avro with the Avro serializer.</p>
<p>If you want your <strong>entire</strong> POJO Type to be treated by the Kryo serializer, set</p>
<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kd">final</span> <span class="n">ExecutionEnvironment</span> <span class="n">env</span> <span class="o">=</span> <span class="n">ExecutionEnvironment</span><span class="o">.</span><span class="na">getExecutionEnvironment</span><span class="o">();</span>
<span class="n">env</span><span class="o">.</span><span class="na">getConfig</span><span class="o">().</span><span class="na">enableForceKryo</span><span class="o">();</span></code></pre></div>
<p>If Kryo is not able to serialize your POJO, you can add a custom serializer to Kryo, using</p>
<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">env</span><span class="o">.</span><span class="na">getConfig</span><span class="o">().</span><span class="na">addDefaultKryoSerializer</span><span class="o">(</span><span class="n">Class</span><span class="o">&lt;?&gt;</span> <span class="n">type</span><span class="o">,</span> <span class="n">Class</span><span class="o">&lt;?</span> <span class="kd">extends</span> <span class="n">Serializer</span><span class="o">&lt;?&gt;&gt;</span> <span class="n">serializerClass</span><span class="o">)</span></code></pre></div>
<p>There are different variants of these methods available.</p>
</div>
<div class="col-sm-10 col-sm-offset-1">
<!-- Disqus thread and some vertical offset -->
<div style="margin-top: 75px; margin-bottom: 50px" id="disqus_thread"></div>
</div>
</div>
</div><!-- /.container -->
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script src="http://flink.apache.org/docs/0.9/page/js/codetabs.js"></script>
<!-- Google Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-52545728-1', 'auto');
ga('send', 'pageview');
</script>
<!-- Disqus -->
<script type="text/javascript">
var disqus_shortname = 'stratosphere-eu';
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
</body>
</html>