{"action":"created","comment":{"url":"https://api.github.com/repos/apache/incubator-pulsar/pulls/comments/187523451","pull_request_review_id":119321646,"id":187523451,"diff_hunk":"@@ -61,8 +67,21 @@ public JavaInstance(InstanceConfig config, Object userClassObject,\n         // create the functions\n         if (userClassObject instanceof Function) {\n             this.function = (Function) userClassObject;\n-        } else {\n-            this.javaUtilFunction = (java.util.function.Function) userClassObject;\n+        } else if (userClassObject instanceof java.util.function.Function) {\n+            Class<?>[] typeArgs = TypeResolver.resolveRawArguments(\n+                    java.util.function.Function.class, userClassObject.getClass());\n+            // check if window function\n+            if (typeArgs[0].equals(Collection.class)) {","path":"pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstance.java","position":33,"original_position":33,"commit_id":"aeae38b1add965a2ca79871157bd00da4faef4ed","original_commit_id":"aeae38b1add965a2ca79871157bd00da4faef4ed","user":{"login":"srkukarni","id":2530234,"avatar_url":"https://avatars0.githubusercontent.com/u/2530234?v=4","gravatar_id":"","url":"https://api.github.com/users/srkukarni","html_url":"https://github.com/srkukarni","followers_url":"https://api.github.com/users/srkukarni/followers","following_url":"https://api.github.com/users/srkukarni/following{/other_user}","gists_url":"https://api.github.com/users/srkukarni/gists{/gist_id}","starred_url":"https://api.github.com/users/srkukarni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srkukarni/subscriptions","organizations_url":"https://api.github.com/users/srkukarni/orgs","repos_url":"https://api.github.com/users/srkukarni/repos","events_url":"https://api.github.com/users/srkukarni/events{/privacy}","received_events_url":"https://api.github.com/users/srkukarni/received_events","type":"User","site_admin":false},"body":"I believe this check should be different? We should check if windowConfig is set, then do this.\r\nI could have a regular function that actually takes in a Collection","created_at":"2018-05-11T05:32:43Z","updated_at":"2018-05-11T05:32:43Z","html_url":"https://github.com/apache/incubator-pulsar/pull/1758#discussion_r187523451","pull_request_url":"https://api.github.com/repos/apache/incubator-pulsar/pulls/1758","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-pulsar/pulls/comments/187523451"},"html":{"href":"https://github.com/apache/incubator-pulsar/pull/1758#discussion_r187523451"},"pull_request":{"href":"https://api.github.com/repos/apache/incubator-pulsar/pulls/1758"}}},"pull_request":{"url":"https://api.github.com/repos/apache/incubator-pulsar/pulls/1758","id":187072017,"html_url":"https://github.com/apache/incubator-pulsar/pull/1758","diff_url":"https://github.com/apache/incubator-pulsar/pull/1758.diff","patch_url":"https://github.com/apache/incubator-pulsar/pull/1758.patch","issue_url":"https://api.github.com/repos/apache/incubator-pulsar/issues/1758","number":1758,"state":"open","locked":false,"title":"Windowing for Pulsar Functions","user":{"login":"jerrypeng","id":3613359,"avatar_url":"https://avatars2.githubusercontent.com/u/3613359?v=4","gravatar_id":"","url":"https://api.github.com/users/jerrypeng","html_url":"https://github.com/jerrypeng","followers_url":"https://api.github.com/users/jerrypeng/followers","following_url":"https://api.github.com/users/jerrypeng/following{/other_user}","gists_url":"https://api.github.com/users/jerrypeng/gists{/gist_id}","starred_url":"https://api.github.com/users/jerrypeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jerrypeng/subscriptions","organizations_url":"https://api.github.com/users/jerrypeng/orgs","repos_url":"https://api.github.com/users/jerrypeng/repos","events_url":"https://api.github.com/users/jerrypeng/events{/privacy}","received_events_url":"https://api.github.com/users/jerrypeng/received_events","type":"User","site_admin":false},"body":"@sijie @srkukarni please review","created_at":"2018-05-10T00:16:45Z","updated_at":"2018-05-11T05:32:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"928d777abe4eec7e900bcaf32586908bb6003dc3","assignee":{"login":"jerrypeng","id":3613359,"avatar_url":"https://avatars2.githubusercontent.com/u/3613359?v=4","gravatar_id":"","url":"https://api.github.com/users/jerrypeng","html_url":"https://github.com/jerrypeng","followers_url":"https://api.github.com/users/jerrypeng/followers","following_url":"https://api.github.com/users/jerrypeng/following{/other_user}","gists_url":"https://api.github.com/users/jerrypeng/gists{/gist_id}","starred_url":"https://api.github.com/users/jerrypeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jerrypeng/subscriptions","organizations_url":"https://api.github.com/users/jerrypeng/orgs","repos_url":"https://api.github.com/users/jerrypeng/repos","events_url":"https://api.github.com/users/jerrypeng/events{/privacy}","received_events_url":"https://api.github.com/users/jerrypeng/received_events","type":"User","site_admin":false},"assignees":[{"login":"jerrypeng","id":3613359,"avatar_url":"https://avatars2.githubusercontent.com/u/3613359?v=4","gravatar_id":"","url":"https://api.github.com/users/jerrypeng","html_url":"https://github.com/jerrypeng","followers_url":"https://api.github.com/users/jerrypeng/followers","following_url":"https://api.github.com/users/jerrypeng/following{/other_user}","gists_url":"https://api.github.com/users/jerrypeng/gists{/gist_id}","starred_url":"https://api.github.com/users/jerrypeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jerrypeng/subscriptions","organizations_url":"https://api.github.com/users/jerrypeng/orgs","repos_url":"https://api.github.com/users/jerrypeng/repos","events_url":"https://api.github.com/users/jerrypeng/events{/privacy}","received_events_url":"https://api.github.com/users/jerrypeng/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":853313264,"url":"https://api.github.com/repos/apache/incubator-pulsar/labels/component/functions","name":"component/functions","color":"c2e0c6","default":false}],"milestone":{"url":"https://api.github.com/repos/apache/incubator-pulsar/milestones/13","html_url":"https://github.com/apache/incubator-pulsar/milestone/13","labels_url":"https://api.github.com/repos/apache/incubator-pulsar/milestones/13/labels","id":3118453,"number":13,"title":"2.1.0-incubating","description":"","creator":{"login":"merlimat","id":62500,"avatar_url":"https://avatars2.githubusercontent.com/u/62500?v=4","gravatar_id":"","url":"https://api.github.com/users/merlimat","html_url":"https://github.com/merlimat","followers_url":"https://api.github.com/users/merlimat/followers","following_url":"https://api.github.com/users/merlimat/following{/other_user}","gists_url":"https://api.github.com/users/merlimat/gists{/gist_id}","starred_url":"https://api.github.com/users/merlimat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/merlimat/subscriptions","organizations_url":"https://api.github.com/users/merlimat/orgs","repos_url":"https://api.github.com/users/merlimat/repos","events_url":"https://api.github.com/users/merlimat/events{/privacy}","received_events_url":"https://api.github.com/users/merlimat/received_events","type":"User","site_admin":false},"open_issues":55,"closed_issues":31,"state":"open","created_at":"2018-02-15T04:20:44Z","updated_at":"2018-05-11T05:02:09Z","due_on":"2018-05-31T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/apache/incubator-pulsar/pulls/1758/commits","review_comments_url":"https://api.github.com/repos/apache/incubator-pulsar/pulls/1758/comments","review_comment_url":"https://api.github.com/repos/apache/incubator-pulsar/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/incubator-pulsar/issues/1758/comments","statuses_url":"https://api.github.com/repos/apache/incubator-pulsar/statuses/aeae38b1add965a2ca79871157bd00da4faef4ed","head":{"label":"jerrypeng:windowing","ref":"windowing","sha":"aeae38b1add965a2ca79871157bd00da4faef4ed","user":{"login":"jerrypeng","id":3613359,"avatar_url":"https://avatars2.githubusercontent.com/u/3613359?v=4","gravatar_id":"","url":"https://api.github.com/users/jerrypeng","html_url":"https://github.com/jerrypeng","followers_url":"https://api.github.com/users/jerrypeng/followers","following_url":"https://api.github.com/users/jerrypeng/following{/other_user}","gists_url":"https://api.github.com/users/jerrypeng/gists{/gist_id}","starred_url":"https://api.github.com/users/jerrypeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jerrypeng/subscriptions","organizations_url":"https://api.github.com/users/jerrypeng/orgs","repos_url":"https://api.github.com/users/jerrypeng/repos","events_url":"https://api.github.com/users/jerrypeng/events{/privacy}","received_events_url":"https://api.github.com/users/jerrypeng/received_events","type":"User","site_admin":false},"repo":{"id":108588215,"name":"incubator-pulsar","full_name":"jerrypeng/incubator-pulsar","owner":{"login":"jerrypeng","id":3613359,"avatar_url":"https://avatars2.githubusercontent.com/u/3613359?v=4","gravatar_id":"","url":"https://api.github.com/users/jerrypeng","html_url":"https://github.com/jerrypeng","followers_url":"https://api.github.com/users/jerrypeng/followers","following_url":"https://api.github.com/users/jerrypeng/following{/other_user}","gists_url":"https://api.github.com/users/jerrypeng/gists{/gist_id}","starred_url":"https://api.github.com/users/jerrypeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jerrypeng/subscriptions","organizations_url":"https://api.github.com/users/jerrypeng/orgs","repos_url":"https://api.github.com/users/jerrypeng/repos","events_url":"https://api.github.com/users/jerrypeng/events{/privacy}","received_events_url":"https://api.github.com/users/jerrypeng/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jerrypeng/incubator-pulsar","description":"Pulsar - distributed pub-sub messaging system","fork":true,"url":"https://api.github.com/repos/jerrypeng/incubator-pulsar","forks_url":"https://api.github.com/repos/jerrypeng/incubator-pulsar/forks","keys_url":"https://api.github.com/repos/jerrypeng/incubator-pulsar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jerrypeng/incubator-pulsar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jerrypeng/incubator-pulsar/teams","hooks_url":"https://api.github.com/repos/jerrypeng/incubator-pulsar/hooks","issue_events_url":"https://api.github.com/repos/jerrypeng/incubator-pulsar/issues/events{/number}","events_url":"https://api.github.com/repos/jerrypeng/incubator-pulsar/events","assignees_url":"https://api.github.com/repos/jerrypeng/incubator-pulsar/assignees{/user}","branches_url":"https://api.github.com/repos/jerrypeng/incubator-pulsar/branches{/branch}","tags_url":"https://api.github.com/repos/jerrypeng/incubator-pulsar/tags","blobs_url":"https://api.github.com/repos/jerrypeng/incubator-pulsar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jerrypeng/incubator-pulsar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jerrypeng/incubator-pulsar/git/refs{/sha}","trees_url":"https://api.github.com/repos/jerrypeng/incubator-pulsar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jerrypeng/incubator-pulsar/statuses/{sha}","languages_url":"https://api.github.com/repos/jerrypeng/incubator-pulsar/languages","stargazers_url":"https://api.github.com/repos/jerrypeng/incubator-pulsar/stargazers","contributors_url":"https://api.github.com/repos/jerrypeng/incubator-pulsar/contributors","subscribers_url":"https://api.github.com/repos/jerrypeng/incubator-pulsar/subscribers","subscription_url":"https://api.github.com/repos/jerrypeng/incubator-pulsar/subscription","commits_url":"https://api.github.com/repos/jerrypeng/incubator-pulsar/commits{/sha}","git_commits_url":"https://api.github.com/repos/jerrypeng/incubator-pulsar/git/commits{/sha}","comments_url":"https://api.github.com/repos/jerrypeng/incubator-pulsar/comments{/number}","issue_comment_url":"https://api.github.com/repos/jerrypeng/incubator-pulsar/issues/comments{/number}","contents_url":"https://api.github.com/repos/jerrypeng/incubator-pulsar/contents/{+path}","compare_url":"https://api.github.com/repos/jerrypeng/incubator-pulsar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jerrypeng/incubator-pulsar/merges","archive_url":"https://api.github.com/repos/jerrypeng/incubator-pulsar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jerrypeng/incubator-pulsar/downloads","issues_url":"https://api.github.com/repos/jerrypeng/incubator-pulsar/issues{/number}","pulls_url":"https://api.github.com/repos/jerrypeng/incubator-pulsar/pulls{/number}","milestones_url":"https://api.github.com/repos/jerrypeng/incubator-pulsar/milestones{/number}","notifications_url":"https://api.github.com/repos/jerrypeng/incubator-pulsar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jerrypeng/incubator-pulsar/labels{/name}","releases_url":"https://api.github.com/repos/jerrypeng/incubator-pulsar/releases{/id}","deployments_url":"https://api.github.com/repos/jerrypeng/incubator-pulsar/deployments","created_at":"2017-10-27T19:42:17Z","updated_at":"2018-05-02T21:54:45Z","pushed_at":"2018-05-10T18:35:49Z","git_url":"git://github.com/jerrypeng/incubator-pulsar.git","ssh_url":"git@github.com:jerrypeng/incubator-pulsar.git","clone_url":"https://github.com/jerrypeng/incubator-pulsar.git","svn_url":"https://github.com/jerrypeng/incubator-pulsar","homepage":"https://pulsar.incubator.apache.org","size":24710,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"f53562755b033062e5774592b5276da66ec2a752","user":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","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":62117812,"name":"incubator-pulsar","full_name":"apache/incubator-pulsar","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","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/incubator-pulsar","description":"Pulsar - distributed pub-sub messaging system","fork":false,"url":"https://api.github.com/repos/apache/incubator-pulsar","forks_url":"https://api.github.com/repos/apache/incubator-pulsar/forks","keys_url":"https://api.github.com/repos/apache/incubator-pulsar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/incubator-pulsar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/incubator-pulsar/teams","hooks_url":"https://api.github.com/repos/apache/incubator-pulsar/hooks","issue_events_url":"https://api.github.com/repos/apache/incubator-pulsar/issues/events{/number}","events_url":"https://api.github.com/repos/apache/incubator-pulsar/events","assignees_url":"https://api.github.com/repos/apache/incubator-pulsar/assignees{/user}","branches_url":"https://api.github.com/repos/apache/incubator-pulsar/branches{/branch}","tags_url":"https://api.github.com/repos/apache/incubator-pulsar/tags","blobs_url":"https://api.github.com/repos/apache/incubator-pulsar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/incubator-pulsar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/incubator-pulsar/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/incubator-pulsar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/incubator-pulsar/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/incubator-pulsar/languages","stargazers_url":"https://api.github.com/repos/apache/incubator-pulsar/stargazers","contributors_url":"https://api.github.com/repos/apache/incubator-pulsar/contributors","subscribers_url":"https://api.github.com/repos/apache/incubator-pulsar/subscribers","subscription_url":"https://api.github.com/repos/apache/incubator-pulsar/subscription","commits_url":"https://api.github.com/repos/apache/incubator-pulsar/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/incubator-pulsar/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/incubator-pulsar/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/incubator-pulsar/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/incubator-pulsar/contents/{+path}","compare_url":"https://api.github.com/repos/apache/incubator-pulsar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/incubator-pulsar/merges","archive_url":"https://api.github.com/repos/apache/incubator-pulsar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/incubator-pulsar/downloads","issues_url":"https://api.github.com/repos/apache/incubator-pulsar/issues{/number}","pulls_url":"https://api.github.com/repos/apache/incubator-pulsar/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/incubator-pulsar/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/incubator-pulsar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/incubator-pulsar/labels{/name}","releases_url":"https://api.github.com/repos/apache/incubator-pulsar/releases{/id}","deployments_url":"https://api.github.com/repos/apache/incubator-pulsar/deployments","created_at":"2016-06-28T07:00:03Z","updated_at":"2018-05-10T23:01:21Z","pushed_at":"2018-05-11T01:34:36Z","git_url":"git://github.com/apache/incubator-pulsar.git","ssh_url":"git@github.com:apache/incubator-pulsar.git","clone_url":"https://github.com/apache/incubator-pulsar.git","svn_url":"https://github.com/apache/incubator-pulsar","homepage":"https://pulsar.incubator.apache.org","size":29801,"stargazers_count":1673,"watchers_count":1673,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":356,"mirror_url":null,"archived":false,"open_issues_count":156,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":356,"open_issues":156,"watchers":1673,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-pulsar/pulls/1758"},"html":{"href":"https://github.com/apache/incubator-pulsar/pull/1758"},"issue":{"href":"https://api.github.com/repos/apache/incubator-pulsar/issues/1758"},"comments":{"href":"https://api.github.com/repos/apache/incubator-pulsar/issues/1758/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/incubator-pulsar/pulls/1758/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/incubator-pulsar/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/incubator-pulsar/pulls/1758/commits"},"statuses":{"href":"https://api.github.com/repos/apache/incubator-pulsar/statuses/aeae38b1add965a2ca79871157bd00da4faef4ed"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"srkukarni"}}