You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2018/08/09 20:37:54 UTC

[GitHub] dclim closed pull request #6126: New quickstart and tutorials

dclim closed pull request #6126: New quickstart and tutorials
URL: https://github.com/apache/incubator-druid/pull/6126
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/NOTICE b/NOTICE
index 71a02dd4c63..bdb2603e66f 100644
--- a/NOTICE
+++ b/NOTICE
@@ -82,4 +82,12 @@ This product contains code adapted from Apache Hadoop
   * LICENSE:
     * https://github.com/apache/hadoop/blob/trunk/LICENSE.txt (Apache License, Version 2.0)
   * HOMEPAGE:
-    * http://hadoop.apache.org/
\ No newline at end of file
+    * http://hadoop.apache.org/
+
+This product contains modified versions of the Dockerfile and related configuration files from SequenceIQ's Hadoop Docker image:
+  * LICENSE:
+    * https://github.com/sequenceiq/hadoop-docker/blob/master/LICENSE (Apache License, Version 2.0)
+  * HOMEPAGE:
+    * https://github.com/sequenceiq/hadoop-docker/
+  * COMMIT TAG:
+    * update this when this patch is committed
\ No newline at end of file
diff --git a/distribution/src/assembly/assembly.xml b/distribution/src/assembly/assembly.xml
index 4c617c8d232..92d02cd0bdf 100644
--- a/distribution/src/assembly/assembly.xml
+++ b/distribution/src/assembly/assembly.xml
@@ -52,70 +52,99 @@
             </includes>
             <outputDirectory>quickstart</outputDirectory>
         </fileSet>
-
         <fileSet>
-            <directory>../examples/conf-quickstart</directory>
+            <directory>../examples/quickstart/tutorial</directory>
+            <includes>
+                <include>*</include>
+            </includes>
+            <outputDirectory>quickstart/tutorial</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>../examples/quickstart/tutorial/conf</directory>
             <includes>
                 <include>*</include>
             </includes>
-            <outputDirectory>conf-quickstart</outputDirectory>
+            <outputDirectory>quickstart/tutorial/conf</outputDirectory>
         </fileSet>
         <fileSet>
-            <directory>../examples/conf-quickstart/druid</directory>
+            <directory>../examples/quickstart/tutorial/conf/druid</directory>
             <includes>
                 <include>*</include>
             </includes>
-            <outputDirectory>conf-quickstart/druid</outputDirectory>
+            <outputDirectory>quickstart/tutorial/conf/druid</outputDirectory>
         </fileSet>
         <fileSet>
-            <directory>../examples/conf-quickstart/druid/_common</directory>
+            <directory>../examples/quickstart/tutorial/conf/druid/_common</directory>
             <includes>
                 <include>*</include>
             </includes>
-            <outputDirectory>conf-quickstart/druid/_common/</outputDirectory>
+            <outputDirectory>quickstart/tutorial/conf/druid/_common/</outputDirectory>
         </fileSet>
         <fileSet>
-            <directory>../examples/conf-quickstart/druid/broker</directory>
+            <directory>../examples/quickstart/tutorial/conf/druid/broker</directory>
             <includes>
                 <include>*</include>
             </includes>
-            <outputDirectory>conf-quickstart/druid/broker</outputDirectory>
+            <outputDirectory>quickstart/tutorial/conf/druid/broker</outputDirectory>
         </fileSet>
         <fileSet>
-            <directory>../examples/conf-quickstart/druid/coordinator</directory>
+            <directory>../examples/quickstart/tutorial/conf/druid/coordinator</directory>
             <includes>
                 <include>*</include>
             </includes>
-            <outputDirectory>conf-quickstart/druid/coordinator</outputDirectory>
+            <outputDirectory>quickstart/tutorial/conf/druid/coordinator</outputDirectory>
         </fileSet>
         <fileSet>
-            <directory>../examples/conf-quickstart/druid/historical</directory>
+            <directory>../examples/quickstart/tutorial/conf/druid/historical</directory>
             <includes>
                 <include>*</include>
             </includes>
-            <outputDirectory>conf-quickstart/druid/historical</outputDirectory>
+            <outputDirectory>quickstart/tutorial/conf/druid/historical</outputDirectory>
         </fileSet>
         <fileSet>
-            <directory>../examples/conf-quickstart/druid/overlord</directory>
+            <directory>../examples/quickstart/tutorial/conf/druid/overlord</directory>
             <includes>
                 <include>*</include>
             </includes>
-            <outputDirectory>conf-quickstart/druid/overlord</outputDirectory>
+            <outputDirectory>quickstart/tutorial/conf/druid/overlord</outputDirectory>
         </fileSet>
         <fileSet>
-            <directory>../examples/conf-quickstart/druid/middleManager</directory>
+            <directory>../examples/quickstart/tutorial/conf/druid/middleManager</directory>
             <includes>
                 <include>*</include>
             </includes>
-            <outputDirectory>conf-quickstart/druid/middleManager</outputDirectory>
+            <outputDirectory>quickstart/tutorial/conf/druid/middleManager</outputDirectory>
         </fileSet>
         <fileSet>
-            <directory>../examples/conf-quickstart/tranquility</directory>
+            <directory>../examples/quickstart/tutorial/conf/tranquility</directory>
             <includes>
                 <include>*</include>
             </includes>
-            <outputDirectory>conf-quickstart/tranquility</outputDirectory>
+            <outputDirectory>quickstart/tutorial/conf/tranquility</outputDirectory>
         </fileSet>
+        <fileSet>
+            <directory>../examples/quickstart/tutorial/conf/zk</directory>
+            <includes>
+                <include>*</include>
+            </includes>
+            <outputDirectory>quickstart/tutorial/conf/zk</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>../examples/quickstart/tutorial/hadoop</directory>
+            <includes>
+                <include>*</include>
+            </includes>
+            <outputDirectory>quickstart/tutorial/hadoop</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>../examples/quickstart/tutorial/hadoop/docker</directory>
+            <includes>
+                <include>*</include>
+            </includes>
+            <outputDirectory>quickstart/tutorial/hadoop/docker</outputDirectory>
+        </fileSet>
+
+
         <fileSet>
             <directory>../examples/quickstart/protobuf</directory>
             <includes>
diff --git a/docs/content/toc.md b/docs/content/toc.md
index a9d91c8b4fd..c8d9d882aff 100644
--- a/docs/content/toc.md
+++ b/docs/content/toc.md
@@ -4,11 +4,19 @@ layout: toc
 
 ## Getting Started
   * [Concepts](/docs/VERSION/design/)
-  * [Quickstart](/docs/VERSION/tutorials/quickstart.html)
-  * [Loading Data](/docs/VERSION/tutorials/ingestion.html)
-    * [Loading from Files](/docs/VERSION/tutorials/tutorial-batch.html)
-    * [Loading from Streams](/docs/VERSION/tutorials/tutorial-streams.html)
-    * [Loading from Kafka](/docs/VERSION/tutorials/tutorial-kafka.html)
+  * [Quickstart](/docs/VERSION/tutorials/index.html)
+    * [Tutorial: Loading a file](/docs/VERSION/tutorials/tutorial-batch.html)
+    * [Tutorial: Loading stream data from Kafka](/docs/VERSION/tutorials/tutorial-kafka.html)
+    * [Tutorial: Loading a file using Hadoop](/docs/VERSION/tutorials/tutorial-batch-hadoop.html)
+    * [Tutorial: Loading stream data using HTTP push](/docs/VERSION/tutorials/tutorial-tranquility.html)
+    * [Tutorial: Querying data](/docs/VERSION/tutorials/tutorial-query.html)
+  * [Further tutorials](/docs/VERSION/tutorials/advanced.html)
+    * [Tutorial: Rollup](/docs/VERSION/tutorials/rollup.html)
+    * [Tutorial: Configuring retention](/docs/VERSION/tutorials/tutorial-retention.html)
+    * [Tutorial: Updating existing data](/docs/VERSION/tutorials/tutorial-update-data.html)
+    * [Tutorial: Compacting segments](/docs/VERSION/tutorials/tutorial-compaction.html)
+    * [Tutorial: Deleting data](/docs/VERSION/tutorials/tutorial-delete-data.html)
+    * [Tutorial: Writing your own ingestion specs](/docs/VERSION/tutorials/tutorial-ingestion-spec.html)
   * [Clustering](/docs/VERSION/tutorials/cluster.html)
 
 ## Data Ingestion
diff --git a/docs/content/tutorials/img/tutorial-batch-01.png b/docs/content/tutorials/img/tutorial-batch-01.png
new file mode 100644
index 00000000000..6c2fdaa804d
Binary files /dev/null and b/docs/content/tutorials/img/tutorial-batch-01.png differ
diff --git a/docs/content/tutorials/img/tutorial-compaction-01.png b/docs/content/tutorials/img/tutorial-compaction-01.png
new file mode 100644
index 00000000000..5c609509851
Binary files /dev/null and b/docs/content/tutorials/img/tutorial-compaction-01.png differ
diff --git a/docs/content/tutorials/img/tutorial-compaction-02.png b/docs/content/tutorials/img/tutorial-compaction-02.png
new file mode 100644
index 00000000000..5467635b8b0
Binary files /dev/null and b/docs/content/tutorials/img/tutorial-compaction-02.png differ
diff --git a/docs/content/tutorials/img/tutorial-deletion-01.png b/docs/content/tutorials/img/tutorial-deletion-01.png
new file mode 100644
index 00000000000..d209b8c753c
Binary files /dev/null and b/docs/content/tutorials/img/tutorial-deletion-01.png differ
diff --git a/docs/content/tutorials/img/tutorial-deletion-02.png b/docs/content/tutorials/img/tutorial-deletion-02.png
new file mode 100644
index 00000000000..772a510a1a6
Binary files /dev/null and b/docs/content/tutorials/img/tutorial-deletion-02.png differ
diff --git a/docs/content/tutorials/img/tutorial-retention-00.png b/docs/content/tutorials/img/tutorial-retention-00.png
new file mode 100644
index 00000000000..99c4ca8f68e
Binary files /dev/null and b/docs/content/tutorials/img/tutorial-retention-00.png differ
diff --git a/docs/content/tutorials/img/tutorial-retention-01.png b/docs/content/tutorials/img/tutorial-retention-01.png
new file mode 100644
index 00000000000..0c9f4033786
Binary files /dev/null and b/docs/content/tutorials/img/tutorial-retention-01.png differ
diff --git a/docs/content/tutorials/img/tutorial-retention-02.png b/docs/content/tutorials/img/tutorial-retention-02.png
new file mode 100644
index 00000000000..a317116b933
Binary files /dev/null and b/docs/content/tutorials/img/tutorial-retention-02.png differ
diff --git a/docs/content/tutorials/img/tutorial-retention-03.png b/docs/content/tutorials/img/tutorial-retention-03.png
new file mode 100644
index 00000000000..ee4538c2d4f
Binary files /dev/null and b/docs/content/tutorials/img/tutorial-retention-03.png differ
diff --git a/docs/content/tutorials/index.md b/docs/content/tutorials/index.md
new file mode 100644
index 00000000000..f0a8cff358d
--- /dev/null
+++ b/docs/content/tutorials/index.md
@@ -0,0 +1,168 @@
+---
+layout: doc_page
+---
+
+# Druid Quickstart
+
+In this quickstart, we will download Druid and set it up on a single machine. The cluster will be ready to load data
+after completing this initial setup.
+
+Before beginning the quickstart, it is helpful to read the [general Druid overview](../design/index.html) and the
+[ingestion overview](../ingestion/index.html), as the tutorials will refer to concepts discussed on those pages.
+
+## Prerequisites
+
+You will need:
+
+  * Java 8
+  * Linux, Mac OS X, or other Unix-like OS (Windows is not supported)
+  * 8G of RAM
+  * 2 vCPUs
+
+On Mac OS X, you can use [Oracle's JDK
+8](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) to install
+Java.
+
+On Linux, your OS package manager should be able to help for Java. If your Ubuntu-
+based OS does not have a recent enough version of Java, WebUpd8 offers [packages for those
+OSes](http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html).
+
+## Getting started
+
+To install Druid, run the following commands in your terminal:
+
+```bash
+curl -O http://static.druid.io/artifacts/releases/druid-#{DRUIDVERSION}-bin.tar.gz
+tar -xzf druid-#{DRUIDVERSION}-bin.tar.gz
+cd druid-#{DRUIDVERSION}
+```
+
+In the package, you should find:
+
+* `LICENSE` - the license files.
+* `bin/` - scripts useful for this quickstart.
+* `conf/*` - template configurations for a clustered setup.
+* `extensions/*` - all Druid extensions.
+* `hadoop-dependencies/*` - Druid Hadoop dependencies.
+* `lib/*` - all included software packages for core Druid.
+* `quickstart/*` - configuration files, sample data, and other files for the quickstart tutorials
+
+## Download Zookeeper
+
+Druid currently has a dependency on [Apache ZooKeeper](http://zookeeper.apache.org/) for distributed coordination. You'll
+need to download and run Zookeeper.
+
+In the package root, run the following commands:
+
+```bash
+curl https://archive.apache.org/dist/zookeeper/zookeeper-3.4.11/zookeeper-3.4.11.tar.gz -o zookeeper-3.4.11.tar.gz
+tar -xzf zookeeper-3.4.11.tar.gz
+mv zookeeper-3.4.11 zk
+```
+
+The startup scripts for the tutorial will expect the contents of the Zookeeper tarball to be located at `zk` under the druid-#{DRUIDVERSION} package root.
+
+## Start up Druid services
+
+From the druid-#{DRUIDVERSION} package root, run the following command:
+
+```bash
+bin/supervise -c quickstart/tutorial/conf/tutorial-cluster.conf
+```
+
+This will bring up instances of Zookeeper and the Druid services, all running on the local machine, e.g.:
+
+```
+bin/supervise -c quickstart/tutorial/conf/tutorial-cluster.conf
+[Thu Jul 26 12:16:23 2018] Running command[zk], logging to[/stage/druid-#{DRUIDVERSION}/var/sv/zk.log]: bin/run-zk quickstart/tutorial/conf
+[Thu Jul 26 12:16:23 2018] Running command[coordinator], logging to[/stage/druid-#{DRUIDVERSION}/var/sv/coordinator.log]: bin/run-druid coordinator quickstart/tutorial/conf
+[Thu Jul 26 12:16:23 2018] Running command[broker], logging to[//stage/druid-#{DRUIDVERSION}/var/sv/broker.log]: bin/run-druid broker quickstart/tutorial/conf
+[Thu Jul 26 12:16:23 2018] Running command[historical], logging to[/stage/druid-#{DRUIDVERSION}/var/sv/historical.log]: bin/run-druid historical quickstart/tutorial/conf
+[Thu Jul 26 12:16:23 2018] Running command[overlord], logging to[/stage/druid-#{DRUIDVERSION}/var/sv/overlord.log]: bin/run-druid overlord quickstart/tutorial/conf
+[Thu Jul 26 12:16:23 2018] Running command[middleManager], logging to[/stage/druid-#{DRUIDVERSION}/var/sv/middleManager.log]: bin/run-druid middleManager quickstart/tutorial/conf
+
+```
+
+All persistent state such as the cluster metadata store and segments for the services will be kept in the `var` directory under the druid-#{DRUIDVERSION} package root. Logs for the services are located at `var/sv`.
+
+Later on, if you'd like to stop the services, CTRL-C to exit the `bin/supervise` script, which will terminate the Druid processes. 
+
+If you want a clean start after stopping the services, delete the `var` directory and run the `bin/supervise` script again.
+
+Once every service has started, you are now ready to load data.
+
+## Loading Data
+
+### Tutorial Dataset
+
+For the following data loading tutorials, we have included a sample data file containing Wikipedia page edit events that occurred on 2015-09-12.
+
+This sample data is located at `quickstart/wikipedia-2015-09-12-sampled.json.gz` from the Druid package root. The page edit events are stored as JSON objects in a text file.
+
+The sample data has the following columns, and an example event is shown below:
+
+  * added
+  * channel
+  * cityName
+  * comment
+  * countryIsoCode
+  * countryName
+  * deleted
+  * delta
+  * isAnonymous
+  * isMinor
+  * isNew
+  * isRobot
+  * isUnpatrolled
+  * metroCode
+  * namespace
+  * page
+  * regionIsoCode
+  * regionName
+  * user
+ 
+```
+{
+  "timestamp":"2015-09-12T20:03:45.018Z",
+  "channel":"#en.wikipedia",
+  "namespace":"Main"
+  "page":"Spider-Man's powers and equipment",
+  "user":"foobar",
+  "comment":"/* Artificial web-shooters */",
+  "cityName":"New York",
+  "regionName":"New York",
+  "regionIsoCode":"NY",
+  "countryName":"United States",
+  "countryIsoCode":"US",
+  "isAnonymous":false,
+  "isNew":false,
+  "isMinor":false,
+  "isRobot":false,
+  "isUnpatrolled":false,
+  "added":99,
+  "delta":99,
+  "deleted":0,
+}
+```
+
+The following tutorials demonstrate various methods of loading data into Druid, including both batch and streaming use cases.
+
+### [Tutorial: Loading a file](./tutorial-batch.html)
+
+This tutorial demonstrates how to perform a batch file load, using Druid's native batch ingestion.
+
+### [Tutorial: Loading stream data from Kafka](../tutorial-kafka.html)
+
+This tutorial demonstrates how to load streaming data from a Kafka topic.
+
+### [Tutorial: Loading a file using Hadoop](../tutorial-batch-hadoop.html)
+
+This tutorial demonstrates how to perform a batch file load, using a remote Hadoop cluster.
+
+### [Tutorial: Loading data using Tranquility](../tutorial-tranquility.html)
+
+This tutorial demonstrates how to load streaming data by pushing events to Druid using the Tranquility service.
+
+### [Tutorial: Writing your own ingestion spec](../tutorial-ingestion-spec.html)
+
+This tutorial demonstrates how to write a new ingestion spec and use it to load data.
\ No newline at end of file
diff --git a/docs/content/tutorials/ingestion.md b/docs/content/tutorials/ingestion.md
deleted file mode 100644
index ab2844fe269..00000000000
--- a/docs/content/tutorials/ingestion.md
+++ /dev/null
@@ -1,42 +0,0 @@
----
-layout: doc_page
----
-
-# Loading Data
-
-## Choosing an ingestion method
-
-Druid supports streaming (real-time) and file-based (batch) ingestion methods. The most 
-popular configurations are:
-
-- [Files](../ingestion/batch-ingestion.html) - Load data from HDFS, S3, local files, or any supported Hadoop 
-filesystem in batches. We recommend this method if your dataset is already in flat files.
-
-- [Stream push](../ingestion/stream-ingestion.html#stream-push) - Push a data stream into Druid in real-time 
-using [Tranquility](http://github.com/druid-io/tranquility), a client library for sending streams 
-to Druid. We recommend this method if your dataset originates in a streaming system like Kafka, 
-Storm, Spark Streaming, or your own system.
-
-- [Stream pull](../ingestion/stream-ingestion.html#stream-pull) - Pull a data stream directly from an external 
-data source into Druid using Realtime Nodes.
-
-## Getting started
-
-The easiest ways to get started with loading your own data are the three included tutorials.
-
-- [Files-based tutorial](tutorial-batch.html) showing you how to load files from your local disk.
-- [Streams-based tutorial](tutorial-streams.html) showing you how to push data over HTTP.
-- [Kafka-based tutorial](tutorial-kafka.html) showing you how to load data from Kafka.
-
-## Hybrid batch/streaming
-
-You can combine batch and streaming methods in a hybrid batch/streaming architecture. In a hybrid architecture, 
-you use a streaming method to do initial ingestion, and then periodically re-ingest older data in batch mode 
-(typically every few hours, or nightly). When Druid re-ingests data for a time range, the new data automatically 
-replaces the data from the earlier ingestion.
-
-All streaming ingestion methods currently supported by Druid do introduce the possibility of dropped or duplicated 
-messages in certain failure scenarios, and batch re-ingestion eliminates this potential source of error for 
-historical data.
-
-Batch re-ingestion also gives you the option to re-ingest your data if you needed to revise it for any reason.
diff --git a/docs/content/tutorials/quickstart.md b/docs/content/tutorials/quickstart.md
deleted file mode 100644
index cb691bc9f83..00000000000
--- a/docs/content/tutorials/quickstart.md
+++ /dev/null
@@ -1,243 +0,0 @@
----
-layout: doc_page
----
-
-# Druid Quickstart
-
-In this quickstart, we will download Druid, set up it up on a single machine, load some data, and query the data.
-
-## Prerequisites
-
-You will need:
-
-  * Java 8
-  * Linux, Mac OS X, or other Unix-like OS (Windows is not supported)
-  * 8G of RAM
-  * 2 vCPUs
-
-On Mac OS X, you can use [Oracle's JDK
-8](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) to install
-Java.
-
-On Linux, your OS package manager should be able to help for Java. If your Ubuntu-
-based OS does not have a recent enough version of Java, WebUpd8 offers [packages for those
-OSes](http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html).
-
-## Getting started
-
-To install Druid, issue the following commands in your terminal:
-
-```bash
-curl -O http://static.druid.io/artifacts/releases/druid-#{DRUIDVERSION}-bin.tar.gz
-tar -xzf druid-#{DRUIDVERSION}-bin.tar.gz
-cd druid-#{DRUIDVERSION}
-```
-
-In the package, you should find:
-
-* `LICENSE` - the license files.
-* `bin/` - scripts useful for this quickstart.
-* `conf/*` - template configurations for a clustered setup.
-* `conf-quickstart/*` - configurations for this quickstart.
-* `extensions/*` - all Druid extensions.
-* `hadoop-dependencies/*` - Druid Hadoop dependencies.
-* `lib/*` - all included software packages for core Druid.
-* `quickstart/*` - files useful for this quickstart.
-
-## Start up Zookeeper
-
-Druid currently has a dependency on [Apache ZooKeeper](http://zookeeper.apache.org/) for distributed coordination. You'll
-need to download and run Zookeeper.
-
-```bash
-curl http://www.gtlib.gatech.edu/pub/apache/zookeeper/zookeeper-3.4.11/zookeeper-3.4.11.tar.gz -o zookeeper-3.4.11.tar.gz
-tar -xzf zookeeper-3.4.11.tar.gz
-cd zookeeper-3.4.11
-cp conf/zoo_sample.cfg conf/zoo.cfg
-./bin/zkServer.sh start
-```
-
-## Start up Druid services
-
-With Zookeeper running, return to the druid-#{DRUIDVERSION} directory. In that directory, issue the command:
-
-```bash
-bin/init
-```
-
-This will setup up some directories for you. Next, you can start up the Druid processes in different terminal windows.
-This tutorial runs every Druid process on the same system. In a large distributed production cluster,
-many of these Druid processes can still be co-located together.
-
-```bash
-java `cat conf-quickstart/druid/historical/jvm.config | xargs` -cp "conf-quickstart/druid/_common:conf-quickstart/druid/historical:lib/*" io.druid.cli.Main server historical
-java `cat conf-quickstart/druid/broker/jvm.config | xargs` -cp "conf-quickstart/druid/_common:conf-quickstart/druid/broker:lib/*" io.druid.cli.Main server broker
-java `cat conf-quickstart/druid/coordinator/jvm.config | xargs` -cp "conf-quickstart/druid/_common:conf-quickstart/druid/coordinator:lib/*" io.druid.cli.Main server coordinator
-java `cat conf-quickstart/druid/overlord/jvm.config | xargs` -cp "conf-quickstart/druid/_common:conf-quickstart/druid/overlord:lib/*" io.druid.cli.Main server overlord
-java `cat conf-quickstart/druid/middleManager/jvm.config | xargs` -cp "conf-quickstart/druid/_common:conf-quickstart/druid/middleManager:lib/*" io.druid.cli.Main server middleManager
-```
-
-You should see a log message printed out for each service that starts up.
-
-Later on, if you'd like to stop the services, CTRL-C to exit from the running java processes. If you
-want a clean start after stopping the services, delete the `var` directory and run the `init` script again.
-
-Once every service has started, you are now ready to load data.
-
-## Load batch data
-
-We've included a sample of Wikipedia edits from September 12, 2015 to get you started.
-
-<div class="note info">
-This section shows you how to load data in batches, but you can skip ahead to learn how to <a href="quickstart.html#load-streaming-data">load
-streams in real-time</a>. Druid's streaming ingestion can load data
-with virtually no delay between events occurring and being available for queries.
-</div>
-
-The [dimensions](https://en.wikipedia.org/wiki/Dimension_%28data_warehouse%29) (attributes you can
-filter and split on) in the Wikipedia dataset, other than time, are:
-
-  * channel
-  * cityName
-  * comment
-  * countryIsoCode
-  * countryName
-  * isAnonymous
-  * isMinor
-  * isNew
-  * isRobot
-  * isUnpatrolled
-  * metroCode
-  * namespace
-  * page
-  * regionIsoCode
-  * regionName
-  * user
-
-The [measures](https://en.wikipedia.org/wiki/Measure_%28data_warehouse%29), or *metrics* as they are known in Druid (values you can aggregate)
-in the Wikipedia dataset are:
-
-  * count
-  * added
-  * deleted
-  * delta
-  * user_unique
-
-To load this data into Druid, you can submit an *ingestion task* pointing to the file. We've included
-a task that loads the `wikiticker-2015-09-12-sampled.json` file included in the archive. To submit
-this task, POST it to Druid in a new terminal window from the druid-#{DRUIDVERSION} directory:
-
-```bash
-curl -X 'POST' -H 'Content-Type:application/json' -d @quickstart/wikiticker-index.json localhost:8090/druid/indexer/v1/task
-```
-
-Which will print the ID of the task if the submission was successful:
-
-```bash
-{"task":"index_hadoop_wikipedia_2013-10-09T21:30:32.802Z"}
-```
-
-To view the status of your ingestion task, go to your overlord console:
-[http://localhost:8090/console.html](http://localhost:8090/console.html). You can refresh the console periodically, and after
-the task is successful, you should see a "SUCCESS" status for the task.
-
-After your ingestion task finishes, the data will be loaded by historical nodes and available for
-querying within a minute or two. You can monitor the progress of loading your data in the
-coordinator console, by checking whether there is a datasource "wikiticker" with a blue circle
-indicating "fully available": [http://localhost:8081/#/](http://localhost:8081/#/).
-
-Once the data is fully available, you can immediately query it&mdash; to see how, skip to the [Query
-data](#query-data) section below. Or, continue to the [Load your own data](#load-your-own-data)
-section if you'd like to load a different dataset.
-
-## Load streaming data
-
-To load streaming data, we are going to push events into Druid
-over a simple HTTP API. To do this we will use [Tranquility], a high level data producer
-library for Druid.
-
-To download Tranquility, issue the following commands in your terminal:
-
-```bash
-curl -O http://static.druid.io/tranquility/releases/tranquility-distribution-0.8.0.tgz
-tar -xzf tranquility-distribution-0.8.0.tgz
-cd tranquility-distribution-0.8.0
-```
-
-We've included a configuration file in `conf-quickstart/tranquility/server.json` as part of the Druid distribution
-for a *metrics* datasource. We're going to start the Tranquility server process, which can be used to push events
-directly to Druid.
-
-``` bash
-bin/tranquility server -configFile <path_to_druid_distro>/conf-quickstart/tranquility/server.json
-```
-
-<div class="note info">
-This section shows you how to load data using Tranquility Server, but Druid also supports a wide
-variety of <a href="../ingestion/stream-ingestion.html#stream-push">other streaming ingestion options</a>, including from
-popular streaming systems like Kafka, Storm, Samza, and Spark Streaming.
-</div>
-
-The [dimensions](https://en.wikipedia.org/wiki/Dimension_%28data_warehouse%29) (attributes you can
-filter and split on) for this datasource are flexible. It's configured for *schemaless dimensions*,
-meaning it will accept any field in your JSON input as a dimension.
-
-The metrics (also called
-[measures](https://en.wikipedia.org/wiki/Measure_%28data_warehouse%29); values
-you can aggregate) in this datasource are:
-
-  * count
-  * value_sum (derived from `value` in the input)
-  * value_min (derived from `value` in the input)
-  * value_max (derived from `value` in the input)
-
-We've included a script that can generate some random sample metrics to load into this datasource.
-To use it, simply run in your Druid distribution repository:
-
-```bash
-bin/generate-example-metrics | curl -XPOST -H'Content-Type: application/json' --data-binary @- http://localhost:8200/v1/post/metrics
-```
-
-Which will print something like:
-
-```
-{"result":{"received":25,"sent":25}}
-```
-
-This indicates that the HTTP server received 25 events from you, and sent 25 to Druid. Note that
-this may take a few seconds to finish the first time you run it, as Druid resources must be
-allocated to the ingestion task. Subsequent POSTs should complete quickly.
-
-Once the data is sent to Druid, you can immediately [query it](#query-data).
-
-## Query data
-
-### Direct Druid queries
-
-Druid supports a rich [family of JSON-based
-queries](../querying/querying.html). We've included an example topN query
-in `quickstart/wikiticker-top-pages.json` that will find the most-edited articles in this dataset:
-
-```bash
-curl -L -H'Content-Type: application/json' -XPOST --data-binary @quickstart/wikiticker-top-pages.json http://localhost:8082/druid/v2/?pretty
-```
-
-## Visualizing data
-
-Druid is ideal for power user-facing analytic applications. There are a number of different open source applications to
-visualize and explore data in Druid. We recommend trying [Pivot](https://github.com/implydata/pivot),
-[Superset](https://github.com/airbnb/superset), or [Metabase](https://github.com/metabase/metabase) to start
-visualizing the data you just ingested.
-
-If you installed Pivot for example, you should be able to view your data in your browser at [localhost:9090](http://localhost:9090/).
-
-### SQL and other query libraries
-
-There are many more query tools for Druid than we've included here, including SQL
-engines, and libraries for various languages like Python and Ruby. Please see [the list of
-libraries](../development/libraries.html) for more information.
-
-## Clustered setup
-
-This quickstart sets you up with all services running on a single machine. The next step is to [load
-your own data](ingestion.html). Or, you can skip ahead to [running a distributed cluster](cluster.html).
diff --git a/docs/content/tutorials/tutorial-batch-hadoop.md b/docs/content/tutorials/tutorial-batch-hadoop.md
new file mode 100644
index 00000000000..cf6c6a14754
--- /dev/null
+++ b/docs/content/tutorials/tutorial-batch-hadoop.md
@@ -0,0 +1,232 @@
+---
+layout: doc_page
+---
+
+# Tutorial: Load batch data using Hadoop
+
+This tutorial shows you how to load data files into Druid using a remote Hadoop cluster.
+
+For this tutorial, we'll assume that you've already completed the previous [batch ingestion tutorial](tutorial-batch.html) using Druid's native batch ingestion system.
+
+## Install Docker
+
+This tutorial requires [Docker](https://docs.docker.com/install/) to be installed on the tutorial machine.
+
+Once the Docker install is complete, please proceed to the next steps in the tutorial.
+
+## Build the Hadoop docker image
+
+For this tutorial, we've provided a Dockerfile for a Hadoop 2.8.3 cluster, which we'll use to run the batch indexing task.
+
+This Dockerfile and related files are located at `quickstart/tutorial/hadoop/docker`.
+
+From the druid-${DRUIDVERSION} package root, run the following commands to build a Docker image named "druid-hadoop-demo" with version tag "2.8.3":
+
+```
+cd quickstart/tutorial/hadoop/docker
+docker build -t druid-hadoop-demo:2.8.3 .
+```
+
+This will start building the Hadoop image. Once the image build is done, you should see the message `Successfully tagged druid-hadoop-demo:2.8.3` printed to the console.
+
+## Setup the Hadoop docker cluster
+
+### Create temporary shared directory
+
+We'll need a shared folder between the host and the Hadoop container for transferring some files.
+
+Let's create some folders under `/tmp`, we will use these later when starting the Hadoop container:
+
+```
+mkdir -p /tmp/shared
+mkdir -p /tmp/shared/hadoop_xml
+```
+
+### Configure /etc/hosts
+
+On the host machine, add the following entry to `/etc/hosts`:
+
+```
+127.0.0.1 druid-hadoop-demo
+```
+
+### Start the Hadoop container
+
+Once the `/tmp/shared` folder has been created and the `etc/hosts` entry has been added, run the following command to start the Hadoop container.
+
+```
+docker run -it  -h druid-hadoop-demo -p 50010:50010 -p 50020:50020 -p 50075:50075 -p 50090:50090 -p 8020:8020 -p 10020:10020 -p 19888:19888 -p 8030:8030 -p 8031:8031 -p 8032:8032 -p 8033:8033 -p 8040:8040 -p 8042:8042 -p 8088:8088 -p 8443:8443 -p 2049:2049 -p 9000:9000 -p 49707:49707 -p 2122:2122  -p 34455:34455 -v /tmp/shared:/shared druid-hadoop-demo:2.8.3 /etc/bootstrap.sh -bash
+```
+
+Once the container is started, your terminal will attach to a bash shell running inside the container:
+
+```
+Starting sshd:                                             [  OK  ]
+18/07/26 17:27:15 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
+Starting namenodes on [druid-hadoop-demo]
+druid-hadoop-demo: starting namenode, logging to /usr/local/hadoop/logs/hadoop-root-namenode-druid-hadoop-demo.out
+localhost: starting datanode, logging to /usr/local/hadoop/logs/hadoop-root-datanode-druid-hadoop-demo.out
+Starting secondary namenodes [0.0.0.0]
+0.0.0.0: starting secondarynamenode, logging to /usr/local/hadoop/logs/hadoop-root-secondarynamenode-druid-hadoop-demo.out
+18/07/26 17:27:31 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
+starting yarn daemons
+starting resourcemanager, logging to /usr/local/hadoop/logs/yarn--resourcemanager-druid-hadoop-demo.out
+localhost: starting nodemanager, logging to /usr/local/hadoop/logs/yarn-root-nodemanager-druid-hadoop-demo.out
+starting historyserver, logging to /usr/local/hadoop/logs/mapred--historyserver-druid-hadoop-demo.out
+bash-4.1#  
+```
+
+The `Unable to load native-hadoop library for your platform... using builtin-java classes where applicable` warning messages can be safely ignored.
+
+### Copy input data to the Hadoop container
+
+From the druid-${DRUIDVERSION} package root on the host, copy the `quickstart/wikiticker-2015-09-12-sampled.json.gz` sample data to the shared folder:
+
+```
+cp quickstart/wikiticker-2015-09-12-sampled.json.gz /tmp/shared/wikiticker-2015-09-12-sampled.json.gz
+```
+
+### Setup HDFS directories
+
+In the Hadoop container's shell, run the following commands to setup the HDFS directories needed by this tutorial and copy the input data to HDFS.
+
+```
+cd /usr/local/hadoop/bin
+./hadoop fs -mkdir /druid
+./hadoop fs -mkdir /druid/segments
+./hadoop fs -mkdir /quickstart
+./hadoop fs -chmod 777 /druid
+./hadoop fs -chmod 777 /druid/segments
+./hadoop fs -chmod 777 /quickstart
+./hadoop fs -chmod -R 777 /tmp
+./hadoop fs -chmod -R 777 /user
+./hadoop fs -put /shared/wikiticker-2015-09-12-sampled.json.gz /quickstart/wikiticker-2015-09-12-sampled.json.gz
+```
+
+If you encounter namenode errors when running this command, the Hadoop container may not be finished initializing. When this occurs, wait a couple of minutes and retry the commands.
+
+## Configure Druid to use Hadoop
+
+Some additional steps are needed to configure the Druid cluster for Hadoop batch indexing.
+
+### Copy Hadoop configuration to Druid classpath
+
+From the Hadoop container's shell, run the following command to copy the Hadoop .xml configuration files to the shared folder:
+
+```
+cp /usr/local/hadoop/etc/hadoop/*.xml /shared/hadoop_xml
+```
+
+From the host machine, run the following, where {PATH_TO_DRUID} is replaced by the path to the Druid package.
+
+```
+mkdir -p {PATH_TO_DRUID}/quickstart/tutorial/conf/druid/_common/hadoop-xml
+cp /tmp/shared/hadoop_xml/*.xml {PATH_TO_DRUID}/quickstart/tutorial/conf/druid/_common/hadoop-xml/
+```
+
+### Update Druid segment and log storage
+
+In your favorite text editor, open `quickstart/tutorial/conf/druid/_common/common.runtime.properties`, and make the following edits:
+
+#### Disable local deep storage and enable HDFS deep stroage
+
+```
+#
+# Deep storage
+#
+
+# For local disk (only viable in a cluster if this is a network mount):
+#druid.storage.type=local
+#druid.storage.storageDirectory=var/druid/segments
+
+# For HDFS:
+druid.storage.type=hdfs
+druid.storage.storageDirectory=/druid/segments
+```
+
+
+#### Disable local log storage and enable HDFS log storage
+
+```
+#
+# Indexing service logs
+#
+
+# For local disk (only viable in a cluster if this is a network mount):
+#druid.indexer.logs.type=file
+#druid.indexer.logs.directory=var/druid/indexing-logs
+
+# For HDFS:
+druid.indexer.logs.type=hdfs
+druid.indexer.logs.directory=/druid/indexing-logs
+
+```
+
+### Restart Druid cluster
+
+Once the Hadoop .xml files have been copied to the Druid cluster and the segment/log storage configuration has been updated to use HDFS, the Druid cluster needs to be restarted for the new configurations to take effect.
+
+If the cluster is still running, CTRL-C to terminate the `bin/supervise` script, and re-reun it to bring the Druid services back up.
+
+## Load batch data
+
+We've included a sample of Wikipedia edits from September 12, 2015 to get you started.
+
+To load this data into Druid, you can submit an *ingestion task* pointing to the file. We've included
+a task that loads the `wikiticker-2015-09-12-sampled.json.gz` file included in the archive.
+
+Let's submit the `wikipedia-index-hadoop-.json` task:
+
+```
+bin/post-index-task --file quickstart/tutorial/wikipedia-index-hadoop.json 
+```
+
+## Querying your data
+
+After the data load is complete, please follow the [query tutorial](../tutorial/tutorial-query.html) to run some example queries on the newly loaded data.
+
+## Cleanup
+
+This tutorial is only meant to be used together with the [query tutorial](../tutorial/tutorial-query.html). 
+
+If you wish to go through any of the other tutorials, you will need to:
+* Shut down the cluster and reset the cluster state by removing the contents of the `var` directory under the druid package.
+* Revert the deep storage and task storage config back to local types in `quickstart/tutorial/conf/druid/_common/common.runtime.properties`
+* Restart the cluster
+
+This is necessary because the other ingestion tutorials will write to the same "wikipedia" datasource, and later tutorials expect the cluster to use local deep storage.
+
+Example reverted config:
+
+```
+#
+# Deep storage
+#
+
+# For local disk (only viable in a cluster if this is a network mount):
+druid.storage.type=local
+druid.storage.storageDirectory=var/druid/segments
+
+# For HDFS:
+#druid.storage.type=hdfs
+#druid.storage.storageDirectory=/druid/segments
+
+#
+# Indexing service logs
+#
+
+# For local disk (only viable in a cluster if this is a network mount):
+druid.indexer.logs.type=file
+druid.indexer.logs.directory=var/druid/indexing-logs
+
+# For HDFS:
+#druid.indexer.logs.type=hdfs
+#druid.indexer.logs.directory=/druid/indexing-logs
+
+```
+
+
+## Further reading
+
+For more information on loading batch data with Hadoop, please see [the Hadoop batch ingestion documentation](../ingestion/hadoop.html).
+
diff --git a/docs/content/tutorials/tutorial-batch.md b/docs/content/tutorials/tutorial-batch.md
index 3d14a9a8449..183a6bc5beb 100644
--- a/docs/content/tutorials/tutorial-batch.md
+++ b/docs/content/tutorials/tutorial-batch.md
@@ -2,137 +2,157 @@
 layout: doc_page
 ---
 
-# Tutorial: Load your own batch data
+# Tutorial: Loading a file
 
 ## Getting started
 
-This tutorial shows you how to load your own data files into Druid.
+This tutorial demonstrates how to perform a batch file load, using Druid's native batch ingestion.
 
 For this tutorial, we'll assume you've already downloaded Druid as described in 
-the [single-machine quickstart](quickstart.html) and have it running on your local machine. You 
+the [single-machine quickstart](index.html) and have it running on your local machine. You 
 don't need to have loaded any data yet.
 
-Once that's complete, you can load your own dataset by writing a custom ingestion spec.
+## Preparing the data and the ingestion task spec
 
-## Writing an ingestion spec
+A data load is initiated by submitting an *ingestion task* spec to the Druid overlord. For this tutorial, we'll be loading the sample Wikipedia page edits data.
 
-When loading files into Druid, you will use Druid's [batch loading](../ingestion/batch-ingestion.html) process.
-There's an example batch ingestion spec in `quickstart/wikiticker-index.json` that you can modify 
-for your own needs.
+The Druid package includes the following sample native batch ingestion task spec at `quickstart/wikipedia-index.json`, shown here for convenience,
+which has been configured to read the `quickstart/wikiticker-2015-09-12-sampled.json.gz` input file:
 
-The most important questions are:
+```
+{
+  "type" : "index",
+  "spec" : {
+    "dataSchema" : {
+      "dataSource" : "wikipedia",
+      "parser" : {
+        "type" : "string",
+        "parseSpec" : {
+          "format" : "json",
+          "dimensionsSpec" : {
+            "dimensions" : [
+              "channel",
+              "cityName",
+              "comment",
+              "countryIsoCode",
+              "countryName",
+              "isAnonymous",
+              "isMinor",
+              "isNew",
+              "isRobot",
+              "isUnpatrolled",
+              "metroCode",
+              "namespace",
+              "page",
+              "regionIsoCode",
+              "regionName",
+              "user",
+              { "name": "added", "type": "long" },
+              { "name": "deleted", "type": "long" },
+              { "name": "delta", "type": "long" }
+            ]
+          },
+          "timestampSpec": {
+            "column": "time",
+            "format": "iso"
+          }
+        }
+      },
+      "metricsSpec" : [],
+      "granularitySpec" : {
+        "type" : "uniform",
+        "segmentGranularity" : "day",
+        "queryGranularity" : "none",
+        "intervals" : ["2015-09-12/2015-09-13"],
+        "rollup" : false
+      }
+    },
+    "ioConfig" : {
+      "type" : "index",
+      "firehose" : {
+        "type" : "local",
+        "baseDir" : "quickstart/",
+        "filter" : "wikiticker-2015-09-12-sampled.json.gz"
+      },
+      "appendToExisting" : false
+    },
+    "tuningConfig" : {
+      "type" : "index",
+      "targetPartitionSize" : 5000000,
+      "maxRowsInMemory" : 25000,
+      "forceExtendableShardSpecs" : true
+    }
+  }
+}
+```
 
-  * What should the dataset be called? This is the "dataSource" field of the "dataSchema".
-  * Where is the dataset located? The file paths belong in the "paths" of the "inputSpec". If you 
-want to load multiple files, you can provide them as a comma-separated string.
-  * Which field should be treated as a timestamp? This belongs in the "column" of the "timestampSpec".
-  * Which fields should be treated as dimensions? This belongs in the "dimensions" of the "dimensionsSpec".
-  * Which fields should be treated as metrics? This belongs in the "metricsSpec".
-  * What time ranges (intervals) are being loaded? This belongs in the "intervals" of the "granularitySpec".
+This spec will create a datasource named "wikipedia", 
 
-If your data does not have a natural sense of time, you can tag each row with the current time. 
-You can also tag all rows with a fixed timestamp, like "2000-01-01T00:00:00.000Z".
+## Load batch data
 
-Let's use this pageviews dataset as an example. Druid supports TSV, CSV, and JSON out of the box. 
-Note that nested JSON objects are not supported, so if you do use JSON, you should provide a file 
-containing flattened objects.
+We've included a sample of Wikipedia edits from September 12, 2015 to get you started.
 
-```json
-{"time": "2015-09-01T00:00:00Z", "url": "/foo/bar", "user": "alice", "latencyMs": 32}
-{"time": "2015-09-01T01:00:00Z", "url": "/", "user": "bob", "latencyMs": 11}
-{"time": "2015-09-01T01:30:00Z", "url": "/foo/bar", "user": "bob", "latencyMs": 45}
-```
+To load this data into Druid, you can submit an *ingestion task* pointing to the file. We've included
+a task that loads the `wikiticker-2015-09-12-sampled.json.gz` file included in the archive. 
 
-Make sure the file has no newline at the end. If you save this to a file called "pageviews.json", then for this dataset:
+For convenience, the Druid package includes a batch ingestion helper script at `bin/post-index-task`.
 
-  * Let's call the dataset "pageviews".
-  * The data is located in "pageviews.json".
-  * The timestamp is the "time" field.
-  * Good choices for dimensions are the string fields "url" and "user".
-  * Good choices for metrics are a count of pageviews, and the sum of "latencyMs". Collecting that 
-sum when we load the data will allow us to compute an average at query time as well.
-  * The data covers the time range 2015-09-01 (inclusive) through 2015-09-02 (exclusive).
+This script will POST an ingestion task to the Druid overlord and poll Druid until the data is available for querying.
 
-You can copy the existing `quickstart/wikiticker-index.json` indexing task to a new file:
+Run the following command from Druid package root:
 
-```bash
-cp quickstart/wikiticker-index.json my-index-task.json
 ```
-
-And modify it by altering these sections:
-
-```json
-"dataSource": "pageviews"
+bin/post-index-task --file quickstart/tutorial/wikipedia-index.json 
 ```
 
-```json
-"inputSpec": {
-  "type": "static",
-  "paths": "pageviews.json"
-}
-```
+You should see output like the following:
 
-```json
-"timestampSpec": {
-  "format": "auto",
-  "column": "time"
-}
 ```
-
-```json
-"dimensionsSpec": {
-  "dimensions": ["url", "user"]
-}
+Beginning indexing data for wikipedia
+Task started: index_wikipedia_2018-07-27T06:37:44.323Z
+Task log:     http://localhost:8090/druid/indexer/v1/task/index_wikipedia_2018-07-27T06:37:44.323Z/log
+Task status:  http://localhost:8090/druid/indexer/v1/task/index_wikipedia_2018-07-27T06:37:44.323Z/status
+Task index_wikipedia_2018-07-27T06:37:44.323Z still running...
+Task index_wikipedia_2018-07-27T06:37:44.323Z still running...
+Task finished with status: SUCCESS
+Completed indexing data for wikipedia. Now loading indexed data onto the cluster...
+wikipedia loading complete! You may now query your data
 ```
 
-```json
-"metricsSpec": [
-  {"name": "views", "type": "count"},
-  {"name": "latencyMs", "type": "doubleSum", "fieldName": "latencyMs"}
-]
-```
+## Querying your data
 
-```json
-"granularitySpec": {
-  "type": "uniform",
-  "segmentGranularity": "day",
-  "queryGranularity": "none",
-  "intervals": ["2015-09-01/2015-09-02"]
-}
-```
+Once the data is loaded, please follow the [query tutorial](../tutorial/tutorial-query.html) to run some example queries on the newly loaded data.
+
+## Cleanup
 
-## Running the task
+If you wish to go through any of the other ingestion tutorials, you will need to shut down the cluster and reset the cluster state by removing the contents of the `var` directory under the druid package, as the other tutorials will write to the same "wikipedia" datasource.
 
-To actually run this task, first make sure that the indexing task can read *pageviews.json*:
+## Extra: Loading data without the script
 
-- If you're running locally (no configuration for connecting to Hadoop; this is the default) then 
-place it in the root of the Druid distribution.
-- If you configured Druid to connect to a Hadoop cluster, upload 
-the pageviews.json file to HDFS. You may need to adjust the `paths` in the ingestion spec.
+Let's briefly discuss how we would've submitted the ingestion task without using the script. You do not need to run these commands.
 
-To kick off the indexing process, POST your indexing task to the Druid Overlord. In a standard Druid 
-install, the URL is `http://OVERLORD_IP:8090/druid/indexer/v1/task`.
+To submit the task, POST it to Druid in a new terminal window from the druid-#{DRUIDVERSION} directory:
 
 ```bash
-curl -X 'POST' -H 'Content-Type:application/json' -d @my-index-task.json OVERLORD_IP:8090/druid/indexer/v1/task
+curl -X 'POST' -H 'Content-Type:application/json' -d @quickstart/tutorial/wikipedia-index.json http://localhost:8090/druid/indexer/v1/task
 ```
 
-If you're running everything on a single machine, you can use localhost:
+Which will print the ID of the task if the submission was successful:
 
 ```bash
-curl -X 'POST' -H 'Content-Type:application/json' -d @my-index-task.json localhost:8090/druid/indexer/v1/task
+{"task":"index_wikipedia_2018-06-09T21:30:32.802Z"}
 ```
 
-If anything goes wrong with this task (e.g. it finishes with status FAILED), you can troubleshoot 
-by visiting the "Task log" on the [overlord console](http://localhost:8090/console.html).
-
-## Querying your data
+To view the status of the ingestion task, go to the overlord console:
+[http://localhost:8090/console.html](http://localhost:8090/console.html). You can refresh the console periodically, and after
+the task is successful, you should see a "SUCCESS" status for the task.
 
-Your data should become fully available within a minute or two. You can monitor this process on 
-your Coordinator console at [http://localhost:8081/#/](http://localhost:8081/#/).
+After the ingestion task finishes, the data will be loaded by historical nodes and available for
+querying within a minute or two. You can monitor the progress of loading the data in the
+coordinator console, by checking whether there is a datasource "wikipedia" with a blue circle
+indicating "fully available": [http://localhost:8081/#/](http://localhost:8081/#/).
 
-Once your data is fully available, you can query it using any of the 
-[supported query methods](../querying/querying.html).
+![Coordinator console](../tutorials/img/tutorial-batch-01.png "Wikipedia 100% loaded")
 
 ## Further reading
 
diff --git a/docs/content/tutorials/tutorial-compaction.md b/docs/content/tutorials/tutorial-compaction.md
new file mode 100644
index 00000000000..c229d386b34
--- /dev/null
+++ b/docs/content/tutorials/tutorial-compaction.md
@@ -0,0 +1,106 @@
+---
+layout: doc_page
+---
+
+# Tutorial: Compacting segments
+
+This tutorial demonstrates how to compact existing segments into fewer but larger segments.
+
+Because there is some per-segment memory and processing overhead, it can sometimes be beneficial to reduce the total number of segments.
+
+For this tutorial, we'll assume you've already downloaded Druid as described in 
+the [single-machine quickstart](index.html) and have it running on your local machine. 
+
+It will also be helpful to have finished [Tutorial: Loading a file](/docs/VERSION/tutorials/tutorial-batch.html) and [Tutorial: Querying data](/docs/VERSION/tutorials/tutorial-query.html).
+
+## Load the initial data
+
+For this tutorial, we'll be using the Wikipedia edits sample data, with an ingestion task spec that will create a separate segment for each hour in the input data.
+
+The ingestion spec can be found at `quickstart/tutorial/compaction-init-index.json`. Let's submit that spec, which will create a datasource called `compaction-tutorial`:
+
+```
+bin/post-index-task --file quickstart/tutorial/compaction-init-index.json 
+```
+
+After the ingestion completes, go to http://localhost:8081/#/datasources/compaction-tutorial in a browser to view information about the new datasource in the Coordinator console.
+
+There will be 24 segments for this datasource, one segment per hour in the input data:
+
+![Original segments](../tutorials/img/tutorial-retention-01.png "Original segments")
+
+Running a COUNT(*) query on this datasource shows that there are 39,244 rows:
+
+```
+dsql> select count(*) from "compaction-tutorial";
+┌────────┐
+│ EXPR$0 │
+├────────┤
+│  39244 │
+└────────┘
+Retrieved 1 row in 1.38s.
+```
+
+## Compact the data
+
+Let's now combine these 24 segments into one segment.
+
+We have included a compaction task spec for this tutorial datasource at `quickstart/tutorial/compaction-final-index.json`:
+
+```
+{
+  "type": "compact",
+  "dataSource": "compaction-tutorial",
+  "interval": "2015-09-12/2015-09-13",
+  "tuningConfig" : {
+    "type" : "index",
+    "targetPartitionSize" : 5000000,
+    "maxRowsInMemory" : 25000,
+    "forceExtendableShardSpecs" : true
+  }
+}
+```
+
+This will compact all segments for the interval `2015-09-12/2015-09-13` in the `compaction-tutorial` datasource. 
+
+The parameters in the `tuningConfig` control how many segments will be present in the compacted set of segments. 
+
+In this tutorial example, only one compacted segment will be created, as the 39244 rows in the input is less than the 5000000 `targetPartitionSize`.
+
+Let's submit this task now:
+
+```
+bin/post-index-task --file quickstart/tutorial/compaction-final-index.json 
+```
+
+After the task finishes, refresh the http://localhost:8081/#/datasources/compaction-tutorial page.
+
+The original 24 segments will eventually be marked as "unused" by the Coordinator and removed, with the new compacted segment remaining. 
+
+By default, the Druid coordinator will not mark segments as unused until the coordinator process has been up for at least 15 minutes, so you may see the old segment set and the new compacted set at the same time in the coordinator, e.g.:
+
+![Compacted segments intermediate state](../tutorials/img/tutorial-compaction-01.png "Compacted segments intermediate state")
+
+The new compacted segment has a more recent version than the original segments, so even when both sets of segments are shown by the coordinator, queries will only read from the new compacted segment.
+
+Let's try running a COUNT(*) on `compaction-tutorial` again, where the row count should still be 39,244:
+
+```
+dsql> select count(*) from "compaction-tutorial";
+┌────────┐
+│ EXPR$0 │
+├────────┤
+│  39244 │
+└────────┘
+Retrieved 1 row in 1.30s.
+```
+
+After the coordinator has been running for at least 15 minutes, the http://localhost:8081/#/datasources/compaction-tutorial page should show there is only 1 segment:
+
+![Compacted segments final state](../tutorials/img/tutorial-compaction-02.png "Compacted segments final state")
+
+## Further reading
+
+[Task documentation](../ingestion/tasks.html)
+
+[Segment optimization](../operations/segment-optimization.html)
diff --git a/docs/content/tutorials/tutorial-delete-data.md b/docs/content/tutorials/tutorial-delete-data.md
new file mode 100644
index 00000000000..cb53dd2697f
--- /dev/null
+++ b/docs/content/tutorials/tutorial-delete-data.md
@@ -0,0 +1,156 @@
+---
+layout: doc_page
+---
+
+# Tutorial: Deleting data
+
+This tutorial demonstrates how to delete existing data.
+
+For this tutorial, we'll assume you've already downloaded Druid as described in 
+the [single-machine quickstart](index.html) and have it running on your local machine. 
+
+Completing [Tutorial: Configuring retention](/docs/VERSION/tutorials/tutorial-retention.html) first is highly recommended, as we will be using retention rules in this tutorial.
+
+## Load initial data
+
+In this tutorial, we will use the Wikipedia edits data, with an indexing spec that creates hourly segments. This spec is located at `quickstart/tutorial/deletion-index.json`, and it creates a datasource called `deletion-tutorial`.
+
+Let's load this initial data:
+
+```
+bin/post-index-task --file quickstart/tutorial/deletion-index.json 
+```
+
+When the load finishes, open http://localhost:8081/#/datasources/deletion-tutorial in a browser.
+
+## How to permanently delete data
+
+Permanent deletion of a Druid segment has two steps:
+
+1. The segment must first be marked as "unused". This occurs when a segment is dropped by retention rules, and when a user manually disables a segment through the Coordinator API. This tutorial will cover both cases.
+2. After segments have been marked as "unused", a Kill Task will delete any "unused" segments from Druid's metadata store as well as deep storage.
+
+Let's drop some segments now, first with load rules, then manually.
+
+## Drop some data with load rules
+
+As with the previous retention tutorial, there are currently 24 segments in the `deletion-tutorial` datasource.
+
+Click the `edit rules` button with a pencil icon at the upper left corner of the page.
+
+A rule configuration window will appear. Enter `tutorial` for both the user and changelog comment field.
+
+Now click the `+ Add a rule` button twice. 
+
+In the `rule #1` box at the top, click `Load`, `Interval`, enter `2015-09-12T12:00:00.000Z/2015-09-13T00:00:00.000Z` in the interval box, and click `+ _default_tier replicant`.
+
+In the `rule #2` box at the bottom, click `Drop` and `Forever`.
+
+This will cause the first 12 segments of `deletion-tutorial` to be dropped. However, these dropped segments are not removed from deep storage.
+
+You can see that all 24 segments are still present in deep storage by listing the contents of `druid-{DRUIDVERSION}/var/druid/segments/deletion-tutorial`:
+
+```
+$ ls -l1 var/druid/segments/deletion-tutorial/
+2015-09-12T00:00:00.000Z_2015-09-12T01:00:00.000Z
+2015-09-12T01:00:00.000Z_2015-09-12T02:00:00.000Z
+2015-09-12T02:00:00.000Z_2015-09-12T03:00:00.000Z
+2015-09-12T03:00:00.000Z_2015-09-12T04:00:00.000Z
+2015-09-12T04:00:00.000Z_2015-09-12T05:00:00.000Z
+2015-09-12T05:00:00.000Z_2015-09-12T06:00:00.000Z
+2015-09-12T06:00:00.000Z_2015-09-12T07:00:00.000Z
+2015-09-12T07:00:00.000Z_2015-09-12T08:00:00.000Z
+2015-09-12T08:00:00.000Z_2015-09-12T09:00:00.000Z
+2015-09-12T09:00:00.000Z_2015-09-12T10:00:00.000Z
+2015-09-12T10:00:00.000Z_2015-09-12T11:00:00.000Z
+2015-09-12T11:00:00.000Z_2015-09-12T12:00:00.000Z
+2015-09-12T12:00:00.000Z_2015-09-12T13:00:00.000Z
+2015-09-12T13:00:00.000Z_2015-09-12T14:00:00.000Z
+2015-09-12T14:00:00.000Z_2015-09-12T15:00:00.000Z
+2015-09-12T15:00:00.000Z_2015-09-12T16:00:00.000Z
+2015-09-12T16:00:00.000Z_2015-09-12T17:00:00.000Z
+2015-09-12T17:00:00.000Z_2015-09-12T18:00:00.000Z
+2015-09-12T18:00:00.000Z_2015-09-12T19:00:00.000Z
+2015-09-12T19:00:00.000Z_2015-09-12T20:00:00.000Z
+2015-09-12T20:00:00.000Z_2015-09-12T21:00:00.000Z
+2015-09-12T21:00:00.000Z_2015-09-12T22:00:00.000Z
+2015-09-12T22:00:00.000Z_2015-09-12T23:00:00.000Z
+2015-09-12T23:00:00.000Z_2015-09-13T00:00:00.000Z
+```
+
+## Manually disable a segment
+
+Let's manually disable a segment now. This will mark a segment as "unused", but not remove it from deep storage.
+
+On http://localhost:8081/#/datasources/deletion-tutorial, click one of the remaining segments on the left for full details about the segment:
+
+![Segments](../tutorials/img/tutorial-deletion-01.png "Segments")
+
+The top of the info box shows the full segment ID, e.g. `deletion-tutorial_2016-06-27T14:00:00.000Z_2016-06-27T15:00:00.000Z_2018-07-27T22:57:00.110Z` for the segment of hour 14.
+
+Let's disable the hour 14 segment by sending the following DELETE request to the coordinator, where {SEGMENT-ID} is the full segment ID shown in the info box:
+
+```
+curl -XDELETE http://localhost:8081/druid/coordinator/v1/datasources/deletion-tutorial/segments/{SEGMENT-ID}
+```
+
+After that command completes, you should see that the segment for hour 14 has been disabled:
+
+![Segments 2](../tutorials/img/tutorial-deletion-02.png "Segments 2")
+
+Note that the hour 14 segment is still in deep storage:
+
+```
+$ ls -l1 var/druid/segments/deletion-tutorial/
+2015-09-12T00:00:00.000Z_2015-09-12T01:00:00.000Z
+2015-09-12T01:00:00.000Z_2015-09-12T02:00:00.000Z
+2015-09-12T02:00:00.000Z_2015-09-12T03:00:00.000Z
+2015-09-12T03:00:00.000Z_2015-09-12T04:00:00.000Z
+2015-09-12T04:00:00.000Z_2015-09-12T05:00:00.000Z
+2015-09-12T05:00:00.000Z_2015-09-12T06:00:00.000Z
+2015-09-12T06:00:00.000Z_2015-09-12T07:00:00.000Z
+2015-09-12T07:00:00.000Z_2015-09-12T08:00:00.000Z
+2015-09-12T08:00:00.000Z_2015-09-12T09:00:00.000Z
+2015-09-12T09:00:00.000Z_2015-09-12T10:00:00.000Z
+2015-09-12T10:00:00.000Z_2015-09-12T11:00:00.000Z
+2015-09-12T11:00:00.000Z_2015-09-12T12:00:00.000Z
+2015-09-12T12:00:00.000Z_2015-09-12T13:00:00.000Z
+2015-09-12T13:00:00.000Z_2015-09-12T14:00:00.000Z
+2015-09-12T14:00:00.000Z_2015-09-12T15:00:00.000Z
+2015-09-12T15:00:00.000Z_2015-09-12T16:00:00.000Z
+2015-09-12T16:00:00.000Z_2015-09-12T17:00:00.000Z
+2015-09-12T17:00:00.000Z_2015-09-12T18:00:00.000Z
+2015-09-12T18:00:00.000Z_2015-09-12T19:00:00.000Z
+2015-09-12T19:00:00.000Z_2015-09-12T20:00:00.000Z
+2015-09-12T20:00:00.000Z_2015-09-12T21:00:00.000Z
+2015-09-12T21:00:00.000Z_2015-09-12T22:00:00.000Z
+2015-09-12T22:00:00.000Z_2015-09-12T23:00:00.000Z
+2015-09-12T23:00:00.000Z_2015-09-13T00:00:00.000Z
+```
+
+## Run a kill task
+
+Now that we have disabled some segments, we can submit a Kill Task, which will delete the disabled segments from metadata and deep storage.
+
+A Kill Task spec has been provided at `quickstart/deletion-kill.json`. Submit this task to the Overlord with the following command:
+
+```
+curl -X 'POST' -H 'Content-Type:application/json' -d @quickstart/tutorial/deletion-kill.json http://localhost:8090/druid/indexer/v1/task
+```
+
+After this task completes, you can see that the disabled segments have now been removed from deep storage:
+
+```
+$ ls -l1 var/druid/segments/deletion-tutorial/
+2015-09-12T12:00:00.000Z_2015-09-12T13:00:00.000Z
+2015-09-12T13:00:00.000Z_2015-09-12T14:00:00.000Z
+2015-09-12T15:00:00.000Z_2015-09-12T16:00:00.000Z
+2015-09-12T16:00:00.000Z_2015-09-12T17:00:00.000Z
+2015-09-12T17:00:00.000Z_2015-09-12T18:00:00.000Z
+2015-09-12T18:00:00.000Z_2015-09-12T19:00:00.000Z
+2015-09-12T19:00:00.000Z_2015-09-12T20:00:00.000Z
+2015-09-12T20:00:00.000Z_2015-09-12T21:00:00.000Z
+2015-09-12T21:00:00.000Z_2015-09-12T22:00:00.000Z
+2015-09-12T22:00:00.000Z_2015-09-12T23:00:00.000Z
+2015-09-12T23:00:00.000Z_2015-09-13T00:00:00.000Z
+```
\ No newline at end of file
diff --git a/docs/content/tutorials/tutorial-ingestion-spec.md b/docs/content/tutorials/tutorial-ingestion-spec.md
new file mode 100644
index 00000000000..66484eac07d
--- /dev/null
+++ b/docs/content/tutorials/tutorial-ingestion-spec.md
@@ -0,0 +1,642 @@
+---
+layout: doc_page
+---
+
+# Tutorial: Writing an ingestion spec
+
+This tutorial will guide the reader through the process of defining an ingestion spec, pointing out key considerations and guidelines.
+
+For this tutorial, we'll assume you've already downloaded Druid as described in 
+the [single-machine quickstart](index.html) and have it running on your local machine. 
+
+It will also be helpful to have finished [Tutorial: Loading a file](/docs/VERSION/tutorials/tutorial-batch.html), [Tutorial: Querying data](/docs/VERSION/tutorials/tutorial-query.html), and [Tutorial: Rollup](/docs/VERSION/tutorials/tutorial-rollup.html).
+
+## Example data
+
+Suppose we have the following network flow data:
+
+* `srcIP`: IP address of sender
+* `srcPort`: Port of sender
+* `dstIP`: IP address of receiver
+* `dstPort`: Port of receiver
+* `protocol`: IP protocol number
+* `packets`: number of packets transmitted
+* `bytes`: number of bytes transmitted
+* `cost`: the cost of sending the traffic
+
+```
+{"ts":"2018-01-01T01:01:35Z","srcIP":"1.1.1.1", "dstIP":"2.2.2.2", "srcPort":2000, "dstPort":3000, "protocol": 6, "packets":10, "bytes":1000, "cost": 1.4}
+{"ts":"2018-01-01T01:01:51Z","srcIP":"1.1.1.1", "dstIP":"2.2.2.2", "srcPort":2000, "dstPort":3000, "protocol": 6, "packets":20, "bytes":2000, "cost": 3.1}
+{"ts":"2018-01-01T01:01:59Z","srcIP":"1.1.1.1", "dstIP":"2.2.2.2", "srcPort":2000, "dstPort":3000, "protocol": 6, "packets":30, "bytes":3000, "cost": 0.4}
+{"ts":"2018-01-01T01:02:14Z","srcIP":"1.1.1.1", "dstIP":"2.2.2.2", "srcPort":5000, "dstPort":7000, "protocol": 6, "packets":40, "bytes":4000, "cost": 7.9}
+{"ts":"2018-01-01T01:02:29Z","srcIP":"1.1.1.1", "dstIP":"2.2.2.2", "srcPort":5000, "dstPort":7000, "protocol": 6, "packets":50, "bytes":5000, "cost": 10.2}
+{"ts":"2018-01-01T01:03:29Z","srcIP":"1.1.1.1", "dstIP":"2.2.2.2", "srcPort":5000, "dstPort":7000, "protocol": 6, "packets":60, "bytes":6000, "cost": 4.3}
+{"ts":"2018-01-01T02:33:14Z","srcIP":"7.7.7.7", "dstIP":"8.8.8.8", "srcPort":4000, "dstPort":5000, "protocol": 17, "packets":100, "bytes":10000, "cost": 22.4}
+{"ts":"2018-01-01T02:33:45Z","srcIP":"7.7.7.7", "dstIP":"8.8.8.8", "srcPort":4000, "dstPort":5000, "protocol": 17, "packets":200, "bytes":20000, "cost": 34.5}
+{"ts":"2018-01-01T02:35:45Z","srcIP":"7.7.7.7", "dstIP":"8.8.8.8", "srcPort":4000, "dstPort":5000, "protocol": 17, "packets":300, "bytes":30000, "cost": 46.3}
+```
+
+Save the JSON contents above into a file called `ingestion-tutorial-data.json` in `quickstart/`.
+
+Let's walk through the process of defining an ingestion spec that can load this data. 
+
+For this tutorial, we will be using the native batch indexing task. When using other task types, some aspects of the ingestion spec will differ, and this tutorial will point out such areas.
+
+## Defining the schema
+
+The core element of a Druid ingestion spec is the `dataSchema`. The `dataSchema` defines how to parse input data into a set of columns that will be stored in Druid.
+
+Let's start with an empty `dataSchema` and add fields to it as we progress through the tutorial.
+
+Create a new file called `ingestion-tutorial-index.json` in `quickstart/` with the following contents:
+
+```json
+"dataSchema" : {}
+```
+
+We will be making successive edits to this ingestion spec as we progress through the tutorial.
+
+### Datasource name
+
+The datasource name is specified by the `dataSource` parameter in the `dataSchema`.
+
+```json
+"dataSchema" : {
+  "dataSource" : "ingestion-tutorial",
+}
+```
+
+Let's call the tutorial datasource `ingestion-tutorial`.
+
+### Choose a parser
+
+A `dataSchema` has a `parser` field, which defines the parser that Druid will use to interpret the input data.
+
+Since our input data is represented as JSON strings, we'll use a `string` parser with `json` format:
+
+```
+"dataSchema" : {
+  "dataSource" : "ingestion-tutorial",
+  "parser" : {
+    "type" : "string",
+    "parseSpec" : {
+      "format" : "json"
+    }
+  }
+}
+```
+
+### Time column
+
+The `parser` needs to know how to extract the main timestamp field from the input data. When using a `json` type `parseSpec`, the timestamp is defined in a `timestampSpec`. 
+
+The timestamp column in our input data is named "ts", containing ISO 8601 timestamps, so let's add a `timestampSpec` with that information to the `parseSpec`:
+
+```
+"dataSchema" : {
+  "dataSource" : "ingestion-tutorial",
+  "parser" : {
+    "type" : "string",
+    "parseSpec" : {
+      "format" : "json",
+      "timestampSpec" : {
+        "format" : "iso",
+        "column" : "ts"
+      }
+    }
+  }
+}
+```
+
+### Column types
+
+Now that we've defined the time column, let's look at definitions for other columns.
+
+Druid supports the following column types: String, Long, Float, Double. We will see how these are used in the following sections.
+
+Before we move on to how we define our other non-time columns, let's discuss `rollup` first.
+
+### Rollup
+
+When ingesting data, we must consider whether we wish to use rollup or not.
+
+* If rollup is enabled, we will need to separate the input columns into two categories, "dimensions" and "metrics". "Dimensions" are the grouping columns for rollup, while "metrics" are the columns that will be aggregated.
+
+* If rollup is disabled, then all columns are treated as "dimensions" and no pre-aggregation occurs.
+
+For this tutorial, let's enable rollup. This is specified with a `granularitySpec` on the `dataSchema`. 
+
+Note that the `granularitySpec` lies outside of the `parser`. We will revist the `parser` soon when we define our dimensions and metrics.
+
+```
+"dataSchema" : {
+  "dataSource" : "ingestion-tutorial",
+  "parser" : {
+    "type" : "string",
+    "parseSpec" : {
+      "format" : "json",
+      "timestampSpec" : {
+        "format" : "iso",
+        "column" : "ts"
+      }
+    }
+  },
+  "granularitySpec" : {
+    "rollup" : true
+  }
+}
+
+```
+
+#### Choosing dimensions and metrics
+
+For this example dataset, the following is a sensible split for "dimensions" and "metrics":
+
+* Dimensions: srcIP, srcPort, dstIP, dstPort, protocol
+* Metrics: packets, bytes, cost
+
+The dimensions here are a group of properties that identify a unidirectional flow of IP traffic, while the metrics represent facts about the IP traffic flow specified by a dimension grouping.
+
+Let's look at how to define these dimensions and metrics within the ingestion spec.
+
+#### Dimensions
+
+Dimensions are specified with a `dimensionsSpec` inside the `parseSpec`.
+
+```
+"dataSchema" : {
+  "dataSource" : "ingestion-tutorial",
+  "parser" : {
+    "type" : "string",
+    "parseSpec" : {
+      "format" : "json",
+      "timestampSpec" : {
+        "format" : "iso",
+        "column" : "ts"
+      },
+      "dimensionsSpec" : {
+        "dimensions": [
+          "srcIP",
+          { "name" : "srcPort", "type" : "long" },
+          { "name" : "dstIP", "type" : "string" },
+          { "name" : "dstPort", "type" : "long" },
+          { "name" : "protocol", "type" : "string" }
+        ]
+      }
+    }
+  },
+  "granularitySpec" : {
+    "rollup" : true
+  }
+}
+```
+
+Each dimension has a `name` and a `type`, where `type` can be "long", "float", "double", or "string".
+
+Note that `srcIP` is a "string" dimension; for string dimensions, it is enough to specify just a dimension name, since "string" is the default dimension type.
+
+Also note that `protocol` is a numeric value in the input data, but we are ingesting it as a "string" column; Druid will coerce the input longs to strings during ingestion.
+ 
+##### Strings vs. Numerics
+
+Should a numeric input be ingested as a numeric dimension or as a string dimension?
+
+Numeric dimensions have the following pros/cons relative to String dimensions:
+* Pros: Numeric representation can result in smaller column sizes on disk and lower processing overhead when reading values from the column
+* Cons: Numeric dimensions do not have indices, so filtering on them will often be slower than filtering on an equivalent String dimension (which has bitmap indices)
+
+#### Metrics
+
+Metrics are specified with a `metricsSpec` inside the `dataSchema`:
+
+```json
+"dataSchema" : {
+  "dataSource" : "ingestion-tutorial",
+  "parser" : {
+    "type" : "string",
+    "parseSpec" : {
+      "format" : "json",
+      "timestampSpec" : {
+        "format" : "iso",
+        "column" : "ts"
+      },
+      "dimensionsSpec" : {
+        "dimensions": [
+          "srcIP",
+          { "name" : "srcPort", "type" : "long" },
+          { "name" : "dstIP", "type" : "string" },
+          { "name" : "dstPort", "type" : "long" },
+          { "name" : "protocol", "type" : "string" }
+        ]
+      }   
+    }
+  },
+  "metricsSpec" : [
+    { "type" : "count", "name" : "count" },
+    { "type" : "longSum", "name" : "packets", "fieldName" : "packets" },
+    { "type" : "longSum", "name" : "bytes", "fieldName" : "bytes" },
+    { "type" : "doubleSum", "name" : "cost", "fieldName" : "cost" }
+  ],
+  "granularitySpec" : {
+    "rollup" : true
+  }
+}
+```
+
+When defining a metric, it is necessary to specify what type of aggregation should be performed on that column during rollup.
+
+Here we have defined long sum aggregations on the two long metric columns, `packets` and `bytes`, and a double sum aggregation for the `cost` column.
+
+Note that the `metricsSpec` is on a different nesting level than `dimensionSpec` or `parseSpec`; it belongs on the same nesting level as `parser` within the `dataSchema`.
+
+Note that we have also defined a `count` aggregator. The count aggregator will track how many rows in the original input data contributed to a "rolled up" row in the final ingested data.
+
+### No rollup
+
+If we were not using rollup, all columns would be specified in the `dimensionsSpec`, e.g.:
+
+```
+      "dimensionsSpec" : {
+        "dimensions": [
+          "srcIP",
+          { "name" : "srcPort", "type" : "long" },
+          { "name" : "dstIP", "type" : "string" },
+          { "name" : "dstPort", "type" : "long" },
+          { "name" : "protocol", "type" : "string" },
+          { "name" : "packets", "type" : "long" },
+          { "name" : "bytes", "type" : "long" },
+          { "name" : "srcPort", "type" : "double" }
+        ]
+      },
+```
+
+
+### Define granularities
+
+At this point, we are done defining the `parser` and `metricsSpec` within the `dataSchema` and we are almost done writing the ingestion spec.
+
+There are some additional properties we need to set in the `granularitySpec`:
+* Type of granularitySpec: `uniform` and `arbitrary` are the two supported types. For this tutorial, we will use a `uniform` granularity spec, where all segments have uniform interval sizes (for example, all segments cover an hour's worth of data).
+* The segment granularity: what size of time interval should a single segment contain data for? e.g., `DAY`, `WEEK`
+* The bucketing granularity of the timestamps in the time column (referred to as `queryGranularity`)
+
+#### Segment granularity
+
+Segment granularity is configured by the `segmentGranularity` property in the `granularitySpec`. For this tutorial, we'll create hourly segments:
+
+```
+"dataSchema" : {
+  "dataSource" : "ingestion-tutorial",
+  "parser" : {
+    "type" : "string",
+    "parseSpec" : {
+      "format" : "json",
+      "timestampSpec" : {
+        "format" : "iso",
+        "column" : "ts"
+      },
+      "dimensionsSpec" : {
+        "dimensions": [
+          "srcIP",
+          { "name" : "srcPort", "type" : "long" },
+          { "name" : "dstIP", "type" : "string" },
+          { "name" : "dstPort", "type" : "long" },
+          { "name" : "protocol", "type" : "string" }
+        ]
+      }      
+    }
+  },
+  "metricsSpec" : [
+    { "type" : "count", "name" : "count" },
+    { "type" : "longSum", "name" : "packets", "fieldName" : "packets" },
+    { "type" : "longSum", "name" : "bytes", "fieldName" : "bytes" },
+    { "type" : "doubleSum", "name" : "cost", "fieldName" : "cost" }
+  ],
+  "granularitySpec" : {
+    "type" : "uniform",
+    "segmentGranularity" : "HOUR",
+    "rollup" : true
+  }
+}
+```
+
+Our input data has events from two separate hours, so this task will generate two segments.
+
+#### Query granularity
+
+The query granularity is configured by the `queryGranularity` property in the `granularitySpec`. For this tutorial, let's use minute granularity:
+
+```
+"dataSchema" : {
+  "dataSource" : "ingestion-tutorial",
+  "parser" : {
+    "type" : "string",
+    "parseSpec" : {
+      "format" : "json",
+      "timestampSpec" : {
+        "format" : "iso",
+        "column" : "ts"
+      },
+      "dimensionsSpec" : {
+        "dimensions": [
+          "srcIP",
+          { "name" : "srcPort", "type" : "long" },
+          { "name" : "dstIP", "type" : "string" },
+          { "name" : "dstPort", "type" : "long" },
+          { "name" : "protocol", "type" : "string" }
+        ]
+      }      
+    }
+  },
+  "metricsSpec" : [
+    { "type" : "count", "name" : "count" },
+    { "type" : "longSum", "name" : "packets", "fieldName" : "packets" },
+    { "type" : "longSum", "name" : "bytes", "fieldName" : "bytes" },
+    { "type" : "doubleSum", "name" : "cost", "fieldName" : "cost" }
+  ],
+  "granularitySpec" : {
+    "type" : "uniform",
+    "segmentGranularity" : "HOUR",
+    "queryGranularity" : "MINUTE"
+    "rollup" : true
+  }
+}
+```
+
+To see the effect of the query granularity, let's look at this row from the raw input data:
+
+```
+{"ts":"2018-01-01T01:03:29Z","srcIP":"1.1.1.1", "dstIP":"2.2.2.2", "srcPort":5000, "dstPort":7000, "protocol": 6, "packets":60, "bytes":6000, "cost": 4.3}
+```
+
+When this row is ingested with minute queryGranularity, Druid will floor the row's timestamp to minute buckets:
+
+```
+{"ts":"2018-01-01T01:03:00Z","srcIP":"1.1.1.1", "dstIP":"2.2.2.2", "srcPort":5000, "dstPort":7000, "protocol": 6, "packets":60, "bytes":6000, "cost": 4.3}
+```
+
+#### Define an interval (batch only)
+
+For batch tasks, it is necessary to define a time interval. Input rows with timestamps outside of the time interval will not be ingested.
+
+The interval is also specified in the `granularitySpec`:
+
+```
+"dataSchema" : {
+  "dataSource" : "ingestion-tutorial",
+  "parser" : {
+    "type" : "string",
+    "parseSpec" : {
+      "format" : "json",
+      "timestampSpec" : {
+        "format" : "iso",
+        "column" : "ts"
+      },
+      "dimensionsSpec" : {
+        "dimensions": [
+          "srcIP",
+          { "name" : "srcPort", "type" : "long" },
+          { "name" : "dstIP", "type" : "string" },
+          { "name" : "dstPort", "type" : "long" },
+          { "name" : "protocol", "type" : "string" }
+        ]
+      }      
+    }
+  },
+  "metricsSpec" : [
+    { "type" : "count", "name" : "count" },
+    { "type" : "longSum", "name" : "packets", "fieldName" : "packets" },
+    { "type" : "longSum", "name" : "bytes", "fieldName" : "bytes" },
+    { "type" : "doubleSum", "name" : "cost", "fieldName" : "cost" }
+  ],
+  "granularitySpec" : {
+    "type" : "uniform",
+    "segmentGranularity" : "HOUR",
+    "queryGranularity" : "MINUTE",
+    "intervals" : ["2018-01-01/2018-01-02"],
+    "rollup" : true
+  }
+}
+```
+
+## Define the task type
+
+We've now finished defining our `dataSchema`. The remaining steps are to place the `dataSchema` we created into an ingestion task spec, and specify the input source.
+
+The `dataSchema` is shared across all task types, but each task type has its own specification format. For this tutorial, we will use the native batch ingestion task:
+
+```
+{
+  "type" : "index",
+  "spec" : {
+    "dataSchema" : {
+      "dataSource" : "ingestion-tutorial",
+      "parser" : {
+        "type" : "string",
+        "parseSpec" : {
+          "format" : "json",
+          "timestampSpec" : {
+            "format" : "iso",
+            "column" : "ts"
+          },
+          "dimensionsSpec" : {
+            "dimensions": [
+              "srcIP",
+              { "name" : "srcPort", "type" : "long" },
+              { "name" : "dstIP", "type" : "string" },
+              { "name" : "dstPort", "type" : "long" },
+              { "name" : "protocol", "type" : "string" }
+            ]              
+          }      
+        }
+      },
+      "metricsSpec" : [
+        { "type" : "count", "name" : "count" },
+        { "type" : "longSum", "name" : "packets", "fieldName" : "packets" },
+        { "type" : "longSum", "name" : "bytes", "fieldName" : "bytes" },
+        { "type" : "doubleSum", "name" : "cost", "fieldName" : "cost" }
+      ],
+      "granularitySpec" : {
+        "type" : "uniform",
+        "segmentGranularity" : "HOUR",
+        "queryGranularity" : "MINUTE",
+        "intervals" : ["2018-01-01/2018-01-02"],
+        "rollup" : true
+      }
+    }
+  }
+}
+```
+
+## Define the input source
+
+Now let's define our input source, which is specified in an `ioConfig` object. Each task type has its own type of `ioConfig`. The native batch task uses "firehoses" to read input data, so let's configure a "local" firehose to read the example netflow data we saved earlier:
+
+
+```
+    "ioConfig" : {
+      "type" : "index",
+      "firehose" : {
+        "type" : "local",
+        "baseDir" : "quickstart/",
+        "filter" : "ingestion-tutorial-data.json"
+      }
+    }
+```
+
+```
+{
+  "type" : "index",
+  "spec" : {
+    "dataSchema" : {
+      "dataSource" : "ingestion-tutorial",
+      "parser" : {
+        "type" : "string",
+        "parseSpec" : {
+          "format" : "json",
+          "timestampSpec" : {
+            "format" : "iso",
+            "column" : "ts"
+          },
+          "dimensionsSpec" : {
+            "dimensions": [
+              "srcIP",
+              { "name" : "srcPort", "type" : "long" },
+              { "name" : "dstIP", "type" : "string" },
+              { "name" : "dstPort", "type" : "long" },
+              { "name" : "protocol", "type" : "string" }
+            ]
+          }      
+        }
+      },
+      "metricsSpec" : [
+        { "type" : "count", "name" : "count" },
+        { "type" : "longSum", "name" : "packets", "fieldName" : "packets" },
+        { "type" : "longSum", "name" : "bytes", "fieldName" : "bytes" },
+        { "type" : "doubleSum", "name" : "cost", "fieldName" : "cost" }
+      ],
+      "granularitySpec" : {
+        "type" : "uniform",
+        "segmentGranularity" : "HOUR",
+        "queryGranularity" : "MINUTE",
+        "intervals" : ["2018-01-01/2018-01-02"],
+        "rollup" : true
+      }
+    },
+    "ioConfig" : {
+      "type" : "index",
+      "firehose" : {
+        "type" : "local",
+        "baseDir" : "quickstart/",
+        "filter" : "ingestion-tutorial-data.json"
+      }
+    }
+  }
+}
+```
+
+## Additional tuning
+
+Each ingestion task has a `tuningConfig` section that allows users to tune various ingestion parameters.
+
+As an example, let's add a `tuningConfig` that sets a target segment size for the native batch ingestion task:
+
+```
+    "tuningConfig" : {
+      "type" : "index",
+      "targetPartitionSize" : 5000000
+    }
+```
+
+Note that each ingestion task has its own type of `tuningConfig`.
+
+## Final spec
+
+We've finished defining the ingestion spec, it should now look like the following:
+
+```
+{
+  "type" : "index",
+  "spec" : {
+    "dataSchema" : {
+      "dataSource" : "ingestion-tutorial",
+      "parser" : {
+        "type" : "string",
+        "parseSpec" : {
+          "format" : "json",
+          "timestampSpec" : {
+            "format" : "iso",
+            "column" : "ts"
+          },
+          "dimensionsSpec" : {
+            "dimensions": [
+              "srcIP",
+              { "name" : "srcPort", "type" : "long" },
+              { "name" : "dstIP", "type" : "string" },
+              { "name" : "dstPort", "type" : "long" },
+              { "name" : "protocol", "type" : "string" }
+            ]
+          }      
+        }
+      },
+      "metricsSpec" : [
+        { "type" : "count", "name" : "count" },
+        { "type" : "longSum", "name" : "packets", "fieldName" : "packets" },
+        { "type" : "longSum", "name" : "bytes", "fieldName" : "bytes" },
+        { "type" : "doubleSum", "name" : "cost", "fieldName" : "cost" }
+      ],
+      "granularitySpec" : {
+        "type" : "uniform",
+        "segmentGranularity" : "HOUR",
+        "queryGranularity" : "MINUTE",
+        "intervals" : ["2018-01-01/2018-01-02"],
+        "rollup" : true
+      }
+    },
+    "ioConfig" : {
+      "type" : "index",
+      "firehose" : {
+        "type" : "local",
+        "baseDir" : "quickstart/",
+        "filter" : "ingestion-tutorial-data.json"
+      }
+    },
+    "tuningConfig" : {
+      "type" : "index",
+      "targetPartitionSize" : 5000000
+    }
+  }
+}
+```
+
+## Submit the task and query the data
+
+From the druid-${DRUIDVERSION} package root, run the following command:
+
+```
+bin/post-index-task --file quickstart/ingestion-tutorial-index.json 
+```
+
+After the script completes, we will query the data.
+
+Let's run `bin/dsql` and issue a `select * from "ingestion-tutorial";` query to see what data was ingested.
+
+```
+$ bin/dsql
+Welcome to dsql, the command-line client for Druid SQL.
+Type "\h" for help.
+dsql> select * from "ingestion-tutorial";
+
+┌──────────────────────────┬───────┬──────┬───────┬─────────┬─────────┬─────────┬──────────┬─────────┬─────────┐
+│ __time                   │ bytes │ cost │ count │ dstIP   │ dstPort │ packets │ protocol │ srcIP   │ srcPort │
+├──────────────────────────┼───────┼──────┼───────┼─────────┼─────────┼─────────┼──────────┼─────────┼─────────┤
+│ 2018-01-01T01:01:00.000Z │  6000 │  4.9 │     3 │ 2.2.2.2 │    3000 │      60 │ 6        │ 1.1.1.1 │    2000 │
+│ 2018-01-01T01:02:00.000Z │  9000 │ 18.1 │     2 │ 2.2.2.2 │    7000 │      90 │ 6        │ 1.1.1.1 │    5000 │
+│ 2018-01-01T01:03:00.000Z │  6000 │  4.3 │     1 │ 2.2.2.2 │    7000 │      60 │ 6        │ 1.1.1.1 │    5000 │
+│ 2018-01-01T02:33:00.000Z │ 30000 │ 56.9 │     2 │ 8.8.8.8 │    5000 │     300 │ 17       │ 7.7.7.7 │    4000 │
+│ 2018-01-01T02:35:00.000Z │ 30000 │ 46.3 │     1 │ 8.8.8.8 │    5000 │     300 │ 17       │ 7.7.7.7 │    4000 │
+└──────────────────────────┴───────┴──────┴───────┴─────────┴─────────┴─────────┴──────────┴─────────┴─────────┘
+Retrieved 5 rows in 0.12s.
+
+dsql> 
+```
diff --git a/docs/content/tutorials/tutorial-kafka.md b/docs/content/tutorials/tutorial-kafka.md
index 5242df76f9f..b936d42f47e 100644
--- a/docs/content/tutorials/tutorial-kafka.md
+++ b/docs/content/tutorials/tutorial-kafka.md
@@ -2,33 +2,26 @@
 layout: doc_page
 ---
 
-# Tutorial: Load from Kafka
+# Tutorial: Load streaming data from Kafka
 
 ## Getting started
 
-This tutorial shows you how to load data from Kafka into Druid.
+This tutorial demonstrates how to load data from a Kafka stream, using the Druid Kafka indexing service.
 
-For this tutorial, we'll assume you've already downloaded Druid and Tranquility as described in
-the [single-machine quickstart](quickstart.html) and have it running on your local machine. You
+For this tutorial, we'll assume you've already downloaded Druid as described in 
+the [single-machine quickstart](index.html) and have it running on your local machine. You 
 don't need to have loaded any data yet.
 
-<div class="note info">
-This tutorial will show you how to load data from Kafka into Druid, but Druid additionally supports
-a wide variety of batch and streaming loading methods. See the <a href="../ingestion/batch-ingestion.html">Loading files</a>
-and <a href="../ingestion/stream-ingestion.html">Loading streams</a> pages for more information about other options,
-including from Hadoop, HTTP, Storm, Samza, Spark Streaming, and your own JVM apps.
-</div>
-
-## Start Kafka
+## Download and start Kafka
 
 [Apache Kafka](http://kafka.apache.org/) is a high throughput message bus that works well with
-Druid.  For this tutorial, we will use Kafka 0.9.0.0. To download Kafka, issue the following
+Druid.  For this tutorial, we will use Kafka 0.10.2.0. To download Kafka, issue the following
 commands in your terminal:
 
 ```bash
-curl -O http://www.us.apache.org/dist/kafka/0.9.0.0/kafka_2.11-0.9.0.0.tgz
-tar -xzf kafka_2.11-0.9.0.0.tgz
-cd kafka_2.11-0.9.0.0
+curl -O https://archive.apache.org/dist/kafka/0.10.2.0/kafka_2.11-0.10.2.0.tgz
+tar -xzf kafka_2.11-0.10.2.0.tgz
+cd kafka_2.11-0.10.2.0
 ```
 
 Start a Kafka broker by running the following command in a new terminal:
@@ -37,149 +30,56 @@ Start a Kafka broker by running the following command in a new terminal:
 ./bin/kafka-server-start.sh config/server.properties
 ```
 
-Run this command to create a Kafka topic called *metrics*, to which we'll send data:
+Run this command to create a Kafka topic called *wikipedia*, to which we'll send data:
 
 ```bash
-./bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic metrics
+./bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic wikipedia
 ```
 
-## Send example data
-
-Let's launch a console producer for our topic and send some data!
-
-In your Druid directory, generate some metrics by running:
-
-```bash
-bin/generate-example-metrics
-```
+## Enable Druid Kafka ingestion
 
-In your Kafka directory, run:
+We will use Druid's Kafka indexing service to ingest messages from our newly created *wikipedia* topic. To start the
+service, we will need to submit a supervisor spec to the Druid overlord by running the following from the Imply directory:
 
 ```bash
-./bin/kafka-console-producer.sh --broker-list localhost:9092 --topic metrics
+curl -XPOST -H'Content-Type: application/json' -d @quickstart/tutorial/wikipedia-kafka-supervisor.json http://localhost:8090/druid/indexer/v1/supervisor
 ```
 
-The *kafka-console-producer* command is now awaiting input. Copy the generated example metrics,
-paste them into the *kafka-console-producer* terminal, and press enter. If you like, you can also
-paste more messages into the producer, or you can press CTRL-D to exit the console producer.
-
-You can immediately query this data, or you can skip ahead to the
-[Loading your own data](#loading-your-own-data) section if you'd like to load your own dataset.
-
-## Querying your data
-
-After sending data, you can immediately query it using any of the
-[supported query methods](../querying/querying.html).
-
-## Loading your own data
-
-So far, you've loaded data into Druid from Kafka using an ingestion spec that we've included in the
-distribution. Each ingestion spec is designed to work with a particular dataset. You load your own
-data types into Imply by writing a custom ingestion spec.
+If the supervisor was successfully created, you will get a response containing the ID of the supervisor; in our case we should see `{"id":"wikipedia-kafka"}`.
 
-You can write a custom ingestion spec by starting from the bundled configuration in
-`conf-quickstart/tranquility/kafka.json` and modifying it for your own needs.
+For more details about what's going on here, check out the
+[Druid Kafka indexing service documentation](http://druid.io/docs/{{druidVersion}}/development/extensions-core/kafka-ingestion.html).
 
-The most important questions are:
+## Load data
 
-  * What should the dataset be called? This is the "dataSource" field of the "dataSchema".
-  * Which field should be treated as a timestamp? This belongs in the "column" of the "timestampSpec".
-  * Which fields should be treated as dimensions? This belongs in the "dimensions" of the "dimensionsSpec".
-  * Which fields should be treated as measures? This belongs in the "metricsSpec".
+Let's launch a console producer for our topic and send some data!
 
-Let's use a small JSON pageviews dataset in the topic *pageviews* as an example, with records like:
+In your Druid directory, run the following command:
 
-```json
-{"time": "2000-01-01T00:00:00Z", "url": "/foo/bar", "user": "alice", "latencyMs": 32}
 ```
-
-First, create the topic:
-
-```bash
-./bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic pageviews
+cd quickstart
+gunzip -k wikipedia-2015-09-12-sampled.json.gz
 ```
 
-Next, edit `conf-quickstart/tranquility/kafka.json`:
-
-  * Let's call the dataset "pageviews-kafka".
-  * The timestamp is the "time" field.
-  * Good choices for dimensions are the string fields "url" and "user".
-  * Good choices for measures are a count of pageviews, and the sum of "latencyMs". Collecting that
-sum when we load the data will allow us to compute an average at query time as well.
-
-You can edit the existing `conf-quickstart/tranquility/kafka.json` file by altering these
-sections:
-
-  1. Change the key `"metrics-kafka"` under `"dataSources"` to `"pageviews-kafka"`
-  2. Alter these sections under the new `"pageviews-kafka"` key:
-  ```json
-  "dataSource": "pageviews-kafka"
-  ```
-
-  ```json
-  "timestampSpec": {
-       "format": "auto",
-       "column": "time"
-  }
-  ```
-
-  ```json
-  "dimensionsSpec": {
-       "dimensions": ["url", "user"]
-  }
-  ```
-
-  ```json
-  "metricsSpec": [
-       {"name": "views", "type": "count"},
-       {"name": "latencyMs", "type": "doubleSum", "fieldName": "latencyMs"}
-  ]
-  ```
-
-  ```json
-  "properties" : {
-       "task.partitions" : "1",
-       "task.replicants" : "1",
-       "topicPattern" : "pageviews"
-  }
-  ```
-
-Next, start Druid Kafka ingestion:
+In your Kafka directory, run the following command, where {PATH_TO_DRUID} is replaced by the path to the Druid directory:
 
 ```bash
-bin/tranquility kafka -configFile ../druid-#{DRUIDVERSION}/conf-quickstart/tranquility/kafka.json
+export KAFKA_OPTS="-Dfile.encoding=UTF-8"
+./bin/kafka-console-producer.sh --broker-list localhost:9092 --topic wikipedia < {PATH_TO_DRUID}/quickstart/wikipedia-2015-09-12-sampled.json
 ```
 
-- If your Tranquility server or Kafka is already running, stop it (CTRL-C) and
-start it up again.
-
-Finally, send some data to the Kafka topic. Let's start with these messages:
-
-```json
-{"time": "2000-01-01T00:00:00Z", "url": "/foo/bar", "user": "alice", "latencyMs": 32}
-{"time": "2000-01-01T00:00:00Z", "url": "/", "user": "bob", "latencyMs": 11}
-{"time": "2000-01-01T00:00:00Z", "url": "/foo/bar", "user": "bob", "latencyMs": 45}
-```
+The previous command posted sample events to the *wikipedia* Kafka topic which were then ingested into Druid by the Kafka indexing service. You're now ready to run some queries!
 
-Druid streaming ingestion requires relatively current messages (relative to a slack time controlled by the
-[windowPeriod](../ingestion/stream-ingestion.html#segmentgranularity-and-windowperiod) value), so you should
-replace `2000-01-01T00:00:00Z` in these messages with the current time in ISO8601 format. You can
-get this by running:
+## Querying your data
 
-```bash
-python -c 'import datetime; print(datetime.datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%SZ"))'
-```
+After data is sent to the Kafka stream, it is immediately available for querying.
 
-Update the timestamps in the JSON above, then copy and paste these messages into this console
-producer and press enter:
+Please follow the [query tutorial](../tutorial/tutorial-query.html) to run some example queries on the newly loaded data.
 
-```bash
-./bin/kafka-console-producer.sh --broker-list localhost:9092 --topic pageviews
-```
+## Cleanup
 
-That's it, your data should now be in Druid. You can immediately query it using any of the
-[supported query methods](../querying/querying.html).
+If you wish to go through any of the other ingestion tutorials, you will need to shut down the cluster and reset the cluster state by removing the contents of the `var` directory under the druid package, as the other tutorials will write to the same "wikipedia" datasource.
 
 ## Further reading
 
-To read more about loading streams, see our [streaming ingestion documentation](../ingestion/stream-ingestion.html).
+For more information on loading data from Kafka streams, please see the [Druid Kafka indexing service documentation](http://druid.io/docs/{{druidVersion}}/development/extensions-core/kafka-ingestion.html).
diff --git a/docs/content/tutorials/tutorial-query.md b/docs/content/tutorials/tutorial-query.md
new file mode 100644
index 00000000000..0767771a363
--- /dev/null
+++ b/docs/content/tutorials/tutorial-query.md
@@ -0,0 +1,280 @@
+---
+layout: doc_page
+---
+
+# Tutorial: Querying data
+
+This tutorial will demonstrate how to query data in Druid, with examples for Druid's native query format and Druid SQL.
+
+The tutorial assumes that you've already completed one of the 4 ingestion tutorials, as we will be querying the sample Wikipedia edits data.
+
+* [Tutorial: Loading a file](/docs/VERSION/tutorials/tutorial-batch.html)
+* [Tutorial: Loading stream data from Kafka](/docs/VERSION/tutorials/tutorial-kafka.html)
+* [Tutorial: Loading a file using Hadoop](/docs/VERSION/tutorials/tutorial-batch-hadoop.html)
+* [Tutorial: Loading stream data using Tranquility](/docs/VERSION/tutorials/tutorial-tranquility.html)
+
+## Native JSON queries
+
+Druid's native query format is expressed in JSON. We have included a sample native TopN query under `quickstart/tutorial/wikipedia-top-pages.json`:
+
+```json
+{
+  "queryType" : "topN",
+  "dataSource" : "wikipedia",
+  "intervals" : ["2015-09-12/2015-09-13"],
+  "granularity" : "all",
+  "dimension" : "page",
+  "metric" : "count",
+  "threshold" : 10,
+  "aggregations" : [
+    {
+      "type" : "count",
+      "name" : "count"
+    }
+  ]
+}
+```
+
+This query retrieves the 10 Wikipedia pages with the most page edits on 2015-09-12.
+
+Let's submit this query to the Druid broker:
+
+```bash
+curl -X 'POST' -H 'Content-Type:application/json' -d @quickstart/tutorial/wikipedia-top-pages.json http://localhost:8082/druid/v2?pretty
+```
+
+You should see the following query results:
+
+```json
+[ {
+  "timestamp" : "2015-09-12T00:46:58.771Z",
+  "result" : [ {
+    "count" : 33,
+    "page" : "Wikipedia:Vandalismusmeldung"
+  }, {
+    "count" : 28,
+    "page" : "User:Cyde/List of candidates for speedy deletion/Subpage"
+  }, {
+    "count" : 27,
+    "page" : "Jeremy Corbyn"
+  }, {
+    "count" : 21,
+    "page" : "Wikipedia:Administrators' noticeboard/Incidents"
+  }, {
+    "count" : 20,
+    "page" : "Flavia Pennetta"
+  }, {
+    "count" : 18,
+    "page" : "Total Drama Presents: The Ridonculous Race"
+  }, {
+    "count" : 18,
+    "page" : "User talk:Dudeperson176123"
+  }, {
+    "count" : 18,
+    "page" : "Wikipédia:Le Bistro/12 septembre 2015"
+  }, {
+    "count" : 17,
+    "page" : "Wikipedia:In the news/Candidates"
+  }, {
+    "count" : 17,
+    "page" : "Wikipedia:Requests for page protection"
+  } ]
+} ]
+```
+
+## Druid SQL queries
+
+Druid also supports a dialect of SQL for querying. Let's run a SQL query that is equivalent to the native JSON query shown above:
+
+```
+SELECT page, COUNT(*) AS Edits FROM wikipedia WHERE "__time" BETWEEN TIMESTAMP '2015-09-12 00:00:00' AND TIMESTAMP '2015-09-13 00:00:00' GROUP BY page ORDER BY Edits DESC LIMIT 10;
+```
+
+The SQL queries are submitted as JSON over HTTP.
+
+### TopN query example
+
+The tutorial package includes an example file that contains the SQL query shown above at `quickstart/wikipedia-top-pages-sql.json`. Let's submit that query to the Druid broker:
+
+```bash
+curl -X 'POST' -H 'Content-Type:application/json' -d @quickstart/tutorial/wikipedia-top-pages-sql.json http://localhost:8082/druid/v2/sql
+```
+
+The following results should be returned:
+
+```
+[
+  {
+    "page": "Wikipedia:Vandalismusmeldung",
+    "Edits": 33
+  },
+  {
+    "page": "User:Cyde/List of candidates for speedy deletion/Subpage",
+    "Edits": 28
+  },
+  {
+    "page": "Jeremy Corbyn",
+    "Edits": 27
+  },
+  {
+    "page": "Wikipedia:Administrators' noticeboard/Incidents",
+    "Edits": 21
+  },
+  {
+    "page": "Flavia Pennetta",
+    "Edits": 20
+  },
+  {
+    "page": "Total Drama Presents: The Ridonculous Race",
+    "Edits": 18
+  },
+  {
+    "page": "User talk:Dudeperson176123",
+    "Edits": 18
+  },
+  {
+    "page": "Wikipédia:Le Bistro/12 septembre 2015",
+    "Edits": 18
+  },
+  {
+    "page": "Wikipedia:In the news/Candidates",
+    "Edits": 17
+  },
+  {
+    "page": "Wikipedia:Requests for page protection",
+    "Edits": 17
+  }
+]
+```
+
+### dsql client
+
+For convenience, the Druid package includes a SQL command-line client, located at `bin/dsql` from the Druid package root.
+
+Let's now run `bin/dsql`; you should see the following prompt:
+
+```
+Welcome to dsql, the command-line client for Druid SQL.
+Type "\h" for help.
+dsql> 
+```
+
+To submit the query, paste it to the `dsql` prompt and press enter:
+
+```
+dsql> SELECT page, COUNT(*) AS Edits FROM wikipedia WHERE "__time" BETWEEN TIMESTAMP '2015-09-12 00:00:00' AND TIMESTAMP '2015-09-13 00:00:00' GROUP BY page ORDER BY Edits DESC LIMIT 10;
+┌──────────────────────────────────────────────────────────┬───────┐
+│ page                                                     │ Edits │
+├──────────────────────────────────────────────────────────┼───────┤
+│ Wikipedia:Vandalismusmeldung                             │    33 │
+│ User:Cyde/List of candidates for speedy deletion/Subpage │    28 │
+│ Jeremy Corbyn                                            │    27 │
+│ Wikipedia:Administrators' noticeboard/Incidents          │    21 │
+│ Flavia Pennetta                                          │    20 │
+│ Total Drama Presents: The Ridonculous Race               │    18 │
+│ User talk:Dudeperson176123                               │    18 │
+│ Wikipédia:Le Bistro/12 septembre 2015                    │    18 │
+│ Wikipedia:In the news/Candidates                         │    17 │
+│ Wikipedia:Requests for page protection                   │    17 │
+└──────────────────────────────────────────────────────────┴───────┘
+Retrieved 10 rows in 0.06s.
+```
+
+### Additional Druid SQL queries
+
+#### Timeseries
+
+`SELECT FLOOR(__time to HOUR) AS HourTime, SUM(deleted) AS LinesDeleted FROM wikipedia WHERE "__time" BETWEEN TIMESTAMP '2015-09-12 00:00:00' AND TIMESTAMP '2015-09-13 00:00:00' GROUP BY FLOOR(__time to HOUR);`
+
+```
+dsql> SELECT FLOOR(__time to HOUR) AS HourTime, SUM(deleted) AS LinesDeleted FROM wikipedia WHERE "__time" BETWEEN TIMESTAMP '2015-09-12 00:00:00' AND TIMESTAMP '2015-09-13 00:00:00' GROUP BY FLOOR(__time to HOUR);
+┌──────────────────────────┬──────────────┐
+│ HourTime                 │ LinesDeleted │
+├──────────────────────────┼──────────────┤
+│ 2015-09-12T00:00:00.000Z │         1761 │
+│ 2015-09-12T01:00:00.000Z │        16208 │
+│ 2015-09-12T02:00:00.000Z │        14543 │
+│ 2015-09-12T03:00:00.000Z │        13101 │
+│ 2015-09-12T04:00:00.000Z │        12040 │
+│ 2015-09-12T05:00:00.000Z │         6399 │
+│ 2015-09-12T06:00:00.000Z │         9036 │
+│ 2015-09-12T07:00:00.000Z │        11409 │
+│ 2015-09-12T08:00:00.000Z │        11616 │
+│ 2015-09-12T09:00:00.000Z │        17509 │
+│ 2015-09-12T10:00:00.000Z │        19406 │
+│ 2015-09-12T11:00:00.000Z │        16284 │
+│ 2015-09-12T12:00:00.000Z │        18672 │
+│ 2015-09-12T13:00:00.000Z │        30520 │
+│ 2015-09-12T14:00:00.000Z │        18025 │
+│ 2015-09-12T15:00:00.000Z │        26399 │
+│ 2015-09-12T16:00:00.000Z │        24759 │
+│ 2015-09-12T17:00:00.000Z │        19634 │
+│ 2015-09-12T18:00:00.000Z │        17345 │
+│ 2015-09-12T19:00:00.000Z │        19305 │
+│ 2015-09-12T20:00:00.000Z │        22265 │
+│ 2015-09-12T21:00:00.000Z │        16394 │
+│ 2015-09-12T22:00:00.000Z │        16379 │
+│ 2015-09-12T23:00:00.000Z │        15289 │
+└──────────────────────────┴──────────────┘
+Retrieved 24 rows in 0.08s.
+```
+
+#### GroupBy
+
+`SELECT channel, SUM(added) FROM wikipedia WHERE "__time" BETWEEN TIMESTAMP '2015-09-12 00:00:00' AND TIMESTAMP '2015-09-13 00:00:00' GROUP BY channel ORDER BY SUM(added) DESC LIMIT 5;`
+
+```
+dsql> SELECT channel, SUM(added) FROM wikipedia WHERE "__time" BETWEEN TIMESTAMP '2015-09-12 00:00:00' AND TIMESTAMP '2015-09-13 00:00:00' GROUP BY channel ORDER BY SUM(added) DESC LIMIT 5;
+┌───────────────┬─────────┐
+│ channel       │ EXPR$1  │
+├───────────────┼─────────┤
+│ #en.wikipedia │ 3045299 │
+│ #it.wikipedia │  711011 │
+│ #fr.wikipedia │  642555 │
+│ #ru.wikipedia │  640698 │
+│ #es.wikipedia │  634670 │
+└───────────────┴─────────┘
+Retrieved 5 rows in 0.05s.
+```
+
+#### Scan
+
+` SELECT user, page FROM wikipedia WHERE "__time" BETWEEN TIMESTAMP '2015-09-12 02:00:00' AND TIMESTAMP '2015-09-12 03:00:00' LIMIT 5;`
+
+```
+ dsql> SELECT user, page FROM wikipedia WHERE "__time" BETWEEN TIMESTAMP '2015-09-12 02:00:00' AND TIMESTAMP '2015-09-12 03:00:00' LIMIT 5;
+┌────────────────────────┬────────────────────────────────────────────────────────┐
+│ user                   │ page                                                   │
+├────────────────────────┼────────────────────────────────────────────────────────┤
+│ Thiago89               │ Campeonato Mundial de Voleibol Femenino Sub-20 de 2015 │
+│ 91.34.200.249          │ Friede von Schönbrunn                                  │
+│ TuHan-Bot              │ Trĩ vàng                                               │
+│ Lowercase sigmabot III │ User talk:ErrantX                                      │
+│ BattyBot               │ Hans W. Jung                                           │
+└────────────────────────┴────────────────────────────────────────────────────────┘
+Retrieved 5 rows in 0.04s.
+```
+
+#### EXPLAIN PLAN FOR
+
+By prepending `EXPLAIN PLAN FOR ` to a Druid SQL query, it is possible to see what native Druid queries a SQL query will plan into.
+
+Using the TopN query above as an example:
+
+`EXPLAIN PLAN FOR SELECT page, COUNT(*) AS Edits FROM wikipedia WHERE "__time" BETWEEN TIMESTAMP '2015-09-12 00:00:00' AND TIMESTAMP '2015-09-13 00:00:00' GROUP BY page ORDER BY Edits DESC LIMIT 10;`
+
+```
+dsql> EXPLAIN PLAN FOR SELECT page, COUNT(*) AS Edits FROM wikipedia WHERE "__time" BETWEEN TIMESTAMP '2015-09-12 00:00:00' AND TIMESTAMP '2015-09-13 00:00:00' GROUP BY page ORDER BY Edits DESC LIMIT 10;
+┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
+│ PLAN                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    │
+├─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
+│ DruidQueryRel(query=[{"queryType":"topN","dataSource":{"type":"table","name":"wikipedia"},"virtualColumns":[],"dimension":{"type":"default","dimension":"page","outputName":"d0","outputType":"STRING"},"metric":{"type":"numeric","metric":"a0"},"threshold":10,"intervals":{"type":"intervals","intervals":["2015-09-12T00:00:00.000Z/2015-09-13T00:00:00.001Z"]},"filter":null,"granularity":{"type":"all"},"aggregations":[{"type":"count","name":"a0"}],"postAggregations":[],"context":{},"descending":false}], signature=[{d0:STRING, a0:LONG}]) │
+└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
+Retrieved 1 row in 0.03s.
+```
+
+## Further reading
+
+The [Queries documentation](/docs/VERSION/querying/querying.html) has more information on Druid's native JSON queries.
+
+The [Druid SQL documentation](/docs/VERSION/querying/sql.html) has more information on using Druid SQL queries.
\ No newline at end of file
diff --git a/docs/content/tutorials/tutorial-retention.md b/docs/content/tutorials/tutorial-retention.md
new file mode 100644
index 00000000000..12b2e76745b
--- /dev/null
+++ b/docs/content/tutorials/tutorial-retention.md
@@ -0,0 +1,92 @@
+---
+layout: doc_page
+---
+
+# Tutorial: Configuring data retention
+
+This tutorial demonstrates how to configure retention rules on a datasource to set the time intervals of data that will be retained or dropped.
+
+For this tutorial, we'll assume you've already downloaded Druid as described in 
+the [single-machine quickstart](index.html) and have it running on your local machine. 
+
+It will also be helpful to have finished [Tutorial: Loading a file](/docs/VERSION/tutorials/tutorial-batch.html) and [Tutorial: Querying data](/docs/VERSION/tutorials/tutorial-query.html).
+
+## Load the example data
+
+For this tutorial, we'll be using the Wikipedia edits sample data, with an ingestion task spec that will create a separate segment for each hour in the input data.
+
+The ingestion spec can be found at `quickstart/retention-index.json`. Let's submit that spec, which will create a datasource called `retention-tutorial`:
+
+```
+bin/post-index-task --file quickstart/tutorial/retention-index.json 
+```
+
+After the ingestion completes, go to http://localhost:8081 in a browser to access the Coordinator console.
+ 
+In the Coordinator console, go to the `datasources` tab at the top of the page.
+
+This tab shows the available datasources and a summary of the retention rules for each datasource:
+
+![Summary](../tutorials/img/tutorial-retention-00.png "Summary")
+
+Currently there are no rules set for the `retention-tutorial` datasource. Note that there are default rules, currently set to `load Forever 2 in _default_tier`. 
+
+This means that all data will be loaded regardless of timestamp, and each segment will be replicated to two nodes in the default tier. 
+
+In this tutorial, we will ignore the tiering and redundancy concepts for now.
+
+Let's click the `retention-tutorial` datasource on the left. 
+
+The next page (http://localhost:8081/#/datasources/retention-tutorial) provides information about what segments a datasource contains. On the left, the page shows that there are 24 segments, each one containing data for a specific hour of 2015-09-12:
+
+![Original segments](../tutorials/img/tutorial-retention-01.png "Original segments")
+
+## Set retention rules
+
+Suppose we want to drop data for the first 12 hours of 2015-09-12 and keep data for the later 12 hours of 2015-09-12.
+
+Click the `edit rules` button with a pencil icon at the upper left corner of the page.
+
+A rule configuration window will appear. Enter `tutorial` for both the user and changelog comment field.
+
+Now click the `+ Add a rule` button twice. 
+
+In the `rule #1` box at the top, click `Load`, `Interval`, enter `2015-09-12T12:00:00.000Z/2015-09-13T00:00:00.000Z` in the interval box, and click `+ _default_tier replicant`.
+
+In the `rule #2` box at the bottom, click `Drop` and `Forever`.
+
+The rules should look like this:
+
+![Set rules](../tutorials/img/tutorial-retention-02.png "Set rules")
+
+Now click `Save all rules`, wait for a few seconds, and refresh the page. 
+
+The segments for the first 12 hours of 2015-09-12 are now gone:
+
+![New segments](../tutorials/img/tutorial-retention-03.png "New segments")
+
+The resulting retention rule chain is the following:
+
+```
+loadByInterval 2015-09-12T12/2015-09-13 (12 hours)
+
+dropForever
+
+loadForever (default rule)
+```
+
+The rule chain is evaluated from top to bottom, with the default rule chain always added at the bottom.
+
+The tutorial rule chain we just created loads data if it is within the specified 12 hour interval. 
+
+If data is not within the 12 hour interval, the rule chain evaluates `dropForever` next, which will drop any data.
+
+The `dropForever` terminates the rule chain, effectively overriding the default `loadForever` rule, which will never be reached in this rule chain.
+
+Note that in this tutorial we defined a load rule on a specific interval. 
+
+If instead you want to retain data based on how old it is (e.g., retain data that ranges from 3 months in the past to the present time), you would define a Period load rule instead.
+
+## Further reading
+
+* [Load rules](/docs/VERSION/operations/rule-configuration.html)
diff --git a/docs/content/tutorials/tutorial-rollup.md b/docs/content/tutorials/tutorial-rollup.md
new file mode 100644
index 00000000000..978bf6aa3df
--- /dev/null
+++ b/docs/content/tutorials/tutorial-rollup.md
@@ -0,0 +1,180 @@
+---
+layout: doc_page
+---
+
+# Tutorial: Roll-up
+
+Druid can summarize raw data at ingestion time using a process we refer to as "roll-up". Roll-up is a first-level aggregation operation over a selected set of columns that reduces the size of stored segments.
+
+This tutorial will demonstrate the effects of roll-up on an example dataset.
+
+For this tutorial, we'll assume you've already downloaded Druid as described in 
+the [single-machine quickstart](index.html) and have it running on your local machine.
+
+It will also be helpful to have finished [Tutorial: Loading a file](/docs/VERSION/tutorials/tutorial-batch.html) and [Tutorial: Querying data](/docs/VERSION/tutorials/tutorial-query.html).
+
+## Example data
+
+For this tutorial, we'll use a small sample of network flow event data, representing packet and byte counts for traffic from a source to a destination IP address that occurred within a particular second.
+
+```
+{"timestamp":"2018-01-01T01:01:35Z","srcIP":"1.1.1.1", "dstIP":"2.2.2.2","packets":20,"bytes":9024}
+{"timestamp":"2018-01-01T01:01:51Z","srcIP":"1.1.1.1", "dstIP":"2.2.2.2","packets":255,"bytes":21133}
+{"timestamp":"2018-01-01T01:01:59Z","srcIP":"1.1.1.1", "dstIP":"2.2.2.2","packets":11,"bytes":5780}
+{"timestamp":"2018-01-01T01:02:14Z","srcIP":"1.1.1.1", "dstIP":"2.2.2.2","packets":38,"bytes":6289}
+{"timestamp":"2018-01-01T01:02:29Z","srcIP":"1.1.1.1", "dstIP":"2.2.2.2","packets":377,"bytes":359971}
+{"timestamp":"2018-01-01T01:03:29Z","srcIP":"1.1.1.1", "dstIP":"2.2.2.2","packets":49,"bytes":10204}
+{"timestamp":"2018-01-02T21:33:14Z","srcIP":"7.7.7.7", "dstIP":"8.8.8.8","packets":38,"bytes":6289}
+{"timestamp":"2018-01-02T21:33:45Z","srcIP":"7.7.7.7", "dstIP":"8.8.8.8","packets":123,"bytes":93999}
+{"timestamp":"2018-01-02T21:35:45Z","srcIP":"7.7.7.7", "dstIP":"8.8.8.8","packets":12,"bytes":2818}
+```
+
+A file containing this sample input data is located at `quickstart/tutorial/rollup-data.json`.
+
+We'll ingest this data using the following ingestion task spec, located at `quickstart/tutorial/rollup-index.json`.
+
+```
+{
+  "type" : "index",
+  "spec" : {
+    "dataSchema" : {
+      "dataSource" : "rollup-tutorial",
+      "parser" : {
+        "type" : "string",
+        "parseSpec" : {
+          "format" : "json",
+          "dimensionsSpec" : {
+            "dimensions" : [
+              "srcIP",
+              "dstIP"
+            ]
+          },
+          "timestampSpec": {
+            "column": "timestamp",
+            "format": "iso"
+          }
+        }
+      },
+      "metricsSpec" : [
+        { "type" : "count", "name" : "count" },
+        { "type" : "longSum", "name" : "packets", "fieldName" : "packets" },
+        { "type" : "longSum", "name" : "bytes", "fieldName" : "bytes" }
+      ],
+      "granularitySpec" : {
+        "type" : "uniform",
+        "segmentGranularity" : "week",
+        "queryGranularity" : "minute",
+        "intervals" : ["2018-01-01/2018-01-03"],
+        "rollup" : true
+      }
+    },
+    "ioConfig" : {
+      "type" : "index",
+      "firehose" : {
+        "type" : "local",
+        "baseDir" : "quickstart/tutorial",
+        "filter" : "rollup-data.json"
+      },
+      "appendToExisting" : false
+    },
+    "tuningConfig" : {
+      "type" : "index",
+      "targetPartitionSize" : 5000000,
+      "maxRowsInMemory" : 25000,
+      "forceExtendableShardSpecs" : true
+    }
+  }
+}
+```
+
+Roll-up has been enabled by setting `"rollup" : true` in the `granularitySpec`.
+
+Note that we have `srcIP` and `dstIP` defined as dimensions, a longSum metric is defined for the `packets` and `bytes` columns, and the `queryGranularity` has been defined as `minute`. 
+
+We will see how these definitions are used after we load this data.
+
+## Load the example data
+
+From the druid-${DRUIDVERSION} package root, run the following command:
+
+```
+bin/post-index-task --file quickstart/tutorial/rollup-index.json 
+```
+
+After the script completes, we will query the data.
+
+## Query the example data
+
+Let's run `bin/dsql` and issue a `select * from "rollup-tutorial";` query to see what data was ingested.
+
+```
+$ bin/dsql
+Welcome to dsql, the command-line client for Druid SQL.
+Type "\h" for help.
+dsql> select * from "rollup-tutorial";
+┌──────────────────────────┬────────┬───────┬─────────┬─────────┬─────────┐
+│ __time                   │ bytes  │ count │ dstIP   │ packets │ srcIP   │
+├──────────────────────────┼────────┼───────┼─────────┼─────────┼─────────┤
+│ 2018-01-01T01:01:00.000Z │  35937 │     3 │ 2.2.2.2 │     286 │ 1.1.1.1 │
+│ 2018-01-01T01:02:00.000Z │ 366260 │     2 │ 2.2.2.2 │     415 │ 1.1.1.1 │
+│ 2018-01-01T01:03:00.000Z │  10204 │     1 │ 2.2.2.2 │      49 │ 1.1.1.1 │
+│ 2018-01-02T21:33:00.000Z │ 100288 │     2 │ 8.8.8.8 │     161 │ 7.7.7.7 │
+│ 2018-01-02T21:35:00.000Z │   2818 │     1 │ 8.8.8.8 │      12 │ 7.7.7.7 │
+└──────────────────────────┴────────┴───────┴─────────┴─────────┴─────────┘
+Retrieved 5 rows in 1.18s.
+
+dsql> 
+```
+
+Let's look at the three events in the original input data that occurred during `2018-01-01T01:01`:
+
+```
+{"timestamp":"2018-01-01T01:01:35Z","srcIP":"1.1.1.1", "dstIP":"2.2.2.2","packets":20,"bytes":9024}
+{"timestamp":"2018-01-01T01:01:51Z","srcIP":"1.1.1.1", "dstIP":"2.2.2.2","packets":255,"bytes":21133}
+{"timestamp":"2018-01-01T01:01:59Z","srcIP":"1.1.1.1", "dstIP":"2.2.2.2","packets":11,"bytes":5780}
+```
+
+These three rows have been "rolled up" into the following row:
+
+```
+┌──────────────────────────┬────────┬───────┬─────────┬─────────┬─────────┐
+│ __time                   │ bytes  │ count │ dstIP   │ packets │ srcIP   │
+├──────────────────────────┼────────┼───────┼─────────┼─────────┼─────────┤
+│ 2018-01-01T01:01:00.000Z │  35937 │     3 │ 2.2.2.2 │     286 │ 1.1.1.1 │
+└──────────────────────────┴────────┴───────┴─────────┴─────────┴─────────┘
+```
+
+The input rows have been grouped by the timestamp and dimension columns `{timestamp, srcIP, dstIP}` with sum aggregations on the metric columns `packets` and `bytes`.
+
+Before the grouping occurs, the timestamps of the original input data are bucketed/floored by minute, due to the `"queryGranularity":"minute"` setting in the ingestion spec.
+
+Likewise, these two events that occurred during `2018-01-01T01:02` have been rolled up:
+
+```
+{"timestamp":"2018-01-01T01:02:14Z","srcIP":"1.1.1.1", "dstIP":"2.2.2.2","packets":38,"bytes":6289}
+{"timestamp":"2018-01-01T01:02:29Z","srcIP":"1.1.1.1", "dstIP":"2.2.2.2","packets":377,"bytes":359971}
+```
+
+```
+┌──────────────────────────┬────────┬───────┬─────────┬─────────┬─────────┐
+│ __time                   │ bytes  │ count │ dstIP   │ packets │ srcIP   │
+├──────────────────────────┼────────┼───────┼─────────┼─────────┼─────────┤
+│ 2018-01-01T01:02:00.000Z │ 366260 │     2 │ 2.2.2.2 │     415 │ 1.1.1.1 │
+└──────────────────────────┴────────┴───────┴─────────┴─────────┴─────────┘
+```
+
+For the last event recording traffic between 1.1.1.1 and 2.2.2.2, no roll-up took place, because this was the only event that occurred during `2018-01-01T01:03`:
+
+```
+{"timestamp":"2018-01-01T01:03:29Z","srcIP":"1.1.1.1", "dstIP":"2.2.2.2","packets":49,"bytes":10204}
+```
+
+```
+┌──────────────────────────┬────────┬───────┬─────────┬─────────┬─────────┐
+│ __time                   │ bytes  │ count │ dstIP   │ packets │ srcIP   │
+├──────────────────────────┼────────┼───────┼─────────┼─────────┼─────────┤
+│ 2018-01-01T01:03:00.000Z │  10204 │     1 │ 2.2.2.2 │      49 │ 1.1.1.1 │
+└──────────────────────────┴────────┴───────┴─────────┴─────────┴─────────┘
+```
+
+Note that the `count` metric shows how many rows in the original input data contributed to the final "rolled up" row.
\ No newline at end of file
diff --git a/docs/content/tutorials/tutorial-streams.md b/docs/content/tutorials/tutorial-streams.md
deleted file mode 100644
index c20fb23a6c7..00000000000
--- a/docs/content/tutorials/tutorial-streams.md
+++ /dev/null
@@ -1,134 +0,0 @@
----
-layout: doc_page
----
-
-# Tutorial: Load your own streaming data
-
-## Getting started
-
-This tutorial shows you how to load your own streams into Druid.
-
-For this tutorial, we'll assume you've already downloaded Druid and Tranquility as described in
-the [single-machine quickstart](quickstart.html) and have it running on your local machine. You
-don't need to have loaded any data yet.
-
-Once that's complete, you can load your own dataset by writing a custom ingestion spec.
-
-## Writing an ingestion spec
-
-When loading streams into Druid, we recommend using the [stream push](../ingestion/stream-push.html)
-process. In this tutorial we'll be using [Tranquility Server](../ingestion/stream-ingestion.html#server) to push
-data into Druid over HTTP.
-
-<div class="note info">
-This tutorial will show you how to push streams to Druid using HTTP, but Druid additionally supports
-a wide variety of batch and streaming loading methods. See the <a href="../ingestion/batch-ingestion.html">Loading files</a>
-and <a href="../ingestion/stream-ingestion.html">Loading streams</a> pages for more information about other options,
-including from Hadoop, Kafka, Storm, Samza, Spark Streaming, and your own JVM apps.
-</div>
-
-You can prepare for loading a new dataset over HTTP by writing a custom Tranquility Server
-configuration. The bundled configuration is in `conf-quickstart/tranquility/server.json`, which
-you can modify for your own needs.
-
-The most important questions are:
-
-  * What should the dataset be called? This is the "dataSource" field of the "dataSchema".
-  * Which field should be treated as a timestamp? This belongs in the "column" field of the "timestampSpec".
-  * Which fields should be treated as dimensions? This belongs in the "dimensions" field of the "dimensionsSpec".
-  * Which fields should be treated as measures? This belongs in the "metricsSpec" field.
-
-Let's use a small JSON pageviews dataset as an example, with records like:
-
-```json
-{"time": "2000-01-01T00:00:00Z", "url": "/foo/bar", "user": "alice", "latencyMs": 32}
-```
-
-So the answers to the questions above are:
-
-  * Let's call the dataset "pageviews".
-  * The timestamp is the "time" field.
-  * Good choices for dimensions are the string fields "url" and "user".
-  * Good choices for measures are a count of pageviews, and the sum of "latencyMs". Collecting that
-sum when we load the data will allow us to compute an average at query time as well.
-
-Now, edit the existing `conf-quickstart/tranquility/server.json` file by altering these
-sections:
-
-  1. Change the key `"metrics"` under `"dataSources"` to `"pageviews"`
-  2. Alter these sections under the new `"pageviews"` key:
-  ```json
-  "dataSource": "pageviews"
-  ```
-
-  ```json
-  "timestampSpec": {
-       "format": "auto",
-       "column": "time"
-  }
-  ```
-
-  ```json
-  "dimensionsSpec": {
-       "dimensions": ["url", "user"]
-  }
-  ```
-
-  ```json
-  "metricsSpec": [
-       {"name": "views", "type": "count"},
-       {"name": "latencyMs", "type": "doubleSum", "fieldName": "latencyMs"}
-  ]
-  ```
-
-## Restarting the server
-
-Restart the server to pick up the new configuration file by stopping Tranquility (CTRL-C) and starting it up again.
-
-## Sending data
-
-Let's send some data! We'll start with these three records:
-
-```json
-{"time": "2000-01-01T00:00:00Z", "url": "/foo/bar", "user": "alice", "latencyMs": 32}
-{"time": "2000-01-01T00:00:00Z", "url": "/", "user": "bob", "latencyMs": 11}
-{"time": "2000-01-01T00:00:00Z", "url": "/foo/bar", "user": "bob", "latencyMs": 45}
-```
-
-Druid streaming ingestion requires relatively current messages (relative to a slack time controlled by the
-[windowPeriod](../ingestion/stream-push.html#segmentgranularity-and-windowperiod) value), so you should
-replace `2000-01-01T00:00:00Z` in these messages with the current time in ISO8601 format. You can
-get this by running:
-
-```bash
-python -c 'import datetime; print(datetime.datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%SZ"))'
-```
-
-Update the timestamps in the JSON above, and save it to a file named `pageviews.json`. Then send
-it to Druid by running:
-
-```bash
-curl -XPOST -H'Content-Type: application/json' --data-binary @pageviews.json http://localhost:8200/v1/post/pageviews
-```
-
-This will print something like:
-
-```
-{"result":{"received":3,"sent":3}}
-```
-
-This indicates that the HTTP server received 3 events from you, and sent 3 to Druid. Note that
-this may take a few seconds to finish the first time you run it, as Druid resources must be
-allocated to the ingestion task. Subsequent POSTs should complete quickly.
-
-If you see `"sent":0` this likely means that your timestamps are not recent enough. Try adjusting
-your timestamps and re-sending your data.
-
-## Querying your data
-
-After sending data, you can immediately query it using any of the
-[supported query methods](../querying/querying.html).
-
-## Further reading
-
-To read more about loading streams, see our [streaming ingestion documentation](../ingestion/stream-ingestion.html).
diff --git a/docs/content/tutorials/tutorial-tranquility.md b/docs/content/tutorials/tutorial-tranquility.md
new file mode 100644
index 00000000000..5901bdf14b6
--- /dev/null
+++ b/docs/content/tutorials/tutorial-tranquility.md
@@ -0,0 +1,84 @@
+---
+layout: doc_page
+---
+
+# Tutorial: Load streaming data with HTTP push
+
+## Getting started
+
+This tutorial shows you how to load streaming data into Druid using HTTP push via Tranquility Server.
+
+[Tranquility Server](https://github.com/druid-io/tranquility/blob/master/docs/server.md) allows a stream of data to be pushed into Druid using HTTP POSTs.
+
+For this tutorial, we'll assume you've already downloaded Druid as described in
+the [single-machine quickstart](quickstart.html) and have it running on your local machine. You
+don't need to have loaded any data yet.
+
+## Download Tranquility
+
+In the Druid package root, run the following commands:
+
+```
+curl http://static.druid.io/tranquility/releases/tranquility-distribution-0.8.2.tgz -o tranquility-distribution-0.8.2.tgz
+tar -xzf tranquility-distribution-0.8.2.tgz
+mv tranquility-distribution-0.8.2 tranquility
+```
+
+The startup scripts for the tutorial will expect the contents of the Tranquility tarball to be located at `tranquility` under the druid-#{DRUIDVERSION} package root.
+
+## Enable Tranquility Server
+
+- In your `quickstart/tutorial/conf/tutorial-cluster.conf`, uncomment the `tranquility-server` line.
+- Stop your *bin/supervise* command (CTRL-C) and then restart it by again running `bin/supervise -c quickstart/tutorial/conf/tutorial-cluster.conf`.
+
+As part of the output of *supervise* you should see something like:
+
+```
+Running command[tranquility-server], logging to[/stage/druid-{DRUIDVERSION}/var/sv/tranquility-server.log]: tranquility/bin/tranquility server -configFile quickstart/tutorial/conf/tranquility/server.json -Ddruid.extensions.loadList=[]
+```
+
+You can check the log file in `var/sv/tranquility-server.log` to confirm that the server is starting up properly.
+
+## Send data
+
+Let's send the sample Wikipedia edits data to Tranquility:
+
+```
+gunzip -k quickstart/wikiticker-2015-09-12-sampled.json.gz 
+curl -XPOST -H'Content-Type: application/json' --data-binary @quickstart/wikiticker-2015-09-12-sampled.json http://localhost:8200/v1/post/wikipedia
+```
+
+Which will print something like:
+
+```
+{"result":{"received":39244,"sent":39244}}
+```
+
+This indicates that the HTTP server received 39,244 events from you, and sent 39,244 to Druid. This
+command may generate a "connection refused" error if you run it too quickly after enabling Tranquility
+Server, which means the server has not yet started up. It should start up within a few seconds. The command
+may also take a few seconds to finish the first time you run it, during which time Druid resources are being
+allocated to the ingestion task. Subsequent POSTs will complete quickly once this is done.
+
+Once the data is sent to Druid, you can immediately query it.
+
+If you see a `sent` count of 0, retry the send command until the `sent` count also shows 39244:
+
+```
+{"result":{"received":39244,"sent":0}}
+```
+
+## Querying your data
+
+Please follow the [query tutorial](../tutorial/tutorial-query.html) to run some example queries on the newly loaded data.
+
+## Cleanup
+
+If you wish to go through any of the other ingestion tutorials, you will need to shut down the cluster and reset the cluster state by removing the contents of the `var` directory under the druid package, as the other tutorials will write to the same "wikipedia" datasource.
+
+When cleaning up after running this Tranquility tutorial, it is also necessary to recomment the `tranquility-server` line in `quickstart/tutorial/conf/tutorial-cluster.conf` before restarting the cluster.
+
+
+## Further reading
+
+For more information on Tranquility, please see [the Tranquility documentation](https://github.com/druid-io/tranquility).
diff --git a/docs/content/tutorials/tutorial-transform-spec.md b/docs/content/tutorials/tutorial-transform-spec.md
new file mode 100644
index 00000000000..b718882ee96
--- /dev/null
+++ b/docs/content/tutorials/tutorial-transform-spec.md
@@ -0,0 +1,138 @@
+---
+layout: doc_page
+---
+
+# Tutorial: Transforming input data
+
+This tutorial will demonstrate how to use transform specs to filter and transform input data during ingestion.
+
+For this tutorial, we'll assume you've already downloaded Druid as described in 
+the [single-machine quickstart](index.html) and have it running on your local machine.
+
+It will also be helpful to have finished [Tutorial: Loading a file](/docs/VERSION/tutorials/tutorial-batch.html) and [Tutorial: Querying data](/docs/VERSION/tutorials/tutorial-query.html).
+
+## Sample data
+
+We've included sample data for this tutorial at `quickstart/tutorial/transform-data.json`, reproduced here for convenience:
+
+```
+{"timestamp":"2018-01-01T07:01:35Z","animal":"octopus",  "location":1, "number":100}
+{"timestamp":"2018-01-01T05:01:35Z","animal":"mongoose", "location":2,"number":200}
+{"timestamp":"2018-01-01T06:01:35Z","animal":"snake", "location":3, "number":300}
+{"timestamp":"2018-01-01T01:01:35Z","animal":"lion", "location":4, "number":300}
+```
+
+## Load data with transform specs
+
+We will ingest the sample data using the following spec, which demonstrates the use of transform specs:
+
+```
+{
+  "type" : "index",
+  "spec" : {
+    "dataSchema" : {
+      "dataSource" : "transform-tutorial",
+      "parser" : {
+        "type" : "string",
+        "parseSpec" : {
+          "format" : "json",
+          "dimensionsSpec" : {
+            "dimensions" : [
+              "animal",
+              { "name": "location", "type": "long" }
+            ]
+          },
+          "timestampSpec": {
+            "column": "timestamp",
+            "format": "iso"
+          }
+        }
+      },
+      "metricsSpec" : [
+        { "type" : "count", "name" : "count" },
+        { "type" : "longSum", "name" : "number", "fieldName" : "number" },
+        { "type" : "longSum", "name" : "triple-number", "fieldName" : "triple-number" }
+      ],
+      "granularitySpec" : {
+        "type" : "uniform",
+        "segmentGranularity" : "week",
+        "queryGranularity" : "minute",
+        "intervals" : ["2018-01-01/2018-01-03"],
+        "rollup" : true
+      },
+      "transformSpec": {
+        "transforms": [
+          {
+            "type": "expression",
+            "name": "animal",
+            "expression": "concat('super-', animal)"
+          },
+          {
+            "type": "expression",
+            "name": "triple-number",
+            "expression": "number * 3"
+          }
+        ],
+        "filter": {
+          "type":"or",
+          "fields": [
+            { "type": "selector", "dimension": "animal", "value": "super-mongoose" },
+            { "type": "selector", "dimension": "triple-number", "value": "300" },
+            { "type": "selector", "dimension": "location", "value": "3" }
+          ]
+        }
+      }
+    },
+    "ioConfig" : {
+      "type" : "index",
+      "firehose" : {
+        "type" : "local",
+        "baseDir" : "quickstart/tutorial",
+        "filter" : "transform-data.json"
+      },
+      "appendToExisting" : false
+    },
+    "tuningConfig" : {
+      "type" : "index",
+      "targetPartitionSize" : 5000000,
+      "maxRowsInMemory" : 25000,
+      "forceExtendableShardSpecs" : true
+    }
+  }
+}
+```
+
+In the transform spec, we have two expression transforms:
+* `super-animal`: prepends "super-" to the values in the `animal` column. This will override the `animal` column with the transformed version, since the transform's name is `animal`.
+* `triple-number`: multiplies the `number` column by 3. This will create a new `triple-number` column. Note that we are ingesting both the original and the transformed column.
+
+Additionally, we have an OR filter with three clauses:
+* `super-animal` values that match "super-mongoose"
+* `triple-number` values that match 300
+* `location` values that match 3
+
+This filter selects the first 3 rows, and it will exclude the final "lion" row in the input data. Note that the filter is applied after the transformation.
+
+Let's submit this task now, which has been included at `quickstart/tutorial/transform-index.json`:
+
+```
+bin/post-index-task --file quickstart/tutorial/transform-index.json
+```
+
+## Query the transformed data
+
+Let's run `bin/dsql` and issue a `select * from "transform-tutorial";` query to see what was ingested:
+
+```
+dsql> select * from "transform-tutorial";
+┌──────────────────────────┬────────────────┬───────┬──────────┬────────┬───────────────┐
+│ __time                   │ animal         │ count │ location │ number │ triple-number │
+├──────────────────────────┼────────────────┼───────┼──────────┼────────┼───────────────┤
+│ 2018-01-01T05:01:00.000Z │ super-mongoose │     1 │        2 │    200 │           600 │
+│ 2018-01-01T06:01:00.000Z │ super-snake    │     1 │        3 │    300 │           900 │
+│ 2018-01-01T07:01:00.000Z │ super-octopus  │     1 │        1 │    100 │           300 │
+└──────────────────────────┴────────────────┴───────┴──────────┴────────┴───────────────┘
+Retrieved 3 rows in 0.03s.
+```
+
+The "lion" row has been discarded, the `animal` column has been transformed, and we have both the original and transformed `number` column.
\ No newline at end of file
diff --git a/docs/content/tutorials/tutorial-update-data.md b/docs/content/tutorials/tutorial-update-data.md
new file mode 100644
index 00000000000..f463d390b6b
--- /dev/null
+++ b/docs/content/tutorials/tutorial-update-data.md
@@ -0,0 +1,150 @@
+---
+layout: doc_page
+---
+
+# Tutorial: Updating existing data
+
+This tutorial demonstrates how to update existing data, showing both overwrites and appends.
+
+For this tutorial, we'll assume you've already downloaded Druid as described in 
+the [single-machine quickstart](index.html) and have it running on your local machine. 
+
+It will also be helpful to have finished [Tutorial: Loading a file](/docs/VERSION/tutorials/tutorial-batch.html), [Tutorial: Querying data](/docs/VERSION/tutorials/tutorial-query.html), and [Tutorial: Rollup](/docs/VERSION/tutorials/tutorial-rollup.html).
+
+## Overwrite
+
+This section of the tutorial will cover how to overwrite an existing interval of data.
+
+### Load initial data
+
+Let's load an initial data set which we will overwrite and append to.
+
+The spec we'll use for this tutorial is located at `quickstart/tutorial/updates-init-index.json`. This spec creates a datasource called `updates-tutorial` from the `quickstart/tutorial/updates-data.json` input file.
+
+Let's submit that task:
+
+```
+bin/post-index-task --file quickstart/tutorial/updates-init-index.json 
+```
+
+We have three initial rows containing an "animal" dimension and "number" metric:
+
+```
+dsql> select * from "updates-tutorial"; 
+┌──────────────────────────┬──────────┬───────┬────────┐
+│ __time                   │ animal   │ count │ number │
+├──────────────────────────┼──────────┼───────┼────────┤
+│ 2018-01-01T01:01:00.000Z │ tiger    │     1 │    100 │
+│ 2018-01-01T03:01:00.000Z │ aardvark │     1 │     42 │
+│ 2018-01-01T03:01:00.000Z │ giraffe  │     1 │  14124 │
+└──────────────────────────┴──────────┴───────┴────────┘
+Retrieved 3 rows in 1.42s.
+```
+
+### Overwrite the initial data
+
+To overwrite this data, we can submit another task for the same interval, but with different input data.
+
+The `quickstart/tutorial/updates-overwrite-index.json` spec will perform an overwrite on the `updates-tutorial` datasource.
+
+Note that this task reads input from `quickstart/tutorial/updates-data2.json`, and `appendToExisting` is set to `false` (indicating this is an overwrite).
+
+Let's submit that task:
+
+```
+bin/post-index-task --file quickstart/tutorial/updates-overwrite-index.json 
+```
+
+When Druid finishes loading the new segment from this overwrite task, the "tiger" row now has the value "lion", the "aardvark" row has a different number, and the "giraffe" row has been replaced. It may take a couple of minutes for the changes to take effect:
+
+```
+dsql> select * from "updates-tutorial";
+┌──────────────────────────┬──────────┬───────┬────────┐
+│ __time                   │ animal   │ count │ number │
+├──────────────────────────┼──────────┼───────┼────────┤
+│ 2018-01-01T01:01:00.000Z │ lion     │     1 │    100 │
+│ 2018-01-01T03:01:00.000Z │ aardvark │     1 │   9999 │
+│ 2018-01-01T04:01:00.000Z │ bear     │     1 │    111 │
+└──────────────────────────┴──────────┴───────┴────────┘
+Retrieved 3 rows in 0.02s.
+```
+
+## Combine old data with new data and overwrite
+
+Let's try appending some new data to the `updates-tutorial` datasource now. We will add the data from `quickstart/tutorial/updates-data3.json`.
+
+The `quickstart/tutorial/updates-append-index.json` task spec has been configured to read from the existing `updates-tutorial` datasource and the `quickstart/tutorial/updates-data3.json` file. The task will combine data from the two input sources, and then overwrite the original data with the new combined data.
+
+Let's submit that task:
+
+```
+bin/post-index-task --file quickstart/tutorial/updates-append-index.json 
+```
+
+When Druid finishes loading the new segment from this overwrite task, the new rows will have been added to the datasource. Note that roll-up occurred for the "lion" row:
+
+```
+dsql> select * from "updates-tutorial";
+┌──────────────────────────┬──────────┬───────┬────────┐
+│ __time                   │ animal   │ count │ number │
+├──────────────────────────┼──────────┼───────┼────────┤
+│ 2018-01-01T01:01:00.000Z │ lion     │     2 │    400 │
+│ 2018-01-01T03:01:00.000Z │ aardvark │     1 │   9999 │
+│ 2018-01-01T04:01:00.000Z │ bear     │     1 │    111 │
+│ 2018-01-01T05:01:00.000Z │ mongoose │     1 │    737 │
+│ 2018-01-01T06:01:00.000Z │ snake    │     1 │   1234 │
+│ 2018-01-01T07:01:00.000Z │ octopus  │     1 │    115 │
+└──────────────────────────┴──────────┴───────┴────────┘
+Retrieved 6 rows in 0.02s.
+```
+
+## Append to the data
+
+Let's try another way of appending data.
+
+The `quickstart/tutorial/updates-append-index2.json` task spec reads input from `quickstart/tutorial/updates-data4.json` and will append its data to the `updates-tutorial` datasource. Note that `appendToExisting` is set to `true` in this spec.
+
+Let's submit that task:
+
+```
+bin/post-index-task --file quickstart/tutorial/updates-append-index2.json 
+```
+
+When the new data is loaded, we can see two additional rows after "octopus". Note that the new "bear" row with number 222 has not been rolled up with the existing bear-111 row, because the new data is held in a separate segment.
+
+```
+dsql> select * from "updates-tutorial";
+┌──────────────────────────┬──────────┬───────┬────────┐
+│ __time                   │ animal   │ count │ number │
+├──────────────────────────┼──────────┼───────┼────────┤
+│ 2018-01-01T01:01:00.000Z │ lion     │     2 │    400 │
+│ 2018-01-01T03:01:00.000Z │ aardvark │     1 │   9999 │
+│ 2018-01-01T04:01:00.000Z │ bear     │     1 │    111 │
+│ 2018-01-01T05:01:00.000Z │ mongoose │     1 │    737 │
+│ 2018-01-01T06:01:00.000Z │ snake    │     1 │   1234 │
+│ 2018-01-01T07:01:00.000Z │ octopus  │     1 │    115 │
+│ 2018-01-01T04:01:00.000Z │ bear     │     1 │    222 │
+│ 2018-01-01T09:01:00.000Z │ falcon   │     1 │   1241 │
+└──────────────────────────┴──────────┴───────┴────────┘
+Retrieved 8 rows in 0.02s.
+
+```
+
+If we run a GroupBy query instead of a `select *`, we can see that the "bear" rows will group together at query time:
+
+```
+dsql> select __time, animal, SUM("count"), SUM("number") from "updates-tutorial" group by __time, animal;
+┌──────────────────────────┬──────────┬────────┬────────┐
+│ __time                   │ animal   │ EXPR$2 │ EXPR$3 │
+├──────────────────────────┼──────────┼────────┼────────┤
+│ 2018-01-01T01:01:00.000Z │ lion     │      2 │    400 │
+│ 2018-01-01T03:01:00.000Z │ aardvark │      1 │   9999 │
+│ 2018-01-01T04:01:00.000Z │ bear     │      2 │    333 │
+│ 2018-01-01T05:01:00.000Z │ mongoose │      1 │    737 │
+│ 2018-01-01T06:01:00.000Z │ snake    │      1 │   1234 │
+│ 2018-01-01T07:01:00.000Z │ octopus  │      1 │    115 │
+│ 2018-01-01T09:01:00.000Z │ falcon   │      1 │   1241 │
+└──────────────────────────┴──────────┴────────┴────────┘
+Retrieved 7 rows in 0.23s.
+```
+
diff --git a/examples/conf-quickstart/druid/coordinator/runtime.properties b/examples/bin/dsql
old mode 100644
new mode 100755
similarity index 71%
rename from examples/conf-quickstart/druid/coordinator/runtime.properties
rename to examples/bin/dsql
index 4ad1f117231..004b01e5d5a
--- a/examples/conf-quickstart/druid/coordinator/runtime.properties
+++ b/examples/bin/dsql
@@ -1,4 +1,5 @@
-#
+#!/bin/bash -eu
+
 # 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
@@ -15,10 +16,21 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-#
 
-druid.service=druid/coordinator
-druid.port=8081
+PWD="$(pwd)"
+WHEREAMI="$(dirname "$0")"
+WHEREAMI="$(cd "$WHEREAMI" && pwd)"
+
+RLWRAP=""
+
+if [ -x "$(command -v rlwrap)" ]
+then
+  RLWRAP="rlwrap -C dsql"
+fi
 
-druid.coordinator.startDelay=PT10S
-druid.coordinator.period=PT5S
+if [ -x "$(command -v python2)" ]
+then
+  exec $RLWRAP python2 "$WHEREAMI/dsql-main" "$@"
+else
+  exec $RLWRAP "$WHEREAMI/dsql-main" "$@"
+fi
diff --git a/examples/bin/dsql-main b/examples/bin/dsql-main
new file mode 100755
index 00000000000..c8fee6f406c
--- /dev/null
+++ b/examples/bin/dsql-main
@@ -0,0 +1,453 @@
+#!/usr/bin/env python
+
+# 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.
+
+from __future__ import print_function
+
+import argparse
+import base64
+import collections
+import csv
+import errno
+import json
+import numbers
+import re
+import ssl
+import sys
+import time
+import unicodedata
+import urllib2
+
+class DruidSqlException(Exception):
+  def write_to(self, f):
+    f.write('\x1b[31m')
+    f.write(self.message if self.message else "Query failed")
+    f.write('\x1b[0m')
+    f.write('\n')
+    f.flush()
+
+def do_query(url, sql, context, timeout, user, password, ignore_ssl_verification, ca_file, ca_path):
+  json_decoder = json.JSONDecoder(object_pairs_hook=collections.OrderedDict)
+  try:
+    sql_json = json.dumps({'query' : sql, 'context' : context})
+
+    # SSL stuff
+    ssl_context =  None;
+    if (ignore_ssl_verification or ca_file != None or ca_path != None):
+      ssl_context = ssl.create_default_context()
+      if (ignore_ssl_verification):
+        ssl_context.check_hostname = False
+        ssl_context.verify_mode = ssl.CERT_NONE
+      else:
+        ssl_context.load_verify_locations(cafile=ca_file, capath=ca_path)
+
+    req = urllib2.Request(url, sql_json, {'Content-Type' : 'application/json'})
+    if timeout <= 0:
+      timeout = None
+
+    if (user and password):
+      basicAuthEncoding = base64.b64encode('%s:%s' % (user, password))
+      req.add_header("Authorization", "Basic %s" % basicAuthEncoding)
+
+    response = urllib2.urlopen(req, None, timeout, context=ssl_context)
+
+    first_chunk = True
+    eof = False
+    buf = ''
+
+    while not eof or len(buf) > 0:
+      while True:
+        try:
+          # Remove starting ','
+          buf = buf.lstrip(',')
+          obj, sz = json_decoder.raw_decode(buf)
+          yield obj
+          buf = buf[sz:]
+        except ValueError as e:
+          # Maybe invalid JSON, maybe partial object; it's hard to tell with this library.
+          if eof and buf.rstrip() == ']':
+            # Stream done and all objects read.
+            buf = ''
+            break
+          elif eof or len(buf) > 256 * 1024:
+            # If we read more than 256KB or if it's eof then report the parse error.
+            raise
+          else:
+            # Stop reading objects, get more from the stream instead.
+            break
+
+      # Read more from the http stream
+      if not eof:
+        chunk = response.read(8192)
+        if chunk:
+          buf = buf + chunk
+          if first_chunk:
+            # Remove starting '['
+            buf = buf.lstrip('[')
+        else:
+          # Stream done. Keep reading objects out of buf though.
+          eof = True
+
+  except urllib2.URLError as e:
+    raise_friendly_error(e)
+
+def raise_friendly_error(e):
+  if isinstance(e, urllib2.HTTPError):
+    text = e.read().strip()
+    error_obj = {}
+    try:
+      error_obj = dict(json.loads(text))
+    except:
+      pass
+    if e.code == 500 and 'errorMessage' in error_obj:
+      error_text = ''
+      if error_obj['error'] != 'Unknown exception':
+        error_text = error_text + error_obj['error'] + ': '
+      if error_obj['errorClass']:
+        error_text = error_text + str(error_obj['errorClass']) + ': '
+      error_text = error_text + str(error_obj['errorMessage'])
+      if error_obj['host']:
+        error_text = error_text + ' (' + str(error_obj['host']) + ')'
+      raise DruidSqlException(error_text)
+    else:
+      raise DruidSqlException("HTTP Error {0}: {1}\n{2}".format(e.code, e.reason, text))
+  else:
+    raise DruidSqlException(str(e))
+
+def to_utf8(value):
+  if value is None:
+    return ""
+  elif isinstance(value, unicode):
+    return value.encode("utf-8")
+  else:
+    return str(value)
+
+def to_tsv(values, delimiter):
+  return delimiter.join(to_utf8(v).replace(delimiter, '') for v in values)
+
+def print_csv(rows, header):
+  csv_writer = csv.writer(sys.stdout)
+  first = True
+  for row in rows:
+    if first and header:
+      csv_writer.writerow(list(to_utf8(k) for k in row.keys()))
+      first = False
+
+    values = []
+    for key, value in row.iteritems():
+      values.append(to_utf8(value))
+
+    csv_writer.writerow(values)
+
+def print_tsv(rows, header, tsv_delimiter):
+  first = True
+  for row in rows:
+    if first and header:
+      print(to_tsv(row.keys(), tsv_delimiter))
+      first = False
+
+    values = []
+    for key, value in row.iteritems():
+      values.append(value)
+
+    print(to_tsv(values, tsv_delimiter))
+
+def print_json(rows):
+  for row in rows:
+    print(json.dumps(row))
+
+def table_to_printable_value(value):
+  # Unicode string, trimmed with control characters removed
+  if value is None:
+    return u"NULL"
+  else:
+    return to_utf8(value).strip().decode('utf-8').translate(dict.fromkeys(range(32)))
+
+def table_compute_string_width(v):
+  normalized = unicodedata.normalize('NFC', v)
+  width = 0
+  for c in normalized:
+    ccategory = unicodedata.category(c)
+    cwidth = unicodedata.east_asian_width(c)
+    if ccategory == 'Cf':
+      # Formatting control, zero width
+      pass
+    elif cwidth == 'F' or cwidth == 'W':
+      # Double-wide character, prints in two columns
+      width = width + 2
+    else:
+      # All other characters
+      width = width + 1
+  return width
+
+def table_compute_column_widths(row_buffer):
+  widths = None
+  for values in row_buffer:
+    values_widths = [table_compute_string_width(v) for v in values]
+    if not widths:
+      widths = values_widths
+    else:
+      i = 0
+      for v in values:
+        widths[i] = max(widths[i], values_widths[i])
+        i = i + 1
+  return widths
+
+def table_print_row(values, column_widths, column_types):
+  vertical_line = u'\u2502'.encode('utf-8')
+  for i in xrange(0, len(values)):
+    padding = ' ' * max(0, column_widths[i] - table_compute_string_width(values[i]))
+    if column_types and column_types[i] == 'n':
+      print(vertical_line + ' ' + padding + values[i].encode('utf-8') + ' ', end="")
+    else:
+      print(vertical_line + ' ' + values[i].encode('utf-8') + padding + ' ', end="")
+  print(vertical_line)
+
+def table_print_header(values, column_widths):
+  # Line 1
+  left_corner = u'\u250C'.encode('utf-8')
+  horizontal_line = u'\u2500'.encode('utf-8')
+  top_tee = u'\u252C'.encode('utf-8')
+  right_corner = u'\u2510'.encode('utf-8')
+  print(left_corner, end="")
+  for i in xrange(0, len(column_widths)):
+    print(horizontal_line * max(0, column_widths[i] + 2), end="")
+    if i + 1 < len(column_widths):
+      print(top_tee, end="")
+  print(right_corner)
+
+  # Line 2
+  table_print_row(values, column_widths, None)
+
+  # Line 3
+  left_tee = u'\u251C'.encode('utf-8')
+  cross = u'\u253C'.encode('utf-8')
+  right_tee = u'\u2524'.encode('utf-8')
+  print(left_tee, end="")
+  for i in xrange(0, len(column_widths)):
+    print(horizontal_line * max(0, column_widths[i] + 2), end="")
+    if i + 1 < len(column_widths):
+      print(cross, end="")
+  print(right_tee)
+
+def table_print_bottom(column_widths):
+  left_corner = u'\u2514'.encode('utf-8')
+  right_corner = u'\u2518'.encode('utf-8')
+  bottom_tee = u'\u2534'.encode('utf-8')
+  horizontal_line = u'\u2500'.encode('utf-8')
+  print(left_corner, end="")
+  for i in xrange(0, len(column_widths)):
+    print(horizontal_line * max(0, column_widths[i] + 2), end="")
+    if i + 1 < len(column_widths):
+      print(bottom_tee, end="")
+  print(right_corner)
+
+def table_print_row_buffer(row_buffer, column_widths, column_types):
+  first = True
+  for values in row_buffer:
+    if first:
+      table_print_header(values, column_widths)
+      first = False
+    else:
+      table_print_row(values, column_widths, column_types)
+
+def print_table(rows):
+  start = time.time()
+  nrows = 0
+  first = True
+
+  # Buffer some rows before printing.
+  rows_to_buffer = 500
+  row_buffer = []
+  column_types = []
+  column_widths = None
+
+  for row in rows:
+    nrows = nrows + 1
+
+    if first:
+      row_buffer.append([table_to_printable_value(k) for k in row.keys()])
+      for k in row.keys():
+        if isinstance(row[k], numbers.Number):
+          column_types.append('n')
+        else:
+          column_types.append('s')
+      first = False
+
+    values = [table_to_printable_value(v) for k, v in row.iteritems()]
+    if rows_to_buffer > 0:
+      row_buffer.append(values)
+      rows_to_buffer = rows_to_buffer - 1
+    else:
+      if row_buffer:
+        column_widths = table_compute_column_widths(row_buffer)
+        table_print_row_buffer(row_buffer, column_widths, column_types)
+        del row_buffer[:]
+      table_print_row(values, column_widths, column_types)
+
+  if row_buffer:
+    column_widths = table_compute_column_widths(row_buffer)
+    table_print_row_buffer(row_buffer, column_widths, column_types)
+
+  if column_widths:
+    table_print_bottom(column_widths)
+
+  print("Retrieved {0:,d} row{1:s} in {2:.2f}s.".format(nrows, 's' if nrows != 1 else '', time.time() - start))
+  print("")
+
+def display_query(url, sql, context, args):
+  rows = do_query(url, sql, context, args.timeout, args.user, args.password, args.ignore_ssl_verification, args.cafile, args.capath)
+
+  if args.format == 'csv':
+    print_csv(rows, args.header)
+  elif args.format == 'tsv':
+    print_tsv(rows, args.header, args.tsv_delimiter)
+  elif args.format == 'json':
+    print_json(rows)
+  elif args.format == 'table':
+    print_table(rows)
+
+def sql_escape(s):
+  if s is None:
+    return "''"
+  elif isinstance(s, unicode):
+    ustr = s
+  else:
+    ustr = str(s).decode('utf-8')
+
+  escaped = [u"U&'"]
+
+  for c in ustr:
+    ccategory = unicodedata.category(c)
+    if ccategory.startswith('L') or ccategory.startswith('N') or c == ' ':
+      escaped.append(c)
+    else:
+      escaped.append(u'\\')
+      escaped.append('%04x' % ord(c))
+
+  escaped.append("'")
+  return ''.join(escaped)
+
+def main():
+  parser = argparse.ArgumentParser(description='Druid SQL command-line client.')
+  parser.add_argument('--host', '-H', type=str, default='http://localhost:8082/', help='Broker host or url')
+  parser.add_argument('--timeout', type=int, default=0, help='Timeout in seconds, 0 for no timeout')
+  parser.add_argument('--format', type=str, default='table', choices=('csv', 'tsv', 'json', 'table'), help='Result format')
+  parser.add_argument('--header', action='store_true', help='Include header row for formats "csv" and "tsv"')
+  parser.add_argument('--tsv-delimiter', type=str, default='\t', help='Delimiter for format "tsv"')
+  parser.add_argument('--context-option', '-c', type=str, action='append', help='Set context option for this connection')
+  parser.add_argument('--execute', '-e', type=str, help='Execute single SQL query')
+  parser.add_argument('--user', '-u', type=str, help='Username for HTTP basic auth')
+  parser.add_argument('--password', '-p', type=str, help='Password for HTTP basic auth')
+  parser.add_argument('--ignore-ssl-verification', '-k', action='store_true', default=False, help='Skip verification of SSL certificates.')
+  parser.add_argument('--cafile', type=str, help='Path to SSL CA file for validating server certificates. See load_verify_locations() in https://docs.python.org/2/library/ssl.html#ssl.SSLContext.')
+  parser.add_argument('--capath', type=str, help='SSL CA path for validating server certificates. See load_verify_locations() in https://docs.python.org/2/library/ssl.html#ssl.SSLContext.')
+  args = parser.parse_args()
+
+  # Build broker URL
+  url = args.host.rstrip('/') + '/druid/v2/sql/'
+  if not url.startswith('http:') and not url.startswith('https:'):
+    url = 'http://' + url
+
+  # Build context
+  context = {}
+  if args.context_option:
+    for opt in args.context_option:
+      kv = opt.split("=", 1)
+      if len(kv) != 2:
+        raise ValueError('Invalid context option, should be key=value: ' + opt)
+      if re.match(r"^\d+$", kv[1]):
+        context[kv[0]] = long(kv[1])
+      else:
+        context[kv[0]] = kv[1]
+
+  if args.execute:
+    display_query(url, args.execute, context, args)
+  else:
+    # interactive mode
+    print("Welcome to dsql, the command-line client for Druid SQL.")
+    print("Type \"\h\" for help.")
+
+    while True:
+      sql = ''
+      while not sql.endswith(';'):
+        prompt = "dsql> " if sql == '' else 'more> '
+        try:
+          more_sql = raw_input(prompt)
+        except EOFError:
+          sys.stdout.write('\n')
+          sys.exit(1)
+        if sql == '' and more_sql.startswith('\\'):
+          # backslash command
+          dmatch = re.match(r'^\\d(S?)(\+?)(\s+.*?|)\s*$', more_sql)
+          if dmatch:
+            include_system = dmatch.group(1)
+            extra_info = dmatch.group(2)
+            arg = dmatch.group(3).strip()
+            if arg:
+              sql = "SELECT TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = " + sql_escape(arg)
+              if not include_system:
+                sql = sql + " AND TABLE_SCHEMA = 'druid'"
+              # break to execute sql
+              break
+            else:
+              sql = "SELECT TABLE_SCHEMA, TABLE_NAME FROM INFORMATION_SCHEMA.TABLES";
+              if not include_system:
+                sql = sql + " WHERE TABLE_SCHEMA = 'druid'"
+              # break to execute sql
+              break
+
+          hmatch = re.match(r'^\\h\s*$', more_sql)
+          if hmatch:
+            print("Commands:")
+            print("  \d             show tables")
+            print("  \dS            show tables, including system tables")
+            print("  \d table_name  describe table")
+            print("  \h             show this help")
+            print("  \q             exit this program")
+            print("Or enter a SQL query ending with a semicolon (;).")
+            continue
+
+          qmatch = re.match(r'^\\q\s*$', more_sql)
+          if qmatch:
+            sys.exit(0)
+
+          print("No such command: " + more_sql)
+        else:
+          sql = (sql + ' ' + more_sql).strip()
+
+      try:
+        display_query(url, sql.rstrip(';'), context, args)
+      except DruidSqlException as e:
+        e.write_to(sys.stdout)
+      except KeyboardInterrupt:
+        sys.stdout.write("Query interrupted\n")
+        sys.stdout.flush()
+
+try:
+  main()
+except DruidSqlException as e:
+  e.write_to(sys.stderr)
+  sys.exit(1)
+except KeyboardInterrupt:
+  sys.exit(1)
+except IOError as e:
+  if e.errno == errno.EPIPE:
+    sys.exit(1)
+  else:
+    raise
diff --git a/examples/conf-quickstart/druid/overlord/runtime.properties b/examples/bin/post-index-task
old mode 100644
new mode 100755
similarity index 76%
rename from examples/conf-quickstart/druid/overlord/runtime.properties
rename to examples/bin/post-index-task
index 793a1904777..d7711baf2cd
--- a/examples/conf-quickstart/druid/overlord/runtime.properties
+++ b/examples/bin/post-index-task
@@ -1,4 +1,5 @@
-#
+#!/bin/bash -eu
+
 # 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
@@ -15,12 +16,14 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-#
-
-druid.service=druid/overlord
-druid.port=8090
 
-druid.indexer.queue.startDelay=PT5S
+PWD="$(pwd)"
+WHEREAMI="$(dirname "$0")"
+WHEREAMI="$(cd "$WHEREAMI" && pwd)"
 
-druid.indexer.runner.type=remote
-druid.indexer.storage.type=metadata
+if [ -x "$(command -v python2)" ]
+then
+  exec python2 "$WHEREAMI/post-index-task-main" "$@"
+else
+  exec "$WHEREAMI/post-index-task-main" "$@"
+fi
diff --git a/examples/bin/post-index-task-main b/examples/bin/post-index-task-main
new file mode 100755
index 00000000000..03436bc3942
--- /dev/null
+++ b/examples/bin/post-index-task-main
@@ -0,0 +1,176 @@
+#!/usr/bin/env python
+
+# 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.
+
+import argparse
+import base64
+import json
+import re
+import sys
+import time
+import urllib2
+import urlparse
+
+def read_task_file(args):
+  with open(args.file, 'r') as f:
+    contents = f.read()
+    # We don't use the parsed data, but we want to throw early if it's invalid
+    try:
+      json.loads(contents)
+    except Exception, e:
+      sys.stderr.write('Invalid JSON in task file "{0}": {1}\n'.format(args.file, repr(e)))
+      sys.exit(1)
+    return contents
+
+def add_basic_auth_header(args, req):
+  if (args.user is not None):
+    basic_auth_encoded = base64.b64encode('%s:%s' % (args.user, args.password))
+    req.add_header("Authorization", "Basic %s" % basic_auth_encoded)
+
+# Keep trying until timeout_at, maybe die then
+def post_task(args, task_json, timeout_at):
+  try:
+    url = args.url.rstrip("/") + "/druid/indexer/v1/task"
+    req = urllib2.Request(url, task_json, {'Content-Type' : 'application/json'})
+    add_basic_auth_header(args, req)
+    timeleft = timeout_at - time.time()
+    response_timeout = min(max(timeleft, 5), 10)
+    response = urllib2.urlopen(req, None, response_timeout)
+    return response.read().rstrip()
+  except urllib2.URLError as e:
+    if isinstance(e, urllib2.HTTPError) and e.code >= 400 and e.code <= 500:
+      # 4xx (problem with the request) or 500 (something wrong on the server)
+      raise_friendly_error(e)
+    elif time.time() >= timeout_at:
+      # No futher retries
+      raise_friendly_error(e)
+    elif isinstance(e, urllib2.HTTPError) and e.code in [301, 302, 303, 305, 307] and \
+        e.info().getheader("Location") is not None:
+      # Set the new location in args.url so it can be used by await_task_completion and re-issue the request
+      location = urlparse.urlparse(e.info().getheader("Location"))
+      args.url = "{0}://{1}".format(location.scheme, location.netloc)
+      sys.stderr.write("Redirect response received, setting url to [{0}]\n".format(args.url))
+      return post_task(args, task_json, timeout_at)
+    else:
+      # If at first you don't succeed, try, try again!
+      sleep_time = 5
+      if not args.quiet:
+        extra = ''
+        if hasattr(e, 'read'):
+          extra = e.read().rstrip()
+        sys.stderr.write("Waiting up to {0}s for indexing service [{1}] to become available. [Got: {2} {3}]".format(max(sleep_time, int(timeout_at - time.time())), args.url, str(e), extra).rstrip())
+        sys.stderr.write("\n")
+      time.sleep(sleep_time)
+      return post_task(args, task_json, timeout_at)
+
+# Keep trying until timeout_at, maybe die then
+def await_task_completion(args, task_id, timeout_at):
+  while True:
+    url = args.url.rstrip("/") + "/druid/indexer/v1/task/{0}/status".format(task_id)
+    req = urllib2.Request(url)
+    add_basic_auth_header(args, req)
+    timeleft = timeout_at - time.time()
+    response_timeout = min(max(timeleft, 5), 10)
+    response = urllib2.urlopen(req, None, response_timeout)
+    response_obj = json.loads(response.read())
+    response_status_code = response_obj["status"]["statusCode"]
+    if response_status_code in ['SUCCESS', 'FAILED']:
+      return response_status_code
+    else:
+      if time.time() < timeout_at:
+        if not args.quiet:
+          sys.stderr.write("Task {0} still running...\n".format(task_id))
+        timeleft = timeout_at - time.time()
+        time.sleep(min(5, timeleft))
+      else:
+        raise Exception("Task {0} did not finish in time!".format(task_id))
+
+def raise_friendly_error(e):
+  if isinstance(e, urllib2.HTTPError):
+    text = e.read().strip()
+    reresult = re.search(r'<pre>(.*?)</pre>', text, re.DOTALL)
+    if reresult:
+      text = reresult.group(1).strip()
+    raise Exception("HTTP Error {0}: {1}, check overlord log for more details.\n{2}".format(e.code, e.reason, text))
+  raise e
+
+def await_load_completion(args, datasource, timeout_at):
+  while True:
+    url = args.coordinator_url.rstrip("/") + "/druid/coordinator/v1/loadstatus"
+    req = urllib2.Request(url)
+    add_basic_auth_header(args, req)
+    timeleft = timeout_at - time.time()
+    response_timeout = min(max(timeleft, 5), 10)
+    response = urllib2.urlopen(req, None, response_timeout)
+    response_obj = json.loads(response.read())
+    load_status = response_obj.get(datasource, 0.0)
+    if load_status >= 100.0:
+      sys.stderr.write("{0} loading complete! You may now query your data\n".format(datasource))
+      return
+    else:
+      if time.time() < timeout_at:
+        if not args.quiet:
+          sys.stderr.write("{0} is {1}% finished loading...\n".format(datasource, load_status))
+        timeleft = timeout_at - time.time()
+        time.sleep(min(5, timeleft))
+      else:
+        raise Exception("{0} was not loaded in time!".format(datasource))
+
+def main():
+  parser = argparse.ArgumentParser(description='Post Druid indexing tasks.')
+  parser.add_argument('--url', '-u', metavar='url', type=str, default='http://localhost:8090/', help='Druid Overlord url')
+  parser.add_argument('--coordinator-url', type=str, default='http://localhost:8081/', help='Druid Coordinator url')
+  parser.add_argument('--file', '-f', type=str, required=True, help='Query JSON file')
+  parser.add_argument('--submit-timeout', type=int, default=120, help='Timeout (in seconds) for submitting tasks')
+  parser.add_argument('--complete-timeout', type=int, default=14400, help='Timeout (in seconds) for completing tasks')
+  parser.add_argument('--load-timeout', type=int, default=14400, help='Timeout (in seconds) for waiting for tasks to load')
+  parser.add_argument('--quiet', '-q', action='store_true', help='Suppress retryable errors')
+  parser.add_argument('--user', type=str, default=None, help='Basic auth username')
+  parser.add_argument('--password', type=str, default=None, help='Basic auth password')
+  args = parser.parse_args()
+
+  submit_timeout_at = time.time() + args.submit_timeout
+  complete_timeout_at = time.time() + args.complete_timeout
+
+  task_contents = read_task_file(args)
+  task_json = json.loads(task_contents)
+  if task_json['type'] == "compact":
+    datasource = task_json['dataSource']
+  else:
+    datasource = json.loads(task_contents)["spec"]["dataSchema"]["dataSource"]
+  sys.stderr.write("Beginning indexing data for {0}\n".format(datasource))
+
+  task_id = json.loads(post_task(args, task_contents, submit_timeout_at))["task"]
+
+  sys.stderr.write('\033[1m' + "Task started: " + '\033[0m' + "{0}\n".format(task_id))
+  sys.stderr.write('\033[1m' + "Task log:     " + '\033[0m' + "{0}/druid/indexer/v1/task/{1}/log\n".format(args.url.rstrip("/"),task_id))
+  sys.stderr.write('\033[1m' + "Task status:  " + '\033[0m' + "{0}/druid/indexer/v1/task/{1}/status\n".format(args.url.rstrip("/"),task_id))
+
+  task_status = await_task_completion(args, task_id, complete_timeout_at)
+  sys.stderr.write("Task finished with status: {0}\n".format(task_status))
+  if task_status != 'SUCCESS':
+    sys.exit(1)
+
+  sys.stderr.write("Completed indexing data for {0}. Now loading indexed data onto the cluster...\n".format(datasource))
+  load_timeout_at = time.time() + args.load_timeout
+  await_load_completion(args, datasource, load_timeout_at)
+
+try:
+  main()
+except KeyboardInterrupt:
+  sys.exit(1)
diff --git a/examples/bin/run-druid b/examples/bin/run-druid
new file mode 100755
index 00000000000..703b2d58c00
--- /dev/null
+++ b/examples/bin/run-druid
@@ -0,0 +1,43 @@
+#!/bin/bash -eu
+
+# 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.
+
+if [ "$#" -gt 2 ]
+then
+  echo "usage: $0 <service> [conf-dir]" >&2
+  exit 1
+fi
+
+PWD="$(pwd)"
+WHEREAMI="$(dirname "$0")"
+WHATAMI="$1"
+
+if [ "$#" -eq 1 ]
+then
+  CONFDIR="$WHEREAMI/../conf"
+else
+  CONFDIR="$2"
+fi
+
+CONFDIR="$(cd "$CONFDIR" && pwd)/druid"
+WHEREAMI="$(cd "$WHEREAMI" && pwd)"
+
+cd "$WHEREAMI/.."
+exec java `cat "$CONFDIR"/"$WHATAMI"/jvm.config | xargs` \
+  -cp "$CONFDIR"/"$WHATAMI":"$CONFDIR"/_common:"$CONFDIR"/_common/hadoop-xml:"$WHEREAMI/../lib/*" \
+  `cat "$CONFDIR"/$WHATAMI/main.config | xargs`
diff --git a/examples/bin/run-zk b/examples/bin/run-zk
new file mode 100755
index 00000000000..e23d63e6803
--- /dev/null
+++ b/examples/bin/run-zk
@@ -0,0 +1,43 @@
+#!/bin/bash -eu
+
+# 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.
+
+if [ "$#" -gt 1 ]
+then
+  echo "usage: $0 [conf-dir]" >&2
+  exit 1
+fi
+
+PWD="$(pwd)"
+WHEREAMI="$(dirname "$0")"
+
+if [ "$#" -lt 1 ] || [ "x$1" = "x" ]
+then
+  CONFDIR="$WHEREAMI"/../conf
+else
+  CONFDIR="$1"
+fi
+
+CONFDIR="$(cd "$CONFDIR" && pwd)/zk"
+WHEREAMI="$(cd "$WHEREAMI" && pwd)"
+
+cd "$WHEREAMI/.."
+exec java `cat "$CONFDIR"/jvm.config | xargs` \
+  -cp "$WHEREAMI/../zk/lib/*:$WHEREAMI/../zk/*:$CONFDIR" \
+  org.apache.zookeeper.server.quorum.QuorumPeerMain \
+  "$CONFDIR"/zoo.cfg
diff --git a/examples/bin/service b/examples/bin/service
new file mode 100755
index 00000000000..372cd14eaf5
--- /dev/null
+++ b/examples/bin/service
@@ -0,0 +1,70 @@
+#!/usr/bin/env perl
+
+# 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.
+
+use strict;
+use warnings;
+
+use Cwd qw/realpath/;
+use Fcntl;
+use File::Basename;
+use FindBin;
+use Getopt::Long qw/:config require_order gnu_compat/;
+
+sub usage
+{
+  die "usage: $0 (--restart <service> | --tail <service> | --down) [-d <var dir>]\n";
+}
+
+# Parse arguments
+my %opt = (
+  'vardir' => realpath("$FindBin::Bin/../var"),
+);
+
+usage() unless GetOptions(\%opt, 'command=s', 'restart=s', 'down', 'tail=s', 'vardir|d=s');
+
+my $svdir = "$opt{vardir}/sv";
+my $command;
+
+if ($opt{command}) {
+  usage() if $command;
+  $command = $opt{command};
+}
+
+if ($opt{down}) {
+  usage() if $command;
+  $command = 'd';
+}
+
+if ($opt{restart}) {
+  usage() if $command;
+  $command = "k $opt{restart}";
+}
+
+if ($opt{tail}) {
+  usage() if $command;
+  exec "tail", "-f", "$svdir/$opt{tail}.log"
+    or die "exec failed: $!\n";
+}
+
+usage() unless $command;
+
+my $fifofile = "$svdir/.ctrl";
+sysopen my $fifofh, $fifofile, O_WRONLY or die "Can't open control fifo, perhaps supervise is not running: $!\n";
+print $fifofh "$command\n";
+close $fifofh;
diff --git a/examples/bin/supervise b/examples/bin/supervise
new file mode 100755
index 00000000000..413d0194c96
--- /dev/null
+++ b/examples/bin/supervise
@@ -0,0 +1,380 @@
+#!/usr/bin/env perl
+
+# 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.
+
+use strict;
+use warnings;
+use Cwd qw/realpath/;
+use POSIX qw/:sys_wait_h mkfifo setsid/;
+use Fcntl qw/:DEFAULT :flock/;
+use Getopt::Long qw/:config require_order gnu_compat/;
+use FindBin;
+use File::Spec;
+use File::Copy;
+
+sub logdie($)
+{
+  my ($msg) = @_;
+  chomp $msg;
+  die "[" . (scalar localtime()) . "] $msg\n";
+}
+
+sub logit($)
+{
+  my ($msg) = @_;
+  chomp $msg;
+  warn "[" . (scalar localtime()) . "] $msg\n";
+}
+
+sub usage
+{
+  die "usage: $0 -c <conf file> [-d <var dir>] [-t <kill timeout>] [--svlogd <optional conf file>]\n";
+}
+
+sub read_config_file
+{
+  my ($config_file) = @_;
+
+  open my $config_fh, "<", $config_file
+    or die "open $config_file: $!";
+
+  my @commands;
+  my @verify;
+  my $kill_timeout;
+  while (my $line = <$config_fh>) {
+    chomp $line;
+    next if $line =~ /^(\s*\#.*|\s*)$/;
+
+    if ($line =~ /^(:verify|:kill-timeout|(?:\!p[0-9]+\s+)?[^:]\S+)\s+(.+)$/) {
+      my $name = $1;
+      my $order = 50;
+      my $command = $2;
+
+      if ($name =~ /^(?:\!p([0-9]+)\s+)(.*)$/) {
+        $order = $1;
+        $name = $2;
+      }
+
+      if ($name eq ':verify') {
+        push @verify, $command;
+      } elsif ($name eq ':kill-timeout') {
+        $kill_timeout = int($command);
+      } else {
+        die "Duplicate command: $line\n" if grep { $_->{name} eq $name } @commands;
+        push @commands, {
+          name => $name,
+          command => $command,
+          order => $order,  # Stop order for this command
+          pid => 0,         # Current pid, or 0 if not running
+          down => 0,        # Time the proc should be down until
+          killed => 0,      # Signal we sent to this process
+          restarting => 0,  # True if this command is currently restarting
+        };
+      }
+    } else {
+      die "Syntax error: $line\n";
+    }
+  }
+
+  close $config_fh;
+  return { commands => \@commands, verify => \@verify, 'kill-timeout' => $kill_timeout };
+}
+
+sub stringify_exit_status
+{
+  my ($status) = @_;
+  my $string;
+  my $signal = $status & 127;
+  my $cored = $status & 128;
+  my $code = $status >> 8;
+
+  if ($signal) {
+    $string = "signal = $signal";
+  } else {
+    $string = "exited = $code";
+  }
+
+  if ($cored) {
+    $string = $string . ", dumped core";
+  }
+
+  return $string;
+}
+
+sub open_control_fifo
+{
+  my ($svdir) = @_;
+  my $fifofile = "$svdir/.ctrl";
+  if (-e $fifofile) {
+    unlink $fifofile or die "Cannot remove fifo: $fifofile\n";
+  }
+  mkfifo($fifofile, 0700) or die "Cannot create fifo: $fifofile\n";
+  sysopen my $fifofh, $fifofile, O_NONBLOCK | O_RDWR or die "Cannot open fifo for reading: $fifofile\n";
+  return $fifofh;
+}
+
+sub pretty
+{
+  my ($text, $color) = @_;
+  if (-t STDERR) {
+    if ($color eq 'bold') {
+      return "\x1b[1m$text\x1b[0m";
+    } elsif ($color eq 'red') {
+      return "\x1b[31m\x1b[1m$text\x1b[0m";
+    } else {
+      return $text;
+    }
+  } else {
+    return $text;
+  }
+}
+
+my @commands;
+
+# If nonzero we should be exiting. -1 means exit without signal, >0 means exit with signal
+my $killed = 0;
+
+# If >0 then kill -9 all procs at this time
+my $killkill = 0;
+
+# Current proc order we're stopping. Ignored unless $killed is nonzero
+my $stopping = 100;
+
+# We'll do our own reaping
+$SIG{CHLD} = sub {};
+
+# Redirect stderr to stdout
+open STDERR, ">&STDOUT" or die;
+
+# Parse arguments
+my %opt = (
+  'chdir' => realpath("$FindBin::Bin/.."),
+  'vardir' => realpath("$FindBin::Bin/../var"),
+  'kill-timeout' => 360,
+);
+
+usage() unless GetOptions(
+  \%opt,
+  'conf|c=s',
+  'vardir|d=s',
+  'kill-timeout|t=i',
+  'chdir=s',
+  'svlogd:s'
+);
+
+usage() unless $opt{'conf'} && $opt{'vardir'};
+
+# Read config file
+my $config = read_config_file($opt{'conf'});
+@commands = @{$config->{commands}};
+
+if (!@commands) {
+  die "Nothing to run.\n";
+}
+
+# Potentially override --kill-timeout
+if (defined $config->{'kill-timeout'}) {
+  $opt{'kill-timeout'} = $config->{'kill-timeout'};
+}
+
+# Remember where vardir, svdir are after chdiring
+my $vardir = File::Spec->rel2abs($opt{vardir});
+my $svdir = "$vardir/sv";
+
+# chdir to the root of the distribution (or whereever)
+chdir($opt{chdir}) or die "chdir[$opt{chdir}] failed: $!\n";
+
+# Create vardir with tmp/
+if (! -e "$vardir/tmp") {
+  system("mkdir -p \Q$vardir\E/tmp") == 0 or die "mkdir $vardir/tmp failed: $!\n";
+}
+
+# Create svdir
+if (! -e $svdir) {
+  system("mkdir -p \Q$svdir\E") == 0 or die "mkdir $svdir failed: $!\n";
+}
+
+# Lock svdir and keep it locked until we exit
+my $lockfile = "$svdir/.lock";
+open my $lockfh, ">", $lockfile or die "Cannot write to svdir, please check permissions: $svdir\n";
+flock($lockfh, LOCK_EX | LOCK_NB) or die "Cannot lock svdir, maybe another 'supervise' is running: $svdir\n";
+
+# Create control fifo in svdir
+my $fifofh = open_control_fifo($svdir);
+
+# Run verification commands
+for my $verify_cmd (@{$config->{verify}}) {
+  system($verify_cmd) == 0 or exit 1;
+}
+
+# Catch killy signals and do an orderly shutdown
+$SIG{HUP} = sub { if (!$killed) { $killed = 1; $killkill = time + $opt{'kill-timeout'}; } };
+$SIG{INT} = sub { if (!$killed) { $killed = 2; $killkill = time + $opt{'kill-timeout'}; } };
+$SIG{TERM} = sub { if (!$killed) { $killed = 15; $killkill = time + $opt{'kill-timeout'}; } };
+
+# Build up control fifo command over multiple sysreads, potentially
+my $fifobuffer = '';
+
+while (1) {
+  # Spawn new procs
+  if (!$killed) {
+    for my $command (grep { !$_->{pid} } @commands) {
+      if ($command->{down} < time) {
+        my $logfile = sprintf("%s%s", "$svdir/$command->{name}", defined $opt{'svlogd'} ? "" : ".log");
+
+        logit "Running command[" . pretty($command->{name}, 'bold') . "], logging to[$logfile]: $command->{command}";
+
+        if (my $pid = fork) {
+          $command->{pid} = $pid;
+          $command->{logfile} = $logfile;
+        } else {
+          setsid;
+
+          if (defined $opt{'svlogd'}) {
+            if (! -e $logfile) {
+              system("mkdir -p \Q$logfile\E") == 0 or logdie "mkdir $logfile failed: $!\n";
+            }
+
+            if ($opt{'svlogd'}) {
+              copy($opt{'svlogd'}, "$logfile/config") or logdie "Failed copying $opt{'svlogd'} to $logfile/config: $!";
+            } else {
+              open my $configfh, ">", "$logfile/config" or logdie "Cannot write svlogd config, please check permissions: $logfile/config\n";
+              print $configfh "s100000000\nn10\nN5\nt604800";
+              close $configfh;
+            }
+
+            open STDOUT, "|svlogd $logfile" or logdie "pipe to svlogd $logfile failed: $!\n";
+          } else {
+            open STDOUT, ">>", $logfile or logdie "open $logfile failed: $!\n";
+          }
+
+          open STDERR, ">&STDOUT" or logdie "redirecting stderr failed: $!\n";
+          exec('sh', '-c', "exec $command->{command}") or logdie "exec [$command->{command}] failed: $!";
+        }
+      }
+    }
+  }
+
+  # Reap dead procs
+  my $pid;
+  while (($pid = waitpid(-1, WNOHANG)) > 0) {
+    my $status = $?;
+    my ($command) = (grep { $_->{pid} eq $pid } @commands);
+    if ($command) {
+      $command->{pid} = 0;
+      $command->{down} = time + 2;
+      logit "Command[" . pretty($command->{name}, 'bold') . "] exited (pid = $pid, " . stringify_exit_status($status) . ")";
+      if ($status && !$killed && !$command->{restarting}) {
+        # Unexpected exit
+        logit "Command[" . pretty($command->{name}, 'bold') . "] " . pretty("failed", "red") . ", see logfile for more details: $command->{logfile}";
+      }
+      $command->{restarting} = 0;
+    } else {
+      logit "ERR: Reaped unknown command (pid = $pid, " . stringify_exit_status($status) . ")";
+    }
+  }
+
+  # Kill procs, maybe
+  if ($killed) {
+    my $should_killkill = time > $killkill;
+
+    # Update stopping position, maybe
+    if ($should_killkill) {
+      $stopping = 0;
+    } else {
+      my $maxorder = 0;
+      for my $command (grep { $_->{pid} } @commands) {
+        if ($command->{order} > $maxorder) {
+          $maxorder = $command->{order};
+        }
+      }
+
+      if ($maxorder < $stopping) {
+        $stopping = $maxorder;
+      }
+    }
+
+    for my $command (grep { $_->{pid} && $_->{order} >= $stopping } @commands) {
+      my $want_signal;
+      if ($command->{killed} == 9 || $should_killkill) {
+        $want_signal = 9;
+      } else {
+        $want_signal = 15;
+      }
+
+      if ($command->{killed} != $want_signal) {
+        if ($want_signal != 9) {
+          my $kt = $opt{'kill-timeout'};
+          logit "Sending signal[$want_signal] to command[" . pretty($command->{name}, 'bold') . "] (timeout ${kt}s).";
+        } else {
+          logit "Sending signal[$want_signal] to command[" . pretty($command->{name}, 'bold') . "].";
+        }
+        kill $want_signal, $command->{pid} or logit "WARN: Could not signal pid: $command->{pid}";
+        $command->{killed} = $want_signal;
+      }
+    }
+  }
+
+  # Kill ourselves, maybe
+  if ($killed && ! grep { $_->{pid} } @commands) {
+    logit "Exiting.";
+    $SIG{HUP} = $SIG{INT} = $SIG{TERM} = 'DEFAULT';
+    if ($killed > 0) {
+      kill $killed, $$;
+      exit 1;
+    } else {
+      # Normal exit
+      exit 0;
+    }
+  }
+
+  # Be controlled, maybe
+  my $fifostr = "";
+  if (sysread $fifofh, $fifostr, 4096) {
+    $fifobuffer .= $fifostr;
+
+    while ($fifobuffer =~ /^([^\n]*)\n(.*)/s) {
+      my $fifocmd = $1;
+      $fifobuffer = $2;
+      if ($fifocmd =~ /^k (.+)$/ && !$killed) {
+        my $name = $1;
+        my ($command) = grep { $_->{name} eq $name && $_->{pid} } @commands;
+        if ($command) {
+          logit "Restarting command[" . pretty($name, "bold") . "].";
+          if (kill TERM => $command->{pid}) {
+            $command->{restarting} = 1;
+          } else {
+            logit "WARN: Could not signal pid: $command->{pid}"
+          }
+        } else {
+          logit "Asked to restart unknown command[" . pretty($name, "bold") . "], ignoring.";
+        }
+      } elsif ($fifocmd eq 'd') {
+        # -1 means exit without signal
+        $killed = -1;
+        $killkill = time + $opt{'kill-timeout'}
+      } else {
+        logit "Received unknown control command, ignoring.";
+      }
+    }
+  }
+
+  sleep 1;
+}
+
+exit 0;
diff --git a/examples/conf-quickstart/druid/broker/runtime.properties b/examples/bin/verify-default-ports
old mode 100644
new mode 100755
similarity index 62%
rename from examples/conf-quickstart/druid/broker/runtime.properties
rename to examples/bin/verify-default-ports
index 5eab4af436f..b8167fc7b2d
--- a/examples/conf-quickstart/druid/broker/runtime.properties
+++ b/examples/bin/verify-default-ports
@@ -1,4 +1,5 @@
-#
+#!/usr/bin/env perl
+
 # 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
@@ -15,21 +16,17 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-#
-
-druid.service=druid/broker
-druid.port=8082
 
-# HTTP server threads
-druid.broker.http.numConnections=5
-druid.server.http.numThreads=9
+use strict;
+use warnings;
+use Socket;
 
-# Processing threads and buffers
-druid.processing.buffer.sizeBytes=256000000
-druid.processing.numThreads=2
+my @ports = (1527, 2181, 8081, 8082, 8083, 8090, 8091, 8200, 9095);
 
-# Query cache (we use a small local cache)
-druid.broker.cache.useCache=true
-druid.broker.cache.populateCache=true
-druid.cache.type=local
-druid.cache.sizeInBytes=10000000
+my $tcp = getprotobyname("tcp");
+for my $port (@ports) {
+  socket(my $sock, PF_INET, SOCK_STREAM, $tcp) or die "socket: $!";
+  setsockopt($sock, SOL_SOCKET, SO_REUSEADDR, pack("l", 1)) or die "setsockopt: $!";
+  bind($sock, sockaddr_in($port, INADDR_ANY)) or die "Cannot start up because port[$port] is already in use.\n";
+  close $sock;
+}
diff --git a/examples/conf-quickstart/druid/historical/runtime.properties b/examples/bin/verify-java
old mode 100644
new mode 100755
similarity index 67%
rename from examples/conf-quickstart/druid/historical/runtime.properties
rename to examples/bin/verify-java
index 8681b6cbf61..7b5eb63fdd1
--- a/examples/conf-quickstart/druid/historical/runtime.properties
+++ b/examples/bin/verify-java
@@ -1,4 +1,5 @@
-#
+#!/usr/bin/env perl
+
 # 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
@@ -15,18 +16,18 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-#
 
-druid.service=druid/historical
-druid.port=8083
+use strict;
+use warnings;
 
-# HTTP server threads
-druid.server.http.numThreads=9
+my $java_version = qx[java -version 2>&1];
+if ($?) {
+  die "Please install Java 8 or better!\n";
+}
 
-# Processing threads and buffers
-druid.processing.buffer.sizeBytes=256000000
-druid.processing.numThreads=2
+# If we know it won't work, die. Otherwise hope for the best.
+if ($java_version =~ /java version \"((\d+)\.(\d+).*?)\"/ && ($2 < 1 || $3 < 8)) {
+  die "Please upgrade to Java 8 or better! Your current version is: $1\n";
+}
 
-# Segment storage
-druid.segmentCache.locations=[{"path":"var/druid/segment-cache","maxSize":300000000000}]
-druid.server.maxSize=300000000000
+exit 0;
diff --git a/examples/conf-quickstart/druid/_common/log4j2.xml b/examples/conf-quickstart/druid/_common/log4j2.xml
deleted file mode 100644
index 17203c64a15..00000000000
--- a/examples/conf-quickstart/druid/_common/log4j2.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one
-  ~ or more contributor license agreements.  See the NOTICE file
-  ~ distributed with this work for additional information
-  ~ regarding copyright ownership.  The ASF licenses this file
-  ~ to you under the Apache License, Version 2.0 (the
-  ~ "License"); you may not use this file except in compliance
-  ~ with the License.  You may obtain a copy of the License at
-  ~
-  ~   http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing,
-  ~ software distributed under the License is distributed on an
-  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~ KIND, either express or implied.  See the License for the
-  ~ specific language governing permissions and limitations
-  ~ under the License.
-  -->
-
-<Configuration status="WARN">
-    <Appenders>
-        <Console name="Console" target="SYSTEM_OUT">
-            <PatternLayout pattern="%d{ISO8601} %p [%t] %c - %m%n"/>
-        </Console>
-    </Appenders>
-    <Loggers>
-        <Root level="info">
-            <AppenderRef ref="Console"/>
-        </Root>
-    </Loggers>
-</Configuration>
-
diff --git a/examples/conf-quickstart/druid/middleManager/runtime.properties b/examples/conf-quickstart/druid/middleManager/runtime.properties
deleted file mode 100644
index ed0e1802a45..00000000000
--- a/examples/conf-quickstart/druid/middleManager/runtime.properties
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-druid.service=druid/middleManager
-druid.port=8091
-
-# Number of tasks per middleManager
-druid.worker.capacity=3
-
-# Task launch parameters
-druid.indexer.runner.javaOpts=-server -Xmx2g -Duser.timezone=UTC -Dfile.encoding=UTF-8 -Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager
-druid.indexer.task.baseTaskDir=var/druid/task
-
-# HTTP server threads
-druid.server.http.numThreads=9
-
-# Processing threads and buffers on Peons
-druid.indexer.fork.property.druid.processing.buffer.sizeBytes=256000000
-druid.indexer.fork.property.druid.processing.numThreads=2
-
-# Hadoop indexing
-druid.indexer.task.hadoopWorkingPath=var/druid/hadoop-tmp
diff --git a/examples/conf-quickstart/tranquility/kafka.json b/examples/conf-quickstart/tranquility/kafka.json
deleted file mode 100644
index 38858d25784..00000000000
--- a/examples/conf-quickstart/tranquility/kafka.json
+++ /dev/null
@@ -1,76 +0,0 @@
-{
-  "dataSources" : {
-    "metrics-kafka" : {
-      "spec" : {
-        "dataSchema" : {
-          "dataSource" : "metrics-kafka",
-          "parser" : {
-            "type" : "string",
-            "parseSpec" : {
-              "timestampSpec" : {
-                "column" : "timestamp",
-                "format" : "auto"
-              },
-              "dimensionsSpec" : {
-                "dimensions" : [],
-                "dimensionExclusions" : [
-                  "timestamp",
-                  "value"
-                ]
-              },
-              "format" : "json"
-            }
-          },
-          "granularitySpec" : {
-            "type" : "uniform",
-            "segmentGranularity" : "hour",
-            "queryGranularity" : "none"
-          },
-          "metricsSpec" : [
-            {
-              "type" : "count",
-              "name" : "count"
-            },
-            {
-              "name" : "value_sum",
-              "type" : "doubleSum",
-              "fieldName" : "value"
-            },
-            {
-              "fieldName" : "value",
-              "name" : "value_min",
-              "type" : "doubleMin"
-            },
-            {
-              "type" : "doubleMax",
-              "name" : "value_max",
-              "fieldName" : "value"
-            }
-          ]
-        },
-        "ioConfig" : {
-          "type" : "realtime"
-        },
-        "tuningConfig" : {
-          "type" : "realtime",
-          "intermediatePersistPeriod" : "PT10M",
-          "windowPeriod" : "PT10M"
-        }
-      },
-      "properties" : {
-        "task.partitions" : "1",
-        "task.replicants" : "1",
-        "topicPattern" : "metrics"
-      }
-    }
-  },
-  "properties" : {
-    "zookeeper.connect" : "localhost",
-    "druid.discovery.curator.path" : "/druid/discovery",
-    "druid.selectors.indexing.serviceName" : "druid/overlord",
-    "commit.periodMillis" : "15000",
-    "consumer.numThreads" : "2",
-    "kafka.zookeeper.connect" : "localhost",
-    "kafka.group.id" : "tranquility-kafka"
-  }
-}
diff --git a/examples/conf-quickstart/tranquility/server.json b/examples/conf-quickstart/tranquility/server.json
deleted file mode 100644
index a17f7166550..00000000000
--- a/examples/conf-quickstart/tranquility/server.json
+++ /dev/null
@@ -1,73 +0,0 @@
-{
-  "dataSources" : {
-    "metrics" : {
-      "spec" : {
-        "dataSchema" : {
-          "dataSource" : "metrics",
-          "parser" : {
-            "type" : "string",
-            "parseSpec" : {
-              "timestampSpec" : {
-                "column" : "timestamp",
-                "format" : "auto"
-              },
-              "dimensionsSpec" : {
-                "dimensions" : [],
-                "dimensionExclusions" : [
-                  "timestamp",
-                  "value"
-                ]
-              },
-              "format" : "json"
-            }
-          },
-          "granularitySpec" : {
-            "type" : "uniform",
-            "segmentGranularity" : "hour",
-            "queryGranularity" : "none"
-          },
-          "metricsSpec" : [
-            {
-              "type" : "count",
-              "name" : "count"
-            },
-            {
-              "name" : "value_sum",
-              "type" : "doubleSum",
-              "fieldName" : "value"
-            },
-            {
-              "fieldName" : "value",
-              "name" : "value_min",
-              "type" : "doubleMin"
-            },
-            {
-              "type" : "doubleMax",
-              "name" : "value_max",
-              "fieldName" : "value"
-            }
-          ]
-        },
-        "ioConfig" : {
-          "type" : "realtime"
-        },
-        "tuningConfig" : {
-          "type" : "realtime",
-          "intermediatePersistPeriod" : "PT10M",
-          "windowPeriod" : "PT10M"
-        }
-      },
-      "properties" : {
-        "task.partitions" : "1",
-        "task.replicants" : "1"
-      }
-    }
-  },
-  "properties" : {
-    "zookeeper.connect" : "localhost",
-    "druid.discovery.curator.path" : "/druid/discovery",
-    "druid.selectors.indexing.serviceName" : "druid/overlord",
-    "http.port" : "8200",
-    "http.threads" : "9"
-  }
-}
diff --git a/examples/quickstart/tutorial/compaction-final-index.json b/examples/quickstart/tutorial/compaction-final-index.json
new file mode 100644
index 00000000000..b84e2ed78d5
--- /dev/null
+++ b/examples/quickstart/tutorial/compaction-final-index.json
@@ -0,0 +1,11 @@
+{
+  "type": "compact",
+  "dataSource": "compaction-tutorial",
+  "interval": "2015-09-12/2015-09-13",
+  "tuningConfig" : {
+    "type" : "index",
+    "targetPartitionSize" : 5000000,
+    "maxRowsInMemory" : 25000,
+    "forceExtendableShardSpecs" : true
+  }
+}
diff --git a/examples/quickstart/tutorial/compaction-init-index.json b/examples/quickstart/tutorial/compaction-init-index.json
new file mode 100644
index 00000000000..f03c3714f51
--- /dev/null
+++ b/examples/quickstart/tutorial/compaction-init-index.json
@@ -0,0 +1,64 @@
+{
+  "type" : "index",
+  "spec" : {
+    "dataSchema" : {
+      "dataSource" : "compaction-tutorial",
+      "parser" : {
+        "type" : "string",
+        "parseSpec" : {
+          "format" : "json",
+          "dimensionsSpec" : {
+            "dimensions" : [
+              "channel",
+              "cityName",
+              "comment",
+              "countryIsoCode",
+              "countryName",
+              "isAnonymous",
+              "isMinor",
+              "isNew",
+              "isRobot",
+              "isUnpatrolled",
+              "metroCode",
+              "namespace",
+              "page",
+              "regionIsoCode",
+              "regionName",
+              "user",
+              { "name": "added", "type": "long" },
+              { "name": "deleted", "type": "long" },
+              { "name": "delta", "type": "long" }
+            ]
+          },
+          "timestampSpec": {
+            "column": "time",
+            "format": "iso"
+          }
+        }
+      },
+      "metricsSpec" : [],
+      "granularitySpec" : {
+        "type" : "uniform",
+        "segmentGranularity" : "hour",
+        "queryGranularity" : "none",
+        "intervals" : ["2015-09-12/2015-09-13"],
+        "rollup" : false
+      }
+    },
+    "ioConfig" : {
+      "type" : "index",
+      "firehose" : {
+        "type" : "local",
+        "baseDir" : "quickstart/",
+        "filter" : "wikiticker-2015-09-12-sampled.json.gz"
+      },
+      "appendToExisting" : false
+    },
+    "tuningConfig" : {
+      "type" : "index",
+      "targetPartitionSize" : 5000000,
+      "maxRowsInMemory" : 25000,
+      "forceExtendableShardSpecs" : true
+    }
+  }
+}
diff --git a/examples/conf-quickstart/druid/_common/common.runtime.properties b/examples/quickstart/tutorial/conf/druid/_common/common.runtime.properties
similarity index 87%
rename from examples/conf-quickstart/druid/_common/common.runtime.properties
rename to examples/quickstart/tutorial/conf/druid/_common/common.runtime.properties
index 79a95559bde..bdff17d6cc0 100644
--- a/examples/conf-quickstart/druid/_common/common.runtime.properties
+++ b/examples/quickstart/tutorial/conf/druid/_common/common.runtime.properties
@@ -1,18 +1,18 @@
 #
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
+# Licensed to Metamarkets Group Inc. (Metamarkets) 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
+# regarding copyright ownership. Metamarkets 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
+# with the License. You may obtain a copy of the License at
 #
-#   http://www.apache.org/licenses/LICENSE-2.0
+# 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
+# KIND, either express or implied. See the License for the
 # specific language governing permissions and limitations
 # under the License.
 #
@@ -24,12 +24,18 @@
 # If you specify `druid.extensions.loadList=[]`, Druid won't load any extension from file system.
 # If you don't specify `druid.extensions.loadList`, Druid will load all the extensions under root extension directory.
 # More info: http://druid.io/docs/latest/operations/including-extensions.html
-druid.extensions.loadList=[]
+druid.extensions.loadList=["druid-hdfs-storage", "druid-kafka-indexing-service"]
 
 # If you have a different version of Hadoop, place your Hadoop client jar files in your hadoop-dependencies directory
 # and uncomment the line below to point to your directory.
 #druid.extensions.hadoopDependenciesDir=/my/dir/hadoop-dependencies
 
+
+#
+# Hostname
+#
+druid.host=localhost
+
 #
 # Logging
 #
@@ -126,3 +132,9 @@ druid.indexing.doubleStorage=double
 # Security
 #
 druid.server.hiddenProperties=["druid.s3.accessKey","druid.s3.secretKey","druid.metadata.storage.connector.password"]
+
+
+#
+# SQL
+#
+druid.sql.enable=true
diff --git a/examples/quickstart/tutorial/conf/druid/_common/log4j2.xml b/examples/quickstart/tutorial/conf/druid/_common/log4j2.xml
new file mode 100644
index 00000000000..a60ebda9eb4
--- /dev/null
+++ b/examples/quickstart/tutorial/conf/druid/_common/log4j2.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ ~ Licensed to Metamarkets Group Inc. (Metamarkets) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. Metamarkets 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.
+-->
+
+<Configuration status="WARN">
+    <Appenders>
+        <Console name="Console" target="SYSTEM_OUT">
+            <PatternLayout pattern="%d{ISO8601} %p [%t] %c - %m%n"/>
+        </Console>
+    </Appenders>
+    <Loggers>
+        <Root level="info">
+            <AppenderRef ref="Console"/>
+        </Root>
+    </Loggers>
+</Configuration>
+
diff --git a/examples/conf-quickstart/druid/broker/jvm.config b/examples/quickstart/tutorial/conf/druid/broker/jvm.config
similarity index 100%
rename from examples/conf-quickstart/druid/broker/jvm.config
rename to examples/quickstart/tutorial/conf/druid/broker/jvm.config
diff --git a/examples/quickstart/tutorial/conf/druid/broker/main.config b/examples/quickstart/tutorial/conf/druid/broker/main.config
new file mode 100644
index 00000000000..de21e417fa1
--- /dev/null
+++ b/examples/quickstart/tutorial/conf/druid/broker/main.config
@@ -0,0 +1 @@
+io.druid.cli.Main server broker
diff --git a/examples/quickstart/tutorial/conf/druid/broker/runtime.properties b/examples/quickstart/tutorial/conf/druid/broker/runtime.properties
new file mode 100644
index 00000000000..bb2aababe54
--- /dev/null
+++ b/examples/quickstart/tutorial/conf/druid/broker/runtime.properties
@@ -0,0 +1,16 @@
+druid.service=druid/broker
+druid.port=8082
+
+# HTTP server threads
+druid.broker.http.numConnections=5
+druid.server.http.numThreads=9
+
+# Processing threads and buffers
+druid.processing.buffer.sizeBytes=256000000
+druid.processing.numThreads=2
+
+# Query cache (we use a small local cache)
+druid.broker.cache.useCache=true
+druid.broker.cache.populateCache=true
+druid.cache.type=local
+druid.cache.sizeInBytes=10000000
diff --git a/examples/conf-quickstart/druid/coordinator/jvm.config b/examples/quickstart/tutorial/conf/druid/coordinator/jvm.config
similarity index 100%
rename from examples/conf-quickstart/druid/coordinator/jvm.config
rename to examples/quickstart/tutorial/conf/druid/coordinator/jvm.config
diff --git a/examples/quickstart/tutorial/conf/druid/coordinator/main.config b/examples/quickstart/tutorial/conf/druid/coordinator/main.config
new file mode 100644
index 00000000000..e8e6ed91e7b
--- /dev/null
+++ b/examples/quickstart/tutorial/conf/druid/coordinator/main.config
@@ -0,0 +1 @@
+io.druid.cli.Main server coordinator
diff --git a/examples/quickstart/tutorial/conf/druid/coordinator/runtime.properties b/examples/quickstart/tutorial/conf/druid/coordinator/runtime.properties
new file mode 100644
index 00000000000..a61482f2a0f
--- /dev/null
+++ b/examples/quickstart/tutorial/conf/druid/coordinator/runtime.properties
@@ -0,0 +1,5 @@
+druid.service=druid/coordinator
+druid.port=8081
+
+druid.coordinator.startDelay=PT10S
+druid.coordinator.period=PT5S
diff --git a/examples/conf-quickstart/druid/historical/jvm.config b/examples/quickstart/tutorial/conf/druid/historical/jvm.config
similarity index 100%
rename from examples/conf-quickstart/druid/historical/jvm.config
rename to examples/quickstart/tutorial/conf/druid/historical/jvm.config
diff --git a/examples/quickstart/tutorial/conf/druid/historical/main.config b/examples/quickstart/tutorial/conf/druid/historical/main.config
new file mode 100644
index 00000000000..1a7749356c4
--- /dev/null
+++ b/examples/quickstart/tutorial/conf/druid/historical/main.config
@@ -0,0 +1 @@
+io.druid.cli.Main server historical
diff --git a/examples/quickstart/tutorial/conf/druid/historical/runtime.properties b/examples/quickstart/tutorial/conf/druid/historical/runtime.properties
new file mode 100644
index 00000000000..af900e8fbd5
--- /dev/null
+++ b/examples/quickstart/tutorial/conf/druid/historical/runtime.properties
@@ -0,0 +1,13 @@
+druid.service=druid/historical
+druid.port=8083
+
+# HTTP server threads
+druid.server.http.numThreads=9
+
+# Processing threads and buffers
+druid.processing.buffer.sizeBytes=256000000
+druid.processing.numThreads=2
+
+# Segment storage
+druid.segmentCache.locations=[{"path":"var/druid/segment-cache","maxSize":300000000000}]
+druid.server.maxSize=300000000000
diff --git a/examples/conf-quickstart/druid/middleManager/jvm.config b/examples/quickstart/tutorial/conf/druid/middleManager/jvm.config
similarity index 100%
rename from examples/conf-quickstart/druid/middleManager/jvm.config
rename to examples/quickstart/tutorial/conf/druid/middleManager/jvm.config
diff --git a/examples/quickstart/tutorial/conf/druid/middleManager/main.config b/examples/quickstart/tutorial/conf/druid/middleManager/main.config
new file mode 100644
index 00000000000..aa70653e6a2
--- /dev/null
+++ b/examples/quickstart/tutorial/conf/druid/middleManager/main.config
@@ -0,0 +1 @@
+io.druid.cli.Main server middleManager
diff --git a/examples/quickstart/tutorial/conf/druid/middleManager/runtime.properties b/examples/quickstart/tutorial/conf/druid/middleManager/runtime.properties
new file mode 100644
index 00000000000..fcfb974603f
--- /dev/null
+++ b/examples/quickstart/tutorial/conf/druid/middleManager/runtime.properties
@@ -0,0 +1,19 @@
+druid.service=druid/middleManager
+druid.port=8091
+
+# Number of tasks per middleManager
+druid.worker.capacity=3
+
+# Task launch parameters
+druid.indexer.runner.javaOpts=-server -Xmx2g -Duser.timezone=UTC -Dfile.encoding=UTF-8 -Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager
+druid.indexer.task.baseTaskDir=var/druid/task
+
+# HTTP server threads
+druid.server.http.numThreads=9
+
+# Processing threads and buffers on Peons
+druid.indexer.fork.property.druid.processing.buffer.sizeBytes=256000000
+druid.indexer.fork.property.druid.processing.numThreads=2
+
+# Hadoop indexing
+druid.indexer.task.hadoopWorkingPath=var/druid/hadoop-tmp
diff --git a/examples/conf-quickstart/druid/overlord/jvm.config b/examples/quickstart/tutorial/conf/druid/overlord/jvm.config
similarity index 100%
rename from examples/conf-quickstart/druid/overlord/jvm.config
rename to examples/quickstart/tutorial/conf/druid/overlord/jvm.config
diff --git a/examples/quickstart/tutorial/conf/druid/overlord/main.config b/examples/quickstart/tutorial/conf/druid/overlord/main.config
new file mode 100644
index 00000000000..af7eda05b38
--- /dev/null
+++ b/examples/quickstart/tutorial/conf/druid/overlord/main.config
@@ -0,0 +1 @@
+io.druid.cli.Main server overlord
diff --git a/examples/quickstart/tutorial/conf/druid/overlord/runtime.properties b/examples/quickstart/tutorial/conf/druid/overlord/runtime.properties
new file mode 100644
index 00000000000..7ab544ad936
--- /dev/null
+++ b/examples/quickstart/tutorial/conf/druid/overlord/runtime.properties
@@ -0,0 +1,7 @@
+druid.service=druid/overlord
+druid.port=8090
+
+druid.indexer.queue.startDelay=PT5S
+
+druid.indexer.runner.type=remote
+druid.indexer.storage.type=metadata
diff --git a/examples/quickstart/tutorial/conf/tranquility/wikipedia-server.json b/examples/quickstart/tutorial/conf/tranquility/wikipedia-server.json
new file mode 100644
index 00000000000..0895cab1e62
--- /dev/null
+++ b/examples/quickstart/tutorial/conf/tranquility/wikipedia-server.json
@@ -0,0 +1,84 @@
+{
+  "dataSources" : {
+    "wikipedia" : {
+      "spec" : {
+        "dataSchema" : {
+          "dataSource" : "wikipedia",
+          "parser" : {
+            "type" : "string",
+            "parseSpec" : {
+              "format" : "json",
+              "dimensionsSpec" : {
+                "dimensions" : [
+                  "channel",
+                  "cityName",
+                  "comment",
+                  "countryIsoCode",
+                  "countryName",
+                  "isAnonymous",
+                  "isMinor",
+                  "isNew",
+                  "isRobot",
+                  "isUnpatrolled",
+                  "metroCode",
+                  "namespace",
+                  "page",
+                  "regionIsoCode",
+                  "regionName",
+                  "user"
+                ]
+              },
+              "timestampSpec": {
+                "column": "time",
+                "format": "iso"
+              }
+            }
+          },
+          "metricsSpec" : [
+            {
+              "name" : "added",
+              "type" : "longSum",
+              "fieldName" : "added"
+            },
+            {
+              "name" : "deleted",
+              "type" : "longSum",
+              "fieldName" : "deleted"
+            },
+            {
+              "name" : "delta",
+              "type" : "longSum",
+              "fieldName" : "delta"
+            }
+          ],
+          "granularitySpec" : {
+            "type" : "uniform",
+            "segmentGranularity" : "day",
+            "queryGranularity" : "none",
+            "intervals" : ["2015-09-12/2015-09-13"],
+            "rollup" : false
+          }
+        },
+        "ioConfig" : {
+          "type" : "realtime"
+        },
+        "tuningConfig" : {
+          "type" : "realtime",
+          "intermediatePersistPeriod" : "PT10M",
+          "windowPeriod" : "P3650D"
+        }
+      },
+      "properties" : {
+        "task.partitions" : "1",
+        "task.replicants" : "1"
+      }
+    }
+  },
+  "properties" : {
+    "zookeeper.connect" : "localhost",
+    "druid.discovery.curator.path" : "/druid/discovery",
+    "druid.selectors.indexing.serviceName" : "druid/overlord",
+    "http.port" : "8200",
+    "http.threads" : "9"
+  }
+}
diff --git a/examples/quickstart/tutorial/conf/tutorial-cluster.conf b/examples/quickstart/tutorial/conf/tutorial-cluster.conf
new file mode 100644
index 00000000000..c1316cc5ba5
--- /dev/null
+++ b/examples/quickstart/tutorial/conf/tutorial-cluster.conf
@@ -0,0 +1,13 @@
+:verify bin/verify-java
+:verify bin/verify-default-ports
+:kill-timeout 10
+
+!p10 zk bin/run-zk quickstart/tutorial/conf
+coordinator bin/run-druid coordinator quickstart/tutorial/conf
+broker bin/run-druid broker quickstart/tutorial/conf
+historical bin/run-druid historical quickstart/tutorial/conf
+!p80 overlord bin/run-druid overlord quickstart/tutorial/conf
+!p90 middleManager bin/run-druid middleManager quickstart/tutorial/conf
+
+# Uncomment to use Tranquility Server
+#!p95 tranquility-server tranquility/bin/tranquility server -configFile quickstart/tutorial/conf/tranquility/wikipedia-server.json -Ddruid.extensions.loadList=[]
diff --git a/examples/quickstart/tutorial/conf/zk/jvm.config b/examples/quickstart/tutorial/conf/zk/jvm.config
new file mode 100644
index 00000000000..3f2906d463f
--- /dev/null
+++ b/examples/quickstart/tutorial/conf/zk/jvm.config
@@ -0,0 +1,4 @@
+-server
+-Xms128m
+-Xmx128m
+-Duser.timezone=UTC
diff --git a/examples/quickstart/tutorial/conf/zk/log4j.xml b/examples/quickstart/tutorial/conf/zk/log4j.xml
new file mode 100644
index 00000000000..5ed9b01bdc8
--- /dev/null
+++ b/examples/quickstart/tutorial/conf/zk/log4j.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+  <appender name="console" class="org.apache.log4j.ConsoleAppender"> 
+    <param name="Target" value="System.out"/> 
+    <layout class="org.apache.log4j.PatternLayout"> 
+      <param name="ConversionPattern" value="%d{ISO8601} %p [%t] %c - %m%n"/> 
+    </layout>
+  </appender> 
+
+  <root> 
+    <priority value ="info" /> 
+    <appender-ref ref="console" /> 
+  </root>
+  
+</log4j:configuration>
diff --git a/examples/quickstart/tutorial/conf/zk/zoo.cfg b/examples/quickstart/tutorial/conf/zk/zoo.cfg
new file mode 100644
index 00000000000..72e57e67d27
--- /dev/null
+++ b/examples/quickstart/tutorial/conf/zk/zoo.cfg
@@ -0,0 +1,16 @@
+#
+# Server
+#
+
+tickTime=2000
+dataDir=var/zk
+clientPort=2181
+initLimit=5
+syncLimit=2
+
+#
+# Autopurge
+#
+
+autopurge.snapRetainCount=5
+autopurge.purgeInterval=1
diff --git a/examples/quickstart/tutorial/deletion-index.json b/examples/quickstart/tutorial/deletion-index.json
new file mode 100644
index 00000000000..7f2f60af63f
--- /dev/null
+++ b/examples/quickstart/tutorial/deletion-index.json
@@ -0,0 +1,64 @@
+{
+  "type" : "index",
+  "spec" : {
+    "dataSchema" : {
+      "dataSource" : "deletion-tutorial",
+      "parser" : {
+        "type" : "string",
+        "parseSpec" : {
+          "format" : "json",
+          "dimensionsSpec" : {
+            "dimensions" : [
+              "channel",
+              "cityName",
+              "comment",
+              "countryIsoCode",
+              "countryName",
+              "isAnonymous",
+              "isMinor",
+              "isNew",
+              "isRobot",
+              "isUnpatrolled",
+              "metroCode",
+              "namespace",
+              "page",
+              "regionIsoCode",
+              "regionName",
+              "user",
+              { "name": "added", "type": "long" },
+              { "name": "deleted", "type": "long" },
+              { "name": "delta", "type": "long" }
+            ]
+          },
+          "timestampSpec": {
+            "column": "time",
+            "format": "iso"
+          }
+        }
+      },
+      "metricsSpec" : [],
+      "granularitySpec" : {
+        "type" : "uniform",
+        "segmentGranularity" : "hour",
+        "queryGranularity" : "none",
+        "intervals" : ["2015-09-12/2015-09-13"],
+        "rollup" : false
+      }
+    },
+    "ioConfig" : {
+      "type" : "index",
+      "firehose" : {
+        "type" : "local",
+        "baseDir" : "quickstart/",
+        "filter" : "wikiticker-2015-09-12-sampled.json.gz"
+      },
+      "appendToExisting" : false
+    },
+    "tuningConfig" : {
+      "type" : "index",
+      "targetPartitionSize" : 5000000,
+      "maxRowsInMemory" : 25000,
+      "forceExtendableShardSpecs" : true
+    }
+  }
+}
diff --git a/examples/quickstart/tutorial/deletion-kill.json b/examples/quickstart/tutorial/deletion-kill.json
new file mode 100644
index 00000000000..c160a7c6632
--- /dev/null
+++ b/examples/quickstart/tutorial/deletion-kill.json
@@ -0,0 +1,5 @@
+{
+  "type": "kill",
+  "dataSource": "deletion-tutorial",
+  "interval" : "2015-09-12/2015-09-13"
+}
diff --git a/examples/quickstart/tutorial/hadoop/docker/Dockerfile b/examples/quickstart/tutorial/hadoop/docker/Dockerfile
new file mode 100644
index 00000000000..31aeeb4fe8a
--- /dev/null
+++ b/examples/quickstart/tutorial/hadoop/docker/Dockerfile
@@ -0,0 +1,107 @@
+# Creates pseudo distributed hadoop 2.8.3 with java 8
+#
+# Modified from the SequenceIQ Dockerfiles at https://github.com/sequenceiq/hadoop-docker
+#
+# docker build -t druid-hadoop-demo:2.8.3 .
+
+FROM sequenceiq/pam:centos-6.5
+MAINTAINER SequenceIQ
+
+USER root
+
+# install dev tools
+RUN yum clean all \
+    && rpm --rebuilddb \
+    && yum install -y curl which tar sudo openssh-server openssh-clients rsync yum-plugin-ovl\
+    && yum clean all \
+    && yum update -y libselinux \
+    && yum clean all
+# update libselinux. see https://github.com/sequenceiq/hadoop-docker/issues/14
+
+# passwordless ssh
+RUN ssh-keygen -q -N "" -t dsa -f /etc/ssh/ssh_host_dsa_key
+RUN ssh-keygen -q -N "" -t rsa -f /etc/ssh/ssh_host_rsa_key
+RUN ssh-keygen -q -N "" -t rsa -f /root/.ssh/id_rsa
+RUN cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys
+
+# zulu java 8
+RUN rpm --import http://repos.azulsystems.com/RPM-GPG-KEY-azulsystems
+RUN rpm --rebuilddb
+RUN sudo curl -o /etc/yum.repos.d/zulu.repo http://repos.azulsystems.com/rhel/zulu.repo
+RUN yum install -y zulu-8
+
+ENV JAVA_HOME /usr/lib/jvm/zulu-8
+ENV PATH $PATH:$JAVA_HOME/bin
+
+# hadoop
+RUN curl -s https://archive.apache.org/dist/hadoop/core/hadoop-2.8.3/hadoop-2.8.3.tar.gz | tar -xz -C /usr/local/
+RUN cd /usr/local && ln -s ./hadoop-2.8.3 hadoop
+
+ENV HADOOP_PREFIX /usr/local/hadoop
+ENV HADOOP_COMMON_HOME /usr/local/hadoop
+ENV HADOOP_HDFS_HOME /usr/local/hadoop
+ENV HADOOP_MAPRED_HOME /usr/local/hadoop
+ENV HADOOP_YARN_HOME /usr/local/hadoop
+ENV HADOOP_CONF_DIR /usr/local/hadoop/etc/hadoop
+ENV YARN_CONF_DIR $HADOOP_PREFIX/etc/hadoop
+
+RUN sed -i '/^export JAVA_HOME/ s:.*:export JAVA_HOME=/usr/lib/jvm/zulu-8\nexport HADOOP_PREFIX=/usr/local/hadoop\nexport HADOOP_HOME=/usr/local/hadoop\n:' $HADOOP_PREFIX/etc/hadoop/hadoop-env.sh
+RUN sed -i '/^export HADOOP_CONF_DIR/ s:.*:export HADOOP_CONF_DIR=/usr/local/hadoop/etc/hadoop/:' $HADOOP_PREFIX/etc/hadoop/hadoop-env.sh
+
+RUN mkdir $HADOOP_PREFIX/input
+RUN cp $HADOOP_PREFIX/etc/hadoop/*.xml $HADOOP_PREFIX/input
+
+# pseudo distributed
+ADD core-site.xml.template $HADOOP_PREFIX/etc/hadoop/core-site.xml.template
+RUN sed s/HOSTNAME/localhost/ /usr/local/hadoop/etc/hadoop/core-site.xml.template > /usr/local/hadoop/etc/hadoop/core-site.xml
+ADD hdfs-site.xml $HADOOP_PREFIX/etc/hadoop/hdfs-site.xml
+
+ADD mapred-site.xml $HADOOP_PREFIX/etc/hadoop/mapred-site.xml
+ADD yarn-site.xml $HADOOP_PREFIX/etc/hadoop/yarn-site.xml
+
+RUN $HADOOP_PREFIX/bin/hdfs namenode -format
+
+ADD ssh_config /root/.ssh/config
+RUN chmod 600 /root/.ssh/config
+RUN chown root:root /root/.ssh/config
+
+# # installing supervisord
+# RUN yum install -y python-setuptools
+# RUN easy_install pip
+# RUN curl https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -o - | python
+# RUN pip install supervisor
+#
+# ADD supervisord.conf /etc/supervisord.conf
+
+ADD bootstrap.sh /etc/bootstrap.sh
+RUN chown root:root /etc/bootstrap.sh
+RUN chmod 700 /etc/bootstrap.sh
+
+ENV BOOTSTRAP /etc/bootstrap.sh
+
+# workingaround docker.io build error
+RUN ls -la /usr/local/hadoop/etc/hadoop/*-env.sh
+RUN chmod +x /usr/local/hadoop/etc/hadoop/*-env.sh
+RUN ls -la /usr/local/hadoop/etc/hadoop/*-env.sh
+
+# Copy additional .jars to classpath
+RUN cp /usr/local/hadoop/share/hadoop/tools/lib/*.jar /usr/local/hadoop/share/hadoop/common/lib/
+
+# fix the 254 error code
+RUN sed  -i "/^[^#]*UsePAM/ s/.*/#&/"  /etc/ssh/sshd_config
+RUN echo "UsePAM no" >> /etc/ssh/sshd_config
+RUN echo "Port 2122" >> /etc/ssh/sshd_config
+
+RUN service sshd start && $HADOOP_PREFIX/etc/hadoop/hadoop-env.sh && $HADOOP_PREFIX/sbin/start-dfs.sh && $HADOOP_PREFIX/bin/hdfs dfs -mkdir -p /user/root
+RUN service sshd start && $HADOOP_PREFIX/etc/hadoop/hadoop-env.sh && $HADOOP_PREFIX/sbin/start-dfs.sh && $HADOOP_PREFIX/bin/hdfs dfs -put $HADOOP_PREFIX/etc/hadoop/ input
+
+CMD ["/etc/bootstrap.sh", "-d"]
+
+# Hdfs ports
+EXPOSE 50010 50020 50070 50075 50090 8020 9000
+# Mapred ports
+EXPOSE 10020 19888
+#Yarn ports
+EXPOSE 8030 8031 8032 8033 8040 8042 8088
+#Other ports
+EXPOSE 49707 2122
diff --git a/examples/quickstart/tutorial/hadoop/docker/LICENSE b/examples/quickstart/tutorial/hadoop/docker/LICENSE
new file mode 100644
index 00000000000..4f4964bf3f3
--- /dev/null
+++ b/examples/quickstart/tutorial/hadoop/docker/LICENSE
@@ -0,0 +1,1331 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+Apache Knox Subcomponents (binary distributions):
+
+Apache Knox includes a number of sub-components with separate copyright
+notices and license terms.  Your use of these sub-components is subject
+to the terms and conditions of the following licenses.
+
+------------------------------------------------------------------------------
+From Jetty and Jerico
+------------------------------------------------------------------------------
+Eclipse Public License - v 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM
+CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+a) in the case of the initial Contributor, the initial code and documentation
+distributed under this Agreement, and
+
+b) in the case of each subsequent Contributor:
+
+i) changes to the Program, and
+
+ii) additions to the Program;
+
+where such changes and/or additions to the Program originate from and are
+distributed by that particular Contributor. A Contribution 'originates' from a
+Contributor if it was added to the Program by such Contributor itself or anyone
+acting on such Contributor's behalf. Contributions do not include additions to
+the Program which: (i) are separate modules of software distributed in
+conjunction with the Program under their own license agreement, and (ii) are not
+derivative works of the Program.
+
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents" mean patent claims licensable by a Contributor which are
+necessarily infringed by the use or sale of its Contribution alone or when
+combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement,
+including all Contributors.
+
+2. GRANT OF RIGHTS
+
+a) Subject to the terms of this Agreement, each Contributor hereby grants
+Recipient a non-exclusive, worldwide, royalty-free copyright license to
+reproduce, prepare derivative works of, publicly display, publicly perform,
+distribute and sublicense the Contribution of such Contributor, if any, and such
+derivative works, in source code and object code form.
+
+b) Subject to the terms of this Agreement, each Contributor hereby grants
+Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed
+Patents to make, use, sell, offer to sell, import and otherwise transfer the
+Contribution of such Contributor, if any, in source code and object code form.
+This patent license shall apply to the combination of the Contribution and the
+Program if, at the time the Contribution is added by the Contributor, such
+addition of the Contribution causes such combination to be covered by the
+Licensed Patents. The patent license shall not apply to any other combinations
+which include the Contribution. No hardware per se is licensed hereunder.
+
+c) Recipient understands that although each Contributor grants the licenses to
+its Contributions set forth herein, no assurances are provided by any
+Contributor that the Program does not infringe the patent or other intellectual
+property rights of any other entity. Each Contributor disclaims any liability to
+Recipient for claims brought by any other entity based on infringement of
+intellectual property rights or otherwise. As a condition to exercising the
+rights and licenses granted hereunder, each Recipient hereby assumes sole
+responsibility to secure any other intellectual property rights needed, if any.
+For example, if a third party patent license is required to allow Recipient to
+distribute the Program, it is Recipient's responsibility to acquire that license
+before distributing the Program.
+
+d) Each Contributor represents that to its knowledge it has sufficient copyright
+rights in its Contribution, if any, to grant the copyright license set forth in
+this Agreement.
+
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form under its
+own license agreement, provided that:
+
+a) it complies with the terms and conditions of this Agreement; and
+
+b) its license agreement:
+
+i) effectively disclaims on behalf of all Contributors all warranties and
+conditions, express and implied, including warranties or conditions of title and
+non-infringement, and implied warranties or conditions of merchantability and
+fitness for a particular purpose;
+
+ii) effectively excludes on behalf of all Contributors all liability for
+damages, including direct, indirect, special, incidental and consequential
+damages, such as lost profits;
+
+iii) states that any provisions which differ from this Agreement are offered by
+that Contributor alone and not by any other party; and
+
+iv) states that source code for the Program is available from such Contributor,
+and informs licensees how to obtain it in a reasonable manner on or through a
+medium customarily used for software exchange.
+
+When the Program is made available in source code form:
+
+a) it must be made available under this Agreement; and
+
+b) a copy of this Agreement must be included with each copy of the Program.
+
+Contributors may not remove or alter any copyright notices contained within the
+Program.
+
+Each Contributor must identify itself as the originator of its Contribution, if
+any, in a manner that reasonably allows subsequent Recipients to identify the
+originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with
+respect to end users, business partners and the like. While this license is
+intended to facilitate the commercial use of the Program, the Contributor who
+includes the Program in a commercial product offering should do so in a manner
+which does not create potential liability for other Contributors. Therefore, if
+a Contributor includes the Program in a commercial product offering, such
+Contributor ("Commercial Contributor") hereby agrees to defend and indemnify
+every other Contributor ("Indemnified Contributor") against any losses, damages
+and costs (collectively "Losses") arising from claims, lawsuits and other legal
+actions brought by a third party against the Indemnified Contributor to the
+extent caused by the acts or omissions of such Commercial Contributor in
+connection with its distribution of the Program in a commercial product
+offering. The obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In order
+to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
+Contributor in writing of such claim, and b) allow the Commercial Contributor
+to control, and cooperate with the Commercial Contributor in, the defense and
+any related settlement negotiations. The Indemnified Contributor may
+participate in any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial product
+offering, Product X. That Contributor is then a Commercial Contributor. If that
+Commercial Contributor then makes performance claims, or offers warranties
+related to Product X, those performance claims and warranties are such
+Commercial Contributor's responsibility alone. Under this section, the
+Commercial Contributor would have to defend claims against the other
+Contributors related to those performance claims and warranties, and if a court
+requires any other Contributor to pay any damages as a result, the Commercial
+Contributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
+IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE,
+NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each
+Recipient is solely responsible for determining the appropriateness of using and
+distributing the Program and assumes all risks associated with its exercise of
+rights under this Agreement , including but not limited to the risks and costs
+of program errors, compliance with applicable laws, damage to or loss of data,
+programs or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY
+CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST
+PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS
+GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable
+law, it shall not affect the validity or enforceability of the remainder of the
+terms of this Agreement, and without further action by the parties hereto, such
+provision shall be reformed to the minimum extent necessary to make such
+provision valid and enforceable.
+
+If Recipient institutes patent litigation against any entity (including a
+cross-claim or counterclaim in a lawsuit) alleging that the Program itself
+(excluding combinations of the Program with other software or hardware)
+infringes such Recipient's patent(s), then such Recipient's rights granted under
+Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it fails to
+comply with any of the material terms or conditions of this Agreement and does
+not cure such failure in a reasonable period of time after becoming aware of
+such noncompliance. If all Recipient's rights under this Agreement terminate,
+Recipient agrees to cease use and distribution of the Program as soon as
+reasonably practicable. However, Recipient's obligations under this Agreement
+and any licenses granted by Recipient relating to the Program shall continue and
+survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement, but in
+order to avoid inconsistency the Agreement is copyrighted and may only be
+modified in the following manner. The Agreement Steward reserves the right to
+publish new versions (including revisions) of this Agreement from time to time.
+No one other than the Agreement Steward has the right to modify this Agreement.
+The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation
+may assign the responsibility to serve as the Agreement Steward to a suitable
+separate entity. Each new version of the Agreement will be given a
+distinguishing version number. The Program (including Contributions) may always
+be distributed subject to the version of the Agreement under which it was
+received. In addition, after a new version of the Agreement is published,
+Contributor may elect to distribute the Program (including its Contributions)
+under the new version. Except as expressly stated in Sections 2(a) and 2(b)
+above, Recipient receives no rights or licenses to the intellectual property of
+any Contributor under this Agreement, whether expressly, by implication,
+estoppel or otherwise. All rights in the Program not expressly granted under
+this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the
+intellectual property laws of the United States of America. No party to this
+Agreement will bring a legal action under this Agreement more than one year
+after the cause of action arose. Each party waives its rights to a jury trial in
+any resulting litigation.
+
+
+For TODO.jar (Jave EE Servlet API)
+
+COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+
+1. Definitions.
+
+   1.1. Contributor. means each individual or entity that creates or contributes
+        to the creation of Modifications.
+
+   1.2. Contributor Version. means the combination of the Original Software,
+        prior Modifications used by a Contributor (if any), and the
+        Modifications made by that particular Contributor.
+
+   1.3. Covered Software. means (a) the Original Software, or (b) Modifications,
+        or (c) the combination of files containing Original Software with files
+        containing Modifications, in each case including portions thereof.
+
+   1.4. Executable. means the Covered Software in any form other than Source
+        Code.
+
+   1.5. Initial Developer. means the individual or entity that first makes
+        Original Software available under this License.
+
+   1.6. Larger Work. means a work which combines Covered Software or portions
+        thereof with code not governed by the terms of this License.
+
+   1.7. License. means this document.
+
+   1.8. Licensable. means having the right to grant, to the maximum extent
+        possible, whether at the time of the initial grant or subsequently
+        acquired, any and all of the rights conveyed herein.
+
+   1.9. Modifications. means the Source Code and Executable form of any of the
+        following:
+
+        A. Any file that results from an addition to, deletion from or
+           modification of the contents of a file containing Original Software
+           or previous Modifications;
+
+        B. Any new file that contains any part of the Original Software or
+           previous Modification; or
+
+        C. Any new file that is contributed or otherwise made available under
+           the terms of this License.
+
+   1.10. Original Software. means the Source Code and Executable form of
+         computer software code that is originally released under this License.
+
+   1.11. Patent Claims. means any patent claim(s), now owned or hereafter
+         acquired, including without limitation, method, process, and apparatus
+         claims, in any patent Licensable by grantor.
+
+   1.12. Source Code. means (a) the common form of computer software code in
+         which modifications are made and (b) associated documentation included
+         in or with such code.
+
+   1.13. You. (or .Your.) means an individual or a legal entity exercising
+         rights under, and complying with all of the terms of, this License. For
+         legal entities, .You. includes any entity which controls, is controlled
+         by, or is under common control with You. For purposes of this
+         definition, .control. means (a) the power, direct or indirect, to cause
+         the direction or management of such entity, whether by contract or
+         otherwise, or (b) ownership of more than fifty percent (50%) of the
+         outstanding shares or beneficial ownership of such entity.
+
+2. License Grants.
+
+      2.1. The Initial Developer Grant.
+
+      Conditioned upon Your compliance with Section 3.1 below and subject to
+      third party intellectual property claims, the Initial Developer hereby
+      grants You a world-wide, royalty-free, non-exclusive license:
+
+        (a) under intellectual property rights (other than patent or trademark)
+            Licensable by Initial Developer, to use, reproduce, modify, display,
+            perform, sublicense and distribute the Original Software (or
+            portions thereof), with or without Modifications, and/or as part of
+            a Larger Work; and
+
+        (b) under Patent Claims infringed by the making, using or selling of
+            Original Software, to make, have made, use, practice, sell, and
+            offer for sale, and/or otherwise dispose of the Original Software
+            (or portions thereof).
+
+        (c) The licenses granted in Sections 2.1(a) and (b) are effective on the
+            date Initial Developer first distributes or otherwise makes the
+            Original Software available to a third party under the terms of this
+            License.
+
+        (d) Notwithstanding Section 2.1(b) above, no patent license is granted:
+            (1) for code that You delete from the Original Software, or (2) for
+            infringements caused by: (i) the modification of the Original
+            Software, or (ii) the combination of the Original Software with
+            other software or devices.
+
+    2.2. Contributor Grant.
+
+    Conditioned upon Your compliance with Section 3.1 below and subject to third
+    party intellectual property claims, each Contributor hereby grants You a
+    world-wide, royalty-free, non-exclusive license:
+
+        (a) under intellectual property rights (other than patent or trademark)
+            Licensable by Contributor to use, reproduce, modify, display,
+            perform, sublicense and distribute the Modifications created by such
+            Contributor (or portions thereof), either on an unmodified basis,
+            with other Modifications, as Covered Software and/or as part of a
+            Larger Work; and
+
+        (b) under Patent Claims infringed by the making, using, or selling of
+            Modifications made by that Contributor either alone and/or in
+            combination with its Contributor Version (or portions of such
+            combination), to make, use, sell, offer for sale, have made, and/or
+            otherwise dispose of: (1) Modifications made by that Contributor (or
+            portions thereof); and (2) the combination of Modifications made by
+            that Contributor with its Contributor Version (or portions of such
+            combination).
+
+        (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective on
+            the date Contributor first distributes or otherwise makes the
+            Modifications available to a third party.
+
+        (d) Notwithstanding Section 2.2(b) above, no patent license is granted:
+            (1) for any code that Contributor has deleted from the Contributor
+            Version; (2) for infringements caused by: (i) third party
+            modifications of Contributor Version, or (ii) the combination of
+            Modifications made by that Contributor with other software (except
+            as part of the Contributor Version) or other devices; or (3) under
+            Patent Claims infringed by Covered Software in the absence of
+            Modifications made by that Contributor.
+
+3. Distribution Obligations.
+
+      3.1. Availability of Source Code.
+      Any Covered Software that You distribute or otherwise make available in
+      Executable form must also be made available in Source Code form and that
+      Source Code form must be distributed only under the terms of this License.
+      You must include a copy of this License with every copy of the Source Code
+      form of the Covered Software You distribute or otherwise make available.
+      You must inform recipients of any such Covered Software in Executable form
+      as to how they can obtain such Covered Software in Source Code form in a
+      reasonable manner on or through a medium customarily used for software
+      exchange.
+
+      3.2. Modifications.
+      The Modifications that You create or to which You contribute are governed
+      by the terms of this License. You represent that You believe Your
+      Modifications are Your original creation(s) and/or You have sufficient
+      rights to grant the rights conveyed by this License.
+
+      3.3. Required Notices.
+      You must include a notice in each of Your Modifications that identifies
+      You as the Contributor of the Modification. You may not remove or alter
+      any copyright, patent or trademark notices contained within the Covered
+      Software, or any notices of licensing or any descriptive text giving
+      attribution to any Contributor or the Initial Developer.
+
+      3.4. Application of Additional Terms.
+      You may not offer or impose any terms on any Covered Software in Source
+      Code form that alters or restricts the applicable version of this License
+      or the recipients. rights hereunder. You may choose to offer, and to
+      charge a fee for, warranty, support, indemnity or liability obligations to
+      one or more recipients of Covered Software. However, you may do so only on
+      Your own behalf, and not on behalf of the Initial Developer or any
+      Contributor. You must make it absolutely clear that any such warranty,
+      support, indemnity or liability obligation is offered by You alone, and
+      You hereby agree to indemnify the Initial Developer and every Contributor
+      for any liability incurred by the Initial Developer or such Contributor as
+      a result of warranty, support, indemnity or liability terms You offer.
+
+      3.5. Distribution of Executable Versions.
+      You may distribute the Executable form of the Covered Software under the
+      terms of this License or under the terms of a license of Your choice,
+      which may contain terms different from this License, provided that You are
+      in compliance with the terms of this License and that the license for the
+      Executable form does not attempt to limit or alter the recipient.s rights
+      in the Source Code form from the rights set forth in this License. If You
+      distribute the Covered Software in Executable form under a different
+      license, You must make it absolutely clear that any terms which differ
+      from this License are offered by You alone, not by the Initial Developer
+      or Contributor. You hereby agree to indemnify the Initial Developer and
+      every Contributor for any liability incurred by the Initial Developer or
+      such Contributor as a result of any such terms You offer.
+
+      3.6. Larger Works.
+      You may create a Larger Work by combining Covered Software with other code
+      not governed by the terms of this License and distribute the Larger Work
+      as a single product. In such a case, You must make sure the requirements
+      of this License are fulfilled for the Covered Software.
+
+4. Versions of the License.
+
+      4.1. New Versions.
+      Sun Microsystems, Inc. is the initial license steward and may publish
+      revised and/or new versions of this License from time to time. Each
+      version will be given a distinguishing version number. Except as provided
+      in Section 4.3, no one other than the license steward has the right to
+      modify this License.
+
+      4.2. Effect of New Versions.
+      You may always continue to use, distribute or otherwise make the Covered
+      Software available under the terms of the version of the License under
+      which You originally received the Covered Software. If the Initial
+      Developer includes a notice in the Original Software prohibiting it from
+      being distributed or otherwise made available under any subsequent version
+      of the License, You must distribute and make the Covered Software
+      available under the terms of the version of the License under which You
+      originally received the Covered Software. Otherwise, You may also choose
+      to use, distribute or otherwise make the Covered Software available under
+      the terms of any subsequent version of the License published by the
+      license steward.
+
+      4.3. Modified Versions.
+      When You are an Initial Developer and You want to create a new license for
+      Your Original Software, You may create and use a modified version of this
+      License if You: (a) rename the license and remove any references to the
+      name of the license steward (except to note that the license differs from
+      this License); and (b) otherwise make it clear that the license contains
+      terms which differ from this License.
+
+5. DISCLAIMER OF WARRANTY.
+
+   COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN .AS IS. BASIS, WITHOUT
+   WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT
+   LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF DEFECTS,
+   MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK
+   AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD
+   ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL
+   DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY
+   SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN
+   ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS AUTHORIZED
+   HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+6. TERMINATION.
+
+      6.1. This License and the rights granted hereunder will terminate
+           automatically if You fail to comply with terms herein and fail to
+           cure such breach within 30 days of becoming aware of the breach.
+           Provisions which, by their nature, must remain in effect beyond the
+           termination of this License shall survive.
+
+      6.2. If You assert a patent infringement claim (excluding declaratory
+           judgment actions) against Initial Developer or a Contributor (the
+           Initial Developer or Contributor against whom You assert such claim
+           is referred to as .Participant.) alleging that the Participant
+           Software (meaning the Contributor Version where the Participant is a
+           Contributor or the Original Software where the Participant is the
+           Initial Developer) directly or indirectly infringes any patent, then
+           any and all rights granted directly or indirectly to You by such
+           Participant, the Initial Developer (if the Initial Developer is not
+           the Participant) and all Contributors under Sections 2.1 and/or 2.2
+           of this License shall, upon 60 days notice from Participant terminate
+           prospectively and automatically at the expiration of such 60 day
+           notice period, unless if within such 60 day period You withdraw Your
+           claim with respect to the Participant Software against such
+           Participant either unilaterally or pursuant to a written agreement
+           with Participant.
+
+      6.3. In the event of termination under Sections 6.1 or 6.2 above, all end
+           user licenses that have been validly granted by You or any
+           distributor hereunder prior to termination (excluding licenses
+           granted to You by any distributor) shall survive termination.
+
+7. LIMITATION OF LIABILITY.
+
+   UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING
+   NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY
+   OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF
+   ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL,
+   INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT
+   LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK STOPPAGE,
+   COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR
+   LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF
+   SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR
+   DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY.S NEGLIGENCE TO THE EXTENT
+   APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
+   EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS
+   EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+8. U.S. GOVERNMENT END USERS.
+
+   The Covered Software is a .commercial item,. as that term is defined in 48
+   C.F.R. 2.101 (Oct. 1995), consisting of .commercial computer software. (as
+   that term is defined at 48 C.F.R. ? 252.227-7014(a)(1)) and commercial
+   computer software documentation. as such terms are used in 48 C.F.R. 12.212
+   (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1
+   through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered
+   Software with only those rights set forth herein. This U.S. Government Rights
+   clause is in lieu of, and supersedes, any other FAR, DFAR, or other clause or
+   provision that addresses Government rights in computer software under this
+   License.
+
+9. MISCELLANEOUS.
+
+   This License represents the complete agreement concerning subject matter
+   hereof. If any provision of this License is held to be unenforceable, such
+   provision shall be reformed only to the extent necessary to make it
+   enforceable. This License shall be governed by the law of the jurisdiction
+   specified in a notice contained within the Original Software (except to the
+   extent applicable law, if any, provides otherwise), excluding such
+   jurisdiction's conflict-of-law provisions. Any litigation relating to this
+   License shall be subject to the jurisdiction of the courts located in the
+   jurisdiction and venue specified in a notice contained within the Original
+   Software, with the losing party responsible for costs, including, without
+   limitation, court costs and reasonable attorneys. fees and expenses. The
+   application of the United Nations Convention on Contracts for the
+   International Sale of Goods is expressly excluded. Any law or regulation
+   which provides that the language of a contract shall be construed against
+   the drafter shall not apply to this License. You agree that You alone are
+   responsible for compliance with the United States export administration
+   regulations (and the export control laws and regulation of any other
+   countries) when You use, distribute or otherwise make available any Covered
+   Software.
+
+10. RESPONSIBILITY FOR CLAIMS.
+
+   As between Initial Developer and the Contributors, each party is responsible
+   for claims and damages arising, directly or indirectly, out of its
+   utilization of rights under this License and You agree to work with Initial
+   Developer and Contributors to distribute such responsibility on an equitable
+   basis. Nothing herein is intended or shall be deemed to constitute any
+   admission of liability.
+
+   NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION
+   LICENSE (CDDL)
+
+   The code released under the CDDL shall be governed by the laws of the State
+   of California (excluding conflict-of-law provisions). Any litigation relating
+   to this License shall be subject to the jurisdiction of the Federal Courts of
+   the Northern District of California and the state courts of the State of
+   California, with venue lying in Santa Clara County, California.
+
+
+------------------------------------------------------------------------------
+ANTLR 2 License (from ApacheDS, Groovy)
+------------------------------------------------------------------------------
+We reserve no legal rights to the ANTLR--it is fully in the public domain.
+An individual or company may do whatever they wish with source code
+distributed with ANTLR or the code generated by ANTLR, including the
+incorporation of ANTLR, or its output, into commerical software.
+We encourage users to develop software with ANTLR. However, we do ask that
+credit is given to us for developing ANTLR. By "credit", we mean that if you
+use ANTLR or incorporate any source code into one of your programs
+(commercial product, research project, or otherwise) that you acknowledge
+this fact somewhere in the documentation, research report, etc... If you like
+ANTLR and have developed a nice tool with the output, please mention that you
+developed it using ANTLR. In addition, we ask that the headers remain intact
+in our source code. As long as these guidelines are kept, we expect to
+continue enhancing this system and expect to make other tools available as
+they are completed.
+
+------------------------------------------------------------------------------
+ASM Project License (from CGLib, Groovy)
+------------------------------------------------------------------------------
+Copyright (c) 2000-2011 INRIA, France Telecom
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holders nor the names of its
+   contributors may be used to endorse or promote products derived from
+   this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.
+
+
+------------------------------------------------------------------------------
+Bouncy Castle License (from ApacheDS)
+------------------------------------------------------------------------------
+Copyright (c) 2000 - 2012 The Legion Of The Bouncy Castle
+(http://www.bouncycastle.org)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+
+------------------------------------------------------------------------------
+Eclipse Public License - v1.0 (from Jetty/Jerico)
+------------------------------------------------------------------------------
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM
+CONSTITUTES RECIPIENT’S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+a) in the case of the initial Contributor, the initial code and documentation
+   distributed under this Agreement, and
+b) in the case of each subsequent Contributor:
+
+i)changes to the Program, and
+
+ii)additions to the Program;
+
+where such changes and/or additions to the Program originate from and are
+distributed by that particular Contributor. A Contribution 'originates' from
+a Contributor if it was added to the Program by such Contributor itself or
+anyone acting on such Contributor’s behalf. Contributions do not include
+additions to the Program which: (i) are separate modules of software
+distributed in conjunction with the Program under their own license agreement,
+and (ii) are not derivative works of the Program.
+
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents " mean patent claims licensable by a Contributor which are
+necessarily infringed by the use or sale of its Contribution alone or when
+combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this
+Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement,
+including all Contributors.
+
+2. GRANT OF RIGHTS
+
+a) Subject to the terms of this Agreement, each Contributor hereby grants
+   Recipient a non-exclusive, worldwide, royalty-free copyright license to
+   reproduce, prepare derivative works of, publicly display, publicly perform,
+   distribute and sublicense the Contribution of such Contributor, if any,
+   and such derivative works, in source code and object code form.
+
+b) Subject to the terms of this Agreement, each Contributor hereby grants
+   Recipient a non-exclusive, worldwide, royalty-free patent license under
+   Licensed Patents to make, use, sell, offer to sell, import and otherwise
+   transfer the Contribution of such Contributor, if any, in source code and
+   object code form. This patent license shall apply to the combination of the
+   Contribution and the Program if, at the time the Contribution is added by
+   the Contributor, such addition of the Contribution causes such combination
+   to be covered by the Licensed Patents. The patent license shall not apply
+   to any other combinations which include the Contribution. No hardware per
+   se is licensed hereunder.
+
+c) Recipient understands that although each Contributor grants the licenses
+   to its Contributions set forth herein, no assurances are provided by any
+   Contributor that the Program does not infringe the patent or other
+   intellectual property rights of any other entity. Each Contributor
+   disclaims any liability to Recipient for claims brought by any other
+   entity based on infringement of intellectual property rights or otherwise.
+   As a condition to exercising the rights and licenses granted hereunder,
+   each Recipient hereby assumes sole responsibility to secure any other
+   intellectual property rights needed, if any. For example, if a third
+   party patent license is required to allow Recipient to distribute the
+   Program, it is Recipient’s responsibility to acquire that license before
+   distributing the Program.
+
+d) Each Contributor represents that to its knowledge it has sufficient
+   copyright rights in its Contribution, if any, to grant the copyright
+   license set forth in this Agreement.
+
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form under
+its own license agreement, provided that:
+
+a) it complies with the terms and conditions of this Agreement; and
+
+b) its license agreement:
+
+i) effectively disclaims on behalf of all Contributors all warranties and
+   conditions, express and implied, including warranties or conditions of
+   title and non-infringement, and implied warranties or conditions of
+   merchantability and fitness for a particular purpose;
+
+ii) effectively excludes on behalf of all Contributors all liability for
+    damages, including direct, indirect, special, incidental and consequential
+    damages, such as lost profits;
+
+iii) states that any provisions which differ from this Agreement are offered by
+     that Contributor alone and not by any other party; and
+
+iv) states that source code for the Program is available from such
+    Contributor, and informs licensees how to obtain it in a reasonable manner
+    on or through a medium customarily used for software exchange.
+
+When the Program is made available in source code form:
+
+a) it must be made available under this Agreement; and
+
+b) a copy of this Agreement must be included with each copy of the Program.
+
+Contributors may not remove or alter any copyright notices contained within
+the Program.
+
+Each Contributor must identify itself as the originator of its Contribution,
+if any, in a manner that reasonably allows subsequent Recipients to identify
+the originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with
+respect to end users, business partners and the like. While this license is
+intended to facilitate the commercial use of the Program, the Contributor who
+includes the Program in a commercial product offering should do so in a manner
+which does not create potential liability for other Contributors. Therefore,
+if a Contributor includes the Program in a commercial product offering, such
+Contributor ("Commercial Contributor") hereby agrees to defend and indemnify
+every other Contributor ("Indemnified Contributor") against any losses,
+damages and costs (collectively "Losses") arising from claims, lawsuits and
+other legal actions brought by a third party against the Indemnified
+Contributor to the extent caused by the acts or omissions of such Commercial
+Contributor in connection with its distribution of the Program in a commercial
+product offering. The obligations in this section do not apply to any claims
+or Losses relating to any actual or alleged intellectual property infringement.
+In order to qualify, an Indemnified Contributor must: a) promptly notify the
+Commercial Contributor in writing of such claim, and b) allow the Commercial
+Contributor to control, and cooperate with the Commercial Contributor in, the
+defense and any related settlement negotiations. The Indemnified Contributor
+may participate in any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial product
+offering, Product X. That Contributor is then a Commercial Contributor. If
+that Commercial Contributor then makes performance claims, or offers
+warranties related to Product X, those performance claims and warranties are
+such Commercial Contributor’s responsibility alone. Under this section, the
+Commercial Contributor would have to defend claims against the other
+Contributors related to those performance claims and warranties, and if a
+court requires any other Contributor to pay any damages as a result, the
+Commercial Contributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON
+AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS
+OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF
+TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+Each Recipient is solely responsible for determining the appropriateness of
+using and distributing the Program and assumes all risks associated with its
+exercise of rights under this Agreement , including but not limited to the
+risks and costs of program errors, compliance with applicable laws, damage to
+or loss of data, programs or equipment, and unavailability or interruption of
+operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY
+CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION
+LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE
+EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY
+OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under
+applicable law, it shall not affect the validity or enforceability of the
+remainder of the terms of this Agreement, and without further action by the
+parties hereto, such provision shall be reformed to the minimum extent
+necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against any entity (including a
+cross-claim or counterclaim in a lawsuit) alleging that the Program itself
+(excluding combinations of the Program with other software or hardware)
+infringes such Recipient’s patent(s), then such Recipient’s rights granted
+under Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient’s rights under this Agreement shall terminate if it fails to
+comply with any of the material terms or conditions of this Agreement and
+does not cure such failure in a reasonable period of time after becoming
+aware of such noncompliance. If all Recipient’s rights under this Agreement
+terminate, Recipient agrees to cease use and distribution of the Program as
+soon as reasonably practicable. However, Recipient’s obligations under this
+Agreement and any licenses granted by Recipient relating to the Program shall
+continue and survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement, but in
+order to avoid inconsistency the Agreement is copyrighted and may only be
+modified in the following manner. The Agreement Steward reserves the right to
+publish new versions (including revisions) of this Agreement from time to
+time. No one other than the Agreement Steward has the right to modify this
+Agreement. The Eclipse Foundation is the initial Agreement Steward. The
+Eclipse Foundation may assign the responsibility to serve as the Agreement
+Steward to a suitable separate entity. Each new version of the Agreement
+will be given a distinguishing version number. The Program (including
+Contributions) may always be distributed subject to the version of the
+Agreement under which it was received. In addition, after a new version of
+the Agreement is published, Contributor may elect to distribute the Program
+(including its Contributions) under the new version. Except as expressly
+stated in Sections 2(a) and 2(b) above, Recipient receives no rights or
+licenses to the intellectual property of any Contributor under this Agreement,
+whether expressly, by implication, estoppel or otherwise. All rights in the
+Program not expressly granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the
+intellectual property laws of the United States of America. No party to this
+Agreement will bring a legal action under this Agreement more than one year
+after the cause of action arose. Each party waives its rights to a jury trial
+in any resulting litigation.
+
+
+--------------------------------------------------------------------------------------------------
+JDBM LICENSE v1.00 (from ApacheDS)
+--------------------------------------------------------------------------------------------------
+/**
+ * JDBM LICENSE v1.00
+ *
+ * Redistribution and use of this software and associated documentation
+ * ("Software"), with or without modification, are permitted provided
+ * that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain copyright
+ *    statements and notices.  Redistributions must also contain a
+ *    copy of this document.
+ *
+ * 2. Redistributions in binary form must reproduce the
+ *    above copyright notice, this list of conditions and the
+ *    following disclaimer in the documentation and/or other
+ *    materials provided with the distribution.
+ *
+ * 3. The name "JDBM" must not be used to endorse or promote
+ *    products derived from this Software without prior written
+ *    permission of Cees de Groot.  For written permission,
+ *    please contact cg@cdegroot.com.
+ *
+ * 4. Products derived from this Software may not be called "JDBM"
+ *    nor may "JDBM" appear in their names without prior written
+ *    permission of Cees de Groot.
+ *
+ * 5. Due credit should be given to the JDBM Project
+ *    (http://jdbm.sourceforge.net/).
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE JDBM PROJECT AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
+ * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
+ * CEES DE GROOT OR ANY CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Copyright 2000 (C) Cees de Groot. All Rights Reserved.
+ * Contributions are Copyright (C) 2000 by their associated contributors.
+ *
+ * $Id: LICENSE.txt,v 1.1 2000/05/05 23:59:52 boisvert Exp $
+ */
+
+------------------------------------------------------------------------------
+JLine License - BSD (from Groovy)
+------------------------------------------------------------------------------
+Copyright (c) 2002-2006, Marc Prud'hommeaux <mw...@cornell.edu>
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or
+without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+
+Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with
+the distribution.
+
+Neither the name of JLine nor the names of its contributors
+may be used to endorse or promote products derived from this
+software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+------------------------------------------------------------------------------
+SL4J License - MIT
+------------------------------------------------------------------------------
+Copyright (c) 2004-2013 QOS.ch
+All rights reserved.
+
+Permission is hereby granted, free  of charge, to any person obtaining
+a  copy  of this  software  and  associated  documentation files  (the
+"Software"), to  deal in  the Software without  restriction, including
+without limitation  the rights to  use, copy, modify,  merge, publish,
+distribute,  sublicense, and/or sell  copies of  the Software,  and to
+permit persons to whom the Software  is furnished to do so, subject to
+the following conditions:
+
+The  above  copyright  notice  and  this permission  notice  shall  be
+included in all copies or substantial portions of the Software.
+
+THE  SOFTWARE IS  PROVIDED  "AS  IS", WITHOUT  WARRANTY  OF ANY  KIND,
+EXPRESS OR  IMPLIED, INCLUDING  BUT NOT LIMITED  TO THE  WARRANTIES OF
+MERCHANTABILITY,    FITNESS    FOR    A   PARTICULAR    PURPOSE    AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE,  ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+------------------------------------------------------------------------------
+Tanuki Software License (from ApacheDS)
+------------------------------------------------------------------------------
+Copyright (c) 1999, 2004 Tanuki Software
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of the Java Service Wrapper and associated
+documentation files (the "Software"), to deal in the Software
+without  restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sub-license,
+and/or sell copies of the Software, and to permit persons to
+whom the Software is furnished to do so, subject to the
+following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+
+------------------------------------------------------------------------------
+Silver Egg Technology License (from ApacheDS)
+------------------------------------------------------------------------------
+Portions of the Software have been derived from source code
+developed by Silver Egg Technology under the following license:
+
+Copyright (c) 2001 Silver Egg Technology
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sub-license, and/or
+sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+
+------------------------------------------------------------------------------
+Sun Microsystems, Inc. License (from Groovy)
+------------------------------------------------------------------------------
+The following notice applies to the files:
+
+src/main/org/codehaus/groovy/jsr223/GroovyCompiledScript.java
+src/main/org/codehaus/groovy/jsr223/GroovyScriptEngineFactory.java
+src/main/org/codehaus/groovy/jsr223/GroovyScriptEngineImpl.java
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met: Redistributions of source code
+ * must retain the above copyright notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list of
+ * conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution. Neither the name of the Sun Microsystems nor the names of
+ * is contributors may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+------------------------------------------------------------------------------
+European Commission License (from Hadoop)
+------------------------------------------------------------------------------
+For the org.apache.hadoop.util.bloom.* classes:
+
+/**
+ *
+ * Copyright (c) 2005, European Commission project OneLab under contract
+ * 034819 (http://www.one-lab.org)
+ * All rights reserved.
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the distribution.
+ *  - Neither the name of the University Catholique de Louvain - UCL
+ *    nor the names of its contributors may be used to endorse or
+ *    promote products derived from this software without specific prior
+ *    written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+------------------------------------------------------------------------------
+zlib/libpng License
+------------------------------------------------------------------------------
+This software is provided 'as-is', without any express or implied warranty. In
+no event will the authors be held liable for any damages arising from the use of
+this software.
+
+Permission is granted to anyone to use this software for any purpose, including
+commercial applications, and to alter it and redistribute it freely, subject to
+the following restrictions:
+
+   1. The origin of this software must not be misrepresented; you must not claim
+       that you wrote the original software. If you use this software in a
+       product, an acknowledgment in the product documentation would be
+       appreciated but is not required.
+   2. Altered source versions must be plainly marked as such, and must not be
+       misrepresented as being the original software.
+   3. This notice may not be removed or altered from any source distribution.
+
+
+------------------------------------------------------------------------------
+bzip2 License
+------------------------------------------------------------------------------
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+   1. Redistributions of source code must retain the above copyright notice,
+       this list of conditions and the following disclaimer.
+   2. The origin of this software must not be misrepresented; you must not claim
+       that you wrote the original software. If you use this software in a
+       product, an acknowledgment in the product documentation would be
+       appreciated but is not required.
+   3. Altered source versions must be plainly marked as such, and must not be
+       misrepresented as being the original software.
+   4. The name of the author may not be used to endorse or promote products
+       derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
+SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+OF SUCH DAMAGE.
+
+Julian Seward, Cambridge, UK.
+jseward@acm.org
diff --git a/examples/quickstart/tutorial/hadoop/docker/bootstrap.sh b/examples/quickstart/tutorial/hadoop/docker/bootstrap.sh
new file mode 100755
index 00000000000..4cf0e55b135
--- /dev/null
+++ b/examples/quickstart/tutorial/hadoop/docker/bootstrap.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+: ${HADOOP_PREFIX:=/usr/local/hadoop}
+
+$HADOOP_PREFIX/etc/hadoop/hadoop-env.sh
+
+rm /tmp/*.pid
+
+# installing libraries if any - (resource urls added comma separated to the ACP system variable)
+cd $HADOOP_PREFIX/share/hadoop/common ; for cp in ${ACP//,/ }; do  echo == $cp; curl -LO $cp ; done; cd -
+
+# altering the core-site configuration
+sed s/HOSTNAME/$HOSTNAME/ /usr/local/hadoop/etc/hadoop/core-site.xml.template > /usr/local/hadoop/etc/hadoop/core-site.xml
+
+
+service sshd start
+$HADOOP_PREFIX/sbin/start-dfs.sh
+$HADOOP_PREFIX/sbin/start-yarn.sh
+$HADOOP_PREFIX/sbin/mr-jobhistory-daemon.sh start historyserver
+
+if [[ $1 == "-d" ]]; then
+  while true; do sleep 1000; done
+fi
+
+if [[ $1 == "-bash" ]]; then
+  /bin/bash
+fi
diff --git a/examples/quickstart/tutorial/hadoop/docker/core-site.xml.template b/examples/quickstart/tutorial/hadoop/docker/core-site.xml.template
new file mode 100644
index 00000000000..00ab59528b8
--- /dev/null
+++ b/examples/quickstart/tutorial/hadoop/docker/core-site.xml.template
@@ -0,0 +1,6 @@
+  <configuration>
+      <property>
+          <name>fs.defaultFS</name>
+          <value>hdfs://HOSTNAME:9000</value>
+      </property>
+  </configuration>
diff --git a/examples/quickstart/tutorial/hadoop/docker/hdfs-site.xml b/examples/quickstart/tutorial/hadoop/docker/hdfs-site.xml
new file mode 100644
index 00000000000..d29556190ad
--- /dev/null
+++ b/examples/quickstart/tutorial/hadoop/docker/hdfs-site.xml
@@ -0,0 +1,14 @@
+<configuration>
+    <property>
+        <name>dfs.replication</name>
+        <value>1</value>
+    </property>
+    <property>
+        <name>dfs.client.use.datanode.hostname</name>
+        <value>true</value>
+    </property>
+    <property>
+        <name>dfs.datanode.use.datanode.hostname</name>
+        <value>true</value>
+    </property>
+</configuration>
diff --git a/examples/quickstart/tutorial/hadoop/docker/mapred-site.xml b/examples/quickstart/tutorial/hadoop/docker/mapred-site.xml
new file mode 100644
index 00000000000..dba582f1c31
--- /dev/null
+++ b/examples/quickstart/tutorial/hadoop/docker/mapred-site.xml
@@ -0,0 +1,6 @@
+<configuration>
+    <property>
+        <name>mapreduce.framework.name</name>
+        <value>yarn</value>
+    </property>
+</configuration>
diff --git a/examples/quickstart/tutorial/hadoop/docker/ssh_config b/examples/quickstart/tutorial/hadoop/docker/ssh_config
new file mode 100644
index 00000000000..535f9d32bd4
--- /dev/null
+++ b/examples/quickstart/tutorial/hadoop/docker/ssh_config
@@ -0,0 +1,5 @@
+Host *
+  UserKnownHostsFile /dev/null
+  StrictHostKeyChecking no
+  LogLevel quiet
+  Port 2122
diff --git a/examples/quickstart/tutorial/hadoop/docker/yarn-site.xml b/examples/quickstart/tutorial/hadoop/docker/yarn-site.xml
new file mode 100644
index 00000000000..becf69465f1
--- /dev/null
+++ b/examples/quickstart/tutorial/hadoop/docker/yarn-site.xml
@@ -0,0 +1,47 @@
+<configuration>
+    <property>
+        <name>yarn.nodemanager.aux-services</name>
+        <value>mapreduce_shuffle</value>
+    </property>
+
+    <property>
+      <name>yarn.application.classpath</name>
+      <value>/usr/local/hadoop/etc/hadoop, /usr/local/hadoop/share/hadoop/common/*, /usr/local/hadoop/share/hadoop/common/lib/*, /usr/local/hadoop/share/hadoop/hdfs/*, /usr/local/hadoop/share/hadoop/hdfs/lib/*, /usr/local/hadoop/share/hadoop/mapreduce/*, /usr/local/hadoop/share/hadoop/mapreduce/lib/*, /usr/local/hadoop/share/hadoop/yarn/*, /usr/local/hadoop/share/hadoop/yarn/lib/*</value>
+    </property>
+
+    <property>
+    <description>
+      Number of seconds after an application finishes before the nodemanager's
+      DeletionService will delete the application's localized file directory
+      and log directory.
+
+      To diagnose Yarn application problems, set this property's value large
+      enough (for example, to 600 = 10 minutes) to permit examination of these
+      directories. After changing the property's value, you must restart the
+      nodemanager in order for it to have an effect.
+
+      The roots of Yarn applications' work directories is configurable with
+      the yarn.nodemanager.local-dirs property (see below), and the roots
+      of the Yarn applications' log directories is configurable with the
+      yarn.nodemanager.log-dirs property (see also below).
+    </description>
+    <name>yarn.nodemanager.delete.debug-delay-sec</name>
+    <value>600</value>
+  </property>
+
+    <property>
+      <name>yarn.log-aggregation-enable</name>
+      <value>true</value> 
+    </property>
+
+    <property>
+      <name>yarn.log-aggregation.retain-seconds</name>
+      <value>900000</value> 
+    </property> 
+
+    <property>
+      <name>yarn.nodemanager.vmem-check-enabled</name>
+      <value>false</value>
+    </property>
+
+</configuration>
diff --git a/examples/quickstart/tutorial/retention-index.json b/examples/quickstart/tutorial/retention-index.json
new file mode 100644
index 00000000000..5ae9d327661
--- /dev/null
+++ b/examples/quickstart/tutorial/retention-index.json
@@ -0,0 +1,64 @@
+{
+  "type" : "index",
+  "spec" : {
+    "dataSchema" : {
+      "dataSource" : "retention-tutorial",
+      "parser" : {
+        "type" : "string",
+        "parseSpec" : {
+          "format" : "json",
+          "dimensionsSpec" : {
+            "dimensions" : [
+              "channel",
+              "cityName",
+              "comment",
+              "countryIsoCode",
+              "countryName",
+              "isAnonymous",
+              "isMinor",
+              "isNew",
+              "isRobot",
+              "isUnpatrolled",
+              "metroCode",
+              "namespace",
+              "page",
+              "regionIsoCode",
+              "regionName",
+              "user",
+              { "name": "added", "type": "long" },
+              { "name": "deleted", "type": "long" },
+              { "name": "delta", "type": "long" }
+            ]
+          },
+          "timestampSpec": {
+            "column": "time",
+            "format": "iso"
+          }
+        }
+      },
+      "metricsSpec" : [],
+      "granularitySpec" : {
+        "type" : "uniform",
+        "segmentGranularity" : "hour",
+        "queryGranularity" : "none",
+        "intervals" : ["2015-09-12/2015-09-13"],
+        "rollup" : false
+      }
+    },
+    "ioConfig" : {
+      "type" : "index",
+      "firehose" : {
+        "type" : "local",
+        "baseDir" : "quickstart/",
+        "filter" : "wikiticker-2015-09-12-sampled.json.gz"
+      },
+      "appendToExisting" : false
+    },
+    "tuningConfig" : {
+      "type" : "index",
+      "targetPartitionSize" : 5000000,
+      "maxRowsInMemory" : 25000,
+      "forceExtendableShardSpecs" : true
+    }
+  }
+}
diff --git a/examples/quickstart/tutorial/rollup-data.json b/examples/quickstart/tutorial/rollup-data.json
new file mode 100644
index 00000000000..63c8dd7b659
--- /dev/null
+++ b/examples/quickstart/tutorial/rollup-data.json
@@ -0,0 +1,9 @@
+{"timestamp":"2018-01-01T01:01:35Z","srcIP":"1.1.1.1", "dstIP":"2.2.2.2","packets":20,"bytes":9024}
+{"timestamp":"2018-01-01T01:01:51Z","srcIP":"1.1.1.1", "dstIP":"2.2.2.2","packets":255,"bytes":21133}
+{"timestamp":"2018-01-01T01:01:59Z","srcIP":"1.1.1.1", "dstIP":"2.2.2.2","packets":11,"bytes":5780}
+{"timestamp":"2018-01-01T01:02:14Z","srcIP":"1.1.1.1", "dstIP":"2.2.2.2","packets":38,"bytes":6289}
+{"timestamp":"2018-01-01T01:02:29Z","srcIP":"1.1.1.1", "dstIP":"2.2.2.2","packets":377,"bytes":359971}
+{"timestamp":"2018-01-01T01:03:29Z","srcIP":"1.1.1.1", "dstIP":"2.2.2.2","packets":49,"bytes":10204}
+{"timestamp":"2018-01-02T21:33:14Z","srcIP":"7.7.7.7", "dstIP":"8.8.8.8","packets":38,"bytes":6289}
+{"timestamp":"2018-01-02T21:33:45Z","srcIP":"7.7.7.7", "dstIP":"8.8.8.8","packets":123,"bytes":93999}
+{"timestamp":"2018-01-02T21:35:45Z","srcIP":"7.7.7.7", "dstIP":"8.8.8.8","packets":12,"bytes":2818}
diff --git a/examples/quickstart/tutorial/rollup-index.json b/examples/quickstart/tutorial/rollup-index.json
new file mode 100644
index 00000000000..482c75104ac
--- /dev/null
+++ b/examples/quickstart/tutorial/rollup-index.json
@@ -0,0 +1,51 @@
+{
+  "type" : "index",
+  "spec" : {
+    "dataSchema" : {
+      "dataSource" : "rollup-tutorial",
+      "parser" : {
+        "type" : "string",
+        "parseSpec" : {
+          "format" : "json",
+          "dimensionsSpec" : {
+            "dimensions" : [
+              "srcIP",
+              "dstIP"
+            ]
+          },
+          "timestampSpec": {
+            "column": "timestamp",
+            "format": "iso"
+          }
+        }
+      },
+      "metricsSpec" : [
+        { "type" : "count", "name" : "count" },
+        { "type" : "longSum", "name" : "packets", "fieldName" : "packets" },
+        { "type" : "longSum", "name" : "bytes", "fieldName" : "bytes" }
+      ],
+      "granularitySpec" : {
+        "type" : "uniform",
+        "segmentGranularity" : "week",
+        "queryGranularity" : "minute",
+        "intervals" : ["2018-01-01/2018-01-03"],
+        "rollup" : true
+      }
+    },
+    "ioConfig" : {
+      "type" : "index",
+      "firehose" : {
+        "type" : "local",
+        "baseDir" : "quickstart/tutorial",
+        "filter" : "rollup-data.json"
+      },
+      "appendToExisting" : false
+    },
+    "tuningConfig" : {
+      "type" : "index",
+      "targetPartitionSize" : 5000000,
+      "maxRowsInMemory" : 25000,
+      "forceExtendableShardSpecs" : true
+    }
+  }
+}
diff --git a/examples/quickstart/tutorial/transform-data.json b/examples/quickstart/tutorial/transform-data.json
new file mode 100644
index 00000000000..562c6f4d519
--- /dev/null
+++ b/examples/quickstart/tutorial/transform-data.json
@@ -0,0 +1,4 @@
+{"timestamp":"2018-01-01T07:01:35Z","animal":"octopus",  "location":1, "number":100}
+{"timestamp":"2018-01-01T05:01:35Z","animal":"mongoose", "location":2,"number":200}
+{"timestamp":"2018-01-01T06:01:35Z","animal":"snake", "location":3, "number":300}
+{"timestamp":"2018-01-01T01:01:35Z","animal":"lion", "location":4, "number":300}
diff --git a/examples/quickstart/tutorial/transform-index.json b/examples/quickstart/tutorial/transform-index.json
new file mode 100644
index 00000000000..0dfcef3e860
--- /dev/null
+++ b/examples/quickstart/tutorial/transform-index.json
@@ -0,0 +1,73 @@
+{
+  "type" : "index",
+  "spec" : {
+    "dataSchema" : {
+      "dataSource" : "transform-tutorial",
+      "parser" : {
+        "type" : "string",
+        "parseSpec" : {
+          "format" : "json",
+          "dimensionsSpec" : {
+            "dimensions" : [
+              "animal",
+              { "name": "location", "type": "long" }
+            ]
+          },
+          "timestampSpec": {
+            "column": "timestamp",
+            "format": "iso"
+          }
+        }
+      },
+      "metricsSpec" : [
+        { "type" : "count", "name" : "count" },
+        { "type" : "longSum", "name" : "number", "fieldName" : "number" },
+        { "type" : "longSum", "name" : "triple-number", "fieldName" : "triple-number" }
+      ],
+      "granularitySpec" : {
+        "type" : "uniform",
+        "segmentGranularity" : "week",
+        "queryGranularity" : "minute",
+        "intervals" : ["2018-01-01/2018-01-03"],
+        "rollup" : true
+      },
+      "transformSpec": {
+        "transforms": [
+          {
+            "type": "expression",
+            "name": "animal",
+            "expression": "concat('super-', animal)"
+          },
+          {
+            "type": "expression",
+            "name": "triple-number",
+            "expression": "number * 3"
+          }
+        ],
+        "filter": {
+          "type":"or",
+          "fields": [
+            { "type": "selector", "dimension": "animal", "value": "super-mongoose" },
+            { "type": "selector", "dimension": "triple-number", "value": "300" },
+            { "type": "selector", "dimension": "location", "value": "3" }
+          ]
+        }
+      }
+    },
+    "ioConfig" : {
+      "type" : "index",
+      "firehose" : {
+        "type" : "local",
+        "baseDir" : "quickstart/tutorial",
+        "filter" : "transform-data.json"
+      },
+      "appendToExisting" : false
+    },
+    "tuningConfig" : {
+      "type" : "index",
+      "targetPartitionSize" : 5000000,
+      "maxRowsInMemory" : 25000,
+      "forceExtendableShardSpecs" : true
+    }
+  }
+}
diff --git a/examples/quickstart/tutorial/updates-append-index.json b/examples/quickstart/tutorial/updates-append-index.json
new file mode 100644
index 00000000000..dfa9887d75f
--- /dev/null
+++ b/examples/quickstart/tutorial/updates-append-index.json
@@ -0,0 +1,59 @@
+{
+  "type" : "index",
+  "spec" : {
+    "dataSchema" : {
+      "dataSource" : "updates-tutorial",
+      "parser" : {
+        "type" : "string",
+        "parseSpec" : {
+          "format" : "json",
+          "dimensionsSpec" : {
+            "dimensions" : [
+              "animal"
+            ]
+          },
+          "timestampSpec": {
+            "column": "timestamp",
+            "format": "iso"
+          }
+        }
+      },
+      "metricsSpec" : [
+        { "type" : "count", "name" : "count" },
+        { "type" : "longSum", "name" : "number", "fieldName" : "number" }
+      ],
+      "granularitySpec" : {
+        "type" : "uniform",
+        "segmentGranularity" : "week",
+        "queryGranularity" : "minute",
+        "intervals" : ["2018-01-01/2018-01-03"],
+        "rollup" : true
+      }
+    },
+    "ioConfig" : {
+      "type" : "index",
+      "firehose" : {
+        "type": "combining",
+        "delegates": [
+          {
+            "type"    : "ingestSegment",
+            "dataSource"   : "updates-tutorial",
+            "interval" : "2018-01-01/2018-01-03"
+          },
+          {
+            "type" : "local",
+            "baseDir" : "quickstart/tutorial",
+            "filter" : "updates-data3.json"
+          }
+        ]
+      },
+      "appendToExisting" : false
+    },
+    "tuningConfig" : {
+      "type" : "index",
+      "targetPartitionSize" : 5000000,
+      "maxRowsInMemory" : 25000,
+      "forceExtendableShardSpecs" : true
+    }
+  }
+}
diff --git a/examples/quickstart/tutorial/updates-append-index2.json b/examples/quickstart/tutorial/updates-append-index2.json
new file mode 100644
index 00000000000..0e7404ae955
--- /dev/null
+++ b/examples/quickstart/tutorial/updates-append-index2.json
@@ -0,0 +1,49 @@
+{
+  "type" : "index",
+  "spec" : {
+    "dataSchema" : {
+      "dataSource" : "updates-tutorial",
+      "parser" : {
+        "type" : "string",
+        "parseSpec" : {
+          "format" : "json",
+          "dimensionsSpec" : {
+            "dimensions" : [
+              "animal"
+            ]
+          },
+          "timestampSpec": {
+            "column": "timestamp",
+            "format": "iso"
+          }
+        }
+      },
+      "metricsSpec" : [
+        { "type" : "count", "name" : "count" },
+        { "type" : "longSum", "name" : "number", "fieldName" : "number" }
+      ],
+      "granularitySpec" : {
+        "type" : "uniform",
+        "segmentGranularity" : "week",
+        "queryGranularity" : "minute",
+        "intervals" : ["2018-01-01/2018-01-03"],
+        "rollup" : true
+      }
+    },
+    "ioConfig" : {
+      "type" : "index",
+      "firehose" : {
+        "type" : "local",
+        "baseDir" : "quickstart/tutorial",
+        "filter" : "updates-data4.json"
+      },
+      "appendToExisting" : true
+    },
+    "tuningConfig" : {
+      "type" : "index",
+      "targetPartitionSize" : 5000000,
+      "maxRowsInMemory" : 25000,
+      "forceExtendableShardSpecs" : true
+    }
+  }
+}
diff --git a/examples/quickstart/tutorial/updates-data.json b/examples/quickstart/tutorial/updates-data.json
new file mode 100644
index 00000000000..da59a6b813a
--- /dev/null
+++ b/examples/quickstart/tutorial/updates-data.json
@@ -0,0 +1,3 @@
+{"timestamp":"2018-01-01T01:01:35Z","animal":"tiger", "number":100}
+{"timestamp":"2018-01-01T03:01:35Z","animal":"aardvark", "number":42}
+{"timestamp":"2018-01-01T03:01:35Z","animal":"giraffe", "number":14124}
diff --git a/examples/quickstart/tutorial/updates-data2.json b/examples/quickstart/tutorial/updates-data2.json
new file mode 100644
index 00000000000..640210fc651
--- /dev/null
+++ b/examples/quickstart/tutorial/updates-data2.json
@@ -0,0 +1,3 @@
+{"timestamp":"2018-01-01T01:01:35Z","animal":"lion", "number":100}
+{"timestamp":"2018-01-01T03:01:35Z","animal":"aardvark", "number":9999}
+{"timestamp":"2018-01-01T04:01:35Z","animal":"bear", "number":111}
diff --git a/examples/quickstart/tutorial/updates-data3.json b/examples/quickstart/tutorial/updates-data3.json
new file mode 100644
index 00000000000..00d82b0575e
--- /dev/null
+++ b/examples/quickstart/tutorial/updates-data3.json
@@ -0,0 +1,4 @@
+{"timestamp":"2018-01-01T07:01:35Z","animal":"octopus", "number":115}
+{"timestamp":"2018-01-01T05:01:35Z","animal":"mongoose", "number":737}
+{"timestamp":"2018-01-01T06:01:35Z","animal":"snake", "number":1234}
+{"timestamp":"2018-01-01T01:01:35Z","animal":"lion", "number":300}
diff --git a/examples/quickstart/tutorial/updates-data4.json b/examples/quickstart/tutorial/updates-data4.json
new file mode 100644
index 00000000000..a0a95b2843c
--- /dev/null
+++ b/examples/quickstart/tutorial/updates-data4.json
@@ -0,0 +1,2 @@
+{"timestamp":"2018-01-01T04:01:35Z","animal":"bear", "number":222}
+{"timestamp":"2018-01-01T09:01:35Z","animal":"falcon", "number":1241}
diff --git a/examples/quickstart/tutorial/updates-init-index.json b/examples/quickstart/tutorial/updates-init-index.json
new file mode 100644
index 00000000000..52a4aef7e8f
--- /dev/null
+++ b/examples/quickstart/tutorial/updates-init-index.json
@@ -0,0 +1,49 @@
+{
+  "type" : "index",
+  "spec" : {
+    "dataSchema" : {
+      "dataSource" : "updates-tutorial",
+      "parser" : {
+        "type" : "string",
+        "parseSpec" : {
+          "format" : "json",
+          "dimensionsSpec" : {
+            "dimensions" : [
+              "animal"
+            ]
+          },
+          "timestampSpec": {
+            "column": "timestamp",
+            "format": "iso"
+          }
+        }
+      },
+      "metricsSpec" : [
+        { "type" : "count", "name" : "count" },
+        { "type" : "longSum", "name" : "number", "fieldName" : "number" }
+      ],
+      "granularitySpec" : {
+        "type" : "uniform",
+        "segmentGranularity" : "week",
+        "queryGranularity" : "minute",
+        "intervals" : ["2018-01-01/2018-01-03"],
+        "rollup" : true
+      }
+    },
+    "ioConfig" : {
+      "type" : "index",
+      "firehose" : {
+        "type" : "local",
+        "baseDir" : "quickstart/tutorial",
+        "filter" : "updates-data.json"
+      },
+      "appendToExisting" : false
+    },
+    "tuningConfig" : {
+      "type" : "index",
+      "targetPartitionSize" : 5000000,
+      "maxRowsInMemory" : 25000,
+      "forceExtendableShardSpecs" : true
+    }
+  }
+}
diff --git a/examples/quickstart/tutorial/updates-overwrite-index.json b/examples/quickstart/tutorial/updates-overwrite-index.json
new file mode 100644
index 00000000000..ac4785e749b
--- /dev/null
+++ b/examples/quickstart/tutorial/updates-overwrite-index.json
@@ -0,0 +1,49 @@
+{
+  "type" : "index",
+  "spec" : {
+    "dataSchema" : {
+      "dataSource" : "updates-tutorial",
+      "parser" : {
+        "type" : "string",
+        "parseSpec" : {
+          "format" : "json",
+          "dimensionsSpec" : {
+            "dimensions" : [
+              "animal"
+            ]
+          },
+          "timestampSpec": {
+            "column": "timestamp",
+            "format": "iso"
+          }
+        }
+      },
+      "metricsSpec" : [
+        { "type" : "count", "name" : "count" },
+        { "type" : "longSum", "name" : "number", "fieldName" : "number" }
+      ],
+      "granularitySpec" : {
+        "type" : "uniform",
+        "segmentGranularity" : "week",
+        "queryGranularity" : "minute",
+        "intervals" : ["2018-01-01/2018-01-03"],
+        "rollup" : true
+      }
+    },
+    "ioConfig" : {
+      "type" : "index",
+      "firehose" : {
+        "type" : "local",
+        "baseDir" : "quickstart/tutorial",
+        "filter" : "updates-data2.json"
+      },
+      "appendToExisting" : false
+    },
+    "tuningConfig" : {
+      "type" : "index",
+      "targetPartitionSize" : 5000000,
+      "maxRowsInMemory" : 25000,
+      "forceExtendableShardSpecs" : true
+    }
+  }
+}
diff --git a/examples/quickstart/tutorial/wikipedia-index-hadoop.json b/examples/quickstart/tutorial/wikipedia-index-hadoop.json
new file mode 100644
index 00000000000..1ad80747c04
--- /dev/null
+++ b/examples/quickstart/tutorial/wikipedia-index-hadoop.json
@@ -0,0 +1,79 @@
+{
+  "type" : "index_hadoop",
+  "spec" : {
+    "dataSchema" : {
+      "dataSource" : "wikipedia",
+      "parser" : {
+        "type" : "hadoopyString",
+        "parseSpec" : {
+          "format" : "json",
+          "dimensionsSpec" : {
+            "dimensions" : [
+              "channel",
+              "cityName",
+              "comment",
+              "countryIsoCode",
+              "countryName",
+              "isAnonymous",
+              "isMinor",
+              "isNew",
+              "isRobot",
+              "isUnpatrolled",
+              "metroCode",
+              "namespace",
+              "page",
+              "regionIsoCode",
+              "regionName",
+              "user",
+              { "name": "added", "type": "long" },
+              { "name": "deleted", "type": "long" },
+              { "name": "delta", "type": "long" }
+            ]
+          },
+          "timestampSpec" : {
+            "format" : "auto",
+            "column" : "time"
+          }
+        }
+      },
+      "metricsSpec" : [],
+      "granularitySpec" : {
+        "type" : "uniform",
+        "segmentGranularity" : "day",
+        "queryGranularity" : "none",
+        "intervals" : ["2015-09-12/2015-09-13"],
+        "rollup" : false
+      }
+    },
+    "ioConfig" : {
+      "type" : "hadoop",
+      "inputSpec" : {
+        "type" : "static",
+        "paths" : "/quickstart/wikiticker-2015-09-12-sampled.json.gz"
+      }
+    },
+    "tuningConfig" : {
+      "type" : "hadoop",
+      "partitionsSpec" : {
+        "type" : "hashed",
+        "targetPartitionSize" : 5000000
+      },
+      "forceExtendableShardSpecs" : true,
+      "jobProperties" : {
+        "fs.default.name" : "hdfs://druid-hadoop-demo:9000",
+        "fs.defaultFS" : "hdfs://druid-hadoop-demo:9000",
+        "dfs.datanode.address" : "druid-hadoop-demo",
+        "dfs.client.use.datanode.hostname" : "true",
+        "dfs.datanode.use.datanode.hostname" : "true",
+        "yarn.resourcemanager.hostname" : "druid-hadoop-demo",
+        "yarn.nodemanager.vmem-check-enabled" : "false",
+        "mapreduce.map.java.opts" : "-Duser.timezone=UTC -Dfile.encoding=UTF-8",
+        "mapreduce.job.user.classpath.first" : "true",
+        "mapreduce.reduce.java.opts" : "-Duser.timezone=UTC -Dfile.encoding=UTF-8",
+        "mapreduce.map.memory.mb" : 1024,
+        "mapreduce.reduce.memory.mb" : 1024
+      }
+    }
+  },
+  "hadoopDependencyCoordinates": ["org.apache.hadoop:hadoop-client:2.8.3"]
+}
diff --git a/examples/quickstart/tutorial/wikipedia-index.json b/examples/quickstart/tutorial/wikipedia-index.json
new file mode 100644
index 00000000000..b24bca0c9a0
--- /dev/null
+++ b/examples/quickstart/tutorial/wikipedia-index.json
@@ -0,0 +1,64 @@
+{
+  "type" : "index",
+  "spec" : {
+    "dataSchema" : {
+      "dataSource" : "wikipedia",
+      "parser" : {
+        "type" : "string",
+        "parseSpec" : {
+          "format" : "json",
+          "dimensionsSpec" : {
+            "dimensions" : [
+              "channel",
+              "cityName",
+              "comment",
+              "countryIsoCode",
+              "countryName",
+              "isAnonymous",
+              "isMinor",
+              "isNew",
+              "isRobot",
+              "isUnpatrolled",
+              "metroCode",
+              "namespace",
+              "page",
+              "regionIsoCode",
+              "regionName",
+              "user",
+              { "name": "added", "type": "long" },
+              { "name": "deleted", "type": "long" },
+              { "name": "delta", "type": "long" }
+            ]
+          },
+          "timestampSpec": {
+            "column": "time",
+            "format": "iso"
+          }
+        }
+      },
+      "metricsSpec" : [],
+      "granularitySpec" : {
+        "type" : "uniform",
+        "segmentGranularity" : "day",
+        "queryGranularity" : "none",
+        "intervals" : ["2015-09-12/2015-09-13"],
+        "rollup" : false
+      }
+    },
+    "ioConfig" : {
+      "type" : "index",
+      "firehose" : {
+        "type" : "local",
+        "baseDir" : "quickstart/",
+        "filter" : "wikiticker-2015-09-12-sampled.json.gz"
+      },
+      "appendToExisting" : false
+    },
+    "tuningConfig" : {
+      "type" : "index",
+      "targetPartitionSize" : 5000000,
+      "maxRowsInMemory" : 25000,
+      "forceExtendableShardSpecs" : true
+    }
+  }
+}
diff --git a/examples/quickstart/tutorial/wikipedia-kafka-supervisor.json b/examples/quickstart/tutorial/wikipedia-kafka-supervisor.json
new file mode 100644
index 00000000000..6988e19b172
--- /dev/null
+++ b/examples/quickstart/tutorial/wikipedia-kafka-supervisor.json
@@ -0,0 +1,59 @@
+{
+  "type": "kafka",
+  "dataSchema": {
+    "dataSource": "wikipedia",
+    "parser": {
+      "type": "string",
+      "parseSpec": {
+        "format": "json",
+        "timestampSpec": {
+          "column": "time",
+          "format": "auto"
+        },
+        "dimensionsSpec": {
+          "dimensions": [
+            "channel",
+            "cityName",
+            "comment",
+            "countryIsoCode",
+            "countryName",
+            "isAnonymous",
+            "isMinor",
+            "isNew",
+            "isRobot",
+            "isUnpatrolled",
+            "metroCode",
+            "namespace",
+            "page",
+            "regionIsoCode",
+            "regionName",
+            "user",
+            { "name": "added", "type": "long" },
+            { "name": "deleted", "type": "long" },
+            { "name": "delta", "type": "long" }
+          ]
+        }
+      }
+    },
+    "metricsSpec" : [],
+    "granularitySpec": {
+      "type": "uniform",
+      "segmentGranularity": "DAY",
+      "queryGranularity": "NONE",
+      "rollup": false
+    }
+  },
+  "tuningConfig": {
+    "type": "kafka",
+    "reportParseExceptions": false
+  },
+  "ioConfig": {
+    "topic": "wikipedia",
+    "replicas": 2,
+    "taskDuration": "PT10M",
+    "completionTimeout": "PT20M",
+    "consumerProperties": {
+      "bootstrap.servers": "localhost:9092"
+    }
+  }
+}
diff --git a/examples/quickstart/tutorial/wikipedia-top-pages-sql.json b/examples/quickstart/tutorial/wikipedia-top-pages-sql.json
new file mode 100644
index 00000000000..b1b0fdcd5a8
--- /dev/null
+++ b/examples/quickstart/tutorial/wikipedia-top-pages-sql.json
@@ -0,0 +1,3 @@
+{
+  "query":"SELECT page, COUNT(*) AS Edits FROM wikipedia WHERE \"__time\" BETWEEN TIMESTAMP '2015-09-12 00:00:00' AND TIMESTAMP '2015-09-13 00:00:00' GROUP BY page ORDER BY Edits DESC LIMIT 10"
+}
diff --git a/examples/quickstart/wikiticker-top-pages.json b/examples/quickstart/tutorial/wikipedia-top-pages.json
similarity index 50%
rename from examples/quickstart/wikiticker-top-pages.json
rename to examples/quickstart/tutorial/wikipedia-top-pages.json
index 55594b9f2dd..2961480e539 100644
--- a/examples/quickstart/wikiticker-top-pages.json
+++ b/examples/quickstart/tutorial/wikipedia-top-pages.json
@@ -1,16 +1,15 @@
 {
   "queryType" : "topN",
-  "dataSource" : "wikiticker",
+  "dataSource" : "wikipedia",
   "intervals" : ["2015-09-12/2015-09-13"],
   "granularity" : "all",
   "dimension" : "page",
-  "metric" : "edits",
-  "threshold" : 25,
+  "metric" : "count",
+  "threshold" : 10,
   "aggregations" : [
     {
-      "type" : "longSum",
-      "name" : "edits",
-      "fieldName" : "count"
+      "type" : "count",
+      "name" : "count"
     }
   ]
-}
+}
\ No newline at end of file
diff --git a/examples/quickstart/wikiticker-2015-09-12-sampled.json.gz b/examples/quickstart/tutorial/wikiticker-2015-09-12-sampled.json.gz
similarity index 100%
rename from examples/quickstart/wikiticker-2015-09-12-sampled.json.gz
rename to examples/quickstart/tutorial/wikiticker-2015-09-12-sampled.json.gz
diff --git a/examples/quickstart/wikiticker-index.json b/examples/quickstart/wikiticker-index.json
deleted file mode 100644
index 176a428c791..00000000000
--- a/examples/quickstart/wikiticker-index.json
+++ /dev/null
@@ -1,85 +0,0 @@
-{
-  "type" : "index_hadoop",
-  "spec" : {
-    "ioConfig" : {
-      "type" : "hadoop",
-      "inputSpec" : {
-        "type" : "static",
-        "paths" : "quickstart/wikiticker-2015-09-12-sampled.json.gz"
-      }
-    },
-    "dataSchema" : {
-      "dataSource" : "wikiticker",
-      "granularitySpec" : {
-        "type" : "uniform",
-        "segmentGranularity" : "day",
-        "queryGranularity" : "none",
-        "intervals" : ["2015-09-12/2015-09-13"]
-      },
-      "parser" : {
-        "type" : "hadoopyString",
-        "parseSpec" : {
-          "format" : "json",
-          "dimensionsSpec" : {
-            "dimensions" : [
-              "channel",
-              "cityName",
-              "comment",
-              "countryIsoCode",
-              "countryName",
-              "isAnonymous",
-              "isMinor",
-              "isNew",
-              "isRobot",
-              "isUnpatrolled",
-              "metroCode",
-              "namespace",
-              "page",
-              "regionIsoCode",
-              "regionName",
-              "user"
-            ]
-          },
-          "timestampSpec" : {
-            "format" : "auto",
-            "column" : "time"
-          }
-        }
-      },
-      "metricsSpec" : [
-        {
-          "name" : "count",
-          "type" : "count"
-        },
-        {
-          "name" : "added",
-          "type" : "longSum",
-          "fieldName" : "added"
-        },
-        {
-          "name" : "deleted",
-          "type" : "longSum",
-          "fieldName" : "deleted"
-        },
-        {
-          "name" : "delta",
-          "type" : "longSum",
-          "fieldName" : "delta"
-        },
-        {
-          "name" : "user_unique",
-          "type" : "hyperUnique",
-          "fieldName" : "user"
-        }
-      ]
-    },
-    "tuningConfig" : {
-      "type" : "hadoop",
-      "partitionsSpec" : {
-        "type" : "hashed",
-        "targetPartitionSize" : 5000000
-      },
-      "jobProperties" : {}
-    }
-  }
-}
diff --git a/indexing-service/src/test/java/io/druid/indexing/common/task/batch/parallel/AbstractParallelIndexSupervisorTaskTest.java b/indexing-service/src/test/java/io/druid/indexing/common/task/batch/parallel/AbstractParallelIndexSupervisorTaskTest.java
index 341d5eee670..ed70ecaaf7a 100644
--- a/indexing-service/src/test/java/io/druid/indexing/common/task/batch/parallel/AbstractParallelIndexSupervisorTaskTest.java
+++ b/indexing-service/src/test/java/io/druid/indexing/common/task/batch/parallel/AbstractParallelIndexSupervisorTaskTest.java
@@ -257,6 +257,7 @@ public void killAll()
         getIndexIO(),
         null,
         null,
+        null,
         getIndexMerger(),
         null,
         null,


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org