{"action":"created","comment":{"url":"https://api.github.com/repos/apache/kafka/pulls/comments/51942872","id":51942872,"diff_hunk":"@@ -0,0 +1,74 @@\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+package org.apache.kafka.test;\n+\n+\n+import org.apache.kafka.clients.consumer.ConsumerInterceptor;\n+import org.apache.kafka.clients.consumer.ConsumerRecord;\n+import org.apache.kafka.clients.consumer.ConsumerRecords;\n+import org.apache.kafka.clients.consumer.OffsetAndMetadata;\n+import org.apache.kafka.clients.consumer.ConsumerConfig;\n+import org.apache.kafka.clients.producer.ProducerConfig;\n+import org.apache.kafka.common.TopicPartition;\n+import org.apache.kafka.common.config.ConfigException;\n+\n+import java.util.ArrayList;\n+import java.util.HashMap;\n+import java.util.List;\n+import java.util.Map;\n+import java.util.concurrent.atomic.AtomicInteger;\n+\n+public class MockConsumerInterceptor implements ConsumerInterceptor<String, String> {\n+    public static final AtomicInteger INIT_COUNT = new AtomicInteger(0);\n+    public static final AtomicInteger CLOSE_COUNT = new AtomicInteger(0);\n+    public static final AtomicInteger ON_COMMIT_COUNT = new AtomicInteger(0);","path":"clients/src/test/java/org/apache/kafka/test/MockConsumerInterceptor.java","position":38,"original_position":38,"commit_id":"b72cd671790e0a51e1022319a5c3e2b42f812fd1","original_commit_id":"73fd72894ca694d9120ff1cec640ca78fe397211","user":{"login":"ijuma","id":24747,"avatar_url":"https://avatars.githubusercontent.com/u/24747?v=3","gravatar_id":"","url":"https://api.github.com/users/ijuma","html_url":"https://github.com/ijuma","followers_url":"https://api.github.com/users/ijuma/followers","following_url":"https://api.github.com/users/ijuma/following{/other_user}","gists_url":"https://api.github.com/users/ijuma/gists{/gist_id}","starred_url":"https://api.github.com/users/ijuma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ijuma/subscriptions","organizations_url":"https://api.github.com/users/ijuma/orgs","repos_url":"https://api.github.com/users/ijuma/repos","events_url":"https://api.github.com/users/ijuma/events{/privacy}","received_events_url":"https://api.github.com/users/ijuma/received_events","type":"User","site_admin":false},"body":"I'm a bit uneasy about mutable static variables. It means that separate tests that run in the same JVM affect each other.","created_at":"2016-02-04T21:46:26Z","updated_at":"2016-02-04T21:46:26Z","html_url":"https://github.com/apache/kafka/pull/854#discussion_r51942872","pull_request_url":"https://api.github.com/repos/apache/kafka/pulls/854","_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments/51942872"},"html":{"href":"https://github.com/apache/kafka/pull/854#discussion_r51942872"},"pull_request":{"href":"https://api.github.com/repos/apache/kafka/pulls/854"}}},"pull_request":{"url":"https://api.github.com/repos/apache/kafka/pulls/854","id":58076605,"html_url":"https://github.com/apache/kafka/pull/854","diff_url":"https://github.com/apache/kafka/pull/854.diff","patch_url":"https://github.com/apache/kafka/pull/854.patch","issue_url":"https://api.github.com/repos/apache/kafka/issues/854","number":854,"state":"open","locked":false,"title":"KAFKA-3162: Added producer and consumer interceptors","user":{"login":"apovzner","id":5383840,"avatar_url":"https://avatars.githubusercontent.com/u/5383840?v=3","gravatar_id":"","url":"https://api.github.com/users/apovzner","html_url":"https://github.com/apovzner","followers_url":"https://api.github.com/users/apovzner/followers","following_url":"https://api.github.com/users/apovzner/following{/other_user}","gists_url":"https://api.github.com/users/apovzner/gists{/gist_id}","starred_url":"https://api.github.com/users/apovzner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apovzner/subscriptions","organizations_url":"https://api.github.com/users/apovzner/orgs","repos_url":"https://api.github.com/users/apovzner/repos","events_url":"https://api.github.com/users/apovzner/events{/privacy}","received_events_url":"https://api.github.com/users/apovzner/received_events","type":"User","site_admin":false},"body":"This is the most of the KIP-42: Producer and consumer interceptor. (Except exposing CRC and record sizes to the interceptor, which is coming as a separate PR; tracked by KAFKA-3196).\r\n\r\nThis PR includes:\r\n1. Add ProducerInterceptor interface and call its callbacks from appropriate places in Kafka Producer.\r\n2. Add ConsumerInterceptor interface and call its callbacks from appropriate places in Kafka Consumer.\r\n3. Add unit tests for interceptor changes\r\n4. Add integration test for both mutable consumer and producer interceptors.","created_at":"2016-02-03T01:04:19Z","updated_at":"2016-02-04T21:46:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bd5398f64960fc09e28ecf9838ec72f42a89b9e7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/kafka/pulls/854/commits","review_comments_url":"https://api.github.com/repos/apache/kafka/pulls/854/comments","review_comment_url":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/kafka/issues/854/comments","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/b72cd671790e0a51e1022319a5c3e2b42f812fd1","head":{"label":"apovzner:kip42","ref":"kip42","sha":"b72cd671790e0a51e1022319a5c3e2b42f812fd1","user":{"login":"apovzner","id":5383840,"avatar_url":"https://avatars.githubusercontent.com/u/5383840?v=3","gravatar_id":"","url":"https://api.github.com/users/apovzner","html_url":"https://github.com/apovzner","followers_url":"https://api.github.com/users/apovzner/followers","following_url":"https://api.github.com/users/apovzner/following{/other_user}","gists_url":"https://api.github.com/users/apovzner/gists{/gist_id}","starred_url":"https://api.github.com/users/apovzner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apovzner/subscriptions","organizations_url":"https://api.github.com/users/apovzner/orgs","repos_url":"https://api.github.com/users/apovzner/repos","events_url":"https://api.github.com/users/apovzner/events{/privacy}","received_events_url":"https://api.github.com/users/apovzner/received_events","type":"User","site_admin":false},"repo":{"id":44782457,"name":"kafka","full_name":"apovzner/kafka","owner":{"login":"apovzner","id":5383840,"avatar_url":"https://avatars.githubusercontent.com/u/5383840?v=3","gravatar_id":"","url":"https://api.github.com/users/apovzner","html_url":"https://github.com/apovzner","followers_url":"https://api.github.com/users/apovzner/followers","following_url":"https://api.github.com/users/apovzner/following{/other_user}","gists_url":"https://api.github.com/users/apovzner/gists{/gist_id}","starred_url":"https://api.github.com/users/apovzner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apovzner/subscriptions","organizations_url":"https://api.github.com/users/apovzner/orgs","repos_url":"https://api.github.com/users/apovzner/repos","events_url":"https://api.github.com/users/apovzner/events{/privacy}","received_events_url":"https://api.github.com/users/apovzner/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/apovzner/kafka","description":"Mirror of Apache Kafka","fork":true,"url":"https://api.github.com/repos/apovzner/kafka","forks_url":"https://api.github.com/repos/apovzner/kafka/forks","keys_url":"https://api.github.com/repos/apovzner/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apovzner/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apovzner/kafka/teams","hooks_url":"https://api.github.com/repos/apovzner/kafka/hooks","issue_events_url":"https://api.github.com/repos/apovzner/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/apovzner/kafka/events","assignees_url":"https://api.github.com/repos/apovzner/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/apovzner/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/apovzner/kafka/tags","blobs_url":"https://api.github.com/repos/apovzner/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apovzner/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apovzner/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/apovzner/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apovzner/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/apovzner/kafka/languages","stargazers_url":"https://api.github.com/repos/apovzner/kafka/stargazers","contributors_url":"https://api.github.com/repos/apovzner/kafka/contributors","subscribers_url":"https://api.github.com/repos/apovzner/kafka/subscribers","subscription_url":"https://api.github.com/repos/apovzner/kafka/subscription","commits_url":"https://api.github.com/repos/apovzner/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/apovzner/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/apovzner/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/apovzner/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/apovzner/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/apovzner/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apovzner/kafka/merges","archive_url":"https://api.github.com/repos/apovzner/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apovzner/kafka/downloads","issues_url":"https://api.github.com/repos/apovzner/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/apovzner/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/apovzner/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/apovzner/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apovzner/kafka/labels{/name}","releases_url":"https://api.github.com/repos/apovzner/kafka/releases{/id}","deployments_url":"https://api.github.com/repos/apovzner/kafka/deployments","created_at":"2015-10-23T01:03:29Z","updated_at":"2015-10-23T01:03:34Z","pushed_at":"2016-02-04T21:40:00Z","git_url":"git://github.com/apovzner/kafka.git","ssh_url":"git@github.com:apovzner/kafka.git","clone_url":"https://github.com/apovzner/kafka.git","svn_url":"https://github.com/apovzner/kafka","homepage":null,"size":27012,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"trunk"}},"base":{"label":"apache:trunk","ref":"trunk","sha":"d3ff902d6023eff257653a5dfb31f4e482204c44","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}","deployments_url":"https://api.github.com/repos/apache/kafka/deployments","created_at":"2011-08-15T18:06:16Z","updated_at":"2016-02-04T19:28:57Z","pushed_at":"2016-02-04T21:40:00Z","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":34705,"stargazers_count":2603,"watchers_count":2603,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1548,"mirror_url":"git://git.apache.org/kafka.git","open_issues_count":122,"forks":1548,"open_issues":122,"watchers":2603,"default_branch":"trunk"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/854"},"html":{"href":"https://github.com/apache/kafka/pull/854"},"issue":{"href":"https://api.github.com/repos/apache/kafka/issues/854"},"comments":{"href":"https://api.github.com/repos/apache/kafka/issues/854/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/kafka/pulls/854/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/kafka/pulls/854/commits"},"statuses":{"href":"https://api.github.com/repos/apache/kafka/statuses/b72cd671790e0a51e1022319a5c3e2b42f812fd1"}}}}