{"action":"created","comment":{"url":"https://api.github.com/repos/apache/kafka/pulls/comments/93458716","pull_request_review_id":13986203,"id":93458716,"diff_hunk":"@@ -17,12 +17,82 @@\n \n package kafka.tools\n \n-import kafka.consumer.BaseConsumerRecord\n+import java.util\n+import java.util.Properties\n+\n+import kafka.consumer.{BaseConsumerRecord}\n+import kafka.server.{KafkaConfig, KafkaServer}\n+import kafka.tools.MirrorMaker.MirrorMakerNewConsumer\n+import kafka.utils.{CoreUtils, TestUtils}\n+import kafka.zk.ZooKeeperTestHarness\n+import org.apache.kafka.clients.consumer.{ConsumerConfig, KafkaConsumer}\n+import org.apache.kafka.clients.producer.{KafkaProducer, ProducerRecord}\n import org.apache.kafka.common.record.{Record, TimestampType}\n import org.junit.Assert._\n-import org.junit.Test\n+import org.junit.{After, Before, Test}\n+\n+class MirrorMakerTest extends ZooKeeperTestHarness {\n+\n+  private var server1: KafkaServer = null\n+\n+  @Before\n+  override def setUp() {\n+    super.setUp()\n+    val props1 = TestUtils.createBrokerConfig(0, zkConnect, false)\n+    val config1 = KafkaConfig.fromProps(props1)\n+    server1 = TestUtils.createServer(config1)\n \n-class MirrorMakerTest {\n+    val topic = \"new-topic\"\n+    TestUtils.createTopic(zkUtils, topic, numPartitions = 1, replicationFactor = 1, servers = List(server1))\n+  }\n+\n+  @After\n+  override def tearDown() {\n+    server1.shutdown\n+    CoreUtils.delete(server1.config.logDirs)\n+    super.tearDown()\n+  }\n+\n+  @Test\n+  def testWhitelistTopic() {\n+    val topic = \"new-topic\"\n+    val msg = \"test message\"\n+    val brokerList = TestUtils.getBrokerListStrFromServers(Seq(server1))\n+\n+    // Create a test producer to delivery a message\n+    val props = new Properties()\n+    props.put(\"bootstrap.servers\", brokerList)\n+    props.put(\"key.serializer\", \"org.apache.kafka.common.serialization.ByteArraySerializer\")\n+    props.put(\"value.serializer\", \"org.apache.kafka.common.serialization.ByteArraySerializer\")","path":"core/src/test/scala/unit/kafka/tools/MirrorMakerTest.scala","position":53,"original_position":53,"commit_id":"f6c570dbfe2914b09eaaedfeda76814f4214b0e0","original_commit_id":"f6c570dbfe2914b09eaaedfeda76814f4214b0e0","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":"Instead of setting the serializers like this, you can just pass them to the `KafkaProducer` constructor.","created_at":"2016-12-21T15:28:53Z","updated_at":"2016-12-21T15:28:53Z","html_url":"https://github.com/apache/kafka/pull/2072#discussion_r93458716","pull_request_url":"https://api.github.com/repos/apache/kafka/pulls/2072","_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments/93458716"},"html":{"href":"https://github.com/apache/kafka/pull/2072#discussion_r93458716"},"pull_request":{"href":"https://api.github.com/repos/apache/kafka/pulls/2072"}}},"pull_request":{"url":"https://api.github.com/repos/apache/kafka/pulls/2072","id":91326604,"html_url":"https://github.com/apache/kafka/pull/2072","diff_url":"https://github.com/apache/kafka/pull/2072.diff","patch_url":"https://github.com/apache/kafka/pull/2072.patch","issue_url":"https://api.github.com/repos/apache/kafka/issues/2072","number":2072,"state":"open","locked":false,"title":"Kafka-4351: Topic regex behavioral change with MirrorMaker new consumer","user":{"login":"amethystic","id":11549429,"avatar_url":"https://avatars.githubusercontent.com/u/11549429?v=3","gravatar_id":"","url":"https://api.github.com/users/amethystic","html_url":"https://github.com/amethystic","followers_url":"https://api.github.com/users/amethystic/followers","following_url":"https://api.github.com/users/amethystic/following{/other_user}","gists_url":"https://api.github.com/users/amethystic/gists{/gist_id}","starred_url":"https://api.github.com/users/amethystic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amethystic/subscriptions","organizations_url":"https://api.github.com/users/amethystic/orgs","repos_url":"https://api.github.com/users/amethystic/repos","events_url":"https://api.github.com/users/amethystic/events{/privacy}","received_events_url":"https://api.github.com/users/amethystic/received_events","type":"User","site_admin":false},"body":"Support CSV values in the regexp for MirrorMaker new consumer as OldConsumer does.\n","created_at":"2016-10-28T06:02:47Z","updated_at":"2016-12-21T15:37:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aae9c776cb351e0a160b8ffa8b792ac61b11ae42","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/kafka/pulls/2072/commits","review_comments_url":"https://api.github.com/repos/apache/kafka/pulls/2072/comments","review_comment_url":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/kafka/issues/2072/comments","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/f6c570dbfe2914b09eaaedfeda76814f4214b0e0","head":{"label":"amethystic:kafka-4351_Regex_behavior_change_for_new_consumer","ref":"kafka-4351_Regex_behavior_change_for_new_consumer","sha":"f6c570dbfe2914b09eaaedfeda76814f4214b0e0","user":{"login":"amethystic","id":11549429,"avatar_url":"https://avatars.githubusercontent.com/u/11549429?v=3","gravatar_id":"","url":"https://api.github.com/users/amethystic","html_url":"https://github.com/amethystic","followers_url":"https://api.github.com/users/amethystic/followers","following_url":"https://api.github.com/users/amethystic/following{/other_user}","gists_url":"https://api.github.com/users/amethystic/gists{/gist_id}","starred_url":"https://api.github.com/users/amethystic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amethystic/subscriptions","organizations_url":"https://api.github.com/users/amethystic/orgs","repos_url":"https://api.github.com/users/amethystic/repos","events_url":"https://api.github.com/users/amethystic/events{/privacy}","received_events_url":"https://api.github.com/users/amethystic/received_events","type":"User","site_admin":false},"repo":{"id":70579257,"name":"kafka","full_name":"amethystic/kafka","owner":{"login":"amethystic","id":11549429,"avatar_url":"https://avatars.githubusercontent.com/u/11549429?v=3","gravatar_id":"","url":"https://api.github.com/users/amethystic","html_url":"https://github.com/amethystic","followers_url":"https://api.github.com/users/amethystic/followers","following_url":"https://api.github.com/users/amethystic/following{/other_user}","gists_url":"https://api.github.com/users/amethystic/gists{/gist_id}","starred_url":"https://api.github.com/users/amethystic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amethystic/subscriptions","organizations_url":"https://api.github.com/users/amethystic/orgs","repos_url":"https://api.github.com/users/amethystic/repos","events_url":"https://api.github.com/users/amethystic/events{/privacy}","received_events_url":"https://api.github.com/users/amethystic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/amethystic/kafka","description":"Mirror of Apache Kafka","fork":true,"url":"https://api.github.com/repos/amethystic/kafka","forks_url":"https://api.github.com/repos/amethystic/kafka/forks","keys_url":"https://api.github.com/repos/amethystic/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amethystic/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amethystic/kafka/teams","hooks_url":"https://api.github.com/repos/amethystic/kafka/hooks","issue_events_url":"https://api.github.com/repos/amethystic/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/amethystic/kafka/events","assignees_url":"https://api.github.com/repos/amethystic/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/amethystic/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/amethystic/kafka/tags","blobs_url":"https://api.github.com/repos/amethystic/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amethystic/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amethystic/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/amethystic/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amethystic/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/amethystic/kafka/languages","stargazers_url":"https://api.github.com/repos/amethystic/kafka/stargazers","contributors_url":"https://api.github.com/repos/amethystic/kafka/contributors","subscribers_url":"https://api.github.com/repos/amethystic/kafka/subscribers","subscription_url":"https://api.github.com/repos/amethystic/kafka/subscription","commits_url":"https://api.github.com/repos/amethystic/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/amethystic/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/amethystic/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/amethystic/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/amethystic/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/amethystic/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amethystic/kafka/merges","archive_url":"https://api.github.com/repos/amethystic/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amethystic/kafka/downloads","issues_url":"https://api.github.com/repos/amethystic/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/amethystic/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/amethystic/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/amethystic/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amethystic/kafka/labels{/name}","releases_url":"https://api.github.com/repos/amethystic/kafka/releases{/id}","deployments_url":"https://api.github.com/repos/amethystic/kafka/deployments","created_at":"2016-10-11T09:48:09Z","updated_at":"2016-10-24T01:12:46Z","pushed_at":"2016-12-21T10:27:37Z","git_url":"git://github.com/amethystic/kafka.git","ssh_url":"git@github.com:amethystic/kafka.git","clone_url":"https://github.com/amethystic/kafka.git","svn_url":"https://github.com/amethystic/kafka","homepage":"","size":38003,"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":"21d7e6f19bd36a7ad16291294fc933f9abfac9b7","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-12-21T13:21:02Z","pushed_at":"2016-12-21T14:41:30Z","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":38109,"stargazers_count":4316,"watchers_count":4316,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2681,"mirror_url":"git://git.apache.org/kafka.git","open_issues_count":302,"forks":2681,"open_issues":302,"watchers":4316,"default_branch":"trunk"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/2072"},"html":{"href":"https://github.com/apache/kafka/pull/2072"},"issue":{"href":"https://api.github.com/repos/apache/kafka/issues/2072"},"comments":{"href":"https://api.github.com/repos/apache/kafka/issues/2072/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/kafka/pulls/2072/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/kafka/pulls/2072/commits"},"statuses":{"href":"https://api.github.com/repos/apache/kafka/statuses/f6c570dbfe2914b09eaaedfeda76814f4214b0e0"}}}}
{"actor":{"display_login":"ijuma"}}