{"action":"created","comment":{"url":"https://api.github.com/repos/druid-io/tranquility/pulls/comments/47701567","id":47701567,"diff_hunk":"@@ -0,0 +1,91 @@\n+/*\n+ * Licensed to Metamarkets Group Inc. (Metamarkets) under one\n+ * or more contributor license agreements.  See the NOTICE file\n+ * distributed with this work for additional information\n+ * regarding copyright ownership.  Metamarkets licenses this file\n+ * to you under the Apache License, Version 2.0 (the\n+ * \"License\"); you may not use this file except in compliance\n+ * with the License.  You may obtain a copy of the License at\n+ *\n+ *   http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing,\n+ * software distributed under the License is distributed on an\n+ * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n+ * KIND, either express or implied.  See the License for the\n+ * specific language governing permissions and limitations\n+ * under the License.\n+ */\n+package com.metamx.tranquility.kafka.util;\n+\n+import com.fasterxml.jackson.databind.Module;\n+import com.fasterxml.jackson.databind.ObjectMapper;\n+import com.google.common.base.Charsets;\n+import com.metamx.common.IAE;\n+import com.metamx.tranquility.kafka.model.IngestionSpec;\n+import com.metamx.tranquility.kafka.model.TranquilityConfig;\n+import io.druid.jackson.AggregatorsModule;\n+import io.druid.jackson.QueryGranularityModule;\n+import io.druid.query.aggregation.histogram.ApproximateHistogramDruidModule;\n+import org.apache.commons.lang.Validate;\n+\n+import java.io.IOException;\n+import java.nio.file.Files;\n+import java.nio.file.Path;\n+import java.nio.file.Paths;\n+\n+/**\n+ * Read and validate ingestion spec files.\n+ */\n+public class IngestionSpecHelper\n+{\n+  private static final ObjectMapper mapper = new ObjectMapper();","path":"kafka/src/main/java/com/metamx/tranquility/kafka/util/IngestionSpecHelper.java","position":42,"original_position":42,"commit_id":"c14fb99e59f921551bfed24d95721e73d74c7c01","original_commit_id":"c14fb99e59f921551bfed24d95721e73d74c7c01","user":{"login":"gianm","id":1214075,"avatar_url":"https://avatars.githubusercontent.com/u/1214075?v=3","gravatar_id":"","url":"https://api.github.com/users/gianm","html_url":"https://github.com/gianm","followers_url":"https://api.github.com/users/gianm/followers","following_url":"https://api.github.com/users/gianm/following{/other_user}","gists_url":"https://api.github.com/users/gianm/gists{/gist_id}","starred_url":"https://api.github.com/users/gianm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gianm/subscriptions","organizations_url":"https://api.github.com/users/gianm/orgs","repos_url":"https://api.github.com/users/gianm/repos","events_url":"https://api.github.com/users/gianm/events{/privacy}","received_events_url":"https://api.github.com/users/gianm/received_events","type":"User","site_admin":false},"body":"This should be a `DruidGuicer.objectMapper` to make sure we load all extensions properly. That will also get the approximate histogram aggregator loaded if it's present, so the explicit dependency and code for that is not necessary.","created_at":"2015-12-15T21:31:07Z","updated_at":"2015-12-15T21:31:07Z","html_url":"https://github.com/druid-io/tranquility/pull/65#discussion_r47701567","pull_request_url":"https://api.github.com/repos/druid-io/tranquility/pulls/65","_links":{"self":{"href":"https://api.github.com/repos/druid-io/tranquility/pulls/comments/47701567"},"html":{"href":"https://github.com/druid-io/tranquility/pull/65#discussion_r47701567"},"pull_request":{"href":"https://api.github.com/repos/druid-io/tranquility/pulls/65"}}},"pull_request":{"url":"https://api.github.com/repos/druid-io/tranquility/pulls/65","id":53069777,"html_url":"https://github.com/druid-io/tranquility/pull/65","diff_url":"https://github.com/druid-io/tranquility/pull/65.diff","patch_url":"https://github.com/druid-io/tranquility/pull/65.patch","issue_url":"https://api.github.com/repos/druid-io/tranquility/issues/65","number":65,"state":"open","locked":false,"title":"tranquility-kafka module","user":{"login":"dclim","id":11050882,"avatar_url":"https://avatars.githubusercontent.com/u/11050882?v=3","gravatar_id":"","url":"https://api.github.com/users/dclim","html_url":"https://github.com/dclim","followers_url":"https://api.github.com/users/dclim/followers","following_url":"https://api.github.com/users/dclim/following{/other_user}","gists_url":"https://api.github.com/users/dclim/gists{/gist_id}","starred_url":"https://api.github.com/users/dclim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dclim/subscriptions","organizations_url":"https://api.github.com/users/dclim/orgs","repos_url":"https://api.github.com/users/dclim/repos","events_url":"https://api.github.com/users/dclim/events{/privacy}","received_events_url":"https://api.github.com/users/dclim/received_events","type":"User","site_admin":false},"body":"This PR adds a module to Tranquility to help push data from Kafka into the indexing service through Tranquility. Multiple instances of tranquility-kafka can be run at the same time to provide scalability and high availability, and an instance can read from multiple Kafka topics and write to multiple Druid datasources. Tranquility-kafka supports regex pattern based mapping of Kafka topic to a Druid ingestion spec, thus allowing indexing tasks for new datasources to be automatically created when a new Kafka topic is created that matches the regex. If additional Kafka topic -> ingestion spec mappings need to be added, tranquility-kafka supports rolling updates without data loss.\r\n\r\nTo build, run: `sbt universal:packageZipTarball`\r\n\r\nUnpack the tgz in `/kafka/target/universal/tranquility-kafka-x.x.x.tgz` and run `bin/tranquility-kafka -f conf/config.properties` to start. You'll need to modify config.properties and add some ingestion specs to do anything useful.\r\n\r\nI'll be adding unit tests and documentation, but wanted to put this out to get some feedback.","created_at":"2015-12-09T02:41:48Z","updated_at":"2015-12-15T21:31:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"22ab9e9dfe8204e644fc73284ff14684c0897710","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/druid-io/tranquility/pulls/65/commits","review_comments_url":"https://api.github.com/repos/druid-io/tranquility/pulls/65/comments","review_comment_url":"https://api.github.com/repos/druid-io/tranquility/pulls/comments{/number}","comments_url":"https://api.github.com/repos/druid-io/tranquility/issues/65/comments","statuses_url":"https://api.github.com/repos/druid-io/tranquility/statuses/c14fb99e59f921551bfed24d95721e73d74c7c01","head":{"label":"dclim:tranquility-kafka","ref":"tranquility-kafka","sha":"c14fb99e59f921551bfed24d95721e73d74c7c01","user":{"login":"dclim","id":11050882,"avatar_url":"https://avatars.githubusercontent.com/u/11050882?v=3","gravatar_id":"","url":"https://api.github.com/users/dclim","html_url":"https://github.com/dclim","followers_url":"https://api.github.com/users/dclim/followers","following_url":"https://api.github.com/users/dclim/following{/other_user}","gists_url":"https://api.github.com/users/dclim/gists{/gist_id}","starred_url":"https://api.github.com/users/dclim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dclim/subscriptions","organizations_url":"https://api.github.com/users/dclim/orgs","repos_url":"https://api.github.com/users/dclim/repos","events_url":"https://api.github.com/users/dclim/events{/privacy}","received_events_url":"https://api.github.com/users/dclim/received_events","type":"User","site_admin":false},"repo":{"id":47656693,"name":"tranquility","full_name":"dclim/tranquility","owner":{"login":"dclim","id":11050882,"avatar_url":"https://avatars.githubusercontent.com/u/11050882?v=3","gravatar_id":"","url":"https://api.github.com/users/dclim","html_url":"https://github.com/dclim","followers_url":"https://api.github.com/users/dclim/followers","following_url":"https://api.github.com/users/dclim/following{/other_user}","gists_url":"https://api.github.com/users/dclim/gists{/gist_id}","starred_url":"https://api.github.com/users/dclim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dclim/subscriptions","organizations_url":"https://api.github.com/users/dclim/orgs","repos_url":"https://api.github.com/users/dclim/repos","events_url":"https://api.github.com/users/dclim/events{/privacy}","received_events_url":"https://api.github.com/users/dclim/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dclim/tranquility","description":"Tranquility helps you send real-time event streams to Druid and handles partitioning, replication, service discovery, and schema rollover, seamlessly and without downtime.","fork":true,"url":"https://api.github.com/repos/dclim/tranquility","forks_url":"https://api.github.com/repos/dclim/tranquility/forks","keys_url":"https://api.github.com/repos/dclim/tranquility/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dclim/tranquility/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dclim/tranquility/teams","hooks_url":"https://api.github.com/repos/dclim/tranquility/hooks","issue_events_url":"https://api.github.com/repos/dclim/tranquility/issues/events{/number}","events_url":"https://api.github.com/repos/dclim/tranquility/events","assignees_url":"https://api.github.com/repos/dclim/tranquility/assignees{/user}","branches_url":"https://api.github.com/repos/dclim/tranquility/branches{/branch}","tags_url":"https://api.github.com/repos/dclim/tranquility/tags","blobs_url":"https://api.github.com/repos/dclim/tranquility/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dclim/tranquility/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dclim/tranquility/git/refs{/sha}","trees_url":"https://api.github.com/repos/dclim/tranquility/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dclim/tranquility/statuses/{sha}","languages_url":"https://api.github.com/repos/dclim/tranquility/languages","stargazers_url":"https://api.github.com/repos/dclim/tranquility/stargazers","contributors_url":"https://api.github.com/repos/dclim/tranquility/contributors","subscribers_url":"https://api.github.com/repos/dclim/tranquility/subscribers","subscription_url":"https://api.github.com/repos/dclim/tranquility/subscription","commits_url":"https://api.github.com/repos/dclim/tranquility/commits{/sha}","git_commits_url":"https://api.github.com/repos/dclim/tranquility/git/commits{/sha}","comments_url":"https://api.github.com/repos/dclim/tranquility/comments{/number}","issue_comment_url":"https://api.github.com/repos/dclim/tranquility/issues/comments{/number}","contents_url":"https://api.github.com/repos/dclim/tranquility/contents/{+path}","compare_url":"https://api.github.com/repos/dclim/tranquility/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dclim/tranquility/merges","archive_url":"https://api.github.com/repos/dclim/tranquility/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dclim/tranquility/downloads","issues_url":"https://api.github.com/repos/dclim/tranquility/issues{/number}","pulls_url":"https://api.github.com/repos/dclim/tranquility/pulls{/number}","milestones_url":"https://api.github.com/repos/dclim/tranquility/milestones{/number}","notifications_url":"https://api.github.com/repos/dclim/tranquility/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dclim/tranquility/labels{/name}","releases_url":"https://api.github.com/repos/dclim/tranquility/releases{/id}","created_at":"2015-12-08T23:48:56Z","updated_at":"2015-12-08T23:48:57Z","pushed_at":"2015-12-09T02:24:04Z","git_url":"git://github.com/dclim/tranquility.git","ssh_url":"git@github.com:dclim/tranquility.git","clone_url":"https://github.com/dclim/tranquility.git","svn_url":"https://github.com/dclim/tranquility","homepage":"","size":511,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"druid-io:master","ref":"master","sha":"6f6005f608fc1eed765ab239c8bb22ea1f147bbe","user":{"login":"druid-io","id":4203474,"avatar_url":"https://avatars.githubusercontent.com/u/4203474?v=3","gravatar_id":"","url":"https://api.github.com/users/druid-io","html_url":"https://github.com/druid-io","followers_url":"https://api.github.com/users/druid-io/followers","following_url":"https://api.github.com/users/druid-io/following{/other_user}","gists_url":"https://api.github.com/users/druid-io/gists{/gist_id}","starred_url":"https://api.github.com/users/druid-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/druid-io/subscriptions","organizations_url":"https://api.github.com/users/druid-io/orgs","repos_url":"https://api.github.com/users/druid-io/repos","events_url":"https://api.github.com/users/druid-io/events{/privacy}","received_events_url":"https://api.github.com/users/druid-io/received_events","type":"Organization","site_admin":false},"repo":{"id":16817857,"name":"tranquility","full_name":"druid-io/tranquility","owner":{"login":"druid-io","id":4203474,"avatar_url":"https://avatars.githubusercontent.com/u/4203474?v=3","gravatar_id":"","url":"https://api.github.com/users/druid-io","html_url":"https://github.com/druid-io","followers_url":"https://api.github.com/users/druid-io/followers","following_url":"https://api.github.com/users/druid-io/following{/other_user}","gists_url":"https://api.github.com/users/druid-io/gists{/gist_id}","starred_url":"https://api.github.com/users/druid-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/druid-io/subscriptions","organizations_url":"https://api.github.com/users/druid-io/orgs","repos_url":"https://api.github.com/users/druid-io/repos","events_url":"https://api.github.com/users/druid-io/events{/privacy}","received_events_url":"https://api.github.com/users/druid-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/druid-io/tranquility","description":"Tranquility helps you send real-time event streams to Druid and handles partitioning, replication, service discovery, and schema rollover, seamlessly and without downtime.","fork":false,"url":"https://api.github.com/repos/druid-io/tranquility","forks_url":"https://api.github.com/repos/druid-io/tranquility/forks","keys_url":"https://api.github.com/repos/druid-io/tranquility/keys{/key_id}","collaborators_url":"https://api.github.com/repos/druid-io/tranquility/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/druid-io/tranquility/teams","hooks_url":"https://api.github.com/repos/druid-io/tranquility/hooks","issue_events_url":"https://api.github.com/repos/druid-io/tranquility/issues/events{/number}","events_url":"https://api.github.com/repos/druid-io/tranquility/events","assignees_url":"https://api.github.com/repos/druid-io/tranquility/assignees{/user}","branches_url":"https://api.github.com/repos/druid-io/tranquility/branches{/branch}","tags_url":"https://api.github.com/repos/druid-io/tranquility/tags","blobs_url":"https://api.github.com/repos/druid-io/tranquility/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/druid-io/tranquility/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/druid-io/tranquility/git/refs{/sha}","trees_url":"https://api.github.com/repos/druid-io/tranquility/git/trees{/sha}","statuses_url":"https://api.github.com/repos/druid-io/tranquility/statuses/{sha}","languages_url":"https://api.github.com/repos/druid-io/tranquility/languages","stargazers_url":"https://api.github.com/repos/druid-io/tranquility/stargazers","contributors_url":"https://api.github.com/repos/druid-io/tranquility/contributors","subscribers_url":"https://api.github.com/repos/druid-io/tranquility/subscribers","subscription_url":"https://api.github.com/repos/druid-io/tranquility/subscription","commits_url":"https://api.github.com/repos/druid-io/tranquility/commits{/sha}","git_commits_url":"https://api.github.com/repos/druid-io/tranquility/git/commits{/sha}","comments_url":"https://api.github.com/repos/druid-io/tranquility/comments{/number}","issue_comment_url":"https://api.github.com/repos/druid-io/tranquility/issues/comments{/number}","contents_url":"https://api.github.com/repos/druid-io/tranquility/contents/{+path}","compare_url":"https://api.github.com/repos/druid-io/tranquility/compare/{base}...{head}","merges_url":"https://api.github.com/repos/druid-io/tranquility/merges","archive_url":"https://api.github.com/repos/druid-io/tranquility/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/druid-io/tranquility/downloads","issues_url":"https://api.github.com/repos/druid-io/tranquility/issues{/number}","pulls_url":"https://api.github.com/repos/druid-io/tranquility/pulls{/number}","milestones_url":"https://api.github.com/repos/druid-io/tranquility/milestones{/number}","notifications_url":"https://api.github.com/repos/druid-io/tranquility/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/druid-io/tranquility/labels{/name}","releases_url":"https://api.github.com/repos/druid-io/tranquility/releases{/id}","created_at":"2014-02-13T21:30:05Z","updated_at":"2015-12-09T08:11:00Z","pushed_at":"2015-12-14T13:25:44Z","git_url":"git://github.com/druid-io/tranquility.git","ssh_url":"git@github.com:druid-io/tranquility.git","clone_url":"https://github.com/druid-io/tranquility.git","svn_url":"https://github.com/druid-io/tranquility","homepage":"","size":562,"stargazers_count":98,"watchers_count":98,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":37,"mirror_url":null,"open_issues_count":19,"forks":37,"open_issues":19,"watchers":98,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/druid-io/tranquility/pulls/65"},"html":{"href":"https://github.com/druid-io/tranquility/pull/65"},"issue":{"href":"https://api.github.com/repos/druid-io/tranquility/issues/65"},"comments":{"href":"https://api.github.com/repos/druid-io/tranquility/issues/65/comments"},"review_comments":{"href":"https://api.github.com/repos/druid-io/tranquility/pulls/65/comments"},"review_comment":{"href":"https://api.github.com/repos/druid-io/tranquility/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/druid-io/tranquility/pulls/65/commits"},"statuses":{"href":"https://api.github.com/repos/druid-io/tranquility/statuses/c14fb99e59f921551bfed24d95721e73d74c7c01"}}}}