{"action":"created","comment":{"url":"https://api.github.com/repos/apache/flink/pulls/comments/45248963","id":45248963,"diff_hunk":"@@ -0,0 +1,194 @@\n+/*\n+ * Licensed to the Apache Software Foundation (ASF) under one\n+ * or more contributor license agreements.  See the NOTICE file\n+ * distributed with this work for additional information\n+ * regarding copyright ownership.  The ASF licenses this file\n+ * to you under the Apache License, Version 2.0 (the\n+ * \"License\"); you may not use this file except in compliance\n+ * with the License.  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 org.apache.flink.api.java.typeutils.runtime;\n+\n+import java.io.IOException;\n+\n+import org.apache.flink.api.common.typeutils.TypeSerializer;\n+import org.apache.flink.api.java.typeutils.Either;\n+import org.apache.flink.core.memory.DataInputView;\n+import org.apache.flink.core.memory.DataOutputView;\n+\n+/**\n+ * A {@link TypeSerializer} for the {@ link Either} type of the Java class.\n+ *\n+ * @param <L> the Left value type\n+ * @param <R> the Right value type\n+ */\n+public class EitherSerializer<L, R> extends TypeSerializer<Either<L, R>> {\n+\n+\tprivate static final long serialVersionUID = 1L;\n+\n+\tprivate final Class<Either<L, R>> typeClass;","path":"flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/EitherSerializer.java","position":38,"original_position":38,"commit_id":"c23cfaa0bfb86d35c19137caacd3152d506e9072","original_commit_id":"c23cfaa0bfb86d35c19137caacd3152d506e9072","user":{"login":"StephanEwen","id":1727146,"avatar_url":"https://avatars.githubusercontent.com/u/1727146?v=3","gravatar_id":"","url":"https://api.github.com/users/StephanEwen","html_url":"https://github.com/StephanEwen","followers_url":"https://api.github.com/users/StephanEwen/followers","following_url":"https://api.github.com/users/StephanEwen/following{/other_user}","gists_url":"https://api.github.com/users/StephanEwen/gists{/gist_id}","starred_url":"https://api.github.com/users/StephanEwen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StephanEwen/subscriptions","organizations_url":"https://api.github.com/users/StephanEwen/orgs","repos_url":"https://api.github.com/users/StephanEwen/repos","events_url":"https://api.github.com/users/StephanEwen/events{/privacy}","received_events_url":"https://api.github.com/users/StephanEwen/received_events","type":"User","site_admin":false},"body":"You can probably drop this class as well, I don't see it needed anywhere.","created_at":"2015-11-18T19:39:58Z","updated_at":"2015-11-18T19:39:58Z","html_url":"https://github.com/apache/flink/pull/1371#discussion_r45248963","pull_request_url":"https://api.github.com/repos/apache/flink/pulls/1371","_links":{"self":{"href":"https://api.github.com/repos/apache/flink/pulls/comments/45248963"},"html":{"href":"https://github.com/apache/flink/pull/1371#discussion_r45248963"},"pull_request":{"href":"https://api.github.com/repos/apache/flink/pulls/1371"}}},"pull_request":{"url":"https://api.github.com/repos/apache/flink/pulls/1371","id":50993910,"html_url":"https://github.com/apache/flink/pull/1371","diff_url":"https://github.com/apache/flink/pull/1371.diff","patch_url":"https://github.com/apache/flink/pull/1371.patch","issue_url":"https://api.github.com/repos/apache/flink/issues/1371","number":1371,"state":"open","locked":false,"title":"[FLINK-3002] Add Either type to the Java API","user":{"login":"vasia","id":498957,"avatar_url":"https://avatars.githubusercontent.com/u/498957?v=3","gravatar_id":"","url":"https://api.github.com/users/vasia","html_url":"https://github.com/vasia","followers_url":"https://api.github.com/users/vasia/followers","following_url":"https://api.github.com/users/vasia/following{/other_user}","gists_url":"https://api.github.com/users/vasia/gists{/gist_id}","starred_url":"https://api.github.com/users/vasia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vasia/subscriptions","organizations_url":"https://api.github.com/users/vasia/orgs","repos_url":"https://api.github.com/users/vasia/repos","events_url":"https://api.github.com/users/vasia/events{/privacy}","received_events_url":"https://api.github.com/users/vasia/received_events","type":"User","site_admin":false},"body":"Implemented as discussed in the corresponding JIRA.\r\n\r\nI haven't added this type to the docs yet. The data types section in the programming guide contains the following categories:\r\n- Java Tuples and Scala Case Classes\r\n- Java POJOs\r\n- Primitive Types\r\n- Regular Classes\r\n- Values\r\n- Hadoop Writables\r\n\r\nI don't think `Either` belongs to any of these. Shall I add it as its own category?","created_at":"2015-11-17T19:40:58Z","updated_at":"2015-11-18T19:39:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4039da5f1ed7c3933ec6955ace858a0ba060522d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/flink/pulls/1371/commits","review_comments_url":"https://api.github.com/repos/apache/flink/pulls/1371/comments","review_comment_url":"https://api.github.com/repos/apache/flink/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/flink/issues/1371/comments","statuses_url":"https://api.github.com/repos/apache/flink/statuses/c23cfaa0bfb86d35c19137caacd3152d506e9072","head":{"label":"vasia:either-java-type","ref":"either-java-type","sha":"c23cfaa0bfb86d35c19137caacd3152d506e9072","user":{"login":"vasia","id":498957,"avatar_url":"https://avatars.githubusercontent.com/u/498957?v=3","gravatar_id":"","url":"https://api.github.com/users/vasia","html_url":"https://github.com/vasia","followers_url":"https://api.github.com/users/vasia/followers","following_url":"https://api.github.com/users/vasia/following{/other_user}","gists_url":"https://api.github.com/users/vasia/gists{/gist_id}","starred_url":"https://api.github.com/users/vasia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vasia/subscriptions","organizations_url":"https://api.github.com/users/vasia/orgs","repos_url":"https://api.github.com/users/vasia/repos","events_url":"https://api.github.com/users/vasia/events{/privacy}","received_events_url":"https://api.github.com/users/vasia/received_events","type":"User","site_admin":false},"repo":{"id":20796928,"name":"flink","full_name":"vasia/flink","owner":{"login":"vasia","id":498957,"avatar_url":"https://avatars.githubusercontent.com/u/498957?v=3","gravatar_id":"","url":"https://api.github.com/users/vasia","html_url":"https://github.com/vasia","followers_url":"https://api.github.com/users/vasia/followers","following_url":"https://api.github.com/users/vasia/following{/other_user}","gists_url":"https://api.github.com/users/vasia/gists{/gist_id}","starred_url":"https://api.github.com/users/vasia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vasia/subscriptions","organizations_url":"https://api.github.com/users/vasia/orgs","repos_url":"https://api.github.com/users/vasia/repos","events_url":"https://api.github.com/users/vasia/events{/privacy}","received_events_url":"https://api.github.com/users/vasia/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vasia/flink","description":"Mirror of Apache Flink","fork":true,"url":"https://api.github.com/repos/vasia/flink","forks_url":"https://api.github.com/repos/vasia/flink/forks","keys_url":"https://api.github.com/repos/vasia/flink/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vasia/flink/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vasia/flink/teams","hooks_url":"https://api.github.com/repos/vasia/flink/hooks","issue_events_url":"https://api.github.com/repos/vasia/flink/issues/events{/number}","events_url":"https://api.github.com/repos/vasia/flink/events","assignees_url":"https://api.github.com/repos/vasia/flink/assignees{/user}","branches_url":"https://api.github.com/repos/vasia/flink/branches{/branch}","tags_url":"https://api.github.com/repos/vasia/flink/tags","blobs_url":"https://api.github.com/repos/vasia/flink/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vasia/flink/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vasia/flink/git/refs{/sha}","trees_url":"https://api.github.com/repos/vasia/flink/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vasia/flink/statuses/{sha}","languages_url":"https://api.github.com/repos/vasia/flink/languages","stargazers_url":"https://api.github.com/repos/vasia/flink/stargazers","contributors_url":"https://api.github.com/repos/vasia/flink/contributors","subscribers_url":"https://api.github.com/repos/vasia/flink/subscribers","subscription_url":"https://api.github.com/repos/vasia/flink/subscription","commits_url":"https://api.github.com/repos/vasia/flink/commits{/sha}","git_commits_url":"https://api.github.com/repos/vasia/flink/git/commits{/sha}","comments_url":"https://api.github.com/repos/vasia/flink/comments{/number}","issue_comment_url":"https://api.github.com/repos/vasia/flink/issues/comments{/number}","contents_url":"https://api.github.com/repos/vasia/flink/contents/{+path}","compare_url":"https://api.github.com/repos/vasia/flink/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vasia/flink/merges","archive_url":"https://api.github.com/repos/vasia/flink/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vasia/flink/downloads","issues_url":"https://api.github.com/repos/vasia/flink/issues{/number}","pulls_url":"https://api.github.com/repos/vasia/flink/pulls{/number}","milestones_url":"https://api.github.com/repos/vasia/flink/milestones{/number}","notifications_url":"https://api.github.com/repos/vasia/flink/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vasia/flink/labels{/name}","releases_url":"https://api.github.com/repos/vasia/flink/releases{/id}","created_at":"2014-06-13T08:09:41Z","updated_at":"2015-01-16T16:11:39Z","pushed_at":"2015-11-18T16:18:58Z","git_url":"git://github.com/vasia/flink.git","ssh_url":"git@github.com:vasia/flink.git","clone_url":"https://github.com/vasia/flink.git","svn_url":"https://github.com/vasia/flink","homepage":null,"size":66918,"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":"master"}},"base":{"label":"apache:master","ref":"master","sha":"a45212d2b18cc12e3c314ed43e8d19943693deed","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-11-18T19:31:58Z","pushed_at":"2015-11-18T19:35:26Z","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":84766,"stargazers_count":743,"watchers_count":743,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":505,"mirror_url":"git://git.apache.org/incubator-flink.git","open_issues_count":82,"forks":505,"open_issues":82,"watchers":743,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/flink/pulls/1371"},"html":{"href":"https://github.com/apache/flink/pull/1371"},"issue":{"href":"https://api.github.com/repos/apache/flink/issues/1371"},"comments":{"href":"https://api.github.com/repos/apache/flink/issues/1371/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/flink/pulls/1371/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/flink/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/flink/pulls/1371/commits"},"statuses":{"href":"https://api.github.com/repos/apache/flink/statuses/c23cfaa0bfb86d35c19137caacd3152d506e9072"}}}}