{"action":"created","comment":{"url":"https://api.github.com/repos/apache/kafka/pulls/comments/41815582","id":41815582,"diff_hunk":"@@ -0,0 +1,497 @@\n+/**\n+ * Licensed to the Apache Software Foundation (ASF) under one or more\n+ * contributor license agreements.  See the NOTICE file distributed with\n+ * this work for additional information regarding copyright ownership.\n+ * The ASF licenses this file to You under the Apache License, Version 2.0\n+ * (the \"License\"); you may not use this file except in compliance with\n+ * 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, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ **/\n+\n+package org.apache.kafka.copycat.runtime.distributed;\n+\n+import org.apache.kafka.clients.CommonClientConfigs;\n+import org.apache.kafka.clients.consumer.ConsumerConfig;\n+import org.apache.kafka.clients.consumer.ConsumerRecord;\n+import org.apache.kafka.clients.producer.ProducerConfig;\n+import org.apache.kafka.common.KafkaException;\n+import org.apache.kafka.copycat.data.Field;\n+import org.apache.kafka.copycat.data.Schema;\n+import org.apache.kafka.copycat.data.SchemaAndValue;\n+import org.apache.kafka.copycat.data.Struct;\n+import org.apache.kafka.copycat.storage.Converter;\n+import org.apache.kafka.copycat.util.Callback;\n+import org.apache.kafka.copycat.util.ConnectorTaskId;\n+import org.apache.kafka.copycat.util.KafkaBasedLog;\n+import org.apache.kafka.copycat.util.TestFuture;\n+import org.easymock.Capture;\n+import org.easymock.EasyMock;\n+import org.easymock.IAnswer;\n+import org.junit.Before;\n+import org.junit.Test;\n+import org.junit.runner.RunWith;\n+import org.powermock.api.easymock.PowerMock;\n+import org.powermock.api.easymock.annotation.Mock;\n+import org.powermock.core.classloader.annotations.PowerMockIgnore;\n+import org.powermock.core.classloader.annotations.PrepareForTest;\n+import org.powermock.modules.junit4.PowerMockRunner;\n+import org.powermock.reflect.Whitebox;\n+\n+import java.util.ArrayList;\n+import java.util.Arrays;\n+import java.util.Collections;\n+import java.util.HashMap;\n+import java.util.LinkedHashMap;\n+import java.util.List;\n+import java.util.Map;\n+import java.util.concurrent.Future;\n+\n+import static org.junit.Assert.assertEquals;\n+import static org.junit.Assert.assertNull;\n+import static org.junit.Assert.fail;\n+\n+@RunWith(PowerMockRunner.class)\n+@PrepareForTest(KafkaConfigStorage.class)\n+@PowerMockIgnore(\"javax.management.*\")\n+public class KafkaConfigStorageTest {","path":"copycat/runtime/src/test/java/org/apache/kafka/copycat/runtime/distributed/KafkaConfigStorageTest.java","position":63,"original_position":63,"commit_id":"37c5a4236700fb5282d9a5e6baf28ad3913be8c9","original_commit_id":"ac9a8f79ae8806088d0a3aac1b04df91bd3889bc","user":{"login":"gwenshap","id":1189030,"avatar_url":"https://avatars.githubusercontent.com/u/1189030?v=3","gravatar_id":"","url":"https://api.github.com/users/gwenshap","html_url":"https://github.com/gwenshap","followers_url":"https://api.github.com/users/gwenshap/followers","following_url":"https://api.github.com/users/gwenshap/following{/other_user}","gists_url":"https://api.github.com/users/gwenshap/gists{/gist_id}","starred_url":"https://api.github.com/users/gwenshap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gwenshap/subscriptions","organizations_url":"https://api.github.com/users/gwenshap/orgs","repos_url":"https://api.github.com/users/gwenshap/repos","events_url":"https://api.github.com/users/gwenshap/events{/privacy}","received_events_url":"https://api.github.com/users/gwenshap/received_events","type":"User","site_admin":false},"body":"I was thinking about \"losing\" an entire topic of \"ephemeral configs\", but since we decided not to split the topics, no need for extra tests :)","created_at":"2015-10-13T00:20:01Z","updated_at":"2015-10-13T00:20:01Z","html_url":"https://github.com/apache/kafka/pull/241#discussion_r41815582","pull_request_url":"https://api.github.com/repos/apache/kafka/pulls/241","_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments/41815582"},"html":{"href":"https://github.com/apache/kafka/pull/241#discussion_r41815582"},"pull_request":{"href":"https://api.github.com/repos/apache/kafka/pulls/241"}}},"pull_request":{"url":"https://api.github.com/repos/apache/kafka/pulls/241","id":45971446,"html_url":"https://github.com/apache/kafka/pull/241","diff_url":"https://github.com/apache/kafka/pull/241.diff","patch_url":"https://github.com/apache/kafka/pull/241.patch","issue_url":"https://api.github.com/repos/apache/kafka/issues/241","number":241,"state":"open","locked":false,"title":"KAFKA-2372: Add Kafka-backed storage of Copycat configs.","user":{"login":"ewencp","id":47366,"avatar_url":"https://avatars.githubusercontent.com/u/47366?v=3","gravatar_id":"","url":"https://api.github.com/users/ewencp","html_url":"https://github.com/ewencp","followers_url":"https://api.github.com/users/ewencp/followers","following_url":"https://api.github.com/users/ewencp/following{/other_user}","gists_url":"https://api.github.com/users/ewencp/gists{/gist_id}","starred_url":"https://api.github.com/users/ewencp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ewencp/subscriptions","organizations_url":"https://api.github.com/users/ewencp/orgs","repos_url":"https://api.github.com/users/ewencp/repos","events_url":"https://api.github.com/users/ewencp/events{/privacy}","received_events_url":"https://api.github.com/users/ewencp/received_events","type":"User","site_admin":false},"body":"This also adds some other needed infrastructure for distributed Copycat, most\r\nimportantly the DistributedHerder, and refactors some code for handling\r\nKafka-backed logs into KafkaBasedLog since this is shared betweeen offset and\r\nconfig storage.","created_at":"2015-09-25T02:27:37Z","updated_at":"2015-10-13T00:20:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7874d660c31df6338240e444f8ced07ba5de0528","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/kafka/pulls/241/commits","review_comments_url":"https://api.github.com/repos/apache/kafka/pulls/241/comments","review_comment_url":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/kafka/issues/241/comments","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/37c5a4236700fb5282d9a5e6baf28ad3913be8c9","head":{"label":"ewencp:kafka-2372-copycat-distributed-config","ref":"kafka-2372-copycat-distributed-config","sha":"37c5a4236700fb5282d9a5e6baf28ad3913be8c9","user":{"login":"ewencp","id":47366,"avatar_url":"https://avatars.githubusercontent.com/u/47366?v=3","gravatar_id":"","url":"https://api.github.com/users/ewencp","html_url":"https://github.com/ewencp","followers_url":"https://api.github.com/users/ewencp/followers","following_url":"https://api.github.com/users/ewencp/following{/other_user}","gists_url":"https://api.github.com/users/ewencp/gists{/gist_id}","starred_url":"https://api.github.com/users/ewencp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ewencp/subscriptions","organizations_url":"https://api.github.com/users/ewencp/orgs","repos_url":"https://api.github.com/users/ewencp/repos","events_url":"https://api.github.com/users/ewencp/events{/privacy}","received_events_url":"https://api.github.com/users/ewencp/received_events","type":"User","site_admin":false},"repo":{"id":31331021,"name":"kafka","full_name":"ewencp/kafka","owner":{"login":"ewencp","id":47366,"avatar_url":"https://avatars.githubusercontent.com/u/47366?v=3","gravatar_id":"","url":"https://api.github.com/users/ewencp","html_url":"https://github.com/ewencp","followers_url":"https://api.github.com/users/ewencp/followers","following_url":"https://api.github.com/users/ewencp/following{/other_user}","gists_url":"https://api.github.com/users/ewencp/gists{/gist_id}","starred_url":"https://api.github.com/users/ewencp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ewencp/subscriptions","organizations_url":"https://api.github.com/users/ewencp/orgs","repos_url":"https://api.github.com/users/ewencp/repos","events_url":"https://api.github.com/users/ewencp/events{/privacy}","received_events_url":"https://api.github.com/users/ewencp/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ewencp/kafka","description":"Mirror of Apache Kafka","fork":true,"url":"https://api.github.com/repos/ewencp/kafka","forks_url":"https://api.github.com/repos/ewencp/kafka/forks","keys_url":"https://api.github.com/repos/ewencp/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ewencp/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ewencp/kafka/teams","hooks_url":"https://api.github.com/repos/ewencp/kafka/hooks","issue_events_url":"https://api.github.com/repos/ewencp/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/ewencp/kafka/events","assignees_url":"https://api.github.com/repos/ewencp/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/ewencp/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/ewencp/kafka/tags","blobs_url":"https://api.github.com/repos/ewencp/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ewencp/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ewencp/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/ewencp/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ewencp/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/ewencp/kafka/languages","stargazers_url":"https://api.github.com/repos/ewencp/kafka/stargazers","contributors_url":"https://api.github.com/repos/ewencp/kafka/contributors","subscribers_url":"https://api.github.com/repos/ewencp/kafka/subscribers","subscription_url":"https://api.github.com/repos/ewencp/kafka/subscription","commits_url":"https://api.github.com/repos/ewencp/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/ewencp/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/ewencp/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/ewencp/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/ewencp/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/ewencp/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ewencp/kafka/merges","archive_url":"https://api.github.com/repos/ewencp/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ewencp/kafka/downloads","issues_url":"https://api.github.com/repos/ewencp/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/ewencp/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/ewencp/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/ewencp/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ewencp/kafka/labels{/name}","releases_url":"https://api.github.com/repos/ewencp/kafka/releases{/id}","created_at":"2015-02-25T19:10:48Z","updated_at":"2015-02-25T19:10:51Z","pushed_at":"2015-10-12T18:07:31Z","git_url":"git://github.com/ewencp/kafka.git","ssh_url":"git@github.com:ewencp/kafka.git","clone_url":"https://github.com/ewencp/kafka.git","svn_url":"https://github.com/ewencp/kafka","homepage":null,"size":22993,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"0.8.2"}},"base":{"label":"apache:trunk","ref":"trunk","sha":"5764e54de147af81aac85acc00687c23e9646a5c","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":2211243,"name":"kafka","full_name":"apache/kafka","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/kafka","description":"Mirror of Apache Kafka","fork":false,"url":"https://api.github.com/repos/apache/kafka","forks_url":"https://api.github.com/repos/apache/kafka/forks","keys_url":"https://api.github.com/repos/apache/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/kafka/teams","hooks_url":"https://api.github.com/repos/apache/kafka/hooks","issue_events_url":"https://api.github.com/repos/apache/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/apache/kafka/events","assignees_url":"https://api.github.com/repos/apache/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/apache/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/apache/kafka/tags","blobs_url":"https://api.github.com/repos/apache/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/kafka/languages","stargazers_url":"https://api.github.com/repos/apache/kafka/stargazers","contributors_url":"https://api.github.com/repos/apache/kafka/contributors","subscribers_url":"https://api.github.com/repos/apache/kafka/subscribers","subscription_url":"https://api.github.com/repos/apache/kafka/subscription","commits_url":"https://api.github.com/repos/apache/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/apache/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/kafka/merges","archive_url":"https://api.github.com/repos/apache/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/kafka/downloads","issues_url":"https://api.github.com/repos/apache/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/apache/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/kafka/labels{/name}","releases_url":"https://api.github.com/repos/apache/kafka/releases{/id}","created_at":"2011-08-15T18:06:16Z","updated_at":"2015-10-12T21:50:17Z","pushed_at":"2015-10-13T00:15:23Z","git_url":"git://github.com/apache/kafka.git","ssh_url":"git@github.com:apache/kafka.git","clone_url":"https://github.com/apache/kafka.git","svn_url":"https://github.com/apache/kafka","homepage":null,"size":33672,"stargazers_count":2039,"watchers_count":2039,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1216,"mirror_url":"git://git.apache.org/kafka.git","open_issues_count":94,"forks":1216,"open_issues":94,"watchers":2039,"default_branch":"trunk"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/241"},"html":{"href":"https://github.com/apache/kafka/pull/241"},"issue":{"href":"https://api.github.com/repos/apache/kafka/issues/241"},"comments":{"href":"https://api.github.com/repos/apache/kafka/issues/241/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/kafka/pulls/241/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/kafka/pulls/241/commits"},"statuses":{"href":"https://api.github.com/repos/apache/kafka/statuses/37c5a4236700fb5282d9a5e6baf28ad3913be8c9"}}}}