{"action":"created","comment":{"url":"https://api.github.com/repos/apache/flink/pulls/comments/29854969","id":29854969,"diff_hunk":"@@ -0,0 +1,75 @@\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.streaming.runtime.tasks;\n+\n+import org.apache.flink.streaming.api.operators.StreamSource;\n+import org.apache.flink.util.StringUtils;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+\n+public class SourceStreamTask<OUT> extends StreamTask<OUT, StreamSource<OUT>> {\n+\n+\tprivate static final Logger LOG = LoggerFactory.getLogger(SourceStreamTask.class);\n+\n+\t@Override\n+\tpublic void invoke() throws Exception {\n+\t\tthis.isRunning = true;\n+\n+\t\tboolean operatorOpen = false;\n+\n+\t\tif (LOG.isDebugEnabled()) {\n+\t\t\tLOG.debug(\"Task {} invoked\", getName());\n+\t\t}\n+\n+\t\ttry {\n+\t\t\topenOperator();\n+\t\t\toperatorOpen = true;\n+\n+\t\t\tstreamOperator.run();\n+\n+\t\t\tcloseOperator();\n+\t\t\toperatorOpen = false;\n+\n+\t\t\tif (LOG.isDebugEnabled()) {\n+\t\t\t\tLOG.debug(\"Task {} invocation finished\", getName());\n+\t\t\t}\n+\n+\t\t} catch (Exception e) {\n+\n+\t\t\tif (operatorOpen) {\n+\t\t\t\ttry {\n+\t\t\t\t\tcloseOperator();\n+\t\t\t\t} catch (Throwable t) {\n+\t\t\t\t\t// TODO: why are we not doing anything here?","path":"flink-staging/flink-streaming/flink-streaming-core/src/main/java/org/apache/flink/streaming/runtime/tasks/SourceStreamTask.java","position":59,"original_position":59,"commit_id":"4ada4581494f522f34c7e3c5761ece39f662726b","original_commit_id":"a4be5138c6262e104d83263d6e4800e416d6fd4a","user":{"login":"rmetzger","id":89049,"avatar_url":"https://avatars.githubusercontent.com/u/89049?v=3","gravatar_id":"","url":"https://api.github.com/users/rmetzger","html_url":"https://github.com/rmetzger","followers_url":"https://api.github.com/users/rmetzger/followers","following_url":"https://api.github.com/users/rmetzger/following{/other_user}","gists_url":"https://api.github.com/users/rmetzger/gists{/gist_id}","starred_url":"https://api.github.com/users/rmetzger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmetzger/subscriptions","organizations_url":"https://api.github.com/users/rmetzger/orgs","repos_url":"https://api.github.com/users/rmetzger/repos","events_url":"https://api.github.com/users/rmetzger/events{/privacy}","received_events_url":"https://api.github.com/users/rmetzger/received_events","type":"User","site_admin":false},"body":"log info","created_at":"2015-05-07T14:11:21Z","updated_at":"2015-05-07T14:11:21Z","html_url":"https://github.com/apache/flink/pull/659#discussion_r29854969","pull_request_url":"https://api.github.com/repos/apache/flink/pulls/659","_links":{"self":{"href":"https://api.github.com/repos/apache/flink/pulls/comments/29854969"},"html":{"href":"https://github.com/apache/flink/pull/659#discussion_r29854969"},"pull_request":{"href":"https://api.github.com/repos/apache/flink/pulls/659"}}},"pull_request":{"url":"https://api.github.com/repos/apache/flink/pulls/659","id":34910419,"html_url":"https://github.com/apache/flink/pull/659","diff_url":"https://github.com/apache/flink/pull/659.diff","patch_url":"https://github.com/apache/flink/pull/659.patch","issue_url":"https://api.github.com/repos/apache/flink/issues/659","number":659,"state":"open","locked":false,"title":"[FLINK-1977] Rework Stream Operators to always be push based","user":{"login":"aljoscha","id":68551,"avatar_url":"https://avatars.githubusercontent.com/u/68551?v=3","gravatar_id":"","url":"https://api.github.com/users/aljoscha","html_url":"https://github.com/aljoscha","followers_url":"https://api.github.com/users/aljoscha/followers","following_url":"https://api.github.com/users/aljoscha/following{/other_user}","gists_url":"https://api.github.com/users/aljoscha/gists{/gist_id}","starred_url":"https://api.github.com/users/aljoscha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aljoscha/subscriptions","organizations_url":"https://api.github.com/users/aljoscha/orgs","repos_url":"https://api.github.com/users/aljoscha/repos","events_url":"https://api.github.com/users/aljoscha/events{/privacy}","received_events_url":"https://api.github.com/users/aljoscha/received_events","type":"User","site_admin":false},"body":"Operator is now an interface that has method receiveElement() that must be used for processing incoming data. Operators do now know about input iterators and serialisation, all of this is handled by the StreamTask. Operators do also not know whether they are chained or now, because the interface is the same in both cases.\r\n\r\nThis change moves the \"inner loops\" of operators into the StreamTask, so that it has the control to suspend processing for checkpointing. This also means, that data sources now no longer have a run() method but two methods reachedEnd() and next(), similar to data sources in the batch API.\r\n\r\nThis work is a requirement for several paths of development:\r\n1. Using event time and low watermarks for window processing\r\n2. Checkpointing for fault tolerance","created_at":"2015-05-07T12:31:14Z","updated_at":"2015-05-07T14:11:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0729ac9508dd94af75696e3645e677422beca27d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/flink/pulls/659/commits","review_comments_url":"https://api.github.com/repos/apache/flink/pulls/659/comments","review_comment_url":"https://api.github.com/repos/apache/flink/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/flink/issues/659/comments","statuses_url":"https://api.github.com/repos/apache/flink/statuses/4ada4581494f522f34c7e3c5761ece39f662726b","head":{"label":"aljoscha:event-time","ref":"event-time","sha":"4ada4581494f522f34c7e3c5761ece39f662726b","user":{"login":"aljoscha","id":68551,"avatar_url":"https://avatars.githubusercontent.com/u/68551?v=3","gravatar_id":"","url":"https://api.github.com/users/aljoscha","html_url":"https://github.com/aljoscha","followers_url":"https://api.github.com/users/aljoscha/followers","following_url":"https://api.github.com/users/aljoscha/following{/other_user}","gists_url":"https://api.github.com/users/aljoscha/gists{/gist_id}","starred_url":"https://api.github.com/users/aljoscha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aljoscha/subscriptions","organizations_url":"https://api.github.com/users/aljoscha/orgs","repos_url":"https://api.github.com/users/aljoscha/repos","events_url":"https://api.github.com/users/aljoscha/events{/privacy}","received_events_url":"https://api.github.com/users/aljoscha/received_events","type":"User","site_admin":false},"repo":{"id":22066189,"name":"flink","full_name":"aljoscha/flink","owner":{"login":"aljoscha","id":68551,"avatar_url":"https://avatars.githubusercontent.com/u/68551?v=3","gravatar_id":"","url":"https://api.github.com/users/aljoscha","html_url":"https://github.com/aljoscha","followers_url":"https://api.github.com/users/aljoscha/followers","following_url":"https://api.github.com/users/aljoscha/following{/other_user}","gists_url":"https://api.github.com/users/aljoscha/gists{/gist_id}","starred_url":"https://api.github.com/users/aljoscha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aljoscha/subscriptions","organizations_url":"https://api.github.com/users/aljoscha/orgs","repos_url":"https://api.github.com/users/aljoscha/repos","events_url":"https://api.github.com/users/aljoscha/events{/privacy}","received_events_url":"https://api.github.com/users/aljoscha/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aljoscha/flink","description":"Mirror of Apache Flink","fork":true,"url":"https://api.github.com/repos/aljoscha/flink","forks_url":"https://api.github.com/repos/aljoscha/flink/forks","keys_url":"https://api.github.com/repos/aljoscha/flink/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aljoscha/flink/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aljoscha/flink/teams","hooks_url":"https://api.github.com/repos/aljoscha/flink/hooks","issue_events_url":"https://api.github.com/repos/aljoscha/flink/issues/events{/number}","events_url":"https://api.github.com/repos/aljoscha/flink/events","assignees_url":"https://api.github.com/repos/aljoscha/flink/assignees{/user}","branches_url":"https://api.github.com/repos/aljoscha/flink/branches{/branch}","tags_url":"https://api.github.com/repos/aljoscha/flink/tags","blobs_url":"https://api.github.com/repos/aljoscha/flink/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aljoscha/flink/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aljoscha/flink/git/refs{/sha}","trees_url":"https://api.github.com/repos/aljoscha/flink/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aljoscha/flink/statuses/{sha}","languages_url":"https://api.github.com/repos/aljoscha/flink/languages","stargazers_url":"https://api.github.com/repos/aljoscha/flink/stargazers","contributors_url":"https://api.github.com/repos/aljoscha/flink/contributors","subscribers_url":"https://api.github.com/repos/aljoscha/flink/subscribers","subscription_url":"https://api.github.com/repos/aljoscha/flink/subscription","commits_url":"https://api.github.com/repos/aljoscha/flink/commits{/sha}","git_commits_url":"https://api.github.com/repos/aljoscha/flink/git/commits{/sha}","comments_url":"https://api.github.com/repos/aljoscha/flink/comments{/number}","issue_comment_url":"https://api.github.com/repos/aljoscha/flink/issues/comments{/number}","contents_url":"https://api.github.com/repos/aljoscha/flink/contents/{+path}","compare_url":"https://api.github.com/repos/aljoscha/flink/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aljoscha/flink/merges","archive_url":"https://api.github.com/repos/aljoscha/flink/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aljoscha/flink/downloads","issues_url":"https://api.github.com/repos/aljoscha/flink/issues{/number}","pulls_url":"https://api.github.com/repos/aljoscha/flink/pulls{/number}","milestones_url":"https://api.github.com/repos/aljoscha/flink/milestones{/number}","notifications_url":"https://api.github.com/repos/aljoscha/flink/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aljoscha/flink/labels{/name}","releases_url":"https://api.github.com/repos/aljoscha/flink/releases{/id}","created_at":"2014-07-21T13:51:54Z","updated_at":"2015-04-29T15:29:18Z","pushed_at":"2015-05-07T14:10:08Z","git_url":"git://github.com/aljoscha/flink.git","ssh_url":"git@github.com:aljoscha/flink.git","clone_url":"https://github.com/aljoscha/flink.git","svn_url":"https://github.com/aljoscha/flink","homepage":null,"size":48317,"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":"ddb2b34704a410491d428dec2ade0cb20a58ed80","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-05-07T14:07:46Z","pushed_at":"2015-05-07T14:10:09Z","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":3170668,"stargazers_count":387,"watchers_count":387,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":237,"mirror_url":"git://git.apache.org/incubator-flink.git","open_issues_count":44,"forks":237,"open_issues":44,"watchers":387,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/flink/pulls/659"},"html":{"href":"https://github.com/apache/flink/pull/659"},"issue":{"href":"https://api.github.com/repos/apache/flink/issues/659"},"comments":{"href":"https://api.github.com/repos/apache/flink/issues/659/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/flink/pulls/659/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/flink/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/flink/pulls/659/commits"},"statuses":{"href":"https://api.github.com/repos/apache/flink/statuses/4ada4581494f522f34c7e3c5761ece39f662726b"}}}}