{"action":"created","comment":{"url":"https://api.github.com/repos/apache/kafka/pulls/comments/77408168","id":77408168,"diff_hunk":"@@ -252,5 +573,72 @@ private void waitUntilAtLeastOneRecordProcessed() throws InterruptedException {\n         return Collections.emptySet();\n     }\n \n+    private Map<String, Long> fetchMap(final ReadOnlyWindowStore<String, Long> store,\n+                                       final String key) {\n+\n+        final WindowStoreIterator<Long> fetch = store.fetch(key, 0, System.currentTimeMillis());\n+        if (fetch.hasNext()) {\n+            KeyValue<Long, Long> next = fetch.next();\n+            return Collections.singletonMap(key, next.value);\n+        }\n+        return Collections.emptyMap();\n+    }\n+\n+\n+    /**\n+     * A class that periodically produces records in a separate thread\n+     */\n+    private class ProducerRunnable implements Runnable {\n+        private String topic;\n+        private final List<String> inputValues;\n+        private final int numIterations;\n+        private int currIteration = 0;\n+        boolean shutdown = false;\n+        private final Random random = new Random();\n+\n+        ProducerRunnable(String topic, List<String> inputValues, int numIterations) {\n+            this.topic = topic;\n+            this.inputValues = inputValues;\n+            this.numIterations = numIterations;\n+        }\n+\n+        public synchronized void incrementInteration() {\n+            currIteration++;\n+        }\n+        public synchronized int getCurrIteration() {\n+            return currIteration;\n+        }\n+        public synchronized void shutdown() {\n+            shutdown = true;\n+        }\n+\n+        @Override\n+        public void run() {\n+            Properties producerConfig = new Properties();\n+            producerConfig.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, CLUSTER.bootstrapServers());\n+            producerConfig.put(ProducerConfig.ACKS_CONFIG, \"all\");\n+            producerConfig.put(ProducerConfig.RETRIES_CONFIG, 0);\n+            producerConfig.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);\n+            producerConfig.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class);\n+\n+            final KafkaProducer<String, String>\n+                producer =\n+                new KafkaProducer<>(producerConfig, new StringSerializer(), new StringSerializer());\n+\n+            try {\n+                while (getCurrIteration() < numIterations && !shutdown) {\n+                    for (int i = 0; i < inputValues.size(); i++) {\n+                        producer.send(new ProducerRecord<>(topic,","path":"streams/src/test/java/org/apache/kafka/streams/integration/QueryableStateIntegrationTest.java","position":514,"original_position":514,"commit_id":"2bd175b51054529e7333b02a66efb973adfa0243","original_commit_id":"2bd175b51054529e7333b02a66efb973adfa0243","user":{"login":"guozhangwang","id":10729597,"avatar_url":"https://avatars.githubusercontent.com/u/10729597?v=3","gravatar_id":"","url":"https://api.github.com/users/guozhangwang","html_url":"https://github.com/guozhangwang","followers_url":"https://api.github.com/users/guozhangwang/followers","following_url":"https://api.github.com/users/guozhangwang/following{/other_user}","gists_url":"https://api.github.com/users/guozhangwang/gists{/gist_id}","starred_url":"https://api.github.com/users/guozhangwang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guozhangwang/subscriptions","organizations_url":"https://api.github.com/users/guozhangwang/orgs","repos_url":"https://api.github.com/users/guozhangwang/repos","events_url":"https://api.github.com/users/guozhangwang/events{/privacy}","received_events_url":"https://api.github.com/users/guozhangwang/received_events","type":"User","site_admin":false},"body":"We do not need to set the key since it can be null: \r\n\r\n```\r\n    public ProducerRecord(String topic, V value) {\r\n        this(topic, null, null, null, value);\r\n    }\r\n```","created_at":"2016-09-02T20:36:31Z","updated_at":"2016-09-02T20:36:31Z","html_url":"https://github.com/apache/kafka/pull/1806#discussion_r77408168","pull_request_url":"https://api.github.com/repos/apache/kafka/pulls/1806","_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments/77408168"},"html":{"href":"https://github.com/apache/kafka/pull/1806#discussion_r77408168"},"pull_request":{"href":"https://api.github.com/repos/apache/kafka/pulls/1806"}}},"pull_request":{"url":"https://api.github.com/repos/apache/kafka/pulls/1806","id":83478854,"html_url":"https://github.com/apache/kafka/pull/1806","diff_url":"https://github.com/apache/kafka/pull/1806.diff","patch_url":"https://github.com/apache/kafka/pull/1806.patch","issue_url":"https://api.github.com/repos/apache/kafka/issues/1806","number":1806,"state":"open","locked":false,"title":"KAFKA-4105: Queryable state tests","user":{"login":"enothereska","id":14234336,"avatar_url":"https://avatars.githubusercontent.com/u/14234336?v=3","gravatar_id":"","url":"https://api.github.com/users/enothereska","html_url":"https://github.com/enothereska","followers_url":"https://api.github.com/users/enothereska/followers","following_url":"https://api.github.com/users/enothereska/following{/other_user}","gists_url":"https://api.github.com/users/enothereska/gists{/gist_id}","starred_url":"https://api.github.com/users/enothereska/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enothereska/subscriptions","organizations_url":"https://api.github.com/users/enothereska/orgs","repos_url":"https://api.github.com/users/enothereska/repos","events_url":"https://api.github.com/users/enothereska/events{/privacy}","received_events_url":"https://api.github.com/users/enothereska/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-31T15:48:27Z","updated_at":"2016-09-02T20:36:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"97f80b6184f828417a7c34d568994a4960734d42","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/kafka/pulls/1806/commits","review_comments_url":"https://api.github.com/repos/apache/kafka/pulls/1806/comments","review_comment_url":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/kafka/issues/1806/comments","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/2bd175b51054529e7333b02a66efb973adfa0243","head":{"label":"enothereska:queryable-state-tests","ref":"queryable-state-tests","sha":"2bd175b51054529e7333b02a66efb973adfa0243","user":{"login":"enothereska","id":14234336,"avatar_url":"https://avatars.githubusercontent.com/u/14234336?v=3","gravatar_id":"","url":"https://api.github.com/users/enothereska","html_url":"https://github.com/enothereska","followers_url":"https://api.github.com/users/enothereska/followers","following_url":"https://api.github.com/users/enothereska/following{/other_user}","gists_url":"https://api.github.com/users/enothereska/gists{/gist_id}","starred_url":"https://api.github.com/users/enothereska/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enothereska/subscriptions","organizations_url":"https://api.github.com/users/enothereska/orgs","repos_url":"https://api.github.com/users/enothereska/repos","events_url":"https://api.github.com/users/enothereska/events{/privacy}","received_events_url":"https://api.github.com/users/enothereska/received_events","type":"User","site_admin":false},"repo":{"id":44994140,"name":"kafka","full_name":"enothereska/kafka","owner":{"login":"enothereska","id":14234336,"avatar_url":"https://avatars.githubusercontent.com/u/14234336?v=3","gravatar_id":"","url":"https://api.github.com/users/enothereska","html_url":"https://github.com/enothereska","followers_url":"https://api.github.com/users/enothereska/followers","following_url":"https://api.github.com/users/enothereska/following{/other_user}","gists_url":"https://api.github.com/users/enothereska/gists{/gist_id}","starred_url":"https://api.github.com/users/enothereska/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enothereska/subscriptions","organizations_url":"https://api.github.com/users/enothereska/orgs","repos_url":"https://api.github.com/users/enothereska/repos","events_url":"https://api.github.com/users/enothereska/events{/privacy}","received_events_url":"https://api.github.com/users/enothereska/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/enothereska/kafka","description":"Mirror of Apache Kafka","fork":true,"url":"https://api.github.com/repos/enothereska/kafka","forks_url":"https://api.github.com/repos/enothereska/kafka/forks","keys_url":"https://api.github.com/repos/enothereska/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/enothereska/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/enothereska/kafka/teams","hooks_url":"https://api.github.com/repos/enothereska/kafka/hooks","issue_events_url":"https://api.github.com/repos/enothereska/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/enothereska/kafka/events","assignees_url":"https://api.github.com/repos/enothereska/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/enothereska/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/enothereska/kafka/tags","blobs_url":"https://api.github.com/repos/enothereska/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/enothereska/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/enothereska/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/enothereska/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/enothereska/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/enothereska/kafka/languages","stargazers_url":"https://api.github.com/repos/enothereska/kafka/stargazers","contributors_url":"https://api.github.com/repos/enothereska/kafka/contributors","subscribers_url":"https://api.github.com/repos/enothereska/kafka/subscribers","subscription_url":"https://api.github.com/repos/enothereska/kafka/subscription","commits_url":"https://api.github.com/repos/enothereska/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/enothereska/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/enothereska/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/enothereska/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/enothereska/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/enothereska/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/enothereska/kafka/merges","archive_url":"https://api.github.com/repos/enothereska/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/enothereska/kafka/downloads","issues_url":"https://api.github.com/repos/enothereska/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/enothereska/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/enothereska/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/enothereska/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/enothereska/kafka/labels{/name}","releases_url":"https://api.github.com/repos/enothereska/kafka/releases{/id}","deployments_url":"https://api.github.com/repos/enothereska/kafka/deployments","created_at":"2015-10-26T20:08:13Z","updated_at":"2016-01-28T16:05:20Z","pushed_at":"2016-09-02T17:27:15Z","git_url":"git://github.com/enothereska/kafka.git","ssh_url":"git@github.com:enothereska/kafka.git","clone_url":"https://github.com/enothereska/kafka.git","svn_url":"https://github.com/enothereska/kafka","homepage":null,"size":32044,"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":"8f3462552fa4d6a6d70a837c2ef7439bba512657","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-09-02T11:11:15Z","pushed_at":"2016-09-02T20:26:25Z","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":46751,"stargazers_count":3699,"watchers_count":3699,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2295,"mirror_url":"git://git.apache.org/kafka.git","open_issues_count":247,"forks":2295,"open_issues":247,"watchers":3699,"default_branch":"trunk"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/1806"},"html":{"href":"https://github.com/apache/kafka/pull/1806"},"issue":{"href":"https://api.github.com/repos/apache/kafka/issues/1806"},"comments":{"href":"https://api.github.com/repos/apache/kafka/issues/1806/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/kafka/pulls/1806/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/kafka/pulls/1806/commits"},"statuses":{"href":"https://api.github.com/repos/apache/kafka/statuses/2bd175b51054529e7333b02a66efb973adfa0243"}}}}
{"actor":{"display_login":"guozhangwang"}}