{"action":"created","comment":{"url":"https://api.github.com/repos/apache/flink/pulls/comments/23163896","id":23163896,"diff_hunk":"@@ -56,218 +56,135 @@\n \n \t\n \tpublic DualInputSemanticProperties() {\n-\t\tinit();\n+\t\tthis.fieldMapping1 = new HashMap<Integer,FieldSet>();\n+\t\tthis.fieldMapping2 = new HashMap<Integer,FieldSet>();\n+\t\tthis.readFields1 = null;\n+\t\tthis.readFields2 = null;\n \t}\n-\t\n-\t/**\n-\t * Adds, to the existing information, a field that is forwarded directly\n-\t * from the source record(s) in the first input to the destination\n-\t * record(s).\n-\t * \n-\t * @param sourceField the position in the source record(s) from the first input\n-\t * @param destinationField the position in the destination record(s)\n-\t */\n-\tpublic void addForwardedField1(int sourceField, int destinationField) {\n-\t\tFieldSet old = this.forwardedFields1.get(sourceField);\n-\t\tif (old == null) {\n-\t\t\told = FieldSet.EMPTY_SET;\n+\n+\t@Override\n+\tpublic FieldSet getTargetFields(int input, int sourceField) {\n+\n+\t\tif (input != 0 && input != 1) {\n+\t\t\tthrow new IndexOutOfBoundsException();\n+\t\t} else if (input == 0) {\n+\n+\t\t\treturn fieldMapping1.get(sourceField);\n+\t\t} else {\n+\t\t\treturn fieldMapping2.get(sourceField);\n \t\t}\n-\t\t\n-\t\tFieldSet fs = old.addField(destinationField);\n-\t\tthis.forwardedFields1.put(sourceField, fs);\n \t}\n-\t\n-\t/**\n-\t * Adds, to the existing information, a field that is forwarded directly\n-\t * from the source record(s) in the first input to multiple fields in\n-\t * the destination record(s).\n-\t * \n-\t * @param sourceField the position in the source record(s)\n-\t * @param destinationFields the position in the destination record(s)\n-\t */\n-\tpublic void addForwardedField1(int sourceField, FieldSet destinationFields) {\n-\t\tFieldSet old = this.forwardedFields1.get(sourceField);\n-\t\tif (old == null) {\n-\t\t\told = FieldSet.EMPTY_SET;\n+\n+\t@Override\n+\tpublic int getSourceField(int input, int targetField) {\n+\t\tMap<Integer, FieldSet> fieldMapping;\n+\n+\t\tif (input != 0 && input != 1) {\n+\t\t\tthrow new IndexOutOfBoundsException();\n+\t\t} else if (input == 0) {\n+\t\t\tfieldMapping = fieldMapping1;\n+\t\t} else {\n+\t\t\tfieldMapping = fieldMapping2;\n+\t\t}\n+\n+\t\tfor (int sourceField : fieldMapping.keySet()) {","path":"flink-core/src/main/java/org/apache/flink/api/common/operators/DualInputSemanticProperties.java","position":90,"original_position":90,"commit_id":"a6f50ac7238507c8bb8b8c1739170fa95ca8e7d6","original_commit_id":"a6f50ac7238507c8bb8b8c1739170fa95ca8e7d6","user":{"login":"fhueske","id":2388347,"avatar_url":"https://avatars.githubusercontent.com/u/2388347?v=3","gravatar_id":"","url":"https://api.github.com/users/fhueske","html_url":"https://github.com/fhueske","followers_url":"https://api.github.com/users/fhueske/followers","following_url":"https://api.github.com/users/fhueske/following{/other_user}","gists_url":"https://api.github.com/users/fhueske/gists{/gist_id}","starred_url":"https://api.github.com/users/fhueske/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fhueske/subscriptions","organizations_url":"https://api.github.com/users/fhueske/orgs","repos_url":"https://api.github.com/users/fhueske/repos","events_url":"https://api.github.com/users/fhueske/events{/privacy}","received_events_url":"https://api.github.com/users/fhueske/received_events","type":"User","site_admin":false},"body":"Good point","created_at":"2015-01-19T14:55:30Z","updated_at":"2015-01-19T14:55:30Z","html_url":"https://github.com/apache/flink/pull/311#discussion_r23163896","pull_request_url":"https://api.github.com/repos/apache/flink/pulls/311","_links":{"self":{"href":"https://api.github.com/repos/apache/flink/pulls/comments/23163896"},"html":{"href":"https://github.com/apache/flink/pull/311#discussion_r23163896"},"pull_request":{"href":"https://api.github.com/repos/apache/flink/pulls/311"}}},"pull_request":{"url":"https://api.github.com/repos/apache/flink/pulls/311","id":27390164,"html_url":"https://github.com/apache/flink/pull/311","diff_url":"https://github.com/apache/flink/pull/311.diff","patch_url":"https://github.com/apache/flink/pull/311.patch","issue_url":"https://api.github.com/repos/apache/flink/issues/311","number":311,"state":"open","locked":false,"title":"[FLINK-1328] Reworked semantic annotations","user":{"login":"fhueske","id":2388347,"avatar_url":"https://avatars.githubusercontent.com/u/2388347?v=3","gravatar_id":"","url":"https://api.github.com/users/fhueske","html_url":"https://github.com/fhueske","followers_url":"https://api.github.com/users/fhueske/followers","following_url":"https://api.github.com/users/fhueske/following{/other_user}","gists_url":"https://api.github.com/users/fhueske/gists{/gist_id}","starred_url":"https://api.github.com/users/fhueske/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fhueske/subscriptions","organizations_url":"https://api.github.com/users/fhueske/orgs","repos_url":"https://api.github.com/users/fhueske/repos","events_url":"https://api.github.com/users/fhueske/events{/privacy}","received_events_url":"https://api.github.com/users/fhueske/received_events","type":"User","site_admin":false},"body":"This PR is based on #83\r\n\r\nOpen Issues:\r\n- Naming of class annotations (`ConstantFields`, `ConstantFieldsExcept`, `ReadFields`, ...) and API methods (`withConstantSet()`, ...). Constant fields and constant set is a bit inconsistent. Do we want to keep the term *constant* or should we go with preserved or forwarded fields? Right now, the original naming is preserved. \r\n- Documentation except for JavaDocs not done yet.","created_at":"2015-01-14T22:36:32Z","updated_at":"2015-01-19T14:55:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6d3005b926ae889edc622fd2c7c39a038b666352","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/flink/pulls/311/commits","review_comments_url":"https://api.github.com/repos/apache/flink/pulls/311/comments","review_comment_url":"https://api.github.com/repos/apache/flink/pulls/comments/{number}","comments_url":"https://api.github.com/repos/apache/flink/issues/311/comments","statuses_url":"https://api.github.com/repos/apache/flink/statuses/a6f50ac7238507c8bb8b8c1739170fa95ca8e7d6","head":{"label":"fhueske:constantFields","ref":"constantFields","sha":"a6f50ac7238507c8bb8b8c1739170fa95ca8e7d6","user":{"login":"fhueske","id":2388347,"avatar_url":"https://avatars.githubusercontent.com/u/2388347?v=3","gravatar_id":"","url":"https://api.github.com/users/fhueske","html_url":"https://github.com/fhueske","followers_url":"https://api.github.com/users/fhueske/followers","following_url":"https://api.github.com/users/fhueske/following{/other_user}","gists_url":"https://api.github.com/users/fhueske/gists{/gist_id}","starred_url":"https://api.github.com/users/fhueske/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fhueske/subscriptions","organizations_url":"https://api.github.com/users/fhueske/orgs","repos_url":"https://api.github.com/users/fhueske/repos","events_url":"https://api.github.com/users/fhueske/events{/privacy}","received_events_url":"https://api.github.com/users/fhueske/received_events","type":"User","site_admin":false},"repo":{"id":22737163,"name":"flink","full_name":"fhueske/flink","owner":{"login":"fhueske","id":2388347,"avatar_url":"https://avatars.githubusercontent.com/u/2388347?v=3","gravatar_id":"","url":"https://api.github.com/users/fhueske","html_url":"https://github.com/fhueske","followers_url":"https://api.github.com/users/fhueske/followers","following_url":"https://api.github.com/users/fhueske/following{/other_user}","gists_url":"https://api.github.com/users/fhueske/gists{/gist_id}","starred_url":"https://api.github.com/users/fhueske/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fhueske/subscriptions","organizations_url":"https://api.github.com/users/fhueske/orgs","repos_url":"https://api.github.com/users/fhueske/repos","events_url":"https://api.github.com/users/fhueske/events{/privacy}","received_events_url":"https://api.github.com/users/fhueske/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fhueske/flink","description":"Mirror of Apache Flink","fork":true,"url":"https://api.github.com/repos/fhueske/flink","forks_url":"https://api.github.com/repos/fhueske/flink/forks","keys_url":"https://api.github.com/repos/fhueske/flink/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fhueske/flink/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fhueske/flink/teams","hooks_url":"https://api.github.com/repos/fhueske/flink/hooks","issue_events_url":"https://api.github.com/repos/fhueske/flink/issues/events{/number}","events_url":"https://api.github.com/repos/fhueske/flink/events","assignees_url":"https://api.github.com/repos/fhueske/flink/assignees{/user}","branches_url":"https://api.github.com/repos/fhueske/flink/branches{/branch}","tags_url":"https://api.github.com/repos/fhueske/flink/tags","blobs_url":"https://api.github.com/repos/fhueske/flink/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fhueske/flink/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fhueske/flink/git/refs{/sha}","trees_url":"https://api.github.com/repos/fhueske/flink/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fhueske/flink/statuses/{sha}","languages_url":"https://api.github.com/repos/fhueske/flink/languages","stargazers_url":"https://api.github.com/repos/fhueske/flink/stargazers","contributors_url":"https://api.github.com/repos/fhueske/flink/contributors","subscribers_url":"https://api.github.com/repos/fhueske/flink/subscribers","subscription_url":"https://api.github.com/repos/fhueske/flink/subscription","commits_url":"https://api.github.com/repos/fhueske/flink/commits{/sha}","git_commits_url":"https://api.github.com/repos/fhueske/flink/git/commits{/sha}","comments_url":"https://api.github.com/repos/fhueske/flink/comments{/number}","issue_comment_url":"https://api.github.com/repos/fhueske/flink/issues/comments/{number}","contents_url":"https://api.github.com/repos/fhueske/flink/contents/{+path}","compare_url":"https://api.github.com/repos/fhueske/flink/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fhueske/flink/merges","archive_url":"https://api.github.com/repos/fhueske/flink/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fhueske/flink/downloads","issues_url":"https://api.github.com/repos/fhueske/flink/issues{/number}","pulls_url":"https://api.github.com/repos/fhueske/flink/pulls{/number}","milestones_url":"https://api.github.com/repos/fhueske/flink/milestones{/number}","notifications_url":"https://api.github.com/repos/fhueske/flink/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fhueske/flink/labels{/name}","releases_url":"https://api.github.com/repos/fhueske/flink/releases{/id}","created_at":"2014-08-07T21:30:01Z","updated_at":"2015-01-15T16:22:38Z","pushed_at":"2015-01-16T21:55:35Z","git_url":"git://github.com/fhueske/flink.git","ssh_url":"git@github.com:fhueske/flink.git","clone_url":"https://github.com/fhueske/flink.git","svn_url":"https://github.com/fhueske/flink","homepage":null,"size":39053,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"be0359821ae411f8673f5053f9af010514d41e1e","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":20587599,"name":"flink","full_name":"apache/flink","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/flink","description":"Mirror of Apache Flink","fork":false,"url":"https://api.github.com/repos/apache/flink","forks_url":"https://api.github.com/repos/apache/flink/forks","keys_url":"https://api.github.com/repos/apache/flink/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/flink/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/flink/teams","hooks_url":"https://api.github.com/repos/apache/flink/hooks","issue_events_url":"https://api.github.com/repos/apache/flink/issues/events{/number}","events_url":"https://api.github.com/repos/apache/flink/events","assignees_url":"https://api.github.com/repos/apache/flink/assignees{/user}","branches_url":"https://api.github.com/repos/apache/flink/branches{/branch}","tags_url":"https://api.github.com/repos/apache/flink/tags","blobs_url":"https://api.github.com/repos/apache/flink/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/flink/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/flink/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/flink/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/flink/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/flink/languages","stargazers_url":"https://api.github.com/repos/apache/flink/stargazers","contributors_url":"https://api.github.com/repos/apache/flink/contributors","subscribers_url":"https://api.github.com/repos/apache/flink/subscribers","subscription_url":"https://api.github.com/repos/apache/flink/subscription","commits_url":"https://api.github.com/repos/apache/flink/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/flink/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/flink/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/flink/issues/comments/{number}","contents_url":"https://api.github.com/repos/apache/flink/contents/{+path}","compare_url":"https://api.github.com/repos/apache/flink/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/flink/merges","archive_url":"https://api.github.com/repos/apache/flink/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/flink/downloads","issues_url":"https://api.github.com/repos/apache/flink/issues{/number}","pulls_url":"https://api.github.com/repos/apache/flink/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/flink/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/flink/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/flink/labels{/name}","releases_url":"https://api.github.com/repos/apache/flink/releases{/id}","created_at":"2014-06-07T07:00:10Z","updated_at":"2015-01-19T14:13:23Z","pushed_at":"2015-01-19T14:13:23Z","git_url":"git://github.com/apache/flink.git","ssh_url":"git@github.com:apache/flink.git","clone_url":"https://github.com/apache/flink.git","svn_url":"https://github.com/apache/flink","homepage":null,"size":2388878,"stargazers_count":202,"watchers_count":202,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":121,"mirror_url":"git://git.apache.org/incubator-flink.git","open_issues_count":39,"forks":121,"open_issues":39,"watchers":202,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/flink/pulls/311"},"html":{"href":"https://github.com/apache/flink/pull/311"},"issue":{"href":"https://api.github.com/repos/apache/flink/issues/311"},"comments":{"href":"https://api.github.com/repos/apache/flink/issues/311/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/flink/pulls/311/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/flink/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/apache/flink/pulls/311/commits"},"statuses":{"href":"https://api.github.com/repos/apache/flink/statuses/a6f50ac7238507c8bb8b8c1739170fa95ca8e7d6"}}}}