{"action":"created","comment":{"url":"https://api.github.com/repos/linkedin/gobblin/pulls/comments/69859785","id":69859785,"diff_hunk":"@@ -0,0 +1,247 @@\n+/*\n+ * Copyright (C) 2014-2016 LinkedIn Corp. All rights reserved.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use\n+ * this file except in compliance with the License. You may obtain a copy of the\n+ * License at  http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software distributed\n+ * under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n+ * CONDITIONS OF ANY KIND, either express or implied.\n+ */\n+\n+package gobblin.kafka.schemareg;\n+\n+import java.io.IOException;\n+import java.util.Properties;\n+\n+import org.apache.avro.Schema;\n+import org.apache.commons.httpclient.Header;\n+import org.apache.commons.httpclient.HttpClient;\n+import org.apache.commons.httpclient.HttpException;\n+import org.apache.commons.httpclient.HttpStatus;\n+import org.apache.commons.httpclient.methods.GetMethod;\n+import org.apache.commons.httpclient.methods.PostMethod;\n+import org.apache.commons.pool2.impl.GenericObjectPool;\n+import org.apache.commons.pool2.impl.GenericObjectPoolConfig;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+\n+import com.google.common.base.Preconditions;\n+\n+import gobblin.configuration.ConfigurationKeys;\n+import gobblin.kafka.serialize.MD5Digest;\n+import gobblin.util.AvroUtils;\n+\n+\n+/**\n+ * Integration with LinkedIn's implementation of a schema registry that uses md5-hash for schema ids.\n+ */\n+public class LiKafkaSchemaRegistry implements KafkaSchemaRegistry<MD5Digest, Schema> {\n+\n+\n+  private static final Logger LOG = LoggerFactory.getLogger(LiKafkaSchemaRegistry.class);\n+  private static final String GET_RESOURCE_BY_ID = \"/id=\";\n+  private static final String GET_RESOURCE_BY_TYPE = \"/latest_with_type=\";\n+  private static final String SCHEMA_ID_HEADER_NAME = \"Location\";\n+  private static final String SCHEMA_ID_HEADER_PREFIX = \"/id=\";\n+\n+  private final GenericObjectPool<HttpClient> httpClientPool;\n+  private final String url;\n+\n+  /**\n+   * @param props properties should contain property \"kafka.schema.registry.url\", and optionally\n+   * \"kafka.schema.registry.max.cache.size\" (default = 1000) and\n+   * \"kafka.schema.registry.cache.expire.after.write.min\" (default = 10).\n+   */\n+  public LiKafkaSchemaRegistry(Properties props) {\n+    //super(props);","path":"gobblin-kafka/src/main/java/gobblin/kafka/schemareg/LiKafkaSchemaRegistry.java","position":58,"original_position":58,"commit_id":"d6924000bf47506f74e5fa473f3b02a98d957668","original_commit_id":"d6924000bf47506f74e5fa473f3b02a98d957668","user":{"login":"abti","id":69499,"avatar_url":"https://avatars.githubusercontent.com/u/69499?v=3","gravatar_id":"","url":"https://api.github.com/users/abti","html_url":"https://github.com/abti","followers_url":"https://api.github.com/users/abti/followers","following_url":"https://api.github.com/users/abti/following{/other_user}","gists_url":"https://api.github.com/users/abti/gists{/gist_id}","starred_url":"https://api.github.com/users/abti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abti/subscriptions","organizations_url":"https://api.github.com/users/abti/orgs","repos_url":"https://api.github.com/users/abti/repos","events_url":"https://api.github.com/users/abti/events{/privacy}","received_events_url":"https://api.github.com/users/abti/received_events","type":"User","site_admin":false},"body":"nit: remove commented code","created_at":"2016-07-07T07:09:19Z","updated_at":"2016-07-07T07:09:19Z","html_url":"https://github.com/linkedin/gobblin/pull/1089#discussion_r69859785","pull_request_url":"https://api.github.com/repos/linkedin/gobblin/pulls/1089","_links":{"self":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/comments/69859785"},"html":{"href":"https://github.com/linkedin/gobblin/pull/1089#discussion_r69859785"},"pull_request":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/1089"}}},"pull_request":{"url":"https://api.github.com/repos/linkedin/gobblin/pulls/1089","id":76522578,"html_url":"https://github.com/linkedin/gobblin/pull/1089","diff_url":"https://github.com/linkedin/gobblin/pull/1089.diff","patch_url":"https://github.com/linkedin/gobblin/pull/1089.patch","issue_url":"https://api.github.com/repos/linkedin/gobblin/issues/1089","number":1089,"state":"open","locked":false,"title":"Kafka writer","user":{"login":"shirshanka","id":906477,"avatar_url":"https://avatars.githubusercontent.com/u/906477?v=3","gravatar_id":"","url":"https://api.github.com/users/shirshanka","html_url":"https://github.com/shirshanka","followers_url":"https://api.github.com/users/shirshanka/followers","following_url":"https://api.github.com/users/shirshanka/following{/other_user}","gists_url":"https://api.github.com/users/shirshanka/gists{/gist_id}","starred_url":"https://api.github.com/users/shirshanka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shirshanka/subscriptions","organizations_url":"https://api.github.com/users/shirshanka/orgs","repos_url":"https://api.github.com/users/shirshanka/repos","events_url":"https://api.github.com/users/shirshanka/events{/privacy}","received_events_url":"https://api.github.com/users/shirshanka/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-07T00:19:59Z","updated_at":"2016-07-07T07:09:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"15050b37db6e68cb265d46cb62585611292cc578","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/linkedin/gobblin/pulls/1089/commits","review_comments_url":"https://api.github.com/repos/linkedin/gobblin/pulls/1089/comments","review_comment_url":"https://api.github.com/repos/linkedin/gobblin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/linkedin/gobblin/issues/1089/comments","statuses_url":"https://api.github.com/repos/linkedin/gobblin/statuses/d6924000bf47506f74e5fa473f3b02a98d957668","head":{"label":"shirshanka:kafkaWriter","ref":"kafkaWriter","sha":"d6924000bf47506f74e5fa473f3b02a98d957668","user":{"login":"shirshanka","id":906477,"avatar_url":"https://avatars.githubusercontent.com/u/906477?v=3","gravatar_id":"","url":"https://api.github.com/users/shirshanka","html_url":"https://github.com/shirshanka","followers_url":"https://api.github.com/users/shirshanka/followers","following_url":"https://api.github.com/users/shirshanka/following{/other_user}","gists_url":"https://api.github.com/users/shirshanka/gists{/gist_id}","starred_url":"https://api.github.com/users/shirshanka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shirshanka/subscriptions","organizations_url":"https://api.github.com/users/shirshanka/orgs","repos_url":"https://api.github.com/users/shirshanka/repos","events_url":"https://api.github.com/users/shirshanka/events{/privacy}","received_events_url":"https://api.github.com/users/shirshanka/received_events","type":"User","site_admin":false},"repo":{"id":31140917,"name":"gobblin","full_name":"shirshanka/gobblin","owner":{"login":"shirshanka","id":906477,"avatar_url":"https://avatars.githubusercontent.com/u/906477?v=3","gravatar_id":"","url":"https://api.github.com/users/shirshanka","html_url":"https://github.com/shirshanka","followers_url":"https://api.github.com/users/shirshanka/followers","following_url":"https://api.github.com/users/shirshanka/following{/other_user}","gists_url":"https://api.github.com/users/shirshanka/gists{/gist_id}","starred_url":"https://api.github.com/users/shirshanka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shirshanka/subscriptions","organizations_url":"https://api.github.com/users/shirshanka/orgs","repos_url":"https://api.github.com/users/shirshanka/repos","events_url":"https://api.github.com/users/shirshanka/events{/privacy}","received_events_url":"https://api.github.com/users/shirshanka/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shirshanka/gobblin","description":"","fork":true,"url":"https://api.github.com/repos/shirshanka/gobblin","forks_url":"https://api.github.com/repos/shirshanka/gobblin/forks","keys_url":"https://api.github.com/repos/shirshanka/gobblin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shirshanka/gobblin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shirshanka/gobblin/teams","hooks_url":"https://api.github.com/repos/shirshanka/gobblin/hooks","issue_events_url":"https://api.github.com/repos/shirshanka/gobblin/issues/events{/number}","events_url":"https://api.github.com/repos/shirshanka/gobblin/events","assignees_url":"https://api.github.com/repos/shirshanka/gobblin/assignees{/user}","branches_url":"https://api.github.com/repos/shirshanka/gobblin/branches{/branch}","tags_url":"https://api.github.com/repos/shirshanka/gobblin/tags","blobs_url":"https://api.github.com/repos/shirshanka/gobblin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shirshanka/gobblin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shirshanka/gobblin/git/refs{/sha}","trees_url":"https://api.github.com/repos/shirshanka/gobblin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shirshanka/gobblin/statuses/{sha}","languages_url":"https://api.github.com/repos/shirshanka/gobblin/languages","stargazers_url":"https://api.github.com/repos/shirshanka/gobblin/stargazers","contributors_url":"https://api.github.com/repos/shirshanka/gobblin/contributors","subscribers_url":"https://api.github.com/repos/shirshanka/gobblin/subscribers","subscription_url":"https://api.github.com/repos/shirshanka/gobblin/subscription","commits_url":"https://api.github.com/repos/shirshanka/gobblin/commits{/sha}","git_commits_url":"https://api.github.com/repos/shirshanka/gobblin/git/commits{/sha}","comments_url":"https://api.github.com/repos/shirshanka/gobblin/comments{/number}","issue_comment_url":"https://api.github.com/repos/shirshanka/gobblin/issues/comments{/number}","contents_url":"https://api.github.com/repos/shirshanka/gobblin/contents/{+path}","compare_url":"https://api.github.com/repos/shirshanka/gobblin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shirshanka/gobblin/merges","archive_url":"https://api.github.com/repos/shirshanka/gobblin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shirshanka/gobblin/downloads","issues_url":"https://api.github.com/repos/shirshanka/gobblin/issues{/number}","pulls_url":"https://api.github.com/repos/shirshanka/gobblin/pulls{/number}","milestones_url":"https://api.github.com/repos/shirshanka/gobblin/milestones{/number}","notifications_url":"https://api.github.com/repos/shirshanka/gobblin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shirshanka/gobblin/labels{/name}","releases_url":"https://api.github.com/repos/shirshanka/gobblin/releases{/id}","deployments_url":"https://api.github.com/repos/shirshanka/gobblin/deployments","created_at":"2015-02-21T21:03:09Z","updated_at":"2016-03-26T15:50:06Z","pushed_at":"2016-07-07T07:06:16Z","git_url":"git://github.com/shirshanka/gobblin.git","ssh_url":"git@github.com:shirshanka/gobblin.git","clone_url":"https://github.com/shirshanka/gobblin.git","svn_url":"https://github.com/shirshanka/gobblin","homepage":null,"size":87162,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"linkedin:master","ref":"master","sha":"589c1bc4447bc59e9cb4c87ecc1b6b72a288515f","user":{"login":"linkedin","id":357098,"avatar_url":"https://avatars.githubusercontent.com/u/357098?v=3","gravatar_id":"","url":"https://api.github.com/users/linkedin","html_url":"https://github.com/linkedin","followers_url":"https://api.github.com/users/linkedin/followers","following_url":"https://api.github.com/users/linkedin/following{/other_user}","gists_url":"https://api.github.com/users/linkedin/gists{/gist_id}","starred_url":"https://api.github.com/users/linkedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linkedin/subscriptions","organizations_url":"https://api.github.com/users/linkedin/orgs","repos_url":"https://api.github.com/users/linkedin/repos","events_url":"https://api.github.com/users/linkedin/events{/privacy}","received_events_url":"https://api.github.com/users/linkedin/received_events","type":"Organization","site_admin":false},"repo":{"id":27392543,"name":"gobblin","full_name":"linkedin/gobblin","owner":{"login":"linkedin","id":357098,"avatar_url":"https://avatars.githubusercontent.com/u/357098?v=3","gravatar_id":"","url":"https://api.github.com/users/linkedin","html_url":"https://github.com/linkedin","followers_url":"https://api.github.com/users/linkedin/followers","following_url":"https://api.github.com/users/linkedin/following{/other_user}","gists_url":"https://api.github.com/users/linkedin/gists{/gist_id}","starred_url":"https://api.github.com/users/linkedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linkedin/subscriptions","organizations_url":"https://api.github.com/users/linkedin/orgs","repos_url":"https://api.github.com/users/linkedin/repos","events_url":"https://api.github.com/users/linkedin/events{/privacy}","received_events_url":"https://api.github.com/users/linkedin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/linkedin/gobblin","description":"Universal data ingestion framework for Hadoop.","fork":false,"url":"https://api.github.com/repos/linkedin/gobblin","forks_url":"https://api.github.com/repos/linkedin/gobblin/forks","keys_url":"https://api.github.com/repos/linkedin/gobblin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/linkedin/gobblin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/linkedin/gobblin/teams","hooks_url":"https://api.github.com/repos/linkedin/gobblin/hooks","issue_events_url":"https://api.github.com/repos/linkedin/gobblin/issues/events{/number}","events_url":"https://api.github.com/repos/linkedin/gobblin/events","assignees_url":"https://api.github.com/repos/linkedin/gobblin/assignees{/user}","branches_url":"https://api.github.com/repos/linkedin/gobblin/branches{/branch}","tags_url":"https://api.github.com/repos/linkedin/gobblin/tags","blobs_url":"https://api.github.com/repos/linkedin/gobblin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/linkedin/gobblin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/linkedin/gobblin/git/refs{/sha}","trees_url":"https://api.github.com/repos/linkedin/gobblin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/linkedin/gobblin/statuses/{sha}","languages_url":"https://api.github.com/repos/linkedin/gobblin/languages","stargazers_url":"https://api.github.com/repos/linkedin/gobblin/stargazers","contributors_url":"https://api.github.com/repos/linkedin/gobblin/contributors","subscribers_url":"https://api.github.com/repos/linkedin/gobblin/subscribers","subscription_url":"https://api.github.com/repos/linkedin/gobblin/subscription","commits_url":"https://api.github.com/repos/linkedin/gobblin/commits{/sha}","git_commits_url":"https://api.github.com/repos/linkedin/gobblin/git/commits{/sha}","comments_url":"https://api.github.com/repos/linkedin/gobblin/comments{/number}","issue_comment_url":"https://api.github.com/repos/linkedin/gobblin/issues/comments{/number}","contents_url":"https://api.github.com/repos/linkedin/gobblin/contents/{+path}","compare_url":"https://api.github.com/repos/linkedin/gobblin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/linkedin/gobblin/merges","archive_url":"https://api.github.com/repos/linkedin/gobblin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/linkedin/gobblin/downloads","issues_url":"https://api.github.com/repos/linkedin/gobblin/issues{/number}","pulls_url":"https://api.github.com/repos/linkedin/gobblin/pulls{/number}","milestones_url":"https://api.github.com/repos/linkedin/gobblin/milestones{/number}","notifications_url":"https://api.github.com/repos/linkedin/gobblin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/linkedin/gobblin/labels{/name}","releases_url":"https://api.github.com/repos/linkedin/gobblin/releases{/id}","deployments_url":"https://api.github.com/repos/linkedin/gobblin/deployments","created_at":"2014-12-01T18:10:50Z","updated_at":"2016-07-07T05:21:21Z","pushed_at":"2016-07-07T07:06:16Z","git_url":"git://github.com/linkedin/gobblin.git","ssh_url":"git@github.com:linkedin/gobblin.git","clone_url":"https://github.com/linkedin/gobblin.git","svn_url":"https://github.com/linkedin/gobblin","homepage":"https://github.com/linkedin/gobblin/wiki","size":172809,"stargazers_count":629,"watchers_count":629,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":259,"mirror_url":null,"open_issues_count":105,"forks":259,"open_issues":105,"watchers":629,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/1089"},"html":{"href":"https://github.com/linkedin/gobblin/pull/1089"},"issue":{"href":"https://api.github.com/repos/linkedin/gobblin/issues/1089"},"comments":{"href":"https://api.github.com/repos/linkedin/gobblin/issues/1089/comments"},"review_comments":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/1089/comments"},"review_comment":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/1089/commits"},"statuses":{"href":"https://api.github.com/repos/linkedin/gobblin/statuses/d6924000bf47506f74e5fa473f3b02a98d957668"}}}}
{"actor":{"display_login":"abti"}}