{"action":"created","comment":{"url":"https://api.github.com/repos/linkedin/pinot/pulls/comments/77205132","id":77205132,"diff_hunk":"@@ -0,0 +1,206 @@\n+/**\n+ * Copyright (C) 2014-2016 LinkedIn Corp. (pinot-core@linkedin.com)\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * 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 com.linkedin.pinot.core.realtime.kafka;\n+\n+import com.google.common.base.Preconditions;\n+import com.linkedin.pinot.core.realtime.impl.kafka.KafkaSimpleConsumerFactory;\n+import com.linkedin.pinot.core.realtime.impl.kafka.SimpleConsumerWrapper;\n+import java.util.Collections;\n+import java.util.HashMap;\n+import kafka.api.FetchRequest;\n+import kafka.api.PartitionFetchInfo;\n+import kafka.api.PartitionMetadata;\n+import kafka.api.TopicMetadata;\n+import kafka.cluster.Broker;\n+import kafka.common.TopicAndPartition;\n+import kafka.javaapi.FetchResponse;\n+import kafka.javaapi.TopicMetadataRequest;\n+import kafka.javaapi.TopicMetadataResponse;\n+import kafka.javaapi.consumer.SimpleConsumer;\n+import kafka.javaapi.message.ByteBufferMessageSet;\n+import kafka.message.Message;\n+import org.apache.kafka.common.protocol.Errors;\n+import org.testng.annotations.Test;\n+import scala.Some;\n+import scala.Tuple2;\n+import scala.collection.Seq;\n+import scala.collection.immutable.List;\n+\n+import static org.testng.Assert.assertEquals;\n+\n+\n+/**\n+ * Tests for the SimpleConsumerWrapper.\n+ */\n+public class SimpleConsumerWrapperTest {\n+  public class MockKafkaSimpleConsumerFactory implements KafkaSimpleConsumerFactory {\n+    public MockKafkaSimpleConsumerFactory(String[] hosts, int[] ports, long[] partitionStartOffsets,\n+        long[] partitionEndOffsets, int[] partitionLeaderIndices, String topicName) {\n+      Preconditions.checkArgument(hosts.length == ports.length);","path":"pinot-core/src/test/java/com/linkedin/pinot/core/realtime/kafka/SimpleConsumerWrapperTest.java","position":53,"original_position":53,"commit_id":"1cc4d03dec01dad07e613daae5d8cb284db58673","original_commit_id":"1cc4d03dec01dad07e613daae5d8cb284db58673","user":{"login":"mcvsubbu","id":2279037,"avatar_url":"https://avatars.githubusercontent.com/u/2279037?v=3","gravatar_id":"","url":"https://api.github.com/users/mcvsubbu","html_url":"https://github.com/mcvsubbu","followers_url":"https://api.github.com/users/mcvsubbu/followers","following_url":"https://api.github.com/users/mcvsubbu/following{/other_user}","gists_url":"https://api.github.com/users/mcvsubbu/gists{/gist_id}","starred_url":"https://api.github.com/users/mcvsubbu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcvsubbu/subscriptions","organizations_url":"https://api.github.com/users/mcvsubbu/orgs","repos_url":"https://api.github.com/users/mcvsubbu/repos","events_url":"https://api.github.com/users/mcvsubbu/events{/privacy}","received_events_url":"https://api.github.com/users/mcvsubbu/received_events","type":"User","site_admin":false},"body":"you could even use Assert instead of Preconditions.check() ? anyone using these mock objects should conform to what it implements ...","created_at":"2016-09-01T16:12:34Z","updated_at":"2016-09-01T16:12:34Z","html_url":"https://github.com/linkedin/pinot/pull/479#discussion_r77205132","pull_request_url":"https://api.github.com/repos/linkedin/pinot/pulls/479","_links":{"self":{"href":"https://api.github.com/repos/linkedin/pinot/pulls/comments/77205132"},"html":{"href":"https://github.com/linkedin/pinot/pull/479#discussion_r77205132"},"pull_request":{"href":"https://api.github.com/repos/linkedin/pinot/pulls/479"}}},"pull_request":{"url":"https://api.github.com/repos/linkedin/pinot/pulls/479","id":83600574,"html_url":"https://github.com/linkedin/pinot/pull/479","diff_url":"https://github.com/linkedin/pinot/pull/479.diff","patch_url":"https://github.com/linkedin/pinot/pull/479.patch","issue_url":"https://api.github.com/repos/linkedin/pinot/issues/479","number":479,"state":"open","locked":false,"title":"SimpleConsumerWrapper test WIP","user":{"login":"jfim","id":246807,"avatar_url":"https://avatars.githubusercontent.com/u/246807?v=3","gravatar_id":"","url":"https://api.github.com/users/jfim","html_url":"https://github.com/jfim","followers_url":"https://api.github.com/users/jfim/followers","following_url":"https://api.github.com/users/jfim/following{/other_user}","gists_url":"https://api.github.com/users/jfim/gists{/gist_id}","starred_url":"https://api.github.com/users/jfim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfim/subscriptions","organizations_url":"https://api.github.com/users/jfim/orgs","repos_url":"https://api.github.com/users/jfim/repos","events_url":"https://api.github.com/users/jfim/events{/privacy}","received_events_url":"https://api.github.com/users/jfim/received_events","type":"User","site_admin":false},"body":null,"created_at":"2016-09-01T09:40:46Z","updated_at":"2016-09-01T16:12:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"20e4bf4bf011b8d6c31395a65ae6a888c51b9c8c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/linkedin/pinot/pulls/479/commits","review_comments_url":"https://api.github.com/repos/linkedin/pinot/pulls/479/comments","review_comment_url":"https://api.github.com/repos/linkedin/pinot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/linkedin/pinot/issues/479/comments","statuses_url":"https://api.github.com/repos/linkedin/pinot/statuses/1cc4d03dec01dad07e613daae5d8cb284db58673","head":{"label":"linkedin:simple-consumer-wrapper-unit-test","ref":"simple-consumer-wrapper-unit-test","sha":"1cc4d03dec01dad07e613daae5d8cb284db58673","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":19961085,"name":"pinot","full_name":"linkedin/pinot","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/pinot","description":"A realtime distributed OLAP datastore","fork":false,"url":"https://api.github.com/repos/linkedin/pinot","forks_url":"https://api.github.com/repos/linkedin/pinot/forks","keys_url":"https://api.github.com/repos/linkedin/pinot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/linkedin/pinot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/linkedin/pinot/teams","hooks_url":"https://api.github.com/repos/linkedin/pinot/hooks","issue_events_url":"https://api.github.com/repos/linkedin/pinot/issues/events{/number}","events_url":"https://api.github.com/repos/linkedin/pinot/events","assignees_url":"https://api.github.com/repos/linkedin/pinot/assignees{/user}","branches_url":"https://api.github.com/repos/linkedin/pinot/branches{/branch}","tags_url":"https://api.github.com/repos/linkedin/pinot/tags","blobs_url":"https://api.github.com/repos/linkedin/pinot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/linkedin/pinot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/linkedin/pinot/git/refs{/sha}","trees_url":"https://api.github.com/repos/linkedin/pinot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/linkedin/pinot/statuses/{sha}","languages_url":"https://api.github.com/repos/linkedin/pinot/languages","stargazers_url":"https://api.github.com/repos/linkedin/pinot/stargazers","contributors_url":"https://api.github.com/repos/linkedin/pinot/contributors","subscribers_url":"https://api.github.com/repos/linkedin/pinot/subscribers","subscription_url":"https://api.github.com/repos/linkedin/pinot/subscription","commits_url":"https://api.github.com/repos/linkedin/pinot/commits{/sha}","git_commits_url":"https://api.github.com/repos/linkedin/pinot/git/commits{/sha}","comments_url":"https://api.github.com/repos/linkedin/pinot/comments{/number}","issue_comment_url":"https://api.github.com/repos/linkedin/pinot/issues/comments{/number}","contents_url":"https://api.github.com/repos/linkedin/pinot/contents/{+path}","compare_url":"https://api.github.com/repos/linkedin/pinot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/linkedin/pinot/merges","archive_url":"https://api.github.com/repos/linkedin/pinot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/linkedin/pinot/downloads","issues_url":"https://api.github.com/repos/linkedin/pinot/issues{/number}","pulls_url":"https://api.github.com/repos/linkedin/pinot/pulls{/number}","milestones_url":"https://api.github.com/repos/linkedin/pinot/milestones{/number}","notifications_url":"https://api.github.com/repos/linkedin/pinot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/linkedin/pinot/labels{/name}","releases_url":"https://api.github.com/repos/linkedin/pinot/releases{/id}","deployments_url":"https://api.github.com/repos/linkedin/pinot/deployments","created_at":"2014-05-19T23:27:48Z","updated_at":"2016-09-01T01:53:22Z","pushed_at":"2016-09-01T09:40:46Z","git_url":"git://github.com/linkedin/pinot.git","ssh_url":"git@github.com:linkedin/pinot.git","clone_url":"https://github.com/linkedin/pinot.git","svn_url":"https://github.com/linkedin/pinot","homepage":"https://github.com/linkedin/pinot/wiki","size":143287,"stargazers_count":1336,"watchers_count":1336,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":217,"mirror_url":null,"open_issues_count":75,"forks":217,"open_issues":75,"watchers":1336,"default_branch":"master"}},"base":{"label":"linkedin:master","ref":"master","sha":"8920e3ee299c4e098b782d670a899169bc956184","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":19961085,"name":"pinot","full_name":"linkedin/pinot","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/pinot","description":"A realtime distributed OLAP datastore","fork":false,"url":"https://api.github.com/repos/linkedin/pinot","forks_url":"https://api.github.com/repos/linkedin/pinot/forks","keys_url":"https://api.github.com/repos/linkedin/pinot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/linkedin/pinot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/linkedin/pinot/teams","hooks_url":"https://api.github.com/repos/linkedin/pinot/hooks","issue_events_url":"https://api.github.com/repos/linkedin/pinot/issues/events{/number}","events_url":"https://api.github.com/repos/linkedin/pinot/events","assignees_url":"https://api.github.com/repos/linkedin/pinot/assignees{/user}","branches_url":"https://api.github.com/repos/linkedin/pinot/branches{/branch}","tags_url":"https://api.github.com/repos/linkedin/pinot/tags","blobs_url":"https://api.github.com/repos/linkedin/pinot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/linkedin/pinot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/linkedin/pinot/git/refs{/sha}","trees_url":"https://api.github.com/repos/linkedin/pinot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/linkedin/pinot/statuses/{sha}","languages_url":"https://api.github.com/repos/linkedin/pinot/languages","stargazers_url":"https://api.github.com/repos/linkedin/pinot/stargazers","contributors_url":"https://api.github.com/repos/linkedin/pinot/contributors","subscribers_url":"https://api.github.com/repos/linkedin/pinot/subscribers","subscription_url":"https://api.github.com/repos/linkedin/pinot/subscription","commits_url":"https://api.github.com/repos/linkedin/pinot/commits{/sha}","git_commits_url":"https://api.github.com/repos/linkedin/pinot/git/commits{/sha}","comments_url":"https://api.github.com/repos/linkedin/pinot/comments{/number}","issue_comment_url":"https://api.github.com/repos/linkedin/pinot/issues/comments{/number}","contents_url":"https://api.github.com/repos/linkedin/pinot/contents/{+path}","compare_url":"https://api.github.com/repos/linkedin/pinot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/linkedin/pinot/merges","archive_url":"https://api.github.com/repos/linkedin/pinot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/linkedin/pinot/downloads","issues_url":"https://api.github.com/repos/linkedin/pinot/issues{/number}","pulls_url":"https://api.github.com/repos/linkedin/pinot/pulls{/number}","milestones_url":"https://api.github.com/repos/linkedin/pinot/milestones{/number}","notifications_url":"https://api.github.com/repos/linkedin/pinot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/linkedin/pinot/labels{/name}","releases_url":"https://api.github.com/repos/linkedin/pinot/releases{/id}","deployments_url":"https://api.github.com/repos/linkedin/pinot/deployments","created_at":"2014-05-19T23:27:48Z","updated_at":"2016-09-01T01:53:22Z","pushed_at":"2016-09-01T09:40:46Z","git_url":"git://github.com/linkedin/pinot.git","ssh_url":"git@github.com:linkedin/pinot.git","clone_url":"https://github.com/linkedin/pinot.git","svn_url":"https://github.com/linkedin/pinot","homepage":"https://github.com/linkedin/pinot/wiki","size":143287,"stargazers_count":1336,"watchers_count":1336,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":217,"mirror_url":null,"open_issues_count":75,"forks":217,"open_issues":75,"watchers":1336,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/linkedin/pinot/pulls/479"},"html":{"href":"https://github.com/linkedin/pinot/pull/479"},"issue":{"href":"https://api.github.com/repos/linkedin/pinot/issues/479"},"comments":{"href":"https://api.github.com/repos/linkedin/pinot/issues/479/comments"},"review_comments":{"href":"https://api.github.com/repos/linkedin/pinot/pulls/479/comments"},"review_comment":{"href":"https://api.github.com/repos/linkedin/pinot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/linkedin/pinot/pulls/479/commits"},"statuses":{"href":"https://api.github.com/repos/linkedin/pinot/statuses/1cc4d03dec01dad07e613daae5d8cb284db58673"}}}}
{"actor":{"display_login":"mcvsubbu"}}